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
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
EcalElectronicsMapping const * getElectronicsMap()
unsigned tccId(DetId const &)
bool isForward(DetId const &)
std::pair< unsigned, unsigned > outerTCCs(unsigned)
int zside(DetId const &)
bool ccuExists(unsigned, unsigned)
CaloGeometry const * getGeometry()
unsigned ttId(DetId const &)
unsigned nSuperCrystals(unsigned)
bool isEndcapTTId(DetId const &)
unsigned nCrystals(unsigned)
CaloTopology const * getTopology()
bool checkElectronicsMap(bool=true)
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
EcalPnDiodeDetId pnForCrystal(DetId const &, char)
void setGeometry(CaloGeometry const *)
unsigned rtHalf(DetId const &)
unsigned towerId(DetId const &)
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
bool isSingleChannelId(DetId const &)
Definition: DetId.h:17
void setTopology(CaloTopology const *)
std::string smName(unsigned)
bool checkTopology(bool=true)
bool checkTrigTowerMap(bool=true)
bool isCrystalId(DetId const &)
void setElectronicsMap(EcalElectronicsMapping const *)
std::pair< unsigned, unsigned > innerTCCs(unsigned)
std::vector< DetId > scConstituents(EcalScDetId const &)
void setTrigTowerMap(EcalTrigTowerConstituentsMap const *)
bool checkGeometry(bool=true)
unsigned dccId(DetId const &)
double eta(EBDetId const &)
double phi(EBDetId const &)