11#ifndef FOURMOMUTILS_XAODHELPERS_H
12#define FOURMOMUTILS_XAODHELPERS_H
41#define GET_VAL( FUNCNAME, VALTYPE, PERSVALTYPE ) \
42 inline bool FUNCNAME( const SG::AuxElement& auxEle, const std::string& varName ) { \
43 SG::AuxElement::ConstAccessor<PERSVALTYPE> acc(varName); \
44 return static_cast<VALTYPE>( acc(auxEle) ); \
50 GET_VAL( getUInt,
unsigned int,
unsigned int )
51 GET_VAL( getFloat,
float,
float )
52 GET_VAL( getDouble,
double,
double )
57#define SET_VAL( FUNCNAME, VALTYPE, PERSVALTYPE ) \
58 inline bool FUNCNAME( SG::AuxElement& auxEle, const std::string& varName, VALTYPE val ) { \
59 SG::AuxElement::Accessor<PERSVALTYPE> acc(varName); \
60 if ( acc.isAvailable(auxEle) && !(acc.isAvailableWritable(auxEle)) ) { \
63 acc(auxEle) = static_cast<PERSVALTYPE>(val); \
70 SET_VAL(setUInt,
unsigned int,
unsigned int )
72 SET_VAL(setDouble,
double,
double)
77#define DECO_VAL( FUNCNAME, VALTYPE, PERSVALTYPE ) \
78 inline bool FUNCNAME( const SG::AuxElement& auxEle, const std::string& varName, VALTYPE val ) { \
79 SG::AuxElement::Decorator<PERSVALTYPE> deco(varName); \
80 if ( deco.isAvailable(auxEle) && !(deco.isAvailableWritable(auxEle)) ) { \
83 deco(auxEle) = static_cast<PERSVALTYPE>(val); \
90 SET_VAL(decoUInt,
unsigned int,
unsigned int )
91 SET_VAL(decoFloat,
float,
float)
92 SET_VAL(decoDouble,
double,
double)
Base class for elements of a container that can have aux data.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define SET_VAL(FUNCNAME, VALTYPE, PERSVALTYPE)
Access to get a variable of the different types.
#define GET_VAL(FUNCNAME, VALTYPE, PERSVALTYPE)