CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoLocalMuon/CSCValidation/macros/triggerCscIdSector.h

Go to the documentation of this file.
00001 #if !defined(_CINT_)
00002 
00003 Int_t triggerSector(Int_t station, Int_t ring, Int_t chamber) const
00004 {
00005   // taken from /CMSSW/DataFormats/MuonDetId/src/CSCDetId.cc on July 23, 2008
00006   // and modified
00007 
00008   Int_t result;
00009 
00010     if(station > 1 && ring > 1 ) {
00011       result = ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
00012     }
00013     else {
00014       result =  (station != 1) ? ((static_cast<unsigned>(chamber-2) & 0x1f) / 3) + 1 : // ch 2-4-> 1, 5-7->2, ...
00015                                  ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1;
00016     }
00017 
00018   return (result <= 6) ? result : 6; // max sector is 6, some calculations give a value greater than six but this is expected.
00019 }
00020 
00021 Int_t triggerCscId(Int_t station, Int_t ring, Int_t chamber) const
00022 {
00023   // taken from /CMSSW/DataFormats/MuonDetId/src/CSCDetId.cc on July 23, 2008
00024   // and modified
00025 
00026   Int_t result;
00027 
00028   if( station == 1 ) {
00029     result = (chamber) % 3 + 1; // 1,2,3
00030     switch (ring) {
00031     case 1:
00032       break;
00033     case 2:
00034       result += 3; // 4,5,6
00035       break;
00036     case 3:
00037       result += 6; // 7,8,9
00038       break;
00039     }
00040   }
00041   else {
00042     if( ring == 1 ) {
00043       result = (chamber+1) % 3 + 1; // 1,2,3
00044     }
00045     else {
00046       result = (chamber+3) % 6 + 4; // 4,5,6,7,8,9
00047     }
00048   }
00049   return result;
00050 }
00051 
00052 #endif