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 int ism ) throw( std::runtime_error );
00044
00045 static std::string sEB( const int ism );
00046
00047 static int iEE( const int ism ) throw( std::runtime_error );
00048
00049 static std::string sEE( const int 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 ) throw( std::runtime_error );
00064
00065 static int iSM( const int ism, const EcalSubdetector subdet ) throw( std::runtime_error );
00066
00067 static int iSM( const EBDetId& id ) throw( std::runtime_error );
00068
00069 static int iSM( const EEDetId& id ) throw( std::runtime_error );
00070
00071 static int iSM( const EcalTrigTowerDetId& id ) throw( std::runtime_error );
00072
00073 static int iSM( const EcalElectronicsId& id ) throw( std::runtime_error );
00074
00075 static int iSM( const EcalPnDiodeDetId& id ) throw( std::runtime_error );
00076
00077 static int iSM( const EcalScDetId& id ) throw( std::runtime_error );
00078
00079 static int iSM( const EcalDCCHeaderBlock& id, const EcalSubdetector subdet ) throw( std::runtime_error );
00080
00081 static int iSC( const EcalScDetId& id ) throw( std::runtime_error );
00082
00083 static int iSC( const int ism, const EcalSubdetector subdet, const int i1, const int i2 ) throw( std::runtime_error );
00084
00085 static int iTT( const int ism, const EcalSubdetector subdet, const int i1, const int i2 ) throw( std::runtime_error );
00086
00087 static int iTT( const EcalTrigTowerDetId& id ) throw( std::runtime_error );
00088
00089 static int iTCC(const int ism, const EcalSubdetector subdet, const int i1, const int i2) throw( std::runtime_error );
00090
00091 static int iTCC(const EcalTrigTowerDetId& id) throw( std::runtime_error );
00092
00093 static std::vector<DetId>* crystals( const EcalTrigTowerDetId& id ) throw( std::runtime_error );
00094
00095 static std::vector<DetId>* crystals( const EcalElectronicsId& id ) throw( std::runtime_error );
00096
00097 static std::vector<DetId>* crystals( int idcc, int isc ) throw( std::runtime_error );
00098
00099 static const EcalScDetId getEcalScDetId( const EEDetId& id ) throw( std::runtime_error );
00100
00101 static int indexEB( const int ism, const int ie, const int ip );
00102
00103 static int indexEE( const int ism, const int ix, const int iy );
00104
00105 static int icEB( const int ism, const int ix, const int iy );
00106
00107 static int icEE( const int ism, const int ix, const int iy ) throw( std::runtime_error );
00108
00109 static int RtHalf(const EBDetId& id);
00110
00111 static int RtHalf(const EEDetId& id);
00112
00113 static int ix0EE( const int ism );
00114
00115
00116 static int ix0EEm( const int ism );
00117
00118 static int iy0EE( const int ism );
00119
00120 static bool validEE( const int ism, const int ix, const int iy );
00121
00122 static bool validEESc( const int ism, const int ix, const int iy );
00123
00124 static const EcalElectronicsMapping* getElectronicsMapping() throw( std::runtime_error );
00125
00126
00127 static float eta( const DetId &id );
00128 static float phi( const DetId &id );
00129
00130 private:
00131
00132 Numbers() {};
00133 ~Numbers() {};
00134
00135 static bool init;
00136
00137 static const EcalElectronicsMapping* map;
00138 static const EcalTrigTowerConstituentsMap* mapTT;
00139
00140 static const CaloGeometry *geometry;
00141
00142 static std::vector<DetId> crystalsTCC_[100*108];
00143 static std::vector<DetId> crystalsDCC_[100* 54];
00144
00145 };
00146
00147 #endif // NUMBERS_H