CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 to
8  // 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  {
14  IndexType irmax = ringsInStation(is);
15  for ( IndexType ir = 1; ir <= irmax; ++ir )
16  {
17  IndexType icmax = chambersInRingOfStation(is, ir);
18  for ( IndexType ic = 1; ic <= icmax; ++ic )
19  {
20  chamberLabel_[ ++count ] = is*1000 + ir*100 + ic ;
21  }
22  }
23  }
24 }
25 
26 
28 
29 
31 {
32  // This is just for cross-checking
33 
34  // Expected range of input range argument is 1-540.
35  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
36 
37  if ( ici > 468 )
38  {
39  // ME42
40  ici -= 234; // now in range 235-306
41  if ( ici > 270 ) // -z
42  {
43  ici -= 36; // now in range 235-270
44  }
45  }
46  else // in range 1-468
47  {
48  if ( ici > 234 ) // -z
49  {
50  ici -= 234; // now in range 1-234
51  }
52  }
53  return chamberLabel_[ici];
54 }
55 
56 
58 {
59  IndexType hvSegment = 1; // There is only one HV segment in ME1/1
60 
61  if (is > 2 && ir == 1) // HV segments are the same in ME3/1 and ME4/1
62  {
63  if ( iwire >= 33 && iwire <= 64 ) { hvSegment = 2; }
64  else if ( iwire >= 65 && iwire <= 96 ) { hvSegment = 3; }
65  }
66  else if (is > 1 && ir == 2) // HV segments are the same in ME2/2, ME3/2, and ME4/2
67  {
68  if ( iwire >= 17 && iwire <= 28 ) { hvSegment = 2; }
69  else if ( iwire >= 29 && iwire <= 40 ) { hvSegment = 3; }
70  else if ( iwire >= 41 && iwire <= 52 ) { hvSegment = 4; }
71  else if ( iwire >= 53 && iwire <= 64 ) { hvSegment = 5; }
72  }
73  else if (is == 1 && ir == 2)
74  {
75  if ( iwire >= 25 && iwire <= 48 ) { hvSegment = 2; }
76  else if ( iwire >= 49 && iwire <= 64 ) { hvSegment = 3; }
77  }
78  else if (is == 1 && ir == 3)
79  {
80  if ( iwire >= 13 && iwire <= 22 ) { hvSegment = 2; }
81  else if ( iwire >= 23 && iwire <= 32 ) { hvSegment = 3; }
82  }
83  else if (is == 2 && ir == 1)
84  {
85  if ( iwire >= 45 && iwire <= 80 ) { hvSegment = 2; }
86  else if ( iwire >= 81 && iwire <= 112) { hvSegment = 3; }
87  }
88  return hvSegment;
89 }
90 
91 
93 {
94  IndexType is = label/1000;
95  label -= is*1000;
96  IndexType ir = label/100;
97  label -= ir*100;
98  IndexType ic = label;
99 
100  return CSCDetId( ie, is, ir, ic );
101 }
102 
103 
105 {
106  // Expected range of input range argument is 1-540.
107  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
108 
109  IndexType ie = 1;
110  if ( ici > 468 )
111  {
112  // ME42
113  ici -= 234; // now in range 235-306
114  if ( ici > 270 ) // -z
115  {
116  ie = 2;
117  ici -= 36; // now in range 235-270
118  }
119  }
120  else // in range 1-468
121  {
122  if ( ici > 234 ) // -z
123  {
124  ie = 2;
125  ici -= 234; // now in range 1-234
126  }
127  }
128 
130  return detIdFromChamberLabel( ie, label );
131 }
132 
133 
135 {
136  IndexType il = (ili - 1)%6 + 1;
137  IndexType ici = (ili - 1)/6 + 1;
138  CSCDetId id = detIdFromChamberIndex( ici );
139 
140  return CSCDetId(id.endcap(), id.station(), id.ring(), id.chamber(), il);
141 }
CSCDetId detIdFromChamberIndex(IndexType ici) const
IndexType chambersInRingOfStation(IndexType is, IndexType ir) const
CSCDetId detIdFromChamberLabel(IndexType ie, IndexType icl) const
uint16_t IndexType
IndexType hvSegmentIndex(IndexType is, IndexType ir, IndexType iwire) const
CSCDetId detIdFromLayerIndex(IndexType ili) const
IndexType chamberLabelFromChamberIndex(IndexType) const
IndexType ringsInStation(IndexType is) const
virtual ~CSCIndexerBase()
std::vector< IndexType > chamberLabel_