15 const IndexType lastplusznonme42layer = 1404;
32 if (isi <= lastnonme42) {
35 if (isi > lastplusznonme42) {
37 isi -= lastplusznonme42;
42 layerOffset = lastme13layer;
43 }
else if (isi >= firstme13)
45 istart = firstme13 - 1;
46 layerOffset = firstme13layer - 1;
49 }
else if (isi <= lastnonme1a)
52 layerOffset = lastnonme42layer;
57 if (isi > lastpluszme1a)
69 ili += lastplusznonme42layer;
78 return std::make_pair(
id, ichan);
90 const IndexType lastplusznonme42layer = 1404;
106 if (ici <= lastnonme42) {
109 if (ici > lastplusznonme42) {
111 ici -= lastplusznonme42;
116 layerOffset = lastme13layer;
117 }
else if (ici >= firstme13)
119 istart = firstme13 - 1;
120 layerOffset = firstme13layer - 1;
123 }
else if (ici <= lastnonme1a)
125 istart = lastnonme42;
126 layerOffset = lastnonme42layer;
131 if (ici > lastpluszme1a)
133 istart = lastnonme1a;
139 IndexType ichip = (ici - 1) % nchipPerLayer + 1;
140 IndexType ili = (ici - 1) / nchipPerLayer + 1;
143 ili += lastplusznonme42layer;
152 return std::make_pair(
id, ichip);
156 int ec =
id.endcap();
157 int st =
id.station();
159 int ch =
id.chamber();
162 return ec * 100000 + st * 10000 + rg * 1000 + ch * 10 + la;
166 const int n_types = 20;
167 const IndexType type_starts[n_types] = {1, 1081, 4321, 6913, 8533, 13933, 15553, 20953, 22573, 23653,
168 26893, 29485, 31105, 36505, 38125, 43525, 45145, 50545, 55945, 56593};
172 const int endcaps[n_types] = {1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2};
173 const int stations[n_types] = {1, 1, 1, 2, 2, 3, 3, 4, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 1, 1};
174 const int rings[n_types] = {1, 2, 3, 1, 2, 1, 2, 1, 1, 2, 3, 1, 2, 1, 2, 1, 2, 2, 4, 4};
177 std::vector<IndexType> v_type_starts(type_starts, type_starts + n_types);
178 int type = int(
std::upper_bound(v_type_starts.begin(), v_type_starts.end(), igg) - v_type_starts.begin()) - 1;
182 int chips_per_layer =
chipsPerLayer(stations[type], rings[type]);
186 IndexType igg_chamber_and_layer = (igg_chamber_etc - 1) / sectors_per_layer + 1;
189 int chamber = (igg_chamber_and_layer - 1) / 6 + 1;
190 int layer = (igg_chamber_and_layer - 1) % 6 + 1;
192 IndexType igg_hvseg_etc = (igg_chamber_etc - 1) % sectors_per_layer + 1;
195 IndexType hvsegment = (igg_hvseg_etc - 1) / chips_per_layer + 1;
196 IndexType chip = (igg_hvseg_etc - 1) % chips_per_layer + 1;
198 CSCDetId id(endcaps[type], stations[type], rings[type], chamber, layer);
199 return std::make_tuple(
id, hvsegment, chip);
int dbIndex(const CSCDetId &id, int &channel) const override
uint16_t *__restrict__ id
~CSCIndexerPostls1() override
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
CSCIndexerBase::GasGainIndexType detIdFromGasGainIndex(IndexType igg) const override
constexpr std::array< uint8_t, layerIndexSize > layer
IndexType sectorsPerLayer(IndexType is, IndexType ir) const
std::pair< CSCDetId, IndexType > detIdFromChipIndex(IndexType ichi) const override
CSCDetId detIdFromLayerIndex(IndexType ili) const
std::pair< CSCDetId, IndexType > detIdFromStripChannelIndex(LongIndexType ichi) const override
std::tuple< CSCDetId, IndexType, IndexType > GasGainIndexType
IndexType chipsPerLayer(IndexType is, IndexType ir) const override