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 }

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

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 }

References a, b, 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
ZSPJPTJetCorrector::fixedPU
int fixedPU
Definition: ZSPJPTJetCorrector.h:36
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
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