9#include <ext/functional>
23 declareInterface<IAmbiTrackSelectionTool>(
this);
32 return StatusCode::SUCCESS;
39 unsigned int numshared{0}, numhits{0}, numPhiHits{0};
42 return std::make_tuple(
nullptr,
false);
46 ATH_MSG_VERBOSE(
"trackId " << trackId <<
", subtrackId " << subtrackId);
48 std::map<Muon::MuonStationIndex::StIndex, int> sharedPrecisionPerLayer;
49 std::map<Muon::MuonStationIndex::StIndex, int> precisionPerLayer;
50 auto is_shared = [&sharedPrecisionPerLayer, &precisionPerLayer,
this, &numshared, &numhits, &prd_to_track_map,
52 if (!rot || !rot->prepRawData())
return;
53 const Identifier rot_id = rot->prepRawData()->identify();
61 ++precisionPerLayer[stIndex];
63 if (!prd_to_track_map.
isUsed(*(rot->prepRawData()))) {
return; }
67 ++sharedPrecisionPerLayer[stIndex];
83 for (
unsigned int i = 0; i < numROTs; ++i) {
97 return std::make_tuple(
nullptr,
false);
99 const double overlapFraction = (double)numshared / (
double)numhits;
101 ATH_MSG_VERBOSE(
"Track " <<
m_printer->print(*track) <<
" has " << numhits <<
" hit, shared " << numshared <<
" overlap fraction "
102 << overlapFraction <<
" layers " << precisionPerLayer.size() <<
" shared " << sharedPrecisionPerLayer.size());
106 if (sharedPrecisionPerLayer.empty()) {
107 ATH_MSG_DEBUG(
"Track is not sharing precision hits, keeping ");
108 return std::make_tuple(
nullptr,
true);
110 if (overlapFraction < 0.25 && precisionPerLayer.size() > 2 && precisionPerLayer.size() - sharedPrecisionPerLayer.size() == 1) {
111 ATH_MSG_DEBUG(
"Three station track differing by one precision layer, keeping ");
112 return std::make_tuple(
nullptr,
true);
114 if (overlapFraction < 0.35 && precisionPerLayer.size() > 2 && precisionPerLayer.size() - sharedPrecisionPerLayer.size() > 1 &&
116 ATH_MSG_DEBUG(
"Three station track differing by more than one precision layer, keeping ");
117 return std::make_tuple(
nullptr,
true);
120 return std::make_tuple(
nullptr,
false);
123 return std::make_tuple(
nullptr,
true);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
An STL vector of pointers that by default owns its pointed-to elements.
Container to associate Cluster with cluster splitting probabilities.
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
This class is the pure abstract base class for all fittable tracking measurements.
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
StIndex
enum to classify the different station layers in the muon spectrometer