ATLAS Offline Software
EventAuxInfo_v3.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 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  m_decorFlags (SG::auxid_set_size_hint)
37  {
38 
39  // Basic event information:
45  AUX_VARIABLE( bcid );
50 
51  // Event type information:
54 
55  // Trigger related information:
62 
63  // Detector flags:
64 #define DET_FLAG(VAR) \
65  AUX_VARIABLE( VAR, SG::AuxTypeRegistry::Flags::Atomic ); \
66  do { \
67  static const auxid_t auxid = \
68  getAuxID( #VAR, VAR, \
69  SG::AuxTypeRegistry::Flags::Atomic ); \
70  m_decorFlags.insert( auxid ); \
71  } while( false )
72 
74  DET_FLAG( sctFlags );
75  DET_FLAG( trtFlags );
76  DET_FLAG( larFlags );
83 #undef DET_FLAG
84  }
85 
86 
96  size_t size,
97  size_t capacity)
98  {
99  if (m_decorFlags.test (auxid)) {
100  return AuxInfoBase::getData (auxid, size, capacity);
101  }
102 
103  return AuxInfoBase::getDecoration (auxid, size, capacity);
104  }
105 
106 
112  {
113  if (m_decorFlags.test (auxid)) {
114  return true;
115  }
116 
117  return AuxInfoBase::isDecoration (auxid);
118  }
119 
120 
126  {
127  if (m_decorFlags.test (auxid)) {
128  m_decorFlags.reset (auxid);
129  return;
130  }
131 
133  }
134 
135 
142  {
144  static const std::vector<SG::auxid_t> flagIds (m_decorFlags.begin(),
145  m_decorFlags.end());
146 
147  // Check each detector flag. If it has been set to something,
148  // then lock this flag.
149  // This check may be too strict; we'll have to see.
150  for (SG::auxid_t id : flagIds) {
151  if (*reinterpret_cast<const uint32_t*>(getData (id)) != 0) {
152  m_decorFlags.reset (id);
153  }
154  }
155  }
156 
157 
158 } // namespace xAOD
xAOD::AuxInfoBase
Common base class for auxiliary info objects.
Definition: AuxInfoBase.h:49
xAOD::EventAuxInfo_v3::tileFlags
uint32_t tileFlags
Definition: EventAuxInfo_v3.h:106
xAOD::EventAuxInfo_v3::muonFlags
uint32_t muonFlags
Definition: EventAuxInfo_v3.h:107
xAOD::EventAuxInfo_v3::detectorMask2
uint32_t detectorMask2
Definition: EventAuxInfo_v3.h:80
xAOD::EventAuxInfo_v3::detectorMask1
uint32_t detectorMask1
Definition: EventAuxInfo_v3.h:79
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::EventAuxInfo_v3::sctFlags
uint32_t sctFlags
Definition: EventAuxInfo_v3.h:103
xAOD::EventAuxInfo_v3::streamTagNames
std::vector< std::string > streamTagNames
Definition: EventAuxInfo_v3.h:95
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::EventAuxInfo_v3::lumiFlags
uint32_t lumiFlags
Definition: EventAuxInfo_v3.h:111
CxxUtils::ConcurrentBitset::end
const_iterator end() const
Return an end iterator.
xAOD::AuxInfoBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxInfoBase.cxx:374
xAOD::EventAuxInfo_v3::forwardDetFlags
uint32_t forwardDetFlags
Definition: EventAuxInfo_v3.h:108
xAOD::EventAuxInfo_v3::statusElement
uint32_t statusElement
Definition: EventAuxInfo_v3.h:92
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::detectorMask1
setEventNumber setTimeStamp setBCID detectorMask1
Definition: EventInfo_v1.cxx:137
xAOD::EventAuxInfo_v3::coreFlags
uint32_t coreFlags
Definition: EventAuxInfo_v3.h:109
xAOD::EventAuxInfo_v3::lumiBlock
uint32_t lumiBlock
Definition: EventAuxInfo_v3.h:74
xAOD::EventAuxInfo_v3::detDescrTags
std::vector< std::pair< std::string, std::string > > detDescrTags
Definition: EventAuxInfo_v3.h:86
xAOD::EventAuxInfo_v3::detectorMask3
uint32_t detectorMask3
Definition: EventAuxInfo_v3.h:81
xAOD::EventAuxInfo_v3::streamTagObeysLumiblock
std::vector< char > streamTagObeysLumiblock
Definition: EventAuxInfo_v3.h:97
xAOD::EventAuxInfo_v3::pixelFlags
uint32_t pixelFlags
Definition: EventAuxInfo_v3.h:102
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:246
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:230
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
xAOD::EventAuxInfo_v3::eventNumber
uint64_t eventNumber
Definition: EventAuxInfo_v3.h:73
AUX_VARIABLE
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition: AuxVariable.h:22
CxxUtils::ConcurrentBitset::reset
ConcurrentBitset & reset(bit_t bit)
Turn off one bit.
xAOD::EventAuxInfo_v3::toTransient
void toTransient()
Called after one of these objects is read.
Definition: EventAuxInfo_v3.cxx:141
xAOD::EventAuxInfo_v3::bcid
uint32_t bcid
Definition: EventAuxInfo_v3.h:77
xAOD::EventAuxInfo_v3::larFlags
uint32_t larFlags
Definition: EventAuxInfo_v3.h:105
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
xAOD::EventAuxInfo_v3::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
Definition: EventAuxInfo_v3.cxx:111
DET_FLAG
#define DET_FLAG(VAR)
xAOD::EventAuxInfo_v3::backgroundFlags
uint32_t backgroundFlags
Definition: EventAuxInfo_v3.h:110
xAOD::EventAuxInfo_v3::EventAuxInfo_v3
EventAuxInfo_v3()
Default constructor.
Definition: EventAuxInfo_v3.cxx:10
xAOD::EventAuxInfo_v3::timeStamp
uint32_t timeStamp
Definition: EventAuxInfo_v3.h:75
CxxUtils::ConcurrentBitset::begin
const_iterator begin() const
Return a begin iterator.
xAOD::EventAuxInfo_v3::eventTypeBitmask
uint32_t eventTypeBitmask
Definition: EventAuxInfo_v3.h:87
xAOD::EventAuxInfo_v3::timeStampNSOffset
uint32_t timeStampNSOffset
Definition: EventAuxInfo_v3.h:76
xAOD::EventAuxInfo_v3::level1TriggerType
uint16_t level1TriggerType
Definition: EventAuxInfo_v3.h:94
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:332
xAOD::timeStamp
setEventNumber timeStamp
Definition: EventInfo_v1.cxx:128
xAOD::EventAuxInfo_v3::trtFlags
uint32_t trtFlags
Definition: EventAuxInfo_v3.h:104
xAOD::EventAuxInfo_v3::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: EventAuxInfo_v3.cxx:125
EventAuxInfo_v3.h
xAOD::EventAuxInfo_v3::m_decorFlags
CxxUtils::ConcurrentBitset m_decorFlags
Keep track of the event status flags.
Definition: EventAuxInfo_v3.h:118
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
xAOD::EventAuxInfo_v3::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_v3.cxx:95
xAOD::EventAuxInfo_v3::extendedLevel1ID
uint32_t extendedLevel1ID
Definition: EventAuxInfo_v3.h:93
xAOD::detectorMask3
setEventNumber setTimeStamp setBCID setDetectorMask1 detectorMask3
Definition: EventInfo_v1.cxx:141
xAOD::EventAuxInfo_v3::runNumber
uint32_t runNumber
Definition: EventAuxInfo_v3.h:72
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
xAOD::EventAuxInfo_v3::detectorMask0
uint32_t detectorMask0
Definition: EventAuxInfo_v3.h:78
xAOD::EventAuxInfo_v3::streamTagTypes
std::vector< std::string > streamTagTypes
Definition: EventAuxInfo_v3.h:96
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.