ATLAS Offline Software
CalibrationDbIOTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef CalibrationDbIOTool_H
6 #define CalibrationDbIOTool_H
7 
8 class MdtIdHelper;
9 namespace MuonGM {
10  class MuonDetectorManager;
11 }
12 
13 // MuonCalibStandAloneBase
14 #include <array>
15 #include <memory>
16 
23 
24 namespace MuonCalib {
25 
26  // class CalibDbConnection;
27  class IRtRelation;
28 
29  class CalibrationDbIOTool : public AthAlgTool, virtual public ICalibrationIOTool {
30  public:
32  CalibrationDbIOTool(const std::string &t, const std::string &n, const IInterface *p);
35  StatusCode initialize() override;
37  StatusCode WriteT0(const MdtTubeFitContainer *t0_output, const NtupleStationId &station_id, int iov_start, int iov_end) override;
39  StatusCode LoadT0(std::map<NtupleStationId, MdtStationT0Container *> &t0s, int /*iov_id*/) override;
41  StatusCode WriteRt(const RtCalibrationOutput *rt_relation, std::shared_ptr<const IRtResolution> resolution,
42  const NtupleStationId &station_id, int iov_start, int iov_end, bool /*real_rt*/,
43  bool /*real resolution*/) override;
45  StatusCode LoadRt(std::map<NtupleStationId, IRtRelation *> &rts, std::map<NtupleStationId, IRtResolution *> &res,
46  int /*iov_id*/) override;
47 
48  private:
50  std::string m_calib_dir;
53  // url of oracle data-base
54  std::string m_db_ConnectionString;
56  std::string m_db_WorkingSchema;
60  // username and password - job options
62  int m_headid;
63  std::string m_sitename;
64  std::vector<MuonCalib::NtupleStationId> m_region_ids;
66  std::unique_ptr<CalibDbConnection> m_connection;
67  std::array<std::unique_ptr<CalibDbConnection>, 2> m_data_connections;
68  std::unique_ptr<CalibHeadOperations> m_head_ops;
70  void fillRtPoints(const std::shared_ptr<const IRtRelation>& rt_relation, std::vector<SamplePoint> &points);
71  void fillResPoints(const std::shared_ptr<const IRtResolution>& rt_resolution, std::vector<SamplePoint> &points);
73  };
74 
75 } // namespace MuonCalib
76 #endif
CalibDbConnection.h
MuonCalib::RtCalibrationOutput
Definition: RtCalibrationOutput.h:21
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MuonCalib::CalibrationDbIOTool::m_data_connections
std::array< std::unique_ptr< CalibDbConnection >, 2 > m_data_connections
Definition: CalibrationDbIOTool.h:67
MuonCalib::CalibrationDbIOTool::m_reader_account
std::string m_reader_account
account data
Definition: CalibrationDbIOTool.h:58
TRTCalib_Extractor.rts
dictionary rts
Definition: TRTCalib_Extractor.py:15
TRTCalib_cfilter.t0s
list t0s
Definition: TRTCalib_cfilter.py:110
MuonCalib::NtupleStationId
Definition: NtupleStationId.h:36
MuonCalib::CalibrationDbIOTool::m_db_ConnectionString
std::string m_db_ConnectionString
Definition: CalibrationDbIOTool.h:54
MuonCalib::CalibrationDbIOTool::initialize
StatusCode initialize() override
initialisation
Definition: CalibrationDbIOTool.cxx:70
MuonCalib::CalibrationDbIOTool::fillResPoints
void fillResPoints(const std::shared_ptr< const IRtResolution > &rt_resolution, std::vector< SamplePoint > &points)
Definition: CalibrationDbIOTool.cxx:239
MuonCalib::CalibrationDbIOTool::m_head_ops
std::unique_ptr< CalibHeadOperations > m_head_ops
Definition: CalibrationDbIOTool.h:68
ICalibrationIOTool.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonCalib::CalibrationDbIOTool::m_region_ids
std::vector< MuonCalib::NtupleStationId > m_region_ids
Definition: CalibrationDbIOTool.h:64
MuonCalib::CalibrationDbIOTool::LoadT0
StatusCode LoadT0(std::map< NtupleStationId, MdtStationT0Container * > &t0s, int) override
load t0s
Definition: CalibrationDbIOTool.cxx:114
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
MuonCalib::CalibrationDbIOTool::m_reader_password
std::string m_reader_password
Definition: CalibrationDbIOTool.h:58
MuonCalib::CalibrationDbIOTool::m_db_WorkingSchema
std::string m_db_WorkingSchema
Definition: CalibrationDbIOTool.h:56
MuonCalib::CalibrationDbIOTool::m_sitename
std::string m_sitename
Definition: CalibrationDbIOTool.h:63
MuonCalib::CalibrationDbIOTool::m_writer_account
std::string m_writer_account
Definition: CalibrationDbIOTool.h:59
MuonCalib::CalibrationDbIOTool::fillRtPoints
void fillRtPoints(const std::shared_ptr< const IRtRelation > &rt_relation, std::vector< SamplePoint > &points)
convert rt and resolution to points
Definition: CalibrationDbIOTool.cxx:204
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonCalib::CalibrationDbIOTool::WriteT0
StatusCode WriteT0(const MdtTubeFitContainer *t0_output, const NtupleStationId &station_id, int iov_start, int iov_end) override
write out t0
Definition: CalibrationDbIOTool.cxx:96
MuonCalib::CalibrationDbIOTool::m_use_validated_t0
bool m_use_validated_t0
if true use validated - jo
Definition: CalibrationDbIOTool.h:52
AthAlgTool.h
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:247
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
MdtIdHelper
Definition: MdtIdHelper.h:61
MuonCalib::CalibrationDbIOTool::m_headid
int m_headid
Definition: CalibrationDbIOTool.h:62
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::CalibrationDbIOTool::m_calib_dir
std::string m_calib_dir
path to calibration directory - job option
Definition: CalibrationDbIOTool.h:50
MuonCalib::CalibrationDbIOTool::~CalibrationDbIOTool
virtual ~CalibrationDbIOTool()
MuonCalib::CalibrationDbIOTool::m_writer_password
std::string m_writer_password
Definition: CalibrationDbIOTool.h:59
MuonCalib::CalibrationDbIOTool::m_max_rt_points
int m_max_rt_points
Definition: CalibrationDbIOTool.h:61
MuonCalib::CalibrationDbIOTool
Definition: CalibrationDbIOTool.h:29
MuonCalib::CalibrationDbIOTool::CalibrationDbIOTool
CalibrationDbIOTool(const std::string &t, const std::string &n, const IInterface *p)
constructor
Definition: CalibrationDbIOTool.cxx:49
PixelModuleFeMask_create_db.iov_end
list iov_end
Definition: PixelModuleFeMask_create_db.py:75
MuonCalib::MdtTubeFitContainer
Holds single-tube full calibration information of one chamber.
Definition: MdtTubeFitContainer.h:16
MuonCalib::CalibrationDbIOTool::m_connection
std::unique_ptr< CalibDbConnection > m_connection
pointer to db connection
Definition: CalibrationDbIOTool.h:66
PixelModuleFeMask_create_db.iov_start
list iov_start
Definition: PixelModuleFeMask_create_db.py:74
SamplePoint.h
MuonCalib::CalibrationDbIOTool::m_writer_connection_string
std::string m_writer_connection_string
Definition: CalibrationDbIOTool.h:55
AthAlgTool
Definition: AthAlgTool.h:26
MuonCalib::ICalibrationIOTool
Definition: ICalibrationIOTool.h:30
MuonCalib::CalibDbConnection
Definition: CalibDbConnection.h:22
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
MuonCalib::CalibrationDbIOTool::LoadRt
StatusCode LoadRt(std::map< NtupleStationId, IRtRelation * > &rts, std::map< NtupleStationId, IRtResolution * > &res, int) override
load rts
Definition: CalibrationDbIOTool.cxx:163
MuonCalib::CalibrationDbIOTool::m_use_validated_rt
bool m_use_validated_rt
Definition: CalibrationDbIOTool.h:52
MuonCalib::CalibrationDbIOTool::WriteRt
StatusCode WriteRt(const RtCalibrationOutput *rt_relation, std::shared_ptr< const IRtResolution > resolution, const NtupleStationId &station_id, int iov_start, int iov_end, bool, bool) override
write rt
Definition: CalibrationDbIOTool.cxx:135
CalibHeadOperations.h
MuonCalib::CalibrationDbIOTool::get_connection
CalibDbConnection * get_connection(int write)
Definition: CalibrationDbIOTool.cxx:243
RtDataFromFile.h