ATLAS Offline Software
Loading...
Searching...
No Matches
PileUpStream.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#ifndef PILEUPSTREAM_PILEUPSTREAM_H
6#define PILEUPSTREAM_PILEUPSTREAM_H
11
12#include <string>
13
14// Framework include files
15#include "GaudiKernel/IEvtSelector.h"
16#include "GaudiKernel/ServiceHandle.h"
18
20#include "xAODEventInfo/EventInfo.h" //typedef, cannot fwd declare
21
22// Forward declarations
23class ISvcLocator;
24class StoreGateSvc;
25
26
31 : public AthMessaging
32{
33public:
34 typedef IEvtSelector::Context EvtIterator;
35
37
39 PileUpStream(const PileUpStream& rhs) = delete;
40 PileUpStream& operator=(const PileUpStream& rhs) = delete;
43 PileUpStream(const std::string& name,
44 ISvcLocator* svcLoc,
45 const std::string& selecName);
46 PileUpStream(const std::string& name,
47 ISvcLocator* svcLoc,
48 IEvtSelector* sel);
49
50 virtual ~PileUpStream();
52
54 inline const std::string& name() { return m_name; }
55 inline IEvtSelector& selector() { return *m_sel; }
56 inline EvtIterator& iterator() { return *p_iter; }
57 inline StoreGateSvc& store() { return *m_SG; }
58 inline const IEvtSelector& selector() const { return *m_sel; }
59 inline const EvtIterator& iterator() const { return *p_iter; }
60 inline const StoreGateSvc& store() const { return *m_SG; }
62
64 const xAOD::EventInfo* nextEventPre(bool readRecord=true);
65
67 bool nextEventPre_Passive(bool readRecord);
68
70 bool setupStore();
72 inline bool setupStore(bool ) { return setupStore();}
73
75 StatusCode finalize();
76
78 bool used() const {return m_used;}
79 void setUsed() {m_used=true;}
80 void resetUsed() {m_used=false;}
81 bool hasRing() const { return m_hasRing; }
83 unsigned int originalIRing() const { return m_iOriginalRing; }
84 void setOriginalIRing(unsigned int iR) {
85 if (!m_hasRing) {
86 m_hasRing=true;
88 }
89 }
90
91
92private:
93 ISvcLocator* serviceLocator() { return p_svcLoc; }
94
96 StatusCode nextRecordPre();
97
99 StatusCode nextRecordPre_Passive();
100
102 bool loadStore();
103
105 void setActiveStore();
106
108 std::string m_name;
110 ISvcLocator* p_svcLoc{nullptr};
112 SmartIF<IEvtSelector> m_sel;
114 SmartIF<StoreGateSvc> m_SG;
117
119
120
121 bool m_ownEvtIterator{false};
122 bool m_neverLoaded{true};
123 bool m_ownStore{false};
124
125 bool m_used{false};
126 bool m_hasRing{false};
127 unsigned int m_iOriginalRing{0};
128};
129#endif // PILEUPSTREAM_PILEUPSTREAM_H
130
131
132
133
134
the preferred mechanism to access information from the different event stores in a pileup job.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
bool used() const
has this stream already be used in this event?
StoreGateSvc & store()
PileUpStream & operator=(const PileUpStream &rhs)=delete
bool m_ownEvtIterator
do we own p_iter?
bool m_ownStore
is m_SG a store we cloned from the master one?
bool setupStore()
setup input and overlay selectors and iters
const std::string & name()
bool m_neverLoaded
has an event been loaded into this stream?
bool setupStore(bool)
backward compatibility
PileUpStream(const PileUpStream &rhs)=delete
const IEvtSelector & selector() const
ISvcLocator * serviceLocator()
const xAOD::EventInfo * nextEventPre(bool readRecord=true)
return next Event, load store with next Event
bool hasRing() const
StatusCode nextRecordPre_Passive()
increment event iterator
bool m_used
has this stream already been used? (for the current event)
void setOriginalIRing(unsigned int iR)
virtual ~PileUpStream()
bool loadStore()
clear store and load new proxies
SmartIF< IEvtSelector > m_sel
Selector.
PileUpStream()
Structors.
StatusCode nextRecordPre()
increment event iterator before loading store
unsigned int originalIRing() const
index of the ring for which this stream was used originally
std::string m_name
Stream name.
StatusCode finalize()
finalize and release store. To be called on ... finalize()
unsigned int m_iOriginalRing
original ring in which event was used
const StoreGateSvc & store() const
EvtIterator * p_iter
Input Iterators.
EvtIterator & iterator()
IEvtSelector::Context EvtIterator
void resetUsed()
SmartIF< StoreGateSvc > m_SG
StoreGateSvc;.
void setActiveStore()
set ActiveStore
bool nextEventPre_Passive(bool readRecord)
like nextEventPre, but doesn't actually load anything
IEvtSelector & selector()
const EvtIterator & iterator() const
ServiceHandle< PileUpMergeSvc > m_mergeSvc
ISvcLocator * p_svcLoc
ServiceLocator.
The Athena Transient Store API.
EventInfo_v1 EventInfo
Definition of the latest event info version.