Go to the documentation of this file.00001 #ifndef NUMBERS_H
00002 #define NUMBERS_H
00003
00012 #include <string>
00013 #include <stdexcept>
00014 #include <vector>
00015
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017
00018 #include "DataFormats/DetId/interface/DetId.h"
00019 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00020
00021 class DetId;
00022 class EBDetId;
00023 class EEDetId;
00024
00025 class EcalTrigTowerDetId;
00026 class EcalElectronicsId;
00027 class EcalPnDiodeDetId;
00028 class EcalScDetId;
00029
00030 class EcalDCCHeaderBlock;
00031
00032 class EcalElectronicsMapping;
00033 class EcalTrigTowerConstituentsMap;
00034
00035 class CaloGeometry;
00036
00037 class Numbers {
00038
00039 public:
00040
00041 static void initGeometry( const edm::EventSetup& setup, bool verbose = false );
00042
00043 static int iEB( const unsigned ism );
00044
00045 static std::string sEB( const unsigned ism );
00046
00047 static int iEE( const unsigned ism );
00048
00049 static std::string sEE( const unsigned ism );
00050
00051 static EcalSubdetector subDet( const EBDetId& id );
00052
00053 static EcalSubdetector subDet( const EEDetId& id );
00054
00055 static EcalSubdetector subDet( const EcalTrigTowerDetId& id );
00056
00057 static EcalSubdetector subDet( const EcalScDetId& id );
00058
00059 static EcalSubdetector subDet( const EcalElectronicsId& id );
00060
00061 static EcalSubdetector subDet( const EcalPnDiodeDetId& id );
00062
00063 static EcalSubdetector subDet( const EcalDCCHeaderBlock& id );
00064
00065
00066 static unsigned iSM( const unsigned ism, const EcalSubdetector subdet );
00067
00068 static unsigned iSM( const EBDetId& id );
00069
00070 static unsigned iSM( const EEDetId& id );
00071
00072 static unsigned iSM( const EcalTrigTowerDetId& id );
00073
00074 static unsigned iSM( const EcalElectronicsId& id );
00075
00076 static unsigned iSM( const EcalPnDiodeDetId& id );
00077
00078 static unsigned iSM( const EcalScDetId& id );
00079
00080 static unsigned iSM( const EcalDCCHeaderBlock& id, const EcalSubdetector subdet );
00081
00082 static unsigned iSC( const EcalScDetId& id );
00083
00084 static unsigned iSC( const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2 );
00085
00086 static unsigned iTT( const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2 );
00087
00088 static unsigned iTT( const EcalTrigTowerDetId& id );
00089
00090 static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2);
00091
00092 static unsigned iTCC(const EcalTrigTowerDetId& id);
00093
00094 static std::vector<DetId>* crystals( const EcalTrigTowerDetId& id );
00095
00096 static std::vector<DetId>* crystals( const EcalElectronicsId& id );
00097
00098 static std::vector<DetId>* crystals( unsigned idcc, unsigned isc );
00099
00100 static const EcalScDetId getEcalScDetId( const EEDetId& id );
00101
00102 static unsigned indexEB( const unsigned ism, const unsigned ie, const unsigned ip );
00103
00104 static unsigned indexEE( const unsigned ism, const unsigned ix, const unsigned iy );
00105
00106 static unsigned icEB( const unsigned ism, const unsigned ix, const unsigned iy );
00107
00108 static unsigned icEE( const unsigned ism, const unsigned ix, const unsigned iy );
00109
00110 static unsigned RtHalf(const EBDetId& id);
00111
00112 static unsigned RtHalf(const EEDetId& id);
00113
00114 static int ix0EE( const unsigned ism );
00115
00116
00117 static int ix0EEm( const unsigned ism );
00118
00119 static int iy0EE( const unsigned ism );
00120
00121 static bool validEE( const unsigned ism, const unsigned ix, const unsigned iy );
00122
00123 static bool validEESc( const unsigned ism, const unsigned ix, const unsigned iy );
00124
00125 static unsigned nCCUs(const unsigned ism);
00126
00127 static unsigned nTTs(const unsigned itcc);
00128
00129 static const EcalElectronicsMapping* getElectronicsMapping();
00130
00131
00132 static float eta( const DetId &id );
00133 static float phi( const DetId &id );
00134
00135 private:
00136
00137 Numbers() {};
00138 ~Numbers() {};
00139
00140 static bool init;
00141
00142 static const EcalElectronicsMapping* map;
00143 static const EcalTrigTowerConstituentsMap* mapTT;
00144
00145 static const CaloGeometry *geometry;
00146
00147 static const unsigned crystalsTCCArraySize_ = 100 * 108;
00148 static const unsigned crystalsDCCArraySize_ = 100 * 54;
00149
00150 static std::vector<DetId> crystalsTCC_[crystalsTCCArraySize_];
00151 static std::vector<DetId> crystalsDCC_[crystalsDCCArraySize_];
00152
00153 };
00154
00155 #endif // NUMBERS_H