Struct to manage accessors to objects.
More...
#include <AccessorHelpers.h>
|
| void | initializeFloatAccessor (const std::string &name) |
| | Initialize a float accessor by name.
|
| void | initializeFloatAccessor (const std::vector< std::string > &names) |
| | Initialize multiple float accessors by a list of names.
|
| void | initializeIntAccessor (const std::string &name) |
| | Initialize an integer accessor by name.
|
| void | initializeIntAccessor (const std::vector< std::string > &names) |
| | Initialize multiple integer accessors by a list of names.
|
| void | initializePtEtaPhiMAccessor (const std::string &prefix) |
| | Initialize a PtEtaPhiMVector using floats.
|
| template<typename T> |
| float | getFloat (const std::string &name, T *object) |
| | Template to get an Float via the name of an accessor.
|
| template<typename T> |
| int | getInt (const std::string &name, T *object) |
| | Template to get an Int via the name of an accessor.
|
| template<typename T> |
| void | getPtEtaPhiMVector (const std::string &prefix, ROOT::Math::PtEtaPhiMVector &p, T *object) |
| | Template to get a PtEtaPhiMVector via the name of an accessor.
|
Struct to manage accessors to objects.
- Author
- Baptiste Ravina bapti.nosp@m.ste..nosp@m.ravin.nosp@m.a@ce.nosp@m.rn.ch
-
Steffen Korn steff.nosp@m.en.k.nosp@m.orn@c.nosp@m.ern..nosp@m.ch
PartonAccessor provides methods to initialize, retrieve, and apply accessors for various properties like mass, pt, eta, phi, and PDG ID. It manages both float and integer accessors.
Definition at line 23 of file AccessorHelpers.h.
◆ getFloat()
template<typename T>
| float PartonAccessor::getFloat |
( |
const std::string & | name, |
|
|
T * | object ) |
|
inline |
Template to get an Float via the name of an accessor.
- Parameters
-
| name | The name of the Float accessor. |
| object | The object to access. |
Definition at line 86 of file AccessorHelpers.h.
86 {
88 }
std::map< std::string, std::unique_ptr< SG::Accessor< float > > > floatAccessors
◆ getInt()
template<typename T>
| int PartonAccessor::getInt |
( |
const std::string & | name, |
|
|
T * | object ) |
|
inline |
Template to get an Int via the name of an accessor.
- Parameters
-
| name | The name of the Int accessor. |
| object | The object to access. |
Definition at line 97 of file AccessorHelpers.h.
97 {
99 }
std::map< std::string, std::unique_ptr< SG::Accessor< int > > > intAccessors
◆ getPtEtaPhiMVector()
template<typename T>
| void PartonAccessor::getPtEtaPhiMVector |
( |
const std::string & | prefix, |
|
|
ROOT::Math::PtEtaPhiMVector & | p, |
|
|
T * | object ) |
|
inline |
Template to get a PtEtaPhiMVector via the name of an accessor.
- Parameters
-
| prefix | The prefix of the accessor holding the different components. |
| p | The PtEtaPhiVector to fill with pT, eta, phi and m values. |
| object | The object to access. |
Definition at line 109 of file AccessorHelpers.h.
110 {
114 }
float getFloat(const std::string &name, T *object)
Template to get an Float via the name of an accessor.
◆ initializeFloatAccessor() [1/2]
| void PartonAccessor::initializeFloatAccessor |
( |
const std::string & | name | ) |
|
|
inline |
Initialize a float accessor by name.
- Parameters
-
| name | The name of the float accessor to initialize. |
Definition at line 32 of file AccessorHelpers.h.
◆ initializeFloatAccessor() [2/2]
| void PartonAccessor::initializeFloatAccessor |
( |
const std::vector< std::string > & | names | ) |
|
|
inline |
Initialize multiple float accessors by a list of names.
- Parameters
-
| names | A vector of accessor names. |
Definition at line 41 of file AccessorHelpers.h.
41 {
42 for (const auto& name : names) {
44 }
45 }
void initializeFloatAccessor(const std::string &name)
Initialize a float accessor by name.
◆ initializeIntAccessor() [1/2]
| void PartonAccessor::initializeIntAccessor |
( |
const std::string & | name | ) |
|
|
inline |
Initialize an integer accessor by name.
- Parameters
-
| name | The name of the integer accessor to initialize. |
Definition at line 52 of file AccessorHelpers.h.
◆ initializeIntAccessor() [2/2]
| void PartonAccessor::initializeIntAccessor |
( |
const std::vector< std::string > & | names | ) |
|
|
inline |
Initialize multiple integer accessors by a list of names.
- Parameters
-
| names | A vector of accessor names. |
Definition at line 61 of file AccessorHelpers.h.
61 {
62 for (const auto& name : names) {
64 }
65 }
void initializeIntAccessor(const std::string &name)
Initialize an integer accessor by name.
◆ initializePtEtaPhiMAccessor()
| void PartonAccessor::initializePtEtaPhiMAccessor |
( |
const std::string & | prefix | ) |
|
|
inline |
Initialize a PtEtaPhiMVector using floats.
- Parameters
-
| prefix | A prefix for the name of the PtEtaPhiMvector. |
Definition at line 72 of file AccessorHelpers.h.
◆ floatAccessors
| std::map<std::string, std::unique_ptr<SG::Accessor<float> > > PartonAccessor::floatAccessors |
◆ intAccessors
| std::map<std::string, std::unique_ptr<SG::Accessor<int> > > PartonAccessor::intAccessors |
The documentation for this struct was generated from the following file: