ATLAS Offline Software
MdtCalibInputSvc.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 MdtCalibInputSvc_H
6 #define MdtCalibInputSvc_H
7 
8 #include <map>
9 #include <string>
10 
13 #include "GaudiKernel/ServiceHandle.h"
14 #include "GaudiKernel/ToolHandle.h"
19 namespace MuonCalib {
21  class IRtRelation;
22  class IRtResolution;
23 } // namespace MuonCalib
24 
30 class MdtCalibInputSvc : public AthService {
31 public:
32  //=============================================================================
34  MdtCalibInputSvc(const std::string &name, ISvcLocator *svc_locator);
36  virtual ~MdtCalibInputSvc();
37  static const InterfaceID &interfaceID() {
38  // interface to enable retrieving of a pointer to the singleton //
39  static const InterfaceID IID_IMdtCalibInputSvc("MdtCalibInputSvc", 1, 0);
40  return IID_IMdtCalibInputSvc;
41  }
43  virtual StatusCode initialize() override;
44 
58  return m_sel_region_b;
59  }
62  //==============================================================================
63 private:
65  ToolHandle<MuonCalib::ICalibrationIOTool> m_calib_input_tool{this, "CalibrationInputTool", "MuonCalib::CalibrationDummyIOTool"};
67  std::map<MuonCalib::NtupleStationId, MuonCalib::MdtStationT0Container *> m_t0;
68  std::map<MuonCalib::NtupleStationId, MuonCalib::IRtRelation *> m_rt_relation;
69  std::map<MuonCalib::NtupleStationId, MuonCalib::BFieldCorFunc *> m_B_corr;
70  std::map<MuonCalib::NtupleStationId, MuonCalib::IRtResolution *> m_spat_res;
77  void create_mean_rts();
86  mutable std::set<MuonCalib::NtupleStationId> m_t0_warned ATLAS_THREAD_SAFE; // protected by mutex
87  mutable std::set<MuonCalib::NtupleStationId> m_rt_warned ATLAS_THREAD_SAFE; // protected by mutex
88 };
89 #endif
MdtCalibInputSvc::read_calib_input
StatusCode read_calib_input()
Definition: MdtCalibInputSvc.cxx:107
MdtCalibInputSvc::create_mean_rts
void create_mean_rts()
create mean rt relations, and resolutions for the selected calibration region
Definition: MdtCalibInputSvc.cxx:127
MdtCalibInputSvc::m_sel_region_b
const MuonCalib::BFieldCorFunc * m_sel_region_b
Definition: MdtCalibInputSvc.h:81
MuonCalib::NtupleStationId
Definition: NtupleStationId.h:36
MuonCalib::MdtStationT0Container
Definition: MdtStationT0Container.h:24
MdtCalibInputSvc::MdtCalibInputSvc
MdtCalibInputSvc(const std::string &name, ISvcLocator *svc_locator)
Service constructor.
Definition: MdtCalibInputSvc.cxx:22
MdtCalibInputSvc::m_mean_station_id
MuonCalib::NtupleStationId m_mean_station_id
station id for mean rt
Definition: MdtCalibInputSvc.h:84
MdtCalibInputSvc::m_B_corr
std::map< MuonCalib::NtupleStationId, MuonCalib::BFieldCorFunc * > m_B_corr
Definition: MdtCalibInputSvc.h:69
MdtCalibInputSvc::m_sel_region_rt
const MuonCalib::IRtRelation * m_sel_region_rt
rt relation - resolution - and correction function for the selected region - is average of all matchi...
Definition: MdtCalibInputSvc.h:80
ICalibrationIOTool.h
MuonCalib::BFieldCorFunc
Definition: BFieldCorFunc.h:47
MdtCalibInputSvc::m_sel_region_res
const MuonCalib::IRtResolution * m_sel_region_res
Definition: MdtCalibInputSvc.h:82
BFieldCorFunc.h
MdtCalibInputSvc::m_reg_sel_svc
ServiceHandle< RegionSelectionSvc > m_reg_sel_svc
pointer to region selection service
Definition: MdtCalibInputSvc.h:72
NtupleStationId.h
MdtCalibInputSvc::GetResolution
const MuonCalib::IRtResolution * GetResolution() const
Get resolution for calibration region.
Definition: MdtCalibInputSvc.h:61
MdtCalibInputSvc::ATLAS_THREAD_SAFE
std::set< MuonCalib::NtupleStationId > m_rt_warned ATLAS_THREAD_SAFE
Definition: MdtCalibInputSvc.h:87
MdtCalibInputSvc::GetBCorr
const MuonCalib::BFieldCorFunc * GetBCorr()
Get b-field correction for calibratino region.
Definition: MdtCalibInputSvc.h:56
MdtCalibInputSvc::findbfieldfun
const MuonCalib::BFieldCorFunc * findbfieldfun(const MuonCalib::NtupleStationId &id)
Definition: MdtCalibInputSvc.cxx:170
MdtCalibInputSvc::GetRtRelation
const MuonCalib::IRtRelation * GetRtRelation() const
Get rt-Relation for calibration region.
Definition: MdtCalibInputSvc.h:54
MdtCalibInputSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: MdtCalibInputSvc.h:37
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
MdtCalibInputSvc::~MdtCalibInputSvc
virtual ~MdtCalibInputSvc()
destructor
Definition: MdtCalibInputSvc.cxx:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MdtCalibInputSvc::GetT0
const MuonCalib::MdtStationT0Container * GetT0(const MuonCalib::NtupleStationId &id) const
Get t0 container for Station.
Definition: MdtCalibInputSvc.cxx:47
MdtCalibInputSvc::m_t0
std::map< MuonCalib::NtupleStationId, MuonCalib::MdtStationT0Container * > m_t0
calibration data sorted by station id
Definition: MdtCalibInputSvc.h:67
MuonCalib::IRtResolution
generic interface for a resolution function
Definition: IRtResolution.h:13
MdtCalibInputSvc::create_b_field_correction
bool create_b_field_correction(const MuonCalib::NtupleStationId &id)
create the b-field correction
Definition: MdtCalibInputSvc.cxx:114
MdtCalibInputSvc
Definition: MdtCalibInputSvc.h:30
MdtCalibInputSvc::m_calib_input_tool
ToolHandle< MuonCalib::ICalibrationIOTool > m_calib_input_tool
calibration io tool to be used
Definition: MdtCalibInputSvc.h:65
MdtCalibInputSvc::m_rt_relation
std::map< MuonCalib::NtupleStationId, MuonCalib::IRtRelation * > m_rt_relation
Definition: MdtCalibInputSvc.h:68
AthService.h
MdtStationT0Container
MdtCalibInputSvc::ATLAS_THREAD_SAFE
std::set< MuonCalib::NtupleStationId > m_t0_warned ATLAS_THREAD_SAFE
give warnings about missing calibration only once per chamber
Definition: MdtCalibInputSvc.h:86
checker_macros.h
Define macros for attributes used to control the static checker.
MdtCalibInputSvc::initialize
virtual StatusCode initialize() override
service initalizer - reads files
Definition: MdtCalibInputSvc.cxx:38
MdtCalibInputSvc::m_spat_res
std::map< MuonCalib::NtupleStationId, MuonCalib::IRtResolution * > m_spat_res
Definition: MdtCalibInputSvc.h:70
MuonCalib::IRtRelation
generic interface for a rt-relation
Definition: IRtRelation.h:15
ServiceHandle< RegionSelectionSvc >
RegionSelectionSvc.h