cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
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-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
#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
71
bool
operator<
(
const
Particle
&)
const
;
72
bool
operator==
(
const
Particle
&)
const
;
73
74
// --- general particle properties
75
76
inline
int
id
()
const
{
return
id_
; }
78
inline
Particle
&
setId
(
int
id
) {
79
id_
=
id
;
80
return
*
this
;
81
}
82
float
charge
()
const
;
84
inline
Particle
&
setAntiparticle
(
bool
anti) {
85
antiparticle_
= anti;
86
return
*
this
;
87
}
88
inline
Role
role
()
const
{
return
role_
; }
90
inline
Particle
&
setRole
(
const
Role
&
role
) {
91
role_
=
role
;
92
return
*
this
;
93
}
94
inline
Status
status
()
const
{
return
(
Status
)
status_
; }
96
inline
Particle
&
setStatus
(
Status
status
) {
97
status_
= (int)
status
;
98
return
*
this
;
99
}
101
inline
Particle
&
setStatus
(
int
status
) {
102
status_
=
status
;
103
return
*
this
;
104
}
105
109
Particle
&
setPdgId
(
pdgid_t
pdg
,
short
ch = 0);
110
pdgid_t
pdgId
()
const
;
113
Particle
&
setIntegerPdgId
(
long
pdg_id);
114
long
integerPdgId
()
const
;
115
116
inline
float
helicity
()
const
{
return
helicity_
; }
118
inline
Particle
&
setHelicity
(
float
heli) {
119
helicity_
= heli;
120
return
*
this
;
121
}
122
123
inline
Momentum
&
momentum
() {
return
momentum_
; }
125
inline
const
Momentum
&
momentum
()
const
{
return
momentum_
; }
128
Particle
&
setMomentum
(
const
Momentum
&,
bool
offshell =
false
);
134
Particle
&
setMomentum
(
double
px,
double
py,
double
pz,
double
e = -1.);
137
inline
Particle
&
setMomentum
(
double
p[4]) {
return
setMomentum
(p[0], p[1], p[2], p[3]); }
138
bool
valid
();
139
140
// --- particle relations
141
142
inline
bool
primary
()
const
{
return
mothers_
.empty(); }
143
Particle
&
addMother
(
Particle
& part);
144
inline
ParticlesIds
mothers
()
const
{
return
mothers_
; }
145
inline
ParticlesIds
&
mothers
() {
return
mothers_
; }
146
Particle
&
addDaughter
(
Particle
& part);
147
inline
ParticlesIds
daughters
()
const
{
return
daughters_
; }
148
inline
ParticlesIds
&
daughters
() {
return
daughters_
; }
149
150
// --- global particle information extraction
151
152
friend
std::ostream&
operator<<
(std::ostream&,
const
Particle
&);
153
154
protected
:
155
int
id_
{-1};
156
bool
antiparticle_
{
false
};
157
Momentum
momentum_
;
158
float
helicity_
{0.};
159
Role
role_
{
UnknownRole
};
160
int
status_
{(int)
Status::Undefined
};
161
ParticlesIds
mothers_
;
162
ParticlesIds
daughters_
;
163
pdgid_t
pdg_id_
{(
pdgid_t
)0};
164
};
165
166
// --- particle containers
167
168
typedef
std::reference_wrapper<Particle>
ParticleRef
;
169
typedef
std::vector<Particle>
Particles
;
170
typedef
std::vector<ParticleRef>
ParticlesRefs
;
171
typedef
std::vector<Particle::Role>
ParticleRoles
;
172
174
class
ParticlesMap
:
public
std::unordered_map<Particle::Role, Particles, utils::EnumHash<Particle::Role> > {
175
public
:
176
ParticlesMap
() =
default
;
177
ParticlesMap
(
const
ParticlesMap
&);
178
ParticlesMap
&
operator=
(
const
ParticlesMap
&);
179
};
180
}
// namespace cepgen
181
182
#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:123
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:91
cepgen::Particle::addDaughter
Particle & addDaughter(Particle &part)
Add a decay product.
Definition
Particle.cpp:59
cepgen::Particle::momentum_
Momentum momentum_
Momentum properties handler.
Definition
Particle.h:157
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:130
cepgen::Particle::helicity_
float helicity_
Helicity.
Definition
Particle.h:158
cepgen::Particle::valid
bool valid()
Is this particle a valid particle which can be used for kinematic computations?
Definition
Particle.cpp:37
cepgen::Particle::mothers
ParticlesIds & mothers()
Identifier to the mother particles.
Definition
Particle.h:145
cepgen::Particle::operator<
bool operator<(const Particle &) const
Comparison operator (from unique identifier)
Definition
Particle.cpp:30
cepgen::Particle::setStatus
Particle & setStatus(int status)
Set the particle decay/stability status.
Definition
Particle.h:101
cepgen::Particle::role_
Role role_
Role in the process.
Definition
Particle.h:159
cepgen::Particle::helicity
float helicity() const
Particle's helicity Set the helicity of the particle.
Definition
Particle.h:116
cepgen::Particle::daughters
ParticlesIds daughters() const
Identifiers list of all daughter particles.
Definition
Particle.h:147
cepgen::Particle::status_
int status_
Decay/stability status.
Definition
Particle.h:160
cepgen::Particle::integerPdgId
long integerPdgId() const
Retrieve the integer value of the PDG identifier.
Definition
Particle.cpp:102
cepgen::Particle::setMomentum
Particle & setMomentum(const Momentum &, bool offshell=false)
Associate a momentum object to this particle.
Definition
Particle.cpp:77
cepgen::Particle::addMother
Particle & addMother(Particle &part)
Set the mother particle.
Definition
Particle.cpp:47
cepgen::Particle::momentum
const Momentum & momentum() const
Definition
Particle.h:125
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:76
cepgen::Particle::mothers
ParticlesIds mothers() const
Identifier to the mother particles.
Definition
Particle.h:144
cepgen::Particle::setIntegerPdgId
Particle & setIntegerPdgId(long pdg_id)
Definition
Particle.cpp:95
cepgen::Particle::setAntiparticle
Particle & setAntiparticle(bool anti)
Definition
Particle.h:84
cepgen::Particle::setRole
Particle & setRole(const Role &role)
Definition
Particle.h:90
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:45
cepgen::Particle::operator==
bool operator==(const Particle &) const
Equality operator.
Definition
Particle.cpp:32
cepgen::Particle::primary
bool primary() const
Is this particle a primary particle?
Definition
Particle.h:142
cepgen::Particle::antiparticle_
bool antiparticle_
Are we dealing with the particle or antiparticle?
Definition
Particle.h:156
cepgen::Particle::setHelicity
Particle & setHelicity(float heli)
Definition
Particle.h:118
cepgen::Particle::id_
int id_
Unique identifier in an event.
Definition
Particle.h:155
cepgen::Particle::setMomentum
Particle & setMomentum(double p[4])
Set the 4-momentum associated to the particle.
Definition
Particle.h:137
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:161
cepgen::Particle::status
Status status() const
Particle status Set the particle decay/stability status.
Definition
Particle.h:94
cepgen::Particle::pdg_id_
pdgid_t pdg_id_
PDG id.
Definition
Particle.h:163
cepgen::Particle::setId
Particle & setId(int id)
Definition
Particle.h:78
cepgen::Particle::daughters
ParticlesIds & daughters()
Identifiers list of all daughter particles.
Definition
Particle.h:148
cepgen::Particle::role
Role role() const
Role in the considered process Set the particle role in the process.
Definition
Particle.h:88
cepgen::Particle::setStatus
Particle & setStatus(Status status)
Definition
Particle.h:96
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:93
cepgen::Particle::daughters_
ParticlesIds daughters_
List of daughter particles.
Definition
Particle.h:162
cepgen::ParticlesMap
Map between a particle's role and its associated Particle object.
Definition
Particle.h:174
cepgen::ParticlesMap::ParticlesMap
ParticlesMap()=default
cepgen::ParticlesMap::operator=
ParticlesMap & operator=(const ParticlesMap &)
Definition
Particle.cpp:185
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:171
cepgen::ParticleRef
std::reference_wrapper< Particle > ParticleRef
Reference to a Particle object.
Definition
Particle.h:168
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:170
cepgen::Particles
std::vector< Particle > Particles
List of Particle objects.
Definition
Particle.h:169
pdg
Definition
MCDFileParser.cpp:28
CepGen
Event
Particle.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7