cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PartonsCollinearPhaseSpaceGenerator.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023-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"
24#include "CepGen/Physics/PDG.h"
27
28namespace cepgen {
30 : PartonsPhaseSpaceGenerator(params), log_part_virt_(steer<bool>("logPartonVirtuality")) {}
31
32 void PartonsCollinearPhaseSpaceGenerator::initialise() {
33 const auto& kin = process().kinematics();
34
35 // pick a parton flux parameterisation for each beam
36 auto set_flux_properties = [&kin](const Beam& beam, std::unique_ptr<PartonFlux>& flux) {
37 auto params = beam.partonFluxParameters();
38 const auto params_p_el = CollinearFluxFactory::get().describeParameters(
39 "EPAFlux", ParametersList().set("formFactors", beam.formFactors()));
40 const auto params_p_inel = CollinearFluxFactory::get().describeParameters(
41 "EPAFlux",
42 ParametersList().set("formFactors",
44 .setName("InelasticNucleon")
45 .set("structureFunctions", kin.incomingBeams().structureFunctions())));
46 const auto params_hi_el = CollinearFluxFactory::get().describeParameters(
47 "EPAFlux", ParametersList().set("formFactors", ParametersList().setName("HeavyIonDipole")));
48 if (params.name().empty()) {
49 if (beam.elastic()) {
50 if (HeavyIon::isHI(beam.integerPdgId()))
51 params = params_hi_el.validate(params);
52 else
53 params = params_p_el.validate(params);
54 } else
55 params = params_p_inel.validate(params);
56 //TODO: fermions/pions
57 }
58 flux = CollinearFluxFactory::get().build(params);
59 if (!flux)
60 throw CG_FATAL("PartonsCollinearPhaseSpaceGenerator:init")
61 << "Failed to initiate a parton flux object with properties: " << params << ".";
62 if (flux->ktFactorised())
63 throw CG_FATAL("PartonsCollinearPhaseSpaceGenerator:init")
64 << "Invalid incoming parton flux: " << flux->name() << ".";
65 };
66 set_flux_properties(kin.incomingBeams().positive(), pos_flux_);
67 set_flux_properties(kin.incomingBeams().negative(), neg_flux_);
68
69 // register the incoming partons' virtuality
70 const auto lim_q2_1 = kin.cuts().initial.q2.at(0).truncate(Limits{1.e-10, 5.}),
71 lim_q2_2 = kin.cuts().initial.q2.at(1).truncate(Limits{1.e-10, 5.});
72 if (log_part_virt_)
73 process()
75 m_t1_, proc::Process::Mapping::exponential, lim_q2_1.compute(std::log), "Positive-z parton virtuality")
77 m_t2_, proc::Process::Mapping::exponential, lim_q2_2.compute(std::log), "Negative-z parton virtuality");
78 else
79 process()
80 .defineVariable(m_t1_, proc::Process::Mapping::linear, lim_q2_1, "Positive-z parton virtuality")
81 .defineVariable(m_t2_, proc::Process::Mapping::linear, lim_q2_2, "Negative-z parton virtuality");
82 }
83
85 // gaussian smearing of kt can be introduced here
86 process().q1() = Momentum::fromPtYPhiM(0., 0., 0., std::sqrt(m_t1_));
87 process().q2() = Momentum::fromPtYPhiM(0., 0., 0., std::sqrt(m_t2_));
88 return true;
89 }
90
92 return positiveFlux<CollinearFlux>().fluxQ2(process().x1(), m_t1_) * process().x1() / m_t1_ *
93 negativeFlux<CollinearFlux>().fluxQ2(process().x2(), m_t2_) * process().x2() / m_t2_;
94 }
95
98 desc.setDescription("Collinear phase space mapper");
99 desc.add<bool>("logPartonVirtuality", true);
100 return desc;
101 }
102} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
Incoming beams characteristics.
Definition Beam.h:30
const ParametersList & formFactors() const
Form factors parameters.
Definition Beam.h:61
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 fromPtYPhiM(double pt, double rap, double phi, double m)
Build a 4-momentum from its transverse momentum, azimuthal angle, rapidity and mass.
Definition Momentum.cpp:93
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
double x2() const
Negative-z incoming parton's fractional momentum.
Definition Process.h:83
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
double x1() const
Positive-z incoming parton's fractional momentum.
Definition Process.h:80
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