cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
add_particles.cc
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/Generator.h
"
21
#include "
CepGen/Modules/ProcessFactory.h
"
22
#include "
CepGen/Physics/PDG.h
"
23
#include "
CepGen/Process/Process.h
"
24
#include "
CepGen/Utils/ArgumentsParser.h
"
25
#include "
CepGen/Utils/Test.h
"
26
#include "
CepGenAddOns/MadGraphWrapper/MadGraphProcess.h
"
27
28
using namespace
std;
29
using namespace
std::string_literals;
30
31
int
main
(
int
argc,
char
* argv[]) {
32
cepgen::ArgumentsParser
(argc, argv).
parse
();
33
cepgen::initialise
();
34
35
const
cepgen::pdgid_t
my_part = 13;
36
const
auto
my_part_mass = 42.;
37
38
cepgen::PDG::get
().
define
(
39
cepgen::ParticleProperties
(my_part,
"la"
,
"laurentino"
, 0., my_part_mass, 0., {-3, 3},
true
));
40
41
auto
mg5 = cepgen::ProcessFactory::get().build(
42
"mg5_aMC"
,
43
cepgen::ParametersList
()
44
.set(
"kinematicsGenerator"
,
cepgen::ParametersList
().setName(
"coll2to4"
s))
45
.set(
"extraParticles"
,
cepgen::ParametersList
().set(
"la"
,
cepgen::PDG::get
()(my_part)))
46
.set(
"process"
,
"a a > la+ la-"
s));
47
mg5->initialise();
48
49
const
auto
& proc_evt = mg5->event();
50
CG_TEST_EQUAL
(proc_evt.oneWithRole(
cepgen::Particle::Role::Parton1
).pdgId(),
cepgen::PDG::photon
,
"parton 1 PDG id"
);
51
CG_TEST_EQUAL
(proc_evt.oneWithRole(
cepgen::Particle::Role::Parton2
).pdgId(),
cepgen::PDG::photon
,
"parton 2 PDG id"
);
52
CG_TEST_EQUAL
(proc_evt(
cepgen::Particle::Role::CentralSystem
).size(), 2,
"cent.part.multiplicity"
);
53
for
(
size_t
i = 0; i < 2; ++i) {
54
const
auto
& cent = proc_evt(
cepgen::Particle::Role::CentralSystem
).at(i);
55
CG_TEST_EQUAL
(cent.integerPdgId(),
short
((i == 0 ? -1 : +1) * my_part),
"cent."
+ to_string(i) +
" PDG id"
);
56
CG_TEST_EQUAL
(cent.momentum().mass(), my_part_mass,
"cent."
+ to_string(i) +
" mass"
);
57
}
58
59
CG_TEST_SUMMARY
;
60
}
ArgumentsParser.h
Exception.h
Generator.h
MadGraphProcess.h
PDG.h
ProcessFactory.h
Process.h
Test.h
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
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::PDG::photon
@ photon
Definition
PDG.h:41
cepgen::PDG::define
void define(const ParticleProperties &)
Add a new particle definition to the library.
Definition
PDG.cpp:60
cepgen::PDG::get
static PDG & get()
Retrieve a unique instance of this particles info collection.
Definition
PDG.cpp:41
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::Particle::Parton2
@ Parton2
beam incoming parton
Definition
Particle.h:59
cepgen::Particle::Parton1
@ Parton1
beam incoming parton
Definition
Particle.h:58
cepgen::Particle::CentralSystem
@ CentralSystem
Central particles system.
Definition
Particle.h:56
cepgen::initialise
void initialise(bool safe_mode)
Definition
GlobalFunctions.cpp:91
cepgen::pdgid_t
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
Definition
ParticleProperties.h:26
main
int main()
Definition
pythia6_decay.cc:9
cepgen::ParticleProperties
A collection of physics constants associated to a single particle.
Definition
ParticleProperties.h:31
CepGenAddOns
MadGraphWrapper
test
add_particles.cc
Generated on Mon Jul 29 2024 for CepGen by
1.9.7