7 #define NUM_CSC_CHAMBERS 6 * 9
11 #define NUM_RPC_CHAMBERS 7 * 10
13 #define NUM_GEM_CHAMBERS 15
15 #define NUM_DT_CHAMBERS 3 * 4
48 std::map<int, TriggerPrimitiveCollection>& selected_csc_map)
const {
49 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
50 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
52 for (; tp_it != tp_end; ++tp_it) {
55 if (selected_csc >= 0) {
59 if (selected_csc_map[selected_csc].
size() < 2) {
60 selected_csc_map[selected_csc].push_back(*tp_it);
62 edm::LogWarning(
"L1T") <<
"\n******************* EMTF EMULATOR: SUPER-BIZZARE CASE *******************";
63 edm::LogWarning(
"L1T") <<
"Found 3 CSC trigger primitives in the same chamber";
64 for (
int ii = 0;
ii < 3;
ii++) {
74 edm::LogWarning(
"L1T") <<
"************************* ONLY KEEP FIRST TWO *************************\n\n";
84 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_csc_map.begin();
85 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_csc_map.end();
87 for (; map_tp_it != map_tp_end; ++map_tp_it) {
88 int selected = map_tp_it->first;
91 if (tmp_primitives.size() >= 4) {
92 edm::LogWarning(
"L1T") <<
"EMTF found 4 or more CSC LCTs in one chamber: keeping only two";
93 tmp_primitives.erase(tmp_primitives.begin() + 4, tmp_primitives.end());
94 tmp_primitives.erase(tmp_primitives.begin() + 2);
95 tmp_primitives.erase(tmp_primitives.begin() + 1);
96 }
else if (tmp_primitives.size() == 3) {
97 edm::LogWarning(
"L1T") <<
"EMTF found 3 CSC LCTs in one chamber: keeping only two";
98 tmp_primitives.erase(tmp_primitives.begin() + 2);
102 if (tmp_primitives.size() == 2) {
103 if ((tmp_primitives.at(0).getStrip() != tmp_primitives.at(1).getStrip()) &&
104 (tmp_primitives.at(0).getWire() != tmp_primitives.at(1).getWire())) {
112 tmp_primitives.insert(tmp_primitives.begin() + 1, tp1);
113 tmp_primitives.insert(tmp_primitives.begin() + 2, tp0);
116 const bool is_csc_me11 = (0 <= selected && selected <= 2) || (9 <= selected && selected <= 11) ||
121 if (tmp_primitives.size() == 2) {
129 tmp_primitives.insert(tmp_primitives.begin() + 1, tp1);
130 tmp_primitives.insert(tmp_primitives.begin() + 2, tp0);
132 emtf_assert(tmp_primitives.size() == 1 || tmp_primitives.size() == 4);
145 std::map<int, TriggerPrimitiveCollection>& selected_rpc_map)
const {
146 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
147 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
149 for (; tp_it != tp_end; ++tp_it) {
152 if (selected_rpc >= 0) {
154 selected_rpc_map[selected_rpc].push_back(*tp_it);
167 bool apply_truncation =
true;
168 if (apply_truncation) {
173 if (
x.getRPCData().isCPPF)
176 int sz =
x.getRPCData().strip_hi -
x.getRPCData().strip_low + 1;
179 int tp_station = tp_detId.
station();
180 int tp_ring = tp_detId.
ring();
181 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
188 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_rpc_map.begin();
189 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_rpc_map.end();
191 for (; map_tp_it != map_tp_end; ++map_tp_it) {
192 int selected = map_tp_it->first;
197 if (tmp_primitives.size() > 2 && tmp_primitives.at(0).getRPCData().isCPPF) {
198 edm::LogWarning(
"L1T") <<
"\n******************* EMTF EMULATOR: SUPER-BIZZARE CASE *******************";
199 edm::LogWarning(
"L1T") <<
"Found " << tmp_primitives.size() <<
" CPPF digis in the same chamber";
200 for (
const auto&
tp : tmp_primitives)
202 edm::LogWarning(
"L1T") <<
"************************* ONLY KEEP FIRST TWO *************************\n\n";
205 if ((selected % 10) == 8 || (selected % 10) == 9) {
207 if (tmp_primitives.size() > 4)
208 tmp_primitives.erase(tmp_primitives.begin() + 4, tmp_primitives.end());
211 if (tmp_primitives.size() > 2)
212 tmp_primitives.erase(tmp_primitives.begin() + 2, tmp_primitives.end());
216 tmp_primitives.erase(std::remove_if(tmp_primitives.begin(), tmp_primitives.end(), cluster_size_cut),
217 tmp_primitives.end());
223 bool map_rpc_to_csc =
true;
224 if (map_rpc_to_csc) {
225 std::map<int, TriggerPrimitiveCollection> tmp_selected_rpc_map;
227 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_rpc_map.begin();
228 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_rpc_map.end();
230 for (; map_tp_it != map_tp_end; ++map_tp_it) {
231 int selected = map_tp_it->first;
234 int rpc_sub = selected / 10;
235 int rpc_chm = selected % 10;
242 if (0 <= rpc_sub && rpc_sub < 3) {
244 pc_chamber = 3 + rpc_sub;
245 }
else if (3 <= rpc_sub && rpc_sub < 6) {
247 pc_chamber = 3 + (rpc_sub - 3);
249 }
else if (rpc_chm == 6) {
250 if (0 <= rpc_sub && rpc_sub < 3) {
252 pc_chamber = 6 + rpc_sub;
253 }
else if (3 <= rpc_sub && rpc_sub < 6) {
255 pc_chamber = 6 + (rpc_sub - 3);
257 }
else if (rpc_chm == 1 || rpc_chm == 7) {
259 pc_chamber = 3 + rpc_sub;
260 }
else if (2 <= rpc_chm && rpc_chm <= 3) {
262 pc_chamber = 3 + rpc_sub;
263 }
else if (4 <= rpc_chm && rpc_chm <= 5) {
265 pc_chamber = 3 + rpc_sub;
266 }
else if (rpc_chm == 8) {
268 pc_chamber = rpc_sub;
269 }
else if (rpc_chm == 9) {
271 pc_chamber = rpc_sub;
278 }
else if (rpc_chm == 6) {
280 }
else if (rpc_chm == 1 || rpc_chm == 7) {
282 }
else if (2 <= rpc_chm && rpc_chm <= 3) {
284 }
else if (4 <= rpc_chm && rpc_chm <= 5) {
286 }
else if (rpc_chm == 8) {
288 }
else if (rpc_chm == 9) {
295 selected = (pc_station * 9) + pc_chamber;
297 bool ignore_this_rpc_chm =
false;
298 if (rpc_chm == 3 || rpc_chm == 5) {
301 if (tmp_selected_rpc_map.find(selected) != tmp_selected_rpc_map.end())
302 ignore_this_rpc_chm =
true;
305 if (rpc_chm == 6 || rpc_chm == 7) {
306 ignore_this_rpc_chm =
true;
309 if (rpc_chm == 8 || rpc_chm == 9) {
310 ignore_this_rpc_chm =
true;
313 if (ignore_this_rpc_chm) {
315 for (
auto&&
tp : tmp_primitives) {
316 tp.accessRPCData().valid = 0;
321 if (tmp_selected_rpc_map.find(selected) == tmp_selected_rpc_map.end()) {
322 tmp_selected_rpc_map[selected] = tmp_primitives;
324 tmp_selected_rpc_map[selected].insert(
325 tmp_selected_rpc_map[selected].
end(), tmp_primitives.begin(), tmp_primitives.end());
329 std::swap(selected_rpc_map, tmp_selected_rpc_map);
338 std::map<int, TriggerPrimitiveCollection>& selected_gem_map)
const {
339 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
340 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
342 for (; tp_it != tp_end; ++tp_it) {
345 if (selected_gem >= 0) {
347 selected_gem_map[selected_gem].push_back(*tp_it);
352 bool apply_truncation =
true;
353 if (apply_truncation) {
357 int sz =
x.getGEMData().pad_hi -
x.getGEMData().pad_low + 1;
362 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_gem_map.begin();
363 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_gem_map.end();
365 for (; map_tp_it != map_tp_end; ++map_tp_it) {
370 tmp_primitives.erase(std::remove_if(tmp_primitives.begin(), tmp_primitives.end(), cluster_size_cut),
371 tmp_primitives.end());
374 if (tmp_primitives.size() > 8)
375 tmp_primitives.erase(tmp_primitives.begin() + 8, tmp_primitives.end());
385 std::map<int, TriggerPrimitiveCollection>& selected_me0_map)
const {
386 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
387 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
389 for (; tp_it != tp_end; ++tp_it) {
392 if (selected_me0 >= 0) {
394 selected_me0_map[selected_me0].push_back(*tp_it);
399 bool apply_truncation =
true;
400 if (apply_truncation) {
401 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_me0_map.begin();
402 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_me0_map.end();
404 for (; map_tp_it != map_tp_end; ++map_tp_it) {
409 if (tmp_primitives.size() > 20)
410 tmp_primitives.erase(tmp_primitives.begin() + 20, tmp_primitives.end());
420 std::map<int, TriggerPrimitiveCollection>& selected_dt_map)
const {
421 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
422 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
424 for (; tp_it != tp_end; ++tp_it) {
427 if (selected_dt >= 0) {
429 selected_dt_map[selected_dt].push_back(*tp_it);
435 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_dt_map.begin();
436 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_dt_map.end();
438 for (; map_tp_it != map_tp_end; ++map_tp_it) {
444 if (tmp_primitives.size() == 2) {
445 if ((tmp_primitives.at(0).getStrip() != tmp_primitives.at(1).getStrip()) &&
446 (tmp_primitives.at(0).getWire() != tmp_primitives.at(1).getWire())) {
454 tmp_primitives.insert(tmp_primitives.begin() + 1, tp1);
455 tmp_primitives.insert(tmp_primitives.begin() + 2, tp0);
483 const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
484 const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
485 const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
486 const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
487 std::map<int, TriggerPrimitiveCollection>& selected_prim_map)
const {
489 std::map<int, TriggerPrimitiveCollection>::const_iterator map_tp_it = selected_csc_map.begin();
490 std::map<int, TriggerPrimitiveCollection>::const_iterator map_tp_end = selected_csc_map.end();
492 for (; map_tp_it != map_tp_end; ++map_tp_it) {
493 int selected_csc = map_tp_it->first;
498 selected_prim_map[selected_csc] = csc_primitives;
502 map_tp_it = selected_gem_map.begin();
503 map_tp_end = selected_gem_map.end();
505 for (; map_tp_it != map_tp_end; ++map_tp_it) {
506 int selected_gem = map_tp_it->first;
508 if (gem_primitives.empty())
512 bool found = (selected_prim_map.find(selected_gem) != selected_prim_map.end());
515 selected_prim_map[selected_gem] = gem_primitives;
523 map_tp_it = selected_rpc_map.begin();
524 map_tp_end = selected_rpc_map.end();
526 for (; map_tp_it != map_tp_end; ++map_tp_it) {
527 int selected_rpc = map_tp_it->first;
529 if (rpc_primitives.empty())
533 bool found = (selected_prim_map.find(selected_rpc) != selected_prim_map.end());
540 for (
const auto&
tp : rpc_primitives) {
541 if (
tp.getRPCData().valid != 0) {
542 tmp_rpc_primitives.push_back(
tp);
547 selected_prim_map[selected_rpc] = tmp_rpc_primitives;
562 const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
563 const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
564 const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
565 const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
566 std::map<int, TriggerPrimitiveCollection>& selected_prim_map)
const {
568 merge_map_into_map(selected_csc_map, selected_prim_map);
571 merge_map_into_map(selected_me0_map, selected_prim_map);
574 merge_map_into_map(selected_gem_map, selected_prim_map);
577 merge_map_into_map(selected_rpc_map, selected_prim_map);
580 merge_map_into_map(selected_dt_map, selected_prim_map);
592 int tp_endcap = tp_detId.
endcap();
594 int tp_station = tp_detId.
station();
595 int tp_ring = tp_detId.
ring();
596 int tp_chamber = tp_detId.
chamber();
598 int tp_bx = tp_data.bx;
599 int tp_csc_ID = tp_data.cscID;
613 emtf_assert(0 < tp_data.quality && tp_data.quality < max_quality);
619 if (!(tp_data.strip < max_strip)) {
620 edm::LogWarning(
"L1T") <<
"Found error in LCT strip: " << tp_data.strip <<
" (allowed range: 0-"
621 << max_strip - 1 <<
").";
623 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
624 << tp_ring <<
", cscid " << tp_csc_ID
625 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
629 if (!(tp_data.keywire < max_wire)) {
630 edm::LogWarning(
"L1T") <<
"Found error in LCT wire: " << tp_data.keywire <<
" (allowed range: 0-"
631 << max_wire - 1 <<
").";
633 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
634 << tp_ring <<
", cscid " << tp_csc_ID
635 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
639 if (!(tp_data.valid ==
true)) {
640 edm::LogWarning(
"L1T") <<
"Found error in LCT valid: " << tp_data.valid <<
" (allowed value: 1).";
642 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
643 << tp_ring <<
", cscid " << tp_csc_ID
644 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
648 if (!(tp_data.pattern < max_pattern)) {
649 edm::LogWarning(
"L1T") <<
"Found error in LCT pattern: " << tp_data.pattern <<
" (allowed range: 0-"
650 << max_pattern - 1 <<
").";
652 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
653 << tp_ring <<
", cscid " << tp_csc_ID
654 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
658 if (!(0 < tp_data.quality && tp_data.quality < max_quality)) {
659 edm::LogWarning(
"L1T") <<
"Found error in LCT quality: " << tp_data.quality <<
" (allowed range: 1-"
660 << max_quality - 1 <<
").";
662 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
663 << tp_ring <<
", cscid " << tp_csc_ID
664 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
671 int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
674 selected =
get_index_csc(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_bx);
684 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID)
const {
685 auto get_neighbor = [](
int sector) {
return (sector == 1) ? 6 : sector - 1; };
688 if ((
endcap_ == tp_endcap) && (get_neighbor(
sector_) == tp_sector)) {
689 if (tp_station == 1) {
690 if ((tp_subsector == 2) && (tp_csc_ID == 3 || tp_csc_ID == 6 || tp_csc_ID == 9))
694 if (tp_csc_ID == 3 || tp_csc_ID == 9)
704 return (
bx_ == tp_bx);
709 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_bx)
const {
712 bool is_native =
false;
713 bool is_neighbor =
false;
721 if (!is_native && !is_neighbor)
725 if (tp_station == 1) {
726 selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
728 selected = (tp_station)*9 + (tp_csc_ID - 1);
732 if (tp_station == 1) {
733 selected = (5) * 9 + (tp_csc_ID - 1) / 3;
735 selected = (5) * 9 + (tp_station)*2 - 1 + (tp_csc_ID - 1 < 3 ? 0 : 1);
751 int tp_region = tp_detId.
region();
752 int tp_endcap = (tp_region == -1) ? 2 : tp_region;
753 int tp_sector = tp_detId.
sector();
755 int tp_station = tp_detId.
station();
756 int tp_ring = tp_detId.
ring();
757 int tp_roll = tp_detId.
roll();
760 int tp_bx = tp_data.bx;
761 int tp_strip = tp_data.strip;
762 int tp_emtf_sect = tp_data.emtf_sector;
763 bool tp_CPPF = tp_data.isCPPF;
766 if (tp_CPPF && (tp_emtf_sect !=
sector_))
769 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
775 emtf_assert(1 <= tp_subsector && tp_subsector <= 6);
777 emtf_assert((!is_irpc && 2 <= tp_ring && tp_ring <= 3) || (is_irpc && tp_ring == 1));
778 emtf_assert((!is_irpc && 1 <= tp_roll && tp_roll <= 3) || (is_irpc && 1 <= tp_roll && tp_roll <= 5));
780 emtf_assert((!is_irpc && (tp_CPPF || (1 <= tp_strip && tp_strip <= 32))) ||
781 (is_irpc && 1 <= tp_strip && tp_strip <= 96 * 2));
787 selected =
get_index_rpc(tp_endcap, tp_station, tp_ring, tp_sector, tp_subsector, tp_bx);
793 int tp_endcap,
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector)
const {
798 auto get_csc_sector = [](
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector) {
799 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
802 int corr = (tp_subsector < 2) ? (tp_sector == 1 ? +5 : -1) : 0;
803 return tp_sector +
corr;
806 int corr = (tp_subsector < 3) ? (tp_sector == 1 ? +5 : -1) : 0;
807 return tp_sector +
corr;
810 return ((
endcap_ == tp_endcap) && (
sector_ == get_csc_sector(tp_station, tp_ring, tp_sector, tp_subsector)));
814 int tp_endcap,
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector)
const {
815 auto get_neighbor_subsector = [](
int tp_station,
int tp_ring) {
816 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
826 (tp_subsector == get_neighbor_subsector(tp_station, tp_ring)));
831 return (
bx_ == tp_bx);
835 int tp_endcap,
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector,
int tp_bx)
const {
838 bool is_native =
false;
839 bool is_neighbor =
false;
841 if (
is_in_sector_rpc(tp_endcap, tp_station, tp_ring, tp_sector, tp_subsector)) {
847 if (!is_native && !is_neighbor)
863 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
867 rpc_sub = ((tp_subsector + 3) % 6);
869 rpc_sub = ((tp_subsector + 1) % 3);
875 if (tp_station <= 2 && tp_ring == 2) {
876 rpc_chm = (tp_station - 1);
877 }
else if (tp_station >= 3 && tp_ring >= 2) {
878 rpc_chm = 2 + (tp_station - 3) * 2 + (tp_ring - 2);
879 }
else if (tp_station <= 2 && tp_ring == 3) {
880 rpc_chm = 6 + (tp_station - 1);
881 }
else if (tp_station >= 3 && tp_ring == 1) {
882 rpc_chm = 8 + (tp_station - 3);
885 selected = (rpc_sub * 10) + rpc_chm;
903 int tp_region = tp_detId.
region();
904 int tp_endcap = (tp_region == -1) ? 2 : tp_region;
905 int tp_station = tp_detId.
station();
906 int tp_ring = tp_detId.
ring();
907 int tp_roll = tp_detId.
roll();
908 int tp_layer = tp_detId.
layer();
909 int tp_chamber = tp_detId.
chamber();
911 int tp_bx = tp_data.bx;
912 int tp_pad = ((tp_data.pad_low + tp_data.pad_hi) / 2);
919 int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
930 emtf_assert((tp_station == 1 && 0 <= tp_pad && tp_pad <= 191) || (tp_station != 1));
931 emtf_assert((tp_station == 2 && 0 <= tp_pad && tp_pad <= 383) || (tp_station != 2));
935 selected =
get_index_gem(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_bx);
946 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID)
const {
953 return (
bx_ == tp_bx);
957 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_bx)
const {
960 bool is_native =
false;
961 bool is_neighbor =
false;
969 if (!is_native && !is_neighbor)
973 if (tp_station == 1) {
974 selected = (tp_subsector - 1) * 3 + (tp_csc_ID - 1);
976 selected = 6 + (tp_csc_ID - 1);
980 if (tp_station == 1) {
1002 int tp_region = tp_detId.
region();
1003 int tp_endcap = (tp_region == -1) ? 2 : tp_region;
1004 int tp_station = tp_detId.
station();
1008 int tp_chamber = tp_detId.
chamber();
1010 int tp_bx = tp_data.bx;
1011 int tp_pad = tp_data.phiposition;
1012 int tp_partition = tp_data.partition;
1018 int tp_subsector = 0;
1030 emtf_assert(0 <= tp_partition && tp_partition <= 15);
1034 selected =
get_index_me0(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_pad, tp_bx);
1046 auto get_other_neighbor = [](
int sector) {
return (sector == 6) ? 1 : sector + 1; };
1048 bool add5deg =
false;
1049 bool sub5deg =
false;
1051 if ((
endcap_ == tp_endcap) && (get_other_neighbor(
sector_) == tp_sector)) {
1052 if (tp_csc_ID == 1 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1054 }
else if (tp_csc_ID == 1 && tp_endcap == 2 && tp_pad <= 191) {
1059 if (tp_csc_ID == 1 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1061 }
else if (tp_csc_ID == 1 && tp_endcap == 2 && tp_pad <= 191) {
1077 auto get_neighbor = [](
int sector) {
return (sector == 1) ? 6 : sector - 1; };
1079 bool add5deg =
false;
1080 bool sub5deg =
false;
1082 if ((
endcap_ == tp_endcap) && (get_neighbor(
sector_) == tp_sector)) {
1083 if (tp_csc_ID == 3 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1085 }
else if (tp_csc_ID == 3 && tp_endcap == 2 && tp_pad <= 191) {
1090 if (tp_csc_ID == 1 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1092 }
else if (tp_csc_ID == 1 && tp_endcap == 2 && tp_pad <= 191) {
1103 return (
bx_ == tp_bx);
1107 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_pad,
int tp_bx)
const {
1110 bool is_native =
false;
1111 bool is_neighbor =
false;
1119 if (!is_native && !is_neighbor)
1123 selected = 9 + (tp_csc_ID - 1);
1140 int tp_wheel = tp_detId.
wheel();
1141 int tp_station = tp_detId.
station();
1142 int tp_sector = tp_detId.
sector();
1147 if (tp_station == 4) {
1148 if (tp_sector == 13)
1150 else if (tp_sector == 14)
1154 int tp_bx = tp_data.bx;
1155 int tp_phi = tp_data.radialAngle;
1162 int tp_endcap = (tp_wheel > 0) ? 1 : ((tp_wheel < 0) ? 2 : 0);
1165 int tp_subsector = 0;
1182 selected =
get_index_dt(tp_endcap, csc_tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_bx);
1200 return (
bx_ == tp_bx);
1204 int tp_endcap,
int csc_tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_bx)
const {
1207 bool is_native =
false;
1208 bool is_neighbor =
false;
1216 if (!is_native && !is_neighbor)
1220 selected = (tp_station - 1) * 2 + (tp_csc_ID - 6) / 3;
1222 selected = 8 + (tp_station - 1);