ATLAS Offline Software
CscCondDbAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCONDALG_CSCCONDDBALG_H
6 #define MUONCONDALG_CSCCONDDBALG_H
7 
8 // STL includes
9 #include <zlib.h>
10 
11 #include <sstream>
12 #include <string>
13 #include <vector>
14 
15 // Gaudi includes
16 #include "GaudiKernel/ServiceHandle.h"
17 
18 // Athena includes
25 #include "CxxUtils/StringUtils.h"
26 
28 public:
29  CscCondDbAlg(const std::string &name, ISvcLocator *svc);
30  virtual ~CscCondDbAlg() = default;
31  virtual StatusCode initialize() override;
32  virtual StatusCode execute(const EventContext &) const override;
33  virtual bool isReEntrant() const override { return false; }
34 
35 private:
37 
38  StatusCode loadDataHv(writeHandle_t &, CscCondDbData *, const EventContext &) const;
39 
40  StatusCode loadData(CscCondDbData *, const CondAttrListCollection *, const std::string&, bool = false) const;
41 
42  StatusCode loadDataF001(writeHandle_t &, CscCondDbData *, const EventContext &) const;
43  StatusCode loadDataNoise(writeHandle_t &, CscCondDbData *, const EventContext &) const;
44  StatusCode loadDataPed(writeHandle_t &, CscCondDbData *, const EventContext &) const;
45  StatusCode loadDataPSlope(writeHandle_t &, CscCondDbData *, const EventContext &) const;
46  StatusCode loadDataRMS(writeHandle_t &, CscCondDbData *, const EventContext &) const;
47  StatusCode loadDataStatus(writeHandle_t &, CscCondDbData *, const EventContext &) const;
48  StatusCode loadDataT0Base(writeHandle_t &, CscCondDbData *, const EventContext &) const;
49  StatusCode loadDataT0Phase(writeHandle_t &, CscCondDbData *, const EventContext &) const;
50 
51  StatusCode cache(const std::string&, CscCondDbData *, const std::string&) const;
52  StatusCode cacheASM(const std::string&, CscCondDbData *, const std::string&) const;
53  StatusCode getAsmScope(int, int &, int &, int &, int &, int &) const;
54 
55  StatusCode recordParameter(unsigned int, const std::string&, CscCondDbData *, const std::string&) const;
56  StatusCode recordParameter(IdentifierHash, const std::string&, CscCondDbData *, const std::string&) const;
57 
66 
67  Gaudi::Property<bool> m_isOnline{this, "isOnline", false, ""};
68  Gaudi::Property<bool> m_isData{this, "isData", false, ""};
69  Gaudi::Property<bool> m_isRun1{this, "isRun1", false, ""};
70  Gaudi::Property<bool> m_onlineOfflinePhiFlip{this, "onlineOfflinePhiFlip", true, ""};
71  Gaudi::Property<std::string> m_defaultDatabaseReadVersion{this, "defaultDatabaseReadVersion", "02-00", ""};
72 
73  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
74 
75  SG::WriteCondHandleKey<CscCondDbData> m_writeKey{this, "WriteKey", "CscCondDbData", "Key of output CSC condition data"};
76 
77  SG::ReadCondHandleKey<CondAttrListCollection> m_readKey_folder_da_hv{this, "ReadKey_HV", "/CSC/DCS/LAYERSTATE",
78  "Key of input CSC condition data HV"};
80  "Key of input CSC condition data F001"};
82  "Key of input CSC condition data NOISE"};
84  "Key of input CSC condition data PEDESTALS"};
86  "Key of input CSC condition data PSLOPE"};
88  "Key of input CSC condition data RMS"};
90  "Key of input CSC condition data STATUS"};
92  "Key of input CSC condition data T0BASE"};
94  "Key of input CSC condition data T0PHASE"};
95 
103  Gaudi::Property<bool> m_pslopeFromDB{
104  this, "ReadPSlopeFromDatabase", false,
105  "read the pslope parameter from the conditions database (if it is not the same value for all channels)"};
110  const float m_DEFAULT_PSLOPE = 0.175;
111  Gaudi::Property<float> m_pslope{this, "PSlope", m_DEFAULT_PSLOPE,
112  "in case someone comes up with a new default value for pslope in the future"};
113 
114  // getParameter
115  template <typename T> StatusCode getParameter(IdentifierHash chanHash, std::string data, T &token) const {
116  // next element is the status bit
117  std::istringstream iss(data);
118  iss >> token;
119 
120  ATH_MSG_VERBOSE("Recorded token " << token << " for channelHash " << chanHash);
121  return StatusCode::SUCCESS;
122  }
123 };
124 
125 #endif
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CscCondDbAlg::recordParameterT0Phase
StatusCode recordParameterT0Phase(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:594
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
CscCondDbAlg::recordParameter
StatusCode recordParameter(unsigned int, const std::string &, CscCondDbData *, const std::string &) const
Definition: CscCondDbAlg.cxx:483
CscCondDbAlg::loadDataF001
StatusCode loadDataF001(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:178
CscCondDbAlg::m_readKey_folder_da_t0base
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_t0base
Definition: CscCondDbAlg.h:91
CscCondDbAlg::m_isOnline
Gaudi::Property< bool > m_isOnline
Definition: CscCondDbAlg.h:67
CscCondDbData.h
StringUtils.h
WriteCondHandleKey.h
CscCondDbAlg::recordParameterT0Base
StatusCode recordParameterT0Base(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:586
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CscCondDbAlg::recordParameterPed
StatusCode recordParameterPed(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:549
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
CscCondDbAlg::m_readKey_folder_da_ped
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_ped
Definition: CscCondDbAlg.h:83
CscCondDbAlg::m_readKey_folder_da_hv
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_hv
Definition: CscCondDbAlg.h:77
CscCondDbAlg::loadDataPSlope
StatusCode loadDataPSlope(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:199
CscCondDbAlg::m_onlineOfflinePhiFlip
Gaudi::Property< bool > m_onlineOfflinePhiFlip
Definition: CscCondDbAlg.h:70
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
CscCondDbAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscCondDbAlg.h:73
CscCondDbAlg::m_pslope
Gaudi::Property< float > m_pslope
Definition: CscCondDbAlg.h:111
CscCondDbAlg::CscCondDbAlg
CscCondDbAlg(const std::string &name, ISvcLocator *svc)
Definition: CscCondDbAlg.cxx:14
CscCondDbAlg::m_readKey_folder_da_noise
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_noise
Definition: CscCondDbAlg.h:81
CscCondDbAlg::recordParameterRMS
StatusCode recordParameterRMS(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:570
CscCondDbAlg::m_isData
Gaudi::Property< bool > m_isData
Definition: CscCondDbAlg.h:68
CscCondDbAlg::~CscCondDbAlg
virtual ~CscCondDbAlg()=default
CscCondDbAlg::m_pslopeFromDB
Gaudi::Property< bool > m_pslopeFromDB
The pslope is the gain of each CSC channel.
Definition: CscCondDbAlg.h:103
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CscCondDbAlg::m_writeKey
SG::WriteCondHandleKey< CscCondDbData > m_writeKey
Definition: CscCondDbAlg.h:75
CscCondDbAlg::loadDataRMS
StatusCode loadDataRMS(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:206
CscCondDbAlg::loadDataNoise
StatusCode loadDataNoise(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:185
CscCondDbAlg::cache
StatusCode cache(const std::string &, CscCondDbData *, const std::string &) const
Definition: CscCondDbAlg.cxx:291
CscCondDbAlg::m_readKey_folder_da_pslope
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_pslope
Definition: CscCondDbAlg.h:85
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
CscCondDbAlg::cacheASM
StatusCode cacheASM(const std::string &, CscCondDbData *, const std::string &) const
Definition: CscCondDbAlg.cxx:326
CscCondDbAlg::loadDataStatus
StatusCode loadDataStatus(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:213
ReadCondHandleKey.h
AthReentrantAlgorithm.h
CscCondDbAlg::loadDataPed
StatusCode loadDataPed(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:192
CscCondDbAlg::getParameter
StatusCode getParameter(IdentifierHash chanHash, std::string data, T &token) const
Definition: CscCondDbAlg.h:115
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CscCondDbAlg
Definition: CscCondDbAlg.h:27
CscCondDbAlg::m_readKey_folder_da_f001
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_f001
Definition: CscCondDbAlg.h:79
CscCondDbAlg::loadData
StatusCode loadData(CscCondDbData *, const CondAttrListCollection *, const std::string &, bool=false) const
Definition: CscCondDbAlg.cxx:234
CscCondDbAlg::m_isRun1
Gaudi::Property< bool > m_isRun1
Definition: CscCondDbAlg.h:69
CscCondDbAlg::loadDataHv
StatusCode loadDataHv(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:98
SG::ReadCondHandleKey< CondAttrListCollection >
CscCondDbAlg::m_readKey_folder_da_t0phase
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_t0phase
Definition: CscCondDbAlg.h:93
CscCondDbAlg::recordParameterF001
StatusCode recordParameterF001(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:533
CscCondDbAlg::getAsmScope
StatusCode getAsmScope(int, int &, int &, int &, int &, int &) const
Definition: CscCondDbAlg.cxx:441
CscCondDbAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition: CscCondDbAlg.cxx:53
CscCondDbAlg::m_readKey_folder_da_status
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_status
Definition: CscCondDbAlg.h:89
CscCondDbAlg::isReEntrant
virtual bool isReEntrant() const override
Definition: CscCondDbAlg.h:33
CscCondDbAlg::initialize
virtual StatusCode initialize() override
Definition: CscCondDbAlg.cxx:18
CscCondDbAlg::recordParameterNoise
StatusCode recordParameterNoise(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:541
CscCondDbAlg::m_readKey_folder_da_rms
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_rms
Definition: CscCondDbAlg.h:87
CscCondDbAlg::recordParameterStatus
StatusCode recordParameterStatus(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:578
CscCondDbAlg::m_DEFAULT_PSLOPE
const float m_DEFAULT_PSLOPE
The CSC gain was originally 5.304 ADC counts per fC, but later increased to 5.7 ADC counts per fC,...
Definition: CscCondDbAlg.h:110
CscCondDbAlg::loadDataT0Phase
StatusCode loadDataT0Phase(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:227
SG::WriteCondHandleKey< CscCondDbData >
CscCondDbAlg::m_defaultDatabaseReadVersion
Gaudi::Property< std::string > m_defaultDatabaseReadVersion
Definition: CscCondDbAlg.h:71
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CscCondDbAlg::recordParameterPSlope
StatusCode recordParameterPSlope(IdentifierHash, std::string, CscCondDbData *) const
Definition: CscCondDbAlg.cxx:557
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
CscCondDbAlg::loadDataT0Base
StatusCode loadDataT0Base(writeHandle_t &, CscCondDbData *, const EventContext &) const
Definition: CscCondDbAlg.cxx:220
CscCondDbAlg::writeHandle_t
SG::WriteCondHandle< CscCondDbData > writeHandle_t
Definition: CscCondDbAlg.h:36
IMuonIdHelperSvc.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
CscCondDbData
Definition: CscCondDbData.h:24
ServiceHandle< Muon::IMuonIdHelperSvc >