 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #ifndef COLUMNAR_CORE_MOMENTUM_ACCESSORS_H
9 #define COLUMNAR_CORE_MOMENTUM_ACCESSORS_H
14 #include <Math/Vector4D.h>
91 template<ContainerIdConcept CIVal,
typename CMVal = ColumnarModeDefault>
99 return object.getXAODObject().pt();}
101 return object.getXAODObject().eta();}
103 return object.getXAODObject().phi();}
105 return object.getXAODObject().m();}
107 return object.getXAODObject().e();}
109 return object.getXAODObject().rapidity();}
123 template<
typename CoreAccessors>
130 using CoreAccessors::CoreAccessors;
134 const double myPt = this->
pt (
object);
135 const double myEta = this->
eta (
object);
136 const double myM = this->
m (
object);
139 const ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>> myP4 {myPt, myEta, 0, myM};
140 return myP4.energy();
145 const double myEta = this->
eta(
object);
146 const double myM = this->
m(
object);
149 const double myPt = this->
pt(
object);
152 const ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>> myP4 {myPt, myEta, 0, myM};
153 return myP4.Rapidity();
160 template<ContainerIdConcept CIVal,
typename CMVal>
171 :
pt (columnarTool,
"pt"),
eta (columnarTool,
"eta"),
phi (columnarTool,
"phi")
197 template<ContainerIdConcept CI,
typename CM>
219 template<ContainerIdConcept CI,
typename CM = ColumnarModeDefault>
235 template<
typename CoreAccessors>
242 template<
typename...
Args>
288 template<ContainerIdConcept CI,
typename CM = ColumnarModeDefault>
298 template<
typename MyMomentumAccessors,
typename...
Args>
301 reset (std::in_place_type<MyMomentumAccessors>, std::forward<Args> (
args)...);
304 template<
typename MyMomentumAccessors,
typename...
Args>
307 m_accessors = std::make_shared<Detail::MomentumAccessorsImp<MyMomentumAccessors>> (std::forward<Args> (
args)...);
328 std::shared_ptr<const Detail::IMomentumAccessors<CI,CM>>
m_accessors;
339 template<ContainerIdConcept CI,
typename CM>
342 template<ContainerIdConcept CI,
typename CM>
345 template<ContainerIdConcept CI,
typename CM>
348 template<ContainerIdConcept CI,
typename CM>
351 template<ContainerIdConcept CI,
typename CM>
354 template<ContainerIdConcept CI,
typename CM>
357 template<ContainerIdConcept CI,
typename CM>
360 template<ContainerIdConcept CI,
typename CM>
363 template<ContainerIdConcept CI,
typename CM>
366 template<ContainerIdConcept CI,
typename CM>
370 template<ContainerIdConcept CI,
typename CM>
391 throw std::runtime_error (
"Unknown object type for momentum accessors: " +
std::to_string(
static_cast<unsigned>(
type)));
constexpr double photonMassInMeV
various mass-less particles
virtual double e(ObjectId< CI, CM > object) const =0
double rapidity(ObjectId< CI, CM > object) const
Electron_v1 Electron
Definition of the current "egamma version".
virtual double phi(ObjectId< CI, CM > object) const =0
virtual double m(ObjectId< CI, CM > object) const override
Scalar eta() const
pseudorapidity method
typename CoreAccessors::CM CM
virtual ~IMomentumAccessors()=default
CoreMomentumAccessorsPtEtaPhi(ColumnarTool< CM > &columnarTool, const std::string &prefix)
a constructor that uses a prefix for the variables (used for jets)
CoreMomentumAccessorsPtEtaPhiReadM(ColumnarTool< CM > &columnarTool, const std::string &prefix)
void resetObjectType(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool, xAODType::ObjectType type)
a handle to hold a IMomentumAccessors object
constexpr double muonMassInMeV
the mass of the muon (in MeV)
void resetJetConstituentScale(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool, const std::string &prefix="JetConstitScaleMomentum_")
double eta(ObjectId< CI, CM > object) const
MomentumAccessorsImp(Args &&... args)
double pt(ObjectId< CI, CM > object) const
ColumnAccessor< CI, RetypeColumn< double, float >, CM > m
typename CoreAccessors::CM CM
generic columnar momentum accessors that use a pt, eta, phi, m representation underneath
a core momentum accessor that reads pt, eta, phi, and m from the file
virtual double eta(ObjectId< CI, CM > object) const =0
std::map< std::string, HypoJetVector >::const_iterator CI
virtual double m(ObjectId< CI, CM > object) const =0
double pt(ObjectId< CI, CM > object) const
the various momentum accessors
void resetTau(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
CoreMomentumAccessorsPtEtaPhiFixedM(ColumnarTool< CM > &columnarTool, double val_mValue)
void resetEgamma(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
CoreMomentumAccessorsPtEtaPhiReadM(ColumnarTool< CM > &columnarTool)
a virtual interface for columnar momentum accessors
double rapidity(ObjectId< CI, CM > object) const
void resetPhoton(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
a core momentum accessor that reads pt, eta, phi from the file, but uses a fixed value for m
virtual double e(ObjectId< CI, CM > object) const override
void resetElectron(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
ColumnAccessor< CI, RetypeColumn< double, float >, CM > eta
MomentumAccessors(std::in_place_type_t< MyMomentumAccessors >, Args &&... args)
double phi(ObjectId< CI, CM > object) const
virtual double rapidity(ObjectId< CI, CM > object) const =0
double e(ObjectId< CI, CM > object) const
void resetIParticle(MomentumAccessors< CI, CM > &accessors)
reset the dynamic momentum accessors to various default implementations
virtual double rapidity(ObjectId< CI, CM > object) const override
columnar momentum accessors that redirect to the xAOD::IParticle interface internally
virtual double eta(ObjectId< CI, CM > object) const override
void resetPtEtaPhiFixedM(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool, double mValue)
double e(ObjectId< CI, CM > object) const
a class representing a single object (electron, muons, etc.)
the implementation of IMomentumAccessors that wraps a static accessor class
std::string to_string(const DetectorType &type)
double m(ObjectId< CI, CM > object) const
double m(ObjectId< CI, CM >) const noexcept
void resetMuon(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
CoreAccessors m_coreAccessors
virtual double pt(ObjectId< CI, CM > object) const override
Photon_v1 Photon
Definition of the current "egamma version".
struct TBPatternUnitContext Muon
ColumnAccessor< CI, RetypeColumn< double, float >, CM > pt
MomentumAccessors() noexcept
std::shared_ptr< const Detail::IMomentumAccessors< CI, CM > > m_accessors
the underlying accessors, which default to the xAOD::IParticle accessors in case they are not overrid...
void resetPtEtaPhiReadM(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
void reset(std::in_place_type_t< MyMomentumAccessors >, Args &&... args)
double m(ObjectId< CI, CM > object) const
double phi(ObjectId< CI, CM > object) const
a core momentum accessor that reads pt, eta, phi from the file
@ Tau
The object is a tau (jet)
ColumnAccessor< CI, RetypeColumn< double, float >, CM > phi
the raw column accessor template class
double e(ObjectId< CI, CM > object) const
ObjectType
Type of objects that have a representation in the xAOD EDM.
double eta(ObjectId< CI, CM > object) const
Jet_v1 Jet
Definition of the current "jet version".
CoreMomentumAccessorsPtEtaPhi(ColumnarTool< CM > &columnarTool)
virtual double phi(ObjectId< CI, CM > object) const override
double rapidity(ObjectId< CI, CM > object) const
virtual double pt(ObjectId< CI, CM > object) const =0
void resetJet(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
constexpr double electronMassInMeV
the mass of the electron (in MeV)