17 const IndexType lastplusznonme42layer = 1404;
34 if ( isi <= lastnonme42 )
37 if ( isi > lastplusznonme42 )
40 isi -= lastplusznonme42;
45 layerOffset = lastme13layer;
47 else if ( isi >= firstme13 )
49 istart = firstme13 - 1;
50 layerOffset = firstme13layer - 1;
54 else if ( isi <= lastnonme1a )
57 layerOffset = lastnonme42layer;
63 if (isi > lastpluszme1a) ie = 2;
73 if ( ie != 1 ) ili += lastplusznonme42layer;
80 return std::make_pair(
id, ichan);
94 const IndexType lastplusznonme42layer = 1404;
109 if ( ici <= lastnonme42 )
112 if ( ici > lastplusznonme42 )
115 ici -= lastplusznonme42;
117 if ( ici > lastme13 )
120 layerOffset = lastme13layer;
122 else if ( ici >= firstme13 )
124 istart = firstme13 - 1;
125 layerOffset = firstme13layer - 1;
129 else if ( ici <= lastnonme1a )
131 istart = lastnonme42;
132 layerOffset = lastnonme42layer;
138 if (ici > lastpluszme1a) ie = 2;
139 istart = lastnonme1a;
145 IndexType ichip = (ici - 1)%nchipPerLayer + 1;
146 IndexType ili = (ici - 1)/nchipPerLayer + 1;
148 if ( ie != 1 ) ili += lastplusznonme42layer;
155 return std::make_pair(
id, ichip);
161 int ec =
id.endcap();
162 int st =
id.station();
164 int ch =
id.chamber();
167 return ec*100000 + st*10000 + rg*1000 + ch*10 + la;
173 const int n_types = 20;
175 {1, 1081, 4321, 6913, 8533, 13933, 15553, 20953, 22573, 23653, 26893, 29485, 31105, 36505, 38125, 43525, 45145, 50545, 55945, 56593};
178 const int endcaps[n_types] =
179 {1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2};
180 const int stations[n_types] =
181 {1, 1, 1, 2, 2, 3, 3, 4, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 1, 1};
182 const int rings[n_types] =
183 {1, 2, 3, 1, 2, 1, 2, 1, 1, 2, 3, 1, 2, 1, 2, 1, 2, 2, 4, 4};
186 std::vector<IndexType> v_type_starts(type_starts, type_starts + n_types);
187 int type =
int(std::upper_bound(v_type_starts.begin(), v_type_starts.end(), igg) - v_type_starts.begin()) - 1;
191 int chips_per_layer =
chipsPerLayer(stations[type], rings[type]);
195 IndexType igg_chamber_and_layer = (igg_chamber_etc - 1) / sectors_per_layer + 1;
198 int chamber = (igg_chamber_and_layer - 1) / 6 + 1;
199 int layer = (igg_chamber_and_layer - 1) % 6 + 1;
201 IndexType igg_hvseg_etc = (igg_chamber_etc - 1) % sectors_per_layer + 1;
204 IndexType hvsegment = (igg_hvseg_etc - 1) / chips_per_layer + 1;
205 IndexType chip = (igg_hvseg_etc - 1) % chips_per_layer + 1;
207 CSCDetId id(endcaps[type], stations[type], rings[type], chamber, layer);
208 return boost::make_tuple(
id, hvsegment, chip);
boost::tuple< CSCDetId, IndexType, IndexType > GasGainIndexType
IndexType sectorsPerLayer(IndexType is, IndexType ir) const
int dbIndex(const CSCDetId &id, int &channel) const
CSCDetId detIdFromLayerIndex(IndexType ili) const
CSCIndexerBase::GasGainIndexType detIdFromGasGainIndex(IndexType igg) const
std::pair< CSCDetId, IndexType > detIdFromChipIndex(IndexType ichi) const
IndexType chipsPerLayer(IndexType is, IndexType ir) const
std::pair< CSCDetId, IndexType > detIdFromStripChannelIndex(LongIndexType ichi) const