CMS 3D CMS Logo

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 (CSCDetId id)
 
static int triggerCscIdFromLabels (int station, int ring, int chamber)
 
static int triggerSectorFromLabels (CSCDetId id)
 
static int triggerSectorFromLabels (int station, int ring, int chamber)
 
static int triggerSubSectorFromLabels (CSCDetId id)
 
static int triggerSubSectorFromLabels (int station, int chamber)
 

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

◆ eTrigMaxNum

Enumerator
MAX_TRIGSECTOR 
MAX_CSCID 
MAX_TRIGSUBSECTOR 

Definition at line 121 of file CSCTriggerNumbering.h.

121 { MAX_TRIGSECTOR = 6, MAX_CSCID = 9, MAX_TRIGSUBSECTOR = 2 };

◆ eTrigMinNum

Enumerator
MIN_TRIGSECTOR 
MIN_CSCID 
MIN_TRIGSUBSECTOR 

Definition at line 124 of file CSCTriggerNumbering.h.

124 { MIN_TRIGSECTOR = 1, MIN_CSCID = 1, MIN_TRIGSUBSECTOR = 0 };

Constructor & Destructor Documentation

◆ CSCTriggerNumbering()

CSCTriggerNumbering::CSCTriggerNumbering ( )

◆ ~CSCTriggerNumbering()

CSCTriggerNumbering::~CSCTriggerNumbering ( )

Member Function Documentation

◆ chamberFromTriggerLabels()

int CSCTriggerNumbering::chamberFromTriggerLabels ( int  TriggerSector,
int  TriggerSubSector,
int  station,
int  TriggerCSCID 
)
static

\function chamberFromTriggerLabels

This function calculates the chamber number for a given set of trigger labels.

Definition at line 30 of file CSCTriggerNumbering.cc.

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

References relativeConstraints::chamber, Exception, MAX_CSCID, MAX_TRIGSECTOR, MAX_TRIGSUBSECTOR, CSCDetId::maxStationId(), MIN_TRIGSUBSECTOR, CSCDetId::minStationId(), and relativeConstraints::station.

Referenced by CSCTriggerPrimitivesBuilder::build(), CSCSectorReceiverLUT::calcGlobalPhiME(), CSCBaseboard::CSCBaseboard(), CSCUpgradeMotherboardLUTGenerator::generateLUTsME11(), CSCUpgradeMotherboardLUTGenerator::generateLUTsME21(), CSCSectorReceiverLUT::getGlobalEtaValue(), CSCTriggerSimpleMapping::hwId(), csc::L1TrackId::L1TrackId(), and CSCTriggerMapping::swId().

◆ maxTriggerCscId()

static int CSCTriggerNumbering::maxTriggerCscId ( )
inlinestatic

Minimum and Maximum values for trigger specific labels.

Definition at line 110 of file CSCTriggerNumbering.h.

110 { return MAX_CSCID; }

References MAX_CSCID.

Referenced by CSCSectorReceiverLUT::calcGlobalEtaME(), CSCSectorReceiverLUT::calcGlobalPhiME(), CSCMotherboard::checkValid(), and CSCSectorReceiverLUT::getGlobalEtaValue().

◆ maxTriggerSectorId()

static int CSCTriggerNumbering::maxTriggerSectorId ( )
inlinestatic

◆ maxTriggerSubSectorId()

static int CSCTriggerNumbering::maxTriggerSubSectorId ( )
inlinestatic

Definition at line 114 of file CSCTriggerNumbering.h.

114 { return MAX_TRIGSUBSECTOR; }

References MAX_TRIGSUBSECTOR.

◆ minTriggerCscId()

static int CSCTriggerNumbering::minTriggerCscId ( )
inlinestatic

◆ minTriggerSectorId()

static int CSCTriggerNumbering::minTriggerSectorId ( )
inlinestatic

◆ minTriggerSubSectorId()

static int CSCTriggerNumbering::minTriggerSubSectorId ( )
inlinestatic

Definition at line 115 of file CSCTriggerNumbering.h.

115 { return MIN_TRIGSUBSECTOR + 1; }

References MIN_TRIGSUBSECTOR.

◆ ringFromTriggerLabels()

int CSCTriggerNumbering::ringFromTriggerLabels ( int  station,
int  triggerCSCID 
)
static

The following functions transform trigger labels into their corresponding standard chamber labels. \function 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.

5  {
6  if (station < CSCDetId::minStationId() || station > CSCDetId::maxStationId() || triggerCSCID < MIN_CSCID ||
7  triggerCSCID > MAX_CSCID)
8  throw cms::Exception("CSCTriggerNumbering::InvalidInput")
9  << "CSCTriggerNumbering::ringFromTriggerLabels():"
10  << " Station: " << station << " TriggerCSCID: " << triggerCSCID << " is not a valid set of labels."
11  << " Cannot Convert!!";
12 
13  int ring = 0;
14 
15  if (station == 1)
16  if (triggerCSCID <= 3)
17  ring = 1;
18  else if (triggerCSCID <= 6)
19  ring = 2;
20  else
21  ring = 3;
22  else if (triggerCSCID <= 3)
23  ring = 1;
24  else
25  ring = 2;
26 
27  return ring;
28 }

References Exception, MAX_CSCID, CSCDetId::maxStationId(), MIN_CSCID, CSCDetId::minStationId(), relativeConstraints::ring, and relativeConstraints::station.

Referenced by CSCTriggerPrimitivesBuilder::build(), CSCSectorReceiverLUT::calcGlobalEtaME(), CSCSectorReceiverLUT::calcGlobalPhiME(), CSCBaseboard::CSCBaseboard(), CSCTriggerPrimitivesBuilder::CSCTriggerPrimitivesBuilder(), CSCSectorReceiverLUT::getGlobalEtaValue(), CSCTriggerSimpleMapping::hwId(), and CSCTriggerMapping::swId().

◆ sectorFromTriggerLabels()

int CSCTriggerNumbering::sectorFromTriggerLabels ( int  TriggerSector,
int  TriggerSubSector,
int  station 
)
static

\function 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 64 of file CSCTriggerNumbering.cc.

64  {
65  if (TriggerSector < MIN_TRIGSECTOR || TriggerSector > MAX_TRIGSECTOR || TriggerSubSector < MIN_TRIGSUBSECTOR ||
67  throw cms::Exception("CSCTriggerNumbering::InvalidInput")
68  << "CSCTriggerNumbering::sectorFromTriggerLabels():"
69  << " Trigger Sector: " << TriggerSector << " Trigger SubSector: " << TriggerSubSector << " Station: " << station
70  << " is not a valid set of labels."
71  << " Cannot Convert!!";
72 
73  return ((station == 1) ? ((TriggerSubSector + 2 * (TriggerSector - 1)) % 12 + 1) : TriggerSector);
74 }

References Exception, MAX_TRIGSECTOR, MAX_TRIGSUBSECTOR, CSCDetId::maxStationId(), MIN_TRIGSUBSECTOR, CSCDetId::minStationId(), and relativeConstraints::station.

Referenced by MuonScenarioBuilder::moveCSCSectors().

◆ triggerCscIdFromLabels() [1/2]

int CSCTriggerNumbering::triggerCscIdFromLabels ( CSCDetId  id)
static

◆ triggerCscIdFromLabels() [2/2]

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 137 of file CSCTriggerNumbering.cc.

138 {
141  throw cms::Exception("CSCTriggerNumbering::InvalidInput")
142  << "CSCTriggerNumbering::triggerSectorFromLabels():"
143  << " Station: " << station << " Ring: " << ring << " Chamber: " << chamber << " is not a valid set of labels."
144  << " Cannot Convert!!";
145 
146  int result;
147 
148  if (station == 1) {
149  result = (chamber) % 3 + 1; // 1,2,3
150  switch (ring) {
151  case 1:
152  break;
153  case 2:
154  result += 3; // 4,5,6
155  break;
156  case 3:
157  result += 6; // 7,8,9
158  break;
159  }
160  } else {
161  if (ring == 1) {
162  result = (chamber + 1) % 3 + 1; // 1,2,3
163  } else {
164  result = (chamber + 3) % 6 + 4; // 4,5,6,7,8,9
165  }
166  }
167  return result;
168 }

References relativeConstraints::chamber, Exception, CSCDetId::maxChamberId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minRingId(), CSCDetId::minStationId(), mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

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

◆ triggerSectorFromLabels() [1/2]

int CSCTriggerNumbering::triggerSectorFromLabels ( CSCDetId  id)
static

◆ triggerSectorFromLabels() [2/2]

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 76 of file CSCTriggerNumbering.cc.

76  {
79  throw cms::Exception("CSCTriggerNumbering::InvalidInput")
80  << "CSCTriggerNumbering::triggerSectorFromLabels():"
81  << " Station: " << station << " Ring: " << ring << " Chamber: " << chamber << " is not a valid set of labels."
82  << " Cannot Convert!!";
83 
84  int result;
85  // This version 16-Nov-99 ptc to match simplified chamber labelling for cms116
86  //@@ REQUIRES UPDATE TO 2005 REALITY, ONCE I UNDERSTAND WHAT THAT IS
87  // UPDATED - LGRAY Feb 2006
88 
89  if (station > 1 && ring > 1) {
90  result = ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
91  } else {
92  result = (station != 1) ? ((static_cast<unsigned>(chamber - 2) & 0x1f) / 3) + 1 : // ch 2-4-> 1, 5-7->2, ...
93  ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1;
94  }
95 
96  // Max sector is 6, some calculations give a value greater than six but this is expected
97  // and delt with.
98  return (result <= 6) ? result : 6;
99 }

References relativeConstraints::chamber, Exception, CSCDetId::maxChamberId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minRingId(), CSCDetId::minStationId(), mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

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

◆ triggerSubSectorFromLabels() [1/2]

int CSCTriggerNumbering::triggerSubSectorFromLabels ( CSCDetId  id)
static

◆ triggerSubSectorFromLabels() [2/2]

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 105 of file CSCTriggerNumbering.cc.

105  {
108  throw cms::Exception("CSCTriggerNumbering::InvalidInput")
109  << "CSCTriggerNumbering::triggerSectorFromLabels():"
110  << " Station: " << station << " Chamber: " << chamber << " is not a valid set of labels."
111  << " Cannot Convert!!";
112 
113  if (station != 1)
114  return 0; // only station one has subsectors
115 
116  switch (chamber) // first make things easier to deal with
117  {
118  case 1:
119  chamber = 36;
120  break;
121  case 2:
122  chamber = 35;
123  break;
124  default:
125  chamber -= 2;
126  }
127 
128  chamber = ((chamber - 1) % 6) + 1; // renumber all chambers to 1-6
129 
130  return ((chamber - 1) / 3) + 1; // [1,3] -> 1 , [4,6]->2
131 }

References relativeConstraints::chamber, Exception, CSCDetId::maxChamberId(), CSCDetId::maxStationId(), CSCDetId::minChamberId(), CSCDetId::minStationId(), and relativeConstraints::station.

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

CSCTriggerNumbering::MIN_CSCID
Definition: CSCTriggerNumbering.h:124
CSCTriggerNumbering::triggerSectorFromLabels
static int triggerSectorFromLabels(int station, int ring, int chamber)
Definition: CSCTriggerNumbering.cc:76
CSCDetId::maxStationId
static int maxStationId()
Definition: CSCDetId.h:222
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCTriggerNumbering::MIN_TRIGSUBSECTOR
Definition: CSCTriggerNumbering.h:124
CSCTriggerNumbering::MAX_TRIGSUBSECTOR
Definition: CSCTriggerNumbering.h:121
CSCTriggerNumbering::triggerSubSectorFromLabels
static int triggerSubSectorFromLabels(int station, int chamber)
Definition: CSCTriggerNumbering.cc:105
CSCDetId::minChamberId
static int minChamberId()
Definition: CSCDetId.h:225
CSCTriggerNumbering::triggerCscIdFromLabels
static int triggerCscIdFromLabels(int station, int ring, int chamber)
Definition: CSCTriggerNumbering.cc:137
CSCDetId::minStationId
static int minStationId()
Definition: CSCDetId.h:221
CSCDetId::maxRingId
static int maxRingId()
Definition: CSCDetId.h:224
CSCTriggerNumbering::MAX_TRIGSECTOR
Definition: CSCTriggerNumbering.h:121
CSCDetId::maxChamberId
static int maxChamberId()
Definition: CSCDetId.h:226
CSCTriggerNumbering::MIN_TRIGSECTOR
Definition: CSCTriggerNumbering.h:124
CSCTriggerNumbering::MAX_CSCID
Definition: CSCTriggerNumbering.h:121
Exception
Definition: hltDiff.cc:246
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
mps_fire.result
result
Definition: mps_fire.py:303
CSCDetId::minRingId
static int minRingId()
Definition: CSCDetId.h:223