cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
N/A
Central exclusive processes event generator
Toggle main menu visibility
Main Page
Related Pages
Packages
Package List
Package Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
y
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
y
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
b
c
d
e
g
h
i
l
m
n
p
r
t
u
w
x
y
z
Related Symbols
d
g
h
o
u
v
Files
File List
File Members
All
_
a
b
c
d
e
h
o
p
r
s
Functions
Variables
Macros
_
b
c
d
e
p
r
s
▼
CepGen
Reference manual
Bibliography
►
Packages
►
Classes
▼
Files
▼
File List
▼
include
▼
CepGen
►
Cards
►
Core
▼
Event
►
Event.h
►
Particle.h
►
EventFilter
►
FormFactors
►
Integration
►
Modules
►
PartonFluxes
►
Physics
►
Process
►
StructureFunctions
►
Utils
►
Generator.h
►
Version.h
►
CepGenBoost
►
CepGenHepMC2
►
CepGenHepMC3
►
CepGenHerwig6
►
CepGenMadGraph
►
CepGenPythia6
►
CepGenPythia8
►
CepGenPython
►
CepGenRoot
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
Particle.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2013-2025 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
#ifndef CepGen_Event_Particle_h
20
#define CepGen_Event_Particle_h
21
22
#include <set>
23
24
#include "
CepGen/Physics/Momentum.h
"
25
#include "
CepGen/Physics/ParticleProperties.h
"
26
#include "
CepGen/Utils/Hasher.h
"
27
28
namespace
cepgen
{
29
using
ParticlesIds
= std::set<int>;
30
32
class
Particle
{
33
public
:
35
enum class
Status
{
36
PrimordialIncoming
= -9,
37
DebugResonance
= -5,
38
Resonance
= -4,
39
Fragmented
= -3,
40
Propagator
= -2,
41
Incoming
= -1,
42
Undefined
= 0,
43
FinalState
= 1,
44
Undecayed
= 2,
45
Unfragmented
= 3
46
};
35
enum class
Status
{
…
};
47
friend
std::ostream&
operator<<
(std::ostream& os,
const
Status
&);
49
enum class
Role
{
50
UnknownRole
= -1,
51
IncomingBeam1
= 1,
52
IncomingBeam2
= 2,
53
OutgoingBeam1
= 3,
54
OutgoingBeam2
= 5,
55
CentralSystem
= 6,
56
Intermediate
= 4,
57
Parton1
= 41,
58
Parton2
= 42
59
};
49
enum class
Role
{
…
};
60
friend
std::ostream&
operator<<
(std::ostream& os,
const
Role
&);
61
62
//----- static getters
63
68
explicit
Particle
(
Role
role
=
Role::UnknownRole
,
pdgid_t
id
= 0,
Status
status
=
Status::Undefined
);
69
70
bool
operator<
(
const
Particle
&)
const
;
71
bool
operator==
(
const
Particle
&)
const
;
72
73
// --- general particle properties
74
75
inline
int
id
()
const
{
return
id_
; }
77
inline
Particle
&
setId
(
int
id
) {
78
id_
=
id
;
79
return
*
this
;
80
}
77
inline
Particle
&
setId
(
int
id
) {
…
}
81
float
charge
()
const
;
83
inline
Particle
&
setAntiparticle
(
bool
anti) {
84
antiparticle_
= anti;
85
return
*
this
;
86
}
83
inline
Particle
&
setAntiparticle
(
bool
anti) {
…
}
87
inline
Role
role
()
const
{
return
role_
; }
89
inline
Particle
&
setRole
(
const
Role
&
role
) {
90
role_
=
role
;
91
return
*
this
;
92
}
89
inline
Particle
&
setRole
(
const
Role
&
role
) {
…
}
93
inline
Status
status
()
const
{
return
static_cast<
Status
>
(
status_
); }
95
inline
Particle
&
setStatus
(
Status
status
) {
96
status_
=
static_cast<
int
>
(
status
);
97
return
*
this
;
98
}
95
inline
Particle
&
setStatus
(
Status
status
) {
…
}
100
inline
Particle
&
setStatus
(
int
status
) {
101
status_
=
status
;
102
return
*
this
;
103
}
100
inline
Particle
&
setStatus
(
int
status
) {
…
}
104
108
Particle
&
setPdgId
(
pdgid_t
pdg
,
short
charge_factor = 0);
109
pdgid_t
pdgId
()
const
;
112
Particle
&
setIntegerPdgId
(
long
pdg_id);
113
long
integerPdgId
()
const
;
114
115
inline
float
helicity
()
const
{
return
helicity_
; }
117
inline
Particle
&
setHelicity
(
float
heli) {
118
helicity_
= heli;
119
return
*
this
;
120
}
117
inline
Particle
&
setHelicity
(
float
heli) {
…
}
121
122
inline
Momentum
&
momentum
() {
return
momentum_
; }
124
inline
const
Momentum
&
momentum
()
const
{
return
momentum_
; }
127
Particle
&
setMomentum
(
const
Momentum
&,
bool
off_shell =
false
);
133
Particle
&
setMomentum
(
double
px,
double
py,
double
pz,
double
energy = -1.);
136
inline
Particle
&
setMomentum
(
double
p[4]) {
return
setMomentum
(p[0], p[1], p[2], p[3]); }
137
bool
valid
()
const
;
138
139
// --- particle relations
140
141
inline
bool
primary
()
const
{
return
mothers_
.empty(); }
142
Particle
&
addMother
(
Particle
& mother_particle);
143
inline
ParticlesIds
mothers
()
const
{
return
mothers_
; }
144
inline
ParticlesIds
&
mothers
() {
return
mothers_
; }
145
Particle
&
addChild
(
Particle
& child_particle);
146
inline
ParticlesIds
children
()
const
{
return
children_
; }
147
inline
ParticlesIds
&
children
() {
return
children_
; }
148
149
// --- global particle information extraction
150
151
friend
std::ostream&
operator<<
(std::ostream&,
const
Particle
&);
152
153
protected
:
154
int
id_
{-1};
155
bool
antiparticle_
{
false
};
156
Momentum
momentum_
;
157
float
helicity_
{0.};
158
Role
role_
{
Role::UnknownRole
};
159
int
status_
{
static_cast<
int
>
(
Status::Undefined
)};
160
ParticlesIds
mothers_
{};
161
ParticlesIds
children_
{};
162
pdgid_t
pdg_id_
{0};
163
};
164
165
// --- particle containers
166
167
using
ParticleRef
= std::reference_wrapper<Particle>;
168
using
Particles
= std::vector<Particle>;
169
using
ParticlesRefs
= std::vector<ParticleRef>;
170
using
ParticleRoles
= std::vector<Particle::Role>;
171
173
class
ParticlesMap
:
public
std::unordered_map<Particle::Role, Particles, utils::EnumHash<Particle::Role> > {
174
public
:
175
ParticlesMap
() =
default
;
176
ParticlesMap
(
const
ParticlesMap
&);
177
ParticlesMap
&
operator=
(
const
ParticlesMap
&);
178
~ParticlesMap
() =
default
;
179
};
173
class
ParticlesMap
:
public
std::unordered_map<Particle::Role, Particles, utils::EnumHash<Particle::Role> > {
…
};
180
}
// namespace cepgen
181
182
#endif
151
friend
std::ostream&
operator<<
(std::ostream&,
const
Particle
&); {
…
};
147
inline
ParticlesIds
&
children
() {
return
children_
; } {
…
}
145
Particle
&
addChild
(
Particle
& child_particle); {
…
}
144
inline
ParticlesIds
&
mothers
() {
return
mothers_
; } {
…
}
142
Particle
&
addMother
(
Particle
& mother_particle); {
…
}
32
class
Particle
{
…
};
Hasher.h
Momentum.h
ParticleProperties.h
cepgen::Momentum
Container for a particle's 4-momentum, along with useful methods to ease the development of any matri...
Definition
Momentum.h:30
cepgen::Particle
Kinematic information for one particle.
Definition
Particle.h:32
cepgen::Particle::momentum
Momentum & momentum()
Retrieve the momentum object associated with this particle Retrieve the momentum object associated wi...
Definition
Particle.h:122
cepgen::Particle::pdgId
pdgid_t pdgId() const
Retrieve the objectified PDG identifier Set the PDG identifier (along with the particle's electric ch...
cepgen::Particle::addChild
Particle & addChild(Particle &child_particle)
Add a decay product.
cepgen::Particle::momentum_
Momentum momentum_
Momentum properties handler.
Definition
Particle.h:156
cepgen::Particle::operator<<
friend std::ostream & operator<<(std::ostream &os, const Status &)
Human-readable particle's status Role of the particle in the process.
cepgen::Particle::helicity_
float helicity_
Helicity.
Definition
Particle.h:157
cepgen::Particle::mothers
ParticlesIds & mothers()
Identifier to the mother particles.
Definition
Particle.h:144
cepgen::Particle::operator<<
friend std::ostream & operator<<(std::ostream &os, const Role &)
Human-readable particle's role in the event.
cepgen::Particle::setMomentum
Particle & setMomentum(double px, double py, double pz, double energy=-1.)
Set the 3- or 4-momentum associated with the particle.
cepgen::Particle::operator<
bool operator<(const Particle &) const
Comparison operator (from unique identifier)
cepgen::Particle::setStatus
Particle & setStatus(int status)
Set the particle decay/stability status.
Definition
Particle.h:100
cepgen::Particle::role_
Role role_
Role in the process.
Definition
Particle.h:158
cepgen::Particle::valid
bool valid() const
Is this particle a valid particle which can be used for kinematic computations?
cepgen::Particle::helicity
float helicity() const
Particle's helicity Set the helicity of the particle.
Definition
Particle.h:115
cepgen::Particle::status_
int status_
Decay/stability status.
Definition
Particle.h:159
cepgen::Particle::operator<<
friend std::ostream & operator<<(std::ostream &, const Particle &)
Human-readable dump of particle information.
cepgen::Particle::integerPdgId
long integerPdgId() const
Retrieve the integer value of the PDG identifier.
cepgen::Particle::setPdgId
Particle & setPdgId(pdgid_t pdg, short charge_factor=0)
Set the PDG identifier (along with the particle's electric charge)
cepgen::Particle::children
ParticlesIds children() const
Identifiers list of all child particles.
Definition
Particle.h:146
cepgen::Particle::momentum
const Momentum & momentum() const
Definition
Particle.h:124
cepgen::Particle::Status
Status
Internal status code for a particle.
Definition
Particle.h:35
cepgen::Particle::Status::Undecayed
@ Undecayed
Particle to be decayed externally.
cepgen::Particle::Status::Fragmented
@ Fragmented
Already fragmented outgoing beam.
cepgen::Particle::Status::PrimordialIncoming
@ PrimordialIncoming
Incoming beam particle.
cepgen::Particle::Status::Incoming
@ Incoming
Incoming parton.
cepgen::Particle::Status::FinalState
@ FinalState
Stable, final state particle.
cepgen::Particle::Status::Resonance
@ Resonance
Already decayed intermediate resonance.
cepgen::Particle::Status::Unfragmented
@ Unfragmented
Particle to be hadronised externally.
cepgen::Particle::Status::Propagator
@ Propagator
Generic propagator.
cepgen::Particle::Status::DebugResonance
@ DebugResonance
Intermediate resonance (for processes developers)
cepgen::Particle::Status::Undefined
@ Undefined
Undefined particle.
cepgen::Particle::id
int id() const
Unique identifier (in a Event object context) Set the particle unique identifier in an event.
Definition
Particle.h:75
cepgen::Particle::Particle
Particle(Role role=Role::UnknownRole, pdgid_t id=0, Status status=Status::Undefined)
Build using the role of the particle in the process and its PDG id.
cepgen::Particle::children_
ParticlesIds children_
List of child particles.
Definition
Particle.h:161
cepgen::Particle::mothers
ParticlesIds mothers() const
Identifier to the mother particles.
Definition
Particle.h:143
cepgen::Particle::setIntegerPdgId
Particle & setIntegerPdgId(long pdg_id)
cepgen::Particle::setAntiparticle
Particle & setAntiparticle(bool anti)
Definition
Particle.h:83
cepgen::Particle::setRole
Particle & setRole(const Role &role)
Definition
Particle.h:89
cepgen::Particle::charge
float charge() const
Electric charge (given as a float number, for the quarks and bound states) Set whether we are coping ...
cepgen::Particle::operator==
bool operator==(const Particle &) const
Equality operator.
cepgen::Particle::primary
bool primary() const
Is this particle a primary particle?
Definition
Particle.h:141
cepgen::Particle::antiparticle_
bool antiparticle_
Are we dealing with the particle or antiparticle?
Definition
Particle.h:155
cepgen::Particle::setHelicity
Particle & setHelicity(float heli)
Definition
Particle.h:117
cepgen::Particle::id_
int id_
Unique identifier in an event.
Definition
Particle.h:154
cepgen::Particle::children
ParticlesIds & children()
Identifiers list of all child particles.
Definition
Particle.h:147
cepgen::Particle::setMomentum
Particle & setMomentum(const Momentum &, bool off_shell=false)
Associate a momentum object with this particle.
cepgen::Particle::setMomentum
Particle & setMomentum(double p[4])
Set the 4-momentum associated with the particle.
Definition
Particle.h:136
cepgen::Particle::Role
Role
Definition
Particle.h:49
cepgen::Particle::Role::OutgoingBeam2
@ OutgoingBeam2
outgoing beam state/particle
cepgen::Particle::Role::CentralSystem
@ CentralSystem
Central particles system.
cepgen::Particle::Role::Parton2
@ Parton2
beam incoming parton
cepgen::Particle::Role::OutgoingBeam1
@ OutgoingBeam1
outgoing beam state/particle
cepgen::Particle::Role::IncomingBeam2
@ IncomingBeam2
incoming beam particle
cepgen::Particle::Role::Intermediate
@ Intermediate
Intermediate two-parton system.
cepgen::Particle::Role::Parton1
@ Parton1
beam incoming parton
cepgen::Particle::Role::UnknownRole
@ UnknownRole
Undefined role.
cepgen::Particle::Role::IncomingBeam1
@ IncomingBeam1
incoming beam particle
cepgen::Particle::mothers_
ParticlesIds mothers_
List of mother particles.
Definition
Particle.h:160
cepgen::Particle::status
Status status() const
Particle status Set the particle decay/stability status.
Definition
Particle.h:93
cepgen::Particle::pdg_id_
pdgid_t pdg_id_
PDG id.
Definition
Particle.h:162
cepgen::Particle::setId
Particle & setId(int id)
Definition
Particle.h:77
cepgen::Particle::role
Role role() const
Role in the considered process Set the particle role in the process.
Definition
Particle.h:87
cepgen::Particle::setStatus
Particle & setStatus(Status status)
Definition
Particle.h:95
cepgen::Particle::addMother
Particle & addMother(Particle &mother_particle)
Set the mother particle.
cepgen::ParticlesMap
Map between a particle's role and its associated Particle object.
Definition
Particle.h:173
cepgen::ParticlesMap::ParticlesMap
ParticlesMap()=default
cepgen::ParticlesMap::~ParticlesMap
~ParticlesMap()=default
cepgen::ParticlesMap::ParticlesMap
ParticlesMap(const ParticlesMap &)
Copy constructor.
cepgen::ParticlesMap::operator=
ParticlesMap & operator=(const ParticlesMap &)
Assignment operator.
cepgen
Common namespace for this Monte Carlo generator.
Definition
Handler.h:26
cepgen::ParticlesIds
std::set< int > ParticlesIds
A set of integer-type particle identifiers.
Definition
Particle.h:29
cepgen::pdgid_t
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
Definition
ParticleProperties.h:25
cepgen::ParticleRoles
std::vector< Particle::Role > ParticleRoles
List of particles' roles.
Definition
Particle.h:170
cepgen::ParticlesRefs
std::vector< ParticleRef > ParticlesRefs
List of references to Particle objects.
Definition
Particle.h:169
cepgen::Particles
std::vector< Particle > Particles
List of Particle objects.
Definition
Particle.h:168
cepgen::ParticleRef
std::reference_wrapper< Particle > ParticleRef
Reference to a Particle object.
Definition
Particle.h:167
pdg
Definition
MCDFileParser.h:25
include
CepGen
Event
Particle.h
Generated on Tue Apr 22 2025 for CepGen by
1.10.0