ATLAS Offline Software
Loading...
Searching...
No Matches
CscCondDbData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCONDDATA_CSCCONDDBDATA_H
6#define MUONCONDDATA_CSCCONDDBDATA_H
7
8
9
10//Athena includes
15#include "Identifier/Identifier.h"
17//STL includes
18#include <string>
19#include <string_view>
20#include <vector>
21
22//forward declarations
23class CscIdHelper;
24
25
27
28 friend class CscCondDbAlg;
29
30public:
31
32 CscCondDbData() = default;
33 virtual ~CscCondDbData() = default;
34
35 void loadParameters(const CscIdHelper*);
36 void setParameters(bool); // keep in plural for future development
37
38 void setChannelF001 (IdentifierHash, float);
39 void setChannelNoise (IdentifierHash, float);
40 void setChannelPed (IdentifierHash, float);
41 void setChannelPSlope (IdentifierHash, float);
42 void setChannelRMS (IdentifierHash, float);
44 void setChannelT0Base (IdentifierHash, float);
46
48 void setDeadLayer (std::string_view, Identifier);
49 void setDeadStation (std::string_view, Identifier);
50
51 const std::vector<std::string>& getDeadLayers () const;
52 const std::vector<std::string>& getDeadStations () const;
53
54 const std::vector<Identifier>& getDeadLayersId () const;
55 const std::vector<Identifier>& getDeadStationsId () const;
56
57 const std::vector<unsigned int>& getDeadChannelsHash() const;
58
60
61 const float& getChannelF001 (IdentifierHash) const;
62 const float& getChannelNoise (IdentifierHash) const;
63 const float& getChannelPed (IdentifierHash) const;
64 const float& getChannelPSlope (IdentifierHash) const;
65 const float& getChannelRMS (IdentifierHash) const;
66 const int& getChannelStatus (IdentifierHash) const;
67 const float& getChannelT0Base (IdentifierHash) const;
68 const bool& getChannelT0Phase(IdentifierHash) const;
69
70 StatusCode readChannelF001 (IdentifierHash, float&) const;
71 StatusCode readChannelNoise (IdentifierHash, float&) const;
72 StatusCode readChannelPed (IdentifierHash, float&) const;
73 StatusCode readChannelPSlope (IdentifierHash, float&) const;
74 StatusCode readChannelRMS (IdentifierHash, float&) const;
75 StatusCode readChannelStatus (IdentifierHash, int& ) const;
76 StatusCode readChannelT0Base (IdentifierHash, float&) const;
77 StatusCode readChannelT0Phase(IdentifierHash, bool& ) const;
78
79 bool isGood (const Identifier & ) const;
80 bool isGoodLayer (const Identifier & ) const;
81 bool isGoodStation (const Identifier & ) const;
82
83 bool isGoodChannelHash(const IdentifierHash &) const;
84
85 StatusCode indexToStringId(const CscIdHelper*, const unsigned int &, std::string_view, std::string &) const;
86 StatusCode layerHashToOnlineId(const unsigned int &, unsigned int &) const;
87 StatusCode offlineElementToOnlineId(const CscIdHelper*, const Identifier &, unsigned int &) const;
88 StatusCode offlineToOnlineId(const CscIdHelper*, const Identifier &, unsigned int &) const;
89 StatusCode onlineToOfflineIds(const CscIdHelper*, const unsigned int &, Identifier &, Identifier &) const;
90
91private:
92
94
97
98 std::vector<unsigned int> m_onlineChannelIdsFromLayerHash{};
99 std::vector<unsigned int> m_onlineChannelIdsFromChamberCoolChannel{};
100
101 std::vector<std::string> m_cachedDeadLayers{};
102 std::vector<std::string> m_cachedDeadStations{};
103
104 std::vector<Identifier> m_cachedDeadLayersId{};
105 std::vector<Identifier> m_cachedDeadStationsId{};
106
107 std::vector<unsigned int> m_cachedDeadChannelsHash{};
108
109 std::map<unsigned int, float> m_cachedChannelsF001{};
110 std::map<unsigned int, float> m_cachedChannelsNoise{};
111 std::map<unsigned int, float> m_cachedChannelsPed{};
112 std::map<unsigned int, float> m_cachedChannelsPSlope{};
113 std::map<unsigned int, float> m_cachedChannelsRMS{};
114 std::map<unsigned int, int > m_cachedChannelsStatus{};
115 std::map<unsigned int, float> m_cachedChannelsT0Base{};
116 std::map<unsigned int, bool > m_cachedChannelsT0Phase{};
117
118 std::vector<std::string> m_emptyNames{};
119 std::vector<Identifier> m_emptyIds{};
120 std::vector<unsigned int> m_emptyHashs{};
121
122 const bool m_nillbool = false;
123 const float m_nillfloat = -1;
124 const int m_nillint = -1;
125
126public:
127
128 // readChannelParam
129 template <typename T> StatusCode readChannelParam(IdentifierHash hash, T& val, const std::string& parName) const{
130
131 if (parName == "f001" ) { float theVal; auto sc = readChannelF001 (hash, theVal); val = theVal; return sc;}
132 else if(parName == "noise" ) { float theVal; auto sc = readChannelNoise (hash, theVal); val = theVal; return sc;}
133 else if(parName == "ped" ) { float theVal; auto sc = readChannelPed (hash, theVal); val = theVal; return sc;}
134 else if(parName == "pslope" ) { float theVal; auto sc = readChannelPSlope (hash, theVal); val = theVal; return sc;}
135 else if(parName == "rms" ) { float theVal; auto sc = readChannelRMS (hash, theVal); val = theVal; return sc;}
136 else if(parName == "status" ) { int theVal; auto sc = readChannelStatus (hash, theVal); val = theVal; return sc;}
137 else if(parName == "t0base" ) { float theVal; auto sc = readChannelT0Base (hash, theVal); val = theVal; return sc;}
138 else if(parName == "t0phase") { bool theVal; auto sc = readChannelT0Phase(hash, theVal); val = theVal; return sc;}
139 return StatusCode::FAILURE;
140 }
141
142};
143
144CLASS_DEF( CscCondDbData, 10742890, 1)
145CLASS_DEF( CondCont<CscCondDbData>, 43297256, 0)
146
147#endif
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Hold mappings of ranges to condition objects.
Provide an interface for finding inheritance information at run time.
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t sc
Hold mapping of ranges to condition objects.
Definition CondCont.h:889
void setParameters(bool)
std::vector< std::string > m_cachedDeadLayers
bool isGood(const Identifier &) const
StatusCode onlineToOfflineIds(const CscIdHelper *, const unsigned int &, Identifier &, Identifier &) const
StatusCode offlineToOnlineId(const CscIdHelper *, const Identifier &, unsigned int &) const
std::map< unsigned int, float > m_cachedChannelsRMS
const bool & getChannelT0Phase(IdentifierHash) const
StatusCode readChannelParam(IdentifierHash hash, T &val, const std::string &parName) const
const std::vector< std::string > & getDeadStations() const
std::map< unsigned int, bool > m_cachedChannelsT0Phase
bool isGoodStation(const Identifier &) const
StatusCode readChannelPed(IdentifierHash, float &) const
StatusCode readChannelT0Base(IdentifierHash, float &) const
void setChannelStatus(IdentifierHash, int)
const std::vector< unsigned int > & getDeadChannelsHash() const
const bool m_nillbool
void setDeadLayer(std::string_view, Identifier)
void setChannelT0Phase(IdentifierHash, bool)
void setChannelRMS(IdentifierHash, float)
const int m_nillint
std::vector< unsigned int > m_onlineChannelIdsFromLayerHash
void setDeadStation(std::string_view, Identifier)
StatusCode offlineElementToOnlineId(const CscIdHelper *, const Identifier &, unsigned int &) const
std::vector< std::string > m_cachedDeadStations
bool isGoodLayer(const Identifier &) const
StatusCode readChannelT0Phase(IdentifierHash, bool &) const
const std::vector< Identifier > & getDeadLayersId() const
const float m_nillfloat
StatusCode readChannelRMS(IdentifierHash, float &) const
const float & getChannelPed(IdentifierHash) const
std::vector< unsigned int > m_onlineChannelIdsFromChamberCoolChannel
const float & getChannelPSlope(IdentifierHash) const
StatusCode readChannelStatus(IdentifierHash, int &) const
const int & getChannelStatus(IdentifierHash) const
void loadParameters(const CscIdHelper *)
std::vector< unsigned int > m_emptyHashs
std::vector< std::string > m_emptyNames
void setChannelNoise(IdentifierHash, float)
void setChannelPSlope(IdentifierHash, float)
const float & getChannelF001(IdentifierHash) const
bool isGoodChannelHash(const IdentifierHash &) const
IdContext m_channelContext
const float & getChannelRMS(IdentifierHash) const
std::map< unsigned int, float > m_cachedChannelsF001
std::vector< Identifier > m_emptyIds
std::map< unsigned int, float > m_cachedChannelsNoise
const std::vector< Identifier > & getDeadStationsId() const
StatusCode indexToStringId(const CscIdHelper *, const unsigned int &, std::string_view, std::string &) const
void setChannelF001(IdentifierHash, float)
void setChannelT0Base(IdentifierHash, float)
StatusCode readChannelPSlope(IdentifierHash, float &) const
void setChannelPed(IdentifierHash, float)
const float & getChannelNoise(IdentifierHash) const
bool hasChannelT0Phase(IdentifierHash) const
StatusCode readChannelNoise(IdentifierHash, float &) const
std::vector< Identifier > m_cachedDeadStationsId
const float & getChannelT0Base(IdentifierHash) const
std::map< unsigned int, float > m_cachedChannelsT0Base
StatusCode layerHashToOnlineId(const unsigned int &, unsigned int &) const
virtual ~CscCondDbData()=default
bool m_onlineOfflinePhiFlip
std::vector< Identifier > m_cachedDeadLayersId
std::vector< unsigned int > m_cachedDeadChannelsHash
std::map< unsigned int, int > m_cachedChannelsStatus
IdContext m_moduleContext
StatusCode readChannelF001(IdentifierHash, float &) const
friend class CscCondDbAlg
void setDeadChannelHash(IdentifierHash)
CscCondDbData()=default
const std::vector< std::string > & getDeadLayers() const
std::map< unsigned int, float > m_cachedChannelsPSlope
std::map< unsigned int, float > m_cachedChannelsPed
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
This is a "hash" representation of an Identifier.