ATLAS Offline Software
MdtCalibrationShiftMapBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MDTCALIBSVC_MDTCALIBRATIONSHIFTMAPBASE_H
6 #define MDTCALIBSVC_MDTCALIBRATIONSHIFTMAPBASE_H
7 
8 #include <map>
9 
11 #include "GaudiKernel/ServiceHandle.h"
12 
17 
25  : public extends<AthAlgTool, MuonCalib::IShiftMapTools> {
26  public:
27  /* constructor */
28  MdtCalibrationShiftMapBase(const std::string& type, const std::string& name, const IInterface* parent);
29 
30  /* destructor */
32 
33  /* get shift value, override from IShiftMapTools */
34  float getValue(const Identifier& id) const override;
35 
36  virtual StatusCode initialize() override;
37 
38  /*
39  * initialization of map cannot happen before first event
40  * special function required
41  * we need the cabling service to be ready first
42  */
43  virtual StatusCode initializeMap() = 0;
44 
45  /* dump the map in binary file, given a path */
47 
48  /* load the map from a binary file, given a path */
50 
51  protected:
52  Gaudi::Property<std::string> m_mapFileName{this,"MapFile",""};
53  Gaudi::Property<float> m_centralValue{this,"CentralValue",0};
54  Gaudi::Property<float> m_sigma{this,"Sigma",10};
55  Gaudi::Property<bool> m_forceMapRecreate{this,"ForceMapRecreate",false};
56 
57  std::map<Identifier, float> m_shiftValues;
58  bool m_mapIsInitialized{false};
59 
60  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
61  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCab {this, "MdtCabling", "MuonMDT_CablingMap"};
62 };
63 
64 #endif
MdtCalibrationShiftMapBase::dumpMapAsFile
StatusCode dumpMapAsFile()
Definition: MdtCalibrationShiftMapBase.cxx:22
MdtCalibrationShiftMapBase::initializeMap
virtual StatusCode initializeMap()=0
IShiftMapTools.h
MdtCalibrationShiftMapBase::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtCalibrationShiftMapBase.h:60
MdtCalibrationShiftMapBase::MdtCalibrationShiftMapBase
MdtCalibrationShiftMapBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MdtCalibrationShiftMapBase.cxx:12
MdtCalibrationShiftMapBase::m_sigma
Gaudi::Property< float > m_sigma
Definition: MdtCalibrationShiftMapBase.h:54
MdtCalibrationShiftMapBase
Definition: MdtCalibrationShiftMapBase.h:25
MdtCalibrationShiftMapBase::getValue
float getValue(const Identifier &id) const override
Definition: MdtCalibrationShiftMapBase.cxx:130
MdtCalibrationShiftMapBase::m_forceMapRecreate
Gaudi::Property< bool > m_forceMapRecreate
Definition: MdtCalibrationShiftMapBase.h:55
MdtCalibrationShiftMapBase::loadMapFromFile
StatusCode loadMapFromFile()
Definition: MdtCalibrationShiftMapBase.cxx:60
MdtCalibrationShiftMapBase::initialize
virtual StatusCode initialize() override
Definition: MdtCalibrationShiftMapBase.cxx:15
MdtCalibrationShiftMapBase::m_mapFileName
Gaudi::Property< std::string > m_mapFileName
Definition: MdtCalibrationShiftMapBase.h:52
MdtCalibrationShiftMapBase::m_shiftValues
std::map< Identifier, float > m_shiftValues
Definition: MdtCalibrationShiftMapBase.h:57
MuonMDT_CablingMap.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ReadCondHandleKey.h
MdtCalibrationShiftMapBase::~MdtCalibrationShiftMapBase
~MdtCalibrationShiftMapBase()=default
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::ReadCondHandleKey< MuonMDT_CablingMap >
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MdtCalibrationShiftMapBase::m_centralValue
Gaudi::Property< float > m_centralValue
Definition: MdtCalibrationShiftMapBase.h:53
MdtCalibrationShiftMapBase::m_mdtCab
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_mdtCab
Definition: MdtCalibrationShiftMapBase.h:61
MdtCalibrationShiftMapBase::m_mapIsInitialized
bool m_mapIsInitialized
Definition: MdtCalibrationShiftMapBase.h:58
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14