CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ZSPJPTJetCorrector Class Reference

#include <ZSPJPTJetCorrector.h>

Public Member Functions

virtual double correction (const reco::Jet &, const edm::Event &, const edm::EventSetup &) const
 apply correction using Event information More...
 
virtual int setPU () const
 Set the number of pileups. More...
 
 ZSPJPTJetCorrector (const edm::ParameterSet &fParameters)
 
virtual ~ZSPJPTJetCorrector ()
 

Private Attributes

int fixedPU
 
int iPU
 
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector
 
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
 
std::vector< std::string > theFilesL1Offset
 
std::vector< std::string > theFilesZSP
 

Detailed Description

Definition at line 21 of file ZSPJPTJetCorrector.h.

Constructor & Destructor Documentation

◆ ZSPJPTJetCorrector()

ZSPJPTJetCorrector::ZSPJPTJetCorrector ( const edm::ParameterSet fParameters)

Definition at line 18 of file ZSPJPTJetCorrector.cc.

References DeadROC_duringRun::f1, DeadROC_duringRun::f2, geometryDiff::file, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
19  iPU = fConfig.getParameter<int>("PU");
20  fixedPU = fConfig.getParameter<int>("FixedPU");
21 
22  if (iPU >= 0 || fixedPU > 0) {
23  theFilesL1Offset = fConfig.getParameter<vector<string> >("tagNameOffset");
24  for (vector<string>::iterator it = theFilesL1Offset.begin(); it != theFilesL1Offset.end(); it++) {
25  std::string file = "CondFormats/JetMETObjects/data/" + (*it) + ".txt";
27  mSimpleCorrectorOffset.push_back(new SimpleZSPJPTJetCorrector(f2.fullPath()));
28  }
29  }
30 
31  theFilesZSP = fConfig.getParameter<vector<string> >("tagName");
32  for (vector<string>::iterator it = theFilesZSP.begin(); it != theFilesZSP.end(); it++) {
33  std::string file = "CondFormats/JetMETObjects/data/" + (*it) + ".txt";
35  mSimpleCorrector.push_back(new SimpleZSPJPTJetCorrector(f1.fullPath()));
36  }
37 }
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
std::vector< std::string > theFilesZSP
std::vector< std::string > theFilesL1Offset
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector

◆ ~ZSPJPTJetCorrector()

ZSPJPTJetCorrector::~ZSPJPTJetCorrector ( )
virtual

Definition at line 39 of file ZSPJPTJetCorrector.cc.

39 {}

Member Function Documentation

◆ correction()

double ZSPJPTJetCorrector::correction ( const reco::Jet fJet,
const edm::Event iEvent,
const edm::EventSetup iSetup 
) const
virtual

apply correction using Event information

Definition at line 41 of file ZSPJPTJetCorrector.cc.

References a, b, HltBtagPostValidation_cff::c, and reco::LeafCandidate::p4().

43  {
44  double b = 1.;
45  int nPU = 0;
46  if (iPU > 0) {
47  nPU = setPU();
48  } else {
49  if (iPU == 0)
50  nPU = setPU();
51  }
52 
53  double a =
54  mSimpleCorrector[nPU]->correctionPtEtaPhiE(fJet.p4().Pt(), fJet.p4().Eta(), fJet.p4().Phi(), fJet.p4().E());
55 
56  if (iPU >= 0) {
57  if (!mSimpleCorrectorOffset.empty()) {
58  b = mSimpleCorrectorOffset[nPU]->correctionPUEtEtaPhiP(
59  fJet.p4().Pt(), fJet.p4().Eta(), fJet.p4().Phi(), fJet.p4().E());
60  }
61  }
62  double c = a * b;
63  return c;
64 }
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
const LorentzVector & p4() const final
four-momentum Lorentz vector
virtual int setPU() const
Set the number of pileups.
double b
Definition: hdecay.h:118
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector
double a
Definition: hdecay.h:119

◆ setPU()

virtual int ZSPJPTJetCorrector::setPU ( ) const
inlinevirtual

Set the number of pileups.

Definition at line 28 of file ZSPJPTJetCorrector.h.

References fixedPU.

28 { return fixedPU; }

Member Data Documentation

◆ fixedPU

int ZSPJPTJetCorrector::fixedPU
private

Definition at line 36 of file ZSPJPTJetCorrector.h.

Referenced by setPU().

◆ iPU

int ZSPJPTJetCorrector::iPU
private

Definition at line 35 of file ZSPJPTJetCorrector.h.

◆ mSimpleCorrector

std::vector<SimpleZSPJPTJetCorrector*> ZSPJPTJetCorrector::mSimpleCorrector
private

Definition at line 31 of file ZSPJPTJetCorrector.h.

◆ mSimpleCorrectorOffset

std::vector<SimpleZSPJPTJetCorrector*> ZSPJPTJetCorrector::mSimpleCorrectorOffset
private

Definition at line 32 of file ZSPJPTJetCorrector.h.

◆ theFilesL1Offset

std::vector<std::string> ZSPJPTJetCorrector::theFilesL1Offset
private

Definition at line 33 of file ZSPJPTJetCorrector.h.

◆ theFilesZSP

std::vector<std::string> ZSPJPTJetCorrector::theFilesZSP
private

Definition at line 34 of file ZSPJPTJetCorrector.h.