ATLAS Offline Software
Loading...
Searching...
No Matches
EventInfo_v1.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODEVENTINFO_VERSIONS_EVENTINFO_V1_H
8#define XAODEVENTINFO_VERSIONS_EVENTINFO_V1_H
9
10// System include(s):
11#include <stdint.h> // global namespace typenames
12#include <set>
13#include <vector>
14#include <string>
15#include <iosfwd>
16
17// EDM include(s):
20#include "AthLinks/ElementLink.h"
23
24// Forward declaration(s):
25class StoreGateSvc;
26
28namespace xAOD {
29
30 // Some forward declaration(s):
31 class EventInfo_v1;
33
44
45 public:
49 EventInfo_v1( const EventInfo_v1& parent );
50
52 EventInfo_v1& operator=( const EventInfo_v1& rhs );
53
56
60 void setRunNumber( uint32_t value );
61
65 void setEventNumber( uint64_t value );
66
70 void setLumiBlock( uint32_t value );
71
75 void setTimeStamp( uint32_t value );
76
81
83 uint32_t bcid() const;
85 void setBCID( uint32_t value );
86
103
105 uint64_t detectorMask() const;
107 void setDetectorMask( uint32_t mask0, uint32_t mask1 );
109 void setDetectorMask( uint64_t mask );
115 void setDetectorMaskExt( uint64_t mask );
116
118
121
123 typedef std::vector< std::pair< std::string, std::string > >
125
129 void setDetDescrTags( const DetDescrTags_t& value );
130
135
140
142 const std::vector< float >& mcEventWeights() const;
144 void setMCEventWeights( const std::vector< float >& value );
146 float mcEventWeight( size_t i = 0 ) const;
147
157
163 bool eventType( EventType type ) const;
164
166
169
174
179
184
190 class StreamTag {
191
192 public:
194 StreamTag( const std::string& name, const std::string& type,
195 bool obeysLumiblock,
196 const std::set< uint32_t >& robs = std::set< uint32_t >(),
197 const std::set< uint32_t >& dets = std::set< uint32_t >() );
198
200 const std::string& name() const;
202 const std::string& type() const;
204 bool obeysLumiblock() const;
206 const std::set< uint32_t >& robs() const;
208 const std::set< uint32_t >& dets() const;
209
210 private:
211 std::string m_name;
212 std::string m_type;
215 std::set< uint32_t > m_robs;
216 std::set< uint32_t > m_dets;
217
218 }; // class StreamTag
219
221 const std::vector< StreamTag >& streamTags() const;
223 void setStreamTags( const std::vector< StreamTag >& value );
224
226
229
232 float actualInteractionsPerCrossing() const;
234 void setActualInteractionsPerCrossing( float value );
235
238 float averageInteractionsPerCrossing() const;
240 void setAverageInteractionsPerCrossing( float value );
241
247
249 PileUpMixtureID pileUpMixtureID() const;
251 void setPileUpMixtureID( const PileUpMixtureID &value );
252
257
262
274
276 static const std::string& PileUpType2Name(PileUpType typ);
277
279 static PileUpType PileUpInt2Type(unsigned short typ);
280
286 class SubEvent {
287
288 public:
292
294 int16_t time() const;
296 uint16_t index() const;
298 PileUpType type() const;
300 const std::string& typeName() const;
301
305 const EventInfo_v1* ptr() const;
306
307 private:
313
314 }; // class SubEvent
315
317 const std::vector< SubEvent >& subEvents() const;
319 void setSubEvents( const std::vector< SubEvent >& value );
321 void addSubEvent( const SubEvent& subEvent );
323 void clearSubEvents();
324
326
329
332 Pixel = 0,
333 SCT = 1,
334 TRT = 2,
335 LAr = 3,
336 Tile = 4,
337 Muon = 5,
339 Core = 7,
341 Lumi = 9,
342 nDets = 10
343 };
344
351
388
390 uint32_t eventFlags( EventFlagSubDet subDet ) const;
392 bool isEventFlagBitSet( EventFlagSubDet subDet, size_t bit ) const;
393
395 bool setEventFlags( EventFlagSubDet subDet, uint32_t flags );
397 bool setEventFlagBit( EventFlagSubDet subDet, size_t bit ) const;
399 bool resetEventFlagBit( EventFlagSubDet subDet, size_t bit );
400
404 bool setErrorState( EventFlagSubDet subDet,
405 EventFlagErrorState state );
406
423
425 bool updateEventFlagBit ( const EventFlagSubDet subDet,
426 const size_t bit ) const;
429 bool updateEventFlags( const EventFlagSubDet subDet,
430 const uint32_t flags_in ) const;
435 bool updateErrorState( const EventFlagSubDet subDet,
436 const EventFlagErrorState state ) const;
437
439
442
444 float beamPosX() const;
446 float beamPosY() const;
448 float beamPosZ() const;
450 void setBeamPos( float x, float y, float z );
451
453 float beamPosSigmaX() const;
455 float beamPosSigmaY() const;
457 float beamPosSigmaZ() const;
459 void setBeamPosSigma( float x, float y, float z );
460
462 float beamPosSigmaXY() const;
464 void setBeamPosSigmaXY( float value );
465
467 float beamTiltXZ() const;
469 void setBeamTiltXZ( float value );
470
472 float beamTiltYZ() const;
474 void setBeamTiltYZ( float value );
475
479 void setBeamStatus( uint32_t value );
480
482 float beamSpotWeight() const;
484 bool hasBeamSpotWeight() const;
486 void setBeamSpotWeight( float value );
487
489
492
493#if not defined(__GCCXML__) and not defined(__ROOTCLING__)
497 void setEvtStore( StoreGateSvc* svc );
498#endif // not genreflex or rootcint/rootcling
499
501
503 void toPersistent();
505 void toTransient();
506
507 private:
508 std::vector< EventInfo_v1::SubEvent > makeSubEvents() const;
509
514
515#ifndef __GCCXML__
519#endif // not __GCCXML__
520
521 }; // class EventInfo_v1
522
524 std::ostream& operator<< ( std::ostream& out, const xAOD::EventInfo_v1& ei );
525 std::ostream& operator<< ( std::ostream& out, const xAOD::EventInfo_v1::PileUpMixtureID& id );
528
529} // namespace xAOD
530
531// Declare the inheritance of the type:
532#include "xAODCore/BaseInfo.h"
534
535#endif // XAODEVENTINFO_VERSIONS_EVENTINFO_V1_H
Base class for elements of a container that can have aux data.
Cached value with atomic update.
#define SG_BASE(D, B)
Declare that class D derives from class B.
An STL vector of pointers that by default owns its pointed-to elements.
static Double_t a
xAOD::EventInfo::SubEvent SubEvent
static const uint32_t mask3
#define y
#define x
#define z
Define macros for attributes used to control the static checker.
Cached value with atomic update.
Definition CachedValue.h:55
For details on how the MC particles are defined and organized see https://twiki.cern....
Definition PileUpType.h:33
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
The Athena Transient Store API.
bool obeysLumiblock() const
Get whether the the stream obeys the luminosity block boundaires.
StreamTag(const std::string &name, const std::string &type, bool obeysLumiblock, const std::set< uint32_t > &robs=std::set< uint32_t >(), const std::set< uint32_t > &dets=std::set< uint32_t >())
Constructor giving all relevant information to the object.
const std::set< uint32_t > & dets() const
Get the (optional) list of detector IDs for partial event building.
std::set< uint32_t > m_dets
Optional list of detector IDs for PEB.
bool m_obeysLumiblock
Whether the stream obeys luminosity block boundaries.
const std::string & type() const
Get the type of the stream.
std::string m_type
The type of the stream.
std::string m_name
The name of the stream.
const std::string & name() const
Get the name of the stream.
std::set< uint32_t > m_robs
Optional list of RoB IDs for PEB.
const std::set< uint32_t > & robs() const
Get the (optional) list of RoB IDs for partial event building.
Class describing the properties of one pileup sub-event.
uint16_t m_index
The index of the pileup event.
PileUpType m_type
The type of the pileup event.
SubEvent(int16_t time, uint16_t index, PileUpType type, const ElementLink< EventInfoContainer_v1 > &link)
Constructor giving all relevant information to the object.
ElementLink< EventInfoContainer_v1 > m_link
Link to the EventInfo object in question.
uint16_t index() const
Get the index of the sub-event.
const ElementLink< EventInfoContainer_v1 > & link() const
Get a link to the EventInfo object describing the pileup event.
int16_t m_time
The time wrt. the signal event.
int16_t time() const
Get the time wrt. the signal event (which has time() == 0)
const EventInfo_v1 * ptr() const
Get a pointer to the EventInfo object describing the pileup event.
PileUpType type() const
Get the type of the pileup event.
const std::string & typeName() const
The string name of the type.
Class describing the basic event information.
uint64_t mcEventNumber() const
The MC generator's event number.
void setBeamPosSigma(float x, float y, float z)
Set the size of the beam spot.
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
static const std::string & PileUpType2Name(PileUpType typ)
Convert PileUpType enum value to string.
uint32_t detectorMask3() const
Bit field indicating which TTC zones are present in the event.
void setAverageInteractionsPerCrossing(float value)
Set average interactions per crossing for all BCIDs.
CxxUtils::CachedValue< std::vector< StreamTag > > m_streamTags
Cached stream tag objects.
bool resetEventFlagBit(EventFlagSubDet subDet, size_t bit)
Reset one particular bit of one particular sub-detector.
void setBCID(uint32_t value)
Set the bunch crossing ID of the event.
uint64_t pileUpMixtureIDLowBits() const
Unique pile-up mixture identifier low bits.
float beamPosSigmaY() const
The width of the beam spot in the Y direction.
void setDetectorMask(uint32_t mask0, uint32_t mask1)
Set the bit fields indicating with TTC timezones were present.
uint32_t lumiBlock() const
The current event's luminosity block number.
void setTimeStampNSOffset(uint32_t value)
Set the nanosecond offset wrt. the time stamp.
void setMCEventNumber(uint64_t value)
Set the MC generator's event number.
bool eventType(EventType type) const
Check for one particular bitmask value.
uint32_t statusElement() const
Trigger status element.
std::vector< EventInfo_v1::SubEvent > makeSubEvents() const
void toPersistent()
Prepare the object for writing.
std::vector< std::pair< std::string, std::string > > DetDescrTags_t
Type of the detector description tags.
uint32_t eventTypeBitmask() const
The event type bitmask.
uint32_t bcid() const
The bunch crossing ID of the event.
EventFlagSubDet
Sub-detector types for which we store event-level flags.
@ Background
The beam background detectors.
@ Core
Core flags describing the event.
@ ForwardDet
The forward detectors.
@ Lumi
The luminosity detectors.
@ nDets
Number of sub-detector type in this enumeration.
float beamPosX() const
X coordinate of the beam spot position.
void setDetectorMask1(uint32_t value)
Set the bit field indicating with TTC timezones were present.
bool updateEventFlagBit(const EventFlagSubDet subDet, const size_t bit) const
Change detector flags with update semantics.
void setStreamTags(const std::vector< StreamTag > &value)
Set the streams that the event was put in.
void setBeamTiltYZ(float value)
Set the beam's tilt in radians in YZ.
void setTimeStamp(uint32_t value)
Set the POSIX time of the event.
bool setErrorState(EventFlagSubDet subDet, EventFlagErrorState state)
Set the error state for a particular sub-detector.
void clearSubEvents()
Clear all the currently held sub-events.
StoreGateSvc * m_evtStore
Transient pointer to the StoreGateSvc instance associated with the event (Needed for pile-up digitisa...
float beamPosSigmaXY() const
The beam spot shape's X-Y correlation.
float beamSpotWeight() const
Weight for beam spot size reweighting.
void toTransient()
Cleanse the object after being read in.
BackgroundEventFlag
Enum for bits in Background EventFlag word.
void setLevel1TriggerType(uint16_t value)
Set the Level-1 trigger type.
bool updateEventFlags(const EventFlagSubDet subDet, const uint32_t flags_in) const
Turn on a set of event flags for one particular sub-detector.
void setDetectorMask0(uint32_t value)
Set the bit field indicating with TTC timezones were present.
StoreGateSvc *evtStore ATLAS_NOT_CONST_THREAD_SAFE() const
Get the pointer to the event store associated with this event.
bool setEventFlags(EventFlagSubDet subDet, uint32_t flags)
Set the event flags for a particular sub-detector.
EventInfo_v1 & operator=(const EventInfo_v1 &rhs)
Assignment operator.
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
void setDetectorMaskExt(uint32_t mask2, uint32_t mask3)
Set the bit fields indicating with TTC timezones were present.
void setEventNumber(uint64_t value)
Set the current event's event number.
void setSubEvents(const std::vector< SubEvent > &value)
Set the pileup events that were used in the simulation.
void setBeamSpotWeight(float value)
Set weight for beam spot size reweighting.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
void setBeamPos(float x, float y, float z)
Set the beam spot position.
uint16_t level1TriggerType() const
The Level-1 trigger type.
EventFlagErrorState
States that a given sub-detector could be in.
@ Warning
The sub-detector issued a warning.
@ NotSet
The flag was not set to anything.
@ Error
The sub-detector issued an error.
float beamTiltYZ() const
The beam's tilt in radians in YZ.
PileUpMixtureID pileUpMixtureID() const
Unique pile-up mixture identifier.
void setBeamPosSigmaXY(float value)
Set the beam spot shape's X-Y correlation.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
CxxUtils::CachedValue< std::vector< SubEvent > > m_subEvents
Cached sub-event objects.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
void addSubEvent(const SubEvent &subEvent)
Add one sub-event to the existing list.
void setPileUpMixtureID(const PileUpMixtureID &value)
Set unique pile-up mixture identifier.
uint32_t detectorMask1() const
Bit field indicating which TTC zones are present in the event.
void setDetectorMask2(uint32_t value)
Set the bit field indicating with TTC timezones were present.
void setEventTypeBitmask(uint32_t value)
Set the event type bitmask.
void setBeamStatus(uint32_t value)
Set the beam spot's status word.
void setMCChannelNumber(uint32_t value)
Set the MC generator's channel number.
void setExtendedLevel1ID(uint32_t value)
Set the extended Level-1 identifier.
void setDetDescrTags(const DetDescrTags_t &value)
Set the detector description tags.
uint32_t eventFlags(EventFlagSubDet subDet) const
Get the event flags for a particular sub-detector.
uint64_t detectorMaskExt() const
Bit field indicating which TTC zones are present in the event.
const std::vector< SubEvent > & subEvents() const
Get the pileup events that were used in the simulation.
const std::vector< StreamTag > & streamTags() const
Get the streams that the event was put in.
void setDetectorMask3(uint32_t value)
Set the bit field indicating with TTC timezones were present.
void setMCEventWeights(const std::vector< float > &value)
Set the weights of all the MC events used in the simulation.
void setRunNumber(uint32_t value)
Set the current event's run number.
EventInfo_v1()
Default constructor.
void setEvtStore(StoreGateSvc *svc)
Set the pointer to the event store associated with this event.
float beamPosSigmaX() const
The width of the beam spot in the X direction.
uint32_t detectorMask0() const
Bit field indicating which TTC zones are present in the event.
PileUpType
Enumerator describing the types of pileup events.
@ HaloGas
Halo-gas non-collision background.
@ HighPtMinimumBias
High pT Minimum bias pileup event.
@ MinimumBias
(Low pT) Minimum bias pileup event
@ ZeroBias
Zero bias pileup event.
@ Signal
The signal event.
@ Cavern
Cavern background pileup event.
@ Unknown
Type not known/specified.
void setBeamTiltXZ(float value)
Set the beam's tilt in radians in XZ.
EventType
Event type codes that can be set/checked in the bitmask.
@ IS_CALIBRATION
true: calibration, false: physics
@ IS_SIMULATION
true: simulation, false: data
@ IS_TESTBEAM
true: testbeam, false: full detector
float beamPosZ() const
Z coordinate of the beam spot position.
uint64_t pileUpMixtureIDHighBits() const
Unique pile-up mixture identifier high bits.
bool updateErrorState(const EventFlagSubDet subDet, const EventFlagErrorState state) const
Update the error state for one particular sub-detector.
uint32_t runNumber() const
The current event's run number.
uint32_t mcChannelNumber() const
The MC generator's channel number.
bool hasBeamSpotWeight() const
Check if weight for beam spot size reweighting exists.
void setPileUpMixtureIDHighBits(uint64_t value)
Set unique pile-up mixture identifier high bits.
uint32_t detectorMask2() const
Bit field indicating which TTC zones are present in the event.
void setStatusElement(uint32_t value)
Set the trigger status element.
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
uint64_t eventNumber() const
The current event's event number.
void setLumiBlock(uint32_t value)
Set the current event's luminosity block number.
float beamPosSigmaZ() const
The length of the beam spot in the Z direction.
float beamPosY() const
Y coordinate of the beam spot position.
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
bool setEventFlagBit(EventFlagSubDet subDet, size_t bit) const
Set one particular bit of one particular sub-detector.
uint64_t detectorMask() const
Bit field indicating which TTC zones are present in the event.
uint32_t extendedLevel1ID() const
The extended Level-1 identifier.
static PileUpType PileUpInt2Type(unsigned short typ)
Convert int to PileUpType enum value.
const DetDescrTags_t & detDescrTags() const
The detector description tags.
void setPileUpMixtureIDLowBits(uint64_t value)
Set unique pile-up mixture identifier low bits.
float beamTiltXZ() const
The beam's tilt in radians in XZ.
uint32_t beamStatus() const
The beam spot's status word.
void setActualInteractionsPerCrossing(float value)
Set average interactions per crossing for the current BCID.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition HitInfo.h:33
Definition index.py:1
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
DataVector< EventInfo_v1 > EventInfoContainer_v1
Container type for event info objects.
bool operator==(const xAOD::EventInfo_v1::PileUpMixtureID &a, const xAOD::EventInfo_v1::PileUpMixtureID &b)
This operator is provided to make it convenient to compare two instances of PileUpMixtureID directly.
setScaleOne setStatusOne setSaturated int16_t
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
setWord1 uint16_t
setEventNumber uint32_t
Unique pile-up mixture identifier definition.