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 
10 #include <string>
11 #include <stdexcept>
12 #include <vector>
13 
15 
18 
19 class DetId;
20 class EBDetId;
21 class EEDetId;
22 
23 class EcalTrigTowerDetId;
24 class EcalElectronicsId;
25 class EcalPnDiodeDetId;
26 class EcalScDetId;
27 
28 class EcalDCCHeaderBlock;
29 
32 
33 class CaloGeometry;
34 
35 class Numbers {
36 
37  public:
38 
39  static void initGeometry( const edm::EventSetup& setup, bool verbose = false );
40 
41  static int iEB( const unsigned ism );
42 
43  static std::string sEB( const unsigned ism );
44 
45  static int iEE( const unsigned ism );
46 
47  static std::string sEE( const unsigned ism );
48 
49  static EcalSubdetector subDet( const EBDetId& id );
50 
51  static EcalSubdetector subDet( const EEDetId& id );
52 
53  static EcalSubdetector subDet( const EcalTrigTowerDetId& id );
54 
55  static EcalSubdetector subDet( const EcalScDetId& id );
56 
57  static EcalSubdetector subDet( const EcalElectronicsId& id );
58 
59  static EcalSubdetector subDet( const EcalPnDiodeDetId& id );
60 
61  static EcalSubdetector subDet( const EcalDCCHeaderBlock& id );
62 
63  // for EB, converts between two schemes. Old scheme [1:9] for EB-, new scheme (used in EBDetId) [1:9] for EB+
64  static unsigned iSM( const unsigned ism, const EcalSubdetector subdet );
65 
66  static unsigned iSM( const EBDetId& id );
67 
68  static unsigned iSM( const EEDetId& id );
69 
70  static unsigned iSM( const EcalTrigTowerDetId& id );
71 
72  static unsigned iSM( const EcalElectronicsId& id );
73 
74  static unsigned iSM( const EcalPnDiodeDetId& id );
75 
76  static unsigned iSM( const EcalScDetId& id );
77 
78  static unsigned iSM( const EcalDCCHeaderBlock& id, const EcalSubdetector subdet );
79 
80  static unsigned iSC( const EcalScDetId& id );
81 
82  static unsigned iSC( const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2 );
83 
84  static unsigned iTT( const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2 );
85 
86  static unsigned iTT( const EcalTrigTowerDetId& id );
87 
88  static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2);
89 
90  static unsigned iTCC(const EcalTrigTowerDetId& id);
91 
92  static std::vector<DetId>* crystals( const EcalTrigTowerDetId& id );
93 
94  static std::vector<DetId>* crystals( const EcalElectronicsId& id );
95 
96  static std::vector<DetId>* crystals( unsigned idcc, unsigned isc );
97 
98  static const EcalScDetId getEcalScDetId( const EEDetId& id );
99 
100  static unsigned indexEB( const unsigned ism, const unsigned ie, const unsigned ip );
101 
102  static unsigned indexEE( const unsigned ism, const unsigned ix, const unsigned iy );
103 
104  static unsigned icEB( const unsigned ism, const unsigned ix, const unsigned iy );
105 
106  static unsigned icEE( const unsigned ism, const unsigned ix, const unsigned iy );
107 
108  static unsigned RtHalf(const EBDetId& id);
109 
110  static unsigned RtHalf(const EEDetId& id);
111 
112  static int ix0EE( const unsigned ism );
113 
114  // returns ix0 in negative-number scheme for EE- instead of 101-ix
115  static int ix0EEm( const unsigned ism );
116 
117  static int iy0EE( const unsigned ism );
118 
119  static bool validEE( const unsigned ism, const unsigned ix, const unsigned iy );
120 
121  static bool validEESc( const unsigned ism, const unsigned ix, const unsigned iy );
122 
123  static unsigned nCCUs(const unsigned ism);
124 
125  static unsigned nTTs(const unsigned itcc);
126 
128 
129  // temporary - this is not really an "id conversion" - must find a better place to implement
130  static float eta( const DetId &id );
131  static float phi( const DetId &id );
132 
133 private:
134 
135  Numbers() {}; // Hidden to force static use
136  ~Numbers() {}; // Hidden to force static use
137 
138  static bool init;
139 
142 
143  static const CaloGeometry *geometry;
144 
145  static const unsigned crystalsTCCArraySize_ = 100 * 108;
146  static const unsigned crystalsDCCArraySize_ = 100 * 54;
147 
148  static std::vector<DetId> crystalsTCC_[crystalsTCCArraySize_];
149  static std::vector<DetId> crystalsDCC_[crystalsDCCArraySize_];
150 
151 };
152 
153 #endif // NUMBERS_H
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
static const unsigned crystalsTCCArraySize_
Definition: Numbers.h:145
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:829
static int iEE(const unsigned ism)
Definition: Numbers.cc:110
static int ix0EEm(const unsigned ism)
Definition: Numbers.cc:790
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:736
static unsigned nCCUs(const unsigned ism)
Definition: Numbers.cc:872
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
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:852
static unsigned nTTs(const unsigned itcc)
Definition: Numbers.cc:903
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
static bool init
Definition: Numbers.h:136
static const EcalElectronicsMapping * getElectronicsMapping()
Definition: Numbers.cc:916
static unsigned icEB(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:726
static std::vector< DetId > crystalsDCC_[crystalsDCCArraySize_]
Definition: Numbers.h:149
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
static const EcalElectronicsMapping * map
Definition: Numbers.h:140
static std::vector< DetId > * crystals(const EcalTrigTowerDetId &id)
Definition: Numbers.cc:582
static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
Definition: Numbers.cc:531
static unsigned iSC(const EcalScDetId &id)
Definition: Numbers.cc:434
static unsigned indexEB(const unsigned ism, const unsigned ie, const unsigned ip)
Definition: Numbers.cc:695
Definition: DetId.h:18
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
static float eta(const DetId &id)
Definition: Numbers.cc:926
~Numbers()
Definition: Numbers.h:136
static unsigned indexEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:709
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
static const EcalTrigTowerConstituentsMap * mapTT
Definition: Numbers.h:141
static std::vector< DetId > crystalsTCC_[crystalsTCCArraySize_]
Definition: Numbers.h:148
static const unsigned crystalsDCCArraySize_
Definition: Numbers.h:146
static unsigned RtHalf(const EBDetId &id)
Definition: Numbers.cc:605
static const EcalScDetId getEcalScDetId(const EEDetId &id)
Definition: Numbers.cc:676
static int iEB(const unsigned ism)
Definition: Numbers.cc:75
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:142
EcalSubdetector
static const CaloGeometry * geometry
Definition: Numbers.h:143
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Numbers()
Definition: Numbers.h:135
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:482
static float phi(const DetId &id)
Definition: Numbers.cc:933