CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CalibMuon/CSCCalibration/interface/CSCIndexerStartup.h

Go to the documentation of this file.
00001 #ifndef CSCIndexerStartup_H
00002 #define CSCIndexerStartup_H
00003 
00033 #include <CalibMuon/CSCCalibration/interface/CSCIndexerBase.h>
00034 
00035 class CSCIndexerStartup : public CSCIndexerBase {
00036 
00037 public:
00038 
00039   ~CSCIndexerStartup();
00040 
00041   std::string name() const {return "CSCIndexerStartup";}
00042 
00044 
00045   LongIndexType maxStripChannelIndex() const { return 252288; }
00046   IndexType maxChipIndex() const             { return 15768; }
00047   IndexType maxGasGainIndex() const          { return 55944; }
00049 
00050 
00052 
00053 
00059   IndexType onlineRingsInStation( IndexType is ) const
00060   {
00061     const IndexType nrings[5] = { 0, 3, 2, 2, 2 };
00062     return nrings[is];
00063   }
00064 
00072   IndexType stripChannelsPerOfflineLayer( IndexType is, IndexType ir ) const
00073   {
00074     const IndexType nSC[16] = { 64,80,64,16,  80,80,0,0,  80,80,0,0,  80,80,0,0 };
00075     return nSC[(is-1)*4 + ir - 1];
00076   }
00077 
00085   IndexType stripChannelsPerOnlineLayer( IndexType is, IndexType ir ) const
00086   {
00087     const IndexType nSC[16] = { 80,80,64,80,  80,80,0,0,  80,80,0,0,  80,80,0,0 };
00088     return nSC[(is-1)*4 + ir - 1];
00089   }
00090 
00098   IndexType chipsPerOnlineLayer( IndexType is, IndexType ir ) const
00099   {
00100     const IndexType nCinL[16] = { 5,5,4,5,  5,5,0,0,  5,5,0,0,  5,5,0,0 };
00101     return nCinL[(is - 1)*4 + ir - 1];
00102   }
00103 
00105 
00106 
00108 
00109 
00120   IndexType stripChannelsPerLayer( IndexType is, IndexType ir ) const
00121   {
00122     const IndexType nSCinC[16] = { 80,80,64,80,  80,80,0,0,  80,80,0,0,  80,80,0,0 };
00123     return nSCinC[(is - 1)*4 + ir - 1];
00124   }
00125 
00134   LongIndexType stripChannelStart( IndexType ie, IndexType is, IndexType ir ) const
00135   {
00136     // These are in the ranges 1-217728 (CSCs 2008) and 217729-252288 (ME42).
00137     // There are 1-108884 channels per endcap (CSCs 2008) and 17280 channels per endcap (ME42).
00138     // Start of -z channels (CSCs 2008) is 108864 + 1 = 108865
00139     // Start of +z (ME42) is 217728 + 1 = 217729
00140     // Start of -z (ME42) is 217728 + 1 + 17280 = 235009
00141     const LongIndexType nStart[32] =
00142       {      1, 17281, 34561,     1,   48385, 57025,0,0,   74305, 82945,0,0,  100225,217729,0,0,
00143         108865,126145,143425,108865,  157249,165889,0,0,  183169,191809,0,0,  209089,235009,0,0 };
00144      return  nStart[(ie - 1)*16 + (is - 1)*4 + ir - 1];
00145   }
00147 
00148 
00150 
00151 
00162   IndexType chipsPerLayer( IndexType is, IndexType ir ) const
00163   {
00164     const IndexType nCinL[16] = { 5,5,4,5,  5,5,0,0,  5,5,0,0,  5,5,0,0 };
00165     return nCinL[(is - 1)*4 + ir - 1];
00166   }
00167 
00176   IndexType chipStart( IndexType ie, IndexType is, IndexType ir ) const
00177   {
00178     // These are in the ranges 1-13608 (CSCs 2008) and 13609-15768 (ME42).
00179     // There are 1-6804 chips per endcap (CSCs 2008) and 1080 channels per endcap (ME42).
00180     // Start of -z channels (CSCs 2008) is 6804 + 1 = 6805
00181     // Start of +z (ME42) is 13608 + 1 = 13609
00182     // Start of -z (ME42) is 13608 + 1 + 1080 = 14689
00183     const IndexType nStart[32] =
00184       {   1, 1081, 2161,    1,   3025, 3565, 0,0,   4645,  5185, 0,0,   6265, 13609,0,0,
00185        6805, 7885, 8965, 6805,   9829, 10369,0,0,  11449, 11989, 0,0,  13069, 14689,0,0 };
00186     return  nStart[(ie - 1)*16 + (is - 1)*4 + ir - 1];
00187   }
00189 
00190 
00192 
00193 
00201   IndexType sectorStart( IndexType ie, IndexType is, IndexType ir ) const
00202   {
00203     // There are 36 chambers * 6 layers * 5 CFEB's * 1 HV segment = 1080 gas-gain sectors in ME1/1
00204     // There are 36*6*5*3 = 3240 gas-gain sectors in ME1/2
00205     // There are 36*6*4*3 = 2592 gas-gain sectors in ME1/3
00206     // There are 18*6*5*3 = 1620 gas-gain sectors in ME[2-4]/1
00207     // There are 36*6*5*5 = 5400 gas-gain sectors in ME[2-4]/2
00208     // Start of -z channels (CSCs 2008) is 22572 + 1 = 22573
00209     // Start of +z (ME42) is 45144 + 1 = 45145
00210     // Start of -z (ME42) is 45144 + 1 + 5400 = 50545
00211     const IndexType nStart[32] =
00212       {1    ,1081 , 4321,  1, //ME+1/1,ME+1/2,ME+1/3,ME+1/4
00213        6913 ,8533 ,    0,  0, //ME+2/1,ME+2/2,
00214        13933,15553,    0,  0, //ME+3/1,ME+3/2,
00215        20953,45145,    0,  0, //ME+4/1,ME+4/2,ME+4/3 (note, ME+4/2 index follows ME-4/1...)
00216        22573,23653,26893,  22573, //ME-1/1,ME-1/2,ME-1/3, ME-1/4
00217        29485,31105,    0,  0, //ME-2/1,ME-2/2,ME-2/3
00218        36505,38125,    0,  0, //ME-3/1,ME-3/2,ME-3/3
00219        43525,50545,    0,  0};//ME-4/1,ME-4/2,ME-4/3 (note, ME-4/2 index follows ME+4/2...)
00220     return  nStart[(ie-1)*16 + (is-1)*4 + ir - 1];
00221   }
00223 
00224 
00228   std::pair<CSCDetId, IndexType> detIdFromStripChannelIndex( LongIndexType ichi ) const;
00229   std::pair<CSCDetId, IndexType> detIdFromChipIndex( IndexType ichi ) const;
00230   GasGainIndexType detIdFromGasGainIndex( IndexType igg ) const;
00231 
00239   int dbIndex(const CSCDetId & id, int & channel) const;
00240 };
00241 
00242 #endif