ATLAS Offline Software
Loading...
Searching...
No Matches
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
12#include "AthLinks/ElementLink.h"
15
16class ParticleBase : public virtual IParticle
17{
18 public:
19
22
25 ParticleBase( const ParticleBase& rhs );
26
29 ParticleBase& operator=( const ParticleBase& rhs );
30
32 virtual ~ParticleBase();
33
34 // standard IParticle methods
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
78
79};
80
81inline void ParticleBase::set_origin(const VxContainer* const theContainer, int index)
82{
83 m_origin.toIndexedElement( *theContainer, index) ;
84}
85inline void ParticleBase::set_origin(const VxContainer* theContainer, const Trk::VxCandidate * vertex )
86{
87 m_origin.toContainedElement(*theContainer, vertex);
88}
97inline bool ParticleBase::hasCharge() const { return m_hasCharge;}
98inline ChargeType ParticleBase::charge() const { return m_charge ;}
99inline bool ParticleBase::hasPdgId() const {return m_hasPdgId ;}
100inline int ParticleBase::pdgId() const {return m_pdgId;}
101
103
104#endif // PARTICLEEVENT_PARTICLEBASE_H
An STL vector of pointers that by default owns its pointed-to elements.
#define DATAVECTOR_VIRTBASES1(T, B1)
Declare base class info to DataVector.
Definition DataVector.h:673
double ChargeType
typedef ChargeType used to anticipate changes here
#define x
void set_charge(ChargeType x)
ParticleBase & operator=(const ParticleBase &rhs)
Assignement operator.
virtual ~ParticleBase()
Destructor.
void set_origin(const VxContainer *theContainer, int index)
ParticleBase()
Default constructor.
virtual ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
void set_dataType(ParticleDataType::DataType x)
virtual ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
virtual const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin.
virtual bool hasCharge() const
method to check if charge information is available
void reset_pdgId()
virtual const ElementLink< VxContainer > & originLink() const
Return an ElementLink corresponding to particle's Origin.
ElementLink< VxContainer > m_origin
virtual bool hasPdgId() const
method to check if particle id information is available
ParticleDataType::DataType m_dataType
ChargeType m_charge
virtual int pdgId() const
Return particle id.
void set_pdgId(int x)
void reset_charge()
Trk::RecVertex inherits from Trk::Vertex.
Definition RecVertex.h:44
Definition index.py:1