ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
EventSelectorMuonCalibStream Class Reference

#include <EventSelectorMuonCalibStream.h>

Inheritance diagram for EventSelectorMuonCalibStream:
Collaboration diagram for EventSelectorMuonCalibStream:

Public Member Functions

 EventSelectorMuonCalibStream (const std::string &name, ISvcLocator *svcloc)
 
 ~EventSelectorMuonCalibStream ()
 
virtual StatusCode initialize ()
 
virtual StatusCode createContext (Context *&it) const
 
virtual StatusCode next (Context &it) const
 
virtual StatusCode next (Context &it, int jump) const
 
virtual StatusCode previous (Context &it) const
 
virtual StatusCode previous (Context &it, int jump) const
 
virtual StatusCode last (Context &it) const
 
virtual StatusCode rewind (Context &it) const
 
virtual StatusCode createAddress (const Context &it, IOpaqueAddress *&iop) const
 
virtual StatusCode releaseContext (Context *&it) const
 
virtual StatusCode resetCriteria (const std::string &criteria, Context &context) const
 

Private Attributes

Gaudi::Property< int > m_SkipEvents {this, "SkipEvents", 0, "Number of events to skip at the beginning"}
 
ServiceHandle< MuonCalibStreamInputSvcm_eventSource { this, "MuonCalibStreamInputSvc", "MuonCalibStreamFileInputSvc"}
 
ServiceHandle< IMuonCalibStreamDataProviderSvcm_dataProvider {this, "DataProvider", "MuonCalibStreamDataProviderSvc"}
 
EventContextMuonCalibStreamm_beginIter
 
EventContextMuonCalibStreamm_endIter
 
std::atomic< long > m_NumEvents {0}
 

Detailed Description

Definition at line 25 of file EventSelectorMuonCalibStream.h.

Constructor & Destructor Documentation

◆ EventSelectorMuonCalibStream()

EventSelectorMuonCalibStream::EventSelectorMuonCalibStream ( const std::string &  name,
ISvcLocator *  svcloc 
)

Definition at line 21 of file EventSelectorMuonCalibStream.cxx.

21  :
22  base_class(name, svcloc),
23  m_beginIter(nullptr),
24  m_endIter(nullptr)
25 {
26  ATH_MSG_DEBUG("EventSelectorMuonCalibStream constructor");
27 }

◆ ~EventSelectorMuonCalibStream()

EventSelectorMuonCalibStream::~EventSelectorMuonCalibStream ( )

Definition at line 30 of file EventSelectorMuonCalibStream.cxx.

30  {
31  if (m_beginIter) delete m_beginIter;
32  if (m_endIter) delete m_endIter;
33 }

Member Function Documentation

◆ createAddress()

StatusCode EventSelectorMuonCalibStream::createAddress ( const Context &  it,
IOpaqueAddress *&  iop 
) const
virtual

Definition at line 125 of file EventSelectorMuonCalibStream.cxx.

125  {
126  ATH_MSG_DEBUG("EventSelectorMuonCalibStream::createAddress");
127  const LVL2_MUON_CALIBRATION::CalibEvent *pre = m_eventSource->currentEvent();
128  m_dataProvider->setNextEvent(pre);
129  ATH_MSG_DEBUG("Calib Event cached in Data Provider ");
130 
131  iop = new MuonCalibStreamAddress(ClassID_traits<xAOD::EventInfo>::ID(), "EventInfo", ""); // change to xAOD::EventInfo key
132  //iop = new MuonCalibStreamAddress(ClassID_traits<xAOD::EventInfo>::ID(), "MuonCalibStreamEventInfo", ""); // old key which need the conversion afterwards
133  ATH_MSG_DEBUG("MuonCalibStreamAddress for MuonCalibStreamEventInfo created ");
134 
135  return (StatusCode::SUCCESS);
136 }

◆ createContext()

StatusCode EventSelectorMuonCalibStream::createContext ( IEvtSelector::Context *&  it) const
virtual

Definition at line 53 of file EventSelectorMuonCalibStream.cxx.

53  {
54  it = new EventContextMuonCalibStream(this);
55  return (StatusCode::SUCCESS);
56 }

◆ initialize()

StatusCode EventSelectorMuonCalibStream::initialize ( )
virtual

Definition at line 36 of file EventSelectorMuonCalibStream.cxx.

36  {
37  ATH_MSG_INFO("EventSelectorMuonCalibStream::initialize");
38 
39  // Check MuonCalibStreamCnvSvc
40  ATH_CHECK( m_eventSource.retrieve() );
41 
42  ATH_CHECK( m_dataProvider.retrieve() );
43 
44  // Create the begin and end iterators for this selector.
46  // increment to get the new event in.
47  // ++(*m_beginIter); ???
49 
50  return StatusCode::SUCCESS;
51 }

◆ last()

StatusCode EventSelectorMuonCalibStream::last ( IEvtSelector::Context &  it) const
virtual

Definition at line 105 of file EventSelectorMuonCalibStream.cxx.

105  {
106  if (it.identifier() == m_endIter->identifier()) {
107  ATH_MSG_DEBUG("last(): Last event in InputStream.");
108  return (StatusCode::SUCCESS);
109  }
110  return (StatusCode::FAILURE);
111 }

◆ next() [1/2]

StatusCode EventSelectorMuonCalibStream::next ( IEvtSelector::Context &  it) const
virtual

Definition at line 59 of file EventSelectorMuonCalibStream.cxx.

59  {
60  ATH_MSG_DEBUG(" EventSelectorMuonCalibStream::next m_NumEvents=" << m_NumEvents);
61  for (;;) {
62  const LVL2_MUON_CALIBRATION::CalibEvent *pre = m_eventSource->nextEvent();
63  if (!pre) {
64  // End of file
65  it = *m_endIter;
66  return StatusCode::FAILURE;
67  }
68  ++m_NumEvents;
69 
70  // Check if we are skipping events
71  if (m_NumEvents > m_SkipEvents) {
72  break;
73  } else {
74  ATH_MSG_DEBUG(" Skipping event " << m_NumEvents - 1);
75  }
76  }
77 
78  return StatusCode::SUCCESS;
79 }

◆ next() [2/2]

StatusCode EventSelectorMuonCalibStream::next ( IEvtSelector::Context &  ctxt,
int  jump 
) const
virtual

Definition at line 83 of file EventSelectorMuonCalibStream.cxx.

83  {
84  ATH_MSG_DEBUG(" EventSelectorMuonCalibStream::next skipping events ==" << jump);
85  if (jump > 0) {
86  for (int i = 0; i < jump; ++i) {
87  StatusCode status = next(ctxt);
88  if (!status.isSuccess()) { return status; }
89  }
90  return StatusCode::SUCCESS;
91  }
92  return StatusCode::FAILURE;
93 }

◆ previous() [1/2]

StatusCode EventSelectorMuonCalibStream::previous ( IEvtSelector::Context &  it) const
virtual

Definition at line 96 of file EventSelectorMuonCalibStream.cxx.

96  {
97  ATH_MSG_ERROR("EventSelectorMuonCalibStream::previous() not implemented");
98  return (StatusCode::FAILURE);
99 }

◆ previous() [2/2]

StatusCode EventSelectorMuonCalibStream::previous ( IEvtSelector::Context &  it,
int  jump 
) const
virtual

Definition at line 102 of file EventSelectorMuonCalibStream.cxx.

102 { return (previous(it)); }

◆ releaseContext()

StatusCode EventSelectorMuonCalibStream::releaseContext ( IEvtSelector::Context *&  it) const
virtual

Definition at line 139 of file EventSelectorMuonCalibStream.cxx.

139 { return (StatusCode::SUCCESS); }

◆ resetCriteria()

StatusCode EventSelectorMuonCalibStream::resetCriteria ( const std::string &  criteria,
IEvtSelector::Context &  context 
) const
virtual

Definition at line 114 of file EventSelectorMuonCalibStream.cxx.

114  {
115  return (StatusCode::SUCCESS);
116 }

◆ rewind()

StatusCode EventSelectorMuonCalibStream::rewind ( IEvtSelector::Context &  it) const
virtual

Definition at line 119 of file EventSelectorMuonCalibStream.cxx.

119  {
120  ATH_MSG_ERROR("EventSelectorMuonCalibStream::rewind() not implemented");
121  return (StatusCode::FAILURE);
122 }

Member Data Documentation

◆ m_beginIter

EventContextMuonCalibStream* EventSelectorMuonCalibStream::m_beginIter
private

Definition at line 56 of file EventSelectorMuonCalibStream.h.

◆ m_dataProvider

ServiceHandle<IMuonCalibStreamDataProviderSvc> EventSelectorMuonCalibStream::m_dataProvider {this, "DataProvider", "MuonCalibStreamDataProviderSvc"}
private

Definition at line 54 of file EventSelectorMuonCalibStream.h.

◆ m_endIter

EventContextMuonCalibStream* EventSelectorMuonCalibStream::m_endIter
private

Definition at line 57 of file EventSelectorMuonCalibStream.h.

◆ m_eventSource

ServiceHandle<MuonCalibStreamInputSvc> EventSelectorMuonCalibStream::m_eventSource { this, "MuonCalibStreamInputSvc", "MuonCalibStreamFileInputSvc"}
private

Definition at line 53 of file EventSelectorMuonCalibStream.h.

◆ m_NumEvents

std::atomic<long> EventSelectorMuonCalibStream::m_NumEvents {0}
mutableprivate

Definition at line 59 of file EventSelectorMuonCalibStream.h.

◆ m_SkipEvents

Gaudi::Property<int> EventSelectorMuonCalibStream::m_SkipEvents {this, "SkipEvents", 0, "Number of events to skip at the beginning"}
private

Definition at line 52 of file EventSelectorMuonCalibStream.h.


The documentation for this class was generated from the following files:
EventSelectorMuonCalibStream::next
virtual StatusCode next(Context &it) const
Definition: EventSelectorMuonCalibStream.cxx:59
EventSelectorMuonCalibStream::m_NumEvents
std::atomic< long > m_NumEvents
Definition: EventSelectorMuonCalibStream.h:59
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
EventSelectorMuonCalibStream::m_SkipEvents
Gaudi::Property< int > m_SkipEvents
Definition: EventSelectorMuonCalibStream.h:52
skel.it
it
Definition: skel.GENtoEVGEN.py:396
EventSelectorMuonCalibStream::previous
virtual StatusCode previous(Context &it) const
Definition: EventSelectorMuonCalibStream.cxx:96
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EventSelectorMuonCalibStream::m_beginIter
EventContextMuonCalibStream * m_beginIter
Definition: EventSelectorMuonCalibStream.h:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
EventContextMuonCalibStream::identifier
virtual void * identifier() const
Inequality operator.
Definition: EventContextMuonCalibStream.cxx:25
EventSelectorMuonCalibStream::m_endIter
EventContextMuonCalibStream * m_endIter
Definition: EventSelectorMuonCalibStream.h:57
EventSelectorMuonCalibStream::m_eventSource
ServiceHandle< MuonCalibStreamInputSvc > m_eventSource
Definition: EventSelectorMuonCalibStream.h:53
merge.status
status
Definition: merge.py:17
MuonCalibStreamAddress
Definition: MuonCalibStreamAddress.h:14
EventContextMuonCalibStream
This class provides the Context for EventSelectorMuonCalibStream.
Definition: EventContextMuonCalibStream.h:23
EventSelectorMuonCalibStream::m_dataProvider
ServiceHandle< IMuonCalibStreamDataProviderSvc > m_dataProvider
Definition: EventSelectorMuonCalibStream.h:54