CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef CSCIndexerPostls1_H
00002 #define CSCIndexerPostls1_H
00003 
00036 #include <CalibMuon/CSCCalibration/interface/CSCIndexerBase.h>
00037 
00038 class CSCIndexerPostls1 : public CSCIndexerBase
00039 {
00040 public:
00041 
00042   ~CSCIndexerPostls1();
00043 
00044   std::string name() const { return "CSCIndexerPostls1"; }
00045 
00046 
00048 
00049   LongIndexType maxStripChannelIndex() const { return 273024; }
00050   IndexType maxChipIndex() const             { return 17064; }
00051   IndexType maxGasGainIndex() const          { return 57240; }
00053 
00054 
00056 
00057 
00063   IndexType onlineRingsInStation( IndexType is ) const
00064   {
00065     const IndexType nrings[5] = { 0, 4, 2, 2, 2 };
00066     return nrings[is];
00067   }
00068 
00075   IndexType stripChannelsPerOfflineLayer( IndexType is, IndexType ir ) const
00076   {
00077     const IndexType nSC[16] = { 64,80,64,48,  80,80,0,0,  80,80,0,0,  80,80,0,0 };
00078     return nSC[(is-1)*4 + ir - 1];
00079   }
00080 
00088   IndexType stripChannelsPerOnlineLayer( IndexType is, IndexType ir ) const
00089   {
00090     const IndexType nSC[16] = { 64,80,64,48,  80,80,0,0,  80,80,0,0,  80,80,0,0 };
00091     return nSC[(is-1)*4 + ir - 1];
00092   }
00093 
00102   IndexType chipsPerOnlineLayer( IndexType is, IndexType ir ) const
00103   {
00104     const IndexType nCinL[16] = { 4,5,4,3,  5,5,0,0,  5,5,0,0,  5,5,0,0 };
00105     return nCinL[(is - 1)*4 + ir - 1];
00106   }
00107 
00109 
00110 
00112 
00113 
00124   IndexType stripChannelsPerLayer( IndexType is, IndexType ir ) const
00125   {
00126     const IndexType nSCinC[16] = { 80,80,64,48,  80,80,0,0,  80,80,0,0,  80,80,0,0 };
00127     return nSCinC[(is - 1)*4 + ir - 1];
00128   }
00129 
00137   LongIndexType stripChannelStart( IndexType ie, IndexType is, IndexType ir ) const
00138   {
00139     // These are in the ranges 1-217728 (CSCs 2008), 217729-252288 (ME42), and 252289-273024 (unganged ME1a)
00140     // There are 1-108884 channels per endcap (CSCs 2008), 17280 channels per endcap (ME42),
00141     // and 10368 channels per endcap (unganged ME1a)
00142     // Start of -z channels (CSCs 2008) is 108864 + 1    = 108865
00143     // Start of +z (ME42) is 217728 + 1                  = 217729
00144     // Start of -z (ME42) is 217728 + 1 + 17280          = 235009
00145     // Start of +z (unganged ME1a) is 252288 + 1         = 252289
00146     // Start of -z (unganged ME1a) is 252288 + 1 + 10368 = 262657
00147     const LongIndexType nStart[32] =
00148       {      1, 17281, 34561,252289,   48385, 57025,0,0,   74305, 82945,0,0,  100225,217729,0,0,
00149         108865,126145,143425,262657,  157249,165889,0,0,  183169,191809,0,0,  209089,235009,0,0 };
00150     return  nStart[(ie - 1)*16 + (is - 1)*4 + ir - 1];
00151   }
00153 
00154 
00156 
00157 
00170   IndexType chipsPerLayer( IndexType is, IndexType ir ) const
00171   {
00172     const IndexType nCinL[16] = { 5,5,4,3,  5,5,0,0,  5,5,0,0,  5,5,0,0 };
00173     return nCinL[(is - 1)*4 + ir - 1];
00174   }
00175 
00184   IndexType chipStart( IndexType ie, IndexType is, IndexType ir ) const
00185   {
00186     // These are in the ranges 1-13608 (CSCs 2008) and 13609-15768 (ME42) and 15769-17064 (ME1a).
00187     // There are 1-6804 chips per endcap (CSCs 2008) and 1080 chips per endcap (ME42) and 648 chips per endcap (ME1a).
00188     // Start of -z channels (CSCs 2008) is 6804 + 1 = 6805
00189     // Start of +z (ME42) is 13608 + 1 = 13609
00190     // Start of -z (ME42) is 13608 + 1 + 1080 = 14689
00191     // Start of +z (ME1a) is 15768 + 1 = 15769
00192     // Start of -z (ME1a) is 15768 + 1 + 648 = 16417
00193     const IndexType nStart[32] =
00194       {1,   1081, 2161, 15769,   3025, 3565, 0,0,  4645, 5185, 0,0,  6265, 13609,0,0,
00195        6805,7885, 8965, 16417,   9829, 10369,0,0,  11449,11989,0,0,  13069,14689,0,0 };
00196     return  nStart[(ie - 1)*16 + (is - 1)*4 + ir - 1];
00197   }
00199 
00200 
00202 
00203 
00211   IndexType sectorStart( IndexType ie, IndexType is, IndexType ir ) const
00212   {
00213     // There are 36 chambers * 6 layers * 5 CFEB's * 1 HV segment = 1080 gas-gain sectors in ME1/1 (non-upgraded)
00214     // There are 36 chambers * 6 layers * 3 CFEB's * 1 HV segment = 648 gas-gain sectors in ME1/1a (upgraded)
00215     // There are 36*6*5*3 = 3240 gas-gain sectors in ME1/2
00216     // There are 36*6*4*3 = 2592 gas-gain sectors in ME1/3
00217     // There are 18*6*5*3 = 1620 gas-gain sectors in ME[2-4]/1
00218     // There are 36*6*5*5 = 5400 gas-gain sectors in ME[2-4]/2
00219     // Start of -z channels (CSCs 2008) is 22572 + 1 = 22573
00220     // Start of +z (ME42) is 45144 + 1 = 45145
00221     // Start of -z (ME42) is 45144 + 1 + 5400 = 50545
00222     // Start of +z (ME1a) is 45144 + 1 + 2*5400 = 55945
00223     // Start of -z (ME42) is 45144 + 1 + 2*5400 + 648 = 56593
00224     const IndexType nStart[32] =
00225       {1    , 1081 ,  4321, 55945,  //ME+1/1,ME+1/2,ME+1/3,ME+1/a
00226        6913 , 8533 ,     0,     0,  //ME+2/1,ME+2/2
00227        13933, 15553,     0,     0,  //ME+3/1,ME+3/2
00228        20953, 45145,     0,     0,  //ME+4/1,ME+4/2 (note, ME+4/2 index follows ME-4/1...)
00229        22573, 23653, 26893, 56593,  //ME-1/1,ME-1/2,ME-1/3,ME+1/a
00230        29485, 31105,     0,     0,  //ME-2/1,ME-2/2
00231        36505, 38125,     0,     0,  //ME-3/1,ME-3/2
00232        43525, 50545,     0,     0 };//ME-4/1,ME-4/2 (note, ME-4/2 index follows ME+4/2...)
00233     return  nStart[(ie-1)*16 + (is-1)*4 + ir - 1];
00234   }
00236 
00240   std::pair<CSCDetId, IndexType> detIdFromStripChannelIndex( LongIndexType ichi ) const;
00241   std::pair<CSCDetId, IndexType> detIdFromChipIndex( IndexType ichi ) const;
00242   CSCIndexerBase::GasGainIndexType detIdFromGasGainIndex( IndexType igg ) const;
00243 
00253   int dbIndex(const CSCDetId & id, int & channel) const;
00254 
00255 };
00256 
00257 #endif