ATLAS Offline Software
Event/xAOD/xAODBase/xAODBase/IParticle.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef XAODBASE_IPARTICLE_H
8 #define XAODBASE_IPARTICLE_H
9 
10 // ROOT include(s):
11 #include <TLorentzVector.h>
12 
13 // EDM include(s):
15 
16 // Local include(s):
17 #include "ObjectType.h"
18 
19 
21 namespace xAOD {
22 
40  class IParticle : public SG::AuxElement {
41 
42  public:
44  virtual ~IParticle() = default;
45  IParticle() = default;
46  IParticle(const IParticle&) = default;
47  IParticle& operator=(const IParticle&) = default;
48  IParticle(IParticle&&) = delete;
50 
53 
55  virtual double pt() const = 0;
57  virtual double eta() const = 0;
59  virtual double phi() const = 0;
61  virtual double m() const = 0;
63  virtual double e() const = 0;
65  virtual double rapidity() const = 0;
66 
68  typedef TLorentzVector FourMom_t;
69 
71  virtual FourMom_t p4() const = 0;
72 
74 
75 
77  virtual Type::ObjectType type() const = 0;
78 
79 
82 
95  template< class T >
96  T& auxdata( const std::string& name,
97  const std::string& clsname = "" ) {
98 
99  return SG::AuxElement::auxdata< T >( name, clsname );
100  }
101 
114  template< class T >
115  const T& auxdata( const std::string& name,
116  const std::string& clsname = "" ) const {
117 
118  return SG::AuxElement::auxdata< T >( name, clsname );
119  }
120 
130  template< class T >
131  bool isAvailable( const std::string& name,
132  const std::string& clsname = "" ) const {
133 
134  return SG::AuxElement::isAvailable< T >( name, clsname );
135  }
136 
146  template< class T >
147  bool isAvailableWritable( const std::string& name,
148  const std::string& clsname = "" ) const {
149 
150  return SG::AuxElement::isAvailableWritable< T >( name, clsname );
151  }
152 
154 
155 
156  protected:
157  // Hide some functions from the regular xAOD users
160 
161  // Hide the Accessor class from the regular xAOD users
163 
164  }; // class IParticle
165 
166 } // namespace xAOD
167 
168 #ifndef XAOD_STANDALONE
169 #include "AthenaKernel/BaseInfo.h"
171 #endif // not XAOD_STANDALONE
172 
173 #endif // XAODBASE_IPARTICLE_H
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
SG_BASE
SG_BASE(xAOD::IParticle, SG::AuxElement)
xAOD::IParticle::operator=
IParticle & operator=(IParticle &&)=delete
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:446
xAOD::IParticle::rapidity
virtual double rapidity() const =0
The true rapidity (y) of the particle.
xAOD::IParticle::type
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
SG::AuxElement::getStore
SG::IAuxStore * getStore() const
Return the current store, as a non-const interface.
Definition: AuxElement.cxx:299
SG::AuxElement::Accessor
SG::Accessor< T, ALLOC > Accessor
Definition: AuxElement.h:522
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:68
ObjectType.h
BaseInfo.h
Provide an interface for finding inheritance information at run time.
xAOD::IParticle::IParticle
IParticle(IParticle &&)=delete
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
xAOD::IParticle::~IParticle
virtual ~IParticle()=default
Virtual destructor, to make vtable happy...
xAOD::IParticle::auxdata
const T & auxdata(const std::string &name, const std::string &clsname="") const
Fetch an aux data variable, as a const reference.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:115
xAOD::IParticle::p4
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
xAOD::IParticle::isAvailable
bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:131
xAOD::IParticle::IParticle
IParticle(const IParticle &)=default
SG::AuxElement::getConstStore
const SG::IConstAuxStore * getConstStore() const
Return the current store, as a const interface.
Definition: AuxElement.cxx:284
xAOD::IParticle::IParticle
IParticle()=default
xAOD::IParticle::eta
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
xAOD::IParticle::auxdata
T & auxdata(const std::string &name, const std::string &clsname="")
Fetch an aux data variable, as a non-const reference.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:96
xAOD::IParticle::phi
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
xAODType::ObjectType
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition: ObjectType.h:32
xAOD::IParticle::isAvailableWritable
bool isAvailableWritable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for writing or not.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:147
xAOD::IParticle::operator=
IParticle & operator=(const IParticle &)=default
xAOD::IParticle::e
virtual double e() const =0
The total energy of the particle.
AuxElement.h
Base class for elements of a container that can have aux data.
xAOD::IParticle::m
virtual double m() const =0
The invariant mass of the particle.