ATLAS Offline Software
EventAuxInfo_v2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Local include(s):
7 
8 namespace xAOD {
9 
11  : AuxInfoBase(),
12  runNumber(0),
13  eventNumber(0),
14  lumiBlock(0),
15  timeStamp(0),
16  timeStampNSOffset(0),
17  bcid(0),
18  detectorMask0(0),
19  detectorMask1(0),
20  detectorMask2(0),
21  detectorMask3(0),
22  eventTypeBitmask(0),
23  statusElement(0),
24  extendedLevel1ID(0),
25  level1TriggerType(0),
26  pixelFlags(0),
27  sctFlags(0),
28  trtFlags(0),
29  larFlags(0),
30  tileFlags(0),
31  muonFlags(0),
32  forwardDetFlags(0),
33  coreFlags(0),
34  backgroundFlags(0),
35  lumiFlags(0),
36  beamPosX(0),
37  beamPosY(0),
38  beamPosZ(0),
39  beamPosSigmaX(0),
40  beamPosSigmaY(0),
41  beamPosSigmaZ(0),
42  beamPosSigmaXY(0),
43  beamTiltXZ(0),
44  beamTiltYZ(0),
45  beamStatus(0),
46  m_decorFlags (SG::auxid_set_size_hint)
47  {
48 
49  // Basic event information:
55  AUX_VARIABLE( bcid );
60 
61  // Event type information:
64 
65  // Trigger related information:
72 
73  // Beam spot information:
84 
85  // Detector flags:
86 #define DET_FLAG(VAR) \
87  AUX_VARIABLE( VAR, SG::AuxTypeRegistry::Flags::Atomic ); \
88  do { \
89  static const auxid_t auxid = \
90  getAuxID( #VAR, VAR, \
91  SG::AuxTypeRegistry::Flags::Atomic ); \
92  m_decorFlags.insert( auxid ); \
93  } while( false )
94 
96  DET_FLAG( sctFlags );
97  DET_FLAG( trtFlags );
98  DET_FLAG( larFlags );
100  DET_FLAG( muonFlags );
102  DET_FLAG( coreFlags );
104  DET_FLAG( lumiFlags );
105 #undef DET_FLAG
106  }
107 
108 
118  size_t size,
119  size_t capacity)
120  {
121  if (m_decorFlags.test (auxid)) {
122  return AuxInfoBase::getData (auxid, size, capacity);
123  }
124 
125  return AuxInfoBase::getDecoration (auxid, size, capacity);
126  }
127 
128 
134  {
135  if (m_decorFlags.test (auxid)) {
136  return true;
137  }
138 
139  return AuxInfoBase::isDecoration (auxid);
140  }
141 
142 
148  {
149  if (m_decorFlags.test (auxid)) {
150  m_decorFlags.reset (auxid);
151  return;
152  }
153 
155  }
156 
157 
164  {
166  static const std::vector<SG::auxid_t> flagIds (m_decorFlags.begin(),
167  m_decorFlags.end());
168 
169  // Check each detector flag. If it has been set to something,
170  // then lock this flag.
171  // This check may be too strict; we'll have to see.
172  for (SG::auxid_t id : flagIds) {
173  if (*reinterpret_cast<const uint32_t*>(getData (id)) != 0) {
174  m_decorFlags.reset (id);
175  }
176  }
177  }
178 
179 
180 } // namespace xAOD
xAOD::AuxInfoBase
Common base class for auxiliary info objects.
Definition: AuxInfoBase.h:49
xAOD::EventAuxInfo_v2::beamPosZ
float beamPosZ
Definition: EventAuxInfo_v2.h:118
xAOD::EventAuxInfo_v2::larFlags
uint32_t larFlags
Definition: EventAuxInfo_v2.h:105
xAOD::EventAuxInfo_v2::m_decorFlags
CxxUtils::ConcurrentBitset m_decorFlags
Keep track of the event status flags.
Definition: EventAuxInfo_v2.h:133
EventAuxInfo_v2.h
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::EventAuxInfo_v2::streamTagObeysLumiblock
std::vector< char > streamTagObeysLumiblock
Definition: EventAuxInfo_v2.h:97
xAOD::EventAuxInfo_v2::streamTagNames
std::vector< std::string > streamTagNames
Definition: EventAuxInfo_v2.h:95
CxxUtils::ConcurrentBitset::end
const_iterator end() const
Return an end iterator.
xAOD::EventAuxInfo_v2::getDecoration
virtual void * getDecoration(SG::auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
Definition: EventAuxInfo_v2.cxx:117
xAOD::AuxInfoBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxInfoBase.cxx:393
xAOD::EventAuxInfo_v2::detDescrTags
std::vector< std::pair< std::string, std::string > > detDescrTags
Definition: EventAuxInfo_v2.h:86
xAOD::EventAuxInfo_v2::runNumber
uint32_t runNumber
Definition: EventAuxInfo_v2.h:72
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::EventAuxInfo_v2::statusElement
uint32_t statusElement
Definition: EventAuxInfo_v2.h:92
xAOD::detectorMask1
setEventNumber setTimeStamp setBCID detectorMask1
Definition: EventInfo_v1.cxx:137
xAOD::EventAuxInfo_v2::sctFlags
uint32_t sctFlags
Definition: EventAuxInfo_v2.h:103
xAOD::EventAuxInfo_v2::beamPosY
float beamPosY
Definition: EventAuxInfo_v2.h:117
xAOD::EventAuxInfo_v2::coreFlags
uint32_t coreFlags
Definition: EventAuxInfo_v2.h:109
xAOD::EventAuxInfo_v2::beamPosSigmaX
float beamPosSigmaX
Definition: EventAuxInfo_v2.h:119
xAOD::AuxInfoBase::getData
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
Definition: AuxInfoBase.cxx:195
xAOD::AuxInfoBase::getDecoration
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Get a pointer to a given array, as a decoration.
Definition: AuxInfoBase.cxx:265
xAOD::EventAuxInfo_v2::trtFlags
uint32_t trtFlags
Definition: EventAuxInfo_v2.h:104
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::AuxInfoBase::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a variable is a decoration.
Definition: AuxInfoBase.cxx:239
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
xAOD::EventAuxInfo_v2::pixelFlags
uint32_t pixelFlags
Definition: EventAuxInfo_v2.h:102
AUX_VARIABLE
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition: AuxVariable.h:23
xAOD::EventAuxInfo_v2::timeStamp
uint32_t timeStamp
Definition: EventAuxInfo_v2.h:75
CxxUtils::ConcurrentBitset::reset
ConcurrentBitset & reset(bit_t bit)
Turn off one bit.
xAOD::EventAuxInfo_v2::beamPosSigmaXY
float beamPosSigmaXY
Definition: EventAuxInfo_v2.h:122
xAOD::EventAuxInfo_v2::timeStampNSOffset
uint32_t timeStampNSOffset
Definition: EventAuxInfo_v2.h:76
xAOD::beamStatus
setBeamTiltXZ beamStatus
Definition: EventInfo_v1.cxx:958
xAOD::EventAuxInfo_v2::streamTagTypes
std::vector< std::string > streamTagTypes
Definition: EventAuxInfo_v2.h:96
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
xAOD::EventAuxInfo_v2::EventAuxInfo_v2
EventAuxInfo_v2()
Default constructor.
Definition: EventAuxInfo_v2.cxx:10
xAOD::EventAuxInfo_v2::toTransient
void toTransient()
Called after one of these objects is read.
Definition: EventAuxInfo_v2.cxx:163
CxxUtils::ConcurrentBitset::begin
const_iterator begin() const
Return a begin iterator.
xAOD::EventAuxInfo_v2::detectorMask2
uint32_t detectorMask2
Definition: EventAuxInfo_v2.h:80
xAOD::EventAuxInfo_v2::muonFlags
uint32_t muonFlags
Definition: EventAuxInfo_v2.h:107
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
xAOD::AuxInfoBase::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: AuxInfoBase.cxx:351
xAOD::timeStamp
setEventNumber timeStamp
Definition: EventInfo_v1.cxx:128
xAOD::EventAuxInfo_v2::beamStatus
uint32_t beamStatus
Definition: EventAuxInfo_v2.h:125
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
xAOD::EventAuxInfo_v2::detectorMask3
uint32_t detectorMask3
Definition: EventAuxInfo_v2.h:81
xAOD::EventAuxInfo_v2::eventNumber
uint64_t eventNumber
Definition: EventAuxInfo_v2.h:73
xAOD::EventAuxInfo_v2::beamPosSigmaY
float beamPosSigmaY
Definition: EventAuxInfo_v2.h:120
xAOD::EventAuxInfo_v2::beamTiltXZ
float beamTiltXZ
Definition: EventAuxInfo_v2.h:123
xAOD::EventAuxInfo_v2::beamTiltYZ
float beamTiltYZ
Definition: EventAuxInfo_v2.h:124
xAOD::beamTiltXZ
beamTiltXZ
Definition: EventInfo_v1.cxx:953
xAOD::EventAuxInfo_v2::backgroundFlags
uint32_t backgroundFlags
Definition: EventAuxInfo_v2.h:110
xAOD::EventAuxInfo_v2::beamPosSigmaZ
float beamPosSigmaZ
Definition: EventAuxInfo_v2.h:121
xAOD::EventAuxInfo_v2::level1TriggerType
uint16_t level1TriggerType
Definition: EventAuxInfo_v2.h:94
xAOD::EventAuxInfo_v2::beamPosX
float beamPosX
Definition: EventAuxInfo_v2.h:116
xAOD::EventAuxInfo_v2::bcid
uint32_t bcid
Definition: EventAuxInfo_v2.h:77
xAOD::detectorMask3
setEventNumber setTimeStamp setBCID setDetectorMask1 detectorMask3
Definition: EventInfo_v1.cxx:141
DET_FLAG
#define DET_FLAG(VAR)
xAOD::EventAuxInfo_v2::lumiBlock
uint32_t lumiBlock
Definition: EventAuxInfo_v2.h:74
xAOD::EventAuxInfo_v2::forwardDetFlags
uint32_t forwardDetFlags
Definition: EventAuxInfo_v2.h:108
xAOD::EventAuxInfo_v2::tileFlags
uint32_t tileFlags
Definition: EventAuxInfo_v2.h:106
xAOD::EventAuxInfo_v2::detectorMask0
uint32_t detectorMask0
Definition: EventAuxInfo_v2.h:78
xAOD::EventAuxInfo_v2::lumiFlags
uint32_t lumiFlags
Definition: EventAuxInfo_v2.h:111
xAOD::EventAuxInfo_v2::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: EventAuxInfo_v2.cxx:147
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
xAOD::EventAuxInfo_v2::extendedLevel1ID
uint32_t extendedLevel1ID
Definition: EventAuxInfo_v2.h:93
xAOD::EventAuxInfo_v2::detectorMask1
uint32_t detectorMask1
Definition: EventAuxInfo_v2.h:79
xAOD::EventAuxInfo_v2::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
Definition: EventAuxInfo_v2.cxx:133
xAOD::EventAuxInfo_v2::eventTypeBitmask
uint32_t eventTypeBitmask
Definition: EventAuxInfo_v2.h:87
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.