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  static constexpr int nDCC = 54, nEBDCC = 36, nEEDCC = 18, nDCCMEM = 44, nEEDCCMEM = 8;
91 
92  // These lines set the number of TriggerTowers in "outer" and "inner" TCCs,
93  // where "outer" := closer to the barrel. These constants are used in
94  // setting the binning. There are 16 trigger towers per TCC for "outer" TCCs,
95  // and 24 per TCC for "inner" TCCs (but the numbering is from 0 to 27, so
96  // 28 bins are required).
97  static constexpr int nTTOuter = 16, nTTInner = 28;
98 
99  static constexpr int nTCC = 108, kEEmTCCLow = 0, kEEmTCCHigh = 35, kEEpTCCLow = 72, kEEpTCCHigh = 107, kEBTCCLow = 36,
102 
103  extern std::vector<unsigned> const memDCC;
104 
105  extern double const etaBound;
106 
107  // returns DCC ID (1 - 54)
108  unsigned dccId(DetId const &, EcalElectronicsMapping const *);
109  unsigned dccId(EcalElectronicsId const &);
110 
111  unsigned memDCCId(unsigned); // convert from dccId skipping DCCs without MEM
112  unsigned memDCCIndex(unsigned); // reverse conversion
113 
114  // returns TCC ID (1 - 108)
115  unsigned tccId(DetId const &, EcalElectronicsMapping const *);
116  unsigned tccId(EcalElectronicsId const &, EcalElectronicsMapping const *);
117 
118  // returns the data tower id - pass only
119  unsigned towerId(DetId const &, EcalElectronicsMapping const *);
120  unsigned towerId(EcalElectronicsId const &);
121 
122  unsigned ttId(DetId const &, EcalElectronicsMapping const *);
123  unsigned ttId(EcalElectronicsId const &, EcalElectronicsMapping const *);
124 
125  unsigned rtHalf(DetId const &, EcalElectronicsMapping const *);
126 
127  std::pair<unsigned, unsigned> innerTCCs(unsigned);
128  std::pair<unsigned, unsigned> outerTCCs(unsigned);
129 
130  std::vector<DetId> scConstituents(EcalScDetId const &);
131 
133 
134  unsigned dccId(std::string const &);
135  std::string smName(unsigned);
136 
137  int zside(DetId const &);
138 
139  double eta(EBDetId const &, CaloGeometry const *);
140  double eta(EEDetId const &, CaloGeometry const *);
141  double phi(EBDetId const &);
142  double phi(EEDetId const &);
143  double phi(EcalTrigTowerDetId const &);
144  double phi(double);
145 
146  bool isForward(DetId const &);
147 
148  bool isCrystalId(DetId const &);
149  bool isSingleChannelId(DetId const &);
150  bool isEcalScDetId(DetId const &);
151  bool isEndcapTTId(DetId const &);
152 
153  unsigned nCrystals(unsigned);
154  unsigned nSuperCrystals(unsigned);
155 
156  bool ccuExists(unsigned, unsigned);
157 } // namespace ecaldqm
158 
159 #endif
std::vector< unsigned > const memDCC
static constexpr int kSizeForDenseIndexing
Definition: EEDetId.h:328
unsigned memDCCIndex(unsigned)
static constexpr int nEBDCC
static constexpr int kEBTotalTowers
static constexpr int nTCC
static constexpr int nTowers
static constexpr int kEBTCCLow
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)
static constexpr int nTTOuter
unsigned nSuperCrystals(unsigned)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
static constexpr int kEEmTCCHigh
bool isEndcapTTId(DetId const &)
unsigned nCrystals(unsigned)
static constexpr int nChannels
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
static constexpr int kEEpTCCLow
static constexpr int kSizeForDenseIndexing
Definition: EBDetId.h:155
static constexpr int nEEDCC
static constexpr int nDCCMEM
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalPnDiodeDetId pnForCrystal(DetId const &, char, EcalElectronicsMapping const *)
static constexpr int kEEmTCCLow
static constexpr int nEEDCCMEM
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
static constexpr int kEBTCCHigh
bool isSingleChannelId(DetId const &)
Definition: DetId.h:17
static constexpr int nDCC
std::string smName(unsigned)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
bool isCrystalId(DetId const &)
static constexpr int kEEpTCCHigh
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)
static constexpr int nTTInner
std::pair< unsigned, unsigned > innerTCCs(unsigned)
double eta(EBDetId const &, CaloGeometry const *)
std::vector< DetId > scConstituents(EcalScDetId const &)
double phi(EBDetId const &)