ATLAS Offline Software
Loading...
Searching...
No Matches
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 */
46 StatusCode dumpMapAsFile();
47
48 /* load the map from a binary file, given a path */
49 StatusCode loadMapFromFile();
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
float getValue(const Identifier &id) const override
Gaudi::Property< std::string > m_mapFileName
Gaudi::Property< float > m_centralValue
std::map< Identifier, float > m_shiftValues
Gaudi::Property< bool > m_forceMapRecreate
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual StatusCode initialize() override
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_mdtCab
virtual StatusCode initializeMap()=0
MdtCalibrationShiftMapBase(const std::string &type, const std::string &name, const IInterface *parent)
~MdtCalibrationShiftMapBase()=default