ATLAS Offline Software
PileUpEventInfo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 /* -C++- */
6 #ifndef EVENTINFO_PILEUPEVENTINFO_H
7 # define EVENTINFO_PILEUPEVENTINFO_H 1
8 
20 #include <cassert>
21 #include "EventInfo/EventInfo.h"
23 #include "GaudiKernel/ClassID.h"
24 
25 #include <list>
26 class StoreGateSvc;
27 class MsgStream;
28 
37 class PileUpEventInfo: public EventInfo {
38 public:
40 
42 
45 
46  virtual ~PileUpEventInfo();
47 
48  PileUpEventInfo(const PileUpEventInfo&) = default;
53 
57  struct SubEvent {
58  private:
60  public:
63 
67 
68  SubEvent();
69  ~SubEvent();
70  SubEvent(const SubEvent&);
71  SubEvent& operator = (const SubEvent&);
72  SubEvent(SubEvent&&);
74  SubEvent(time_type t, const EventInfo* pse, StoreGateSvc* psg);
76  const EventInfo* pse, StoreGateSvc* psg);
79  const EventInfo* pse, StoreGateSvc* psg);
80  SubEvent(time_type t, unsigned int BCID, index_type index,
82  const EventInfo& rse, StoreGateSvc* psg);
83 
84  SubEvent(time_type t, std::unique_ptr<EventInfo> pse, StoreGateSvc* psg);
86  std::unique_ptr<EventInfo> pse, StoreGateSvc* psg);
89  std::unique_ptr<EventInfo> pse, StoreGateSvc* psg);
90  SubEvent(time_type t, unsigned int BCID, index_type index,
92  std::unique_ptr<EventInfo> pse, StoreGateSvc* psg);
93 
95  time_type time() const {return m_timeIndex.time();}
96  index_type index() const {return m_timeIndex.index();}
97 
98  unsigned int BCID() const;
100  pileup_type type() const {return m_timeIndex.type();}
101 
102  typedef std::list<SubEvent>::const_iterator const_iterator;
104  };
105 
110  const EventInfo* pse, StoreGateSvc* psg) {
111  m_subEvents.emplace_back(t, m_subEvents.size(), puType, pse, psg);
112  }
113 
115  std::unique_ptr<EventInfo> pse, StoreGateSvc* psg) {
116  m_subEvents.emplace_back(t, m_subEvents.size(), puType, std::move(pse), psg);
117  }
118 
120  void addSubEvt(time_type t, unsigned int BCID,
122  const EventInfo& rse, StoreGateSvc* psg) {
123  m_subEvents.emplace_back(t, BCID, m_subEvents.size(), puType, rse, psg);
124  }
125 
126  void addSubEvt(time_type t, unsigned int BCID,
128  std::unique_ptr<EventInfo>& pse, StoreGateSvc* psg) {
129  m_subEvents.emplace_back(t, BCID, m_subEvents.size(), puType, std::move(pse), psg);
130  }
131 
132  //NO INSERTIONS only push_backs in m_subEvents!
133 
135 
141 private:
142  std::list<SubEvent> m_subEvents; //FIXME should become a vector
143 };
144 
145 #include "AthenaKernel/CLASS_DEF.h"
146 CLASS_DEF(PileUpEventInfo, 2102, 1)
147 
148 #include "AthenaKernel/BaseInfo.h"
150 
151 #endif // EVENTINFO_PILEUPEVENTINFO_H
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PileUpEventInfo::time_type
SubEvent::time_type time_type
Definition: PileUpEventInfo.h:106
PileUpEventInfo::PileUpEventInfo
PileUpEventInfo()
Definition: PileUpEventInfo.cxx:18
PileUpEventInfo::PileUpEventInfo
PileUpEventInfo(PileUpEventInfo &&)=default
PileUpEventInfo::SubEvent::pSubEvt
EventInfo * pSubEvt
redundant but handy e.g. for persist. FIXME OWNED COPY
Definition: PileUpEventInfo.h:61
PileUpEventInfo::operator=
PileUpEventInfo & operator=(PileUpEventInfo &&)=default
PileUpTimeEventIndex::index_type
unsigned long index_type
Definition: PileUpTimeEventIndex.h:25
PileUpEventInfo::SubEvent::index
index_type index() const
Definition: PileUpEventInfo.h:96
index
Definition: index.py:1
EventType
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition: EventType.h:92
PileUpEventInfo::endSubEvt
SubEvent::const_iterator endSubEvt() const
Definition: PileUpEventInfo.h:139
PileUpEventInfo::addSubEvt
void addSubEvt(time_type t, unsigned int BCID, PileUpTimeEventIndex::PileUpType puType, const EventInfo &rse, StoreGateSvc *psg)
setter for the subEvt collection t=0(ns) for the original event
Definition: PileUpEventInfo.h:120
PileUpEventInfo::operator=
PileUpEventInfo & operator=(const PileUpEventInfo &)=default
PileUpTimeEventIndex::PileUpType
PileUpType
Definition: PileUpTimeEventIndex.h:14
PileUpTimeEventIndex::index
index_type index() const
the index of the component event in PileUpEventInfo
Definition: PileUpTimeEventIndex.cxx:76
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
PileUpEventInfo::SubEvent::type
pileup_type type() const
pileup event proveance
Definition: PileUpEventInfo.h:100
PileUpEventInfo::index_type
SubEvent::index_type index_type
Definition: PileUpEventInfo.h:107
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
PileUpEventInfo::SubEvent::time_type
PileUpTimeEventIndex::time_type time_type
Definition: PileUpEventInfo.h:64
PileUpTimeEventIndex.h
PileUpEventInfo::SubEvent::time
time_type time() const
t0 wrto original event (hence original evt time == 0)
Definition: PileUpEventInfo.h:95
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
PileUpEventInfo::SubEvent::operator=
SubEvent & operator=(const SubEvent &)
Definition: PileUpEventInfo.cxx:49
PileUpEventInfo::SubEvent::BCID
unsigned int BCID() const
Definition: PileUpEventInfo.cxx:151
PileUpEventInfo::beginSubEvt
SubEvent::iterator beginSubEvt()
Definition: PileUpEventInfo.h:136
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:122
PileUpEventInfo::~PileUpEventInfo
virtual ~PileUpEventInfo()
Definition: PileUpEventInfo.cxx:31
PileUpEventInfo::SubEvent::index_type
PileUpTimeEventIndex::index_type index_type
Definition: PileUpEventInfo.h:65
PileUpEventInfo::m_subEvents
std::list< SubEvent > m_subEvents
Definition: PileUpEventInfo.h:142
PileUpTimeEventIndex::time_type
long time_type
Definition: PileUpTimeEventIndex.h:24
PileUpEventInfo::addSubEvt
void addSubEvt(time_type t, PileUpTimeEventIndex::PileUpType puType, const EventInfo *pse, StoreGateSvc *psg)
setter for the subEvt collection t=0(ns) for the original event
Definition: PileUpEventInfo.h:109
PileUpEventInfo::addSubEvt
void addSubEvt(time_type t, unsigned int BCID, PileUpTimeEventIndex::PileUpType puType, std::unique_ptr< EventInfo > &pse, StoreGateSvc *psg)
Definition: PileUpEventInfo.h:126
SG_ADD_BASE
SG_ADD_BASE(PileUpEventInfo, EventInfo)
PileUpEventInfo::beginSubEvt
SubEvent::const_iterator beginSubEvt() const
Definition: PileUpEventInfo.h:138
PileUpEventInfo::SubEvent::m_timeIndex
PileUpTimeEventIndex m_timeIndex
Definition: PileUpEventInfo.h:59
TriggerInfo
This class contains trigger related information.
Definition: TriggerInfo.h:77
PileUpTimeEventIndex::time
time_type time() const
bunch xing time in ns
Definition: PileUpTimeEventIndex.cxx:71
PileUpEventInfo::SubEvent::SubEvent
SubEvent()
Definition: PileUpEventInfo.cxx:34
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:43
PileUpEventInfo::SubEvent::iterator
std::list< SubEvent >::iterator iterator
Definition: PileUpEventInfo.h:103
PileUpEventInfo
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
Definition: PileUpEventInfo.h:37
PileUpEventInfo::SubEvent::const_iterator
std::list< SubEvent >::const_iterator const_iterator
Definition: PileUpEventInfo.h:102
PileUpEventInfo::addSubEvt
void addSubEvt(time_type t, PileUpTimeEventIndex::PileUpType puType, std::unique_ptr< EventInfo > pse, StoreGateSvc *psg)
Definition: PileUpEventInfo.h:114
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:67
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventID.h:35
PileUpTimeEventIndex
a struct encapsulating the identifier of a pile-up event
Definition: PileUpTimeEventIndex.h:12
PileUpTimeEventIndex::type
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
Definition: PileUpTimeEventIndex.cxx:81
PileUpEventInfo::SubEvent
a triple allowing access to a sub-event
Definition: PileUpEventInfo.h:57
PileUpEventInfo::SubEvent::pileup_type
PileUpTimeEventIndex::PileUpType pileup_type
Definition: PileUpEventInfo.h:66
CLASS_DEF.h
macros to associate a CLID to a type
PileUpEventInfo::SubEvent::~SubEvent
~SubEvent()
Definition: PileUpEventInfo.cxx:78
PileUpEventInfo::PileUpEventInfo
PileUpEventInfo(const PileUpEventInfo &)=default
PileUpEventInfo::endSubEvt
SubEvent::iterator endSubEvt()
Definition: PileUpEventInfo.h:137
PileUpEventInfo::SubEvent::pSubEvtSG
StoreGateSvc * pSubEvtSG
the sub event store
Definition: PileUpEventInfo.h:62