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 
11 
20 
22 
23 namespace ecaldqm {
24 
25  enum SMName {
88  };
89 
90  enum Constants {
91  nDCC = 54,
92  nEBDCC = 36,
93  nEEDCC = 18,
94  nDCCMEM = 44,
95  nEEDCCMEM = 8,
96 
97  nTTOuter = 16,
98  nTTInner = 28,
99  // These lines set the number of TriggerTowers in "outer" and "inner" TCCs,
100  // where "outer" := closer to the barrel. These constants are used in
101  // setting the binning. There are 16 trigger towers per TCC for "outer" TCCs,
102  // and 24 per TCC for "inner" TCCs (but the numbering is from 0 to 27, so
103  // 28 bins are required).
104 
105  nTCC = 108,
109  kEEpTCCHigh = 107,
110  kEBTCCLow = 36,
112 
115  };
116 
117  extern std::vector<unsigned> const memDCC;
118 
119  extern double const etaBound;
120 
121  // returns DCC ID (1 - 54)
122  unsigned dccId(DetId const &, EcalElectronicsMapping const *);
123  unsigned dccId(EcalElectronicsId const &);
124 
125  unsigned memDCCId(unsigned); // convert from dccId skipping DCCs without MEM
126  unsigned memDCCIndex(unsigned); // reverse conversion
127 
128  // returns TCC ID (1 - 108)
129  unsigned tccId(DetId const &, EcalElectronicsMapping const *);
130  unsigned tccId(EcalElectronicsId const &, EcalElectronicsMapping const *);
131 
132  // returns the data tower id - pass only
133  unsigned towerId(DetId const &, EcalElectronicsMapping const *);
134  unsigned towerId(EcalElectronicsId const &);
135 
136  unsigned ttId(DetId const &, EcalElectronicsMapping const *);
137  unsigned ttId(EcalElectronicsId const &, EcalElectronicsMapping const *);
138 
139  unsigned rtHalf(DetId const &, EcalElectronicsMapping const *);
140 
141  std::pair<unsigned, unsigned> innerTCCs(unsigned);
142  std::pair<unsigned, unsigned> outerTCCs(unsigned);
143 
144  std::vector<DetId> scConstituents(EcalScDetId const &);
145 
147 
148  unsigned dccId(std::string const &);
149  std::string smName(unsigned);
150 
151  int zside(DetId const &);
152 
153  double eta(EBDetId const &, CaloGeometry const *);
154  double eta(EEDetId const &, CaloGeometry const *);
155  double phi(EBDetId const &);
156  double phi(EEDetId const &);
157  double phi(EcalTrigTowerDetId const &);
158  double phi(double);
159 
160  bool isForward(DetId const &);
161 
162  bool isCrystalId(DetId const &);
163  bool isSingleChannelId(DetId const &);
164  bool isEcalScDetId(DetId const &);
165  bool isEndcapTTId(DetId const &);
166 
167  unsigned nCrystals(unsigned);
168  unsigned nSuperCrystals(unsigned);
169 
170  bool ccuExists(unsigned, unsigned);
171 } // namespace ecaldqm
172 
173 #endif
std::vector< unsigned > const memDCC
unsigned memDCCIndex(unsigned)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
double const etaBound
bool isForward(DetId const &)
std::pair< unsigned, unsigned > outerTCCs(unsigned)
int zside(DetId const &)
bool ccuExists(unsigned, unsigned)
unsigned nSuperCrystals(unsigned)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
bool isEndcapTTId(DetId const &)
unsigned nCrystals(unsigned)
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalPnDiodeDetId pnForCrystal(DetId const &, char, EcalElectronicsMapping const *)
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
bool isSingleChannelId(DetId const &)
Definition: DetId.h:17
std::string smName(unsigned)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
bool isCrystalId(DetId const &)
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)
std::pair< unsigned, unsigned > innerTCCs(unsigned)
double eta(EBDetId const &, CaloGeometry const *)
std::vector< DetId > scConstituents(EcalScDetId const &)
double phi(EBDetId const &)