15 const IndexType lastplusznonme42layer = 1404;
28 if ( isi <= lastnonme42 )
30 if ( isi > lastplusznonme42 )
33 isi -= lastplusznonme42;
38 layerOffset = lastme13layer;
40 else if ( isi >= firstme13 )
42 istart = firstme13 - 1;
43 layerOffset = firstme13layer - 1;
50 layerOffset = lastnonme42layer;
57 if ( ie != 1 ) ili += lastplusznonme42layer;
71 const IndexType lastplusznonme42layer = 1404;
84 if ( ici <= lastnonme42 )
86 if ( ici > lastplusznonme42 )
89 ici -= lastplusznonme42;
94 layerOffset = lastme13layer;
96 else if ( ici >= firstme13 )
98 istart = firstme13 - 1;
99 layerOffset = firstme13layer - 1;
105 istart = lastnonme42;
106 layerOffset = lastnonme42layer;
110 IndexType ichip = (ici - 1)%nchipPerLayer + 1;
111 IndexType ili = (ici - 1)/nchipPerLayer + 1;
113 if ( ie != 1 ) ili += lastplusznonme42layer;
121 int ec =
id.endcap();
122 int st =
id.station();
124 int ch =
id.chamber();
128 if(st == 1 && rg == 4)
131 if(channel <= 16) channel += 64;
133 return ec*100000 + st*10000 + rg*1000 + ch*10 + la;
139 const int n_types = 18;
141 {1, 1081, 4321, 6913, 8533, 13933, 15553, 20953, 22573, 23653, 26893, 29485, 31105, 36505, 38125, 43525, 45145, 50545};
144 const int endcaps[n_types] =
145 {1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2};
146 const int stations[n_types] =
147 {1, 1, 1, 2, 2, 3, 3, 4, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4};
148 const int rings[n_types] =
149 {1, 2, 3, 1, 2, 1, 2, 1, 1, 2, 3, 1, 2, 1, 2, 1, 2, 2};
152 std::vector<IndexType> v_type_starts(type_starts, type_starts + n_types);
153 int type =
int(std::upper_bound(v_type_starts.begin(), v_type_starts.end(), igg) - v_type_starts.begin()) - 1;
157 int chips_per_layer =
chipsPerLayer(stations[type], rings[type]);
161 IndexType igg_chamber_and_layer = (igg_chamber_etc - 1) / sectors_per_layer + 1;
164 int chamber = (igg_chamber_and_layer - 1) / 6 + 1;
165 int layer = (igg_chamber_and_layer - 1) % 6 + 1;
167 IndexType igg_hvseg_etc = (igg_chamber_etc - 1) % sectors_per_layer + 1;
170 IndexType hvsegment = (igg_hvseg_etc - 1) / chips_per_layer + 1;
171 IndexType chip = (igg_hvseg_etc - 1) % chips_per_layer + 1;
173 CSCDetId id(endcaps[type], stations[type], rings[type], chamber, layer);
174 return boost::make_tuple(
id, hvsegment, chip);
GasGainIndexType detIdFromGasGainIndex(IndexType igg) const
boost::tuple< CSCDetId, IndexType, IndexType > GasGainIndexType
int dbIndex(const CSCDetId &id, int &channel) const
IndexType sectorsPerLayer(IndexType is, IndexType ir) const
CSCDetId detIdFromLayerIndex(IndexType ili) const
std::pair< CSCDetId, IndexType > detIdFromChipIndex(IndexType ichi) const
IndexType chipsPerLayer(IndexType is, IndexType ir) const
std::pair< CSCDetId, IndexType > detIdFromStripChannelIndex(LongIndexType ichi) const