4 #include "TGraphErrors.h"
6 #include "TLorentzVector.h"
91 std::cout<<
"Configured Uncertainty from CondDB"<<std::endl;
99 double jec,rawPt,corPt,
eta,unc;
106 P4.SetPtEtaPhiE(rawPt,eta,0,0);
113 for(
unsigned ieta=0;ieta<
mVEta.size();ieta++)
120 vpt[ieta][
i] = rawPt;
121 P4.SetPtEtaPhiE(rawPt,eta,0,0);
137 std::cout<<rawPt<<
" "<<eta<<
" "<<jec<<
" "<<rawPt*jec<<
" "<<unc<<std::endl;
141 for(
unsigned ipt=0;ipt<
mVPt.size();ipt++)
152 while(e > 0.0001 && nLoop < 10)
154 P4.SetPtEtaPhiE(rawPt,eta,0,0);
158 e = fabs(tmp-corPt)/corPt;
164 P4.SetPtEtaPhiE(rawPt,eta,0,0);
179 std::cout<<rawPt<<
" "<<eta<<
" "<<jec<<
" "<<rawPt*jec<<
" "<<unc<<std::endl;
188 throw cms::Exception(
"JetCorrectorDemo",
"Too many graph points !!! Maximum is 1000 !!!");
189 if (
mVEta.size() > 100)
190 throw cms::Exception(
"JetCorrectorDemo",
"Too many eta values !!! Maximum is 100 !!!");
191 if (
mVPt.size() > 100)
192 throw cms::Exception(
"JetCorrectorDemo",
"Too many pt values !!! Maximum is 100 !!!");
202 for(
unsigned ipt=0;ipt<
mVPt.size();ipt++)
205 sprintf(name,
"JEC_vs_Eta_CorPt%1.1f",
mVPt[ipt]);
208 sprintf(name,
"UNC_vs_Eta_CorPt%1.1f",
mVPt[ipt]);
211 for(
unsigned ieta=0;ieta<
mVEta.size();ieta++)
214 sprintf(name,
"JEC_vs_RawPt_eta%1.1f",
mVEta[ieta]);
217 sprintf(name,
"JEC_vs_CorPt_eta%1.1f",
mVEta[ieta]);
220 sprintf(name,
"UNC_vs_CorPt_eta%1.1f",
mVEta[ieta]);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > mVEta
edm::Service< TFileService > fs
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
#define DEFINE_FWK_MODULE(type)
reco::Particle::LorentzVector LorentzVector
double vjec_pt[100][1000]
std::string mJetCorService
std::string mUncertaintyTag
double vUnc_eta[100][1000]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
TGraphErrors * mVGraphPt[100]
JetCorrectorDemo(const edm::ParameterSet &)
TGraphErrors * mVGraphCorPt[100]
double vex_eta[100][1000]
std::string mUncertaintyFile
double vjecUnc_eta[100][1000]
double vjec_eta[100][1000]
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
void setJetEta(float fEta)
std::vector< std::vector< double > > tmp
std::vector< double > mVPt
T * make() const
make new ROOT object
float getUncertainty(bool fDirection)
double vjecUnc_pt[100][1000]
std::string fullPath() const
double vUnc_pt[100][1000]
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Power< A, B >::type pow(const A &a, const B &b)
TGraphErrors * mVGraphEta[100]