ATLAS Offline Software
EventInfoAuxContainer_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Local include(s):
7 
8 namespace xAOD {
9 
11  : AuxContainerBase(),
12  m_decorFlags (SG::auxid_set_size_hint)
13  {
14 
15  // Basic event information:
21  AUX_VARIABLE( bcid );
26 
27  // Event type information:
30 
31  // Detector flags:
32 #define DET_FLAG(VAR) \
33  AUX_VARIABLE( VAR, SG::AuxTypeRegistry::Flags::Atomic ); \
34  do { \
35  static const auxid_t auxid = \
36  getAuxID( #VAR, VAR, \
37  SG::AuxTypeRegistry::Flags::Atomic ); \
38  m_decorFlags.insert( auxid ); \
39  } while( false )
40 
42  DET_FLAG( sctFlags );
43  DET_FLAG( trtFlags );
44  DET_FLAG( larFlags );
51 #undef DET_FLAG
52 
53  // MC information:
57 
58  // Pileup information:
61  }
62 
72  size_t size,
73  size_t capacity)
74  {
75  if (m_decorFlags.test (auxid)) {
76  return AuxContainerBase::getData (auxid, size, capacity);
77  }
78 
79  return AuxContainerBase::getDecoration (auxid, size, capacity);
80  }
81 
82 
88  {
89  if (m_decorFlags.test (auxid)) {
90  return true;
91  }
92 
93  return AuxContainerBase::isDecoration (auxid);
94  }
95 
96 
102  {
103  if (m_decorFlags.test (auxid)) {
104  m_decorFlags.reset (auxid);
105  return;
106  }
107 
109  }
110 
111 
118  {
120  static const std::vector<SG::auxid_t> flagIds (m_decorFlags.begin(),
121  m_decorFlags.end());
122 
123  // Check each detector flag. If it has been set to something,
124  // then lock this flag.
125  // This check may be too strict; we'll have to see.
126  size_t sz = size();
127  for (SG::auxid_t id : flagIds) {
128  const uint32_t* flags = reinterpret_cast<const uint32_t*>(getData (id, sz, sz));
129  for (size_t i = 0; i < sz; i++) {
130  if (flags[i] != 0) {
131  m_decorFlags.reset (id);
132  break;
133  }
134  }
135  }
136  }
137 
138 
139 } // namespace xAOD
xAOD::EventInfoAuxContainer_v1::pixelFlags
std::vector< uint32_t > pixelFlags
Definition: EventInfoAuxContainer_v1.h:96
xAOD::EventInfoAuxContainer_v1::mcEventNumber
std::vector< uint64_t > mcEventNumber
Definition: EventInfoAuxContainer_v1.h:111
DET_FLAG
#define DET_FLAG(VAR)
xAOD::EventInfoAuxContainer_v1::eventTypeBitmask
std::vector< uint32_t > eventTypeBitmask
Definition: EventInfoAuxContainer_v1.h:91
xAOD::EventInfoAuxContainer_v1::pileUpMixtureIDLowBits
std::vector< uint64_t > pileUpMixtureIDLowBits
Definition: EventInfoAuxContainer_v1.h:117
xAOD::EventInfoAuxContainer_v1::detectorMask3
std::vector< uint32_t > detectorMask3
Definition: EventInfoAuxContainer_v1.h:84
fitman.sz
sz
Definition: fitman.py:527
xAOD::EventInfoAuxContainer_v1::backgroundFlags
std::vector< uint32_t > backgroundFlags
Definition: EventInfoAuxContainer_v1.h:104
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::EventInfoAuxContainer_v1::m_decorFlags
CxxUtils::ConcurrentBitset m_decorFlags
Keep track of the event status flags.
Definition: EventInfoAuxContainer_v1.h:125
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
CxxUtils::ConcurrentBitset::end
const_iterator end() const
Return an end iterator.
xAOD::AuxContainerBase::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a variable is a decoration.
Definition: AuxContainerBase.cxx:291
xAOD::AuxContainerBase
Common base class for the auxiliary containers.
Definition: AuxContainerBase.h:59
xAOD::EventInfoAuxContainer_v1::eventNumber
std::vector< uint64_t > eventNumber
Definition: EventInfoAuxContainer_v1.h:76
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::EventInfoAuxContainer_v1::toTransient
void toTransient()
Called after one of these objects is read.
Definition: EventInfoAuxContainer_v1.cxx:117
xAOD::EventInfoAuxContainer_v1::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
Definition: EventInfoAuxContainer_v1.cxx:87
xAOD::EventInfoAuxContainer_v1::detectorMask2
std::vector< uint32_t > detectorMask2
Definition: EventInfoAuxContainer_v1.h:83
xAOD::EventInfoAuxContainer_v1::runNumber
std::vector< uint32_t > runNumber
Definition: EventInfoAuxContainer_v1.h:75
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxContainerBase.cxx:430
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
xAOD::EventInfoAuxContainer_v1::coreFlags
std::vector< uint32_t > coreFlags
Definition: EventInfoAuxContainer_v1.h:103
xAOD::EventInfoAuxContainer_v1::timeStampNSOffset
std::vector< uint32_t > timeStampNSOffset
Definition: EventInfoAuxContainer_v1.h:79
xAOD::EventInfoAuxContainer_v1::lumiFlags
std::vector< uint32_t > lumiFlags
Definition: EventInfoAuxContainer_v1.h:105
lumiFormat.i
int i
Definition: lumiFormat.py:85
AUX_VARIABLE
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition: AuxVariable.h:23
xAOD::EventInfoAuxContainer_v1::mcEventWeights
std::vector< std::vector< float > > mcEventWeights
Definition: EventInfoAuxContainer_v1.h:112
xAOD::EventInfoAuxContainer_v1::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: EventInfoAuxContainer_v1.cxx:101
xAOD::EventInfoAuxContainer_v1::pileUpMixtureIDHighBits
std::vector< uint64_t > pileUpMixtureIDHighBits
Definition: EventInfoAuxContainer_v1.h:118
CxxUtils::ConcurrentBitset::reset
ConcurrentBitset & reset(bit_t bit)
Turn off one bit.
xAOD::EventInfoAuxContainer_v1::sctFlags
std::vector< uint32_t > sctFlags
Definition: EventInfoAuxContainer_v1.h:97
xAOD::EventInfoAuxContainer_v1::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: EventInfoAuxContainer_v1.cxx:71
xAOD::AuxContainerBase::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: AuxContainerBase.cxx:300
EventInfoAuxContainer_v1.h
CxxUtils::ConcurrentBitset::begin
const_iterator begin() const
Return a begin iterator.
xAOD::EventInfoAuxContainer_v1::timeStamp
std::vector< uint32_t > timeStamp
Definition: EventInfoAuxContainer_v1.h:78
xAOD::EventInfoAuxContainer_v1::EventInfoAuxContainer_v1
EventInfoAuxContainer_v1()
Default constructor.
Definition: EventInfoAuxContainer_v1.cxx:10
xAOD::EventInfoAuxContainer_v1::detectorMask0
std::vector< uint32_t > detectorMask0
Definition: EventInfoAuxContainer_v1.h:81
xAOD::EventInfoAuxContainer_v1::mcChannelNumber
std::vector< uint32_t > mcChannelNumber
Definition: EventInfoAuxContainer_v1.h:110
xAOD::EventInfoAuxContainer_v1::detectorMask1
std::vector< uint32_t > detectorMask1
Definition: EventInfoAuxContainer_v1.h:82
xAOD::EventInfoAuxContainer_v1::larFlags
std::vector< uint32_t > larFlags
Definition: EventInfoAuxContainer_v1.h:99
xAOD::EventInfoAuxContainer_v1::muonFlags
std::vector< uint32_t > muonFlags
Definition: EventInfoAuxContainer_v1.h:101
xAOD::EventInfoAuxContainer_v1::detDescrTags
std::vector< std::vector< std::pair< std::string, std::string > > > detDescrTags
Definition: EventInfoAuxContainer_v1.h:90
xAOD::AuxContainerBase::getData
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
Definition: AuxContainerBase.cxx:230
xAOD::EventInfoAuxContainer_v1::tileFlags
std::vector< uint32_t > tileFlags
Definition: EventInfoAuxContainer_v1.h:100
xAOD::EventInfoAuxContainer_v1::lumiBlock
std::vector< uint32_t > lumiBlock
Definition: EventInfoAuxContainer_v1.h:77
xAOD::AuxContainerBase::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: AuxContainerBase.cxx:387
xAOD::EventInfoAuxContainer_v1::trtFlags
std::vector< uint32_t > trtFlags
Definition: EventInfoAuxContainer_v1.h:98
xAOD::EventInfoAuxContainer_v1::bcid
std::vector< uint32_t > bcid
Definition: EventInfoAuxContainer_v1.h:80
xAOD::EventInfoAuxContainer_v1::forwardDetFlags
std::vector< uint32_t > forwardDetFlags
Definition: EventInfoAuxContainer_v1.h:102
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.