ATLAS Offline Software
EventInfo/EventInfo/EventInfo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 //Dear emacs, this is -*-c++-*-
6 #ifndef EVENTINFO_EVENTINFO_H
7 # define EVENTINFO_EVENTINFO_H 1
8 
19 #include "GaudiKernel/ClassID.h"
20 #include <vector>
21 
22 class EventID;
23 class EventType;
25 class TagInfoMgr;
26 class TriggerInfo;
27 
38 namespace xAODMaker {
39  class EventInfoCnvTool;
40 }
41 
42 class EventInfo {
43  //The following 'friends' are a hack to ease the AOD->xAOD migration
44  friend class EventInfoByteStreamCnv;
46  friend class G4AtlasAlg;
47  friend class LooperKiller;
48  friend class CopyMcEventCollection;
49 public:
52 
55  };
57 
61  };
63 
64 
66 
67 
68 
90  };
92 
93 
95 
96  EventInfo();
98  EventInfo(EventID* id, EventType* type, TriggerInfo* trig_info);
99  EventInfo(const EventInfo& e);
100  EventInfo& operator = (const EventInfo& e);
101  EventInfo(EventInfo&& e);
103  virtual ~EventInfo();
105 
107 
108  static const CLID& classID();
109  const CLID& clID() const;
111 
113 
114 
116  EventID* event_ID();
117  const EventID* event_ID() const;
118 
121  const EventType* event_type() const;
122 
125  const TriggerInfo* trigger_info() const;
126 
127  //private:
129  unsigned int eventFlags(EventFlagSubDet subDet) const;
130 
132  bool isEventFlagBitSet(EventFlagSubDet subDet, unsigned char bit) const;
133 
135  const std::vector<unsigned int>& eventFlags() const;
136 
137 
140 
144  bool setEventFlags(EventFlagSubDet subDet, unsigned int flags);
145 
150  bool setEventFlagBit(EventFlagSubDet subDet, unsigned char bit, bool set = true);
151 
155 public:
160  float actualInteractionsPerCrossing() const;
161 
163  float averageInteractionsPerCrossing() const;
164 
166 
168 
171 
176  void setActualInteractionsPerCrossing(float interactions);
177 
179  void setAverageInteractionsPerCrossing(float interactions);
181 protected:
182  friend class MixingEventSelector;
183  void setEventID(EventID* pid);
184 
185  friend class TagInfoMgr;
186  void setEventType(EventType*);
187 private:
188  friend class EventInfoCnv_p1;
189  friend class EventInfoCnv_p2;
190  friend class EventInfoCnv_p3;
191  friend class EventInfoCnv_p4;
192 
193  enum {
194  EF_BITS = 0x0FFFFFFF,
195  EF_ERROR_BITS = 0xF0000000,
197  ACTUAL_INTERACTS_BITS = 0x0000FFFF,
198  AVE_INTERACTS_BITS = 0xFFFF0000,
200  };
204  std::vector<unsigned int> m_event_flags;
205 };
206 
207 
208 
209 inline EventID*
211  return(m_event_ID);
212 }
213 
214 inline const EventID*
216  return(m_event_ID);
217 }
218 
219 inline EventType*
221  return(m_event_type);
222 }
223 
224 inline const EventType*
226  return(m_event_type);
227 }
228 
229 inline TriggerInfo*
231  return(m_trigger_info);
232 }
233 
234 inline const TriggerInfo*
236  return(m_trigger_info);
237 }
238 
239 inline unsigned int
241  if ((unsigned) subDet < m_event_flags.size()) return(EF_BITS & m_event_flags[subDet]);
242 
243  return(0xFFFFFFFF);
244 }
245 
246 inline bool
247 EventInfo::isEventFlagBitSet(EventFlagSubDet subDet, unsigned char bit) const {
248  if (subDet < m_event_flags.size() && bit < EF_ERROR_SHIFT) return((1u << bit) & m_event_flags[subDet]);
249 
250  return(false);
251 }
252 
253 inline const std::vector<unsigned int>&
255  return m_event_flags;
256 }
257 
261  if ((unsigned) subDet < m_event_flags.size()) {
263  }
264  return NotSet;
265 }
266 
268 inline float
270  float result = -999.99f;
271 
272  if (Lumi < m_event_flags.size()) {
273  unsigned int interactions = m_event_flags[Lumi];
274  result = (float) (interactions & ACTUAL_INTERACTS_BITS);
275  result *= 0.01;
276  }
277  return result;
278 }
279 
281 inline float
283  float result = -999.99f;
284 
285  if (Lumi < m_event_flags.size()) {
286  unsigned int interactions = m_event_flags[Lumi];
287  result = (float) ((interactions & AVE_INTERACTS_BITS) >> AVE_INTERACTS_SHIFT);
288  result *= 0.01;
289  }
290  return result;
291 }
292 
293 inline const CLID&
295  return classID();
296 }
297 
298 #include "AthenaKernel/CLASS_DEF.h"
299 CLASS_DEF(EventInfo, 2101, 1)
300 
301 inline const CLID &
302 EventInfo::classID() {
304 }
305 
306 #endif // EVENTINFO_EVENTINFO_H
EventInfoCnv_p1
Definition: EventInfoCnv_p1.h:13
EventInfo::Error
@ Error
Definition: EventInfo/EventInfo/EventInfo.h:60
EventInfo::BCMBeamVeto
@ BCMBeamVeto
Definition: EventInfo/EventInfo/EventInfo.h:78
EventInfo::MBTSBeamVeto
@ MBTSBeamVeto
Definition: EventInfo/EventInfo/EventInfo.h:77
EventInfo::isEventFlagBitSet
bool isEventFlagBitSet(EventFlagSubDet subDet, unsigned char bit) const
check for a event flag bit for a particular sub-detector
Definition: EventInfo/EventInfo/EventInfo.h:247
MixingEventSelector
a stream of events read from different selectors.
Definition: MixingEventSelector.h:71
EventInfoCnv_p4
Definition: EventInfoCnv_p4.h:13
get_generator_info.result
result
Definition: get_generator_info.py:21
EventInfo::Warning
@ Warning
Definition: EventInfo/EventInfo/EventInfo.h:60
EventInfo::CosmicCombinedTight
@ CosmicCombinedTight
Definition: EventInfo/EventInfo/EventInfo.h:85
EventInfo::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
average interactions per crossing for all BCIDs - for out-of-time pile-up
Definition: EventInfo/EventInfo/EventInfo.h:282
EventInfo::HaloTileClusterPattern
@ HaloTileClusterPattern
Definition: EventInfo/EventInfo/EventInfo.h:82
EventInfo::m_event_flags
std::vector< unsigned int > m_event_flags
Definition: EventInfo/EventInfo/EventInfo.h:204
EventInfo::PixSPNonEmpty
@ PixSPNonEmpty
Definition: EventInfo/EventInfo/EventInfo.h:72
EventInfo::CSCTimeDiffHalo
@ CSCTimeDiffHalo
Definition: EventInfo/EventInfo/EventInfo.h:74
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
EventInfo::MBTSTimeDiffCol
@ MBTSTimeDiffCol
Definition: EventInfo/EventInfo/EventInfo.h:70
EventType
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition: EventType.h:92
EventInfo::Tile
@ Tile
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::BkgdResvBit5
@ BkgdResvBit5
Definition: EventInfo/EventInfo/EventInfo.h:88
EventInfo::SCTSPNonEmpty
@ SCTSPNonEmpty
Definition: EventInfo/EventInfo/EventInfo.h:73
EventInfoCnv_p2
Definition: EventInfoCnv_p2.h:13
EventInfo::setTriggerInfo
void setTriggerInfo(TriggerInfo *)
Add TriggerInfo to existing object.
Definition: EventInfo.cxx:130
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
xAODMaker
Definition: StoreGateSvc.h:72
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
EventInfo::NBackgroundWords
@ NBackgroundWords
Definition: EventInfo/EventInfo/EventInfo.h:89
EventInfo::setEventID
void setEventID(EventID *pid)
Definition: EventInfo.cxx:118
EventInfo::EF_ERROR_SHIFT
@ EF_ERROR_SHIFT
Definition: EventInfo/EventInfo/EventInfo.h:196
EventInfo::SCT
@ SCT
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::eventFlags
const std::vector< unsigned int > & eventFlags() const
All event flags.
Definition: EventInfo/EventInfo/EventInfo.h:254
EventInfo::errorState
EventFlagErrorState errorState(EventFlagSubDet subDet) const
return error state for a particular sub-detector
Definition: EventInfo/EventInfo/EventInfo.h:260
EventInfo::classID
static const CLID & classID()
Definition: EventInfo/EventInfo/EventInfo.h:302
EventInfo::TRT
@ TRT
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::PixMultiplicityHuge
@ PixMultiplicityHuge
Definition: EventInfo/EventInfo/EventInfo.h:72
EventInfo::setEventFlagBit
bool setEventFlagBit(EventFlagSubDet subDet, unsigned char bit, bool set=true)
Set a bit for an event flag of a particular sub detector.
Definition: EventInfo.cxx:149
EventInfo::ForwardDet
@ ForwardDet
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::nDets
@ nDets
Definition: EventInfo/EventInfo/EventInfo.h:54
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
EventInfo::EventFlagErrorState
EventFlagErrorState
Definition: EventInfo/EventInfo/EventInfo.h:59
EventInfo::setErrorState
bool setErrorState(EventFlagSubDet subDet, EventFlagErrorState errorState)
Set error state flag for a particular sub detector.
Definition: EventInfo.cxx:168
xAODMaker::EventInfoCnvTool
Implementation for the IEventInfoCnvTool interface.
Definition: EventInfoCnvTool.h:43
EventInfo::BkgdResvBit4
@ BkgdResvBit4
Definition: EventInfo/EventInfo/EventInfo.h:87
EventInfo::setActualInteractionsPerCrossing
void setActualInteractionsPerCrossing(float interactions)
Setting the number of interactions per crossing:
Definition: EventInfo.cxx:185
EventInfo::HaloMuonOneSided
@ HaloMuonOneSided
Definition: EventInfo/EventInfo/EventInfo.h:81
EventInfo::clID
const CLID & clID() const
Definition: EventInfo/EventInfo/EventInfo.h:294
EventInfo::BackgroundEventFlag
BackgroundEventFlag
Definition: EventInfo/EventInfo/EventInfo.h:69
python.LArBadChannelDBAlg.xFFFFFFFF
xFFFFFFFF
Definition: LArBadChannelDBAlg.py:73
EventInfo::NotSet
@ NotSet
Definition: EventInfo/EventInfo/EventInfo.h:60
EventInfo::LUCIDBeamVeto
@ LUCIDBeamVeto
Definition: EventInfo/EventInfo/EventInfo.h:79
EventInfo::event_ID
EventID * event_ID()
the unique identification of the event.
Definition: EventInfo/EventInfo/EventInfo.h:210
EventInfo::SCTMultiplicityHuge
@ SCTMultiplicityHuge
Definition: EventInfo/EventInfo/EventInfo.h:73
EventInfo::Core
@ Core
Definition: EventInfo/EventInfo/EventInfo.h:54
TagInfoMgr
This is a Athena service which manages detector description tag information. It maintains a TagInfo o...
Definition: TagInfoMgr.h:70
EventInfo::ACTUAL_INTERACTS_BITS
@ ACTUAL_INTERACTS_BITS
Definition: EventInfo/EventInfo/EventInfo.h:197
EventInfo::BCMTimeDiffHalo
@ BCMTimeDiffHalo
Definition: EventInfo/EventInfo/EventInfo.h:75
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
EventInfo::BkgdResvBit1
@ BkgdResvBit1
Definition: EventInfo/EventInfo/EventInfo.h:86
EventInfo::HaloClusterShape
@ HaloClusterShape
Definition: EventInfo/EventInfo/EventInfo.h:80
G4AtlasAlg
Primary Athena algorithm for ATLAS simulation.
Definition: G4AtlasAlg.h:53
EventInfo::BkgdResvBit3
@ BkgdResvBit3
Definition: EventInfo/EventInfo/EventInfo.h:87
EventInfo::operator=
EventInfo & operator=(const EventInfo &e)
Definition: EventInfo.cxx:59
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
EventInfo::setAverageInteractionsPerCrossing
void setAverageInteractionsPerCrossing(float interactions)
average interactions per crossing for all BCIDs - for out-of-time pile-up
Definition: EventInfo.cxx:202
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
EventInfo::CosmicCombined
@ CosmicCombined
Definition: EventInfo/EventInfo/EventInfo.h:85
EventInfo::BeamGasPixel
@ BeamGasPixel
Definition: EventInfo/EventInfo/EventInfo.h:83
EventInfo::EventInfo
EventInfo()
Definition: EventInfo.cxx:20
EventInfo::CSCTimeDiffCol
@ CSCTimeDiffCol
Definition: EventInfo/EventInfo/EventInfo.h:74
CopyMcEventCollection
Definition: CopyMcEventCollection.h:13
TriggerInfo
This class contains trigger related information.
Definition: TriggerInfo.h:77
EventInfo::m_event_type
EventType * m_event_type
Definition: EventInfo/EventInfo/EventInfo.h:202
EventInfo::AVE_INTERACTS_SHIFT
@ AVE_INTERACTS_SHIFT
Definition: EventInfo/EventInfo/EventInfo.h:199
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
EventInfo::BkgdResvBit2
@ BkgdResvBit2
Definition: EventInfo/EventInfo/EventInfo.h:86
EventInfo::HaloMuonTwoSided
@ HaloMuonTwoSided
Definition: EventInfo/EventInfo/EventInfo.h:81
EventInfo::m_event_ID
EventID * m_event_ID
Definition: EventInfo/EventInfo/EventInfo.h:201
EventInfo::MuonTimingCosmic
@ MuonTimingCosmic
Definition: EventInfo/EventInfo/EventInfo.h:76
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
EventInfo::Muon
@ Muon
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::Lumi
@ Lumi
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::trigger_info
TriggerInfo * trigger_info()
trigger information (ptr may be NULL)
Definition: EventInfo/EventInfo/EventInfo.h:230
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
EventInfo::EF_ERROR_BITS
@ EF_ERROR_BITS
Definition: EventInfo/EventInfo/EventInfo.h:195
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
EventInfo::~EventInfo
virtual ~EventInfo()
Definition: EventInfo.cxx:111
EventInfo::setEventFlags
bool setEventFlags(EventFlagSubDet subDet, unsigned int flags)
Set event flag for a particular sub detector - maximun size is 28 bits.
Definition: EventInfo.cxx:136
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventID.h:35
EventInfo::LArECTimeDiffHalo
@ LArECTimeDiffHalo
Definition: EventInfo/EventInfo/EventInfo.h:71
EventInfo::CosmicStandAloneTight
@ CosmicStandAloneTight
Definition: EventInfo/EventInfo/EventInfo.h:84
EventInfo::LAr
@ LAr
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::EventFlagSubDet
EventFlagSubDet
Definition: EventInfo/EventInfo/EventInfo.h:53
EventInfo::setEventType
void setEventType(EventType *)
Definition: EventInfo.cxx:124
EventInfoCnv_p3
Definition: EventInfoCnv_p3.h:13
EventInfo::MuonTimingCol
@ MuonTimingCol
Definition: EventInfo/EventInfo/EventInfo.h:76
EventInfo::EF_BITS
@ EF_BITS
Definition: EventInfo/EventInfo/EventInfo.h:194
EventInfo::m_trigger_info
TriggerInfo * m_trigger_info
Definition: EventInfo/EventInfo/EventInfo.h:203
EventInfo::Pixel
@ Pixel
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::HaloMuonSegment
@ HaloMuonSegment
Definition: EventInfo/EventInfo/EventInfo.h:80
EventInfo::AVE_INTERACTS_BITS
@ AVE_INTERACTS_BITS
Definition: EventInfo/EventInfo/EventInfo.h:198
EventInfo::BCMTimeDiffCol
@ BCMTimeDiffCol
Definition: EventInfo/EventInfo/EventInfo.h:75
EventInfo::LArECTimeDiffCol
@ LArECTimeDiffCol
Definition: EventInfo/EventInfo/EventInfo.h:71
CLASS_DEF.h
macros to associate a CLID to a type
readCCLHist.float
float
Definition: readCCLHist.py:83
EventInfo::CosmicStandAlone
@ CosmicStandAlone
Definition: EventInfo/EventInfo/EventInfo.h:84
EventInfo::event_type
EventType * event_type()
the type of the event, e.g. simulation, testbeam, etc
Definition: EventInfo/EventInfo/EventInfo.h:220
EventInfo::EventInfoByteStreamCnv
friend class EventInfoByteStreamCnv
Definition: EventInfo/EventInfo/EventInfo.h:44
EventInfo::MBTSTimeDiffHalo
@ MBTSTimeDiffHalo
Definition: EventInfo/EventInfo/EventInfo.h:70
EventInfo::Background
@ Background
Definition: EventInfo/EventInfo/EventInfo.h:54
EventInfo::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Access to number of interactions per crossing:
Definition: EventInfo/EventInfo/EventInfo.h:269
EventInfo::LooperKiller
friend class LooperKiller
Definition: EventInfo/EventInfo/EventInfo.h:47