ATLAS Offline Software
Loading...
Searching...
No Matches
MdtCalibJsonDumpAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#pragma once
5
11
14
15#include "nlohmann/json.hpp"
16
17namespace Muon{
18
20 public:
22
24
25 virtual StatusCode initialize() override final;
26 virtual StatusCode execute() override final;
27 virtual StatusCode finalize() override final;
28 private:
34
35 std::string dump(const std::vector<double>& values) const;
36 std::string dump(const double v) const;
37 std::string toString(const EventIDRange& range) const;
38
40 StatusCode dumpRtRelations(const EventContext& ctx, const RtGrouper& rtRelMap, const EventIDRange& eventRange);
41
42 StatusCode dumpTubeT0s(const EventContext& ctx,
43 const T0Grouper& t0Map, const EventIDRange& eventRange);
44
45 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
47 "Conditions object containing the calibrations"};
48
49 Gaudi::Property<std::string> m_rtJSON{this, "RtJSON", "RtRelations.json"};
50 Gaudi::Property<std::string> m_t0JSON{this, "TubeT0JSON", "TubeT0.json"};
51 Gaudi::Property<bool> m_savePerIOV{this, "JsonPerIOV", true};
52
53 Gaudi::Property<unsigned> m_whiteSpace{this, "WhiteSpaces", 2};
54 Gaudi::Property<unsigned> m_precision{this, "FloatPrecision", 4};
55
56
57 std::vector<EventIDRange> m_seenIDs{};
58
59 MuonVal::MuonTesterTree m_rtDumpTree{"RtCalibConstants", "MDTRTCALIBDUMP"};
61 MuonVal::ScalarBranch<std::string>& m_rt_type{m_rtDumpTree.newScalar<std::string>("rtType")};
63 MuonVal::VectorBranch<double>& m_rt_pars{m_rtDumpTree.newVector<double>("rtParams")};
65 MuonVal::ScalarBranch<std::string>& m_tr_type{m_rtDumpTree.newScalar<std::string>("trType", "")};
67 MuonVal::VectorBranch<double>& m_tr_pars{m_rtDumpTree.newVector<double>("trParams")};
71 MuonVal::VectorBranch<double>& m_rt_resoPars{m_rtDumpTree.newVector<double>("resoParams")};
73 MuonVal::VectorBranch<std::string>& m_rt_stName{m_rtDumpTree.newVector<std::string>("stationName")};
75 MuonVal::VectorBranch<short>& m_rt_stEta{m_rtDumpTree.newVector<short>("stationEta")};
77 MuonVal::VectorBranch<unsigned short>& m_rt_stPhi{m_rtDumpTree.newVector<unsigned short>("stationPhi")};
79 MuonVal::VectorBranch<unsigned short>& m_rt_stMl{m_rtDumpTree.newVector<unsigned short>("multiLayer")};
84
85 MuonVal::MuonTesterTree m_t0DumpTree{"T0CalibConstants", "MDTT0CALIBDUMP"};
86 MuonVal::ScalarBranch<std::string>& m_t0_stName{m_t0DumpTree.newScalar<std::string>("stationName")};
87 MuonVal::ScalarBranch<short>& m_t0_stEta{m_t0DumpTree.newScalar<short>("stationEta")};
88 MuonVal::ScalarBranch<unsigned short>& m_t0_stPhi{m_t0DumpTree.newScalar<unsigned short>("stationPhi")};
89
93
94 MuonVal::VectorBranch<unsigned short>& m_t0_multiLayer{m_t0DumpTree.newVector<unsigned short>("multiLayer")};
95 MuonVal::VectorBranch<unsigned short>& m_t0_tubeLayer{m_t0DumpTree.newVector<unsigned short>("tubeLayer")};
101
102
103 };
104}
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Branch class to dump a EventIDBase object into a MuonTesterTree format.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
MuonVal::VectorBranch< double > & m_rt_resoPars
parameters of the rt resolution function
StatusCode dumpRtRelations(const EventContext &ctx, const RtGrouper &rtRelMap, const EventIDRange &eventRange)
writes the RT relations into the JSON & output root file
Gaudi::Property< std::string > m_rtJSON
MuonVal::ScalarBranch< short > & m_t0_stEta
std::map< const SingleTubeCalib *, std::set< Identifier >, CalibParamSorter > T0PerChamb
virtual StatusCode initialize() override final
MuonVal::ScalarBranch< std::string > & m_rt_type
string defining the type of the rt function
MuonVal::VectorBranch< unsigned short > & m_rt_stPhi
Station phi of the associated chamber.
Gaudi::Property< std::string > m_t0JSON
MuonVal::VectorBranch< unsigned short > & m_t0_tubeLayer
MuonVal::ScalarBranch< float > & m_t0_adc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::map< Identifier, T0PerChamb > T0Grouper
MuonCalib::CalibParamSorter CalibParamSorter
MuonVal::ScalarBranch< float > & m_t0_t0
MuonVal::EventIDBranch m_rt_iov_end
Data mebmers to save the IOV range (End point)
MuonVal::VectorBranch< double > & m_rt_pars
parameters of the rt-function
MuonVal::EventIDBranch m_t0_iov_start
Data mebmers to save the IOV range (Start point)
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_readKey
MuonVal::ScalarBranch< std::string > & m_tr_type
String defining the type of the tr function.
std::vector< EventIDRange > m_seenIDs
std::map< const MuonCalib::MdtRtRelation *, std::set< Identifier >, CalibParamSorter > RtGrouper
Gaudi::Property< bool > m_savePerIOV
MuonVal::ScalarBranch< unsigned short > & m_t0_code
std::string toString(const EventIDRange &range) const
MuonVal::ScalarBranch< unsigned short > & m_t0_stPhi
MuonVal::MuonTesterTree m_rtDumpTree
MuonVal::VectorBranch< unsigned short > & m_rt_stMl
Multi layer of the associated chamber.
StatusCode dumpTubeT0s(const EventContext &ctx, const T0Grouper &t0Map, const EventIDRange &eventRange)
MuonVal::EventIDBranch m_rt_iov_start
Data mebmers to save the IOV range (Start point)
virtual StatusCode finalize() override final
MuonVal::VectorBranch< unsigned short > & m_t0_multiLayer
Gaudi::Property< unsigned > m_whiteSpace
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
MuonVal::ScalarBranch< std::string > & m_rt_resoType
string defining the type of the rt resolution function
CalibParamSorter::SingleTubeCalib SingleTubeCalib
MuonVal::VectorBranch< unsigned short > & m_t0_tube
MuonVal::VectorBranch< short > & m_rt_stEta
Station eta of the associated chambers.
MuonVal::VectorBranch< double > & m_tr_pars
parameters of the tr-function
Gaudi::Property< unsigned > m_precision
MuonVal::MuonTesterTree m_t0DumpTree
MuonVal::ScalarBranch< std::string > & m_t0_stName
MuonVal::EventIDBranch m_t0_iov_end
Data mebmers to save the IOV range (End point)
MuonVal::VectorBranch< std::string > & m_rt_stName
Station name string of the associated chambers.
virtual StatusCode execute() override final
STL class.
STL class.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
-event-from-file
STL namespace.
#define private