CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 22 of file ZSPJPTJetCorrector.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file ZSPJPTJetCorrector.cc.

References python.connectstrParser::f1, python.connectstrParser::f2, mergeVDriftHistosByStation::file, edm::FileInPath::fullPath(), and edm::ParameterSet::getParameter().

19  {
20 
21  iPU = fConfig.getParameter<int>("PU");
22  fixedPU = fConfig.getParameter<int>("FixedPU");
23 
24  if( iPU >= 0 || fixedPU > 0 ) {
25  theFilesL1Offset = fConfig.getParameter <vector<string> > ("tagNameOffset");
26  for(vector<string>::iterator it=theFilesL1Offset.begin(); it != theFilesL1Offset.end(); it++) {
27  std::string file="CondFormats/JetMETObjects/data/"+(*it)+".txt";
28  edm::FileInPath f2(file);
29  mSimpleCorrectorOffset.push_back(new SimpleZSPJPTJetCorrector (f2.fullPath()));
30  }
31  }
32 
33  theFilesZSP = fConfig.getParameter <vector<string> > ("tagName");
34  for(vector<string>::iterator it=theFilesZSP.begin(); it != theFilesZSP.end(); it++) {
35  std::string file="CondFormats/JetMETObjects/data/"+(*it)+".txt";
36  edm::FileInPath f1(file);
37  mSimpleCorrector.push_back(new SimpleZSPJPTJetCorrector (f1.fullPath()));
38  }
39 // cout<<" Size of correctors "<<mSimpleCorrector.size()<<" "<<mSimpleCorrectorOffset.size()<<endl;
40 }
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrectorOffset
std::vector< std::string > theFilesZSP
std::vector< std::string > theFilesL1Offset
std::vector< SimpleZSPJPTJetCorrector * > mSimpleCorrector
ZSPJPTJetCorrector::~ZSPJPTJetCorrector ( )
virtual

Definition at line 42 of file ZSPJPTJetCorrector.cc.

42  {
43 }

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

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

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

Set the number of pileups.

Definition at line 29 of file ZSPJPTJetCorrector.h.

References fixedPU.

29 {return fixedPU;}

Member Data Documentation

int ZSPJPTJetCorrector::fixedPU
private

Definition at line 37 of file ZSPJPTJetCorrector.h.

Referenced by setPU().

int ZSPJPTJetCorrector::iPU
private

Definition at line 36 of file ZSPJPTJetCorrector.h.

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

Definition at line 32 of file ZSPJPTJetCorrector.h.

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

Definition at line 33 of file ZSPJPTJetCorrector.h.

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

Definition at line 34 of file ZSPJPTJetCorrector.h.

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

Definition at line 35 of file ZSPJPTJetCorrector.h.