![]() |
ATLAS Offline Software
|
Struct to manage and apply decorators to the EventInfo object. More...
#include <DecoratorHelpers.h>
Classes | |
| struct | ParticleDecorators |
| Decorators of one scalar particle prefix; pdgId is nullptr if the "<prefix>_pdgId" decorator was not initialized. More... | |
| struct | VectorParticleDecorators |
| Decorators of one vector particle prefix. More... | |
Public Member Functions | |
| void | setPrefix (const std::string &prefix) |
| Set the prefix prepended to all decorator names. | |
| void | setEventInfo (const xAOD::EventInfo *eventInfo) |
| Set the EventInfo object to decorate for the current event. | |
| void | initializeFloatDecorator (const std::string &name) |
| Initialize a float decorator by bare name. | |
| void | initializeVectorFloatDecorator (const std::string &name) |
| Initialize a vector-of-float decorator by bare name. | |
| void | initializeFloatDecorator (const std::vector< std::string > &names) |
| Initialize multiple float decorators by a list of bare names. | |
| void | initializePtEtaPhiMDecorator (const std::string &prefix) |
| Initialize pt, eta, phi, m float decorators for a bare prefix. | |
| void | initializeParticleDecorators (const std::string &prefix) |
| Initialize pt, eta, phi, m float and pdgId int decorators for a bare prefix. | |
| void | initializeVectorPtEtaPhiMDecorator (const std::string &prefix) |
| Initialize vector pt, eta, phi, m float decorators for a bare prefix. | |
| void | initializeVectorParticleDecorators (const std::string &prefix) |
| Initialize vector pt, eta, phi, m float and pdgId int decorators for a bare prefix. | |
| void | initializeIntDecorator (const std::string &name) |
| Initialize an integer decorator by bare name. | |
| void | initializeVectorIntDecorator (const std::string &name) |
| Initialize a vector-of-int decorator by bare name. | |
| void | initializeIntDecorator (const std::vector< std::string > &names) |
| Initialize multiple integer decorators by a list of bare names. | |
| const SG::Decorator< int > * | getIntDecorator (const std::string &name) const |
| Retrieve a pointer to an integer decorator by bare name. | |
| const SG::Decorator< std::vector< int > > * | getVectorIntDecorator (const std::string &name) const |
| Retrieve a pointer to a vector-of-int decorator by bare name. | |
| const SG::Decorator< float > * | getFloatDecorator (const std::string &name) const |
| Retrieve a pointer to a float decorator by bare name. | |
| const SG::Decorator< std::vector< float > > * | getVectorFloatDecorator (const std::string &name) const |
| Retrieve a pointer to a vector-of-float decorator by bare name. | |
| void | decorateDefault (const std::string &prefix) |
| Decorate with default particle kinematics (bare prefix). | |
| void | decorateVectorDefault (const std::string &prefix) |
| Decorate with default vector particle kinematics (bare prefix). | |
| void | decorateDefaultNoPdgId (const std::string &prefix) |
| Decorate with default particle kinematics, no PDG ID (bare prefix). | |
| void | decorateCustom (const std::string &name, float value) |
| Decorate with a custom float value (bare name). | |
| void | decorateCustom (const std::string &name, int value) |
| Decorate with a custom integer value (bare name). | |
| void | decorateParticle (const std::string &prefix, const ROOT::Math::PtEtaPhiMVector &p) |
| Decorate with particle kinematics, no PDG ID (bare prefix). | |
| void | decorateParticle (const std::string &prefix, const ROOT::Math::PtEtaPhiMVector &p, int pdgId) |
| Decorate with particle kinematics and PDG ID (bare prefix). | |
| void | decorateVectorParticle (const std::string &prefix, const std::vector< ROOT::Math::PtEtaPhiMVector > &vec_p, const std::vector< int > &vec_pdgId) |
| Decorate with a vector of particle kinematics and PDG IDs (bare prefix). | |
Public Attributes | |
| std::unordered_map< std::string, SG::Decorator< float > > | floatDecorators |
| std::unordered_map< std::string, SG::Decorator< std::vector< float > > > | vectorfloatDecorators |
| std::unordered_map< std::string, SG::Decorator< int > > | intDecorators |
| std::unordered_map< std::string, SG::Decorator< std::vector< int > > > | vectorintDecorators |
Private Member Functions | |
| std::string | fullName (const std::string &name) const |
| Returns the full (prefixed) decorator key for internal use. | |
| template<typename T> | |
| const T * | findDecorator (const std::unordered_map< std::string, T > &decorators, const std::string &name) const |
| Look up a decorator by bare name; throws if it was not initialized. | |
| void | clearCaches () |
| Invalidate the per-prefix bundles, e.g. after new decorators were added. | |
| const ParticleDecorators & | particleDecorators (const std::string &prefix) |
| Resolve (once) the scalar decorators belonging to a bare prefix. | |
| const VectorParticleDecorators & | vectorParticleDecorators (const std::string &prefix) |
| Resolve (once) the vector decorators belonging to a bare prefix. | |
| const SG::Decorator< int > & | pdgIdDecorator (const ParticleDecorators &decs, const std::string &prefix) const |
| The pdgId decorator of a bundle; throws if it was not initialized. | |
Private Attributes | |
| std::string | m_prefix |
| Prefix prepended to all decorator names. | |
| const xAOD::EventInfo * | m_eventInfo |
| Target object; set once per event via setEventInfo(). | |
| std::unordered_map< std::string, ParticleDecorators > | m_particleCache |
| Per-prefix decorator bundles, keyed by bare prefix. | |
| std::unordered_map< std::string, VectorParticleDecorators > | m_vectorParticleCache |
Struct to manage and apply decorators to the EventInfo object.
PartonDecorator centralises all decoration of the xAOD::EventInfo for a single parton history instance. Two pieces of per-instance state are set once and reused:
All decorate* methods therefore take only the branch name and the value(s) to write — no object pointer argument is needed at call sites. The decorators belonging to one particle prefix are resolved once and cached, so repeated decorate* calls do not rebuild the individual decorator names.
Definition at line 231 of file DecoratorHelpers.h.
|
inlineprivate |
Invalidate the per-prefix bundles, e.g. after new decorators were added.
Definition at line 518 of file DecoratorHelpers.h.
Decorate with a custom float value (bare name).
Definition at line 414 of file DecoratorHelpers.h.
Decorate with a custom integer value (bare name).
Definition at line 419 of file DecoratorHelpers.h.
|
inline |
Decorate with default particle kinematics (bare prefix).
Writes sentinel values: pt=-1, eta=-999, phi=-999, m=-1, pdgId=0.
Definition at line 391 of file DecoratorHelpers.h.
|
inline |
Decorate with default particle kinematics, no PDG ID (bare prefix).
Definition at line 407 of file DecoratorHelpers.h.
|
inline |
Decorate with particle kinematics, no PDG ID (bare prefix).
| prefix | Bare decorator prefix. |
| p | The particle four-vector. |
Definition at line 429 of file DecoratorHelpers.h.
|
inline |
Decorate with particle kinematics and PDG ID (bare prefix).
| prefix | Bare decorator prefix. |
| p | The particle four-vector. |
| pdgId | The PDG ID of the particle. |
Definition at line 442 of file DecoratorHelpers.h.
|
inline |
Decorate with default vector particle kinematics (bare prefix).
Definition at line 398 of file DecoratorHelpers.h.
|
inline |
Decorate with a vector of particle kinematics and PDG IDs (bare prefix).
| prefix | Bare decorator prefix. |
| vec_p | Vector of particle four-vectors. |
| vec_pdgId | Vector of PDG IDs. |
Definition at line 457 of file DecoratorHelpers.h.
|
inlineprivate |
Look up a decorator by bare name; throws if it was not initialized.
Definition at line 508 of file DecoratorHelpers.h.
|
inlineprivate |
Returns the full (prefixed) decorator key for internal use.
Definition at line 502 of file DecoratorHelpers.h.
|
inline |
Retrieve a pointer to a float decorator by bare name.
| std::runtime_error | if the decorator is not found. |
Definition at line 370 of file DecoratorHelpers.h.
|
inline |
Retrieve a pointer to an integer decorator by bare name.
| std::runtime_error | if the decorator is not found. |
Definition at line 353 of file DecoratorHelpers.h.
|
inline |
Retrieve a pointer to a vector-of-float decorator by bare name.
| std::runtime_error | if the decorator is not found. |
Definition at line 378 of file DecoratorHelpers.h.
|
inline |
Retrieve a pointer to a vector-of-int decorator by bare name.
| std::runtime_error | if the decorator is not found. |
Definition at line 361 of file DecoratorHelpers.h.
|
inline |
Initialize a float decorator by bare name.
Definition at line 267 of file DecoratorHelpers.h.
|
inline |
Initialize multiple float decorators by a list of bare names.
Definition at line 281 of file DecoratorHelpers.h.
|
inline |
Initialize an integer decorator by bare name.
Definition at line 328 of file DecoratorHelpers.h.
|
inline |
Initialize multiple integer decorators by a list of bare names.
Definition at line 342 of file DecoratorHelpers.h.
|
inline |
Initialize pt, eta, phi, m float and pdgId int decorators for a bare prefix.
Definition at line 302 of file DecoratorHelpers.h.
|
inline |
Initialize pt, eta, phi, m float decorators for a bare prefix.
| prefix | Bare prefix (e.g. "MC_Z_beforeFSR"); "_pt" etc. are appended. |
Definition at line 291 of file DecoratorHelpers.h.
|
inline |
Initialize a vector-of-float decorator by bare name.
Definition at line 274 of file DecoratorHelpers.h.
|
inline |
Initialize a vector-of-int decorator by bare name.
Definition at line 335 of file DecoratorHelpers.h.
|
inline |
Initialize vector pt, eta, phi, m float and pdgId int decorators for a bare prefix.
Definition at line 322 of file DecoratorHelpers.h.
|
inline |
Initialize vector pt, eta, phi, m float decorators for a bare prefix.
Definition at line 311 of file DecoratorHelpers.h.
|
inlineprivate |
Resolve (once) the scalar decorators belonging to a bare prefix.
| std::runtime_error | if a kinematic decorator is not found. |
Definition at line 525 of file DecoratorHelpers.h.
|
inlineprivate |
The pdgId decorator of a bundle; throws if it was not initialized.
Definition at line 557 of file DecoratorHelpers.h.
|
inline |
Set the EventInfo object to decorate for the current event.
Must be called once per event before any decorate*() calls. The pointer is not owned and must remain valid for the duration of event processing.
| eventInfo | Pointer to the current xAOD::EventInfo. |
Definition at line 260 of file DecoratorHelpers.h.
|
inline |
Set the prefix prepended to all decorator names.
Must be called before any initialize*() calls. All public methods accept bare names (e.g. "MC_Z_beforeFSR") and the prefix is applied internally.
| prefix | The prefix string (e.g. "Tzq"). May be empty. |
Definition at line 247 of file DecoratorHelpers.h.
|
inlineprivate |
Resolve (once) the vector decorators belonging to a bare prefix.
| std::runtime_error | if a decorator is not found. |
Definition at line 542 of file DecoratorHelpers.h.
| std::unordered_map<std::string, SG::Decorator<float> > CP::PartonDecorator::floatDecorators |
Definition at line 232 of file DecoratorHelpers.h.
| std::unordered_map<std::string, SG::Decorator<int> > CP::PartonDecorator::intDecorators |
Definition at line 235 of file DecoratorHelpers.h.
|
private |
Target object; set once per event via setEventInfo().
Definition at line 490 of file DecoratorHelpers.h.
|
private |
Per-prefix decorator bundles, keyed by bare prefix.
The pointers stay valid because decorators are never erased or replaced once created.
Definition at line 495 of file DecoratorHelpers.h.
|
private |
Prefix prepended to all decorator names.
Definition at line 489 of file DecoratorHelpers.h.
|
private |
Definition at line 497 of file DecoratorHelpers.h.
| std::unordered_map<std::string, SG::Decorator<std::vector<float> > > CP::PartonDecorator::vectorfloatDecorators |
Definition at line 234 of file DecoratorHelpers.h.
| std::unordered_map<std::string, SG::Decorator<std::vector<int> > > CP::PartonDecorator::vectorintDecorators |
Definition at line 237 of file DecoratorHelpers.h.