ATLAS Offline Software
MdtAnalyticRtCalibAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #ifndef MUONCALIBR4_MDTANALYTICCALIBALG_H
10 #define MUONCALIBR4_MDTANALYTICCALIBALG_H
11 
13 
16 
19 
20 class TGraph;
21 namespace MuonCalib{
22  class SamplePoint;
23 }
24 namespace MuonCalibR4{
26  public:
28  virtual ~MdtAnalyticRtCalibAlg() = default;
29 
30  virtual StatusCode initialize() override final;
31  virtual StatusCode execute() override final;
32 
33  enum class PolyType{
34  ChebyChev,
35  Legendre,
36  Simple
37  };
39 
40  private:
41 
42  void drawRt(const EventContext& ctx,
43  const Identifier& detId,
44  const std::vector<MuonCalib::SamplePoint>& rtPoints,
45  const MuonCalib::MdtRtRelation& inRel) const;
46 
47  void drawResoFunc(const EventContext& ctx,
48  const Identifier& detId,
49  const std::vector<MuonCalib::SamplePoint>& resoPoints,
50  const MuonCalib::IRtResolution& inReso) const;
51 
57  RtRelationPtr translateRt(const EventContext& ctx,
58  const Identifier& detId,
59  const MuonCalib::MdtRtRelation& inRel) const;
60 
61 
62  std::vector<Identifier> tubeIds(const Identifier& chId) const;
63 
64  void saveGraph(const std::string& path, std::unique_ptr<TGraph>&& graph) const;
65  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
66  SG::ReadCondHandleKey<MuonCalib::MdtCalibDataContainer> m_readKey{this, "ReadKey", "MdtCalibConstantsR4"};
68  "Conditions object containing the calibrations"};
69 
71  Gaudi::Property<unsigned> m_maxOrder{this, "maxOrder", 12};
73  Gaudi::Property<int> m_polyTypeRt{this, "PolyTypeRt", static_cast<int>(PolyType::ChebyChev)};
75  Gaudi::Property<int> m_polyTypeTr{this, "PolyTypeTr", static_cast<int>(PolyType::Legendre)};
77  Gaudi::Property<bool> m_fitRtReso{this, "FitRtReso", true};
79  Gaudi::Property<double> m_relUncReso{this, "RelUncertOnReso", 0.01};
81  Gaudi::Property<unsigned> m_maxOrderReso{this, "maxOrderReso", 25};
83  Gaudi::Property<float> m_chiCutOff{this,"chi2CutOff", 0.05};
84 
86  Gaudi::Property<bool> m_saveDiagnostic{this, "saveDiagnosticHist", true};
88  Gaudi::Property<std::string> m_outStream{this, "OutStream", "MDTANALYTICRTS"};
90  Gaudi::Property<unsigned> m_precCutOff{this,"precCutOff", 6};
92  Gaudi::Property<bool> m_fillMissingCh{this, "fillMissingCh", true};
94  Gaudi::Property<float> m_missingT0{this, "missingT0", 5.4597301};
95  };
96 }
97 
98 
99 
100 #endif
GeoModel::TransientConstSharedPtr< MdtRtRelation >
MuonCalibR4::MdtAnalyticRtCalibAlg::PolyType::ChebyChev
@ ChebyChev
MuonCalibR4::MdtAnalyticRtCalibAlg::m_polyTypeTr
Gaudi::Property< int > m_polyTypeTr
Toggle the polynomial for the Rt-relation: ChebyChev or Legendre.
Definition: MdtAnalyticRtCalibAlg.h:75
AthHistogramAlgorithm::AthHistogramAlgorithm
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: AthHistogramAlgorithm.cxx:31
MuonCalibR4::MdtAnalyticRtCalibAlg::m_maxOrderReso
Gaudi::Property< unsigned > m_maxOrderReso
Maximal order to use for the resolution
Definition: MdtAnalyticRtCalibAlg.h:81
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
MuonCalibR4::MdtAnalyticRtCalibAlg::m_saveDiagnostic
Gaudi::Property< bool > m_saveDiagnostic
Save diagnostic histograms.
Definition: MdtAnalyticRtCalibAlg.h:86
MuonCalibR4::MdtAnalyticRtCalibAlg::m_fillMissingCh
Gaudi::Property< bool > m_fillMissingCh
At the end of the translation, it's checked whether all channels have been assigned.
Definition: MdtAnalyticRtCalibAlg.h:92
MuonCalibR4::MdtAnalyticRtCalibAlg::translateRt
RtRelationPtr translateRt(const EventContext &ctx, const Identifier &detId, const MuonCalib::MdtRtRelation &inRel) const
Translates the rt / tr & resolution relation from a look-up table into the requested polynomial type.
Definition: MdtAnalyticRtCalibAlg.cxx:145
MdtCalibDataContainer.h
MuonCalibR4::MdtAnalyticRtCalibAlg::PolyType::Legendre
@ Legendre
WriteCondHandleKey.h
MuonCalibR4::MdtAnalyticRtCalibAlg::saveGraph
void saveGraph(const std::string &path, std::unique_ptr< TGraph > &&graph) const
Definition: MdtAnalyticRtCalibAlg.cxx:313
AthHistogramming::graph
TGraph * graph(const std::string &graphName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered TGraphs.
Definition: AthHistogramming.cxx:492
MuonCalibR4::MdtAnalyticRtCalibAlg::initialize
virtual StatusCode initialize() override final
Definition: MdtAnalyticRtCalibAlg.cxx:26
MuonCalib::MdtRtRelation
class which holds calibration constants per rt-region
Definition: MdtRtRelation.h:19
AthHistogramAlgorithm.h
MuonCalibR4::MdtAnalyticRtCalibAlg::m_relUncReso
Gaudi::Property< double > m_relUncReso
Assignment of the relative uncertainty on each resolution data point.
Definition: MdtAnalyticRtCalibAlg.h:79
MuonCalibR4::MdtAnalyticRtCalibAlg::m_precCutOff
Gaudi::Property< unsigned > m_precCutOff
Precision cut-off to treat two incoming rt-relations as equivalent.
Definition: MdtAnalyticRtCalibAlg.h:90
MuonCalibR4::MdtAnalyticRtCalibAlg::execute
virtual StatusCode execute() override final
Definition: MdtAnalyticRtCalibAlg.cxx:35
MuonCalibR4::MdtAnalyticRtCalibAlg::m_writeKey
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
Definition: MdtAnalyticRtCalibAlg.h:67
MuonCalibR4::MdtAnalyticRtCalibAlg::m_maxOrder
Gaudi::Property< unsigned > m_maxOrder
Maximum order of the polynomial in use.
Definition: MdtAnalyticRtCalibAlg.h:71
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalibR4::MdtAnalyticRtCalibAlg::m_readKey
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_readKey
Definition: MdtAnalyticRtCalibAlg.h:66
MuonCalibR4::MdtAnalyticRtCalibAlg::m_outStream
Gaudi::Property< std::string > m_outStream
StreamName of the diagnostic histograms.
Definition: MdtAnalyticRtCalibAlg.h:88
MuonCalibR4
Definition: MdtAnalyticRtCalibAlg.cxx:24
MuonCalibR4::MdtAnalyticRtCalibAlg::tubeIds
std::vector< Identifier > tubeIds(const Identifier &chId) const
Definition: MdtAnalyticRtCalibAlg.cxx:130
AthHistogramAlgorithm
Definition: AthHistogramAlgorithm.h:32
ReadCondHandleKey.h
MuonCalibR4::MdtAnalyticRtCalibAlg::drawRt
void drawRt(const EventContext &ctx, const Identifier &detId, const std::vector< MuonCalib::SamplePoint > &rtPoints, const MuonCalib::MdtRtRelation &inRel) const
Definition: MdtAnalyticRtCalibAlg.cxx:243
MuonCalibR4::MdtAnalyticRtCalibAlg::m_missingT0
Gaudi::Property< float > m_missingT0
Default t0 constant to use, in case there's
Definition: MdtAnalyticRtCalibAlg.h:94
MuonCalib::IRtResolution
Generic interface to retrieve the resolution on the drift radius as a function of the drift time.
Definition: IRtResolution.h:20
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer >
MuonCalib::MdtFullCalibData::RtRelationPtr
GeoModel::TransientConstSharedPtr< MdtRtRelation > RtRelationPtr
Definition: MdtFullCalibData.h:17
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer >
MuonCalibR4::MdtAnalyticRtCalibAlg
Definition: MdtAnalyticRtCalibAlg.h:25
MuonCalibR4::MdtAnalyticRtCalibAlg::m_chiCutOff
Gaudi::Property< float > m_chiCutOff
Stop incrementing the order once the chi2CutOff is reached
Definition: MdtAnalyticRtCalibAlg.h:83
MuonCalibR4::MdtAnalyticRtCalibAlg::~MdtAnalyticRtCalibAlg
virtual ~MdtAnalyticRtCalibAlg()=default
MuonCalibR4::MdtAnalyticRtCalibAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtAnalyticRtCalibAlg.h:65
MuonCalibR4::MdtAnalyticRtCalibAlg::PolyType
PolyType
Definition: MdtAnalyticRtCalibAlg.h:33
MuonCalibR4::MdtAnalyticRtCalibAlg::drawResoFunc
void drawResoFunc(const EventContext &ctx, const Identifier &detId, const std::vector< MuonCalib::SamplePoint > &resoPoints, const MuonCalib::IRtResolution &inReso) const
Definition: MdtAnalyticRtCalibAlg.cxx:317
IMuonIdHelperSvc.h
MuonCalibR4::MdtAnalyticRtCalibAlg::m_fitRtReso
Gaudi::Property< bool > m_fitRtReso
Toggle whether the resolution shall be also converted into a polynomial.
Definition: MdtAnalyticRtCalibAlg.h:77
MuonCalibR4::MdtAnalyticRtCalibAlg::m_polyTypeRt
Gaudi::Property< int > m_polyTypeRt
Toggle the polynomial for the Rt-relation: ChebyChev or Legendre.
Definition: MdtAnalyticRtCalibAlg.h:73
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14