CMS 3D CMS Logo

CSCIndexerBase.cc
Go to the documentation of this file.
2 
4  : chamberLabel_(271) // # of physical chambers per endcap + 1. Includes ME42.
5 {
6  // Fill the member vector which permits decoding of the linear chamber index.
7  // Beware that the ME42 indices 235-270 within this vector do NOT correspond
8  // to their 'real' linear indices (which are 469-504 for +z)
9  IndexType count = 0;
10  chamberLabel_[count] = 0;
11 
12  for (IndexType is = 1; is <= 4; ++is) {
13  IndexType irmax = ringsInStation(is);
14  for (IndexType ir = 1; ir <= irmax; ++ir) {
15  IndexType icmax = chambersInRingOfStation(is, ir);
16  for (IndexType ic = 1; ic <= icmax; ++ic) {
17  chamberLabel_[++count] = is * 1000 + ir * 100 + ic;
18  }
19  }
20  }
21 }
22 
24 
26  // This is just for cross-checking
27 
28  // Expected range of input range argument is 1-540.
29  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
30 
31  if (ici > 468) {
32  // ME42
33  ici -= 234; // now in range 235-306
34  if (ici > 270) // -z
35  {
36  ici -= 36; // now in range 235-270
37  }
38  } else // in range 1-468
39  {
40  if (ici > 234) // -z
41  {
42  ici -= 234; // now in range 1-234
43  }
44  }
45  return chamberLabel_[ici];
46 }
47 
49  IndexType hvSegment = 1; // There is only one HV segment in ME1/1
50 
51  if (is > 2 && ir == 1) // HV segments are the same in ME3/1 and ME4/1
52  {
53  if (iwire >= 33 && iwire <= 64) {
54  hvSegment = 2;
55  } else if (iwire >= 65 && iwire <= 96) {
56  hvSegment = 3;
57  }
58  } else if (is > 1 && ir == 2) // HV segments are the same in ME2/2, ME3/2, and ME4/2
59  {
60  if (iwire >= 17 && iwire <= 28) {
61  hvSegment = 2;
62  } else if (iwire >= 29 && iwire <= 40) {
63  hvSegment = 3;
64  } else if (iwire >= 41 && iwire <= 52) {
65  hvSegment = 4;
66  } else if (iwire >= 53 && iwire <= 64) {
67  hvSegment = 5;
68  }
69  } else if (is == 1 && ir == 2) {
70  if (iwire >= 25 && iwire <= 48) {
71  hvSegment = 2;
72  } else if (iwire >= 49 && iwire <= 64) {
73  hvSegment = 3;
74  }
75  } else if (is == 1 && ir == 3) {
76  if (iwire >= 13 && iwire <= 22) {
77  hvSegment = 2;
78  } else if (iwire >= 23 && iwire <= 32) {
79  hvSegment = 3;
80  }
81  } else if (is == 2 && ir == 1) {
82  if (iwire >= 45 && iwire <= 80) {
83  hvSegment = 2;
84  } else if (iwire >= 81 && iwire <= 112) {
85  hvSegment = 3;
86  }
87  }
88  return hvSegment;
89 }
90 
92  IndexType is = label / 1000;
93  label -= is * 1000;
94  IndexType ir = label / 100;
95  label -= ir * 100;
96  IndexType ic = label;
97 
98  return CSCDetId(ie, is, ir, ic);
99 }
100 
102  // Expected range of input range argument is 1-540.
103  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
104 
105  IndexType ie = 1;
106  if (ici > 468) {
107  // ME42
108  ici -= 234; // now in range 235-306
109  if (ici > 270) // -z
110  {
111  ie = 2;
112  ici -= 36; // now in range 235-270
113  }
114  } else // in range 1-468
115  {
116  if (ici > 234) // -z
117  {
118  ie = 2;
119  ici -= 234; // now in range 1-234
120  }
121  }
122 
124  return detIdFromChamberLabel(ie, label);
125 }
126 
128  IndexType il = (ili - 1) % 6 + 1;
129  IndexType ici = (ili - 1) / 6 + 1;
131 
132  return CSCDetId(id.endcap(), id.station(), id.ring(), id.chamber(), il);
133 }
IndexType chambersInRingOfStation(IndexType is, IndexType ir) const
IndexType chamberLabelFromChamberIndex(IndexType) const
CSCDetId detIdFromChamberLabel(IndexType ie, IndexType icl) const
CSCDetId detIdFromLayerIndex(IndexType ili) const
char const * label
uint16_t IndexType
CSCDetId detIdFromChamberIndex(IndexType ici) const
IndexType hvSegmentIndex(IndexType is, IndexType ir, IndexType iwire) const
IndexType ringsInStation(IndexType is) const
virtual ~CSCIndexerBase()
std::vector< IndexType > chamberLabel_