18 input_token_(i_consumes_collector.consumes<
ME0Tag::collection_type>(
context.config_.me0_input_)) {}
23 static const int me0_max_partition = 9;
24 static const int me0_nstrips = 384;
25 static const int me0_nphipositions = me0_nstrips * 2;
26 static const int phiposition_q1 = me0_nphipositions / 4;
27 static const int phiposition_q3 = (me0_nphipositions / 4) * 3;
35 auto chamber = me0_digis->begin();
36 auto chend = me0_digis->end();
39 auto digi = (*chamber).second.first;
40 auto dend = (*chamber).second.second;
42 for (; digi != dend; ++digi) {
43 tpc.emplace_back((*chamber).first, *digi);
48 for (
auto& tp_entry : tpc) {
49 const auto& tp_det_id = tp_entry.tp_.detId<
ME0DetId>();
50 const ME0Data& tp_data = tp_entry.tp_.getME0Data();
52 const int tp_region = tp_det_id.region();
53 const int tp_endcap = (tp_region == -1) ? 2 : tp_region;
54 const int tp_endcap_pm = (tp_endcap == 2) ? -1 : tp_endcap;
55 const int tp_station = tp_det_id.station();
56 const int tp_ring = 4;
57 const int tp_layer = tp_det_id.layer();
58 const int tp_roll = tp_det_id.roll();
59 const int tp_me0_chamber = tp_det_id.chamber();
62 const int tp_partition = tp_data.partition;
66 if (tp_partition > me0_max_partition) {
74 const int tp_phiposition = tp_data.phiposition;
76 int tp_chamber = (tp_me0_chamber - 1) * 2 + 1;
81 if (tp_phiposition < phiposition_q1) {
83 }
else if (tp_phiposition < phiposition_q3) {
91 if (tp_phiposition < phiposition_q1) {
93 }
else if (tp_phiposition < phiposition_q3) {
102 const int tp_csc_id =
csc::getId(tp_station, tp_ring, tp_chamber);
108 emtf_assert((1 <= tp_subsector) and (tp_subsector <= 2));
111 emtf_assert((1 <= tp_chamber) and (tp_chamber <= 36));
114 emtf_assert(0 <= tp_partition && tp_partition <= 15);
117 tp_entry.info_.bx = tp_bx;
119 tp_entry.info_.endcap = tp_endcap;
120 tp_entry.info_.endcap_pm = tp_endcap_pm;
121 tp_entry.info_.sector = tp_sector;
122 tp_entry.info_.subsector = tp_subsector;
123 tp_entry.info_.station = tp_station;
124 tp_entry.info_.ring = tp_ring;
125 tp_entry.info_.layer = tp_layer;
126 tp_entry.info_.roll = tp_roll;
127 tp_entry.info_.chamber = tp_chamber;
129 tp_entry.info_.csc_id = tp_csc_id;
130 tp_entry.info_.csc_facing = tp_csc_facing;
132 bx_tpc_map[tp_bx].push_back(tp_entry);
ME0TPCollector(const EMTFContext &, edm::ConsumesCollector &)
int getId(int ring, int station, int chamber)
const EMTFContext & context_
int getTriggerSubsector(int station, int chamber)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::map< int, TPCollection > BXTPCMap
void collect(const edm::Event &, BXTPCMap &) const final
int getNext10DegChamber(int chamber)
int getTriggerSector(int ring, int station, int chamber)
Facing getFaceDirection(int station, int ring, int chamber)
constexpr int kMinTrigSector
int getPrev10DegChamber(int chamber)
constexpr int kMaxTrigSector
const edm::EDGetToken input_token_
std::vector< TPEntry > TPCollection
EMTFConfiguration config_