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 ( const edm::ParameterSet fParameters)

Definition at line 18 of file ZSPJPTJetCorrector.cc.

References DeadROC_duringRun::f1, DeadROC_duringRun::f2, FrontierConditions_GlobalTag_cff::file, edm::FileInPath::fullPath(), 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";
26  edm::FileInPath f2(file);
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";
34  edm::FileInPath f1(file);
35  mSimpleCorrector.push_back(new SimpleZSPJPTJetCorrector(f1.fullPath()));
36  }
37  // cout<<" Size of correctors "<<mSimpleCorrector.size()<<" "<<mSimpleCorrectorOffset.size()<<endl;
38 }
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
std::vector< std::string > theFilesZSP
std::vector< std::string > theFilesL1Offset
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector
ZSPJPTJetCorrector::~ZSPJPTJetCorrector ( )
virtual

Definition at line 40 of file ZSPJPTJetCorrector.cc.

40 {}

Member Function Documentation

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 42 of file ZSPJPTJetCorrector.cc.

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

44  {
45  double b = 1.;
46  int nPU = 0;
47  if (iPU > 0) {
48  // Look for the Lumi section
49  // LuminosityBlock lbID = iEvent.getLuminosityBlock();
50  // cout<<" Not implemented yet "<<iEvent.run()<<endl;
51  nPU = setPU();
52  } else {
53  if (iPU == 0)
54  nPU = setPU();
55  }
56 
57  double a =
58  mSimpleCorrector[nPU]->correctionPtEtaPhiE(fJet.p4().Pt(), fJet.p4().Eta(), fJet.p4().Phi(), fJet.p4().E());
59 
60  if (iPU >= 0) {
61  if (!mSimpleCorrectorOffset.empty()) {
62  b = mSimpleCorrectorOffset[nPU]->correctionPUEtEtaPhiP(
63  fJet.p4().Pt(), fJet.p4().Eta(), fJet.p4().Phi(), fJet.p4().E());
64  }
65  }
66  double c = a * b;
67  return c;
68 }
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
virtual int setPU() const
Set the number of pileups.
const LorentzVector & p4() const final
four-momentum Lorentz vector
double b
Definition: hdecay.h:118
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector
double a
Definition: hdecay.h:119
virtual int ZSPJPTJetCorrector::setPU ( ) const
inlinevirtual

Set the number of pileups.

Definition at line 28 of file ZSPJPTJetCorrector.h.

28 { return fixedPU; }

Member Data Documentation

int ZSPJPTJetCorrector::fixedPU
private

Definition at line 36 of file ZSPJPTJetCorrector.h.

int ZSPJPTJetCorrector::iPU
private

Definition at line 35 of file ZSPJPTJetCorrector.h.

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

Definition at line 31 of file ZSPJPTJetCorrector.h.

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

Definition at line 32 of file ZSPJPTJetCorrector.h.

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

Definition at line 33 of file ZSPJPTJetCorrector.h.

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

Definition at line 34 of file ZSPJPTJetCorrector.h.