CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1JPTOffsetCorrector Class Reference

#include <L1JPTOffsetCorrector.h>

Inheritance diagram for L1JPTOffsetCorrector:
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
 L1JPTOffsetCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
virtual bool refRequired () const
 if correction needs the jet reference
virtual ~L1JPTOffsetCorrector ()

Private Attributes

FactorizedJetCorrectormCorrector
bool mIsOffsetSet
std::string mOffsetService

Detailed Description

Definition at line 17 of file L1JPTOffsetCorrector.h.


Constructor & Destructor Documentation

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

Definition at line 24 of file L1JPTOffsetCorrector.cc.

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

{
  mOffsetService = fConfig.getParameter<std::string>("offsetService");
  mIsOffsetSet = false;
  if (mOffsetService != "")
    mIsOffsetSet = true;
  if (fParam.definitions().level() != "L1JPTOffset")
    throw cms::Exception("L1OffsetCorrector")<<" correction level: "<<fParam.definitions().level()<<" is not L1JPTOffset"; 
  vector<JetCorrectorParameters> vParam;
  vParam.push_back(fParam);
  mCorrector = new FactorizedJetCorrector(vParam);
}
L1JPTOffsetCorrector::~L1JPTOffsetCorrector ( ) [virtual]

Definition at line 39 of file L1JPTOffsetCorrector.cc.

{
  delete mCorrector;
} 

Member Function Documentation

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 46 of file L1JPTOffsetCorrector.cc.

References Exception.

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

apply correction using Jet information only

Implements JetCorrector.

Definition at line 55 of file L1JPTOffsetCorrector.cc.

References Exception.

{
  throw cms::Exception("EventRequired")
    <<"Wrong interface correction(reco::Jet), event required!";
  return 1.0;
}
double L1JPTOffsetCorrector::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 64 of file L1JPTOffsetCorrector.cc.

References JetCorrector::correction(), reco::LeafCandidate::energy(), reco::JPTJet::getCaloJetRef(), JetCorrector::getJetCorrector(), evf::evtn::offset(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), and query::result.

{
  double result = 1.;
  const reco::JPTJet& jptjet = dynamic_cast <const reco::JPTJet&> (fJet);
  edm::RefToBase<reco::Jet> jptjetRef = jptjet.getCaloJetRef();
  reco::CaloJet const * rawcalojet = dynamic_cast<reco::CaloJet const *>( &* jptjetRef);   
  //------ access the offset correction service ----------------
  double offset = 1.0;
  if (mIsOffsetSet) {
    const JetCorrector* OffsetCorrector = JetCorrector::getJetCorrector(mOffsetService,fSetup); 
    offset = OffsetCorrector->correction(*rawcalojet,fEvent,fSetup); 
  }
  //------ calculate the correction for the JPT jet ------------
  TLorentzVector JPTrawP4(rawcalojet->px(),rawcalojet->py(),rawcalojet->pz(),rawcalojet->energy());
  mCorrector->setJPTrawP4(JPTrawP4);
  mCorrector->setJPTrawOff(offset);
  mCorrector->setJetE(fJet.energy());
  result = mCorrector->getCorrection();
  return result;
}
virtual bool L1JPTOffsetCorrector::eventRequired ( ) const [inline, virtual]

if correction needs event information

Implements JetCorrector.

Definition at line 37 of file L1JPTOffsetCorrector.h.

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

if correction needs the jet reference

Implements JetCorrector.

Definition at line 38 of file L1JPTOffsetCorrector.h.

{return false;}

Member Data Documentation

Definition at line 44 of file L1JPTOffsetCorrector.h.

Definition at line 43 of file L1JPTOffsetCorrector.h.

std::string L1JPTOffsetCorrector::mOffsetService [private]

Definition at line 42 of file L1JPTOffsetCorrector.h.