ATLAS Offline Software
CscCondDbData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCONDDATA_CSCCONDDBDATA_H
6 #define MUONCONDDATA_CSCCONDDBDATA_H
7 
8 //STL includes
9 #include <string>
10 #include <vector>
11 
12 //Athena includes
14 #include "AthenaKernel/CondCont.h"
15 #include "AthenaKernel/BaseInfo.h"
16 #include "Identifier/IdContext.h"
17 #include "Identifier/Identifier.h"
19 
20 //forward declarations
21 class CscIdHelper;
22 
23 
25 
26  friend class CscCondDbAlg;
27 
28 public:
29 
30  CscCondDbData() = default;
31  virtual ~CscCondDbData() = default;
32 
33  void loadParameters(const CscIdHelper*);
34  void setParameters(bool); // keep in plural for future development
35 
36  void setChannelF001 (IdentifierHash, float);
37  void setChannelNoise (IdentifierHash, float);
38  void setChannelPed (IdentifierHash, float);
39  void setChannelPSlope (IdentifierHash, float);
40  void setChannelRMS (IdentifierHash, float);
41  void setChannelStatus (IdentifierHash, int );
42  void setChannelT0Base (IdentifierHash, float);
43  void setChannelT0Phase(IdentifierHash, bool );
44 
46  void setDeadLayer (std::string_view, Identifier);
47  void setDeadStation (std::string_view, Identifier);
48 
49  const std::vector<std::string>& getDeadLayers () const;
50  const std::vector<std::string>& getDeadStations () const;
51 
52  const std::vector<Identifier>& getDeadLayersId () const;
53  const std::vector<Identifier>& getDeadStationsId () const;
54 
55  const std::vector<unsigned int>& getDeadChannelsHash() const;
56 
58 
59  const float& getChannelF001 (IdentifierHash) const;
60  const float& getChannelNoise (IdentifierHash) const;
61  const float& getChannelPed (IdentifierHash) const;
62  const float& getChannelPSlope (IdentifierHash) const;
63  const float& getChannelRMS (IdentifierHash) const;
64  const int& getChannelStatus (IdentifierHash) const;
65  const float& getChannelT0Base (IdentifierHash) const;
66  const bool& getChannelT0Phase(IdentifierHash) const;
67 
76 
77  bool isGood (const Identifier & ) const;
78  bool isGoodLayer (const Identifier & ) const;
79  bool isGoodStation (const Identifier & ) const;
80 
81  bool isGoodChannelHash(const IdentifierHash &) const;
82 
83  StatusCode indexToStringId(const CscIdHelper*, const unsigned int &, const std::string &, std::string &) const;
84  StatusCode layerHashToOnlineId(const unsigned int &, unsigned int &) const;
85  StatusCode offlineElementToOnlineId(const CscIdHelper*, const Identifier &, unsigned int &) const;
86  StatusCode offlineToOnlineId(const CscIdHelper*, const Identifier &, unsigned int &) const;
87  StatusCode onlineToOfflineIds(const CscIdHelper*, const unsigned int &, Identifier &, Identifier &) const;
88 
89 private:
90 
92 
95 
96  std::vector<unsigned int> m_onlineChannelIdsFromLayerHash{};
97  std::vector<unsigned int> m_onlineChannelIdsFromChamberCoolChannel{};
98 
99  std::vector<std::string> m_cachedDeadLayers{};
100  std::vector<std::string> m_cachedDeadStations{};
101 
102  std::vector<Identifier> m_cachedDeadLayersId{};
103  std::vector<Identifier> m_cachedDeadStationsId{};
104 
105  std::vector<unsigned int> m_cachedDeadChannelsHash{};
106 
107  std::map<unsigned int, float> m_cachedChannelsF001{};
108  std::map<unsigned int, float> m_cachedChannelsNoise{};
109  std::map<unsigned int, float> m_cachedChannelsPed{};
110  std::map<unsigned int, float> m_cachedChannelsPSlope{};
111  std::map<unsigned int, float> m_cachedChannelsRMS{};
112  std::map<unsigned int, int > m_cachedChannelsStatus{};
113  std::map<unsigned int, float> m_cachedChannelsT0Base{};
114  std::map<unsigned int, bool > m_cachedChannelsT0Phase{};
115 
116  std::vector<std::string> m_emptyNames{};
117  std::vector<Identifier> m_emptyIds{};
118  std::vector<unsigned int> m_emptyHashs{};
119 
120  const bool m_nillbool = false;
121  const float m_nillfloat = -1;
122  const int m_nillint = -1;
123 
124 public:
125 
126  // readChannelParam
127  template <typename T> StatusCode readChannelParam(IdentifierHash hash, T& val, const std::string& parName) const{
128 
129  if (parName == "f001" ) { float theVal; auto sc = readChannelF001 (hash, theVal); val = theVal; return sc;}
130  else if(parName == "noise" ) { float theVal; auto sc = readChannelNoise (hash, theVal); val = theVal; return sc;}
131  else if(parName == "ped" ) { float theVal; auto sc = readChannelPed (hash, theVal); val = theVal; return sc;}
132  else if(parName == "pslope" ) { float theVal; auto sc = readChannelPSlope (hash, theVal); val = theVal; return sc;}
133  else if(parName == "rms" ) { float theVal; auto sc = readChannelRMS (hash, theVal); val = theVal; return sc;}
134  else if(parName == "status" ) { int theVal; auto sc = readChannelStatus (hash, theVal); val = theVal; return sc;}
135  else if(parName == "t0base" ) { float theVal; auto sc = readChannelT0Base (hash, theVal); val = theVal; return sc;}
136  else if(parName == "t0phase") { bool theVal; auto sc = readChannelT0Phase(hash, theVal); val = theVal; return sc;}
137  return StatusCode::FAILURE;
138  }
139 
140 };
141 
142 CLASS_DEF( CscCondDbData, 10742890, 1)
143 CLASS_DEF( CondCont<CscCondDbData>, 43297256, 0)
144 
145 #endif
CscCondDbData::readChannelRMS
StatusCode readChannelRMS(IdentifierHash, float &) const
Definition: CscCondDbData.cxx:276
CscCondDbData::getChannelPSlope
const float & getChannelPSlope(IdentifierHash) const
Definition: CscCondDbData.cxx:214
CscCondDbData::getChannelF001
const float & getChannelF001(IdentifierHash) const
Definition: CscCondDbData.cxx:193
CscCondDbData::~CscCondDbData
virtual ~CscCondDbData()=default
CscCondDbData::m_nillfloat
const float m_nillfloat
Definition: CscCondDbData.h:121
CscCondDbData::readChannelParam
StatusCode readChannelParam(IdentifierHash hash, T &val, const std::string &parName) const
Definition: CscCondDbData.h:127
CondCont.h
Hold mappings of ranges to condition objects.
CscCondDbData::m_cachedChannelsNoise
std::map< unsigned int, float > m_cachedChannelsNoise
Definition: CscCondDbData.h:108
CscCondDbData::readChannelPed
StatusCode readChannelPed(IdentifierHash, float &) const
Definition: CscCondDbData.cxx:262
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
CscCondDbData::setDeadChannelHash
void setDeadChannelHash(IdentifierHash)
Definition: CscCondDbData.cxx:115
CscCondDbData::readChannelT0Phase
StatusCode readChannelT0Phase(IdentifierHash, bool &) const
Definition: CscCondDbData.cxx:297
CscCondDbData::CscCondDbData
CscCondDbData()=default
CscCondDbData::getDeadLayersId
const std::vector< Identifier > & getDeadLayersId() const
Definition: CscCondDbData.cxx:160
CscCondDbData::getDeadChannelsHash
const std::vector< unsigned int > & getDeadChannelsHash() const
Definition: CscCondDbData.cxx:176
CscCondDbData::setChannelNoise
void setChannelNoise(IdentifierHash, float)
Definition: CscCondDbData.cxx:68
CscCondDbData::m_onlineOfflinePhiFlip
bool m_onlineOfflinePhiFlip
Definition: CscCondDbData.h:91
CscCondDbData::m_cachedDeadLayers
std::vector< std::string > m_cachedDeadLayers
Definition: CscCondDbData.h:99
CscCondDbData::getChannelStatus
const int & getChannelStatus(IdentifierHash) const
Definition: CscCondDbData.cxx:228
CscCondDbData::setChannelPSlope
void setChannelPSlope(IdentifierHash, float)
Definition: CscCondDbData.cxx:80
CscCondDbData::m_cachedChannelsPed
std::map< unsigned int, float > m_cachedChannelsPed
Definition: CscCondDbData.h:109
CscCondDbData::m_cachedDeadStationsId
std::vector< Identifier > m_cachedDeadStationsId
Definition: CscCondDbData.h:103
CscCondDbData::m_moduleContext
IdContext m_moduleContext
Definition: CscCondDbData.h:94
CscCondDbData::offlineToOnlineId
StatusCode offlineToOnlineId(const CscIdHelper *, const Identifier &, unsigned int &) const
Definition: CscCondDbData.cxx:447
CscCondDbData::m_cachedChannelsPSlope
std::map< unsigned int, float > m_cachedChannelsPSlope
Definition: CscCondDbData.h:110
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CscCondDbData::indexToStringId
StatusCode indexToStringId(const CscIdHelper *, const unsigned int &, const std::string &, std::string &) const
Definition: CscCondDbData.cxx:347
CscCondDbData::m_cachedDeadLayersId
std::vector< Identifier > m_cachedDeadLayersId
Definition: CscCondDbData.h:102
CscCondDbData::getDeadStations
const std::vector< std::string > & getDeadStations() const
Definition: CscCondDbData.cxx:151
CscCondDbData::readChannelT0Base
StatusCode readChannelT0Base(IdentifierHash, float &) const
Definition: CscCondDbData.cxx:290
CscCondDbData::m_emptyNames
std::vector< std::string > m_emptyNames
Definition: CscCondDbData.h:116
CscCondDbData::offlineElementToOnlineId
StatusCode offlineElementToOnlineId(const CscIdHelper *, const Identifier &, unsigned int &) const
Definition: CscCondDbData.cxx:419
CscCondDbData::m_emptyIds
std::vector< Identifier > m_emptyIds
Definition: CscCondDbData.h:117
CscCondDbData::setChannelRMS
void setChannelRMS(IdentifierHash, float)
Definition: CscCondDbData.cxx:86
CscCondDbData::getChannelRMS
const float & getChannelRMS(IdentifierHash) const
Definition: CscCondDbData.cxx:221
CscCondDbData::m_onlineChannelIdsFromLayerHash
std::vector< unsigned int > m_onlineChannelIdsFromLayerHash
Definition: CscCondDbData.h:96
CscCondDbData::readChannelPSlope
StatusCode readChannelPSlope(IdentifierHash, float &) const
Definition: CscCondDbData.cxx:269
CscCondDbData::readChannelStatus
StatusCode readChannelStatus(IdentifierHash, int &) const
Definition: CscCondDbData.cxx:283
IdContext.h
CscCondDbData::setChannelPed
void setChannelPed(IdentifierHash, float)
Definition: CscCondDbData.cxx:74
BaseInfo.h
Provide an interface for finding inheritance information at run time.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CscCondDbData::m_onlineChannelIdsFromChamberCoolChannel
std::vector< unsigned int > m_onlineChannelIdsFromChamberCoolChannel
Definition: CscCondDbData.h:97
CscCondDbData::m_nillbool
const bool m_nillbool
Definition: CscCondDbData.h:120
CscCondDbData::setChannelT0Phase
void setChannelT0Phase(IdentifierHash, bool)
Definition: CscCondDbData.cxx:105
beamspotnt.parName
list parName
Definition: bin/beamspotnt.py:1287
CscCondDbData::setChannelStatus
void setChannelStatus(IdentifierHash, int)
Definition: CscCondDbData.cxx:92
CscCondDbData::m_cachedDeadChannelsHash
std::vector< unsigned int > m_cachedDeadChannelsHash
Definition: CscCondDbData.h:105
CscCondDbData::readChannelNoise
StatusCode readChannelNoise(IdentifierHash, float &) const
Definition: CscCondDbData.cxx:255
CscCondDbData::readChannelF001
StatusCode readChannelF001(IdentifierHash, float &) const
Definition: CscCondDbData.cxx:248
CscCondDbData::setDeadStation
void setDeadStation(std::string_view, Identifier)
Definition: CscCondDbData.cxx:130
CscCondDbData::setDeadLayer
void setDeadLayer(std::string_view, Identifier)
Definition: CscCondDbData.cxx:122
CscCondDbData::getDeadStationsId
const std::vector< Identifier > & getDeadStationsId() const
Definition: CscCondDbData.cxx:167
CscCondDbData::getChannelNoise
const float & getChannelNoise(IdentifierHash) const
Definition: CscCondDbData.cxx:200
CscCondDbData::m_cachedChannelsF001
std::map< unsigned int, float > m_cachedChannelsF001
Definition: CscCondDbData.h:107
CscCondDbAlg
Definition: CscCondDbAlg.h:27
CscCondDbData::m_cachedDeadStations
std::vector< std::string > m_cachedDeadStations
Definition: CscCondDbData.h:100
IdentifierHash.h
CscCondDbData::getDeadLayers
const std::vector< std::string > & getDeadLayers() const
Definition: CscCondDbData.cxx:144
CscCondDbData::m_nillint
const int m_nillint
Definition: CscCondDbData.h:122
CscCondDbData::setChannelF001
void setChannelF001(IdentifierHash, float)
Definition: CscCondDbData.cxx:62
CscCondDbData::m_cachedChannelsT0Base
std::map< unsigned int, float > m_cachedChannelsT0Base
Definition: CscCondDbData.h:113
CscCondDbData::m_emptyHashs
std::vector< unsigned int > m_emptyHashs
Definition: CscCondDbData.h:118
CscCondDbData::isGood
bool isGood(const Identifier &) const
Definition: CscCondDbData.cxx:309
CscCondDbData::m_channelContext
IdContext m_channelContext
Definition: CscCondDbData.h:93
CscCondDbData::onlineToOfflineIds
StatusCode onlineToOfflineIds(const CscIdHelper *, const unsigned int &, Identifier &, Identifier &) const
Definition: CscCondDbData.cxx:483
CondCont
Hold mapping of ranges to condition objects.
Definition: CondCont.h:811
CscCondDbData::getChannelPed
const float & getChannelPed(IdentifierHash) const
Definition: CscCondDbData.cxx:207
CscCondDbData::hasChannelT0Phase
bool hasChannelT0Phase(IdentifierHash) const
Definition: CscCondDbData.cxx:186
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CscIdHelper
Definition: CscIdHelper.h:52
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
CscCondDbData::m_cachedChannelsStatus
std::map< unsigned int, int > m_cachedChannelsStatus
Definition: CscCondDbData.h:112
CscCondDbData::isGoodStation
bool isGoodStation(const Identifier &) const
Definition: CscCondDbData.cxx:334
CscCondDbData::m_cachedChannelsT0Phase
std::map< unsigned int, bool > m_cachedChannelsT0Phase
Definition: CscCondDbData.h:114
CscCondDbData::setParameters
void setParameters(bool)
Definition: CscCondDbData.cxx:53
CscCondDbData::isGoodLayer
bool isGoodLayer(const Identifier &) const
Definition: CscCondDbData.cxx:326
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
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
CscCondDbData::setChannelT0Base
void setChannelT0Base(IdentifierHash, float)
Definition: CscCondDbData.cxx:99
CscCondDbData::m_cachedChannelsRMS
std::map< unsigned int, float > m_cachedChannelsRMS
Definition: CscCondDbData.h:111
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
CscCondDbData::layerHashToOnlineId
StatusCode layerHashToOnlineId(const unsigned int &, unsigned int &) const
Definition: CscCondDbData.cxx:404
CscCondDbData::isGoodChannelHash
bool isGoodChannelHash(const IdentifierHash &) const
Definition: CscCondDbData.cxx:318
CscCondDbData
Definition: CscCondDbData.h:24
CscCondDbData::getChannelT0Base
const float & getChannelT0Base(IdentifierHash) const
Definition: CscCondDbData.cxx:235
CscCondDbData::getChannelT0Phase
const bool & getChannelT0Phase(IdentifierHash) const
Definition: CscCondDbData.cxx:242
CscCondDbData::loadParameters
void loadParameters(const CscIdHelper *)
Definition: CscCondDbData.cxx:14
Identifier
Definition: IdentifierFieldParser.cxx:14