ATLAS Offline Software
ParticleBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PARTICLEEVENT_PARTICLEBASE_H
6 #define PARTICLEEVENT_PARTICLEBASE_H
7 
9 
10 #include "VxVertex/VxContainer.h"
11 #include "VxVertex/VxCandidate.h"
12 #include "AthLinks/ElementLink.h"
15 
16 class ParticleBase : public virtual IParticle
17 {
18  public:
19 
21  ParticleBase();
22 
25  ParticleBase( const ParticleBase& rhs );
26 
29  ParticleBase& operator=( const ParticleBase& rhs );
30 
32  virtual ~ParticleBase();
33 
34  // standard IParticle methods
38  virtual ParticleDataType::DataType dataType() const;
39 
41  virtual const Trk::RecVertex* origin() const ;
42 
44  virtual const ElementLink<VxContainer>& originLink () const { return m_origin; }
45 
47  virtual bool hasCharge() const;
48 
52  virtual ChargeType charge() const;
53 
55  virtual bool hasPdgId() const;
56 
58  virtual int pdgId() const;
59 
60  // Set functions (for IParticle)
63  void set_pdgId(int x ) { m_pdgId = x; m_hasPdgId = true;}
64  void reset_charge() { m_hasCharge = false; }
65  void reset_pdgId() { m_hasPdgId = false; }
66  void set_origin(const VxContainer* theContainer, int index);
67  void set_origin(const VxContainer* theContainer, const Trk::VxCandidate * vertex );
69 
70  private:
71 
75  int m_pdgId;
76  bool m_hasPdgId;
78 
79 };
80 
81 inline void ParticleBase::set_origin(const VxContainer* const theContainer, int index)
82 {
83  m_origin.toIndexedElement( *theContainer, index) ;
84 }
85 inline void ParticleBase::set_origin(const VxContainer* theContainer, const Trk::VxCandidate * vertex )
86 {
87  m_origin.toContainedElement(*theContainer, vertex);
88 }
90 {
91  m_origin = origin;
92 }
94 {
95  return m_dataType;
96 }
97 inline bool ParticleBase::hasCharge() const { return m_hasCharge;}
98 inline ChargeType ParticleBase::charge() const { return m_charge ;}
99 inline bool ParticleBase::hasPdgId() const {return m_hasPdgId ;}
100 inline int ParticleBase::pdgId() const {return m_pdgId;}
101 
103 
104 #endif // PARTICLEEVENT_PARTICLEBASE_H
ParticleBase
Definition: ParticleBase.h:17
ParticleBase::dataType
virtual ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
Definition: ParticleBase.h:93
index
Definition: index.py:1
ParticleBase::reset_charge
void reset_charge()
Definition: ParticleBase.h:64
ParticleBase::ParticleBase
ParticleBase()
Default constructor.
Definition: ParticleBase.cxx:25
ParticleBase::~ParticleBase
virtual ~ParticleBase()
Destructor.
Definition: ParticleBase.cxx:71
IParticle.h
x
#define x
ParticleDataType::DataType
DataType
Definition: Event/EventKernel/EventKernel/IParticle.h:36
ParticleBase::m_charge
ChargeType m_charge
Definition: ParticleBase.h:73
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
ParticleBase::pdgId
virtual int pdgId() const
Return particle id.
Definition: ParticleBase.h:100
ParticleBase::hasCharge
virtual bool hasCharge() const
method to check if charge information is available
Definition: ParticleBase.h:97
ParticleBase::m_hasPdgId
bool m_hasPdgId
Definition: ParticleBase.h:76
ParticleBase::hasPdgId
virtual bool hasPdgId() const
method to check if particle id information is available
Definition: ParticleBase.h:99
ParticleBase::originLink
virtual const ElementLink< VxContainer > & originLink() const
Return an ElementLink corresponding to particle's Origin.
Definition: ParticleBase.h:44
ParticleBase::m_pdgId
int m_pdgId
Definition: ParticleBase.h:75
DATAVECTOR_VIRTBASES1
DATAVECTOR_VIRTBASES1(ParticleBase, IParticle)
ParticleBase::origin
virtual const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin
Definition: ParticleBase.cxx:76
VxContainer.h
VxContainer
Definition: VxContainer.h:28
VxCandidate.h
ParticleBase::reset_pdgId
void reset_pdgId()
Definition: ParticleBase.h:65
ParticleBase::m_hasCharge
bool m_hasCharge
Definition: ParticleBase.h:74
ChargeType
double ChargeType
typedef ChargeType used to anticipate changes here
Definition: Event/EventKernel/EventKernel/IParticle.h:40
ParticleBase::operator=
ParticleBase & operator=(const ParticleBase &rhs)
Assignement operator.
Definition: ParticleBase.cxx:52
ParticleBase::set_dataType
void set_dataType(ParticleDataType::DataType x)
Definition: ParticleBase.h:61
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
ParticleBase::set_charge
void set_charge(ChargeType x)
Definition: ParticleBase.h:62
Trk::VxCandidate
Definition: VxCandidate.h:27
ParticleBase::charge
virtual ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
Definition: ParticleBase.h:98
ParticleBase::m_origin
ElementLink< VxContainer > m_origin
Definition: ParticleBase.h:72
IParticleContainer.h
ParticleBase::m_dataType
ParticleDataType::DataType m_dataType
Definition: ParticleBase.h:77
ParticleBase::set_origin
void set_origin(const VxContainer *theContainer, int index)
Definition: ParticleBase.h:81
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
ParticleBase::set_pdgId
void set_pdgId(int x)
Definition: ParticleBase.h:63