CMS 3D CMS Logo

EcalDQMCommonUtils.h
Go to the documentation of this file.
1 #ifndef EcalDQMCommonUtils_H
2 #define EcalDQMCommonUtils_H
3 
4 #include <algorithm>
5 #include <cmath>
6 #include <iomanip>
7 
12 
21 
23 
24 namespace ecaldqm {
25 
26  enum SMName {
89  };
90 
91  enum Constants {
92  nDCC = 54,
93  nEBDCC = 36,
94  nEEDCC = 18,
95  nDCCMEM = 44,
96  nEEDCCMEM = 8,
97 
98  nTTOuter = 16,
99  nTTInner = 28,
100  // These lines set the number of TriggerTowers in "outer" and "inner" TCCs,
101  // where "outer" := closer to the barrel. These constants are used in
102  // setting the binning. There are 16 trigger towers per TCC for "outer" TCCs,
103  // and 24 per TCC for "inner" TCCs (but the numbering is from 0 to 27, so
104  // 28 bins are required).
105 
106  nTCC = 108,
110  kEEpTCCHigh = 107,
111  kEBTCCLow = 36,
113 
116  };
117 
118  extern std::vector<unsigned> const memDCC;
119 
120  extern double const etaBound;
121 
122  // returns DCC ID (1 - 54)
123  unsigned dccId(DetId const &);
124  unsigned dccId(EcalElectronicsId const &);
125 
126  unsigned memDCCId(unsigned); // convert from dccId skipping DCCs without MEM
127  unsigned memDCCIndex(unsigned); // reverse conversion
128 
129  // returns TCC ID (1 - 108)
130  unsigned tccId(DetId const &);
131  unsigned tccId(EcalElectronicsId const &);
132 
133  // returns the data tower id - pass only
134  unsigned towerId(DetId const &);
135  unsigned towerId(EcalElectronicsId const &);
136 
137  unsigned ttId(DetId const &);
138  unsigned ttId(EcalElectronicsId const &);
139 
140  unsigned rtHalf(DetId const &);
141 
142  std::pair<unsigned, unsigned> innerTCCs(unsigned);
143  std::pair<unsigned, unsigned> outerTCCs(unsigned);
144 
145  std::vector<DetId> scConstituents(EcalScDetId const &);
146 
147  EcalPnDiodeDetId pnForCrystal(DetId const &, char);
148 
149  unsigned dccId(std::string const &);
150  std::string smName(unsigned);
151 
152  int zside(DetId const &);
153 
154  double eta(EBDetId const &);
155  double eta(EEDetId const &);
156  double phi(EBDetId const &);
157  double phi(EEDetId const &);
158  double phi(EcalTrigTowerDetId const &);
159  double phi(double);
160 
161  bool isForward(DetId const &);
162 
163  bool isCrystalId(DetId const &);
164  bool isSingleChannelId(DetId const &);
165  bool isEcalScDetId(DetId const &);
166  bool isEndcapTTId(DetId const &);
167 
168  unsigned nCrystals(unsigned);
169  unsigned nSuperCrystals(unsigned);
170 
171  bool ccuExists(unsigned, unsigned);
172 
173  bool checkElectronicsMap(bool = true);
176 
177  bool checkTrigTowerMap(bool = true);
180 
181  bool checkGeometry(bool = true);
182  CaloGeometry const *getGeometry();
183  void setGeometry(CaloGeometry const *);
184 
185  bool checkTopology(bool = true);
186  CaloTopology const *getTopology();
187  void setTopology(CaloTopology const *);
188 } // namespace ecaldqm
189 
190 #endif
EcalElectronicsMapping
Definition: EcalElectronicsMapping.h:28
ecaldqm::kEBm02
Definition: EcalDQMCommonUtils.h:37
ecaldqm::getTopology
const CaloTopology * getTopology()
Definition: EcalDQMCommonUtils.cc:498
EcalElectronicsId.h
ecaldqm::kEBmHigh
Definition: EcalDQMCommonUtils.h:86
ecaldqm::tccId
unsigned tccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:56
ecaldqm::kEBm17
Definition: EcalDQMCommonUtils.h:52
ecaldqm
Definition: DQWorker.h:24
ecaldqm::kEBp06
Definition: EcalDQMCommonUtils.h:59
ecaldqm::kEEm09
Definition: EcalDQMCommonUtils.h:29
ecaldqm::kEEp09
Definition: EcalDQMCommonUtils.h:74
ecaldqm::kEBp05
Definition: EcalDQMCommonUtils.h:58
ecaldqm::outerTCCs
std::pair< unsigned, unsigned > outerTCCs(unsigned)
Definition: EcalDQMCommonUtils.cc:153
ecaldqm::kEBp02
Definition: EcalDQMCommonUtils.h:55
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
ecaldqm::kEBp10
Definition: EcalDQMCommonUtils.h:63
ecaldqm::kEBTCCLow
Definition: EcalDQMCommonUtils.h:111
EBDetId
Definition: EBDetId.h:17
ecaldqm::kEEm04
Definition: EcalDQMCommonUtils.h:33
ecaldqm::kEBp18
Definition: EcalDQMCommonUtils.h:71
ecaldqm::nSuperCrystals
unsigned nSuperCrystals(unsigned)
Definition: EcalDQMCommonUtils.cc:369
ecaldqm::kEEpHigh
Definition: EcalDQMCommonUtils.h:84
EBDetId.h
EEDetId.h
ecaldqm::nChannels
Definition: EcalDQMCommonUtils.h:114
ecaldqm::ttId
unsigned ttId(DetId const &)
Definition: EcalDQMCommonUtils.cc:101
ecaldqm::kEBm14
Definition: EcalDQMCommonUtils.h:49
ecaldqm::memDCCIndex
unsigned memDCCIndex(unsigned)
Definition: EcalDQMCommonUtils.cc:48
ecaldqm::nEBDCC
Definition: EcalDQMCommonUtils.h:93
ecaldqm::kEBp08
Definition: EcalDQMCommonUtils.h:61
ecaldqm::kEBm12
Definition: EcalDQMCommonUtils.h:47
ecaldqm::kEEm07
Definition: EcalDQMCommonUtils.h:27
ecaldqm::isEndcapTTId
bool isEndcapTTId(DetId const &)
Definition: EcalDQMCommonUtils.cc:270
ecaldqm::kEEp07
Definition: EcalDQMCommonUtils.h:72
ecaldqm::kEEmLow
Definition: EcalDQMCommonUtils.h:81
ecaldqm::kEEm01
Definition: EcalDQMCommonUtils.h:30
ecaldqm::kEEpTCCHigh
Definition: EcalDQMCommonUtils.h:110
EcalPnDiodeDetId
Definition: EcalPnDiodeDetId.h:22
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
ecaldqm::etaBound
const double etaBound
ecaldqm::kEBm18
Definition: EcalDQMCommonUtils.h:53
CaloTopology
Definition: CaloTopology.h:19
ecaldqm::isForward
bool isForward(DetId const &)
Definition: EcalDQMCommonUtils.cc:243
ecaldqm::kEBm10
Definition: EcalDQMCommonUtils.h:45
DetId
Definition: DetId.h:17
CaloGeometry
Definition: CaloGeometry.h:21
ecaldqm::kEBm15
Definition: EcalDQMCommonUtils.h:50
ecaldqm::kEBm05
Definition: EcalDQMCommonUtils.h:40
EEDetId::kSizeForDenseIndexing
Definition: EEDetId.h:329
ecaldqm::checkElectronicsMap
bool checkElectronicsMap(bool=true)
Definition: EcalDQMCommonUtils.cc:429
ecaldqm::kEBp07
Definition: EcalDQMCommonUtils.h:60
ecaldqm::kEBp04
Definition: EcalDQMCommonUtils.h:57
ecaldqm::kEBm08
Definition: EcalDQMCommonUtils.h:43
ecaldqm::kEBTCCHigh
Definition: EcalDQMCommonUtils.h:112
EcalScDetId
Definition: EcalScDetId.h:24
ecaldqm::ccuExists
bool ccuExists(unsigned, unsigned)
Definition: EcalDQMCommonUtils.cc:403
ecaldqm::kEEp02
Definition: EcalDQMCommonUtils.h:76
ecaldqm::kEEm03
Definition: EcalDQMCommonUtils.h:32
ecaldqm::kEBpHigh
Definition: EcalDQMCommonUtils.h:88
ecaldqm::getGeometry
const CaloGeometry * getGeometry()
Definition: EcalDQMCommonUtils.cc:478
ecaldqm::kEEmHigh
Definition: EcalDQMCommonUtils.h:82
ecaldqm::kEBm01
Definition: EcalDQMCommonUtils.h:36
ecaldqm::memDCCId
unsigned memDCCId(unsigned)
Definition: EcalDQMCommonUtils.cc:40
ecaldqm::rtHalf
unsigned rtHalf(DetId const &)
Definition: EcalDQMCommonUtils.cc:119
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
ecaldqm::setTopology
void setTopology(CaloTopology const *)
Definition: EcalDQMCommonUtils.cc:504
ecaldqm::kEEm08
Definition: EcalDQMCommonUtils.h:28
ecaldqm::nEEDCC
Definition: EcalDQMCommonUtils.h:94
ecaldqm::kEEp01
Definition: EcalDQMCommonUtils.h:75
EEDetId
Definition: EEDetId.h:14
ecaldqm::SMName
SMName
Definition: EcalDQMCommonUtils.h:26
EcalTrigTowerDetId.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ecaldqm::kEBp12
Definition: EcalDQMCommonUtils.h:65
EcalSubdetector.h
EcalTrigTowerConstituentsMap
Definition: EcalTrigTowerConstituentsMap.h:19
EcalPnDiodeDetId.h
ecaldqm::kEBm13
Definition: EcalDQMCommonUtils.h:48
ecaldqm::nEEDCCMEM
Definition: EcalDQMCommonUtils.h:96
ecaldqm::checkTopology
bool checkTopology(bool=true)
Definition: EcalDQMCommonUtils.cc:489
ecaldqm::nCrystals
unsigned nCrystals(unsigned)
Definition: EcalDQMCommonUtils.cc:334
ecaldqm::isSingleChannelId
bool isSingleChannelId(DetId const &)
Definition: EcalDQMCommonUtils.cc:262
ecaldqm::pnForCrystal
EcalPnDiodeDetId pnForCrystal(DetId const &, char)
Definition: EcalDQMCommonUtils2.cc:10
ecaldqm::kEBm11
Definition: EcalDQMCommonUtils.h:46
ecaldqm::kEBm06
Definition: EcalDQMCommonUtils.h:41
ecaldqm::setGeometry
void setGeometry(CaloGeometry const *)
Definition: EcalDQMCommonUtils.cc:484
ecaldqm::isEcalScDetId
bool isEcalScDetId(DetId const &)
Definition: EcalDQMCommonUtils.cc:266
EcalElectronicsMapping.h
ecaldqm::nTTOuter
Definition: EcalDQMCommonUtils.h:98
ecaldqm::kEEp05
Definition: EcalDQMCommonUtils.h:79
EcalTriggerElectronicsId.h
ecaldqm::kEEmTCCHigh
Definition: EcalDQMCommonUtils.h:108
ecaldqm::kEBmLow
Definition: EcalDQMCommonUtils.h:85
ecaldqm::kEEm05
Definition: EcalDQMCommonUtils.h:34
ecaldqm::kEBp16
Definition: EcalDQMCommonUtils.h:69
ecaldqm::kEBp01
Definition: EcalDQMCommonUtils.h:54
ecaldqm::nTTInner
Definition: EcalDQMCommonUtils.h:99
ecaldqm::checkTrigTowerMap
bool checkTrigTowerMap(bool=true)
Definition: EcalDQMCommonUtils.cc:449
ecaldqm::getTrigTowerMap
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
Definition: EcalDQMCommonUtils.cc:458
ecaldqm::kEBp11
Definition: EcalDQMCommonUtils.h:64
ecaldqm::kEBp13
Definition: EcalDQMCommonUtils.h:66
EcalTrigTowerDetId::kEBTotalTowers
Definition: EcalTrigTowerDetId.h:116
CaloTopology.h
ecaldqm::memDCC
const std::vector< unsigned > memDCC
ecaldqm::kEEp04
Definition: EcalDQMCommonUtils.h:78
ecaldqm::scConstituents
std::vector< DetId > scConstituents(EcalScDetId const &)
Definition: EcalDQMCommonUtils.cc:173
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
ecaldqm::kEBm16
Definition: EcalDQMCommonUtils.h:51
EcalTrigTowerConstituentsMap.h
ecaldqm::kEBp15
Definition: EcalDQMCommonUtils.h:68
ecaldqm::checkGeometry
bool checkGeometry(bool=true)
Definition: EcalDQMCommonUtils.cc:469
ecaldqm::kEBm04
Definition: EcalDQMCommonUtils.h:39
ecaldqm::Constants
Constants
Definition: EcalDQMCommonUtils.h:91
EcalScDetId.h
ecaldqm::kEEpLow
Definition: EcalDQMCommonUtils.h:83
CaloGeometry.h
ecaldqm::kEBm09
Definition: EcalDQMCommonUtils.h:44
ecaldqm::kEEmTCCLow
Definition: EcalDQMCommonUtils.h:107
ecaldqm::smName
std::string smName(unsigned)
Definition: EcalDQMCommonUtils.cc:289
EBDetId::kSizeForDenseIndexing
Definition: EBDetId.h:155
Exception.h
ecaldqm::kEEpTCCLow
Definition: EcalDQMCommonUtils.h:109
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92
EcalScDetId::kSizeForDenseIndexing
Definition: EcalScDetId.h:188
ecaldqm::kEEp03
Definition: EcalDQMCommonUtils.h:77
ecaldqm::nTCC
Definition: EcalDQMCommonUtils.h:106
ecaldqm::kEBm07
Definition: EcalDQMCommonUtils.h:42
ecaldqm::isCrystalId
bool isCrystalId(DetId const &)
Definition: EcalDQMCommonUtils.cc:257
ecaldqm::kEEp06
Definition: EcalDQMCommonUtils.h:80
ecaldqm::innerTCCs
std::pair< unsigned, unsigned > innerTCCs(unsigned)
Definition: EcalDQMCommonUtils.cc:133
ecaldqm::getElectronicsMap
const EcalElectronicsMapping * getElectronicsMap()
Definition: EcalDQMCommonUtils.cc:438
ecaldqm::kEBpLow
Definition: EcalDQMCommonUtils.h:87
ecaldqm::nTowers
Definition: EcalDQMCommonUtils.h:115
ecaldqm::nDCCMEM
Definition: EcalDQMCommonUtils.h:95
ecaldqm::kEEm02
Definition: EcalDQMCommonUtils.h:31
ecaldqm::kEEm06
Definition: EcalDQMCommonUtils.h:35
ecaldqm::setTrigTowerMap
void setTrigTowerMap(EcalTrigTowerConstituentsMap const *)
Definition: EcalDQMCommonUtils.cc:464
ecaldqm::kEBp03
Definition: EcalDQMCommonUtils.h:56
ecaldqm::setElectronicsMap
void setElectronicsMap(EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:444
ecaldqm::kEBp09
Definition: EcalDQMCommonUtils.h:62
ecaldqm::kEBp17
Definition: EcalDQMCommonUtils.h:70
ecaldqm::phi
double phi(EBDetId const &)
Definition: EcalDQMCommonUtils.cc:215
ecaldqm::kEBm03
Definition: EcalDQMCommonUtils.h:38
ecaldqm::kEEp08
Definition: EcalDQMCommonUtils.h:73
ecaldqm::eta
double eta(EBDetId const &)
Definition: EcalDQMCommonUtils.cc:209
ecaldqm::dccId
unsigned dccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:16
ecaldqm::kEBp14
Definition: EcalDQMCommonUtils.h:67