ATLAS Offline Software
Loading...
Searching...
No Matches
MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9#ifndef MUONCALIBR4_MDTCALIBDBALGR4_H
10#define MUONCALIBR4_MDTCALIBDBALGR4_H
11
13
18
21
22#include <nlohmann/json.hpp>
23
24
25class TTree;
26
27namespace MuonCalibR4 {
29 public:
30
31 using AthReentrantAlgorithm::AthReentrantAlgorithm;
32 virtual ~MdtCalibDbAlg() = default;
33
34 virtual StatusCode initialize() override;
35 virtual StatusCode execute(const EventContext& ctx) const override;
36 virtual bool isReEntrant() const override { return false; }
37
38 private:
39
43
44 /*** @brief Translates a r-t JSON payload into Mdt calibration constants
45 * @param rtBlob: JSON payload to translated
46 * @param outContainer: Container into which the Rt relations are appended */
47 StatusCode parseRtPayload(const nlohmann::json& rtBlob,
48 MuonCalib::MdtCalibDataContainer& outContainer) const;
49
53 StatusCode parseRtPayload(TTree& rtTree,
54 MuonCalib::MdtCalibDataContainer& outContainer) const;
58 MuonCalib::IRtRelationPtr makeRt(const std::string& rtType,
59 const std::vector<double>& pars) const;
63 MuonCalib::ITrRelationPtr makeTr(const std::string& trType,
64 const std::vector<double>& pars) const;
69 MuonCalib::IRtResolutionPtr makeReso(const std::string& resoType,
70 const std::vector<double>& pars,
75 StatusCode parseT0Payload(const nlohmann::json& t0Blob,
76 MuonCalib::MdtCalibDataContainer& outContainer) const;
77
81 StatusCode parseT0Payload(TTree& t0Tree,
82 MuonCalib::MdtCalibDataContainer& outContainer) const;
83
84
85 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
87 "Conditions object containing the calibrations"};
88
90 Gaudi::Property<std::string> m_rtJSON{this, "RtJSON", ""};
91 Gaudi::Property<std::string> m_t0JSON{this, "TubeT0JSON", ""};
92
93 Gaudi::Property<std::string> m_rtRootFile{this, "RtROOT", "",
94 "Path to an external root file to read the Rt relation from"};
95 Gaudi::Property<std::string> m_t0RootFile{this, "TubeT0ROOT", "",
96 "Path to an external root file to read the T0 constants from"};
97
98 Gaudi::Property<std::string> m_rtTreeName{this, "RtTreeName", "RtCalibConstants"};
99 Gaudi::Property<std::string> m_t0TreeName{this, "T0TreeName", "T0CalibConstants"};
100
101 SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyRt{this, "ReadKeyRt", "/MDT/RTJSON", "DB folder containing the RT calibrations"};
102 SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyTube{this, "ReadKeyTube", "/MDT/T0JSON", "DB folder containing the tube constants"};
103 Gaudi::Property<std::string> m_dbPayloadType {this, "dbPayloadType","TTree", "specify the format of the payload in the database. Can be TTree or JSON"};
104
105 Gaudi::Property<double> m_prop_beta{this, "PropagationSpeedBeta", 1., "Speed of the signal propagation"};
107 Gaudi::Property<unsigned> m_t0CalibPrec{this, "T0CalibPrecision", 4};
108
109 Gaudi::Property<bool> m_create_b_field_function{this, "CreateBFieldFunctions", false,
110 "If set to true, the B-field correction functions are initialized for each rt-relation that is loaded."};
111
112 Gaudi::Property<bool> m_createSlewingFunction{this, "CreateSlewingFunctions", false,
113 "If set to true, the slewing correction functions are initialized for each rt-relation that is loaded."};
114
115
116 };
117}
118#endif
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
An algorithm that can be simultaneously executed in multiple threads.
StatusCode parseRtPayload(const nlohmann::json &rtBlob, MuonCalib::MdtCalibDataContainer &outContainer) const
MuonCalib::IRtRelationPtr makeRt(const std::string &rtType, const std::vector< double > &pars) const
Creates a new rt function from the typeName & the list of parameters.
StatusCode parseT0Payload(const nlohmann::json &t0Blob, MuonCalib::MdtCalibDataContainer &outContainer) const
Trnaslates a t0 - JSON payload into transient memory.
MuonCalib::MdtCalibDataContainer::RtRelationPtr RtRelationPtr
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyTube
Gaudi::Property< unsigned > m_t0CalibPrec
Precision cut off to treat 2 t0 constants as equivalent.
MuonCalib::MdtCalibDataContainer::TubeContainerPtr TubeContainerPtr
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
MuonCalib::IRtResolutionPtr makeReso(const std::string &resoType, const std::vector< double > &pars, MuonCalib::IRtRelationPtr rt) const
Creates a new resoltuion function from the typeName & the list of parameters.
Gaudi::Property< std::string > m_rtJSON
External Rt & T0 JSON files.
MuonCalib::ITrRelationPtr makeTr(const std::string &trType, const std::vector< double > &pars) const
Creates a new tr function from the typeName & the list of parameters.
virtual ~MdtCalibDbAlg()=default
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyRt
MuonCalib::MdtCalibDataContainer::CorrectionPtr CorrectionPtr
virtual StatusCode execute(const EventContext &ctx) const override
MdtFullCalibData::TubeContainerPtr TubeContainerPtr
MdtFullCalibData::CorrectionPtr CorrectionPtr
MdtFullCalibData::RtRelationPtr RtRelationPtr
GeoModel::TransientConstSharedPtr< IRtRelation > IRtRelationPtr
Definition IRtRelation.h:17
GeoModel::TransientConstSharedPtr< ITrRelation > ITrRelationPtr
Definition ITrRelation.h:16
GeoModel::TransientConstSharedPtr< IRtResolution > IRtResolutionPtr