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.
3#include "CepGen/Generator.h"
9#include "CepGen/Utils/Test.h"
11
12using namespace std;
13
14int main(int argc, char* argv[]) {
15 cepgen::ArgumentsParser(argc, argv).parse();
16 auto gen = cepgen::Generator();
17
19 evt.dump();
20
21 gen.runParameters().setProcess(cepgen::ProcessFactory::get().build(
22 "lpair",
24 "kinematics",
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
54}
#define CG_DEBUG(mod)
Definition Message.h:220
#define CG_TEST_EQUIV(var1, var2, name)
Definition Test.h:61
#define CG_TEST_SUMMARY
Definition Test.h:127
#define CG_TEST_EQUAL(var1, var2, name)
Definition Test.h:45
#define CG_TEST(test_cond, name)
Definition Test.h:30
A generic command line arguments parser.
ArgumentsParser & parse()
Associate command-line arguments to parameters.
Core generator object allowing for process definition, cross section computation, and event generatio...
Definition Generator.h:48
Container for a particle's 4-momentum, along with useful methods to ease the development of any matri...
Definition Momentum.h:33
@ OutgoingBeam1
outgoing beam state/particle
Definition Particle.h:54
@ OutgoingBeam2
outgoing beam state/particle
Definition Particle.h:55
A scalar value with its uncertainty.
Definition Value.h:26
@ InelasticElastic
proton-proton single-dissociative (or elastic-inelastic) case
Event generateLPAIREvent()
Generate a standard single-dissociative LPAIR event.
Definition EventUtils.h:30
int main()