Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "70X met uncertainty tool fixes" #5071

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions JetMETCorrections/Algorithms/BuildFile.xml
@@ -0,0 +1,15 @@
<use name="CondFormats/JetMETObjects"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/EgammaCandidates"/>
<use name="DataFormats/JetReco"/>
<use name="DataFormats/Math"/>
<use name="DataFormats/MuonReco"/>
<use name="DataFormats/TrackReco"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="JetMETCorrections/Objects"/>
<use name="boost"/>
<export>
<lib name="1"/>
</export>
15 changes: 15 additions & 0 deletions JetMETCorrections/Algorithms/ChangeLog
@@ -0,0 +1,15 @@
2009-11-17 Philipp SCHIEFERDECKER <philipp.schieferdecker@cern.ch>

* adjust ZSPCorrector and JetPlusTrackCorrector to interface
change in JetCorrector baseclass.

2009-11-12 Philipp SCHIEFERDECKER <philipp.schieferdecker@cern.ch>

* remove tagName parameters, introduce parameters era, level,
algorithm instead. Look at
JetMETCorrections/Configuration/JetCorrectionServices_cff.py to
see how this makes sense.

2009-11-10 Philipp SCHIEFERDECKER <philipp.schieferdecker@cern.ch>

* added L6SLBCorrector and L1FastjetCorrector
47 changes: 47 additions & 0 deletions JetMETCorrections/Algorithms/interface/L1FastjetCorrector.h
@@ -0,0 +1,47 @@
//
// L1FastjetCorrector
// ------------------
//
// 08/09/2009 Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
//
#ifndef L1FastjetCorrector_h
#define L1FastjetCorrector_h 1

#include "JetMETCorrections/Objects/interface/JetCorrector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"

class L1FastjetCorrector : public JetCorrector
{
public:
// construction / destruction
L1FastjetCorrector(const JetCorrectorParameters& fParam, const edm::ParameterSet& fConfig);
virtual ~L1FastjetCorrector();

public:
//member functions

/// apply correction using Jet information only
virtual double correction(const LorentzVector& fJet) const;
/// apply correction using Jet information only
virtual double correction(const reco::Jet& fJet) const;
/// apply correction using all event information
virtual double correction(const reco::Jet& fJet,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const;
/// if correction needs event information
virtual bool eventRequired() const { return true; }

//----- if correction needs a jet reference -------------
virtual bool refRequired() const { return false; }

private:
// member data
edm::InputTag srcRho_;
FactorizedJetCorrector* mCorrector;
};

#endif
47 changes: 47 additions & 0 deletions JetMETCorrections/Algorithms/interface/L1JPTOffsetCorrector.h
@@ -0,0 +1,47 @@
// L1Offset jet corrector class. Inherits from JetCorrector.h
#ifndef L1JPTOffsetCorrector_h
#define L1JPTOffsetCorrector_h

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "JetMETCorrections/Objects/interface/JetCorrector.h"
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"

//----- classes declaration -----------------------------------
namespace edm
{
class ParameterSet;
}
class FactorizedJetCorrector;
//----- LXXXCorrector interface -------------------------------
class L1JPTOffsetCorrector : public JetCorrector
{
public:
//----- constructors---------------------------------------
L1JPTOffsetCorrector(const JetCorrectorParameters& fConfig, const edm::ParameterSet& fParameters);

//----- destructor ----------------------------------------
virtual ~L1JPTOffsetCorrector();

//----- apply correction using Jet information only -------
virtual double correction(const LorentzVector& fJet) const;

//----- apply correction using Jet information only -------
virtual double correction(const reco::Jet& fJet) const;

//----- apply correction using all event information
virtual double correction(const reco::Jet& fJet,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const;
//----- if correction needs event information -------------
virtual bool eventRequired() const {return true;}
virtual bool refRequired() const {return false;}

private:
//----- member data ---------------------------------------
std::string mOffsetService;
bool mIsOffsetSet;
FactorizedJetCorrector* mCorrector;
};

#endif
50 changes: 50 additions & 0 deletions JetMETCorrections/Algorithms/interface/L1OffsetCorrector.h
@@ -0,0 +1,50 @@
// L1Offset jet corrector class. Inherits from JetCorrector.h
#ifndef L1OffsetCorrector_h
#define L1OffsetCorrector_h

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "JetMETCorrections/Objects/interface/JetCorrector.h"
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"

//----- classes declaration -----------------------------------
namespace edm
{
class ParameterSet;
}
class FactorizedJetCorrector;
//----- LXXXCorrector interface -------------------------------
class L1OffsetCorrector : public JetCorrector
{
public:
//----- constructors---------------------------------------
L1OffsetCorrector(const JetCorrectorParameters& fConfig, const edm::ParameterSet& fParameters);

//----- destructor ----------------------------------------
virtual ~L1OffsetCorrector();

//----- apply correction using Jet information only -------
virtual double correction(const LorentzVector& fJet) const;

//----- apply correction using Jet information only -------
virtual double correction(const reco::Jet& fJet) const;

//----- apply correction using all event information
virtual double correction(const reco::Jet& fJet,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const;
//----- if correction needs event information -------------
virtual bool eventRequired() const {return true;}

//----- if correction needs a jet reference -------------
virtual bool refRequired() const { return false; }

private:
//----- member data ---------------------------------------
std::string mVertexCollName;
int mMinVtxNdof;
FactorizedJetCorrector* mCorrector;

};

#endif
69 changes: 69 additions & 0 deletions JetMETCorrections/Algorithms/interface/L6SLBCorrector.h
@@ -0,0 +1,69 @@
////////////////////////////////////////////////////////////////////////////////
//
// Level6 SLB (Semileptonic BJet) Corrector
// ----------------------------------------
//
// 25/10/2009 Hauke Held <hauke.held@cern.ch>
// Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
////////////////////////////////////////////////////////////////////////////////
#ifndef L6SLBCorrector_h
#define L6SLBCorrector_h

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "JetMETCorrections/Objects/interface/JetCorrector.h"
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
#include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"


class L6SLBCorrector : public JetCorrector
{
//
// construction / destruction
//
public:
L6SLBCorrector (const JetCorrectorParameters& fParam, const edm::ParameterSet& fConfig);
virtual ~L6SLBCorrector ();


//
// member functions
//
public:
/// apply correction using Jet information only
virtual double correction (const LorentzVector& fJet) const;
/// apply correction using Jet information only
virtual double correction (const reco::Jet& fJet) const;
/// apply correction using all event information
virtual double correction (const reco::Jet& fJet,
const edm::RefToBase<reco::Jet>& refToRawJet,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const;

/// if correction needs event information
virtual bool eventRequired () const {return true;}

//----- if correction needs a jet reference -------------
virtual bool refRequired () const {return true;}

//
// private member functions
//
private:
int getBTagInfoIndex(const edm::RefToBase<reco::Jet>& refToRawJet,
const std::vector<reco::SoftLeptonTagInfo>& tags) const;


//
// member data
//
private:
std::string tagName_;
bool addMuonToJet_;
edm::InputTag srcBTagInfoElec_;
edm::InputTag srcBTagInfoMuon_;
FactorizedJetCorrector* corrector_;

};

#endif
43 changes: 43 additions & 0 deletions JetMETCorrections/Algorithms/interface/LXXXCorrector.h
@@ -0,0 +1,43 @@
// Generic LX jet corrector class. Inherits from JetCorrector.h
#ifndef LXXXCorrector_h
#define LXXXCorrector_h

#include "JetMETCorrections/Objects/interface/JetCorrector.h"
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"

//----- classes declaration -----------------------------------
namespace edm
{
class ParameterSet;
}
class FactorizedJetCorrector;
//----- LXXXCorrector interface -------------------------------
class LXXXCorrector : public JetCorrector
{
public:
//----- constructors---------------------------------------
LXXXCorrector(const JetCorrectorParameters& fConfig, const edm::ParameterSet& fParameters);

//----- destructor ----------------------------------------
virtual ~LXXXCorrector();

//----- apply correction using Jet information only -------
virtual double correction(const LorentzVector& fJet) const;

//----- apply correction using Jet information only -------
virtual double correction(const reco::Jet& fJet) const;

//----- if correction needs event information -------------
virtual bool eventRequired() const {return false;}

//----- if correction needs a jet reference -------------
virtual bool refRequired() const { return false; }

private:
//----- member data ---------------------------------------
unsigned mLevel;
FactorizedJetCorrector* mCorrector;
};

#endif
80 changes: 80 additions & 0 deletions JetMETCorrections/Algorithms/src/L1FastjetCorrector.cc
@@ -0,0 +1,80 @@
////////////////////////////////////////////////////////////////////////////////
//
// L1FastjetCorrector
// ------------------
//
// 08/09/2009 Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
////////////////////////////////////////////////////////////////////////////////

#include "JetMETCorrections/Algorithms/interface/L1FastjetCorrector.h"

#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"


using namespace std;


////////////////////////////////////////////////////////////////////////////////
// construction / destruction
////////////////////////////////////////////////////////////////////////////////

//______________________________________________________________________________
L1FastjetCorrector::L1FastjetCorrector (const JetCorrectorParameters& fParam, const edm::ParameterSet& fConfig)
: srcRho_(fConfig.getParameter<edm::InputTag>("srcRho"))
{
if (fParam.definitions().level() != "L1FastJet")
throw cms::Exception("L1FastjetCorrector")<<" correction level: "<<fParam.definitions().level()<<" is not L1FastJet";
vector<JetCorrectorParameters> vParam;
vParam.push_back(fParam);
mCorrector = new FactorizedJetCorrector(vParam);
}

//______________________________________________________________________________
L1FastjetCorrector::~L1FastjetCorrector ()
{
delete mCorrector;
}


////////////////////////////////////////////////////////////////////////////////
// implementation of member functions
////////////////////////////////////////////////////////////////////////////////

//______________________________________________________________________________
double L1FastjetCorrector::correction (const LorentzVector& fJet) const
{
throw cms::Exception("EventRequired")
<<"Wrong interface correction(LorentzVector), event required!";
return 1.0;
}


//______________________________________________________________________________
double L1FastjetCorrector::correction (const reco::Jet& fJet) const
{
throw cms::Exception("EventRequired")
<<"Wrong interface correction(reco::Jet), event required!";
return 1.0;
}


//______________________________________________________________________________
double L1FastjetCorrector::correction(const reco::Jet& fJet,
const edm::Event& fEvent,
const edm::EventSetup& fSetup) const
{
edm::Handle<double> rho;
fEvent.getByLabel(srcRho_,rho);
double result(1.0);
mCorrector->setJetEta(fJet.eta());
mCorrector->setJetPt(fJet.pt());
mCorrector->setJetA(fJet.jetArea());
mCorrector->setRho(*rho);
result = mCorrector->getCorrection();
return result;
}