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.

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  // cout<<" Size of correctors "<<mSimpleCorrector.size()<<" "<<mSimpleCorrectorOffset.size()<<endl;
38 }

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

◆ ~ZSPJPTJetCorrector()

ZSPJPTJetCorrector::~ZSPJPTJetCorrector ( )
virtual

Definition at line 40 of file ZSPJPTJetCorrector.cc.

40 {}

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

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 }

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

◆ setPU()

virtual int ZSPJPTJetCorrector::setPU ( ) const
inlinevirtual

Set the number of pileups.

Definition at line 28 of file ZSPJPTJetCorrector.h.

28 { return fixedPU; }

References 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.

ZSPJPTJetCorrector::theFilesL1Offset
std::vector< std::string > theFilesL1Offset
Definition: ZSPJPTJetCorrector.h:33
ZSPJPTJetCorrector::mSimpleCorrector
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector
Definition: ZSPJPTJetCorrector.h:31
edm::FileInPath
Definition: FileInPath.h:64
ZSPJPTJetCorrector::mSimpleCorrectorOffset
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
Definition: ZSPJPTJetCorrector.h:32
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
a
double a
Definition: hdecay.h:119
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
SimpleZSPJPTJetCorrector
classes declaration
Definition: SimpleZSPJPTJetCorrector.h:15
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
ZSPJPTJetCorrector::theFilesZSP
std::vector< std::string > theFilesZSP
Definition: ZSPJPTJetCorrector.h:34
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
ZSPJPTJetCorrector::fixedPU
int fixedPU
Definition: ZSPJPTJetCorrector.h:36
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
ZSPJPTJetCorrector::setPU
virtual int setPU() const
Set the number of pileups.
Definition: ZSPJPTJetCorrector.h:28
ZSPJPTJetCorrector::iPU
int iPU
Definition: ZSPJPTJetCorrector.h:35