ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TruthParticleID
McParticleEvent
McParticleEvent
TruthParticleBase.h
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// TruthParticleBase.h
8
// Header file for class TruthParticleBase
9
// Author: S.Binet<binet@cern.ch>
11
#ifndef MCPARTICLEEVENT_TRUTHPARTICLEBASE_H
12
#define MCPARTICLEEVENT_TRUTHPARTICLEBASE_H
13
14
// STL includes
15
16
// HepMC / CLHEP includes
17
#include "
AtlasHepMC/GenParticle.h
"
18
19
// Gaudi includes
20
21
// EventKernel includes
22
#include "
EventKernel/IParticle.h
"
// for {Charge,ParticleDataType::Data}Type
23
24
// Navigation includes
25
#include "
Navigation/AthenaBarCodeImpl.h
"
26
#include "AthLinks/ElementLink.h"
27
#include "
VxVertex/VxContainer.h
"
28
29
// Forward declaration
30
namespace
Trk
{
class
RecVertex
; }
31
namespace
Trk
{
class
VxCandidate
;}
32
33
class
TruthParticleBase
34
{
35
37
// Public methods:
39
public
:
40
43
TruthParticleBase
();
44
47
TruthParticleBase
(
const
TruthParticleBase
& rhs );
48
51
TruthParticleBase
&
operator=
(
const
TruthParticleBase
& rhs );
52
55
TruthParticleBase
(
const
HepMC::GenParticlePtr
mc
);
56
59
~TruthParticleBase
();
60
62
// Const methods:
64
67
71
ParticleDataType::DataType
dataType
()
const
;
72
74
const
Trk::RecVertex
*
origin
()
const
;
75
77
const
ElementLink<VxContainer>
&
originLink
()
const
;
78
80
bool
hasCharge
()
const
;
81
85
ChargeType
charge
()
const
;
86
88
bool
hasPdgId
()
const
;
89
91
int
pdgId
()
const
;
92
94
std::ostream&
dump
( std::ostream& out )
const
;
95
98
100
HepMC::ConstGenParticlePtr
genParticle
()
const
;
101
103
const
AthenaBarCodeImpl
&
getAthenaBarCodeImpl
()
const
{
return
m_abc
;}
104
106
// Non-const methods:
108
110
void
setCharge
(
const
ChargeType
charge
);
111
113
void
setGenParticle
(
HepMC::ConstGenParticlePtr
particle );
114
116
AthenaBarCodeImpl
&
getAthenaBarCodeImpl
() {
return
m_abc
;}
117
118
// Set functions (for IParticle) (all dummy)
119
void
set_dataType
(
ParticleDataType::DataType
/*x*/
) {std::abort();}
120
void
set_charge
(
ChargeType
x
) {
setCharge
(
x
);}
121
void
set_pdgId
(
int
/*x*/
) {std::abort();}
122
void
set_origin
(
const
VxContainer
*
/*theContainer*/
,
int
/*index*/
)
123
{std::abort();}
124
void
set_origin
(
const
VxContainer
*
/*theContainer*/
,
125
const
Trk::VxCandidate
*
/*vertex*/
)
126
{std::abort();}
127
129
// Private data:
131
private
:
132
134
ChargeType
m_charge
;
135
137
HepMC::ConstGenParticlePtr
m_genParticle
;
138
141
AthenaBarCodeImpl
m_abc
;
142
143
};
144
146
// Inline methods:
148
149
inline
150
ParticleDataType::DataType
TruthParticleBase::dataType
()
const
151
{
152
return
ParticleDataType::True
;
153
}
154
155
inline
156
bool
TruthParticleBase::hasCharge
()
const
157
{
158
return
true
;
159
}
160
161
inline
162
ChargeType
TruthParticleBase::charge
()
const
163
{
164
return
m_charge
;
165
}
166
167
inline
168
bool
TruthParticleBase::hasPdgId
()
const
169
{
170
return
true
;
171
}
172
173
inline
174
int
TruthParticleBase::pdgId
()
const
175
{
176
return
m_genParticle
->pdg_id();
177
}
178
179
inline
180
HepMC::ConstGenParticlePtr
TruthParticleBase::genParticle
()
const
181
{
182
return
m_genParticle
;
183
}
184
185
inline
186
void
TruthParticleBase::setCharge
(
const
ChargeType
charge
)
187
{
188
m_charge
=
charge
;
189
}
190
191
inline
192
void
TruthParticleBase::setGenParticle
(
HepMC::ConstGenParticlePtr
mc
)
193
{
194
m_genParticle
= std::move(
mc
);
195
}
196
197
#endif
//> MCPARTICLEEVENT_TRUTHPARTICLEBASE_H
AthenaBarCodeImpl.h
charge
double charge(const T &p)
Definition
AtlasPID.h:1003
IParticle.h
ChargeType
double ChargeType
typedef ChargeType used to anticipate changes here
Definition
Event/EventKernel/EventKernel/IParticle.h:40
GenParticle.h
x
#define x
VxContainer.h
AthenaBarCodeImpl
Definition
AthenaBarCodeImpl.h:37
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition
RecVertex.h:44
Trk::VxCandidate
Definition
VxCandidate.h:27
TruthParticleBase::setCharge
void setCharge(const ChargeType charge)
Set the charge of this TruthParticleBase.
Definition
TruthParticleBase.h:186
TruthParticleBase::set_dataType
void set_dataType(ParticleDataType::DataType)
Definition
TruthParticleBase.h:119
TruthParticleBase::hasPdgId
bool hasPdgId() const
method to check if particle id information is available
Definition
TruthParticleBase.h:168
TruthParticleBase::getAthenaBarCodeImpl
AthenaBarCodeImpl & getAthenaBarCodeImpl()
return the (atlas) unique identifier
Definition
TruthParticleBase.h:116
TruthParticleBase::dataType
ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
Definition
TruthParticleBase.h:150
TruthParticleBase::m_genParticle
HepMC::ConstGenParticlePtr m_genParticle
The HepMC::GenParticle we are proxying.
Definition
TruthParticleBase.h:137
TruthParticleBase::originLink
const ElementLink< VxContainer > & originLink() const
Return the ElementLink to particle Origin.
Definition
TruthParticleBase.cxx:76
TruthParticleBase::m_abc
AthenaBarCodeImpl m_abc
The AthenaBarCodeImpl held to provide unique identification throughout the whole Atlas EDM.
Definition
TruthParticleBase.h:141
TruthParticleBase::m_charge
ChargeType m_charge
The charge of this TruthParticle.
Definition
TruthParticleBase.h:134
TruthParticleBase::getAthenaBarCodeImpl
const AthenaBarCodeImpl & getAthenaBarCodeImpl() const
return the (atlas) unique identifier
Definition
TruthParticleBase.h:103
TruthParticleBase::set_origin
void set_origin(const VxContainer *, int)
Definition
TruthParticleBase.h:122
TruthParticleBase::set_charge
void set_charge(ChargeType x)
Definition
TruthParticleBase.h:120
TruthParticleBase::pdgId
int pdgId() const
Return eparticle id.
Definition
TruthParticleBase.h:174
TruthParticleBase::hasCharge
bool hasCharge() const
method to check if charge information is available
Definition
TruthParticleBase.h:156
TruthParticleBase::operator=
TruthParticleBase & operator=(const TruthParticleBase &rhs)
Assignment operator:
Definition
TruthParticleBase.cxx:41
TruthParticleBase::origin
const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin.
Definition
TruthParticleBase.cxx:69
TruthParticleBase::charge
ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
Definition
TruthParticleBase.h:162
TruthParticleBase::TruthParticleBase
TruthParticleBase()
Default constructor:
Definition
TruthParticleBase.cxx:28
TruthParticleBase::genParticle
HepMC::ConstGenParticlePtr genParticle() const
return the HepMC::GenParticle which is being proxied
Definition
TruthParticleBase.h:180
TruthParticleBase::setGenParticle
void setGenParticle(HepMC::ConstGenParticlePtr particle)
Fill the data members of ParticleBase from the GenParticle.
Definition
TruthParticleBase.h:192
TruthParticleBase::~TruthParticleBase
~TruthParticleBase()
Destructor:
Definition
TruthParticleBase.cxx:61
TruthParticleBase::set_pdgId
void set_pdgId(int)
Definition
TruthParticleBase.h:121
TruthParticleBase::set_origin
void set_origin(const VxContainer *, const Trk::VxCandidate *)
Definition
TruthParticleBase.h:124
VxContainer
Definition
VxContainer.h:28
HepMC::GenParticlePtr
HepMC3::GenParticlePtr GenParticlePtr
Definition
GenParticle.h:19
HepMC::ConstGenParticlePtr
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition
GenParticle.h:20
ParticleDataType::DataType
DataType
Definition
Event/EventKernel/EventKernel/IParticle.h:36
ParticleDataType::True
@ True
Definition
Event/EventKernel/EventKernel/IParticle.h:36
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
dump
-event-from-file
mc
Definition
mc.Ep4_simple_OO.py:1
Generated on
for ATLAS Offline Software by
1.17.0