17 const std::map<int, int>& seg_to_hit,
18 const std::vector<track_t>&
tracks,
19 const bool& displaced_en,
34 const auto& site_seg_id =
track.site_segs[
i];
35 const auto& site_bit =
track.site_mask[
i];
36 const auto& site_rm_bit =
track.site_rm_mask[
i];
46 if ((site_bit == 1) || (site_rm_bit == 1)) {
47 hit_id = seg_to_hit.at(site_seg_id);
51 site_hits.push_back(hit_id);
52 site_segs.push_back(site_seg_id);
53 site_mask.push_back(site_bit);
54 site_rm_mask.push_back(site_rm_bit);
58 if (!
track.valid && hit_count == 0) {
66 model_features.push_back(
track.features[
i]);
75 auto& out_trk = out_tracks.emplace_back();
77 out_trk.setEndcap(endcap_pm);
80 out_trk.setUnconstrained(displaced_en ?
true :
false);
81 out_trk.setValid(
track.valid);
83 out_trk.setModelPtAddress(
track.pt_address);
84 out_trk.setModelRelsAddress(
track.rels_address);
85 out_trk.setModelDxyAddress(
track.dxy_address);
86 out_trk.setModelPattern(
track.pattern);
87 out_trk.setModelQual(
track.quality);
88 out_trk.setModelPhi(
track.phi);
89 out_trk.setModelEta(
track.theta);
90 out_trk.setModelFeatures(model_features);
92 out_trk.setEmtfQ(
track.q);
93 out_trk.setEmtfPt(
track.pt);
94 out_trk.setEmtfRels(
track.rels);
97 out_trk.setEmtfBeta(0);
98 out_trk.setEmtfModeV1(emtf_mode_v1);
99 out_trk.setEmtfModeV2(emtf_mode_v2);
100 out_trk.setEmtfQuality(emtf_quality);
102 out_trk.setSiteHits(site_hits);
103 out_trk.setSiteSegs(site_segs);
104 out_trk.setSiteMask(site_mask);
105 out_trk.setSiteRMMask(site_rm_mask);
168 int cnt_ye11 =
x[0] +
x[9];
169 int cnt_ye12 =
x[1] +
x[5];
170 int cnt_ye22 =
x[2] +
x[10] +
x[6];
171 int cnt_ye23 =
x[3] +
x[7];
172 int cnt_ye24 =
x[4] +
x[8];
173 int cnt_ye2a = (cnt_ye22 != 0) + (cnt_ye23 != 0) + (cnt_ye24 != 0);
174 int cnt_ye2b = (cnt_ye23 != 0) + (cnt_ye24 != 0);
177 int cnt_me14 =
x[11];
178 int cnt_me2a = (
x[2] != 0) + (
x[3] != 0) + (
x[4] != 0);
182 bool rule_a_i = (cnt_me12 != 0) and (cnt_me2a >= 1);
183 bool rule_a_ii = (cnt_ye12 != 0) and (cnt_me2a >= 1) and (cnt_ye2a >= 2);
184 bool rule_b_i = (cnt_me11 != 0) and (cnt_me2a >= 1) and (cnt_ye2a >= 2);
185 bool rule_b_ii = (cnt_ye11 != 0) and (cnt_me2a >= 2);
186 bool rule_c_i = (cnt_me14 != 0) and (cnt_me11 != 0) and (cnt_ye2b >= 1);
187 bool rule_c_ii = (cnt_me14 != 0) and (cnt_me2a >= 1) and (cnt_ye2a >= 2);
189 if (rule_a_i
or rule_a_ii
or rule_b_i
or rule_b_ii
or rule_c_i
or rule_c_ii) {
196 if (
mode < (1 << 3)) {
197 bool rule_a_i = (cnt_me12 != 0) and (cnt_ye2a >= 1);
198 bool rule_a_ii = (cnt_me11 != 0) and (cnt_ye2a >= 1);
199 bool rule_b_i = (cnt_ye12 != 0) and (cnt_me2a >= 1);
200 bool rule_b_ii = (cnt_ye11 != 0) and (cnt_me2a >= 1);
201 bool rule_c_i = (cnt_me14 != 0) and (cnt_me11 != 0) and (cnt_ye2a >= 1);
202 bool rule_c_ii = (cnt_me14 != 0) and (cnt_me2a >= 1);
204 if (rule_a_i
or rule_a_ii
or rule_b_i
or rule_b_ii
or rule_c_i
or rule_c_ii) {
210 if (
mode < (1 << 2)) {
211 bool rule_a_i = (cnt_me12 != 0) and (cnt_ye2a >= 1);
212 bool rule_a_ii = (cnt_me11 != 0) and (cnt_ye2a >= 1);
213 bool rule_b_i = (cnt_ye12 != 0) and (cnt_me2a >= 1);
214 bool rule_b_ii = (cnt_ye11 != 0) and (cnt_me2a >= 1);
215 bool rule_c_i = (cnt_me14 != 0) and (cnt_me11 != 0) and (cnt_ye2a >= 1);
216 bool rule_c_ii = (cnt_me14 != 0) and (cnt_me2a >= 1);
217 bool rule_d = (cnt_me2a >= 2);
219 if (rule_a_i
or rule_a_ii
or rule_b_i
or rule_b_ii
or rule_c_i
or rule_c_ii
or rule_d) {
229 if (
track.valid == 0) {
234 bool is_single_station = (mode_v1 == 0);
235 is_single_station |= (mode_v1 == 1);
236 is_single_station |= (mode_v1 == 2);
237 is_single_station |= (mode_v1 == 4);
238 is_single_station |= (mode_v1 == 8);
240 if (is_single_station) {
247 if ((0 <=
track.quality) && (
track.quality <= 3)) {
249 }
else if ((4 <=
track.quality) && (
track.quality <= 7)) {
251 }
else if (7 <
track.quality) {
256 }
else if (mode_v2 == 4) {
258 if ((8 <=
track.quality) && (
track.quality <= 11)) {
260 }
else if ((12 <=
track.quality) && (
track.quality <= 15)) {
262 }
else if (15 <
track.quality) {
267 }
else if (mode_v2 == 8) {
269 bool valid_mode = (mode_v1 == 9);
270 valid_mode |= (mode_v1 == 10);
271 valid_mode |= (mode_v1 == 12);
274 if ((16 <=
track.quality) && (
track.quality <= 23)) {
276 }
else if ((24 <=
track.quality) && (
track.quality <= 31)) {
278 }
else if (31 <
track.quality) {
284 }
else if (mode_v2 == 12) {
286 bool valid_mode = (mode_v1 == 11);
287 valid_mode |= (mode_v1 == 13);
288 valid_mode |= (mode_v1 == 14);
289 valid_mode |= (mode_v1 == 15);
292 if ((32 <=
track.quality) && (
track.quality <= 39)) {
294 }
else if ((40 <=
track.quality) && (
track.quality <= 51)) {
296 }
else if (51 <
track.quality) {
std::vector< int16_t > features_t
int findEMTFQuality(const track_t &, const int &, const int &) const
l1t::phase2::EMTFTrackCollection EMTFTrackCollection
constexpr int kNumTrackFeatures
int findEMTFModeV2(const track_t::site_mask_t &) const
int findEMTFModeV1(const track_t::site_mask_t &) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< uint8_t > site_mask_t
Abs< T >::type abs(const T &t)
std::vector< uint16_t > site_segs_t
std::vector< uint16_t > site_hits_t
constexpr int kNumTrackSites
OutputLayer(const EMTFContext &)
void apply(const int &, const int &, const int &, const std::map< int, int > &, const std::vector< track_t > &, const bool &, EMTFTrackCollection &) const
std::array< trk_site_bit_t, v3::kNumTrackSites > site_mask_t