ATLAS Offline Software
TruthParticleBase.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2017 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
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 
34 {
35 
37  // Public methods:
39  public:
40 
44 
48 
52 
56 
60 
62  // Const methods:
64 
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 
101 
104 
106  // Non-const methods:
108 
110  void setCharge( const ChargeType charge );
111 
114 
117 
118  // Set functions (for IParticle) (all dummy)
119  void set_dataType( ParticleDataType::DataType /*x*/ ) {std::abort();}
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 
135 
138 
142 
143 };
144 
146 // Inline methods:
148 
149 inline
151 {
152  return ParticleDataType::True;
153 }
154 
155 inline
157 {
158  return true;
159 }
160 
161 inline
163 {
164  return m_charge;
165 }
166 
167 inline
169 {
170  return true;
171 }
172 
173 inline
175 {
176  return m_genParticle->pdg_id();
177 }
178 
179 inline
181 {
182  return m_genParticle;
183 }
184 
185 inline
187 {
188  m_charge = charge;
189 }
190 
191 inline
193 {
194  m_genParticle = mc;
195 }
196 
197 #endif //> MCPARTICLEEVENT_TRUTHPARTICLEBASE_H
TruthParticleBase::m_abc
AthenaBarCodeImpl m_abc
The AthenaBarCodeImpl held to provide unique identification throughout the whole Atlas EDM.
Definition: TruthParticleBase.h:141
AthenaBarCodeImpl.h
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
TruthParticleBase::operator=
TruthParticleBase & operator=(const TruthParticleBase &rhs)
Assignment operator:
Definition: TruthParticleBase.cxx:41
TruthParticleBase::set_origin
void set_origin(const VxContainer *, const Trk::VxCandidate *)
Definition: TruthParticleBase.h:124
TruthParticleBase::hasPdgId
bool hasPdgId() const
method to check if particle id information is available
Definition: TruthParticleBase.h:168
TruthParticleBase::dump
std::ostream & dump(std::ostream &out) const
Print IParticle content.
Definition: TruthParticleBase.cxx:83
AthenaBarCodeImpl
Definition: AthenaBarCodeImpl.h:37
TruthParticleBase::m_genParticle
HepMC::ConstGenParticlePtr m_genParticle
The HepMC::GenParticle we are proxying.
Definition: TruthParticleBase.h:137
TruthParticleBase::set_origin
void set_origin(const VxContainer *, int)
Definition: TruthParticleBase.h:122
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
TruthParticleBase
Definition: TruthParticleBase.h:34
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
IParticle.h
TruthParticleBase::~TruthParticleBase
~TruthParticleBase()
Destructor:
Definition: TruthParticleBase.cxx:61
x
#define x
ParticleDataType::DataType
DataType
Definition: Event/EventKernel/EventKernel/IParticle.h:36
TruthParticleBase::pdgId
int pdgId() const
Return eparticle id.
Definition: TruthParticleBase.h:174
GenParticle.h
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
TruthParticleBase::getAthenaBarCodeImpl
const AthenaBarCodeImpl & getAthenaBarCodeImpl() const
return the (atlas) unique identifier
Definition: TruthParticleBase.h:103
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::set_dataType
void set_dataType(ParticleDataType::DataType)
Definition: TruthParticleBase.h:119
mc
Definition: mc.PG_single_nu_valid.py:1
TruthParticleBase::hasCharge
bool hasCharge() const
method to check if charge information is available
Definition: TruthParticleBase.h:156
TruthParticleBase::set_charge
void set_charge(ChargeType x)
Definition: TruthParticleBase.h:120
TruthParticleBase::genParticle
HepMC::ConstGenParticlePtr genParticle() const
return the HepMC::GenParticle which is being proxied
Definition: TruthParticleBase.h:180
VxContainer.h
VxContainer
Definition: VxContainer.h:28
TruthParticleBase::TruthParticleBase
TruthParticleBase()
Default constructor:
Definition: TruthParticleBase.cxx:28
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
TruthParticleBase::origin
const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin
Definition: TruthParticleBase.cxx:69
ParticleDataType::True
@ True
Definition: Event/EventKernel/EventKernel/IParticle.h:36
charge
double charge(const T &p)
Definition: AtlasPID.h:538
TruthParticleBase::set_pdgId
void set_pdgId(int)
Definition: TruthParticleBase.h:121
ChargeType
double ChargeType
typedef ChargeType used to anticipate changes here
Definition: Event/EventKernel/EventKernel/IParticle.h:40
TruthParticleBase::setGenParticle
void setGenParticle(HepMC::ConstGenParticlePtr particle)
Fill the data members of ParticleBase from the GenParticle.
Definition: TruthParticleBase.h:192
TruthParticleBase::getAthenaBarCodeImpl
AthenaBarCodeImpl & getAthenaBarCodeImpl()
return the (atlas) unique identifier
Definition: TruthParticleBase.h:116
TruthParticleBase::setCharge
void setCharge(const ChargeType charge)
Set the charge of this TruthParticleBase.
Definition: TruthParticleBase.h:186
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::originLink
const ElementLink< VxContainer > & originLink() const
Return the ElementLink to particle Origin
Definition: TruthParticleBase.cxx:76
Trk::VxCandidate
Definition: VxCandidate.h:27
TruthParticleBase::m_charge
ChargeType m_charge
The charge of this TruthParticle.
Definition: TruthParticleBase.h:134
covarianceTool.mc
mc
Definition: covarianceTool.py:554