CMS 3D CMS Logo

Enumerations | Functions
emtf::phase2::csc Namespace Reference

Enumerations

enum  Facing { kFront, kRear, kNone }
 

Functions

Facing getFaceDirection (int station, int ring, int chamber)
 
int getId (int ring, int station, int chamber)
 
std::pair< int, int > getMaxPatternAndQuality (int station, int ring)
 
std::pair< int, int > getMaxStripAndWire (int station, int ring)
 
int getNext10DegChamber (int chamber)
 
int getNext20DegChamber (int chamber)
 
int getPrev10DegChamber (int chamber)
 
int getPrev20DegChamber (int chamber)
 
int getTriggerSector (int ring, int station, int chamber)
 
int getTriggerSubsector (int station, int chamber)
 
bool isTPInNeighborSector (int match_endcap, int match_sector, int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_id)
 
bool isTPInSector (int match_endcap, int match_sector, int tp_endcap, int tp_sector)
 

Enumeration Type Documentation

◆ Facing

Enumerator
kFront 
kRear 
kNone 

Definition at line 9 of file CSCUtils.h.

Function Documentation

◆ getFaceDirection()

Facing emtf::phase2::csc::getFaceDirection ( int  station,
int  ring,
int  chamber 
)

Definition at line 100 of file CSCUtils.cc.

References relativeConstraints::chamber, kFront, kRear, relativeConstraints::ring, and relativeConstraints::station.

Referenced by emtf::phase2::CSCTPCollector::collect(), emtf::phase2::RPCTPCollector::collect(), emtf::phase2::ME0TPCollector::collect(), emtf::phase2::GEMTPCollector::collect(), and emtf::phase2::GE0TPCollector::collect().

100  {
101  bool is_not_overlapping = (station == 1 && ring == 3);
102 
103  // Not overlapping means it's facing backwards
104  if (is_not_overlapping)
105  return Facing::kRear;
106 
107  // odd chambers are bolted to the iron, which faces
108  // forward in stations 1 and 2, backward in stations 3 and 4
109  bool is_even = (chamber % 2 == 0);
110 
111  if (station < 3)
112  return (is_even ? Facing::kRear : Facing::kFront);
113 
114  return (is_even ? Facing::kFront : Facing::kRear);
115  }

◆ getId()

int emtf::phase2::csc::getId ( int  ring,
int  station,
int  chamber 
)

Definition at line 39 of file CSCUtils.cc.

References relativeConstraints::chamber, mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

Referenced by emtf::phase2::GE0TPCollector::collect(), emtf::phase2::RPCTPCollector::collect(), emtf::phase2::ME0TPCollector::collect(), and emtf::phase2::GEMTPCollector::collect().

39  {
40  int result = 0;
41 
42  if (station == 1) {
43  result = (chamber) % 3 + 1; // 1,2,3
44 
45  switch (ring) {
46  case 1:
47  break;
48  case 2:
49  result += 3; // 4,5,6
50  break;
51  case 3:
52  result += 6; // 7,8,9
53  break;
54  case 4:
55  break;
56  }
57  } else {
58  if (ring == 1) {
59  result = (chamber + 1) % 3 + 1; // 1,2,3
60  } else {
61  result = (chamber + 3) % 6 + 4; // 4,5,6,7,8,9
62  }
63  }
64 
65  return result;
66  }

◆ getMaxPatternAndQuality()

std::pair< int, int > emtf::phase2::csc::getMaxPatternAndQuality ( int  station,
int  ring 
)

Definition at line 161 of file CSCUtils.cc.

Referenced by emtf::phase2::CSCTPCollector::collect().

161  {
162  int max_pattern = 11;
163  int max_quality = 16;
164 
165  return std::make_pair(max_pattern, max_quality);
166  }

◆ getMaxStripAndWire()

std::pair< int, int > emtf::phase2::csc::getMaxStripAndWire ( int  station,
int  ring 
)

Definition at line 131 of file CSCUtils.cc.

References relativeConstraints::ring, and relativeConstraints::station.

Referenced by emtf::phase2::CSCTPCollector::collect().

131  {
132  int max_strip = 0; // halfstrip
133  int max_wire = 0; // wiregroup
134 
135  if (station == 1 && ring == 4) { // ME1/1a
136  max_strip = 96;
137  max_wire = 48;
138  } else if (station == 1 && ring == 1) { // ME1/1b
139  max_strip = 128;
140  max_wire = 48;
141  } else if (station == 1 && ring == 2) { // ME1/2
142  max_strip = 160;
143  max_wire = 64;
144  } else if (station == 1 && ring == 3) { // ME1/3
145  max_strip = 128;
146  max_wire = 32;
147  } else if (station == 2 && ring == 1) { // ME2/1
148  max_strip = 160;
149  max_wire = 112;
150  } else if (station >= 3 && ring == 1) { // ME3/1, ME4/1
151  max_strip = 160;
152  max_wire = 96;
153  } else if (station >= 2 && ring == 2) { // ME2/2, ME3/2, ME4/2
154  max_strip = 160;
155  max_wire = 64;
156  }
157 
158  return std::make_pair(max_strip, max_wire);
159  }

◆ getNext10DegChamber()

int emtf::phase2::csc::getNext10DegChamber ( int  chamber)

◆ getNext20DegChamber()

int emtf::phase2::csc::getNext20DegChamber ( int  chamber)

Definition at line 12 of file CSCUtils.cc.

References relativeConstraints::chamber.

12 { return (chamber == 18) ? 1 : (chamber + 1); }

◆ getPrev10DegChamber()

int emtf::phase2::csc::getPrev10DegChamber ( int  chamber)

◆ getPrev20DegChamber()

int emtf::phase2::csc::getPrev20DegChamber ( int  chamber)

Definition at line 14 of file CSCUtils.cc.

References relativeConstraints::chamber.

14 { return (chamber == 1) ? 18 : (chamber - 1); }

◆ getTriggerSector()

int emtf::phase2::csc::getTriggerSector ( int  ring,
int  station,
int  chamber 
)

Definition at line 70 of file CSCUtils.cc.

References relativeConstraints::chamber, mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

Referenced by emtf::phase2::GE0TPCollector::collect(), emtf::phase2::RPCTPCollector::collect(), emtf::phase2::ME0TPCollector::collect(), and emtf::phase2::GEMTPCollector::collect().

70  {
71  int result = 0;
72 
73  if (station > 1 && ring > 1) {
74  result = ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
75  } else if (station == 1) {
76  result = ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
77  } else {
78  result = ((static_cast<unsigned>(chamber - 2) & 0x1f) / 3) + 1; // ch 2-4-> 1, 5-7->2, ...
79  }
80 
81  return (result <= 6) ? result
82  : 6; // max sector is 6, some calculations give a value greater than six but this is expected.
83  }

◆ getTriggerSubsector()

int emtf::phase2::csc::getTriggerSubsector ( int  station,
int  chamber 
)

Definition at line 85 of file CSCUtils.cc.

References relativeConstraints::chamber, and relativeConstraints::station.

Referenced by emtf::phase2::CSCTPCollector::collect(), emtf::phase2::RPCTPCollector::collect(), emtf::phase2::ME0TPCollector::collect(), emtf::phase2::GEMTPCollector::collect(), and emtf::phase2::GE0TPCollector::collect().

85  {
86  // station 2,3,4 --> subsector 0
87  if (station != 1) {
88  return 0;
89  }
90 
91  // station 1 --> subsector 1 or 2
92  if ((chamber % 6) > 2) {
93  return 1;
94  }
95 
96  return 2;
97  }

◆ isTPInNeighborSector()

bool emtf::phase2::csc::isTPInNeighborSector ( int  match_endcap,
int  match_sector,
int  tp_endcap,
int  tp_sector,
int  tp_subsector,
int  tp_station,
int  tp_id 
)

Definition at line 21 of file CSCUtils.cc.

Referenced by emtf::phase2::CSCTPSelector::getInputLink(), emtf::phase2::GE0TPSelector::getInputLink(), emtf::phase2::ME0TPSelector::getInputLink(), emtf::phase2::GEMTPSelector::getInputLink(), and emtf::phase2::RPCTPSelector::getInputLink().

22  {
23  // Match endcap and neighbor sector
24  int neighbor_sector = ((sp_sector == 1) ? 6 : sp_sector - 1);
25 
26  if ((sp_endcap != tp_endcap) || (neighbor_sector != tp_sector))
27  return false;
28 
29  // Match CSCID in station 1
30  if (tp_station == 1)
31  return (tp_subsector == 2) && (tp_id == 3 || tp_id == 6 || tp_id == 9);
32 
33  // Match CSCID in other stations
34  return tp_id == 3 || tp_id == 9;
35  }

◆ isTPInSector()

bool emtf::phase2::csc::isTPInSector ( int  match_endcap,
int  match_sector,
int  tp_endcap,
int  tp_sector 
)