CMS 3D CMS Logo

EcalDQMCommonUtils.h
Go to the documentation of this file.
1 #ifndef EcalDQMCommonUtils_H
2 #define EcalDQMCommonUtils_H
3 
4 #include <iomanip>
5 #include <algorithm>
6 #include <cmath>
7 
12 
21 
23 
24 namespace ecaldqm {
25 
26  enum SMName {
36  kEBpLow = kEBp01, kEBpHigh = kEBp18
37  };
38 
39  enum Constants {
40  nDCC = 54,
41  nEBDCC = 36,
42  nEEDCC = 18,
43  nDCCMEM = 44,
44  nEEDCCMEM = 8,
45 
46  nTTOuter = 16,
47  nTTInner = 28,
48  // These lines set the number of TriggerTowers in "outer" and "inner" TCCs,
49  // where "outer" := closer to the barrel. These constants are used in
50  // setting the binning. There are 16 trigger towers per TCC for "outer" TCCs,
51  // and 24 per TCC for "inner" TCCs (but the numbering is from 0 to 27, so
52  // 28 bins are required).
53 
54  nTCC = 108,
56  kEEpTCCLow = 72, kEEpTCCHigh = 107,
57  kEBTCCLow = 36, kEBTCCHigh = 71,
58 
61  };
62 
63  extern std::vector<unsigned> const memDCC;
64 
65  extern double const etaBound;
66 
67  // returns DCC ID (1 - 54)
68  unsigned dccId(DetId const&);
69  unsigned dccId(EcalElectronicsId const&);
70 
71  unsigned memDCCId(unsigned); // convert from dccId skipping DCCs without MEM
72  unsigned memDCCIndex(unsigned); // reverse conversion
73 
74  // returns TCC ID (1 - 108)
75  unsigned tccId(DetId const&);
76  unsigned tccId(EcalElectronicsId const&);
77 
78  // returns the data tower id - pass only
79  unsigned towerId(DetId const&);
80  unsigned towerId(EcalElectronicsId const&);
81 
82  unsigned ttId(DetId const&);
83  unsigned ttId(EcalElectronicsId const&);
84 
85  unsigned rtHalf(DetId const&);
86 
87  std::pair<unsigned, unsigned> innerTCCs(unsigned);
88  std::pair<unsigned, unsigned> outerTCCs(unsigned);
89 
90  std::vector<DetId> scConstituents(EcalScDetId const&);
91 
92  EcalPnDiodeDetId pnForCrystal(DetId const&, char);
93 
94  unsigned dccId(std::string const&);
95  std::string smName(unsigned);
96 
97  int zside(DetId const&);
98 
99  double eta(EBDetId const&);
100  double eta(EEDetId const&);
101  double phi(EBDetId const&);
102  double phi(EEDetId const&);
103  double phi(EcalTrigTowerDetId const&);
104  double phi(double);
105 
106  bool isForward(DetId const&);
107 
108  bool isCrystalId(DetId const&);
109  bool isSingleChannelId(DetId const&);
110  bool isEcalScDetId(DetId const&);
111  bool isEndcapTTId(DetId const&);
112 
113  unsigned nCrystals(unsigned);
114  unsigned nSuperCrystals(unsigned);
115 
116  bool ccuExists(unsigned, unsigned);
117 
118  bool checkElectronicsMap(bool = true);
121 
122  bool checkTrigTowerMap(bool = true);
125 
126  bool checkGeometry(bool = true);
127  CaloGeometry const* getGeometry();
128  void setGeometry(CaloGeometry const*);
129 
130  bool checkTopology(bool = true);
131  CaloTopology const* getTopology();
132  void setTopology(CaloTopology const*);
133 }
134 
135 #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:18
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 &)