ATLAS Offline Software
Loading...
Searching...
No Matches
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
17#include "Identifier/Identifier.h"
19
20//forward declarations
21class CscIdHelper;
22
23
25
26 friend class CscCondDbAlg;
27
28public:
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);
42 void setChannelT0Base (IdentifierHash, float);
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
68 StatusCode readChannelF001 (IdentifierHash, float&) const;
69 StatusCode readChannelNoise (IdentifierHash, float&) const;
70 StatusCode readChannelPed (IdentifierHash, float&) const;
71 StatusCode readChannelPSlope (IdentifierHash, float&) const;
72 StatusCode readChannelRMS (IdentifierHash, float&) const;
73 StatusCode readChannelStatus (IdentifierHash, int& ) const;
74 StatusCode readChannelT0Base (IdentifierHash, float&) const;
75 StatusCode readChannelT0Phase(IdentifierHash, bool& ) const;
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
89private:
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
124public:
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
142CLASS_DEF( CscCondDbData, 10742890, 1)
143CLASS_DEF( CondCont<CscCondDbData>, 43297256, 0)
144
145#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 indexToStringId(const CscIdHelper *, const unsigned int &, const std::string &, std::string &) 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
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.