CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Numbers.h
Go to the documentation of this file.
1 #ifndef NUMBERS_H
2 #define NUMBERS_H
3 
12 #include <string>
13 #include <stdexcept>
14 #include <vector>
15 
17 
20 
21 class DetId;
22 class EBDetId;
23 class EEDetId;
24 
25 class EcalTrigTowerDetId;
26 class EcalElectronicsId;
27 class EcalPnDiodeDetId;
28 class EcalScDetId;
29 
30 class EcalDCCHeaderBlock;
31 
34 
35 class CaloGeometry;
36 
37 class Numbers {
38 
39  public:
40 
41  static void initGeometry( const edm::EventSetup& setup, bool verbose = false );
42 
43  static int iEB( const unsigned ism );
44 
45  static std::string sEB( const unsigned ism );
46 
47  static int iEE( const unsigned ism );
48 
49  static std::string sEE( const unsigned ism );
50 
51  static EcalSubdetector subDet( const EBDetId& id );
52 
53  static EcalSubdetector subDet( const EEDetId& id );
54 
55  static EcalSubdetector subDet( const EcalTrigTowerDetId& id );
56 
57  static EcalSubdetector subDet( const EcalScDetId& id );
58 
59  static EcalSubdetector subDet( const EcalElectronicsId& id );
60 
61  static EcalSubdetector subDet( const EcalPnDiodeDetId& id );
62 
63  static EcalSubdetector subDet( const EcalDCCHeaderBlock& id );
64 
65  // for EB, converts between two schemes. Old scheme [1:9] for EB-, new scheme (used in EBDetId) [1:9] for EB+
66  static unsigned iSM( const unsigned ism, const EcalSubdetector subdet );
67 
68  static unsigned iSM( const EBDetId& id );
69 
70  static unsigned iSM( const EEDetId& id );
71 
72  static unsigned iSM( const EcalTrigTowerDetId& id );
73 
74  static unsigned iSM( const EcalElectronicsId& id );
75 
76  static unsigned iSM( const EcalPnDiodeDetId& id );
77 
78  static unsigned iSM( const EcalScDetId& id );
79 
80  static unsigned iSM( const EcalDCCHeaderBlock& id, const EcalSubdetector subdet );
81 
82  static unsigned iSC( const EcalScDetId& id );
83 
84  static unsigned iSC( const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2 );
85 
86  static unsigned iTT( const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2 );
87 
88  static unsigned iTT( const EcalTrigTowerDetId& id );
89 
90  static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2);
91 
92  static unsigned iTCC(const EcalTrigTowerDetId& id);
93 
94  static std::vector<DetId>* crystals( const EcalTrigTowerDetId& id );
95 
96  static std::vector<DetId>* crystals( const EcalElectronicsId& id );
97 
98  static std::vector<DetId>* crystals( unsigned idcc, unsigned isc );
99 
100  static const EcalScDetId getEcalScDetId( const EEDetId& id );
101 
102  static unsigned indexEB( const unsigned ism, const unsigned ie, const unsigned ip );
103 
104  static unsigned indexEE( const unsigned ism, const unsigned ix, const unsigned iy );
105 
106  static unsigned icEB( const unsigned ism, const unsigned ix, const unsigned iy );
107 
108  static unsigned icEE( const unsigned ism, const unsigned ix, const unsigned iy );
109 
110  static unsigned RtHalf(const EBDetId& id);
111 
112  static unsigned RtHalf(const EEDetId& id);
113 
114  static int ix0EE( const unsigned ism );
115 
116  // returns ix0 in negative-number scheme for EE- instead of 101-ix
117  static int ix0EEm( const unsigned ism );
118 
119  static int iy0EE( const unsigned ism );
120 
121  static bool validEE( const unsigned ism, const unsigned ix, const unsigned iy );
122 
123  static bool validEESc( const unsigned ism, const unsigned ix, const unsigned iy );
124 
125  static unsigned nCCUs(const unsigned ism);
126 
127  static unsigned nTTs(const unsigned itcc);
128 
130 
131  // temporary - this is not really an "id conversion" - must find a better place to implement
132  static float eta( const DetId &id );
133  static float phi( const DetId &id );
134 
135 private:
136 
137  Numbers() {}; // Hidden to force static use
138  ~Numbers() {}; // Hidden to force static use
139 
140  static bool init;
141 
144 
145  static const CaloGeometry *geometry;
146 
147  static const unsigned crystalsTCCArraySize_ = 100 * 108;
148  static const unsigned crystalsDCCArraySize_ = 100 * 54;
149 
150  static std::vector<DetId> crystalsTCC_[crystalsTCCArraySize_];
151  static std::vector<DetId> crystalsDCC_[crystalsDCCArraySize_];
152 
153 };
154 
155 #endif // NUMBERS_H
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:226
static const unsigned crystalsTCCArraySize_
Definition: Numbers.h:147
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:832
static int iEE(const unsigned ism)
Definition: Numbers.cc:113
static int ix0EEm(const unsigned ism)
Definition: Numbers.cc:793
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:739
static unsigned nCCUs(const unsigned ism)
Definition: Numbers.cc:875
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
static bool validEESc(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:855
static unsigned nTTs(const unsigned itcc)
Definition: Numbers.cc:906
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:773
static bool init
Definition: Numbers.h:138
static const EcalElectronicsMapping * getElectronicsMapping()
Definition: Numbers.cc:919
static unsigned icEB(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:729
static std::vector< DetId > crystalsDCC_[crystalsDCCArraySize_]
Definition: Numbers.h:151
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:812
static const EcalElectronicsMapping * map
Definition: Numbers.h:142
static std::vector< DetId > * crystals(const EcalTrigTowerDetId &id)
Definition: Numbers.cc:585
static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
Definition: Numbers.cc:534
static unsigned iSC(const EcalScDetId &id)
Definition: Numbers.cc:437
static unsigned indexEB(const unsigned ism, const unsigned ie, const unsigned ip)
Definition: Numbers.cc:698
Definition: DetId.h:20
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:50
static float eta(const DetId &id)
Definition: Numbers.cc:929
~Numbers()
Definition: Numbers.h:138
static unsigned indexEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:712
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
static const EcalTrigTowerConstituentsMap * mapTT
Definition: Numbers.h:143
static std::vector< DetId > crystalsTCC_[crystalsTCCArraySize_]
Definition: Numbers.h:150
static const unsigned crystalsDCCArraySize_
Definition: Numbers.h:148
static unsigned RtHalf(const EBDetId &id)
Definition: Numbers.cc:608
static const EcalScDetId getEcalScDetId(const EEDetId &id)
Definition: Numbers.cc:679
static int iEB(const unsigned ism)
Definition: Numbers.cc:78
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:145
EcalSubdetector
static const CaloGeometry * geometry
Definition: Numbers.h:145
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Numbers()
Definition: Numbers.h:137
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
static unsigned iTT(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
Definition: Numbers.cc:485
static float phi(const DetId &id)
Definition: Numbers.cc:936