ATLAS Offline Software
FileMetaDataAccessors_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // System include(s):
6 #include <iostream>
7 
8 // Local include(s):
10 
12 #define DECLARE_STRING_ACCESSOR( TYPE ) \
13  case FileMetaData_v1::TYPE: \
14  do { \
15  static const SG::AuxElement::Accessor< std::string > acc( #TYPE ); \
16  return &acc; \
17  } while( 0 )
18 
20 #define DECLARE_UINT_ACCESSOR( TYPE ) \
21  case FileMetaData_v1::TYPE: \
22  do { \
23  static const SG::AuxElement::Accessor< uint32_t > acc( #TYPE ); \
24  return &acc; \
25  } while( 0 )
26 
28 #define DECLARE_FLOAT_ACCESSOR( TYPE ) \
29  case FileMetaData_v1::TYPE: \
30  do { \
31  static const SG::AuxElement::Accessor< float > acc( #TYPE ); \
32  return &acc; \
33  } while( 0 )
34 
36 #define DECLARE_CHAR_ACCESSOR( TYPE ) \
37  case FileMetaData_v1::TYPE: \
38  do { \
39  const static SG::AuxElement::Accessor< char > acc( #TYPE ); \
40  return &acc; \
41  } while( 0 )
42 
43 namespace xAOD {
44 
47 
48  switch( type ) {
49 
50  DECLARE_STRING_ACCESSOR( productionRelease );
51  DECLARE_STRING_ACCESSOR( AODFixVersion );
52  DECLARE_STRING_ACCESSOR( AODCalibVersion );
58  DECLARE_STRING_ACCESSOR( simFlavour );
60  DECLARE_STRING_ACCESSOR( generatorsInfo );
61 
62  default:
63  std::cerr << "xAOD::FileMetaData_v1 ERROR No string accessor for "
64  << "type: " << type << std::endl;
65  return nullptr;
66  }
67 
68  // Just to make sure the compiler doesn't complain:
69  return nullptr;
70  }
71 
74 
75  switch( type ) {
76 
77  DECLARE_UINT_ACCESSOR( dataYear );
78 
79  default:
80  std::cerr << "xAOD::FileMetaData_v1 ERROR No uint32_t accessor for "
81  << "type: " << type << std::endl;
82  return nullptr;
83  }
84 
85  // Just to make sure the compiler doesn't complain:
86  return nullptr;
87  }
88 
91 
92  switch( type ) {
93 
94  DECLARE_FLOAT_ACCESSOR( beamEnergy );
95  DECLARE_FLOAT_ACCESSOR( mcProcID );
96 
97  default:
98  std::cerr << "xAOD::FileMetaData_v1 ERROR No float accessor for "
99  << "type: " << type << std::endl;
100  return nullptr;
101  }
102 
103  // Just to make sure the compiler doesn't complain:
104  return nullptr;
105  }
106 
109 
110  switch( type ) {
111 
112  DECLARE_CHAR_ACCESSOR( isDataOverlay );
113 
114  default:
115  std::cerr << "xAOD::FileMetaData_v1 ERROR No char accessor for "
116  << "type: " << type << std::endl;
117  return nullptr;
118  }
119 
120  // Just to make sure the compiler doesn't complain:
121  return nullptr;
122  }
123 
124 } // namespace xAOD
DECLARE_CHAR_ACCESSOR
#define DECLARE_CHAR_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
Definition: FileMetaDataAccessors_v1.cxx:36
xAOD::metaDataTypeCharAccessorV1
const SG::AuxElement::Accessor< char > * metaDataTypeCharAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
Definition: FileMetaDataAccessors_v1.cxx:108
jetMakeRefSamples.geometryVersion
string geometryVersion
Definition: jetMakeRefSamples.py:68
GlobalMonitoring_CA.conditionsTag
string conditionsTag
Definition: GlobalMonitoring_CA.py:64
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
hotSpotInTAG.amiTag
amiTag
Definition: hotSpotInTAG.py:102
FileMetaDataAccessors_v1.h
TestSUSYToolsAlg.mcCampaign
mcCampaign
Definition: TestSUSYToolsAlg.py:138
xAOD::metaDataTypeUIntAccessorV1
const SG::AuxElement::Accessor< uint32_t > * metaDataTypeUIntAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
Definition: FileMetaDataAccessors_v1.cxx:73
xAOD::metaDataTypeStringAccessorV1
const SG::AuxElement::Accessor< std::string > * metaDataTypeStringAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
Definition: FileMetaDataAccessors_v1.cxx:46
xAOD::FileMetaData_v1::MetaDataType
MetaDataType
Pre-defined metadata value types.
Definition: FileMetaData_v1.h:54
NoiseOccupancyTrigOff.beamType
string beamType
Definition: NoiseOccupancyTrigOff.py:23
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DECLARE_STRING_ACCESSOR
#define DECLARE_STRING_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
Definition: FileMetaDataAccessors_v1.cxx:12
xAOD::metaDataTypeFloatAccessorV1
const SG::AuxElement::Accessor< float > * metaDataTypeFloatAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
Definition: FileMetaDataAccessors_v1.cxx:90
DECLARE_FLOAT_ACCESSOR
#define DECLARE_FLOAT_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
Definition: FileMetaDataAccessors_v1.cxx:28
DECLARE_UINT_ACCESSOR
#define DECLARE_UINT_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
Definition: FileMetaDataAccessors_v1.cxx:20