ATLAS Offline Software
Loading...
Searching...
No Matches
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-2024 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):
16
17// Local include(s):
18#include "ObjectType.h"
19
20
22namespace xAOD {
23
41 class IParticle : public SG::AuxElement {
42
43 public:
45 virtual ~IParticle() = default;
46 IParticle() = default;
47 IParticle(const IParticle&) = default;
48 IParticle& operator=(const IParticle&) = default;
49 IParticle(IParticle&&) = delete;
51
54
56 virtual double pt() const = 0;
58 virtual double eta() const = 0;
60 virtual double phi() const = 0;
62 virtual double m() const = 0;
64 virtual double e() const = 0;
66 virtual double rapidity() const = 0;
67
69 typedef TLorentzVector FourMom_t;
70
72 virtual FourMom_t p4() const = 0;
73
75
76
78 virtual Type::ObjectType type() const = 0;
79
80
83
96 template< class T >
98 T& auxdata( const std::string& name,
99 const std::string& clsname = "" ) {
100
101 return SG::Accessor< T >(name, clsname)(*this);
102 }
103
116 template< class T >
118 const T& auxdata( const std::string& name,
119 const std::string& clsname = "" ) const {
120
121 return SG::ConstAccessor< T >( name, clsname )( *this );
122 }
123
133 template< class T >
135 bool isAvailable( const std::string& name,
136 const std::string& clsname = "" ) const {
137
138 return SG::ConstAccessor< T >(name, clsname).isAvailable(*this);
139 }
140
150 template< class T >
152 bool isAvailableWritable( const std::string& name,
153 const std::string& clsname = "" ) const {
154
155 return SG::Accessor< T >(name, clsname).isAvailableWritable(*this);
156 }
157
159
160
161 protected:
162 // Hide some functions from the regular xAOD users
165
166 // Hide the Accessor class from the regular xAOD users
168
169 }; // class IParticle
170
171} // namespace xAOD
172
173#ifndef XAOD_STANDALONE
176#endif // not XAOD_STANDALONE
177
178#endif // XAODBASE_IPARTICLE_H
Base class for elements of a container that can have aux data.
#define XAOD_AUXDATA_DEPRECATED
Definition AuxElement.h:45
Helper class to provide type-safe access to aux data.
Provide an interface for finding inheritance information at run time.
#define SG_BASE(D, B)
Declare that class D derives from class B.
Helper class to provide type-safe access to aux data.
bool isAvailableWritable(ELT &e) const
Test to see if this variable exists in the store and is writable.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
const SG::IConstAuxStore * getConstStore() const
Return the current store, as a const interface.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
SG::IAuxStore * getStore() const
Return the current store, as a non-const interface.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
IParticle()=default
Class providing the definition of the 4-vector interface.
IParticle(const IParticle &)=default
XAOD_AUXDATA_DEPRECATED const T & auxdata(const std::string &name, const std::string &clsname="") const
Fetch an aux data variable, as a const reference.
IParticle & operator=(const IParticle &)=default
IParticle()=default
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
virtual double pt() const =0
The transverse momentum ( ) of the particle.
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
IParticle & operator=(IParticle &&)=delete
virtual double m() const =0
The invariant mass of the particle.
virtual double rapidity() const =0
The true rapidity (y) of the particle.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
IParticle(IParticle &&)=delete
virtual ~IParticle()=default
Virtual destructor, to make vtable happy...
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for writing or not.
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
XAOD_AUXDATA_DEPRECATED T & auxdata(const std::string &name, const std::string &clsname="")
Fetch an aux data variable, as a non-const reference.
virtual double e() const =0
The total energy of the particle.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.