cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
pythia6_kt_hadr.cc
Go to the documentation of this file.
1
#include "
CepGen/Core/RunParameters.h
"
2
#include "
CepGen/EventFilter/EventModifier.h
"
3
#include "
CepGen/Generator.h
"
4
#include "
CepGen/Modules/EventModifierFactory.h
"
5
#include "
CepGen/Modules/ProcessFactory.h
"
6
#include "
CepGen/Physics/Beam.h
"
7
#include "
CepGen/Process/Process.h
"
8
#include "
CepGen/Utils/ArgumentsParser.h
"
9
#include "
CepGen/Utils/Test.h
"
10
#include "
CepGenAddOns/Common/EventUtils.h
"
11
12
using namespace
std;
13
14
int
main
(
int
argc,
char
* argv[]) {
15
cepgen::ArgumentsParser
(argc, argv).
parse
();
16
auto
gen =
cepgen::Generator
();
17
18
auto
evt =
cepgen::utils::generateLPAIREvent
();
19
evt.dump();
20
21
gen.runParameters().setProcess(cepgen::ProcessFactory::get().build(
22
"lpair"
,
23
cepgen::ParametersList
().set(
24
"kinematics"
,
25
cepgen::ParametersList
()
26
.set<double>(
"cmEnergy"
, 13.e3)
27
.setAs<int, cepgen::mode::Kinematics>(
"mode"
,
cepgen::mode::Kinematics::InelasticElastic
))));
28
29
auto
cg_pythia = cepgen::EventModifierFactory::get().build(
"pythia6"
);
30
cg_pythia->setCrossSection(
cepgen::Value
{1.46161e-1, 1.25691e-3});
31
cg_pythia->initialise(gen.runParameters());
32
double
evt_weight = 1.;
33
34
const
auto
evt_before_particles = evt.particles().size();
35
cg_pythia->run(evt, evt_weight,
true
);
36
CG_TEST
(evt_weight == 1.,
"no event weight modification in fast mode"
);
37
CG_TEST
(evt.particles().size() == evt_before_particles,
"no event modification in fast mode"
);
38
39
cg_pythia->run(evt, evt_weight,
false
);
40
41
CG_DEBUG
(
"main"
) <<
"Pythia 6-filtered event:\n"
<< evt;
42
43
CG_TEST_EQUAL
(evt_weight, 1.,
"event weight"
);
44
CG_TEST
(evt(
cepgen::Particle::Role::OutgoingBeam1
).size() > 1,
"decayed diffractive beam system"
);
45
CG_TEST
(evt(
cepgen::Particle::Role::OutgoingBeam2
).size() == 1,
"undecayed elastic beam system"
);
46
cepgen::Momentum
daugh_total_momentum;
47
for
(
const
auto
& daugh : evt.stableDaughters(evt(
cepgen::Particle::Role::OutgoingBeam1
)[0],
true
))
48
daugh_total_momentum += daugh.get().momentum();
49
CG_TEST_EQUIV
((daugh_total_momentum - evt(
cepgen::Particle::Role::OutgoingBeam1
)[0].momentum()).p(),
50
0.,
51
"diffractive system momentum balance"
);
52
53
CG_TEST_SUMMARY
;
54
}
ArgumentsParser.h
Beam.h
EventModifierFactory.h
EventModifier.h
EventUtils.h
Generator.h
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
ProcessFactory.h
Process.h
RunParameters.h
Test.h
CG_TEST_EQUIV
#define CG_TEST_EQUIV(var1, var2, name)
Definition
Test.h:61
CG_TEST_SUMMARY
#define CG_TEST_SUMMARY
Definition
Test.h:127
CG_TEST_EQUAL
#define CG_TEST_EQUAL(var1, var2, name)
Definition
Test.h:45
CG_TEST
#define CG_TEST(test_cond, name)
Definition
Test.h:30
cepgen::ArgumentsParser
A generic command line arguments parser.
Definition
ArgumentsParser.h:31
cepgen::ArgumentsParser::parse
ArgumentsParser & parse()
Associate command-line arguments to parameters.
Definition
ArgumentsParser.cpp:106
cepgen::Generator
Core generator object allowing for process definition, cross section computation, and event generatio...
Definition
Generator.h:48
cepgen::Momentum
Container for a particle's 4-momentum, along with useful methods to ease the development of any matri...
Definition
Momentum.h:33
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::Particle::OutgoingBeam1
@ OutgoingBeam1
outgoing beam state/particle
Definition
Particle.h:54
cepgen::Particle::OutgoingBeam2
@ OutgoingBeam2
outgoing beam state/particle
Definition
Particle.h:55
cepgen::Value
A scalar value with its uncertainty.
Definition
Value.h:26
cepgen::mode::Kinematics::InelasticElastic
@ InelasticElastic
proton-proton single-dissociative (or elastic-inelastic) case
cepgen::utils::generateLPAIREvent
Event generateLPAIREvent()
Generate a standard single-dissociative LPAIR event.
Definition
EventUtils.h:30
main
int main()
Definition
pythia6_decay.cc:9
CepGenAddOns
Pythia6Wrapper
test
pythia6_kt_hadr.cc
Generated on Mon Jul 29 2024 for CepGen by
1.9.7