cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PartonsKTPhaseSpaceGenerator.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2016-2024 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
22#include "CepGen/Physics/Beam.h"
26
27namespace cepgen {
29 : PartonsPhaseSpaceGenerator(params), log_part_virt_(steer<bool>("logPartonVirtuality")) {}
30
31 void PartonsKTPhaseSpaceGenerator::initialise() {
32 const auto& kin = process().kinematics();
33
34 // pick a parton flux parameterisation for each beam
35 auto set_flux_properties = [](const Beam& beam, std::unique_ptr<PartonFlux>& flux) {
36 auto params = beam.partonFluxParameters();
37 const auto params_p_el = KTFluxFactory::get().describeParameters("BudnevElastic");
38 const auto params_p_inel = KTFluxFactory::get().describeParameters("BudnevInelastic");
39 const auto params_hi_el = KTFluxFactory::get().describeParameters("ElasticHeavyIon");
40 if (params.name().empty()) {
41 if (beam.elastic()) {
42 if (HeavyIon::isHI(beam.integerPdgId()))
43 params = params_hi_el.validate(params);
44 else
45 params = params_p_el.validate(params);
46 } else
47 params = params_p_inel.validate(params);
48 //TODO: fermions/pions
49 }
50 flux = KTFluxFactory::get().build(params);
51 if (!flux)
52 throw CG_FATAL("PartonsKTPhaseSpaceGenerator:init")
53 << "Failed to initiate a parton flux object with properties: " << params << ".";
54 if (!flux->ktFactorised())
55 throw CG_FATAL("PartonsKTPhaseSpaceGenerator:init")
56 << "Invalid incoming parton flux modelling: " << flux->name() << ".";
57 };
58 set_flux_properties(kin.incomingBeams().positive(), pos_flux_);
59 set_flux_properties(kin.incomingBeams().negative(), neg_flux_);
60
61 // register the incoming partons' transverse virtualities range
62 if (log_part_virt_) {
63 const auto log_lim_kt = kin.cuts().initial.qt.compute(std::log).truncate(Limits{-10., 10.});
64 process()
66 m_qt1_, proc::Process::Mapping::exponential, log_lim_kt, "qt1", "Positive-z parton virtuality")
68 m_qt2_, proc::Process::Mapping::exponential, log_lim_kt, "qt2", "Negative-z parton virtuality");
69 } else {
70 const auto lim_kt = kin.cuts().initial.qt.truncate(Limits{1.e-5, 1.e3});
71 process()
72 .defineVariable(m_qt1_, proc::Process::Mapping::linear, lim_kt, "qt1", "Positive-z parton virtuality")
73 .defineVariable(m_qt2_, proc::Process::Mapping::linear, lim_kt, "qt2", "Negative-z parton virtuality");
74 }
75
76 // register the incoming partons' azimuthal angles range
77 const auto lim_phi = kin.cuts().initial.phi.truncate(Limits{0., 2. * M_PI});
78 process()
80 m_phi_qt1_, proc::Process::Mapping::linear, lim_phi, "phi_qt1", "Positive-z parton azimuthal angle")
82 m_phi_qt2_, proc::Process::Mapping::linear, lim_phi, "phi_qt2", "Negative-z parton azimuthal angle");
83 }
84
86 // set the fully transverse kinematics (eta = 0) of initial partons
87 process().q1() = Momentum::fromPtEtaPhiE(m_qt1_, 0., m_phi_qt1_);
88 process().q2() = Momentum::fromPtEtaPhiE(m_qt2_, 0., m_phi_qt2_);
89 return true;
90 }
91
93 // factors 1/pi due to integration over d^2(kt1) d^2(kt2) instead of d(kt1^2) d(kt2^2)
94 return (positiveFlux<KTFlux>().fluxMX2(process().x1(), m_qt1_ * m_qt1_, process().mX2()) * M_1_PI * m_qt1_) *
95 (negativeFlux<KTFlux>().fluxMX2(process().x2(), m_qt2_ * m_qt2_, process().mY2()) * M_1_PI * m_qt2_);
96 }
97
100 desc.setDescription("KT-dependent phase space mapper");
101 desc.add<bool>("logPartonVirtuality", true);
102 return desc;
103 }
104} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
Incoming beams characteristics.
Definition Beam.h:30
spdgid_t integerPdgId() const
Beam particle PDG id Set the beam particle PDG id.
Definition Beam.h:47
bool elastic() const
Does the beam remain on-shell after parton emission? Specify if the beam remains on-shell after parto...
Definition Beam.h:40
const ParametersList & partonFluxParameters() const
Parton flux modelling.
Definition Beam.h:62
static Momentum fromPtEtaPhiE(double pt, double eta, double phi, double e=-1.)
Build a 3-momentum from its three pseudo-cylindrical coordinates.
Definition Momentum.cpp:69
A description object for parameters collection.
bool generatePartonKinematics() override
Generate the 4-momentum of incoming partons.
double fluxes() const override
Retrieve the event weight in the phase space.
A generic phase space integration wrapper.
proc::FactorisedProcess & process()
Consumer process object Const-qualified consumer process object.
static ParametersDescription description()
Description of all object parameters.
Definition Steerable.cpp:42
const Kinematics & kinematics() const
Constant reference to the process kinematics.
Definition Process.h:50
const Momentum & q2() const
Negative-z incoming parton's 4-momentum.
Definition Process.cpp:111
Process & defineVariable(double &out, const Mapping &type, const Limits &lim, const std::string &name, const std::string &description="")
Register a variable to be handled and populated whenever a new phase space point weight is to be calc...
Definition Process.cpp:149
@ exponential
an exponential mapping
const Momentum & q1() const
Positive-z incoming parton's 4-momentum.
Definition Process.cpp:107
Common namespace for this Monte Carlo generator.
static bool isHI(const spdgid_t &)
Check if the PDG id is compatible with a HI.
Definition HeavyIon.cpp:54