#include <ZSPJPTJetCorrector.h>
Public Member Functions | |
virtual double | correction (const reco::Jet &, const edm::Event &, const edm::EventSetup &) const |
apply correction using Event information | |
virtual int | setPU () const |
Set the number of pileups. | |
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 |
Definition at line 22 of file ZSPJPTJetCorrector.h.
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().
{ iPU = fConfig.getParameter<int>("PU"); fixedPU = fConfig.getParameter<int>("FixedPU"); if( iPU >= 0 || fixedPU > 0 ) { theFilesL1Offset = fConfig.getParameter <vector<string> > ("tagNameOffset"); for(vector<string>::iterator it=theFilesL1Offset.begin(); it != theFilesL1Offset.end(); it++) { std::string file="CondFormats/JetMETObjects/data/"+(*it)+".txt"; edm::FileInPath f2(file); mSimpleCorrectorOffset.push_back(new SimpleZSPJPTJetCorrector (f2.fullPath())); } } theFilesZSP = fConfig.getParameter <vector<string> > ("tagName"); for(vector<string>::iterator it=theFilesZSP.begin(); it != theFilesZSP.end(); it++) { std::string file="CondFormats/JetMETObjects/data/"+(*it)+".txt"; edm::FileInPath f1(file); mSimpleCorrector.push_back(new SimpleZSPJPTJetCorrector (f1.fullPath())); } // cout<<" Size of correctors "<<mSimpleCorrector.size()<<" "<<mSimpleCorrectorOffset.size()<<endl; }
ZSPJPTJetCorrector::~ZSPJPTJetCorrector | ( | ) | [virtual] |
Definition at line 42 of file ZSPJPTJetCorrector.cc.
{ }
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().
{ double b=1.; int nPU = 0; if(iPU > 0) { // Look for the Lumi section // LuminosityBlock lbID = iEvent.getLuminosityBlock(); // cout<<" Not implemented yet "<<iEvent.run()<<endl; nPU=setPU(); } else { if(iPU==0) nPU=setPU(); } double a = mSimpleCorrector[nPU]->correctionPtEtaPhiE (fJet.p4().Pt(), fJet.p4().Eta(), fJet.p4().Phi(),fJet.p4().E()); if(iPU >= 0) { if(mSimpleCorrectorOffset.size()>0) { b = mSimpleCorrectorOffset[nPU]->correctionPUEtEtaPhiP (fJet.p4().Pt(), fJet.p4().Eta(), fJet.p4().Phi(),fJet.p4().E()); } } double c = a * b; return c; }
virtual int ZSPJPTJetCorrector::setPU | ( | ) | const [inline, virtual] |
Set the number of pileups.
Definition at line 29 of file ZSPJPTJetCorrector.h.
References fixedPU.
{return fixedPU;}
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.