From 69b07cc5877db6127a73bd2bfc81aa585c795683 Mon Sep 17 00:00:00 2001 From: Robert John Bainbridge Date: Fri, 2 Oct 2009 16:20:39 +0000 Subject: [PATCH] --- yaml --- r: 74621 b: "refs/heads/CMSSW_7_1_X" c: 2158d5f918db541342b2acf32150206cc5004a2d h: "refs/heads/CMSSW_7_1_X" i: 74619: 8ac629f700933b3ea81fbf9ab35f69b2337d7a51 v: v3 --- [refs] | 2 +- .../interface/JetPlusTrackCorrector.h | 2 +- .../Algorithms/src/JetPlusTrackCorrector.cc | 27 +++++++++---------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index caa7fa6a912da..f0e41e516617b 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": f65652c983510068edf92f7e6bafbcbe525707ea +"refs/heads/CMSSW_7_1_X": 2158d5f918db541342b2acf32150206cc5004a2d diff --git a/trunk/JetMETCorrections/Algorithms/interface/JetPlusTrackCorrector.h b/trunk/JetMETCorrections/Algorithms/interface/JetPlusTrackCorrector.h index bc7eaaa7ee86b..502576dadd9b9 100644 --- a/trunk/JetMETCorrections/Algorithms/interface/JetPlusTrackCorrector.h +++ b/trunk/JetMETCorrections/Algorithms/interface/JetPlusTrackCorrector.h @@ -216,7 +216,7 @@ class JetPlusTrackCorrector : public JetCorrector { P4 pionCorrection( const P4& jet, const jpt::MatchedTracks& pions ) const; /// Calculates correction to be applied using muons - P4 muonCorrection( const P4& jet, const jpt::MatchedTracks& muons, bool ) const; + P4 muonCorrection( const P4& jet, const jpt::MatchedTracks& muons ) const; /// Calculates correction to be applied using electrons P4 elecCorrection( const P4& jet, const jpt::MatchedTracks& elecs ) const; diff --git a/trunk/JetMETCorrections/Algorithms/src/JetPlusTrackCorrector.cc b/trunk/JetMETCorrections/Algorithms/src/JetPlusTrackCorrector.cc index 5b0435a408cb9..104cecc34757f 100644 --- a/trunk/JetMETCorrections/Algorithms/src/JetPlusTrackCorrector.cc +++ b/trunk/JetMETCorrections/Algorithms/src/JetPlusTrackCorrector.cc @@ -124,7 +124,7 @@ double JetPlusTrackCorrector::correction( const reco::Jet& fJet, if ( usePions_ ) { corrected += pionCorrection( fJet.p4(), pions ); } // Muon corrections (both scalar and vectorial) - if ( useMuons_ ) { corrected += muonCorrection( fJet.p4(), muons, !pions.inVertexOutOfCalo_.empty() ); } + if ( useMuons_ ) { corrected += muonCorrection( fJet.p4(), muons ); } // Electrons corrections (both scalar and vectorial) if ( useElecs_ ) { corrected += elecCorrection( fJet.p4(), elecs ); } @@ -359,7 +359,7 @@ void JetPlusTrackCorrector::matchTracks( const JetTracks& jet_tracks, else { pions.inVertexInCalo_.push_back(*it); } } else { if ( is_muon ) { muons.inVertexOutOfCalo_.push_back(*itrk); } - //else if ( is_ele ) { elecs.inVertexOutOfCalo_.push_back(*itrk); } //@@ bug? + else if ( is_ele ) { elecs.inVertexOutOfCalo_.push_back(*itrk); } else { pions.inVertexOutOfCalo_.push_back(*itrk); } } } @@ -380,10 +380,10 @@ void JetPlusTrackCorrector::matchTracks( const JetTracks& jet_tracks, if ( !found ) { bool is_muon = useMuons_ && matchMuons( itrk, reco_muons ); - bool is_ele = false; //@@ bug? useElecs_ && matchElectrons( itrk, reco_elecs, reco_elec_ids ); + bool is_ele = useElecs_ && matchElectrons( itrk, reco_elecs, reco_elec_ids ); if ( is_muon ) { muons.outOfVertexInCalo_.push_back(*itrk); } - else if ( is_ele ) { elecs.outOfVertexInCalo_.push_back(*itrk); } //@@ bug? + else if ( is_ele ) { elecs.outOfVertexInCalo_.push_back(*itrk); } else { pions.outOfVertexInCalo_.push_back(*itrk); } } @@ -475,8 +475,8 @@ bool JetPlusTrackCorrector::findTrack( const MatchedTracks& pions, elecs.inVertexInCalo_.end(), *itrk ); if ( ip == pions.inVertexInCalo_.end() && - im == muons.inVertexInCalo_.end() /* && */ ) { - /* ie == elecs.inVertexInCalo_.end() ) { */ return false; } //@@ bug? + im == muons.inVertexInCalo_.end() && + ie == elecs.inVertexInCalo_.end() ) { return false; } else { return true; } } @@ -485,9 +485,9 @@ bool JetPlusTrackCorrector::findTrack( const MatchedTracks& pions, bool JetPlusTrackCorrector::tracksInCalo( const MatchedTracks& pions, const MatchedTracks& muons, const MatchedTracks& elecs ) const { - if ( !pions.inVertexInCalo_.empty() /* || */ ) { - /* !muons.inVertexInCalo_.empty() || */ - /* !elecs.inVertexInCalo_.empty() ) { */ return true; } //@@ bug? + if ( !pions.inVertexInCalo_.empty() || + !muons.inVertexInCalo_.empty() || + !elecs.inVertexInCalo_.empty() ) { return true; } else { return false; } } @@ -559,8 +559,7 @@ JetPlusTrackCorrector::P4 JetPlusTrackCorrector::pionCorrection( const P4& jet, // ----------------------------------------------------------------------------- // JetPlusTrackCorrector::P4 JetPlusTrackCorrector::muonCorrection( const P4& jet, - const MatchedTracks& muons, - bool size ) const { + const MatchedTracks& muons ) const { P4 corr_muons; @@ -574,10 +573,8 @@ JetPlusTrackCorrector::P4 JetPlusTrackCorrector::muonCorrection( const P4& jet, } if ( useOutOfConeTracks_ ) { - if ( size ) { //@@ bug? - corr_muons_out_of_cone = muonCorrection( jet, muons.inVertexOutOfCalo_, true, false ); - corr_muons += corr_muons_out_of_cone; - } + corr_muons_out_of_cone = muonCorrection( jet, muons.inVertexOutOfCalo_, true, false ); + corr_muons += corr_muons_out_of_cone; } if ( useOutOfVertexTracks_ ) {