cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.3
A generic central exclusive processes event generator
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-2023 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/Constants.h
"
25
#include "
CepGen/Physics/Momentum.h
"
26
#include "
CepGen/Physics/ParticleProperties.h
"
27
#include "
CepGen/Utils/Hasher.h
"
28
29
namespace
cepgen
{
30
typedef
std::set<int>
ParticlesIds
;
31
33
class
Particle
{
34
public
:
36
enum class
Status
{
37
PrimordialIncoming
= -9,
38
DebugResonance
= -5,
39
Resonance
= -4,
40
Fragmented
= -3,
41
Propagator
= -2,
42
Incoming
= -1,
43
Undefined
= 0,
44
FinalState
= 1,
45
Undecayed
= 2,
46
Unfragmented
= 3
47
};
48
friend
std::ostream&
operator<<
(std::ostream& os,
const
Status
&);
50
enum
Role
{
51
UnknownRole
= -1,
52
IncomingBeam1
= 1,
53
IncomingBeam2
= 2,
54
OutgoingBeam1
= 3,
55
OutgoingBeam2
= 5,
56
CentralSystem
= 6,
57
Intermediate
= 4,
58
Parton1
= 41,
59
Parton2
= 42
60
};
61
friend
std::ostream&
operator<<
(std::ostream& os,
const
Role
&);
62
63
//----- static getters
64
69
explicit
Particle
(
Role
role
=
Role::UnknownRole
,
pdgid_t
id
= 0,
Status
st =
Status::Undefined
);
70
Particle
(
const
Particle
&);
71
inline
~Particle
() =
default
;
72
Particle
&
operator=
(
const
Particle
&) =
default
;
73
bool
operator<
(
const
Particle
& rhs)
const
;
74
75
// --- general particle properties
76
77
inline
int
id
()
const
{
return
id_
; }
79
inline
Particle
&
setId
(
int
id
) {
80
id_
=
id
;
81
return
*
this
;
82
}
83
float
charge
()
const
;
85
inline
Particle
&
setAntiparticle
(
bool
anti) {
86
antiparticle_
= anti;
87
return
*
this
;
88
}
89
inline
Role
role
()
const
{
return
role_
; }
91
inline
Particle
&
setRole
(
const
Role
&
role
) {
92
role_
=
role
;
93
return
*
this
;
94
}
95
inline
Status
status
()
const
{
return
(
Status
)
status_
; }
97
inline
Particle
&
setStatus
(
Status
status
) {
98
status_
= (int)
status
;
99
return
*
this
;
100
}
102
inline
Particle
&
setStatus
(
int
status
) {
103
status_
=
status
;
104
return
*
this
;
105
}
106
110
Particle
&
setPdgId
(
pdgid_t
pdg
,
short
ch = 0);
111
pdgid_t
pdgId
()
const
;
114
Particle
&
setIntegerPdgId
(
long
pdg_id);
115
long
integerPdgId
()
const
;
116
117
inline
float
helicity
()
const
{
return
helicity_
; }
119
inline
Particle
&
setHelicity
(
float
heli) {
120
helicity_
= heli;
121
return
*
this
;
122
}
123
124
inline
Momentum
&
momentum
() {
return
momentum_
; }
126
inline
const
Momentum
&
momentum
()
const
{
return
momentum_
; }
129
Particle
&
setMomentum
(
const
Momentum
&,
bool
offshell =
false
);
135
Particle
&
setMomentum
(
double
px,
double
py,
double
pz,
double
e = -1.);
138
inline
Particle
&
setMomentum
(
double
p[4]) {
return
setMomentum
(p[0], p[1], p[2], p[3]); }
139
bool
valid
();
140
141
// --- particle relations
142
143
inline
bool
primary
()
const
{
return
mothers_
.empty(); }
144
Particle
&
clearMothers
();
145
Particle
&
addMother
(
Particle
& part);
146
inline
ParticlesIds
mothers
()
const
{
return
mothers_
; }
147
Particle
&
clearDaughters
();
148
Particle
&
addDaughter
(
Particle
& part);
149
inline
size_t
numDaughters
()
const
{
return
daughters_
.size(); };
150
inline
ParticlesIds
daughters
()
const
{
return
daughters_
; }
151
152
// --- global particle information extraction
153
154
friend
std::ostream&
operator<<
(std::ostream&,
const
Particle
&);
155
156
protected
:
157
int
id_
{-1};
158
bool
antiparticle_
{
false
};
159
Momentum
momentum_
;
160
float
helicity_
{0.};
161
Role
role_
{
UnknownRole
};
162
int
status_
{(int)
Status::Undefined
};
163
ParticlesIds
mothers_
{};
164
ParticlesIds
daughters_
{};
165
pdgid_t
pdg_id_
{(
pdgid_t
)0};
166
ParticleProperties
phys_prop_
;
167
};
168
169
// --- particle containers
170
171
typedef
std::reference_wrapper<Particle>
ParticleRef
;
172
typedef
std::vector<Particle>
Particles
;
173
typedef
std::vector<ParticleRef>
ParticlesRefs
;
174
typedef
std::vector<Particle::Role>
ParticleRoles
;
175
177
class
ParticlesMap
:
public
std::unordered_map<Particle::Role, Particles, utils::EnumHash<Particle::Role> > {
178
public
:
179
ParticlesMap
() =
default
;
180
ParticlesMap
(
const
ParticlesMap
&);
181
ParticlesMap
&
operator=
(
const
ParticlesMap
&);
182
};
183
}
// namespace cepgen
184
185
#endif
Constants.h
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:33
cepgen::Particle
Kinematic information for one particle.
Definition
Particle.h:33
cepgen::Particle::momentum
Momentum & momentum()
Retrieve the momentum object associated with this particle Retrieve the momentum object associated wi...
Definition
Particle.h:124
cepgen::Particle::pdgId
pdgid_t pdgId() const
Retrieve the objectified PDG identifier Set the PDG identifier (along with the particle's electric ch...
Definition
Particle.cpp:118
cepgen::Particle::addDaughter
Particle & addDaughter(Particle &part)
Add a decay product.
Definition
Particle.cpp:83
cepgen::Particle::momentum_
Momentum momentum_
Momentum properties handler.
Definition
Particle.h:159
cepgen::Particle::operator<<
friend std::ostream & operator<<(std::ostream &os, const Status &)
Human-readable particle's status Role of the particle in the process.
Definition
Particle.cpp:160
cepgen::Particle::clearMothers
Particle & clearMothers()
Clear the particle parentage.
Definition
Particle.cpp:59
cepgen::Particle::helicity_
float helicity_
Helicity.
Definition
Particle.h:160
cepgen::Particle::valid
bool valid()
Is this particle a valid particle which can be used for kinematic computations?
Definition
Particle.cpp:49
cepgen::Particle::setStatus
Particle & setStatus(int status)
Set the particle decay/stability status.
Definition
Particle.h:102
cepgen::Particle::role_
Role role_
Role in the process.
Definition
Particle.h:161
cepgen::Particle::helicity
float helicity() const
Particle's helicity Set the helicity of the particle.
Definition
Particle.h:117
cepgen::Particle::daughters
ParticlesIds daughters() const
Number of daughter particles.
Definition
Particle.h:150
cepgen::Particle::~Particle
~Particle()=default
cepgen::Particle::status_
int status_
Decay/stability status.
Definition
Particle.h:162
cepgen::Particle::integerPdgId
long integerPdgId() const
Retrieve the integer value of the PDG identifier.
Definition
Particle.cpp:132
cepgen::Particle::operator<
bool operator<(const Particle &rhs) const
Comparison operator (from unique identifier)
Definition
Particle.cpp:47
cepgen::Particle::setMomentum
Particle & setMomentum(const Momentum &, bool offshell=false)
Associate a momentum object to this particle.
Definition
Particle.cpp:104
cepgen::Particle::addMother
Particle & addMother(Particle &part)
Set the mother particle.
Definition
Particle.cpp:64
cepgen::Particle::momentum
const Momentum & momentum() const
Definition
Particle.h:126
cepgen::Particle::Status
Status
Internal status code for a particle.
Definition
Particle.h:36
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:77
cepgen::Particle::mothers
ParticlesIds mothers() const
Identifier to the mother particles.
Definition
Particle.h:146
cepgen::Particle::setIntegerPdgId
Particle & setIntegerPdgId(long pdg_id)
Definition
Particle.cpp:122
cepgen::Particle::numDaughters
size_t numDaughters() const
Definition
Particle.h:149
cepgen::Particle::setAntiparticle
Particle & setAntiparticle(bool anti)
Definition
Particle.h:85
cepgen::Particle::clearDaughters
Particle & clearDaughters()
Remove the decay products linking.
Definition
Particle.cpp:78
cepgen::Particle::setRole
Particle & setRole(const Role &role)
Definition
Particle.h:91
cepgen::Particle::charge
float charge() const
Electric charge (given as a float number, for the quarks and bound states) Set whether we are coping ...
Definition
Particle.cpp:57
cepgen::Particle::primary
bool primary() const
Is this particle a primary particle?
Definition
Particle.h:143
cepgen::Particle::antiparticle_
bool antiparticle_
Are we dealing with the particle or antiparticle?
Definition
Particle.h:158
cepgen::Particle::setHelicity
Particle & setHelicity(float heli)
Definition
Particle.h:119
cepgen::Particle::id_
int id_
Unique identifier in an event.
Definition
Particle.h:157
cepgen::Particle::setMomentum
Particle & setMomentum(double p[4])
Set the 4-momentum associated to the particle.
Definition
Particle.h:138
cepgen::Particle::phys_prop_
ParticleProperties phys_prop_
Collection of standard, bare-level physical properties.
Definition
Particle.h:166
cepgen::Particle::Role
Role
Definition
Particle.h:50
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::UnknownRole
@ UnknownRole
Undefined role.
Definition
Particle.h:51
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::Particle::Intermediate
@ Intermediate
Intermediate two-parton system.
Definition
Particle.h:57
cepgen::Particle::mothers_
ParticlesIds mothers_
List of mother particles.
Definition
Particle.h:163
cepgen::Particle::operator=
Particle & operator=(const Particle &)=default
Assignment operator.
cepgen::Particle::status
Status status() const
Particle status Set the particle decay/stability status.
Definition
Particle.h:95
cepgen::Particle::pdg_id_
pdgid_t pdg_id_
PDG id.
Definition
Particle.h:165
cepgen::Particle::setId
Particle & setId(int id)
Definition
Particle.h:79
cepgen::Particle::role
Role role() const
Role in the considered process Set the particle role in the process.
Definition
Particle.h:89
cepgen::Particle::setStatus
Particle & setStatus(Status status)
Definition
Particle.h:97
cepgen::Particle::setPdgId
Particle & setPdgId(pdgid_t pdg, short ch=0)
Set the PDG identifier (along with the particle's electric charge)
Definition
Particle.cpp:120
cepgen::Particle::daughters_
ParticlesIds daughters_
List of daughter particles.
Definition
Particle.h:164
cepgen::ParticlesMap
Map between a particle's role and its associated Particle object.
Definition
Particle.h:177
cepgen::ParticlesMap::ParticlesMap
ParticlesMap()=default
cepgen::ParticlesMap::operator=
ParticlesMap & operator=(const ParticlesMap &)
Definition
Particle.cpp:215
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::ParticleRoles
std::vector< Particle::Role > ParticleRoles
List of particles' roles.
Definition
Particle.h:174
cepgen::ParticleRef
std::reference_wrapper< Particle > ParticleRef
Reference to a Particle object.
Definition
Particle.h:171
cepgen::ParticlesIds
std::set< int > ParticlesIds
A set of integer-type particle identifiers.
Definition
Particle.h:30
cepgen::pdgid_t
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
Definition
ParticleProperties.h:26
cepgen::ParticlesRefs
std::vector< ParticleRef > ParticlesRefs
List of references to Particle objects.
Definition
Particle.h:173
cepgen::Particles
std::vector< Particle > Particles
List of Particle objects.
Definition
Particle.h:172
pdg
Definition
MCDFileParser.cpp:28
cepgen::ParticleProperties
A collection of physics constants associated to a single particle.
Definition
ParticleProperties.h:31
CepGen
Event
Particle.h
Generated on Thu Apr 25 2024 for CepGen by
1.9.7