8#ifndef ACCESSORHELPERS_H
9#define ACCESSORHELPERS_H
11#include <Math/Vector4D.h>
25 std::map<std::string, std::unique_ptr<SG::Accessor<int>>>
intAccessors;
33 floatAccessors[name] = std::make_unique<SG::Accessor<float>>(name);
42 for (
const auto& name : names) {
53 intAccessors[name] = std::make_unique<SG::Accessor<int>>(name);
62 for (
const auto& name : names) {
86 float getFloat(
const std::string& name, T*
object) {
97 int getInt(
const std::string& name, T*
object) {
108 template <
typename T>
110 ROOT::Math::PtEtaPhiMVector& p, T*
object) {
Struct to manage accessors to objects.
void initializeFloatAccessor(const std::vector< std::string > &names)
Initialize multiple float accessors by a list of names.
std::map< std::string, std::unique_ptr< SG::Accessor< float > > > floatAccessors
std::map< std::string, std::unique_ptr< SG::Accessor< int > > > intAccessors
void initializeFloatAccessor(const std::string &name)
Initialize a float accessor by name.
void initializeIntAccessor(const std::string &name)
Initialize an integer accessor by name.
int getInt(const std::string &name, T *object)
Template to get an Int via the name of an accessor.
float getFloat(const std::string &name, T *object)
Template to get an Float via the name of an accessor.
void initializeIntAccessor(const std::vector< std::string > &names)
Initialize multiple integer accessors by a list of names.
void getPtEtaPhiMVector(const std::string &prefix, ROOT::Math::PtEtaPhiMVector &p, T *object)
Template to get a PtEtaPhiMVector via the name of an accessor.
void initializePtEtaPhiMAccessor(const std::string &prefix)
Initialize a PtEtaPhiMVector using floats.