Skip to content

Commit

Permalink
Protect against invalid trajectory state on surface in STA muon reco
Browse files Browse the repository at this point in the history
  • Loading branch information
mandrenguyen committed May 26, 2024
1 parent 32dc277 commit addd479
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions RecoMuon/StandAloneTrackFinder/src/StandAloneMuonFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ void StandAloneMuonFilter::refit(const TrajectoryStateOnSurface& initialTSOS,
LogTrace(metname) << "search Trajectory Measurement from: " << lastTSOS.globalPosition();

// pick the best measurement from each group
std::vector<TrajectoryMeasurement> bestMeasurements = findBestMeasurements(*layer, lastTSOS);
std::vector<TrajectoryMeasurement> bestMeasurements{};

if (lastTSOS.isValid())
bestMeasurements = findBestMeasurements(*layer, lastTSOS);
else
edm::LogInfo(metname) << "Invalid last TSOS, will not find best measurements ";

// RB: Different ways can be choosen if no bestMeasurement is available:
// 1- check on lastTSOS-initialTSOS eta difference
Expand All @@ -251,15 +256,23 @@ void StandAloneMuonFilter::refit(const TrajectoryStateOnSurface& initialTSOS,
if (bestMeasurements.empty() && lastdEta > 0.1) {
LogTrace(metname) << "No measurement and big eta variation wrt seed" << endl
<< "trying with lastButOneUpdatedTSOS";
bestMeasurements = findBestMeasurements(*layer, theLastButOneUpdatedTSOS);

if (theLastButOneUpdatedTSOS.isValid())
bestMeasurements = findBestMeasurements(*layer, theLastButOneUpdatedTSOS);
else
edm::LogInfo(metname) << "Invalid last but one updated TSOS, will not find best measurements ";
}

//if no measurement found and the current FTS has an eta very different
//wrt the initial one (i.e. seed), then try to find the measurements
//according to the initial FTS. (1A)
if (bestMeasurements.empty() && lastdEta > 0.1) {
LogTrace(metname) << "No measurement and big eta variation wrt seed" << endl << "tryng with seed TSOS";
bestMeasurements = findBestMeasurements(*layer, initialTSOS);

if (initialTSOS.isValid())
bestMeasurements = findBestMeasurements(*layer, initialTSOS);
else
edm::LogInfo(metname) << "Invalid initial TSOS, will not find best measurements ";
}

// FIXME: uncomment this line!!
Expand Down

0 comments on commit addd479

Please sign in to comment.