ATLAS Offline Software
MdtCalibEventLoop.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <algorithm>
8 #include <iostream>
9 
11 #include "GaudiKernel/MsgStream.h"
14 
15 namespace MuonCalib {
16 
17  MdtCalibEventLoop::MdtCalibEventLoop(const std::string& regionKey) :
18  m_calibrationImp(nullptr), m_calibrationResult(nullptr), m_regionKey(regionKey) {
19  m_printLevel = 1;
20  }
21 
23 
25  if (m_printLevel >= 1) {
26  MsgStream log(Athena::getMessageSvc(), "MdtCalibEventLoop");
27  log << MSG::VERBOSE << "MdtCalibEventLoop::performAnalysis for region " << m_regionKey << endmsg;
28  }
29 
30  // perform rt-calibration
32 
33  if (m_printLevel >= 2) {
34  MsgStream log(Athena::getMessageSvc(), "MdtCalibEventLoop");
35  log << MSG::DEBUG << "new rtOutput " << m_calibrationResult << endmsg;
36  }
37  }
38 
40  if (m_printLevel >= 4) {
41  MsgStream log(Athena::getMessageSvc(), "MdtCalibEventLoop");
42  log << MSG::WARNING << "MdtCalibEventLoop::handleSegment " << cseg << endmsg;
43  }
44 
45  if (cseg) {
46  // eventloop owns the segments so it should make a copy
47  MuonCalibSegment* seg = new MuonCalibSegment(*cseg);
48 
49  // add segment to vector
50  m_segments.emplace_back(seg);
51 
52  } else {
53  MsgStream log(Athena::getMessageSvc(), "MdtCalibEventLoop");
54  log << MSG::WARNING << "MdtCalibEventLoop::handleSegment: got nullptr " << endmsg;
55  return false;
56  }
57  return true;
58  }
59 
61  if (m_printLevel >= 2) {
62  MsgStream log(Athena::getMessageSvc(), "MdtCalibEventLoop");
63  log << MSG::DEBUG << "MdtCalibEventLoop::setRtCalibTool >> new tool " << calibImp << endmsg;
64  }
65  if (calibImp) {
66  m_calibrationImp = calibImp;
67  } else {
68  MsgStream log(Athena::getMessageSvc(), "MdtCalibEventLoop");
69  log << MSG::WARNING << "MdtCalibEventLoop::setCalibImp: got nullptr " << endmsg;
70  m_calibrationImp = nullptr;
71  }
72  }
73 
74 } // namespace MuonCalib
MuonCalibSegment.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonCalib::IMdtCalibration
Definition: IMdtCalibration.h:25
MuonCalib::MuonCalibSegment
Definition: MuonCalibSegment.h:39
MuonCalib::MdtCalibEventLoop::MdtCalibEventLoop
MdtCalibEventLoop(const std::string &regionKey)
constructor
Definition: MdtCalibEventLoop.cxx:17
MuonCalib::MdtCalibEventLoop::performAnalysis
void performAnalysis()
analyse segments using IRtCalibration
Definition: MdtCalibEventLoop.cxx:24
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
IMdtCalibrationOutput.h
MuonCalib::MdtCalibEventLoop::m_calibrationImp
IMdtCalibration * m_calibrationImp
pointer to calibration implementation
Definition: MdtCalibEventLoop.h:59
MuonCalib::MdtCalibEventLoop::setCalibImp
void setCalibImp(IMdtCalibration *calibImp)
set pointer to RtCalibration
Definition: MdtCalibEventLoop.cxx:60
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::MdtCalibEventLoop::m_regionKey
std::string m_regionKey
region key
Definition: MdtCalibEventLoop.h:68
MuonCalib::MdtCalibEventLoop::m_segments
MuonSegVec m_segments
segment collection
Definition: MdtCalibEventLoop.h:60
MuonCalib::MdtCalibEventLoop::handleSegment
bool handleSegment(const MuonCalibSegment *seg)
handle segment (for now store)
Definition: MdtCalibEventLoop.cxx:39
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonCalib::MdtCalibEventLoop::m_calibrationResult
IMdtCalibration::MdtCalibOutputPtr m_calibrationResult
results calibration
Definition: MdtCalibEventLoop.h:62
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
MuonCalib::MdtCalibEventLoop::~MdtCalibEventLoop
~MdtCalibEventLoop()
destructor
MuonCalib::IMdtCalibration::analyseSegments
virtual MdtCalibOutputPtr analyseSegments(const MuonSegVec &segs)=0
final analyse results
MuonCalib::MdtCalibEventLoop::m_printLevel
int m_printLevel
print level
Definition: MdtCalibEventLoop.h:65
MdtCalibEventLoop.h