8 #define NUM_CSC_CHAMBERS 6 * 9
12 #define NUM_RPC_CHAMBERS 7 * 10
14 #define NUM_GEM_CHAMBERS 15
16 #define NUM_DT_CHAMBERS 3 * 4
49 std::map<int, TriggerPrimitiveCollection>& selected_csc_map)
const {
50 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
51 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
53 for (; tp_it != tp_end; ++tp_it) {
56 if (selected_csc >= 0) {
60 if (selected_csc_map[selected_csc].
size() < 2) {
61 selected_csc_map[selected_csc].push_back(*tp_it);
63 edm::LogWarning(
"L1T") <<
"\n******************* EMTF EMULATOR: SUPER-BIZZARE CASE *******************";
64 edm::LogWarning(
"L1T") <<
"Found 3 CSC trigger primitives in the same chamber";
65 for (
int ii = 0;
ii < 3;
ii++) {
71 <<
", chamber " << tp_err.
detId<
CSCDetId>().chamber() <<
", CSC ID "
75 edm::LogWarning(
"L1T") <<
"************************* ONLY KEEP FIRST TWO *************************\n\n";
85 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_csc_map.begin();
86 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_csc_map.end();
88 for (; map_tp_it != map_tp_end; ++map_tp_it) {
89 int selected = map_tp_it->first;
92 if (tmp_primitives.size() >= 4) {
93 edm::LogWarning(
"L1T") <<
"EMTF found 4 or more CSC LCTs in one chamber: keeping only two";
94 tmp_primitives.erase(tmp_primitives.begin() + 4, tmp_primitives.end());
95 tmp_primitives.erase(tmp_primitives.begin() + 2);
96 tmp_primitives.erase(tmp_primitives.begin() + 1);
97 }
else if (tmp_primitives.size() == 3) {
98 edm::LogWarning(
"L1T") <<
"EMTF found 3 CSC LCTs in one chamber: keeping only two";
99 tmp_primitives.erase(tmp_primitives.begin() + 2);
103 if (tmp_primitives.size() == 2) {
104 if ((tmp_primitives.at(0).getStrip() != tmp_primitives.at(1).getStrip()) &&
105 (tmp_primitives.at(0).getWire() != tmp_primitives.at(1).getWire())) {
113 tmp_primitives.insert(tmp_primitives.begin() + 1, tp1);
114 tmp_primitives.insert(tmp_primitives.begin() + 2, tp0);
117 const bool is_csc_me11 = (0 <= selected && selected <= 2) || (9 <= selected && selected <= 11) ||
122 if (tmp_primitives.size() == 2) {
130 tmp_primitives.insert(tmp_primitives.begin() + 1, tp1);
131 tmp_primitives.insert(tmp_primitives.begin() + 2, tp0);
133 emtf_assert(tmp_primitives.size() == 1 || tmp_primitives.size() == 4);
146 std::map<int, TriggerPrimitiveCollection>& selected_rpc_map)
const {
147 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
148 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
150 for (; tp_it != tp_end; ++tp_it) {
153 if (selected_rpc >= 0) {
155 selected_rpc_map[selected_rpc].push_back(*tp_it);
168 bool apply_truncation =
true;
169 if (apply_truncation) {
172 bool operator()(
const value_type&
x)
const {
174 if (x.getRPCData().isCPPF)
177 int sz = x.getRPCData().strip_hi - x.getRPCData().strip_low + 1;
180 int tp_station = tp_detId.
station();
181 int tp_ring = tp_detId.
ring();
182 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
189 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_rpc_map.begin();
190 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_rpc_map.end();
192 for (; map_tp_it != map_tp_end; ++map_tp_it) {
193 int selected = map_tp_it->first;
198 if (tmp_primitives.size() > 2 && tmp_primitives.at(0).getRPCData().isCPPF) {
199 edm::LogWarning(
"L1T") <<
"\n******************* EMTF EMULATOR: SUPER-BIZZARE CASE *******************";
200 edm::LogWarning(
"L1T") <<
"Found " << tmp_primitives.size() <<
" CPPF digis in the same chamber";
201 for (
const auto&
tp : tmp_primitives)
203 edm::LogWarning(
"L1T") <<
"************************* ONLY KEEP FIRST TWO *************************\n\n";
206 if ((selected % 10) == 8 || (selected % 10) == 9) {
208 if (tmp_primitives.size() > 4)
209 tmp_primitives.erase(tmp_primitives.begin() + 4, tmp_primitives.end());
212 if (tmp_primitives.size() > 2)
213 tmp_primitives.erase(tmp_primitives.begin() + 2, tmp_primitives.end());
217 tmp_primitives.erase(std::remove_if(tmp_primitives.begin(), tmp_primitives.end(), cluster_size_cut),
218 tmp_primitives.end());
224 bool map_rpc_to_csc =
true;
225 if (map_rpc_to_csc) {
226 std::map<int, TriggerPrimitiveCollection> tmp_selected_rpc_map;
228 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_rpc_map.begin();
229 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_rpc_map.end();
231 for (; map_tp_it != map_tp_end; ++map_tp_it) {
232 int selected = map_tp_it->first;
235 int rpc_sub = selected / 10;
236 int rpc_chm = selected % 10;
243 if (0 <= rpc_sub && rpc_sub < 3) {
245 pc_chamber = 3 + rpc_sub;
246 }
else if (3 <= rpc_sub && rpc_sub < 6) {
248 pc_chamber = 3 + (rpc_sub - 3);
250 }
else if (rpc_chm == 6) {
251 if (0 <= rpc_sub && rpc_sub < 3) {
253 pc_chamber = 6 + rpc_sub;
254 }
else if (3 <= rpc_sub && rpc_sub < 6) {
256 pc_chamber = 6 + (rpc_sub - 3);
258 }
else if (rpc_chm == 1 || rpc_chm == 7) {
260 pc_chamber = 3 + rpc_sub;
261 }
else if (2 <= rpc_chm && rpc_chm <= 3) {
263 pc_chamber = 3 + rpc_sub;
264 }
else if (4 <= rpc_chm && rpc_chm <= 5) {
266 pc_chamber = 3 + rpc_sub;
267 }
else if (rpc_chm == 8) {
269 pc_chamber = rpc_sub;
270 }
else if (rpc_chm == 9) {
272 pc_chamber = rpc_sub;
279 }
else if (rpc_chm == 6) {
281 }
else if (rpc_chm == 1 || rpc_chm == 7) {
283 }
else if (2 <= rpc_chm && rpc_chm <= 3) {
285 }
else if (4 <= rpc_chm && rpc_chm <= 5) {
287 }
else if (rpc_chm == 8) {
289 }
else if (rpc_chm == 9) {
296 selected = (pc_station * 9) + pc_chamber;
298 bool ignore_this_rpc_chm =
false;
299 if (rpc_chm == 3 || rpc_chm == 5) {
302 if (tmp_selected_rpc_map.find(selected) != tmp_selected_rpc_map.end())
303 ignore_this_rpc_chm =
true;
306 if (rpc_chm == 6 || rpc_chm == 7) {
307 ignore_this_rpc_chm =
true;
310 if (rpc_chm == 8 || rpc_chm == 9) {
311 ignore_this_rpc_chm =
true;
314 if (ignore_this_rpc_chm) {
316 for (
auto&&
tp : tmp_primitives) {
317 tp.accessRPCData().valid = 0;
322 if (tmp_selected_rpc_map.find(selected) == tmp_selected_rpc_map.end()) {
323 tmp_selected_rpc_map[selected] = tmp_primitives;
325 tmp_selected_rpc_map[selected].insert(
326 tmp_selected_rpc_map[selected].
end(), tmp_primitives.begin(), tmp_primitives.end());
330 std::swap(selected_rpc_map, tmp_selected_rpc_map);
339 std::map<int, TriggerPrimitiveCollection>& selected_gem_map)
const {
340 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
341 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
343 for (; tp_it != tp_end; ++tp_it) {
346 if (selected_gem >= 0) {
348 selected_gem_map[selected_gem].push_back(*tp_it);
353 bool apply_truncation =
true;
354 if (apply_truncation) {
357 bool operator()(
const value_type&
x)
const {
358 int sz = x.getGEMData().pad_hi - x.getGEMData().pad_low + 1;
363 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_gem_map.begin();
364 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_gem_map.end();
366 for (; map_tp_it != map_tp_end; ++map_tp_it) {
371 tmp_primitives.erase(std::remove_if(tmp_primitives.begin(), tmp_primitives.end(), cluster_size_cut),
372 tmp_primitives.end());
375 if (tmp_primitives.size() > 8)
376 tmp_primitives.erase(tmp_primitives.begin() + 8, tmp_primitives.end());
386 std::map<int, TriggerPrimitiveCollection>& selected_me0_map)
const {
387 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
388 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
390 for (; tp_it != tp_end; ++tp_it) {
393 if (selected_me0 >= 0) {
395 selected_me0_map[selected_me0].push_back(*tp_it);
400 bool apply_truncation =
true;
401 if (apply_truncation) {
402 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_me0_map.begin();
403 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_me0_map.end();
405 for (; map_tp_it != map_tp_end; ++map_tp_it) {
410 if (tmp_primitives.size() > 20)
411 tmp_primitives.erase(tmp_primitives.begin() + 20, tmp_primitives.end());
421 std::map<int, TriggerPrimitiveCollection>& selected_dt_map)
const {
422 TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
423 TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
425 for (; tp_it != tp_end; ++tp_it) {
428 if (selected_dt >= 0) {
430 selected_dt_map[selected_dt].push_back(*tp_it);
436 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_dt_map.begin();
437 std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_dt_map.end();
439 for (; map_tp_it != map_tp_end; ++map_tp_it) {
445 if (tmp_primitives.size() == 2) {
446 if ((tmp_primitives.at(0).getStrip() != tmp_primitives.at(1).getStrip()) &&
447 (tmp_primitives.at(0).getWire() != tmp_primitives.at(1).getWire())) {
455 tmp_primitives.insert(tmp_primitives.begin() + 1, tp1);
456 tmp_primitives.insert(tmp_primitives.begin() + 2, tp0);
484 const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
485 const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
486 const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
487 const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
488 std::map<int, TriggerPrimitiveCollection>& selected_prim_map)
const {
490 std::map<int, TriggerPrimitiveCollection>::const_iterator map_tp_it = selected_csc_map.begin();
491 std::map<int, TriggerPrimitiveCollection>::const_iterator map_tp_end = selected_csc_map.end();
493 for (; map_tp_it != map_tp_end; ++map_tp_it) {
494 int selected_csc = map_tp_it->first;
499 selected_prim_map[selected_csc] = csc_primitives;
503 map_tp_it = selected_gem_map.begin();
504 map_tp_end = selected_gem_map.end();
506 for (; map_tp_it != map_tp_end; ++map_tp_it) {
507 int selected_gem = map_tp_it->first;
509 if (gem_primitives.empty())
513 bool found = (selected_prim_map.find(selected_gem) != selected_prim_map.end());
516 selected_prim_map[selected_gem] = gem_primitives;
524 map_tp_it = selected_rpc_map.begin();
525 map_tp_end = selected_rpc_map.end();
527 for (; map_tp_it != map_tp_end; ++map_tp_it) {
528 int selected_rpc = map_tp_it->first;
530 if (rpc_primitives.empty())
534 bool found = (selected_prim_map.find(selected_rpc) != selected_prim_map.end());
541 for (
const auto&
tp : rpc_primitives) {
542 if (
tp.getRPCData().valid != 0) {
543 tmp_rpc_primitives.push_back(
tp);
548 selected_prim_map[selected_rpc] = tmp_rpc_primitives;
563 const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
564 const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
565 const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
566 const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
567 std::map<int, TriggerPrimitiveCollection>& selected_prim_map)
const {
569 merge_map_into_map(selected_csc_map, selected_prim_map);
572 merge_map_into_map(selected_me0_map, selected_prim_map);
575 merge_map_into_map(selected_gem_map, selected_prim_map);
578 merge_map_into_map(selected_rpc_map, selected_prim_map);
581 merge_map_into_map(selected_dt_map, selected_prim_map);
593 int tp_endcap = tp_detId.
endcap();
595 int tp_station = tp_detId.
station();
596 int tp_ring = tp_detId.
ring();
597 int tp_chamber = tp_detId.
chamber();
599 int tp_bx = tp_data.bx;
600 int tp_csc_ID = tp_data.cscID;
614 emtf_assert(0 < tp_data.quality && tp_data.quality < max_quality);
620 if (!(tp_data.strip < max_strip)) {
621 edm::LogWarning(
"L1T") <<
"Found error in LCT strip: " << tp_data.strip <<
" (allowed range: 0-"
622 << max_strip - 1 <<
").";
624 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
625 << tp_ring <<
", cscid " << tp_csc_ID
626 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
630 if (!(tp_data.keywire < max_wire)) {
631 edm::LogWarning(
"L1T") <<
"Found error in LCT wire: " << tp_data.keywire <<
" (allowed range: 0-"
632 << max_wire - 1 <<
").";
634 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
635 << tp_ring <<
", cscid " << tp_csc_ID
636 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
640 if (!(tp_data.valid ==
true)) {
641 edm::LogWarning(
"L1T") <<
"Found error in LCT valid: " << tp_data.valid <<
" (allowed value: 1).";
643 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
644 << tp_ring <<
", cscid " << tp_csc_ID
645 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
649 if (!(tp_data.pattern < max_pattern)) {
650 edm::LogWarning(
"L1T") <<
"Found error in LCT pattern: " << tp_data.pattern <<
" (allowed range: 0-"
651 << max_pattern - 1 <<
").";
653 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
654 << tp_ring <<
", cscid " << tp_csc_ID
655 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
659 if (!(0 < tp_data.quality && tp_data.quality < max_quality)) {
660 edm::LogWarning(
"L1T") <<
"Found error in LCT quality: " << tp_data.quality <<
" (allowed range: 1-"
661 << max_quality - 1 <<
").";
663 <<
"From endcap " << tp_endcap <<
", sector " << tp_sector <<
", station " << tp_station <<
", ring "
664 << tp_ring <<
", cscid " << tp_csc_ID
665 <<
". (Note that this LCT may be reported multiple times. See source code for explanations.)";
672 int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
675 selected =
get_index_csc(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_bx);
685 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID)
const {
686 auto get_neighbor = [](
int sector) {
return (sector == 1) ? 6 : sector - 1; };
689 if ((
endcap_ == tp_endcap) && (get_neighbor(
sector_) == tp_sector)) {
690 if (tp_station == 1) {
691 if ((tp_subsector == 2) && (tp_csc_ID == 3 || tp_csc_ID == 6 || tp_csc_ID == 9))
695 if (tp_csc_ID == 3 || tp_csc_ID == 9)
705 return (
bx_ == tp_bx);
710 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_bx)
const {
713 bool is_native =
false;
714 bool is_neighbor =
false;
722 if (!is_native && !is_neighbor)
726 if (tp_station == 1) {
727 selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
729 selected = (tp_station)*9 + (tp_csc_ID - 1);
733 if (tp_station == 1) {
734 selected = (5) * 9 + (tp_csc_ID - 1) / 3;
736 selected = (5) * 9 + (tp_station)*2 - 1 + (tp_csc_ID - 1 < 3 ? 0 : 1);
752 int tp_region = tp_detId.
region();
753 int tp_endcap = (tp_region == -1) ? 2 : tp_region;
754 int tp_sector = tp_detId.
sector();
756 int tp_station = tp_detId.
station();
757 int tp_ring = tp_detId.
ring();
758 int tp_roll = tp_detId.
roll();
761 int tp_bx = tp_data.bx;
762 int tp_strip = tp_data.strip;
763 int tp_emtf_sect = tp_data.emtf_sector;
764 bool tp_CPPF = tp_data.isCPPF;
767 if (tp_CPPF && (tp_emtf_sect !=
sector_))
770 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
776 emtf_assert(1 <= tp_subsector && tp_subsector <= 6);
778 emtf_assert((!is_irpc && 2 <= tp_ring && tp_ring <= 3) || (is_irpc && tp_ring == 1));
779 emtf_assert((!is_irpc && 1 <= tp_roll && tp_roll <= 3) || (is_irpc && 1 <= tp_roll && tp_roll <= 5));
781 emtf_assert((!is_irpc && (tp_CPPF || (1 <= tp_strip && tp_strip <= 32))) ||
782 (is_irpc && 1 <= tp_strip && tp_strip <= 96 * 2));
788 selected =
get_index_rpc(tp_endcap, tp_station, tp_ring, tp_sector, tp_subsector, tp_bx);
794 int tp_endcap,
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector)
const {
799 auto get_csc_sector = [](
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector) {
800 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
803 int corr = (tp_subsector < 2) ? (tp_sector == 1 ? +5 : -1) : 0;
804 return tp_sector +
corr;
807 int corr = (tp_subsector < 3) ? (tp_sector == 1 ? +5 : -1) : 0;
808 return tp_sector +
corr;
811 return ((
endcap_ == tp_endcap) && (
sector_ == get_csc_sector(tp_station, tp_ring, tp_sector, tp_subsector)));
815 int tp_endcap,
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector)
const {
816 auto get_neighbor_subsector = [](
int tp_station,
int tp_ring) {
817 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
827 (tp_subsector == get_neighbor_subsector(tp_station, tp_ring)));
832 return (
bx_ == tp_bx);
836 int tp_endcap,
int tp_station,
int tp_ring,
int tp_sector,
int tp_subsector,
int tp_bx)
const {
839 bool is_native =
false;
840 bool is_neighbor =
false;
842 if (
is_in_sector_rpc(tp_endcap, tp_station, tp_ring, tp_sector, tp_subsector)) {
848 if (!is_native && !is_neighbor)
864 const bool is_irpc = (tp_station == 3 || tp_station == 4) && (tp_ring == 1);
868 rpc_sub = ((tp_subsector + 3) % 6);
870 rpc_sub = ((tp_subsector + 1) % 3);
876 if (tp_station <= 2 && tp_ring == 2) {
877 rpc_chm = (tp_station - 1);
878 }
else if (tp_station >= 3 && tp_ring >= 2) {
879 rpc_chm = 2 + (tp_station - 3) * 2 + (tp_ring - 2);
880 }
else if (tp_station <= 2 && tp_ring == 3) {
881 rpc_chm = 6 + (tp_station - 1);
882 }
else if (tp_station >= 3 && tp_ring == 1) {
883 rpc_chm = 8 + (tp_station - 3);
886 selected = (rpc_sub * 10) + rpc_chm;
904 int tp_region = tp_detId.
region();
905 int tp_endcap = (tp_region == -1) ? 2 : tp_region;
906 int tp_station = tp_detId.
station();
907 int tp_ring = tp_detId.
ring();
908 int tp_roll = tp_detId.
roll();
909 int tp_layer = tp_detId.
layer();
910 int tp_chamber = tp_detId.
chamber();
912 int tp_bx = tp_data.bx;
913 int tp_pad = ((tp_data.pad_low + tp_data.pad_hi) / 2);
920 int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
931 emtf_assert((tp_station == 1 && 0 <= tp_pad && tp_pad <= 191) || (tp_station != 1));
932 emtf_assert((tp_station == 2 && 0 <= tp_pad && tp_pad <= 383) || (tp_station != 2));
936 selected =
get_index_gem(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_bx);
947 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID)
const {
954 return (
bx_ == tp_bx);
958 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_bx)
const {
961 bool is_native =
false;
962 bool is_neighbor =
false;
970 if (!is_native && !is_neighbor)
974 if (tp_station == 1) {
975 selected = (tp_subsector - 1) * 3 + (tp_csc_ID - 1);
977 selected = 6 + (tp_csc_ID - 1);
981 if (tp_station == 1) {
1003 int tp_region = tp_detId.
region();
1004 int tp_endcap = (tp_region == -1) ? 2 : tp_region;
1005 int tp_station = tp_detId.
station();
1009 int tp_chamber = tp_detId.
chamber();
1011 int tp_bx = tp_data.bx;
1012 int tp_pad = tp_data.phiposition;
1013 int tp_partition = tp_data.partition;
1019 int tp_subsector = 0;
1031 emtf_assert(0 <= tp_partition && tp_partition <= 15);
1035 selected =
get_index_me0(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_pad, tp_bx);
1047 auto get_other_neighbor = [](
int sector) {
return (sector == 6) ? 1 : sector + 1; };
1049 bool add5deg =
false;
1050 bool sub5deg =
false;
1052 if ((
endcap_ == tp_endcap) && (get_other_neighbor(
sector_) == tp_sector)) {
1053 if (tp_csc_ID == 1 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1055 }
else if (tp_csc_ID == 1 && tp_endcap == 2 && tp_pad <= 191) {
1060 if (tp_csc_ID == 1 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1062 }
else if (tp_csc_ID == 1 && tp_endcap == 2 && tp_pad <= 191) {
1078 auto get_neighbor = [](
int sector) {
return (sector == 1) ? 6 : sector - 1; };
1080 bool add5deg =
false;
1081 bool sub5deg =
false;
1083 if ((
endcap_ == tp_endcap) && (get_neighbor(
sector_) == tp_sector)) {
1084 if (tp_csc_ID == 3 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1086 }
else if (tp_csc_ID == 3 && tp_endcap == 2 && tp_pad <= 191) {
1091 if (tp_csc_ID == 1 && tp_endcap == 1 && tp_pad >= (767 - 192)) {
1093 }
else if (tp_csc_ID == 1 && tp_endcap == 2 && tp_pad <= 191) {
1104 return (
bx_ == tp_bx);
1108 int tp_endcap,
int tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_pad,
int tp_bx)
const {
1111 bool is_native =
false;
1112 bool is_neighbor =
false;
1120 if (!is_native && !is_neighbor)
1124 selected = 9 + (tp_csc_ID - 1);
1141 int tp_wheel = tp_detId.
wheel();
1142 int tp_station = tp_detId.
station();
1143 int tp_sector = tp_detId.
sector();
1148 if (tp_station == 4) {
1149 if (tp_sector == 13)
1151 else if (tp_sector == 14)
1155 int tp_bx = tp_data.bx;
1156 int tp_phi = tp_data.radialAngle;
1163 int tp_endcap = (tp_wheel > 0) ? 1 : ((tp_wheel < 0) ? 2 : 0);
1166 int tp_subsector = 0;
1183 selected =
get_index_dt(tp_endcap, csc_tp_sector, tp_subsector, tp_station, tp_csc_ID, tp_bx);
1201 return (
bx_ == tp_bx);
1205 int tp_endcap,
int csc_tp_sector,
int tp_subsector,
int tp_station,
int tp_csc_ID,
int tp_bx)
const {
1208 bool is_native =
false;
1209 bool is_neighbor =
false;
1217 if (!is_native && !is_neighbor)
1221 selected = (tp_station - 1) * 2 + (tp_csc_ID - 6) / 3;
1223 selected = 8 + (tp_station - 1);
ME0Data getME0Data() const
int get_index_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector, int tp_bx) const
bool is_in_sector_dt(int tp_endcap, int tp_sector) const
bool is_in_sector_csc(int tp_endcap, int tp_sector) const
int get_trigger_sector(int ring, int station, int chamber)
bool is_in_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const
int get_index_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const
constexpr int roll() const
int select_me0(const TriggerPrimitive &muon_primitive) const
std::pair< int, int > get_csc_max_pattern_and_quality(int station, int ring)
CSCData getCSCData() const
GEMData getGEMData() const
int select_gem(const TriggerPrimitive &muon_primitive) const
bool is_in_sector_gem(int tp_endcap, int tp_sector) const
bool is_in_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const
int get_trigger_csc_ID(int ring, int station, int chamber)
bool is_in_neighbor_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const
void configure(int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, int bxShiftME0, bool includeNeighbor, bool duplicateTheta, bool bugME11Dupes)
constexpr int MIN_TRIGSECTOR
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Container::value_type value_type
bool is_in_bx_gem(int tp_bx) const
static constexpr int verbose
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool is_in_bx_me0(int tp_bx) const
CSCData & accessCSCData()
constexpr int region() const
int select_rpc(const TriggerPrimitive &muon_primitive) const
int select_csc(const TriggerPrimitive &muon_primitive) const
void process(T tag, const TriggerPrimitiveCollection &muon_primitives, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
bool is_in_neighbor_sector_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
bool is_in_bx_csc(int tp_bx) const
subsystem_type subsystem() const
int select_dt(const TriggerPrimitive &muon_primitive) const
constexpr int chamber() const
int get_index_me0(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_pad, int tp_bx) const
constexpr int ring() const
bool is_in_bx_rpc(int tp_bx) const
constexpr int layer() const
bool is_in_neighbor_sector_dt(int tp_endcap, int tp_sector, int tp_csc_ID) const
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
constexpr int station() const
void merge_no_truncate(const std::map< int, TriggerPrimitiveCollection > &selected_dt_map, const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, const std::map< int, TriggerPrimitiveCollection > &selected_me0_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
int triggerSector() const
std::pair< int, int > get_csc_max_strip_and_wire(int station, int ring)
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
void merge(const std::map< int, TriggerPrimitiveCollection > &selected_dt_map, const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, const std::map< int, TriggerPrimitiveCollection > &selected_me0_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
int get_index_dt(int tp_endcap, int csc_tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const
RPCData getRPCData() const
constexpr int MAX_TRIGSECTOR
bool is_in_bx_dt(int tp_bx) const
Log< level::Warning, false > LogWarning
int get_index_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const
int station() const
Return the station number.
int wheel() const
Return the wheel number.
Int_t triggerSector(Int_t station, Int_t ring, Int_t chamber) const
L1TMuon::TriggerPrimitiveCollection TriggerPrimitiveCollection
tuple size
Write out results.
bool is_in_neighbor_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const
bool is_in_neighbor_sector_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.