CMS 3D CMS Logo

CSCDetId.cc
Go to the documentation of this file.
2 
4  // UPDATED TO OCT 2005 - LGRAY Feb 2006
5 
6  int result;
7  int ring = this->ring();
8  int station = this->station();
9  int chamber = this->chamber();
10 
11  if (station > 1 && ring > 1) {
12  result = ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
13  } else {
14  result = (station != 1) ? ((static_cast<unsigned>(chamber - 2) & 0x1f) / 3) + 1 : // ch 2-4-> 1, 5-7->2, ...
15  ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1;
16  }
17 
18  // max sector is 6, some calculations give a value greater than six but this is expected.
19  return (result <= 6) ? result : 6;
20 }
21 
23  // UPDATED TO OCT 2005 - LGRAY Feb 2006
24 
25  int result;
26  int ring = this->ring();
27  int station = this->station();
28  int chamber = this->chamber();
29 
30  if (station == 1) {
31  result = (chamber) % 3 + 1; // 1,2,3
32  switch (ring) {
33  case 1:
34  break;
35  case 2:
36  result += 3; // 4,5,6
37  break;
38  case 3:
39  result += 6; // 7,8,9
40  break;
41  }
42  } else {
43  if (ring == 1) {
44  result = (chamber + 1) % 3 + 1; // 1,2,3
45  } else {
46  result = (chamber + 3) % 6 + 4; // 4,5,6,7,8,9
47  }
48  }
49  return result;
50 }
51 
52 unsigned short CSCDetId::iChamberType(unsigned short istation, unsigned short iring) {
53  int i = 2 * istation + iring; // i=2S+R ok for S=2, 3, 4
54  if (istation == 1) {
55  --i; // ring 1R -> i=1+R (2S+R-1=1+R for S=1)
56  if (i > 4)
57  i = 1; // But ring 1A (R=4) -> i=1
58  }
59  return i;
60 }
61 
62 bool CSCDetId::isME1a() const { return iChamberType(station(), ring()) == 1; }
63 bool CSCDetId::isME1b() const { return iChamberType(station(), ring()) == 2; }
64 bool CSCDetId::isME11() const { return isME1a() or isME1b(); }
65 bool CSCDetId::isME12() const { return iChamberType(station(), ring()) == 3; }
66 bool CSCDetId::isME13() const { return iChamberType(station(), ring()) == 4; }
67 bool CSCDetId::isME21() const { return iChamberType(station(), ring()) == 5; }
68 bool CSCDetId::isME22() const { return iChamberType(station(), ring()) == 6; }
69 bool CSCDetId::isME31() const { return iChamberType(station(), ring()) == 7; }
70 bool CSCDetId::isME32() const { return iChamberType(station(), ring()) == 8; }
71 bool CSCDetId::isME41() const { return iChamberType(station(), ring()) == 9; }
72 bool CSCDetId::isME42() const { return iChamberType(station(), ring()) == 10; }
73 
75  const std::string eSign = endcap == 1 ? "+" : "-";
76  return "ME" + eSign + std::to_string(station) + "/" + std::to_string(ring) + "/" + std::to_string(chamber);
77 }
78 
80  // ME1a, ME1b, ME12, ME13, ME21, ME22, ME31, ME32, ME41, ME42
81  const unsigned stations[10] = {1, 1, 1, 1, 2, 2, 3, 3, 4, 4};
82  const std::string rings[10] = {"A", "B", "2", "3", "1", "2", "1", "2", "1", "2"};
83  return "ME" + std::to_string(stations[chamberType - 1]) + rings[chamberType - 1];
84 }
85 
87 
88 std::ostream& operator<<(std::ostream& os, const CSCDetId& id) {
89  // Note that there is no endl to end the output
90 
91  os << " E:" << id.endcap() << " S:" << id.station() << " R:" << id.ring() << " C:" << id.chamber()
92  << " L:" << id.layer();
93  return os;
94 }
mps_fire.i
i
Definition: mps_fire.py:428
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
CSCDetId::isME32
bool isME32() const
Definition: CSCDetId.cc:70
CSCDetId::isME31
bool isME31() const
Definition: CSCDetId.cc:69
CSCDetId::isME22
bool isME22() const
Definition: CSCDetId.cc:68
CSCDetId::isME1a
bool isME1a() const
Definition: CSCDetId.cc:62
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCDetId::iChamberType
unsigned short iChamberType() const
Definition: CSCDetId.h:96
CSCDetId::isME12
bool isME12() const
Definition: CSCDetId.cc:65
CSCDetId.h
CSCDetId::triggerCscId
int triggerCscId() const
Definition: CSCDetId.cc:22
CSCDetId::triggerSector
int triggerSector() const
Definition: CSCDetId.cc:3
CSCDetId
Definition: CSCDetId.h:26
CSCDetId::isME21
bool isME21() const
Definition: CSCDetId.cc:67
CSCDetId::chamber
int chamber() const
Definition: CSCDetId.h:62
CSCDetId::isME41
bool isME41() const
Definition: CSCDetId.cc:71
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCDetId::isME1b
bool isME1b() const
Definition: CSCDetId.cc:63
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:86
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
operator<<
std::ostream & operator<<(std::ostream &os, const CSCDetId &id)
Definition: CSCDetId.cc:88
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
CSCDetId::isME11
bool isME11() const
Definition: CSCDetId.cc:64
CSCDetId::isME13
bool isME13() const
Definition: CSCDetId.cc:66
CSCDetId::isME42
bool isME42() const
Definition: CSCDetId.cc:72
mps_fire.result
result
Definition: mps_fire.py:311
CSCDetId::station
int station() const
Definition: CSCDetId.h:79