17 input_token_(i_consumes_collector.consumes<
RPCTag::rechit_collection_type>(
context.config_.rpc_input_)) {}
21 static const int clus_width_cut = 4;
22 static const int clus_width_cut_irpc = 6;
30 auto digi = rpc_digis->begin();
31 auto digi_end = rpc_digis->end();
33 for (; digi != digi_end; ++digi) {
34 tpc.emplace_back(digi->rpcId(), *digi);
38 for (
auto& tp_entry : tpc) {
39 const auto& tp_det_id = tp_entry.tp_.detId<
RPCDetId>();
40 const RPCData& tp_data = tp_entry.tp_.getRPCData();
42 const int tp_region = tp_det_id.region();
43 const int tp_endcap = (tp_region == -1) ? 2 : tp_region;
44 const int tp_endcap_pm = (tp_endcap == 2) ? -1 : tp_endcap;
48 const int tp_rpc_sector = tp_det_id.sector();
52 const int tp_rpc_subsector = tp_det_id.subsector();
54 const int tp_station = tp_det_id.station();
55 const int tp_ring = tp_det_id.ring();
58 const int tp_layer = tp_det_id.layer();
60 const int tp_strip = (tp_data.strip_low + tp_data.strip_hi) / 2;
61 const int tp_strip_lo = tp_data.strip_low;
62 const int tp_strip_hi = tp_data.strip_hi;
63 const int tp_clus_width = (tp_strip_hi - tp_strip_lo + 1);
65 const bool tp_is_CPPF = tp_data.isCPPF;
70 bool tp_is_substitute = (tp_ring == 3);
73 const bool tp_is_barrel = (tp_region == 0);
77 if ((!tp_is_barrel) && (tp_station >= 3) && (tp_ring == 1)) {
89 if (tp_station <= 2 && tp_ring == 3) {
95 if (tp_clus_width > clus_width_cut_irpc) {
99 if (tp_clus_width > clus_width_cut) {
108 tp_chamber = (tp_rpc_sector - 1) * 3 + tp_rpc_subsector;
110 tp_chamber = (tp_rpc_sector - 1) * 6 + tp_rpc_subsector;
115 const int tp_csc_id =
csc::getId(tp_station, tp_ring, tp_chamber);
121 emtf_assert(0 <= tp_subsector && tp_subsector <= 2);
124 emtf_assert((1 <= tp_csc_id) and (tp_csc_id <= 9));
133 emtf_assert(tp_is_CPPF || (1 <= tp_strip && tp_strip <= 32));
139 tp_entry.info_.bx = tp_bx;
141 tp_entry.info_.endcap = tp_endcap;
142 tp_entry.info_.endcap_pm = tp_endcap_pm;
143 tp_entry.info_.sector = tp_sector;
144 tp_entry.info_.subsector = tp_subsector;
145 tp_entry.info_.station = tp_station;
146 tp_entry.info_.ring = tp_ring;
147 tp_entry.info_.roll = tp_roll;
148 tp_entry.info_.layer = tp_layer;
149 tp_entry.info_.chamber = tp_chamber;
151 tp_entry.info_.csc_id = tp_csc_id;
152 tp_entry.info_.csc_facing = tp_csc_facing;
154 tp_entry.info_.rpc_type = tp_rpc_type;
156 tp_entry.info_.flag_substitute = tp_is_substitute;
158 bx_tpc_map[tp_bx].push_back(tp_entry);
int getId(int ring, int station, int chamber)
int getTriggerSubsector(int station, int chamber)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::map< int, TPCollection > BXTPCMap
const EMTFContext & context_
int getTriggerSector(int ring, int station, int chamber)
const edm::EDGetToken input_token_
Facing getFaceDirection(int station, int ring, int chamber)
RPCTPCollector(const EMTFContext &, edm::ConsumesCollector &)
constexpr int kMinTrigSector
constexpr int kMaxTrigSector
std::vector< TPEntry > TPCollection
void collect(const edm::Event &, BXTPCMap &) const final
EMTFConfiguration config_