cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PythonObjectsWrappers.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023 Laurent Forthomme
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef CepGenAddOns_BoostWrapper_PythonObjectsWrappers_h
20#define CepGenAddOns_BoostWrapper_PythonObjectsWrappers_h
21
22#include <boost/python/wrapper.hpp>
23
26
27namespace py = boost::python;
28
29struct PartonFluxWrap : cepgen::PartonFlux, py::wrapper<cepgen::PartonFlux> {
30 bool ktFactorised() const override {
31 if (py::override ov = this->get_override("ktFactorised"))
32 return ov();
34 }
35 bool fragmenting() const override {
36 if (py::override ov = this->get_override("fragmenting"))
37 return ov();
39 }
40 cepgen::pdgid_t partonPdgId() const override {
41 if (py::override ov = this->get_override("partonPdgId"))
42 return ov();
44 }
45 //double mass2() const override { return this->get_override("mass2")(); }
46};
47
48struct KTFluxWrap : cepgen::KTFlux, py::wrapper<cepgen::KTFlux> {
49 double fluxMX2(double x, double kt2, double mx2) const override {
50 if (py::override ov = this->get_override("fluxMX2"))
51 return ov(x, kt2, mx2);
52 return cepgen::KTFlux::fluxMX2(x, kt2, mx2);
53 }
54 double fluxQ2(double x, double kt2, double q2) const override {
55 if (py::override ov = this->get_override("fluxQ2"))
56 return ov(x, kt2, q2);
57 return cepgen::KTFlux::fluxQ2(x, kt2, q2);
58 }
59};
60
61struct CollinearFluxWrap : cepgen::CollinearFlux, py::wrapper<cepgen::CollinearFlux> {
62 double fluxMX2(double x, double mx2) const override {
63 if (py::override ov = this->get_override("fluxMX2"))
64 return ov(x, mx2);
65 return cepgen::CollinearFlux::fluxMX2(x, mx2);
66 }
67 double fluxQ2(double x, double q2) const override {
68 if (py::override ov = this->get_override("fluxQ2"))
69 return ov(x, q2);
71 }
72};
73
74#endif
virtual double fluxQ2(double x, double q2) const
Compute the collinear flux for this x value and virtuality.
virtual double fluxMX2(double x, double mf2=0.) const
Compute the collinear flux for this x value and remnant mass.
virtual double fluxMX2(double x, double kt2, double mf2) const
Compute the kt-dependent flux for this x value and remnant mass.
Definition KTFlux.cpp:36
virtual double fluxQ2(double x, double kt2, double q2) const
Compute the kt-dependent flux for this x value and virtuality.
Definition KTFlux.cpp:32
virtual pdgid_t partonPdgId() const =0
Parton PDG identifier.
virtual bool fragmenting() const =0
Is initiator particle fragmenting after parton emission?
virtual bool ktFactorised() const
Is the flux parton kT-dependent?
Definition PartonFlux.h:32
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
double fluxQ2(double x, double q2) const override
Compute the collinear flux for this x value and virtuality.
double fluxMX2(double x, double mx2) const override
Compute the collinear flux for this x value and remnant mass.
double fluxQ2(double x, double kt2, double q2) const override
Compute the kt-dependent flux for this x value and virtuality.
double fluxMX2(double x, double kt2, double mx2) const override
Compute the kt-dependent flux for this x value and remnant mass.
bool fragmenting() const override
Is initiator particle fragmenting after parton emission?
cepgen::pdgid_t partonPdgId() const override
Parton PDG identifier.
bool ktFactorised() const override
Is the flux parton kT-dependent?