9#ifndef MDTCALIBDBCOOLSTRTOOL_MDTCALIBDBALG_H
10#define MDTCALIBDBCOOLSTRTOOL_MDTCALIBDBALG_H
16#include "CLHEP/Random/RandomEngine.h"
17#include "CoralBase/Blob.h"
30#include "nlohmann/json.hpp"
35 MdtCalibDbAlg(
const std::string& name, ISvcLocator* pSvcLocator);
38 virtual StatusCode
execute(
const EventContext& ctx)
const override;
63 ToolHandle<MuonCalib::IIdToFixedIdTool>
m_idToFixedIdTool{
this,
"IdToFixedIdTool",
"MuonCalib::IdToFixedIdTool"};
69 "Switch between the legacy and the new geometry"};
73 Gaudi::Property<bool>
m_checkTubes{
this,
"checkTubes",
true,
"If true the number of tubes must agree between the conditions DB & geometry"};
75 Gaudi::Property<bool>
m_newFormat2020{
this,
"NewFormat2020",
false,
"Use the new calibration data format "};
80 "If set to true, the B-field correction functions are initialized for each rt-relation that is loaded."};
83 "If set to true, the slewing correction functions are initialized for each rt-relation that is loaded."};
95 Gaudi::Property<bool>
m_UseMLRt{
this,
"UseMLRt",
false,
"Enable use of ML-RTs from COOL"};
101 Gaudi::Property<double>
m_defaultT0{
this,
"defaultT0", 40.,
"default T0 value to be used in absence of DB information"};
102 Gaudi::Property<double>
m_t0Shift{
this,
"T0Shift", 0.,
"for simulation: common shift of all T0s, in ns"};
103 Gaudi::Property<double>
m_t0Spread{
this,
"T0Spread", 0.,
"for simulation: sigma for random smeraing of T0s, in ns"};
105 Gaudi::Property<double>
m_rtShift{
this,
"RTShift", 0.,
"for simulations: maximum RT distortion, in mm"};
106 Gaudi::Property<double>
m_rtScale{
this,
"RTScale", 1.,
"for simulations: a muliplicitive scale to the drift r"};
107 Gaudi::Property<double>
m_prop_beta{
this,
"PropagationSpeedBeta", 1.,
"Speed of the signal propagation"};
113 StringProperty
m_RTfileName{
this,
"RT_InputFile",
"MuonCondAlg/Muon_RT_default.data",
114 "single input ascii file for default RT to be applied in absence of DB information"};
116 static std::unique_ptr<MuonCalib::RtResolutionLookUp>
getRtResolutionInterpolation(
const std::vector<MuonCalib::SamplePoint>& sample_points);
121 "Conditions object containing the calibrations"};
Base class for conditions algorithms.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
A wrapper class for event-slot-local random engines.
Base class for conditions algorithms.
StringProperty m_randomStream
Gaudi::Property< double > m_TsCorrectionT0
SG::ReadCondHandleKey< MdtCondDbData > m_readKeyDCS
StringProperty m_RTfileName
MdtCalibDbAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_checkTubes
only needed to retrieve information on number of tubes etc. (no alignment needed)
Gaudi::Property< bool > m_UseMLRt
Gaudi::Property< double > m_t0Shift
virtual ~MdtCalibDbAlg()=default
Gaudi::Property< double > m_prop_beta
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
static std::unique_ptr< MuonCalib::RtResolutionLookUp > getRtResolutionInterpolation(const std::vector< MuonCalib::SamplePoint > &sample_points)
Gaudi::Property< double > m_rtShift
Gaudi::Property< double > m_rtScale
Gaudi::Property< bool > m_newFormat2020
virtual StatusCode initialize() override
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idToFixedIdTool
Gaudi::Property< bool > m_TimeSlewingCorrection
MuonCalib::MdtFullCalibData::RtRelationPtr RtRelationPtr
Gaudi::Property< bool > m_createSlewingFunction
StatusCode loadTube(const EventContext &ctx, MuonCalib::MdtCalibDataContainer &writeCdo) const
ServiceHandle< IAthRNGSvc > m_AthRNGSvc
StatusCode defaultT0s(MuonCalib::MdtCalibDataContainer &writeCdoTube) const
std::map< Identifier, RtRelationPtr > LoadedRtMap
const MuonGMR4::MuonDetectorManager * m_r4detMgr
Gaudi::Property< double > m_t0Spread
ATHRNG::RNGWrapper * m_RNGWrapper
Gaudi::Property< double > m_defaultT0
StatusCode declareDependency(const EventContext &ctx, SG::WriteCondHandle< MuonCalib::MdtCalibDataContainer > &writeHandle) const
std::optional< double > getInnerTubeRadius(const Identifier &id) const
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyRt
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode loadRt(const EventContext &ctx, MuonCalib::MdtCalibDataContainer &writeCdo) const
StatusCode defaultRt(MuonCalib::MdtCalibDataContainer &writeCdoRt, LoadedRtMap &loadedRts) const
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyTube
Gaudi::Property< bool > m_create_b_field_function
Gaudi::Property< bool > m_useNewGeo
const MuonGM::MuonDetectorManager * m_detMgr
Gaudi::Property< std::vector< float > > m_MeanCorrectionVsR
StatusCode legacyRtPayloadToJSON(const coral::AttributeList &attr, nlohmann::json &json) const
Parses the legacy payload for the RT functions to a json format.
StatusCode legacyTubePayloadToJSON(const coral::AttributeList &attr, nlohmann::json &json) const
virtual StatusCode execute(const EventContext &ctx) const override
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
GeoModel::TransientConstSharedPtr< MdtRtRelation > RtRelationPtr