CMS 3D CMS Logo

Public Member Functions | Private Attributes

LXXXCorrector Class Reference

#include <LXXXCorrector.h>

Inheritance diagram for LXXXCorrector:
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 bool eventRequired () const
 if correction needs event information
 LXXXCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
virtual ~LXXXCorrector ()

Private Attributes

FactorizedJetCorrectormCorrector
unsigned mLevel

Detailed Description

Definition at line 16 of file LXXXCorrector.h.


Constructor & Destructor Documentation

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

Definition at line 20 of file LXXXCorrector.cc.

References JetCorrectorParameters::definitions(), Exception, and testEve_cfg::level.

{
  string level = fParam.definitions().level();
  if (level == "L1Offset")
    mLevel = 1;
  else if (level == "L2Relative")
    mLevel = 2;
  else if (level == "L3Absolute")
    mLevel = 3;  
  else if (level == "L4EMF")
    mLevel = 4;
  else if (level == "L5Flavor")
    mLevel = 5;
  else if (level == "L7Parton")
    mLevel = 7;
  else if (level == "L1JPTOffset")
    mLevel = 8;
  else
    throw cms::Exception("LXXXCorrector")<<" unknown correction level "<<level; 
  vector<JetCorrectorParameters> vParam;
  vParam.push_back(fParam);
  mCorrector = new FactorizedJetCorrector(vParam);
}
LXXXCorrector::~LXXXCorrector ( ) [virtual]

Definition at line 46 of file LXXXCorrector.cc.

{
  delete mCorrector;
} 

Member Function Documentation

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 53 of file LXXXCorrector.cc.

References Exception.

{
  // L4 correction requires more information that a simple 4-vector
  if (mLevel == 4)
    {
      throw cms::Exception("Invalid jet type") << "L4EMFCorrection is applicable to CaloJets only";
      return 1;
    }
  else
    {
      mCorrector->setJetEta(fJet.eta()); 
      mCorrector->setJetE(fJet.energy());
      mCorrector->setJetPt(fJet.pt());
      mCorrector->setJetPhi(fJet.phi());
    } 
  return mCorrector->getCorrection();
}
double LXXXCorrector::correction ( const reco::Jet fJet) const [virtual]

apply correction using Jet information only

Implements JetCorrector.

Definition at line 73 of file LXXXCorrector.cc.

References reco::CaloJet::emEnergyFraction(), reco::LeafCandidate::energy(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), reco::JPTJet::getCaloJetRef(), reco::JPTJet::getZSPCor(), reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), and query::result.

{
  double result = 1.;
  // L4 correction applies to Calojets only
  if (mLevel == 4)
    {
      const reco::CaloJet& caloJet = dynamic_cast <const reco::CaloJet&> (fJet);
      mCorrector->setJetEta(fJet.eta()); 
      mCorrector->setJetPt(fJet.pt());
      mCorrector->setJetEMF(caloJet.emEnergyFraction());
      result = mCorrector->getCorrection();
    }
  else if ( mLevel == 8 ) 
    {
      // For JPT offset only   
      const reco::JPTJet& jptjet = dynamic_cast <const reco::JPTJet&> (fJet);
      edm::RefToBase<reco::Jet> jptjetRef = jptjet.getCaloJetRef();
      double zspcor_old = jptjet.getZSPCor();
      reco::CaloJet const * rawcalojet = dynamic_cast<reco::CaloJet const *>( &* jptjetRef);

      mCorrector->setJetEta(rawcalojet->eta()); 
      mCorrector->setJetPt(rawcalojet->et());
      
      double aa = mCorrector->getCorrection();
      double resulto(0.0);
      if (aa != 1.0)
        resulto = 1./(1.-aa);
      double enew = jptjet.energy() - (zspcor_old-resulto)*rawcalojet->energy();
      result = enew/jptjet.energy();
    }
  else
    result = correction(fJet.p4());
  return result;
}
virtual bool LXXXCorrector::eventRequired ( ) const [inline, virtual]

if correction needs event information

Implements JetCorrector.

Definition at line 32 of file LXXXCorrector.h.

{return false;} 

Member Data Documentation

Definition at line 37 of file LXXXCorrector.h.

unsigned LXXXCorrector::mLevel [private]

Definition at line 36 of file LXXXCorrector.h.