ATLAS Offline Software
CalibRtDbOperations.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef CalibRtDbOperations_h
6 #define CalibRtDbOperations_h
7 
8 // c - c++
9 #include "string"
10 #include "vector"
11 
12 namespace coral {
13  class IQuery;
14  class AttributeList;
15 } // namespace coral
16 
17 namespace MuonCalib {
18 
19  class CalibDbConnection;
20  class NtupleStationId;
21  class RtFullInfo;
22  class SamplePoint;
23  class IConditionsStorage;
24 
26  public:
27  //=====================constructor - destructor=================================
29  virtual ~CalibRtDbOperations() = default;
30  //=====================publlic member functions=================================
31  // load rt do not read full info, if full_info=NULL
32  bool LoadRt(const NtupleStationId &id, int head_id, bool validated, const std::string & /*site_name*/,
33  std::vector<SamplePoint> &points, RtFullInfo *full_info);
34  // write/update rt
35  bool WriteUpdateRt(const NtupleStationId &id, int head_id, const std::string & /*site_name*/,
36  const std::vector<SamplePoint> &points, int validflag, const RtFullInfo *full_info);
37  // set validation flag - last requested rt-id is used as key
38  bool SetValidflag(int validflag, bool commit = true);
39  // read for cconditions db insert
40  bool ReadForConditions(const std::string& /*site_name*/, int head_id, IConditionsStorage &storage);
41 
42  private:
43  //=====================private data members====================================
44  // db connection
46  coral::IQuery *m_query;
47  // current mdt-rt-id
49  std::string m_prev_algs;
51  // red mdt-rt table
52  bool getRtId(bool validated, RtFullInfo *full_info);
53  // read r/t/s-table
54  inline bool readRTS(std::vector<SamplePoint> &points);
55  // update MDT_RT-Table
56  inline bool updateFullInfo(const RtFullInfo *full_info, const int &validflag, const int &n_points);
57  // update r-t-s-table
58  inline bool updateRTSable(const std::vector<SamplePoint> &points);
59  // insert into MDT_RT table
60  inline bool insertFullInfo(const RtFullInfo *full_info, const int &validflag, const int &n_points);
61  // insert line into r/t/s table
62  inline bool insertRTSable(const std::vector<SamplePoint> &points);
63  // initialize data buffer for MDT_RT table
64  inline void fullInfoInitData(const RtFullInfo *full_info, const int &validflag, coral::AttributeList &updateData, const int &n_bins,
65  const bool &for_insert);
66  // initialize data buffer for MDT_RT_MAP_. Table
67  inline void rtTableInitData(coral::AttributeList &rowBuffer);
68  // get rt map t id
69  inline bool getRTMapTId();
70  // prevent double inserts
71  inline bool checkRtPresent(const int &head_id, const std::string & /*site_name*/, const NtupleStationId &id, const int &validflag);
72  };
73 
74 } // namespace MuonCalib
75 
76 #endif
MuonCalib::CalibRtDbOperations::m_n_points
int m_n_points
Definition: CalibRtDbOperations.h:50
MuonCalib::NtupleStationId
Definition: NtupleStationId.h:36
MuonCalib::CalibRtDbOperations::m_query
coral::IQuery * m_query
Definition: CalibRtDbOperations.h:46
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
MuonCalib::CalibRtDbOperations::m_prev_algs
std::string m_prev_algs
Definition: CalibRtDbOperations.h:49
MuonCalib::CalibRtDbOperations::ReadForConditions
bool ReadForConditions(const std::string &, int head_id, IConditionsStorage &storage)
Definition: CalibRtDbOperations.cxx:157
MuonCalib::CalibRtDbOperations::m_rt_id
int m_rt_id
Definition: CalibRtDbOperations.h:48
MuonCalib::CalibRtDbOperations::~CalibRtDbOperations
virtual ~CalibRtDbOperations()=default
MuonCalib::CalibRtDbOperations::CalibRtDbOperations
CalibRtDbOperations(CalibDbConnection &db_conn)
Definition: CalibRtDbOperations.cxx:37
coral
Definition: ISecondaryEventSelector.h:19
MuonCalib::CalibRtDbOperations::updateRTSable
bool updateRTSable(const std::vector< SamplePoint > &points)
Definition: CalibRtDbOperations.cxx:335
MuonCalib::CalibRtDbOperations::fullInfoInitData
void fullInfoInitData(const RtFullInfo *full_info, const int &validflag, coral::AttributeList &updateData, const int &n_bins, const bool &for_insert)
Definition: CalibRtDbOperations.cxx:411
MuonCalib::CalibRtDbOperations::getRtId
bool getRtId(bool validated, RtFullInfo *full_info)
Definition: CalibRtDbOperations.cxx:212
MuonCalib::CalibRtDbOperations::LoadRt
bool LoadRt(const NtupleStationId &id, int head_id, bool validated, const std::string &, std::vector< SamplePoint > &points, RtFullInfo *full_info)
Definition: CalibRtDbOperations.cxx:42
CalibDbCompareRT.n_points
n_points
Definition: CalibDbCompareRT.py:76
MuonCalib::CalibRtDbOperations::insertFullInfo
bool insertFullInfo(const RtFullInfo *full_info, const int &validflag, const int &n_points)
Definition: CalibRtDbOperations.cxx:382
MuonCalib::CalibRtDbOperations::updateFullInfo
bool updateFullInfo(const RtFullInfo *full_info, const int &validflag, const int &n_points)
Definition: CalibRtDbOperations.cxx:313
MuonCalib::IConditionsStorage
Definition: IConditionsStorage.h:21
MuonCalib::CalibRtDbOperations::WriteUpdateRt
bool WriteUpdateRt(const NtupleStationId &id, int head_id, const std::string &, const std::vector< SamplePoint > &points, int validflag, const RtFullInfo *full_info)
Definition: CalibRtDbOperations.cxx:72
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::CalibRtDbOperations::getRTMapTId
bool getRTMapTId()
MuonCalib::CalibRtDbOperations::readRTS
bool readRTS(std::vector< SamplePoint > &points)
Definition: CalibRtDbOperations.cxx:270
MuonCalib::CalibRtDbOperations
Definition: CalibRtDbOperations.h:25
MuonCalib::CalibRtDbOperations::insertRTSable
bool insertRTSable(const std::vector< SamplePoint > &points)
Definition: CalibRtDbOperations.cxx:390
MuonCalib::RtFullInfo
addiitonal information used in validation of a rt-relation
Definition: RtFullInfo.h:15
calibdata.head_id
head_id
Definition: calibdata.py:29
MuonCalib::CalibRtDbOperations::rtTableInitData
void rtTableInitData(coral::AttributeList &rowBuffer)
Definition: CalibRtDbOperations.cxx:495
MuonCalib::CalibRtDbOperations::checkRtPresent
bool checkRtPresent(const int &head_id, const std::string &, const NtupleStationId &id, const int &validflag)
Definition: CalibRtDbOperations.cxx:505
calibdata.commit
bool commit
Definition: calibdata.py:832
MuonCalib::CalibRtDbOperations::m_region_id
int m_region_id
Definition: CalibRtDbOperations.h:48
MuonCalib::CalibRtDbOperations::m_rt_map_t_id
int m_rt_map_t_id
Definition: CalibRtDbOperations.h:48
MuonCalib::CalibRtDbOperations::m_db_conn
CalibDbConnection & m_db_conn
Definition: CalibRtDbOperations.h:45
MuonCalib::CalibDbConnection
Definition: CalibDbConnection.h:22
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
MuonCalib::CalibRtDbOperations::SetValidflag
bool SetValidflag(int validflag, bool commit=true)
Definition: CalibRtDbOperations.cxx:119
MuonCalib::CalibRtDbOperations::m_head_id
int m_head_id
Definition: CalibRtDbOperations.h:48