#include <DataFormats/MuonDetId/interface/CSCTriggerNumbering.h>
Public Member Functions | |
CSCTriggerNumbering () | |
~CSCTriggerNumbering () | |
Static Public Member Functions | |
static int | chamberFromTriggerLabels (int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID) |
chamberFromTriggerLabels | |
static int | maxTriggerCscId () |
Minimum and Maximum values for trigger specific labels. | |
static int | maxTriggerSectorId () |
static int | maxTriggerSubSectorId () |
static int | minTriggerCscId () |
static int | minTriggerSectorId () |
static int | minTriggerSubSectorId () |
static int | ringFromTriggerLabels (int station, int triggerCSCID) |
The following functions transform trigger labels into their corresponding standard chamber labels. | |
static int | sectorFromTriggerLabels (int TriggerSector, int TriggerSubSector, int station) |
sectorFromTriggerLabels | |
static int | triggerCscIdFromLabels (CSCDetId id) |
static int | triggerCscIdFromLabels (int station, int ring, int chamber) |
Return trigger-level CSC id within a sector for an Endcap Muon chamber. | |
static int | triggerSectorFromLabels (CSCDetId id) |
static int | triggerSectorFromLabels (int station, int ring, int chamber) |
The following functions transform standard chamber labels into their corresponding trigger labels. | |
static int | triggerSubSectorFromLabels (CSCDetId id) |
static int | triggerSubSectorFromLabels (int station, int chamber) |
Return trigger-level sub sector id within a sector in station one. | |
Private Types | |
enum | eTrigMaxNum { MAX_TRIGSECTOR = 6, MAX_CSCID = 9, MAX_TRIGSUBSECTOR = 2 } |
enum | eTrigMinNum { MIN_TRIGSECTOR = 1, MIN_CSCID = 1, MIN_TRIGSUBSECTOR = 0 } |
"Standard" implies that the numbering is EXACTLY that of CMS NOTE: CMS IN 2000/004 v. 2.1 (Oct, 2005).
Definition at line 15 of file CSCTriggerNumbering.h.
enum CSCTriggerNumbering::eTrigMaxNum [private] |
Definition at line 124 of file CSCTriggerNumbering.h.
00124 { MAX_TRIGSECTOR=6, MAX_CSCID=9, MAX_TRIGSUBSECTOR = 2 };
enum CSCTriggerNumbering::eTrigMinNum [private] |
Definition at line 127 of file CSCTriggerNumbering.h.
00127 { MIN_TRIGSECTOR=1, MIN_CSCID=1, MIN_TRIGSUBSECTOR = 0 };
CSCTriggerNumbering::CSCTriggerNumbering | ( | ) |
CSCTriggerNumbering::~CSCTriggerNumbering | ( | ) |
int CSCTriggerNumbering::chamberFromTriggerLabels | ( | int | TriggerSector, | |
int | TriggerSubSector, | |||
int | station, | |||
int | TriggerCSCID | |||
) | [static] |
chamberFromTriggerLabels
This function calculates the chamber number for a given set of trigger labels.
Definition at line 33 of file CSCTriggerNumbering.cc.
References Exception, MAX_CSCID, MAX_TRIGSECTOR, MAX_TRIGSUBSECTOR, CSCDetId::maxStationId(), and CSCDetId::minStationId().
Referenced by CSCTriggerPrimitivesBuilder::build(), CSCTriggerGeomManager::chamber(), CSCAnodeLCTProcessor::dumpDigis(), CSCCathodeLCTProcessor::dumpDigis(), CSCAnodeLCTProcessor::getDigis(), CSCCathodeLCTProcessor::getDigis(), CSCTriggerSimpleMapping::hwId(), csc::L1TrackId::L1TrackId(), CSCAnodeLCTProcessor::lctSearch(), CSCAnodeLCTProcessor::run(), CSCCathodeLCTProcessor::run(), CSCTriggerGeomManager::sectorOfChambersInStation(), and CSCTriggerMapping::swId().
00034 { 00035 if(TriggerSector < MIN_TRIGSECTOR || TriggerSector > MAX_TRIGSECTOR || 00036 TriggerSubSector < MIN_TRIGSUBSECTOR || TriggerSubSector > MAX_TRIGSUBSECTOR || 00037 station < CSCDetId::minStationId() || station > CSCDetId::maxStationId() || 00038 TriggerCSCID < MIN_CSCID || TriggerCSCID > MAX_CSCID) 00039 throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::chamberFromTriggerLabels():" 00040 << " Trigger Sector: " << TriggerSector 00041 << " Trigger SubSector: " << TriggerSubSector 00042 << " Station: " << station 00043 << " TriggerCSCID: " << TriggerCSCID 00044 << " is not a valid set of labels." 00045 << " Cannot Convert!!"; 00046 00047 00048 int chamber = 0; 00049 int realsubsector = (TriggerSubSector + 2*(TriggerSector - 1))%12 + 1; // station 1 only 00050 00051 if(station != 1) 00052 if(TriggerCSCID <= 3) 00053 chamber = (TriggerCSCID + 3*(TriggerSector - 1))%18 + 1; // Derived from CMS Note: CMS IN 2000/04 ver 2.1 Oct/2005 00054 // As far as I know this is reality. 00055 else 00056 chamber = (TriggerCSCID + 6*(TriggerSector - 1) - 2)%36 + 1; 00057 else 00058 if(TriggerCSCID <= 3) 00059 chamber = (TriggerCSCID + 3*(realsubsector - 1)+34)%36 + 1; 00060 else if(TriggerCSCID <= 6) 00061 chamber = (TriggerCSCID + 3*(realsubsector - 1)+31)%36 + 1; 00062 else 00063 chamber = (TriggerCSCID + 3*(realsubsector - 1)+28)%36 + 1; 00064 00065 return chamber; 00066 }
static int CSCTriggerNumbering::maxTriggerCscId | ( | ) | [inline, static] |
Minimum and Maximum values for trigger specific labels.
Definition at line 112 of file CSCTriggerNumbering.h.
References MAX_CSCID.
Referenced by CSCSectorReceiverLUT::calcGlobalEtaME(), CSCSectorReceiverLUT::calcGlobalPhiME(), CSCSectorReceiverLUT::getGlobalEtaValue(), and CSCTriggerGeomManager::sectorOfChambersInStation().
00112 { return MAX_CSCID; }
static int CSCTriggerNumbering::maxTriggerSectorId | ( | ) | [inline, static] |
Definition at line 114 of file CSCTriggerNumbering.h.
References MAX_TRIGSECTOR.
Referenced by CSCTFTrackBuilder::buildTracks(), CSCTFTrackBuilder::CSCTFTrackBuilder(), CSCTFTrackBuilder::initialize(), CSCTFDTReceiver::process(), and CSCTFTrackBuilder::~CSCTFTrackBuilder().
00114 { return MAX_TRIGSECTOR; }
static int CSCTriggerNumbering::maxTriggerSubSectorId | ( | ) | [inline, static] |
Definition at line 116 of file CSCTriggerNumbering.h.
References MAX_TRIGSUBSECTOR.
00116 { return MAX_TRIGSUBSECTOR; }
static int CSCTriggerNumbering::minTriggerCscId | ( | ) | [inline, static] |
Definition at line 113 of file CSCTriggerNumbering.h.
References MIN_CSCID.
Referenced by CSCSectorReceiverLUT::calcGlobalEtaME(), CSCSectorReceiverLUT::calcGlobalPhiME(), CSCSectorReceiverLUT::getGlobalEtaValue(), and CSCTriggerGeomManager::sectorOfChambersInStation().
00113 { return MIN_CSCID; }
static int CSCTriggerNumbering::minTriggerSectorId | ( | ) | [inline, static] |
Definition at line 115 of file CSCTriggerNumbering.h.
References MIN_TRIGSECTOR.
Referenced by CSCTFTrackBuilder::buildTracks(), CSCTFTrackBuilder::CSCTFTrackBuilder(), CSCTFTrackBuilder::initialize(), CSCTFDTReceiver::process(), and CSCTFTrackBuilder::~CSCTFTrackBuilder().
00115 { return MIN_TRIGSECTOR; }
static int CSCTriggerNumbering::minTriggerSubSectorId | ( | ) | [inline, static] |
Definition at line 117 of file CSCTriggerNumbering.h.
References MIN_TRIGSUBSECTOR.
00117 { return MIN_TRIGSUBSECTOR+1; }
The following functions transform trigger labels into their corresponding standard chamber labels.
ringFromTriggerLabels
This function calculates the ring at which a given chamber resides. Station 1: ring = [1,3] Station 2-4: ring = [1,2]
Definition at line 5 of file CSCTriggerNumbering.cc.
References Exception, MAX_CSCID, CSCDetId::maxStationId(), and CSCDetId::minStationId().
Referenced by CSCTriggerPrimitivesBuilder::build(), CSCSectorReceiverLUT::calcGlobalEtaME(), CSCTriggerGeomManager::chamber(), CSCAnodeLCTProcessor::dumpDigis(), CSCCathodeLCTProcessor::dumpDigis(), CSCAnodeLCTProcessor::getDigis(), CSCCathodeLCTProcessor::getDigis(), CSCSectorReceiverLUT::getGlobalEtaValue(), CSCMotherboard::getLCTs(), CSCTriggerSimpleMapping::hwId(), CSCAnodeLCTProcessor::lctSearch(), CSCAnodeLCTProcessor::run(), CSCCathodeLCTProcessor::run(), CSCTriggerGeomManager::sectorOfChambersInStation(), and CSCTriggerMapping::swId().
00006 { 00007 if(station < CSCDetId::minStationId() || station > CSCDetId::maxStationId() || 00008 triggerCSCID < MIN_CSCID || triggerCSCID > MAX_CSCID) 00009 throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::ringFromTriggerLabels():" 00010 << " Station: " << station 00011 << " TriggerCSCID: " << triggerCSCID 00012 << " is not a valid set of labels." 00013 << " Cannot Convert!!"; 00014 00015 int ring = 0; 00016 00017 if(station == 1) 00018 if(triggerCSCID <= 3) 00019 ring = 1; 00020 else if(triggerCSCID <= 6) 00021 ring = 2; 00022 else 00023 ring = 3; 00024 else 00025 if(triggerCSCID <= 3) 00026 ring = 1; 00027 else 00028 ring = 2; 00029 00030 return ring; 00031 }
int CSCTriggerNumbering::sectorFromTriggerLabels | ( | int | TriggerSector, | |
int | TriggerSubSector, | |||
int | station | |||
) | [static] |
sectorFromTriggerLabels
Translates trigger sector and trigger subsector into the "real" sector number For station 1 sector = [1,12] For stations 2-4 sector = [1,6]
Definition at line 68 of file CSCTriggerNumbering.cc.
References Exception, MAX_TRIGSECTOR, MAX_TRIGSUBSECTOR, CSCDetId::maxStationId(), and CSCDetId::minStationId().
Referenced by MuonScenarioBuilder::moveCSCSectors().
00069 { 00070 if(TriggerSector < MIN_TRIGSECTOR || TriggerSector > MAX_TRIGSECTOR || 00071 TriggerSubSector < MIN_TRIGSUBSECTOR || TriggerSubSector > MAX_TRIGSUBSECTOR || 00072 station < CSCDetId::minStationId() || station > CSCDetId::maxStationId()) 00073 throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::sectorFromTriggerLabels():" 00074 << " Trigger Sector: " << TriggerSector 00075 << " Trigger SubSector: " << TriggerSubSector 00076 << " Station: " << station 00077 << " is not a valid set of labels." 00078 << " Cannot Convert!!"; 00079 00080 return ((station == 1) ? ((TriggerSubSector + 2*(TriggerSector - 1))%12 + 1) : TriggerSector); 00081 }
Definition at line 190 of file CSCTriggerNumbering.cc.
References triggerCscIdFromLabels().
00191 { 00192 return triggerCscIdFromLabels(id.station(),id.ring(),id.chamber()); 00193 }
Return trigger-level CSC id within a sector for an Endcap Muon chamber.
This id is an index within a sector such that the 3 inner ring chambers (20 degrees each) are 1, 2, 3 (increasing counterclockwise) and the 6 outer ring chambers (10 degrees each) are 4, 5, 6, 7, 8, 9 (again increasing counter-clockwise.)
This method knows which chambers are part of which sector and returns the chamber label/index/identifier accordingly. Beware that this information is liable to change according to hardware and software changes.
Definition at line 152 of file CSCTriggerNumbering.cc.
References Exception, CSCDetId::maxChamberId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minRingId(), CSCDetId::minStationId(), and HLT_VtxMuL3::result.
Referenced by csctf::TrackStub::cscid(), and triggerCscIdFromLabels().
00153 { 00154 if(station < CSCDetId::minStationId() || station > CSCDetId::maxStationId() || 00155 ring < CSCDetId::minRingId() || ring > CSCDetId::maxRingId() || 00156 chamber < CSCDetId::minChamberId() || chamber > CSCDetId::maxChamberId()) 00157 throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::triggerSectorFromLabels():" 00158 << " Station: " << station 00159 << " Ring: " << ring 00160 << " Chamber: " << chamber 00161 << " is not a valid set of labels." 00162 << " Cannot Convert!!"; 00163 00164 int result; 00165 00166 if( station == 1 ) { 00167 result = (chamber) % 3 + 1; // 1,2,3 00168 switch (ring) { 00169 case 1: 00170 break; 00171 case 2: 00172 result += 3; // 4,5,6 00173 break; 00174 case 3: 00175 result += 6; // 7,8,9 00176 break; 00177 } 00178 } 00179 else { 00180 if( ring == 1 ) { 00181 result = (chamber+1) % 3 + 1; // 1,2,3 00182 } 00183 else { 00184 result = (chamber+3) % 6 + 4; // 4,5,6,7,8,9 00185 } 00186 } 00187 return result; 00188 }
Definition at line 113 of file CSCTriggerNumbering.cc.
References triggerSectorFromLabels().
00114 { 00115 return triggerSectorFromLabels(id.station(),id.ring(),id.chamber()); 00116 }
The following functions transform standard chamber labels into their corresponding trigger labels.
Return trigger-level sector id for an Endcap Muon chamber.
This method encapsulates the information about which chambers are in which sectors, and may need updating according to hardware changes, or software chamber indexing.
Station 1 has 3 rings of 10-degree chambers.
Stations 2, 3, 4 have an inner ring of 20-degree chambers and an outer ring of 10-degree chambers.
Sectors are 60 degree slices of a station, covering both rings.
For Station 1, there are subsectors of 30 degrees: 9 10-degree chambers (3 each from ME1/1, ME1/2, ME1/3.)
The first sector starts at phi = 15 degrees so it matches Barrel Muon sectors. We count from one not zero.
Definition at line 83 of file CSCTriggerNumbering.cc.
References Exception, CSCDetId::maxChamberId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minRingId(), CSCDetId::minStationId(), and HLT_VtxMuL3::result.
Referenced by MuonScenarioBuilder::moveCSCSectors(), csctf::TrackStub::sector(), csc::L1TrackId::sector(), and triggerSectorFromLabels().
00084 { 00085 if(station < CSCDetId::minStationId() || station > CSCDetId::maxStationId() || 00086 ring < CSCDetId::minRingId() || ring > CSCDetId::maxRingId() || 00087 chamber < CSCDetId::minChamberId() || chamber > CSCDetId::maxChamberId()) 00088 throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::triggerSectorFromLabels():" 00089 << " Station: " << station 00090 << " Ring: " << ring 00091 << " Chamber: " << chamber 00092 << " is not a valid set of labels." 00093 << " Cannot Convert!!"; 00094 00095 00096 int result; 00097 // This version 16-Nov-99 ptc to match simplified chamber labelling for cms116 00098 //@@ REQUIRES UPDATE TO 2005 REALITY, ONCE I UNDERSTAND WHAT THAT IS 00099 // UPDATED - LGRAY Feb 2006 00100 00101 if(station > 1 && ring > 1 ) { 00102 result = ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6 00103 } 00104 else { 00105 result = (station != 1) ? ((static_cast<unsigned>(chamber-2) & 0x1f) / 3) + 1 : // ch 2-4-> 1, 5-7->2, ... 00106 ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1; 00107 } 00108 00109 return (result <= 6) ? result : 6; // Max sector is 6, some calculations give a value greater than six but this is expected 00110 // and delt with. 00111 }
Definition at line 147 of file CSCTriggerNumbering.cc.
References triggerSubSectorFromLabels().
00148 { 00149 return triggerSubSectorFromLabels(id.station(),id.chamber()); 00150 }
Return trigger-level sub sector id within a sector in station one.
Each station one sector has two 30 degree subsectors. Again, we count from one, not zero. Zero is an allowed return value though.
A return value of zero means this station does not have subsectors.
Definition at line 118 of file CSCTriggerNumbering.cc.
References Exception, CSCDetId::maxChamberId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), and CSCDetId::minStationId().
Referenced by CSCTFAnalyzer::analyze(), L1TCSCTF::analyze(), CSCTFanalyzer::analyze(), CSCTFTrackBuilder::buildTracks(), CSCTFSPCoreLogic::loadData(), MuonScenarioBuilder::moveCSCSectors(), CSCTFPacker::produce(), CSCTFSectorProcessor::run(), csctf::TrackStub::subsector(), and triggerSubSectorFromLabels().
00119 { 00120 if(station < CSCDetId::minStationId() || station > CSCDetId::maxStationId() || 00121 chamber < CSCDetId::minChamberId() || chamber > CSCDetId::maxChamberId()) 00122 throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::triggerSectorFromLabels():" 00123 << " Station: " << station 00124 << " Chamber: " << chamber 00125 << " is not a valid set of labels." 00126 << " Cannot Convert!!"; 00127 00128 if(station != 1) return 0; // only station one has subsectors 00129 00130 switch(chamber) // first make things easier to deal with 00131 { 00132 case 1: 00133 chamber = 36; 00134 break; 00135 case 2: 00136 chamber = 35; 00137 break; 00138 default: 00139 chamber -= 2; 00140 } 00141 00142 chamber = ((chamber-1)%6) + 1; // renumber all chambers to 1-6 00143 00144 return ((chamber-1) / 3) + 1; // [1,3] -> 1 , [4,6]->2 00145 }