CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types
CSCTriggerNumbering Class Reference

#include <CSCTriggerNumbering.h>

Public Member Functions

 CSCTriggerNumbering ()
 
 ~CSCTriggerNumbering ()
 

Static Public Member Functions

static int chamberFromTriggerLabels (int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
 
static int maxTriggerCscId ()
 
static int maxTriggerSectorId ()
 
static int maxTriggerSubSectorId ()
 
static int minTriggerCscId ()
 
static int minTriggerSectorId ()
 
static int minTriggerSubSectorId ()
 
static int ringFromTriggerLabels (int station, int triggerCSCID)
 
static int sectorFromTriggerLabels (int TriggerSector, int TriggerSubSector, int station)
 
static int triggerCscIdFromLabels (int station, int ring, int chamber)
 
static int triggerCscIdFromLabels (CSCDetId id)
 
static int triggerSectorFromLabels (int station, int ring, int chamber)
 
static int triggerSectorFromLabels (CSCDetId id)
 
static int triggerSubSectorFromLabels (int station, int chamber)
 
static int triggerSubSectorFromLabels (CSCDetId id)
 

Private Types

enum  eTrigMaxNum { MAX_TRIGSECTOR =6, MAX_CSCID =9, MAX_TRIGSUBSECTOR = 2 }
 
enum  eTrigMinNum { MIN_TRIGSECTOR =1, MIN_CSCID =1, MIN_TRIGSUBSECTOR = 0 }
 

Detailed Description

Converts standard trigger labels to geometry labels. "Standard" implies that the numbering is EXACTLY that of CMS NOTE: CMS IN 2000/004 v. 2.1 (Oct, 2005).

Warning
EVERY INDEX COUNTS FROM ONE

Definition at line 15 of file CSCTriggerNumbering.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CSCTriggerNumbering::CSCTriggerNumbering ( )
CSCTriggerNumbering::~CSCTriggerNumbering ( )

Member Function Documentation

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 edm::hlt::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().

34 {
35  if(TriggerSector < MIN_TRIGSECTOR || TriggerSector > MAX_TRIGSECTOR ||
36  TriggerSubSector < MIN_TRIGSUBSECTOR || TriggerSubSector > MAX_TRIGSUBSECTOR ||
38  TriggerCSCID < MIN_CSCID || TriggerCSCID > MAX_CSCID)
39  throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::chamberFromTriggerLabels():"
40  << " Trigger Sector: " << TriggerSector
41  << " Trigger SubSector: " << TriggerSubSector
42  << " Station: " << station
43  << " TriggerCSCID: " << TriggerCSCID
44  << " is not a valid set of labels."
45  << " Cannot Convert!!";
46 
47 
48  int chamber = 0;
49  int realsubsector = (TriggerSubSector + 2*(TriggerSector - 1))%12 + 1; // station 1 only
50 
51  if(station != 1)
52  if(TriggerCSCID <= 3)
53  chamber = (TriggerCSCID + 3*(TriggerSector - 1))%18 + 1; // Derived from CMS Note: CMS IN 2000/04 ver 2.1 Oct/2005
54  // As far as I know this is reality.
55  else
56  chamber = (TriggerCSCID + 6*(TriggerSector - 1) - 2)%36 + 1;
57  else
58  if(TriggerCSCID <= 3)
59  chamber = (TriggerCSCID + 3*(realsubsector - 1)+34)%36 + 1;
60  else if(TriggerCSCID <= 6)
61  chamber = (TriggerCSCID + 3*(realsubsector - 1)+31)%36 + 1;
62  else
63  chamber = (TriggerCSCID + 3*(realsubsector - 1)+28)%36 + 1;
64 
65  return chamber;
66 }
static int maxStationId()
Definition: CSCDetId.h:241
static int minStationId()
Definition: CSCDetId.h:240
static int CSCTriggerNumbering::maxTriggerCscId ( )
inlinestatic
static int CSCTriggerNumbering::maxTriggerSectorId ( )
inlinestatic
static int CSCTriggerNumbering::maxTriggerSubSectorId ( )
inlinestatic
static int CSCTriggerNumbering::minTriggerCscId ( )
inlinestatic
static int CSCTriggerNumbering::minTriggerSectorId ( )
inlinestatic
static int CSCTriggerNumbering::minTriggerSubSectorId ( )
inlinestatic
int CSCTriggerNumbering::ringFromTriggerLabels ( int  station,
int  triggerCSCID 
)
static

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 edm::hlt::Exception, MAX_CSCID, CSCDetId::maxStationId(), CSCDetId::minStationId(), and relativeConstraints::ring.

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().

6 {
8  triggerCSCID < MIN_CSCID || triggerCSCID > MAX_CSCID)
9  throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::ringFromTriggerLabels():"
10  << " Station: " << station
11  << " TriggerCSCID: " << triggerCSCID
12  << " is not a valid set of labels."
13  << " Cannot Convert!!";
14 
15  int ring = 0;
16 
17  if(station == 1)
18  if(triggerCSCID <= 3)
19  ring = 1;
20  else if(triggerCSCID <= 6)
21  ring = 2;
22  else
23  ring = 3;
24  else
25  if(triggerCSCID <= 3)
26  ring = 1;
27  else
28  ring = 2;
29 
30  return ring;
31 }
static int maxStationId()
Definition: CSCDetId.h:241
static int minStationId()
Definition: CSCDetId.h:240
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 edm::hlt::Exception, MAX_TRIGSECTOR, MAX_TRIGSUBSECTOR, CSCDetId::maxStationId(), and CSCDetId::minStationId().

Referenced by MuonScenarioBuilder::moveCSCSectors().

69 {
70  if(TriggerSector < MIN_TRIGSECTOR || TriggerSector > MAX_TRIGSECTOR ||
71  TriggerSubSector < MIN_TRIGSUBSECTOR || TriggerSubSector > MAX_TRIGSUBSECTOR ||
73  throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::sectorFromTriggerLabels():"
74  << " Trigger Sector: " << TriggerSector
75  << " Trigger SubSector: " << TriggerSubSector
76  << " Station: " << station
77  << " is not a valid set of labels."
78  << " Cannot Convert!!";
79 
80  return ((station == 1) ? ((TriggerSubSector + 2*(TriggerSector - 1))%12 + 1) : TriggerSector);
81 }
static int maxStationId()
Definition: CSCDetId.h:241
static int minStationId()
Definition: CSCDetId.h:240
int CSCTriggerNumbering::triggerCscIdFromLabels ( int  station,
int  ring,
int  chamber 
)
static

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 edm::hlt::Exception, CSCDetId::maxChamberId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minRingId(), CSCDetId::minStationId(), and query::result.

Referenced by csctf::TrackStub::cscid(), csctf::TrackStub::cscidSeparateME1a(), and triggerCscIdFromLabels().

153 {
156  chamber < CSCDetId::minChamberId() || chamber > CSCDetId::maxChamberId())
157  throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::triggerSectorFromLabels():"
158  << " Station: " << station
159  << " Ring: " << ring
160  << " Chamber: " << chamber
161  << " is not a valid set of labels."
162  << " Cannot Convert!!";
163 
164  int result;
165 
166  if( station == 1 ) {
167  result = (chamber) % 3 + 1; // 1,2,3
168  switch (ring) {
169  case 1:
170  break;
171  case 2:
172  result += 3; // 4,5,6
173  break;
174  case 3:
175  result += 6; // 7,8,9
176  break;
177  }
178  }
179  else {
180  if( ring == 1 ) {
181  result = (chamber+1) % 3 + 1; // 1,2,3
182  }
183  else {
184  result = (chamber+3) % 6 + 4; // 4,5,6,7,8,9
185  }
186  }
187  return result;
188 }
static int minRingId()
Definition: CSCDetId.h:242
static int maxStationId()
Definition: CSCDetId.h:241
static int maxRingId()
Definition: CSCDetId.h:243
static int minChamberId()
Definition: CSCDetId.h:244
static int minStationId()
Definition: CSCDetId.h:240
tuple result
Definition: query.py:137
static int maxChamberId()
Definition: CSCDetId.h:245
int CSCTriggerNumbering::triggerCscIdFromLabels ( CSCDetId  id)
static

Definition at line 190 of file CSCTriggerNumbering.cc.

References relativeConstraints::ring, relativeConstraints::station, and triggerCscIdFromLabels().

191 {
192  return triggerCscIdFromLabels(id.station(),id.ring(),id.chamber());
193 }
static int triggerCscIdFromLabels(int station, int ring, int chamber)
int CSCTriggerNumbering::triggerSectorFromLabels ( int  station,
int  ring,
int  chamber 
)
static

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 edm::hlt::Exception, CSCDetId::maxChamberId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minRingId(), CSCDetId::minStationId(), and query::result.

Referenced by MuonScenarioBuilder::moveCSCSectors(), csc::L1TrackId::sector(), csctf::TrackStub::sector(), and triggerSectorFromLabels().

84 {
87  chamber < CSCDetId::minChamberId() || chamber > CSCDetId::maxChamberId())
88  throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::triggerSectorFromLabels():"
89  << " Station: " << station
90  << " Ring: " << ring
91  << " Chamber: " << chamber
92  << " is not a valid set of labels."
93  << " Cannot Convert!!";
94 
95 
96  int result;
97  // This version 16-Nov-99 ptc to match simplified chamber labelling for cms116
98  //@@ REQUIRES UPDATE TO 2005 REALITY, ONCE I UNDERSTAND WHAT THAT IS
99  // UPDATED - LGRAY Feb 2006
100 
101  if(station > 1 && ring > 1 ) {
102  result = ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
103  }
104  else {
105  result = (station != 1) ? ((static_cast<unsigned>(chamber-2) & 0x1f) / 3) + 1 : // ch 2-4-> 1, 5-7->2, ...
106  ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1;
107  }
108 
109  return (result <= 6) ? result : 6; // Max sector is 6, some calculations give a value greater than six but this is expected
110  // and delt with.
111 }
static int minRingId()
Definition: CSCDetId.h:242
static int maxStationId()
Definition: CSCDetId.h:241
static int maxRingId()
Definition: CSCDetId.h:243
static int minChamberId()
Definition: CSCDetId.h:244
static int minStationId()
Definition: CSCDetId.h:240
tuple result
Definition: query.py:137
static int maxChamberId()
Definition: CSCDetId.h:245
int CSCTriggerNumbering::triggerSectorFromLabels ( CSCDetId  id)
static

Definition at line 113 of file CSCTriggerNumbering.cc.

References relativeConstraints::ring, relativeConstraints::station, and triggerSectorFromLabels().

114 {
115  return triggerSectorFromLabels(id.station(),id.ring(),id.chamber());
116 }
static int triggerSectorFromLabels(int station, int ring, int chamber)
int CSCTriggerNumbering::triggerSubSectorFromLabels ( int  station,
int  chamber 
)
static

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 edm::hlt::Exception, CSCDetId::maxChamberId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), and CSCDetId::minStationId().

Referenced by CSCTFAnalyzer::analyze(), L1TCSCTF::analyze(), CSCTFTrackBuilder::buildTracks(), CSCTFSPCoreLogic::loadData(), MuonScenarioBuilder::moveCSCSectors(), CSCTFPacker::produce(), CSCTFSectorProcessor::run(), csctf::TrackStub::subsector(), and triggerSubSectorFromLabels().

119 {
121  chamber < CSCDetId::minChamberId() || chamber > CSCDetId::maxChamberId())
122  throw cms::Exception("CSCTriggerNumbering::InvalidInput") << "CSCTriggerNumbering::triggerSectorFromLabels():"
123  << " Station: " << station
124  << " Chamber: " << chamber
125  << " is not a valid set of labels."
126  << " Cannot Convert!!";
127 
128  if(station != 1) return 0; // only station one has subsectors
129 
130  switch(chamber) // first make things easier to deal with
131  {
132  case 1:
133  chamber = 36;
134  break;
135  case 2:
136  chamber = 35;
137  break;
138  default:
139  chamber -= 2;
140  }
141 
142  chamber = ((chamber-1)%6) + 1; // renumber all chambers to 1-6
143 
144  return ((chamber-1) / 3) + 1; // [1,3] -> 1 , [4,6]->2
145 }
static int maxStationId()
Definition: CSCDetId.h:241
static int minChamberId()
Definition: CSCDetId.h:244
static int minStationId()
Definition: CSCDetId.h:240
static int maxChamberId()
Definition: CSCDetId.h:245
int CSCTriggerNumbering::triggerSubSectorFromLabels ( CSCDetId  id)
static

Definition at line 147 of file CSCTriggerNumbering.cc.

References relativeConstraints::station, and triggerSubSectorFromLabels().

148 {
149  return triggerSubSectorFromLabels(id.station(),id.chamber());
150 }
static int triggerSubSectorFromLabels(int station, int chamber)