From 57a29798171dd93ca9462b48e7bde05a20688d1d Mon Sep 17 00:00:00 2001 From: Philipp Schieferdecker Date: Tue, 10 Nov 2009 14:47:33 +0000 Subject: [PATCH] --- yaml --- r: 77544 b: "refs/heads/CMSSW_7_1_X" c: 419389406198346a9cb95363674dade67d4e5863 h: "refs/heads/CMSSW_7_1_X" v: v3 --- [refs] | 2 +- trunk/JetMETCorrections/Objects/ChangeLog | 17 ++++++++++++++ .../Objects/interface/ChainedJetCorrector.h | 22 +++++++++++-------- .../Objects/interface/JetCorrector.h | 5 +++-- .../Objects/src/ChainedJetCorrector.cc | 19 +++++++++++----- .../Objects/src/JetCorrector.cc | 5 +++-- 6 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 trunk/JetMETCorrections/Objects/ChangeLog diff --git a/[refs] b/[refs] index 3d3c488c6906a..10f16f993904a 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": 214b5011d8739cc66f4f18dcc46f54edff8b6a62 +"refs/heads/CMSSW_7_1_X": 419389406198346a9cb95363674dade67d4e5863 diff --git a/trunk/JetMETCorrections/Objects/ChangeLog b/trunk/JetMETCorrections/Objects/ChangeLog new file mode 100644 index 0000000000000..479f97ae5a0e0 --- /dev/null +++ b/trunk/JetMETCorrections/Objects/ChangeLog @@ -0,0 +1,17 @@ +2009-11-10 Philipp SCHIEFERDECKER + + * change JetCorrector::correction(jet,evt,setup) interface to also + contain an edm::RefToBase fJetRef. + * this is useful because extra information about a given jet in + the event is typically keyed by such a reference + * note that the reference is always w.r.t. the original + uncorrected jet, not the jet from the last correction level (as + the information would have been lost by creating a new jet object) + * this should not impact any existing correctors, as non was + implementing this particular interface so far + * the motivation is the introduction of the new L6SLBCorrector in + JetMETCorrections/Algorithms, which corrects for leptonic decays + within a jet and therefore needs to access tagging information for + each jet in order to determine if a reconstructed muon could be + matched and if yes, to get to it kinematics + diff --git a/trunk/JetMETCorrections/Objects/interface/ChainedJetCorrector.h b/trunk/JetMETCorrections/Objects/interface/ChainedJetCorrector.h index 742c4f88c670e..e5950a6d77bed 100644 --- a/trunk/JetMETCorrections/Objects/interface/ChainedJetCorrector.h +++ b/trunk/JetMETCorrections/Objects/interface/ChainedJetCorrector.h @@ -1,6 +1,6 @@ // // Original Author: Fedor Ratnikov Dec 27, 2006 -// $Id: JetCorrector.h,v 1.4 2007/11/01 21:54:48 fedor Exp $ +// $Id: ChainedJetCorrector.h,v 1.1 2008/02/29 23:00:36 fedor Exp $ // // Correction which chains other corrections // @@ -13,21 +13,25 @@ #include "JetMETCorrections/Objects/interface/JetCorrector.h" -class ChainedJetCorrector : public JetCorrector { - public: +class ChainedJetCorrector : public JetCorrector +{ +public: ChainedJetCorrector (){} - virtual ~ChainedJetCorrector (){} + virtual ~ChainedJetCorrector () {} virtual double correction (const JetCorrector::LorentzVector& fJet) const; virtual double correction (const reco::Jet& fJet) const; - virtual double correction (const reco::Jet& fJet, const edm::Event& fEvent, const edm::EventSetup& fSetup) const; - + virtual double correction (const reco::Jet& fJet, + const edm::RefToBase& fJetRef, + const edm::Event& fEvent, + const edm::EventSetup& fSetup) const; + virtual bool eventRequired () const; - + void push_back (const JetCorrector* fCorrector) {mCorrectors.push_back (fCorrector);} void clear () {mCorrectors.clear ();} - - private: + +private: std::vector mCorrectors; }; diff --git a/trunk/JetMETCorrections/Objects/interface/JetCorrector.h b/trunk/JetMETCorrections/Objects/interface/JetCorrector.h index 4273a16c511e0..8b82906557140 100644 --- a/trunk/JetMETCorrections/Objects/interface/JetCorrector.h +++ b/trunk/JetMETCorrections/Objects/interface/JetCorrector.h @@ -1,6 +1,6 @@ // // Original Author: Fedor Ratnikov Dec 27, 2006 -// $Id: JetCorrector.h,v 1.4 2007/11/01 21:54:48 fedor Exp $ +// $Id: JetCorrector.h,v 1.5 2009/09/24 13:08:31 bainbrid Exp $ // // Generic interface for JetCorrection services // @@ -32,7 +32,8 @@ class JetCorrector virtual double correction (const reco::Jet& fJet) const = 0; /// apply correction using all event information - virtual double correction (const reco::Jet& fJet, + virtual double correction (const reco::Jet& fJet, + const edm::RefToBase& fJetRef, const edm::Event& fEvent, const edm::EventSetup& fSetup) const; diff --git a/trunk/JetMETCorrections/Objects/src/ChainedJetCorrector.cc b/trunk/JetMETCorrections/Objects/src/ChainedJetCorrector.cc index 2b09a146acc8c..8e5f9ca77ce9b 100644 --- a/trunk/JetMETCorrections/Objects/src/ChainedJetCorrector.cc +++ b/trunk/JetMETCorrections/Objects/src/ChainedJetCorrector.cc @@ -1,6 +1,6 @@ // // Original Author: Fedor Ratnikov Feb. 16, 2007 -// $Id: SimpleJetCorrector.cc,v 1.1 2007/02/16 23:32:16 fedor Exp $ +// $Id: ChainedJetCorrector.cc,v 1.1 2008/02/29 23:00:36 fedor Exp $ // // Correction which chains other corrections // @@ -8,7 +8,8 @@ #include "JetMETCorrections/Objects/interface/ChainedJetCorrector.h" /// get correction using Jet information only -double ChainedJetCorrector::correction (const LorentzVector& fJet) const { +double ChainedJetCorrector::correction (const LorentzVector& fJet) const +{ LorentzVector jet = fJet; double result = 1; for (size_t i = 0; i < mCorrectors.size (); ++i) { @@ -20,7 +21,8 @@ double ChainedJetCorrector::correction (const LorentzVector& fJet) const { } /// apply correction using Jet information only -double ChainedJetCorrector::correction (const reco::Jet& fJet) const { +double ChainedJetCorrector::correction (const reco::Jet& fJet) const +{ std::auto_ptr jet (dynamic_cast (fJet.clone ())); double result = 1; for (size_t i = 0; i < mCorrectors.size (); ++i) { @@ -32,11 +34,15 @@ double ChainedJetCorrector::correction (const reco::Jet& fJet) const { } /// apply correction using all event information -double ChainedJetCorrector::correction (const reco::Jet& fJet, const edm::Event& fEvent, const edm::EventSetup& fSetup) const { +double ChainedJetCorrector::correction (const reco::Jet& fJet, + const edm::RefToBase& fJetRef, + const edm::Event& fEvent, + const edm::EventSetup& fSetup) const +{ std::auto_ptr jet (dynamic_cast (fJet.clone ())); double result = 1; for (size_t i = 0; i < mCorrectors.size (); ++i) { - double scale = mCorrectors[i]->correction (*jet, fEvent, fSetup); + double scale = mCorrectors[i]->correction (*jet, fJetRef, fEvent, fSetup); jet->scaleEnergy (scale); result *= scale; } @@ -44,7 +50,8 @@ double ChainedJetCorrector::correction (const reco::Jet& fJet, const edm::Event& } /// if correction needs event information -bool ChainedJetCorrector::eventRequired () const { +bool ChainedJetCorrector::eventRequired () const +{ for (size_t i = 0; i < mCorrectors.size (); ++i) { if (mCorrectors[i]->eventRequired ()) return true; } diff --git a/trunk/JetMETCorrections/Objects/src/JetCorrector.cc b/trunk/JetMETCorrections/Objects/src/JetCorrector.cc index d203a4fcb255b..e56509cccf7ad 100644 --- a/trunk/JetMETCorrections/Objects/src/JetCorrector.cc +++ b/trunk/JetMETCorrections/Objects/src/JetCorrector.cc @@ -1,6 +1,6 @@ // // Original Author: Fedor Ratnikov Dec 27, 2006 -// $Id: JetCorrector.cc,v 1.4 2007/11/01 21:56:37 fedor Exp $ +// $Id: JetCorrector.cc,v 1.5 2009/09/24 13:08:28 bainbrid Exp $ // // Generic interface for JetCorrection services // @@ -13,7 +13,8 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" double JetCorrector::correction (const reco::Jet& fJet, - const edm::Event& fEvent, + const edm::RefToBase& fJetRef, + const edm::Event& fEvent, const edm::EventSetup& fSetup) const { if (eventRequired ()) { edm::LogError ("Missing Jet Correction Method")