ATLAS Offline Software
MdtCalibOutputDbSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MdtCalibOutputDbScvH
6 #define MdtCalibOutputDbScvH
7 
8 //:::::::::::::::::::::::::::::::
9 //:: CLASS MdtCalibOutputDvSvc ::
10 //:::::::::::::::::::::::::::::::
11 
24 
25 #include <string>
26 #include <vector>
27 
29 #include "GaudiKernel/ServiceHandle.h"
30 #include "GaudiKernel/ToolHandle.h"
38 
39 namespace MuonCalib {
40  class IMdtCalibrationOutput;
41  class IRtRelation;
42  class IRtResolution;
43  class MdtTubeFitContainer;
44 } // namespace MuonCalib
45 
47 public:
48  // Constructor //
49  MdtCalibOutputDbSvc(const std::string &name, ISvcLocator *svc_locator);
51 
52  virtual ~MdtCalibOutputDbSvc() = default;
54 
55  // Methods //
57 
58  static const InterfaceID &interfaceID() {
59  static const InterfaceID IID_IMdtCalibOutputDbSvc("MdtCalibOutputDbSvc", 1, 0);
60  return IID_IMdtCalibOutputDbSvc;
61  }
62  virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown);
64  virtual StatusCode initialize();
66 
67  virtual StatusCode finalize();
70  void AddRunNumber(int run_number);
73  bool memorize(std::shared_ptr<const MuonCalib::IMdtCalibrationOutput> result);
80  bool memorize(std::shared_ptr<const MuonCalib::IMdtCalibrationOutput> result, std::shared_ptr<const MuonCalib::IRtResolution> resol);
89  void reset();
91 
92 private:
93  // calibration outputs //
94  std::shared_ptr<const MuonCalib::IMdtCalibrationOutput> m_results;
95  // vector holding the results of the calibration algorithms
96  // associated resolution functions //
97  std::shared_ptr<const MuonCalib::IRtResolution> m_resolution;
98  // vector of pointers to associated resolution functions
99 
100  // postprocess calibration data - job option
101  // NOTE: Detector geometry has to be loaded to do this
103  // flat default resolution - job option
105  // use default resolution even if a resolution was loaded by the input service
107  // calibration io tool to be used
108  ToolHandle<MuonCalib::ICalibrationIOTool> m_calib_output_tool{this, "OutputTool", "MuonCalib::CalibrationFileIOTool"};
109  // iov range in run numbers//
111 
112  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
113 
114  // MuonDetectorManager from the conditions store
115  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey{this, "DetectorManagerKey", "MuonDetectorManager",
116  "Key of input MuonDetectorManager condition data"};
117 
118  // region selection service
120  // calibration input service
122  std::vector<MuonCalib::NtupleStationId> m_region_ids;
123  // private methods //
128 
129  // postprocess t0
131  void create_default_resolution(const std::shared_ptr<const MuonCalib::IRtRelation>& rt);
132 };
133 #endif
MdtCalibOutputDbSvc::m_postprocess_calibration
bool m_postprocess_calibration
Definition: MdtCalibOutputDbSvc.h:102
MdtCalibOutputDbSvc
Definition: MdtCalibOutputDbSvc.h:46
plotting.plot_kinematics.run_number
run_number
Definition: plot_kinematics.py:29
get_generator_info.result
result
Definition: get_generator_info.py:21
MdtCalibOutputDbSvc::m_calib_output_tool
ToolHandle< MuonCalib::ICalibrationIOTool > m_calib_output_tool
Definition: MdtCalibOutputDbSvc.h:108
MdtCalibOutputDbSvc::m_input_service
ServiceHandle< MdtCalibInputSvc > m_input_service
Definition: MdtCalibOutputDbSvc.h:121
MdtCalibOutputDbSvc::m_reg_sel_svc
ServiceHandle< RegionSelectionSvc > m_reg_sel_svc
Definition: MdtCalibOutputDbSvc.h:119
MuonCalib::NtupleStationId
Definition: NtupleStationId.h:36
MdtCalibOutputDbSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
method required by the base class which is need to obtain a pointer to the service in the standard wa...
Definition: MdtCalibOutputDbSvc.cxx:50
MdtCalibOutputDbSvc::memorize
bool memorize(std::shared_ptr< const MuonCalib::IMdtCalibrationOutput > result)
memorize the result of a particular calibration (given in result) for the calibration region "regionK...
Definition: MdtCalibOutputDbSvc.cxx:118
MdtCalibOutputDbSvc::AddRunNumber
void AddRunNumber(int run_number)
add a run number to the iov interval.
Definition: MdtCalibOutputDbSvc.cxx:108
ICalibrationIOTool.h
MdtCalibOutputDbSvc::interfaceID
static const InterfaceID & interfaceID()
Methods required as defined in the base class "Service".
Definition: MdtCalibOutputDbSvc.h:58
NtupleStationId.h
MdtCalibInputSvc.h
MdtCalibOutputDbSvc::initialize
virtual StatusCode initialize()
initialize method as required by the base class
Definition: MdtCalibOutputDbSvc.cxx:65
MdtCalibOutputDbSvc::m_iov_start
int m_iov_start
Definition: MdtCalibOutputDbSvc.h:110
MdtCalibOutputDbSvc::m_results
std::shared_ptr< const MuonCalib::IMdtCalibrationOutput > m_results
Definition: MdtCalibOutputDbSvc.h:94
MdtCalibOutputDbSvc::MdtCalibOutputDbSvc
MdtCalibOutputDbSvc(const std::string &name, ISvcLocator *svc_locator)
Constructor.
Definition: MdtCalibOutputDbSvc.cxx:24
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MdtCalibOutputDbSvc::m_flat_default_resolution
double m_flat_default_resolution
Definition: MdtCalibOutputDbSvc.h:104
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MdtCalibOutputDbSvc::m_region_ids
std::vector< MuonCalib::NtupleStationId > m_region_ids
Definition: MdtCalibOutputDbSvc.h:122
MuonDetectorManager.h
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
MdtCalibOutputDbSvc::create_default_resolution
void create_default_resolution(const std::shared_ptr< const MuonCalib::IRtRelation > &rt)
Definition: MdtCalibOutputDbSvc.cxx:282
MdtCalibOutputDbSvc::saveCalibrationResults
StatusCode saveCalibrationResults()
write out all memorized results to text files (location specified in the job options) which can be up...
Definition: MdtCalibOutputDbSvc.cxx:142
MuonCalib::MdtTubeFitContainer
Holds single-tube full calibration information of one chamber.
Definition: MdtTubeFitContainer.h:16
MdtCalibOutputDbSvc::finalize
virtual StatusCode finalize()
finalize method as required by the base class; the finalize method calls the method "save_calibration...
Definition: MdtCalibOutputDbSvc.cxx:97
MdtCalibOutputDbSvc::~MdtCalibOutputDbSvc
virtual ~MdtCalibOutputDbSvc()=default
Virtual destructor.
AthService.h
MdtCalibOutputDbSvc::reset
void reset()
reset, clear memory of results
Definition: MdtCalibOutputDbSvc.cxx:224
MdtCalibOutputDbSvc::m_resolution
std::shared_ptr< const MuonCalib::IRtResolution > m_resolution
Definition: MdtCalibOutputDbSvc.h:97
MdtCalibOutputDbSvc::m_iov_end
int m_iov_end
Definition: MdtCalibOutputDbSvc.h:110
MdtCalibOutputDbSvc::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtCalibOutputDbSvc.h:112
MdtCalibOutputDbSvc::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: MdtCalibOutputDbSvc.h:115
IMuonIdHelperSvc.h
MdtCalibOutputDbSvc::postprocess_t0s
static const MuonCalib::MdtTubeFitContainer * postprocess_t0s(const MuonCalib::MdtTubeFitContainer *new_t0, const MuonCalib::NtupleStationId &id)
Definition: MdtCalibOutputDbSvc.cxx:228
MdtCalibOutputDbSvc::m_force_default_resolution
bool m_force_default_resolution
Definition: MdtCalibOutputDbSvc.h:106
ServiceHandle< Muon::IMuonIdHelperSvc >
RtDataFromFile.h
RegionSelectionSvc.h