00001
00002
00003 #ifndef MUONIDHELPERS_MUONSTATIONINDEX_H
00004 #define MUONIDHELPERS_MUONSTATIONINDEX_H
00005
00006 #include <string>
00007 #include <vector>
00008
00009 namespace Muon {
00010 class MuonStationIndex {
00011 public:
00013 enum ChIndex {
00014 ChUnknown = -1,
00015 BIS, BIL, BMS, BML, BOS, BOL, BEE,
00016 EIS, EIL, EMS, EML, EOS, EOL, EES, EEL, CSS, CSL,
00017 ChIndexMax
00018 };
00019
00021 enum StIndex {
00022 StUnknown = -1,
00023 BI, BM, BO, BE,
00024 EI, EM, EO, EE,
00025 StIndexMax
00026 };
00027
00029 enum PhiIndex {
00030 PhiUnknown = -1,
00031 BM1, BM2, BO1, T1, T2, T3, T4, CSC, STGC1, STGC2,
00032 PhiIndexMax
00033 };
00034
00036 enum LayerIndex {
00037 LayerUnknown = -1,
00038 Inner, Middle, Outer,
00039 Extended,
00040 BarrelExtended,
00041 LayerIndexMax
00042 };
00043
00045 enum DetectorRegionIndex {
00046 DetectorRegionUnknown = -1,
00047 EndcapA, Barrel, EndcapC,
00048 DetectorRegionIndexMax
00049 };
00050
00052 enum TechnologyIndex {
00053 TechnologyUnknown = -1,
00054 MDT, CSCI, RPC, TGC, STGC, MM,
00055 TechnologyIndexMax
00056 };
00057
00059 static StIndex toStationIndex( ChIndex index );
00060
00062 static LayerIndex toLayerIndex( ChIndex index );
00063
00065 static LayerIndex toLayerIndex( StIndex index );
00066
00068 static StIndex toStationIndex( DetectorRegionIndex region, LayerIndex layer );
00069
00071 static ChIndex toChamberIndex( DetectorRegionIndex region, LayerIndex layer, bool isSmall ) ;
00072
00074 static ChIndex toChamberIndex( StIndex stIndex, bool isSmall ) ;
00075
00077 static const std::string& phiName( PhiIndex index ) ;
00078
00080 static const std::string& stName( StIndex index ) ;
00081
00083 static const std::string& chName( ChIndex index ) ;
00084
00086 static const std::string& regionName( DetectorRegionIndex index ) ;
00087
00089 static const std::string& layerName( LayerIndex index ) ;
00090
00092 static const std::string& technologyName( TechnologyIndex index ) ;
00093
00095 static unsigned int sectorLayerHash( DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex );
00096
00098 static unsigned int sectorLayerHashMax();
00099
00101 static std::pair<DetectorRegionIndex,LayerIndex> decomposeSectorLayerHash( unsigned int hash );
00102
00104 static unsigned int numberOfSectors() { return 16; }
00105
00107 static ChIndex chIndex( const std::string& index );
00108
00109 private:
00111 static std::vector<std::string> m_chamberIndexNames;
00112 static std::vector<std::string> m_stationIndexNames;
00113 static std::vector<std::string> m_phiIndexNames;
00114 static std::vector<std::string> m_layerIndexNames;
00115 static std::vector<std::string> m_detectorRegionIndexNames;
00116 static std::vector<std::string> m_technologyIndexNames;
00117 static std::vector<StIndex> m_chamberToStationIndex;
00118 static std::vector<LayerIndex> m_chamberToLayerIndex;
00119 static std::vector<LayerIndex> m_stationToLayerIndex;
00120 static std::vector<StIndex> m_regionLayerToStationIndex;
00121 static std::vector<ChIndex> m_regionLayerToChamberIndexSmall;
00122 static std::vector<ChIndex> m_regionLayerToChamberIndexLarge;
00123 };
00124 }
00125
00126 #endif