Loading [MathJax]/jax/input/TeX/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Macros
AccessorMacros.h File Reference
#include "GeoModelKernel/throwExcept.h"
Include dependency graph for AccessorMacros.h:

Go to the source code of this file.

Macros

#define IMPLEMENT_SETTER_GETTER(CLASS_NAME, DTYPE, GETTER, SETTER)
 Macros to implement the scalar variables of the xAOD::MuonPrepData objects. More...
 
#define IMPLEMENT_SETTER_GETTER_WITH_CAST(CLASS_NAME, STORE_DTYPE, CAST_DTYPE, GETTER, SETTER)
 Macro to implement the scalar variable of the xAOD::MuonPrepData object which is then casted to an enum type. More...
 
#define IMPLEMENT_VECTOR_SETTER_GETTER(CLASS_NAME, DTYPE, GETTER, SETTER)
 Macro to implement vector like variables of the xAOD::MuonPrepData objects. More...
 
#define IMPLEMENT_READOUTELEMENT(CLASS_NAME, CACHED_VALUE, READOUT_ELEMENT_TYPE)
 Macro to handle the readoutElement. More...
 
#define PRD_AUXVARIABLE(VAR)
 Macro to declare the variables belonging to the AuxElementContainer. More...
 

Macro Definition Documentation

◆ IMPLEMENT_READOUTELEMENT

#define IMPLEMENT_READOUTELEMENT (   CLASS_NAME,
  CACHED_VALUE,
  READOUT_ELEMENT_TYPE 
)
Value:
void CLASS_NAME::setReadoutElement(const MuonGMR4::READOUT_ELEMENT_TYPE* readoutEle) { \
CACHED_VALUE.set(readoutEle); \
} \
\
const MuonGMR4::READOUT_ELEMENT_TYPE* CLASS_NAME::readoutElement() const { \
if (!CACHED_VALUE.isValid()) { \
ServiceHandle<StoreGateSvc> service{"DetectorStore", #CLASS_NAME}; \
const MuonGMR4::MuonDetectorManager* detMgr{}; \
if (!service.retrieve().isSuccess() || \
!service->retrieve(detMgr).isSuccess()){ \
THROW_EXCEPTION("Failed to retrieve the Run4 muon detector manager. "<< \
"Please schedule the MuonGeometry in your job"); \
} \
const IdentifierHash hash{identifierHash()}; \
const MuonGMR4::READOUT_ELEMENT_TYPE* re = detMgr->get##READOUT_ELEMENT_TYPE(hash); \
if (!re) { \
const Identifier id{static_cast<Identifier::value_type>(identifier())}; \
THROW_EXCEPTION(detMgr->idHelperSvc()->toString(id) \
<<" does not have a readout element."); \
} \
CACHED_VALUE.set(re); \
} \
return (*CACHED_VALUE.ptr()); \
}

Macro to handle the readoutElement.

If the object is created within the RDO -> Prd conversion the method simply returns the pointer to the given readoutElement. In contrast, if the object is created from disk, the readoutElement link is not automatically restored. At the first time, when method is called, the MuonDetectorManager is retrieved from the detector store and the associated readout element is fetched. In Phase II, alignment constants are parsed via the GeometryContext, hence there only exists one instance of the MuonDetectorManager and there's no problem with the scheduler

Definition at line 56 of file AccessorMacros.h.

◆ IMPLEMENT_SETTER_GETTER

#define IMPLEMENT_SETTER_GETTER (   CLASS_NAME,
  DTYPE,
  GETTER,
  SETTER 
)
Value:
DTYPE CLASS_NAME::GETTER() const { \
static const SG::AuxElement::Accessor<DTYPE> acc{preFixStr + #GETTER}; \
return acc(*this); \
} \
\
void CLASS_NAME::SETTER(DTYPE value) { \
static const SG::AuxElement::Accessor<DTYPE> acc{preFixStr + #GETTER}; \
acc(*this) = value; \
}

Macros to implement the scalar variables of the xAOD::MuonPrepData objects.

Definition at line 11 of file AccessorMacros.h.

◆ IMPLEMENT_SETTER_GETTER_WITH_CAST

#define IMPLEMENT_SETTER_GETTER_WITH_CAST (   CLASS_NAME,
  STORE_DTYPE,
  CAST_DTYPE,
  GETTER,
  SETTER 
)
Value:
CAST_DTYPE CLASS_NAME::GETTER() const { \
static const SG::AuxElement::Accessor<STORE_DTYPE> acc{preFixStr + #GETTER}; \
return static_cast<CAST_DTYPE>(acc(*this)); \
} \
\
void CLASS_NAME::SETTER(CAST_DTYPE value) { \
static const SG::AuxElement::Accessor<STORE_DTYPE> acc{preFixStr + #GETTER}; \
acc(*this) = static_cast<STORE_DTYPE>(value); \
}

Macro to implement the scalar variable of the xAOD::MuonPrepData object which is then casted to an enum type.

Definition at line 25 of file AccessorMacros.h.

◆ IMPLEMENT_VECTOR_SETTER_GETTER

#define IMPLEMENT_VECTOR_SETTER_GETTER (   CLASS_NAME,
  DTYPE,
  GETTER,
  SETTER 
)
Value:
const std::vector<DTYPE>& CLASS_NAME::GETTER() const { \
return acc(*this); \
} \
\
void CLASS_NAME::SETTER(const std::vector<DTYPE>& value) { \
acc(*this) = value; \
}

Macro to implement vector like variables of the xAOD::MuonPrepData objects.

Definition at line 38 of file AccessorMacros.h.

◆ PRD_AUXVARIABLE

#define PRD_AUXVARIABLE (   VAR)
Value:
do { \
static const std::string varName =preFixStr+#VAR; \
static const auxid_t auxid = getAuxID(varName, VAR); \
regAuxVar(auxid, varName, VAR); \
} while (false);

Macro to declare the variables belonging to the AuxElementContainer.

It's preassumed that a preFixStr is defined at the top of the source file

Definition at line 86 of file AccessorMacros.h.

MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
athena.value
value
Definition: athena.py:124
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
PixelAthClusterMonAlgCfg.varName
string varName
end cluster ToT and charge
Definition: PixelAthClusterMonAlgCfg.py:125
GETTER
#define GETTER(_name_)
Macros for plotting.
Definition: egammaMonitorBaseAlgorithm.cxx:95
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
xAOD::readoutElement
const MuonGMR4::MuonReadoutElement * readoutElement(const UncalibratedMeasurement *meas)
Returns the associated readout element to the measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:42
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
re
const boost::regex re(r_e)
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Identifier
Definition: IdentifierFieldParser.cxx:14