cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
FactorisedProcess.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
19
#include "
CepGen/Core/Exception.h
"
20
#include "
CepGen/Event/Event.h
"
21
#include "
CepGen/Modules/PartonFluxFactory.h
"
22
#include "
CepGen/Modules/PhaseSpaceGeneratorFactory.h
"
23
#include "
CepGen/Physics/Beam.h
"
24
#include "
CepGen/Physics/PDG.h
"
25
#include "
CepGen/Process/FactorisedProcess.h
"
26
#include "
CepGen/Process/PhaseSpaceGenerator.h
"
27
#include "
CepGen/Utils/Math.h
"
28
29
namespace
cepgen
{
30
namespace
proc {
31
FactorisedProcess::FactorisedProcess
(
const
ParametersList
& params,
const
spdgids_t
& central)
32
:
Process
(params),
33
psgen_(PhaseSpaceGeneratorFactory::get().build(
34
steer<
ParametersList
>(
"kinematicsGenerator"
)
35
.set(
"ids"
, std::vector<int>(central.begin(), central.end())))),
36
symmetrise_(steer<bool>(
"symmetrise"
)),
37
store_alphas_(steer<bool>(
"storeAlphas"
)) {
38
event
().
map
()[
Particle::CentralSystem
].resize(central.size());
39
}
40
41
FactorisedProcess::FactorisedProcess
(
const
FactorisedProcess
& proc)
42
:
Process
(proc),
43
psgen_(PhaseSpaceGeneratorFactory::get().build(proc.psgen_->parameters())),
44
symmetrise_(proc.symmetrise_),
45
store_alphas_(proc.store_alphas_) {}
46
47
void
FactorisedProcess::addEventContent
() {
48
CG_ASSERT
(
psgen_
);
49
const
auto
cent_pdgids =
psgen_
->central();
50
Process::setEventContent
({{
Particle::IncomingBeam1
, {
kinematics
().
incomingBeams
().
positive
().
integerPdgId
()}},
51
{
Particle::IncomingBeam2
, {
kinematics
().
incomingBeams
().
negative
().
integerPdgId
()}},
52
{
Particle::OutgoingBeam1
, {
kinematics
().
incomingBeams
().
positive
().
integerPdgId
()}},
53
{
Particle::OutgoingBeam2
, {
kinematics
().
incomingBeams
().
negative
().
integerPdgId
()}},
54
{
Particle::CentralSystem
,
spdgids_t
(cent_pdgids.begin(), cent_pdgids.end())}});
55
}
56
57
void
FactorisedProcess::prepareKinematics
() {
58
if
(!
psgen_
)
59
throw
CG_FATAL
(
"FactorisedProcess:prepareKinematics"
)
60
<<
"Phase space generator not set. Please check your process initialisation procedure, as you might "
61
"be doing something irregular."
;
62
psgen_
->initialise(
this
);
63
64
event
().
oneWithRole
(
Particle::Parton1
).
setIntegerPdgId
(
psgen_
->partons().at(0));
65
event
().
oneWithRole
(
Particle::Parton2
).
setIntegerPdgId
(
psgen_
->partons().at(1));
66
67
CG_DEBUG
(
"FactorisedProcess:prepareKinematics"
) <<
"Partons: "
<<
psgen_
->partons() <<
", "
68
<<
"central system: "
<<
psgen_
->central() <<
". "
<<
event
();
69
70
// register all process-dependent variables
71
prepareFactorisedPhaseSpace
();
72
73
// register the outgoing remnants' variables
74
if
(!
kinematics
().incomingBeams().positive().elastic())
75
defineVariable
(
mX2
(),
Mapping::square
,
kinematics
().cuts().remnants.mx,
"Positive-z beam remnant squared mass"
);
76
if
(!
kinematics
().incomingBeams().negative().elastic())
77
defineVariable
(
mY2
(),
Mapping::square
,
kinematics
().cuts().remnants.mx,
"Negative-z beam remnant squared mass"
);
78
// symmetrisation of the phase space: factor 2 in Jacobian for single-dissociation
79
kin_prefactor_ =
symmetrise_
&& (
kinematics
().
incomingBeams
().
mode
() ==
mode::Kinematics::ElasticInelastic
||
80
kinematics
().
incomingBeams
().
mode
() ==
mode::Kinematics::InelasticElastic
)
81
? 2.
82
: 1.;
83
}
84
85
double
FactorisedProcess::computeWeight
() {
86
if
(!
psgen_
->generate())
87
return
0.;
88
if
(
const
auto
cent_weight =
computeFactorisedMatrixElement
();
utils::positive
(cent_weight))
89
return
cent_weight *
psgen_
->weight() * kin_prefactor_;
90
return
0.;
91
}
92
93
void
FactorisedProcess::fillKinematics
() {
94
// beam systems
95
if
(!
kinematics
().incomingBeams().positive().elastic())
96
pX
().
setMass2
(
mX2
());
97
if
(!
kinematics
().incomingBeams().negative().elastic())
98
pY
().
setMass2
(
mY2
());
99
100
// parton systems
101
auto
& part1 =
event
().
oneWithRole
(
Particle::Parton1
);
102
auto
& part2 =
event
().
oneWithRole
(
Particle::Parton2
);
103
part1.
setMomentum
(
pA
() -
pX
(),
true
);
104
part2.
setMomentum
(
pB
() -
pY
(),
true
);
105
106
if
(
symmetrise_
&&
rnd_gen_
->uniformInt(0, 1) == 1) {
// symmetrise the el-in and in-el cases
107
std::swap(
pX
(),
pY
());
108
std::swap(
q1
(),
q2
());
109
std::swap(
pc
(0),
pc
(1));
110
for
(
auto
* mom : {&
q1
(), &
q2
(), &
pX
(), &
pY
(), &
pc
(0), &
pc
(1)})
111
mom->mirrorZ();
112
}
113
114
// add couplings to metadata
115
if
(
store_alphas_
) {
116
const
auto
two_part_mass = (part1.momentum() + part2.momentum()).mass();
117
event
().
metadata
[
"alphaEM"
] =
alphaEM
(two_part_mass);
118
event
().
metadata
[
"alphaS"
] =
alphaS
(two_part_mass);
119
}
120
}
121
122
//----- utilities
123
124
double
FactorisedProcess::that
()
const
{
return
psgen_
->that(); }
125
126
double
FactorisedProcess::uhat
()
const
{
return
psgen_
->uhat(); }
127
128
ParametersDescription
FactorisedProcess::description
() {
129
auto
desc =
Process::description
();
130
desc.setDescription(
"Unnamed factorised process"
);
131
desc.add(
"kinematics"
,
132
Kinematics::description
()
133
.addParametersDescriptionVector(
134
"partonFluxes"
,
135
PartonFluxFactory::get
().describeParameters(
"BudnevElastic"
),
136
std::vector<ParametersList>(
137
2,
PartonFluxFactory::get
().describeParameters(
"BudnevElastic"
).
parameters
()))
138
.setDescription(
"Parton fluxes modelling"
));
139
desc.add(
"kinematicsGenerator"
, PhaseSpaceGeneratorFactory::get().describeParameters(
"kt2to4"
));
140
desc.add<
bool
>(
"symmetrise"
,
false
).setDescription(
"Symmetrise along z the central system?"
);
141
desc.add<
bool
>(
"storeAlphas"
,
false
)
142
.setDescription(
"store the electromagnetic and strong coupling constants to the event content?"
);
143
return
desc;
144
}
145
}
// namespace proc
146
}
// namespace cepgen
Beam.h
Event.h
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
CG_ASSERT
#define CG_ASSERT(assertion)
Definition
Exception.h:62
FactorisedProcess.h
Math.h
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
PDG.h
PartonFluxFactory.h
PhaseSpaceGeneratorFactory.h
PhaseSpaceGenerator.h
cepgen::Beam::integerPdgId
spdgid_t integerPdgId() const
Beam particle PDG id Set the beam particle PDG id.
Definition
Beam.h:47
cepgen::Event::map
ParticlesMap & map()
Internal particles map retrieval operator.
Definition
Event.h:72
cepgen::Event::oneWithRole
Particle & oneWithRole(Particle::Role role)
First Particle object with a given role in the event.
Definition
Event.cpp:190
cepgen::Event::metadata
EventMetadata metadata
List of auxiliary information.
Definition
Event.h:136
cepgen::IncomingBeams::positive
const Beam & positive() const
Reference to the positive-z beam information.
Definition
IncomingBeams.h:38
cepgen::IncomingBeams::negative
const Beam & negative() const
Reference to the negative-z beam information.
Definition
IncomingBeams.h:40
cepgen::IncomingBeams::mode
mode::Kinematics mode() const
Type of kinematics to consider for the phase space.
Definition
IncomingBeams.cpp:204
cepgen::Kinematics::incomingBeams
IncomingBeams & incomingBeams()
Beam/primary particle kinematics.
Definition
Kinematics.h:36
cepgen::Kinematics::description
static ParametersDescription description()
Definition
Kinematics.cpp:51
cepgen::Momentum::setMass2
Momentum & setMass2(double)
Compute the energy from the mass.
Definition
Momentum.cpp:178
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::Particle::setMomentum
Particle & setMomentum(const Momentum &, bool offshell=false)
Associate a momentum object to this particle.
Definition
Particle.cpp:77
cepgen::Particle::setIntegerPdgId
Particle & setIntegerPdgId(long pdg_id)
Definition
Particle.cpp:95
cepgen::Particle::IncomingBeam2
@ IncomingBeam2
incoming beam particle
Definition
Particle.h:53
cepgen::Particle::Parton2
@ Parton2
beam incoming parton
Definition
Particle.h:59
cepgen::Particle::OutgoingBeam1
@ OutgoingBeam1
outgoing beam state/particle
Definition
Particle.h:54
cepgen::Particle::IncomingBeam1
@ IncomingBeam1
incoming beam particle
Definition
Particle.h:52
cepgen::Particle::OutgoingBeam2
@ OutgoingBeam2
outgoing beam state/particle
Definition
Particle.h:55
cepgen::Particle::Parton1
@ Parton1
beam incoming parton
Definition
Particle.h:58
cepgen::Particle::CentralSystem
@ CentralSystem
Central particles system.
Definition
Particle.h:56
cepgen::SteeredObject::parameters
const ParametersList & parameters() const override
Module user-defined parameters.
Definition
SteeredObject.h:54
cepgen::proc::FactorisedProcess
Generic parton emission-factorised process.
Definition
FactorisedProcess.h:33
cepgen::proc::FactorisedProcess::FactorisedProcess
FactorisedProcess(const ParametersList ¶ms, const spdgids_t &output)
Class constructor.
Definition
FactorisedProcess.cpp:31
cepgen::proc::FactorisedProcess::that
double that() const
Definition
FactorisedProcess.cpp:124
cepgen::proc::FactorisedProcess::symmetrise_
const bool symmetrise_
Definition
FactorisedProcess.h:59
cepgen::proc::FactorisedProcess::prepareFactorisedPhaseSpace
virtual void prepareFactorisedPhaseSpace()=0
Prepare central part of the Jacobian after kinematics is set.
cepgen::proc::FactorisedProcess::psgen_
const std::unique_ptr< PhaseSpaceGenerator > psgen_
Kinematic variables generator for the phase space coverage.
Definition
FactorisedProcess.h:58
cepgen::proc::FactorisedProcess::fillKinematics
void fillKinematics() override final
Fill the Event object with the particles' kinematics.
Definition
FactorisedProcess.cpp:93
cepgen::proc::FactorisedProcess::prepareKinematics
void prepareKinematics() override final
Compute the incoming state kinematics.
Definition
FactorisedProcess.cpp:57
cepgen::proc::FactorisedProcess::uhat
double uhat() const
Definition
FactorisedProcess.cpp:126
cepgen::proc::FactorisedProcess::description
static ParametersDescription description()
Definition
FactorisedProcess.cpp:128
cepgen::proc::FactorisedProcess::computeFactorisedMatrixElement
virtual double computeFactorisedMatrixElement()=0
Factorised matrix element (event weight)
cepgen::proc::FactorisedProcess::addEventContent
void addEventContent() override
Set the incoming and outgoing state to be expected in the process.
Definition
FactorisedProcess.cpp:47
cepgen::proc::FactorisedProcess::store_alphas_
const bool store_alphas_
Definition
FactorisedProcess.h:60
cepgen::proc::FactorisedProcess::computeWeight
double computeWeight() override
Compute the phase space point weight.
Definition
FactorisedProcess.cpp:85
cepgen::proc::Process
Class template to define any process to compute using this MC integrator/events generator.
Definition
Process.h:34
cepgen::proc::Process::kinematics
const Kinematics & kinematics() const
Constant reference to the process kinematics.
Definition
Process.h:50
cepgen::proc::Process::pA
const Momentum & pA() const
Positive-z incoming beam particle's 4-momentum.
Definition
Process.cpp:91
cepgen::proc::Process::pX
const Momentum & pX() const
Positive-z outgoing beam particle's 4-momentum.
Definition
Process.cpp:99
cepgen::proc::Process::q2
const Momentum & q2() const
Negative-z incoming parton's 4-momentum.
Definition
Process.cpp:111
cepgen::proc::Process::defineVariable
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
cepgen::proc::Process::Mapping::square
@ square
a square mapping
cepgen::proc::Process::mY2
double mY2() const
Negative-z outgoing beam particle's squared mass.
Definition
Process.h:77
cepgen::proc::Process::alphaEM
double alphaEM(double q) const
Compute the electromagnetic running coupling algorithm at a given scale.
Definition
Process.cpp:346
cepgen::proc::Process::pB
const Momentum & pB() const
Negative-z incoming beam particle's 4-momentum.
Definition
Process.cpp:95
cepgen::proc::Process::setEventContent
void setEventContent(const std::unordered_map< Particle::Role, spdgids_t > &)
Set the incoming and outgoing states to be defined in this process (and prepare the Event object acco...
Definition
Process.cpp:370
cepgen::proc::Process::pc
Momentum & pc(size_t)
Central particle's 4-momentum.
Definition
Process.cpp:113
cepgen::proc::Process::pY
const Momentum & pY() const
Negative-z outgoing beam particle's 4-momentum.
Definition
Process.cpp:103
cepgen::proc::Process::rnd_gen_
std::unique_ptr< utils::RandomGenerator > rnd_gen_
Process-local random number generator engine.
Definition
Process.h:161
cepgen::proc::Process::description
static ParametersDescription description()
Definition
Process.cpp:403
cepgen::proc::Process::mX2
double mX2() const
Positive-z outgoing beam particle's squared mass.
Definition
Process.h:74
cepgen::proc::Process::event
const Event & event() const
Handled particles objects and their relationships.
Definition
Process.cpp:267
cepgen::proc::Process::alphaS
double alphaS(double q) const
Compute the strong coupling algorithm at a given scale.
Definition
Process.cpp:353
cepgen::proc::Process::q1
const Momentum & q1() const
Positive-z incoming parton's 4-momentum.
Definition
Process.cpp:107
cepgen::mode::Kinematics::InelasticElastic
@ InelasticElastic
proton-proton single-dissociative (or elastic-inelastic) case
cepgen::mode::Kinematics::ElasticInelastic
@ ElasticInelastic
proton-proton single-dissociative (or inelastic-elastic) case
cepgen::utils::positive
bool positive(const T &val)
Check if a number is positive and finite.
Definition
Math.cpp:26
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::spdgids_t
std::vector< spdgid_t > spdgids_t
Definition
ParticleProperties.h:29
cepgen::PartonFluxFactory::get
static PartonFluxFactory & get()
Definition
PartonFluxFactory.h:53
CepGen
Process
FactorisedProcess.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7