Skip to content

Commit

Permalink
check both algo and originalAlgo in electron track isolation calculators
Browse files Browse the repository at this point in the history
  • Loading branch information
slava77devel committed Dec 4, 2021
1 parent f496aeb commit c0aec63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion RecoEgamma/EgammaIsolationAlgos/src/EleTkIsolFromCands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ bool EleTkIsolFromCands::passQual(const reco::TrackBase& trk, const std::vector<

bool EleTkIsolFromCands::passAlgo(const reco::TrackBase& trk,
const std::vector<reco::TrackBase::TrackAlgorithm>& algosToRej) {
return algosToRej.empty() || !std::binary_search(algosToRej.begin(), algosToRej.end(), trk.algo());
return algosToRej.empty() ||
//check also the originalAlgo in case the track is reconstructed by more than one
//reject only if both algo and originalAlgo are not acceptable
!(std::binary_search(algosToRej.begin(), algosToRej.end(), trk.algo()) &&
std::binary_search(algosToRej.begin(), algosToRej.end(), trk.originalAlgo()));
}

EleTkIsolFromCands::TrackTable const& EleTkIsolFromCands::getPreselectedTracks(bool isBarrel) {
Expand Down
6 changes: 5 additions & 1 deletion RecoEgamma/EgammaIsolationAlgos/src/ElectronTkIsolation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ double ElectronTkIsolation::getPtTracks(const reco::GsfElectron* electron) const
bool ElectronTkIsolation::passAlgo(const reco::TrackBase& trk) const {
int algo = trk.algo();
bool rejAlgo = std::binary_search(algosToReject_.begin(), algosToReject_.end(), algo);
return rejAlgo == false;
//check also the originalAlgo in case the track is reconstructed by more than one
algo = trk.originalAlgo();
//reject only if both algo and originalAlgo are not acceptable
rejAlgo &= std::binary_search(algosToReject_.begin(), algosToReject_.end(), algo);
return !rejAlgo;
}

void ElectronTkIsolation::setAlgosToReject() {
Expand Down

0 comments on commit c0aec63

Please sign in to comment.