ATLAS Offline Software
Loading...
Searching...
No Matches
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
43namespace xAOD {
44
47
48 switch( type ) {
49
50 DECLARE_STRING_ACCESSOR( productionRelease );
51 DECLARE_STRING_ACCESSOR( AODFixVersion );
52 DECLARE_STRING_ACCESSOR( AODCalibVersion );
53 DECLARE_STRING_ACCESSOR( dataType );
55 DECLARE_STRING_ACCESSOR( geometryVersion );
56 DECLARE_STRING_ACCESSOR( conditionsTag );
57 DECLARE_STRING_ACCESSOR( beamType );
58 DECLARE_STRING_ACCESSOR( simFlavour );
59 DECLARE_STRING_ACCESSOR( mcCampaign );
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
#define DECLARE_FLOAT_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
#define DECLARE_CHAR_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
#define DECLARE_STRING_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
#define DECLARE_UINT_ACCESSOR(TYPE)
Helper macro for implementing the accessor function.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
MetaDataType
Pre-defined metadata value types.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const SG::AuxElement::Accessor< std::string > * metaDataTypeStringAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
const SG::AuxElement::Accessor< uint32_t > * metaDataTypeUIntAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
const SG::AuxElement::Accessor< float > * metaDataTypeFloatAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.
const SG::AuxElement::Accessor< char > * metaDataTypeCharAccessorV1(FileMetaData_v1::MetaDataType type)
Helper function for getting an accessor for a pre-defined property.