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

#include <MuonCalibStreamFileInputSvc.h>

Inheritance diagram for MuonCalibStreamFileInputSvc:
Collaboration diagram for MuonCalibStreamFileInputSvc:

Public Member Functions

 MuonCalibStreamFileInputSvc (const std::string &name, ISvcLocator *svcloc)
 
virtual ~MuonCalibStreamFileInputSvc ()
 
virtual StatusCode initialize ()
 
virtual const LVL2_MUON_CALIBRATION::CalibEvent * nextEvent ()
 
virtual const LVL2_MUON_CALIBRATION::CalibEvent * currentEvent () const
 Get a pointer to the current event. More...
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Private Attributes

Long64_t m_fileEventCounter {0}
 
Long64_t m_totalEventCounter {0}
 
Gaudi::Property< int > m_DumpStream {this, "DumpStream", 0}
 
std::unique_ptr< DataReader > m_reader {}
 
bool m_EoF {false}
 
std::unique_ptr< LVL2_MUON_CALIBRATION::CalibEvent > m_re {}
 
std::unique_ptr< LVL2_MUON_CALIBRATION::CalibDataLoader > m_dataLoader {}
 
DataBuffer m_dataBuffer
 
Gaudi::Property< std::vector< std::string > > m_inputFiles {this, "InputFiles", {} }
 
std::vector< std::string >::iterator m_inputFilesIt {m_inputFiles.value().begin()}
 

Detailed Description

Definition at line 24 of file MuonCalibStreamFileInputSvc.h.

Constructor & Destructor Documentation

◆ MuonCalibStreamFileInputSvc()

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

Definition at line 23 of file MuonCalibStreamFileInputSvc.cxx.

23  :
24  MuonCalibStreamInputSvc(name, svcloc) {}

◆ ~MuonCalibStreamFileInputSvc()

MuonCalibStreamFileInputSvc::~MuonCalibStreamFileInputSvc ( )
virtual

Definition at line 27 of file MuonCalibStreamFileInputSvc.cxx.

27 {}

Member Function Documentation

◆ currentEvent()

const LVL2_MUON_CALIBRATION::CalibEvent * MuonCalibStreamFileInputSvc::currentEvent ( ) const
virtual

Get a pointer to the current event.

Implements MuonCalibStreamInputSvc.

Definition at line 110 of file MuonCalibStreamFileInputSvc.cxx.

110  {
111  // Return a pointer to the raw event.
112  return m_re.get();
113 }

◆ initialize()

StatusCode MuonCalibStreamFileInputSvc::initialize ( )
virtual

Definition at line 30 of file MuonCalibStreamFileInputSvc.cxx.

30  {
31 
32  // Check that the vector of input file names is not empty.
33  if (m_inputFiles.empty()) {
34  ATH_MSG_ERROR(" initialize: No input event files ");
35  return StatusCode::FAILURE;
36  }
37 
38  // Set the iterator to the first input file.
39  m_inputFilesIt = m_inputFiles.begin();
40 
41  // instantiate the data loader
42  m_dataLoader = std::make_unique<LVL2_MUON_CALIBRATION::CalibDataLoader>(m_inputFilesIt->c_str(), false, 0xffffffff, 0, DEFAULT_BUFFER_SIZE);
43 
44  m_EoF = false;
45 
46  return StatusCode::SUCCESS;
47 } // MuonCalibStreamFileInputSvc::initialize()

◆ 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  }

◆ nextEvent()

const LVL2_MUON_CALIBRATION::CalibEvent * MuonCalibStreamFileInputSvc::nextEvent ( )
virtual

Implements MuonCalibStreamInputSvc.

Definition at line 50 of file MuonCalibStreamFileInputSvc.cxx.

50  {
51 
52  if (m_EoF) { // EOF reached, need to change input file
53  ATH_MSG_INFO("nextEvent: end of file reached ");
55 
56  ATH_MSG_INFO("nextEvent: finished with file " << *m_inputFilesIt);
57  ATH_MSG_INFO(" Number of Events in this file " << m_fileEventCounter);
58  ATH_MSG_INFO(" Total number of Events " << m_totalEventCounter);
59 
60  // Reinitialize the file event counter.
62 
64 
65  if (m_inputFilesIt == m_inputFiles.end()) {
66  ATH_MSG_INFO("no more file to read ");
67  return 0;
68  }
69 
70  // do the next File
71  m_dataLoader = std::make_unique<LVL2_MUON_CALIBRATION::CalibDataLoader>(m_inputFilesIt->c_str(), false, 0xffffffff, 0, DEFAULT_BUFFER_SIZE);
72 
73  m_EoF = false;
74 
75  return nextEvent();
76  }
77 
79 
80  // try to read next event
81  // add TGC fragment and move the print out of the fragment to DEBUG outputLevel
82  if (m_dataLoader->next(m_dataBuffer)) {
83  m_re = std::make_unique<LVL2_MUON_CALIBRATION::CalibEvent>(m_dataBuffer);
84 
85  if (m_re) {
86  if (m_re->mdt() != 0) {
87  if (m_DumpStream != 0)
88  ATH_MSG_DEBUG(" MuonCalibStreamFileInputSvc::next event -- eta=" << m_re->eta() << " mdt " << *(m_re->mdt()));
89  }
90  if (m_re->rpc() != 0) {
91  if (m_DumpStream != 0)
92  ATH_MSG_DEBUG(" MuonCalibStreamFileInputSvc::next event -- eta=" << m_re->eta() << " rpc " << *(m_re->rpc()));
93  }
94  if (m_re->tgc() != 0) {
95  if (m_DumpStream != 0)
96  ATH_MSG_DEBUG(" MuonCalibStreamFileInputSvc::next event -- eta=" << m_re->eta() << " tgc " << *(m_re->tgc()));
97  }
98  }
99  } else {
100  // file must be over
101  m_EoF = true;
102  return nextEvent();
103  }
104 
105  // Return
106  return m_re.get();
107 } // MuonCalibStreamFileInputSvc::nextEvent()

Member Data Documentation

◆ m_dataBuffer

DataBuffer MuonCalibStreamFileInputSvc::m_dataBuffer
private

Definition at line 43 of file MuonCalibStreamFileInputSvc.h.

◆ m_dataLoader

std::unique_ptr<LVL2_MUON_CALIBRATION::CalibDataLoader> MuonCalibStreamFileInputSvc::m_dataLoader {}
private

Definition at line 42 of file MuonCalibStreamFileInputSvc.h.

◆ m_DumpStream

Gaudi::Property<int> MuonCalibStreamFileInputSvc::m_DumpStream {this, "DumpStream", 0}
private

Definition at line 38 of file MuonCalibStreamFileInputSvc.h.

◆ m_EoF

bool MuonCalibStreamFileInputSvc::m_EoF {false}
private

Definition at line 40 of file MuonCalibStreamFileInputSvc.h.

◆ m_fileEventCounter

Long64_t MuonCalibStreamFileInputSvc::m_fileEventCounter {0}
private

Definition at line 36 of file MuonCalibStreamFileInputSvc.h.

◆ m_inputFiles

Gaudi::Property<std::vector<std::string> > MuonCalibStreamFileInputSvc::m_inputFiles {this, "InputFiles", {} }
private

Definition at line 44 of file MuonCalibStreamFileInputSvc.h.

◆ m_inputFilesIt

std::vector<std::string>::iterator MuonCalibStreamFileInputSvc::m_inputFilesIt {m_inputFiles.value().begin()}
private

Definition at line 45 of file MuonCalibStreamFileInputSvc.h.

◆ m_re

std::unique_ptr<LVL2_MUON_CALIBRATION::CalibEvent> MuonCalibStreamFileInputSvc::m_re {}
private

Definition at line 41 of file MuonCalibStreamFileInputSvc.h.

◆ m_reader

std::unique_ptr<DataReader> MuonCalibStreamFileInputSvc::m_reader {}
private

Definition at line 39 of file MuonCalibStreamFileInputSvc.h.

◆ m_totalEventCounter

Long64_t MuonCalibStreamFileInputSvc::m_totalEventCounter {0}
private

Definition at line 37 of file MuonCalibStreamFileInputSvc.h.


The documentation for this class was generated from the following files:
MuonCalibStreamFileInputSvc::m_re
std::unique_ptr< LVL2_MUON_CALIBRATION::CalibEvent > m_re
Definition: MuonCalibStreamFileInputSvc.h:41
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonCalibStreamFileInputSvc::m_fileEventCounter
Long64_t m_fileEventCounter
Definition: MuonCalibStreamFileInputSvc.h:36
MuonCalibStreamFileInputSvc::m_EoF
bool m_EoF
Definition: MuonCalibStreamFileInputSvc.h:40
MuonCalibStreamFileInputSvc::m_totalEventCounter
Long64_t m_totalEventCounter
Definition: MuonCalibStreamFileInputSvc.h:37
MuonCalibStreamFileInputSvc::m_inputFilesIt
std::vector< std::string >::iterator m_inputFilesIt
Definition: MuonCalibStreamFileInputSvc.h:45
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonCalibStreamFileInputSvc::m_dataLoader
std::unique_ptr< LVL2_MUON_CALIBRATION::CalibDataLoader > m_dataLoader
Definition: MuonCalibStreamFileInputSvc.h:42
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonCalibStreamFileInputSvc::m_dataBuffer
DataBuffer m_dataBuffer
Definition: MuonCalibStreamFileInputSvc.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonCalibStreamInputSvc::MuonCalibStreamInputSvc
MuonCalibStreamInputSvc(const std::string &name, ISvcLocator *svcloc)
Definition: MuonCalibStreamInputSvc.cxx:5
MuonCalibStreamFileInputSvc::m_DumpStream
Gaudi::Property< int > m_DumpStream
Definition: MuonCalibStreamFileInputSvc.h:38
MuonCalibStreamFileInputSvc::m_inputFiles
Gaudi::Property< std::vector< std::string > > m_inputFiles
Definition: MuonCalibStreamFileInputSvc.h:44
MuonCalibStreamFileInputSvc::nextEvent
virtual const LVL2_MUON_CALIBRATION::CalibEvent * nextEvent()
Definition: MuonCalibStreamFileInputSvc.cxx:50