00001
00002
00011 #ifndef Numbers_H
00012 #define Numbers_H
00013
00014 #include <string>
00015 #include <stdexcept>
00016 #include <vector>
00017
00018 #include "FWCore/Framework/interface/EventSetup.h"
00019
00020 #include "DataFormats/DetId/interface/DetId.h"
00021 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00022
00023 class EBDetId;
00024 class EEDetId;
00025
00026 class EcalTrigTowerDetId;
00027 class EcalElectronicsId;
00028 class EcalPnDiodeDetId;
00029
00030 class EcalDCCHeaderBlock;
00031
00032 class EcalElectronicsMapping;
00033
00034 class Numbers {
00035
00036 public:
00037
00038 static void initGeometry( const edm::EventSetup& setup, bool verbose = false );
00039
00040 static int iEB( const int ism ) throw( std::runtime_error );
00041
00042 static std::string sEB( const int ism );
00043
00044 static int iEE( const int ism ) throw( std::runtime_error );
00045
00046 static std::string sEE( const int ism );
00047
00048 static EcalSubdetector subDet( const EBDetId& id );
00049
00050 static EcalSubdetector subDet( const EEDetId& id );
00051
00052 static EcalSubdetector subDet( const EcalTrigTowerDetId& id );
00053
00054 static EcalSubdetector subDet( const EcalElectronicsId& id );
00055
00056 static EcalSubdetector subDet( const EcalPnDiodeDetId& id );
00057
00058 static EcalSubdetector subDet( const EcalDCCHeaderBlock& id ) throw( std::runtime_error );
00059
00060 static int iSM( const int ism, const EcalSubdetector subdet ) throw( std::runtime_error );
00061
00062 static int iSM( const EBDetId& id ) throw( std::runtime_error );
00063
00064 static int iSM( const EEDetId& id ) throw( std::runtime_error );
00065
00066 static int iSM( const EcalTrigTowerDetId& id ) throw( std::runtime_error );
00067
00068 static int iSM( const EcalElectronicsId& id ) throw( std::runtime_error );
00069
00070 static int iSM( const EcalPnDiodeDetId& id ) throw( std::runtime_error );
00071
00072 static int iSM( const EcalDCCHeaderBlock& id, const EcalSubdetector subdet ) throw( std::runtime_error );
00073
00074 static int iTT( const int ism, const EcalSubdetector subdet, const int i1, const int i2 ) throw( std::runtime_error );
00075
00076 static int iTT( const EcalTrigTowerDetId& id ) throw( std::runtime_error );
00077
00078 static int TCCid(const EcalTrigTowerDetId& id) throw( std::runtime_error );
00079
00080 static int indexEB( const int ism, const int ie, const int ip );
00081
00082 static int indexEE( const int ism, const int ix, const int iy );
00083
00084 static int icEB( const int ism, const int ix, const int iy );
00085
00086 static int icEE( const int ism, const int ix, const int iy ) throw( std::runtime_error );
00087
00088 static std::vector<DetId> crystals( const EcalSubdetector subdet, int itcc, int itt ) throw( std::runtime_error );
00089
00090 static std::vector<DetId> crystals( const EcalTrigTowerDetId& id ) throw( std::runtime_error );
00091
00092 static std::vector<DetId> crystals( const EcalElectronicsId& id ) throw( std::runtime_error );
00093
00094 static int RtHalf(const EBDetId& id);
00095
00096 static int RtHalf(const EEDetId& id);
00097
00098 static int ix0EE( const int ism );
00099
00100 static int iy0EE( const int ism );
00101
00102 static bool validEE( const int ism, const int ix, const int iy );
00103
00104 static int ixSectorsEE[202];
00105 static int iySectorsEE[202];
00106
00107 static int inTowersEE[400];
00108
00109 private:
00110
00111 static bool init;
00112
00113 static const EcalElectronicsMapping* map;
00114
00115 };
00116
00117 #endif // Numbers_H