Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77544
b: "refs/heads/CMSSW_7_1_X"
c: 4193894
h: "refs/heads/CMSSW_7_1_X"
v: v3
  • Loading branch information
Philipp Schieferdecker committed Nov 10, 2009
1 parent 1d7da34 commit 57a2979
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": 214b5011d8739cc66f4f18dcc46f54edff8b6a62
"refs/heads/CMSSW_7_1_X": 419389406198346a9cb95363674dade67d4e5863
17 changes: 17 additions & 0 deletions trunk/JetMETCorrections/Objects/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
2009-11-10 Philipp SCHIEFERDECKER <[email protected]>

* change JetCorrector::correction(jet,evt,setup) interface to also
contain an edm::RefToBase<reco::Jet> 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

22 changes: 13 additions & 9 deletions trunk/JetMETCorrections/Objects/interface/ChainedJetCorrector.h
Original file line number Diff line number Diff line change
@@ -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
//
Expand All @@ -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<reco::Jet>& 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 <const JetCorrector*> mCorrectors;
};

Expand Down
5 changes: 3 additions & 2 deletions trunk/JetMETCorrections/Objects/interface/JetCorrector.h
Original file line number Diff line number Diff line change
@@ -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
//
Expand Down Expand Up @@ -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<reco::Jet>& fJetRef,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const;

Expand Down
19 changes: 13 additions & 6 deletions trunk/JetMETCorrections/Objects/src/ChainedJetCorrector.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
//
// 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
//

#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) {
Expand All @@ -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<reco::Jet> jet (dynamic_cast<reco::Jet*> (fJet.clone ()));
double result = 1;
for (size_t i = 0; i < mCorrectors.size (); ++i) {
Expand All @@ -32,19 +34,24 @@ 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<reco::Jet>& fJetRef,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const
{
std::auto_ptr<reco::Jet> jet (dynamic_cast<reco::Jet*> (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;
}
return result;
}

/// 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;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/JetMETCorrections/Objects/src/JetCorrector.cc
Original file line number Diff line number Diff line change
@@ -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
//
Expand All @@ -13,7 +13,8 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"

double JetCorrector::correction (const reco::Jet& fJet,
const edm::Event& fEvent,
const edm::RefToBase<reco::Jet>& fJetRef,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const {
if (eventRequired ()) {
edm::LogError ("Missing Jet Correction Method")
Expand Down

0 comments on commit 57a2979

Please sign in to comment.