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 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
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Private Attributes

string m_eventSourceName
 
EventContextMuonCalibStreamm_beginIter
 
EventContextMuonCalibStreamm_endIter
 
MuonCalibStreamInputSvcm_eventSource
 
IMuonCalibStreamDataProviderSvcm_dataProvider
 
int m_SkipEvents
 
long m_NumEvents ATLAS_THREAD_SAFE = 0
 

Detailed Description

Definition at line 26 of file EventSelectorMuonCalibStream.h.

Constructor & Destructor Documentation

◆ EventSelectorMuonCalibStream()

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

Definition at line 22 of file EventSelectorMuonCalibStream.cxx.

22  :
23  AthService(name, svcloc),
24  m_beginIter(nullptr),
25  m_endIter(nullptr),
26  m_eventSource(nullptr),
27  m_dataProvider(nullptr),
28  m_SkipEvents(0),
29  m_NumEvents(0) {
30  ATH_MSG_DEBUG("EventSelectorMuonCalibStream constructor");
31  m_eventSourceName = "MuonCalibStreamFileInputSvc";
32  m_SkipEvents = 0;
33  declareProperty("MuonCalibStreamInputSvc", m_eventSourceName);
34  declareProperty("SkipEvents", m_SkipEvents);
35 }

◆ ~EventSelectorMuonCalibStream()

EventSelectorMuonCalibStream::~EventSelectorMuonCalibStream ( )

Definition at line 38 of file EventSelectorMuonCalibStream.cxx.

38  {
39  // if(m_eventSource) m_eventSource->release();
40  if (m_beginIter) delete m_beginIter;
41  if (m_endIter) delete m_endIter;
42 }

Member Function Documentation

◆ createAddress()

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

Definition at line 141 of file EventSelectorMuonCalibStream.cxx.

141  {
142  ATH_MSG_DEBUG("EventSelectorMuonCalibStream::createAddress");
143  const LVL2_MUON_CALIBRATION::CalibEvent *pre = m_eventSource->currentEvent();
145  ATH_MSG_DEBUG("Calib Event cached in Data Provider ");
146 
147  iop = new MuonCalibStreamAddress(ClassID_traits<xAOD::EventInfo>::ID(), "EventInfo", ""); // change to xAOD::EventInfo key
148  //iop = new MuonCalibStreamAddress(ClassID_traits<xAOD::EventInfo>::ID(), "MuonCalibStreamEventInfo", ""); // old key which need the conversion afterwards
149  ATH_MSG_DEBUG("MuonCalibStreamAddress for MuonCalibStreamEventInfo created ");
150 
151  return (StatusCode::SUCCESS);
152 }

◆ createContext()

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

Definition at line 69 of file EventSelectorMuonCalibStream.cxx.

69  {
70  it = new EventContextMuonCalibStream(this);
71  return (StatusCode::SUCCESS);
72 }

◆ initialize()

StatusCode EventSelectorMuonCalibStream::initialize ( )
virtual

Definition at line 45 of file EventSelectorMuonCalibStream.cxx.

45  {
46  ATH_MSG_INFO("EventSelectorMuonCalibStream::initialize");
47  // Check MuonCalibStreamCnvSvc
48  IService *svc;
49  ATH_CHECK(serviceLocator()->getService(m_eventSourceName, svc));
50 
51  m_eventSource = dynamic_cast<MuonCalibStreamInputSvc *>(svc);
52  if (m_eventSource == 0) {
53  ATH_MSG_ERROR("Cannot cast to MuonCalibStreamInputSvc");
54  return StatusCode::FAILURE;
55  }
56  m_eventSource->addRef();
57 
58  ATH_CHECK(service("MuonCalibStreamDataProviderSvc", m_dataProvider));
59 
60  // Create the begin and end iterators for this selector.
62  // increment to get the new event in.
63  // ++(*m_beginIter); ???
65 
66  return StatusCode::SUCCESS;
67 }

◆ last()

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

Definition at line 121 of file EventSelectorMuonCalibStream.cxx.

121  {
122  if (it.identifier() == m_endIter->identifier()) {
123  ATH_MSG_DEBUG("last(): Last event in InputStream.");
124  return (StatusCode::SUCCESS);
125  }
126  return (StatusCode::FAILURE);
127 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ next() [1/2]

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

Definition at line 75 of file EventSelectorMuonCalibStream.cxx.

75  {
76  ATH_MSG_DEBUG(" EventSelectorMuonCalibStream::next m_NumEvents=" << m_NumEvents);
77  for (;;) {
78  const LVL2_MUON_CALIBRATION::CalibEvent *pre = m_eventSource->nextEvent();
79  if (!pre) {
80  // End of file
81  it = *m_endIter;
82  return StatusCode::FAILURE;
83  }
84  ++m_NumEvents;
85 
86  // Check if we are skipping events
87  if (m_NumEvents > m_SkipEvents) {
88  break;
89  } else {
90  ATH_MSG_DEBUG(" Skipping event " << m_NumEvents - 1);
91  }
92  }
93 
94  return StatusCode::SUCCESS;
95 }

◆ next() [2/2]

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

Definition at line 99 of file EventSelectorMuonCalibStream.cxx.

99  {
100  ATH_MSG_DEBUG(" EventSelectorMuonCalibStream::next skipping events ==" << jump);
101  if (jump > 0) {
102  for (int i = 0; i < jump; ++i) {
103  StatusCode status = next(ctxt);
104  if (!status.isSuccess()) { return status; }
105  }
106  return StatusCode::SUCCESS;
107  }
108  return StatusCode::FAILURE;
109 }

◆ previous() [1/2]

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

Definition at line 112 of file EventSelectorMuonCalibStream.cxx.

112  {
113  ATH_MSG_ERROR("EventSelectorMuonCalibStream::previous() not implemented");
114  return (StatusCode::FAILURE);
115 }

◆ previous() [2/2]

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

Definition at line 118 of file EventSelectorMuonCalibStream.cxx.

118 { return (previous(it)); }

◆ queryInterface()

StatusCode EventSelectorMuonCalibStream::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
virtual

Definition at line 158 of file EventSelectorMuonCalibStream.cxx.

158  {
159  if (riid == IEvtSelector::interfaceID()) {
160  *ppvInterface = (IEvtSelector *)this;
161  } else if (riid == IProperty::interfaceID()) {
162  *ppvInterface = (IProperty *)this;
163  } else {
164  return AthService::queryInterface(riid, ppvInterface);
165  }
166 
167  addRef();
168  return StatusCode::SUCCESS;
169 }

◆ releaseContext()

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

Definition at line 155 of file EventSelectorMuonCalibStream.cxx.

155 { return (StatusCode::SUCCESS); }

◆ resetCriteria()

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

Definition at line 130 of file EventSelectorMuonCalibStream.cxx.

130  {
131  return (StatusCode::SUCCESS);
132 }

◆ rewind()

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

Definition at line 135 of file EventSelectorMuonCalibStream.cxx.

135  {
136  ATH_MSG_ERROR("EventSelectorMuonCalibStream::rewind() not implemented");
137  return (StatusCode::FAILURE);
138 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

long m_NumEvents EventSelectorMuonCalibStream::ATLAS_THREAD_SAFE = 0
mutableprivate

Definition at line 68 of file EventSelectorMuonCalibStream.h.

◆ m_beginIter

EventContextMuonCalibStream* EventSelectorMuonCalibStream::m_beginIter
private

Definition at line 59 of file EventSelectorMuonCalibStream.h.

◆ m_dataProvider

IMuonCalibStreamDataProviderSvc* EventSelectorMuonCalibStream::m_dataProvider
private

Definition at line 62 of file EventSelectorMuonCalibStream.h.

◆ m_endIter

EventContextMuonCalibStream* EventSelectorMuonCalibStream::m_endIter
private

Definition at line 60 of file EventSelectorMuonCalibStream.h.

◆ m_eventSource

MuonCalibStreamInputSvc* EventSelectorMuonCalibStream::m_eventSource
private

Definition at line 61 of file EventSelectorMuonCalibStream.h.

◆ m_eventSourceName

string EventSelectorMuonCalibStream::m_eventSourceName
private

Definition at line 58 of file EventSelectorMuonCalibStream.h.

◆ m_SkipEvents

int EventSelectorMuonCalibStream::m_SkipEvents
private

Definition at line 64 of file EventSelectorMuonCalibStream.h.


The documentation for this class was generated from the following files:
AthService::AthService
AthService()
EventSelectorMuonCalibStream::next
virtual StatusCode next(Context &it) const
Definition: EventSelectorMuonCalibStream.cxx:75
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MuonCalibStreamInputSvc::currentEvent
virtual const LVL2_MUON_CALIBRATION::CalibEvent * currentEvent() const =0
EventSelectorMuonCalibStream::m_eventSource
MuonCalibStreamInputSvc * m_eventSource
Definition: EventSelectorMuonCalibStream.h:61
EventSelectorMuonCalibStream::previous
virtual StatusCode previous(Context &it) const
Definition: EventSelectorMuonCalibStream.cxx:112
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
EventSelectorMuonCalibStream::m_eventSourceName
string m_eventSourceName
Definition: EventSelectorMuonCalibStream.h:58
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
EventSelectorMuonCalibStream::m_beginIter
EventContextMuonCalibStream * m_beginIter
Definition: EventSelectorMuonCalibStream.h:59
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EventContextMuonCalibStream::identifier
virtual void * identifier() const
Inequality operator.
Definition: EventContextMuonCalibStream.cxx:25
EventSelectorMuonCalibStream::m_endIter
EventContextMuonCalibStream * m_endIter
Definition: EventSelectorMuonCalibStream.h:60
IMuonCalibStreamDataProviderSvc::setNextEvent
virtual void setNextEvent(const LVL2_MUON_CALIBRATION::CalibEvent *re)=0
EventSelectorMuonCalibStream::m_SkipEvents
int m_SkipEvents
Definition: EventSelectorMuonCalibStream.h:64
MuonCalibStreamInputSvc
Definition: MuonCalibStreamInputSvc.h:16
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
EventSelectorMuonCalibStream::m_dataProvider
IMuonCalibStreamDataProviderSvc * m_dataProvider
Definition: EventSelectorMuonCalibStream.h:62
merge.status
status
Definition: merge.py:17
MuonCalibStreamAddress
Definition: MuonCalibStreamAddress.h:14
EventContextMuonCalibStream
This class provides the Context for EventSelectorMuonCalibStream.
Definition: EventContextMuonCalibStream.h:23
MuonCalibStreamInputSvc::nextEvent
virtual const LVL2_MUON_CALIBRATION::CalibEvent * nextEvent()=0