CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1OffsetCorrector Class Reference

#include <L1OffsetCorrector.h>

Inheritance diagram for L1OffsetCorrector:
JetCorrector

List of all members.

Public Member Functions

virtual double correction (const LorentzVector &fJet) const
 get correction using Jet information only
virtual double correction (const reco::Jet &fJet) const
 apply correction using Jet information only
virtual double correction (const reco::Jet &fJet, const edm::Event &fEvent, const edm::EventSetup &fSetup) const
 apply correction using all event information
virtual bool eventRequired () const
 if correction needs event information
 L1OffsetCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
virtual bool refRequired () const
 if correction needs the jet reference
virtual ~L1OffsetCorrector ()

Private Attributes

FactorizedJetCorrectormCorrector
int mMinVtxNdof
std::string mVertexCollName

Detailed Description

Definition at line 17 of file L1OffsetCorrector.h.


Constructor & Destructor Documentation

L1OffsetCorrector::L1OffsetCorrector ( const JetCorrectorParameters fConfig,
const edm::ParameterSet fParameters 
)

Definition at line 22 of file L1OffsetCorrector.cc.

References JetCorrectorParameters::definitions(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

{
  mVertexCollName = fConfig.getParameter<std::string>("vertexCollection");
  mMinVtxNdof     = fConfig.getParameter<int>("minVtxNdof");
  if (fParam.definitions().level() != "L1Offset")
    throw cms::Exception("L1OffsetCorrector")<<" correction level: "<<fParam.definitions().level()<<" is not L1Offset"; 
  vector<JetCorrectorParameters> vParam;
  vParam.push_back(fParam);
  mCorrector = new FactorizedJetCorrector(vParam);
}
L1OffsetCorrector::~L1OffsetCorrector ( ) [virtual]

Definition at line 35 of file L1OffsetCorrector.cc.

{
  delete mCorrector;
} 

Member Function Documentation

double L1OffsetCorrector::correction ( const LorentzVector fJet) const [virtual]

get correction using Jet information only

Implements JetCorrector.

Definition at line 42 of file L1OffsetCorrector.cc.

References Exception.

{
  throw cms::Exception("EventRequired")
    <<"Wrong interface correction(LorentzVector), event required!";
  return 1.0;
}
double L1OffsetCorrector::correction ( const reco::Jet fJet) const [virtual]

apply correction using Jet information only

Implements JetCorrector.

Definition at line 51 of file L1OffsetCorrector.cc.

References Exception.

{
  throw cms::Exception("EventRequired")
    <<"Wrong interface correction(reco::Jet), event required!";
  return 1.0;
}
double L1OffsetCorrector::correction ( const reco::Jet fJet,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const [virtual]

apply correction using all event information

Reimplemented from JetCorrector.

Definition at line 60 of file L1OffsetCorrector.cc.

References reco::LeafCandidate::eta(), edm::Event::getByLabel(), reco::LeafCandidate::pt(), and query::result.

{
  double result = 1.;
  edm::Handle<reco::VertexCollection> recVtxs;
  fEvent.getByLabel(mVertexCollName,recVtxs);
  int NPV(0);
  for(unsigned int ind=0;ind<recVtxs->size();ind++) {
    if (!((*recVtxs)[ind].isFake()) && (*recVtxs)[ind].ndof() > mMinVtxNdof) {
      NPV++;
    }
  } 
  if (NPV > 0) {
    mCorrector->setJetEta(fJet.eta());
    mCorrector->setJetPt(fJet.pt());
    mCorrector->setNPV(NPV);
    result = mCorrector->getCorrection();
  }
  return result;
}
virtual bool L1OffsetCorrector::eventRequired ( ) const [inline, virtual]

if correction needs event information

Implements JetCorrector.

Definition at line 37 of file L1OffsetCorrector.h.

{return true;} 
virtual bool L1OffsetCorrector::refRequired ( ) const [inline, virtual]

if correction needs the jet reference

Implements JetCorrector.

Definition at line 40 of file L1OffsetCorrector.h.

{ return false; }

Member Data Documentation

Definition at line 46 of file L1OffsetCorrector.h.

Definition at line 45 of file L1OffsetCorrector.h.

std::string L1OffsetCorrector::mVertexCollName [private]

Definition at line 44 of file L1OffsetCorrector.h.