Skip to content

Commit

Permalink
Merge pull request #36364 from slava77/CMSSW_12_1_0_pre5/sign1129/ele…
Browse files Browse the repository at this point in the history
…IsoOriginalAlgo

check both algo and originalAlgo in electron track isolation calculators
  • Loading branch information
cmsbuild authored Dec 10, 2021
2 parents 2068c43 + c0aec63 commit ce6fe13
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 ce6fe13

Please sign in to comment.