281 filteredHits.clear();
286 std::vector< std::pair<FPGATrackSimHit,unsigned> > filteredHits_ID, hits_to_filter;
288 for (
const auto &hit :
hits) {
290 std::pair<FPGATrackSimHit,unsigned> hit_ID;
297 if( std::any_of(
std::begin(filter_pixel_physLayers),
std::end(filter_pixel_physLayers),
298 [&](
unsigned i) {
return i == hit.getPhysLayer(); }) )
299 hits_to_filter.push_back(hit_ID);
301 filteredHits_ID.push_back(hit_ID);
305 if( std::any_of(
std::begin(filter_strip_physLayers),
std::end(filter_strip_physLayers),
306 [&](
unsigned i) {
return i == hit.getPhysLayer(); }) )
307 hits_to_filter.push_back(hit_ID);
309 filteredHits_ID.push_back(hit_ID);
314 std::vector< std::pair<FPGATrackSimHit,unsigned> > hits_to_filter_inner, hits_to_filter_outer;
319 for (
const auto &hit : hits_to_filter) {
320 if (hit.first.getPhysLayer() % 2 == 0)
321 hits_to_filter_inner.push_back(hit);
323 hits_to_filter_outer.push_back(hit);
327 std::vector< std::pair<FPGATrackSimHit,unsigned> > passed_inner_hits, passed_outer_hits;
328 for (
const auto &innerHit : hits_to_filter_inner) {
329 std::vector<std::pair<FPGATrackSimHit,unsigned>> nearby_outer_hits;
336 for (
const auto &outerHit : nearby_outer_hits) {
337 bool hitPassed =
check_hit_stub(innerHit.first, outerHit.first, cut_m, cut_p);
340 passed_inner_hits.push_back(innerHit);
341 passed_outer_hits.push_back(outerHit);
347 std::vector< std::pair<FPGATrackSimHit,unsigned> > passed_outer_hits_unique;
348 for (
const auto &hit : passed_outer_hits) {
349 auto it = std::find_if(passed_outer_hits_unique.begin(), passed_outer_hits_unique.end(),
350 [&hit](
const std::pair<FPGATrackSimHit,unsigned>&
h) {return h.second == hit.second;} );
351 if(
it == passed_outer_hits_unique.end()) {
352 passed_outer_hits_unique.push_back(hit);
355 std::vector< std::pair<FPGATrackSimHit,unsigned> > passed_inner_hits_unique;
356 for (
const auto &hit : passed_inner_hits) {
357 auto it = std::find_if(passed_inner_hits_unique.begin(), passed_inner_hits_unique.end(),
358 [&hit](
const std::pair<FPGATrackSimHit,unsigned>&
h) {return h.second == hit.second;} );
359 if(
it == passed_inner_hits_unique.end()) {
360 passed_inner_hits_unique.push_back(hit);
366 for (
auto &hit : passed_inner_hits_unique) {
367 filteredHits_ID.push_back(hit);
369 for (
const auto &hit : passed_outer_hits_unique) {
370 filteredHits_ID.push_back(hit);
374 std::sort(filteredHits_ID.begin(), filteredHits_ID.end(),
375 [](
const std::pair<FPGATrackSimHit,unsigned> & hit1,
const std::pair<FPGATrackSimHit,unsigned> & hit2){
376 return hit1.second < hit2.second;
378 for (
const auto &hit_ID : filteredHits_ID) {
379 filteredHits.push_back(hit_ID.first);