64 |
|
#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" |
65 |
|
#include "SimDataFormats/Vertex/interface/SimVertex.h" |
66 |
|
|
67 |
+ |
#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" |
68 |
+ |
|
69 |
|
#include "UserCode/HbbAnalysis/plugins/HbbTreeMaker.hh" |
70 |
|
|
71 |
|
using namespace HbbAnalysis; |
107 |
|
hltTagsJet_(pset.getParameter<std::vector<edm::InputTag> >("HLTTagsJets")) |
108 |
|
//processVec_(pset.getParameter<std::vector<std::string> >("ProcessVec")) |
109 |
|
{//constructor |
110 |
< |
|
110 |
> |
|
111 |
> |
std::string JEC_PATH("CondFormats/JetMETObjects/data/"); |
112 |
> |
edm::FileInPath fipCalo(JEC_PATH+"Jec10V3_Uncertainty_AK5Calo.txt"); |
113 |
> |
edm::FileInPath fipPF(JEC_PATH+"Jec10V3_Uncertainty_AK5PF.txt"); |
114 |
> |
edm::FileInPath fipJPT(JEC_PATH+"Jec10V3_Uncertainty_AK5JPT.txt"); |
115 |
> |
jecUncCalo = new JetCorrectionUncertainty(fipCalo.fullPath()); |
116 |
> |
jecUncPF = new JetCorrectionUncertainty(fipPF.fullPath()); |
117 |
> |
jecUncJPT = new JetCorrectionUncertainty(fipJPT.fullPath()); |
118 |
|
|
119 |
|
}//constructor |
120 |
|
|
121 |
|
HbbTreeMaker::~HbbTreeMaker() |
122 |
|
{//destructor |
123 |
+ |
delete jecUncCalo; |
124 |
+ |
delete jecUncPF; |
125 |
+ |
delete jecUncJPT; |
126 |
+ |
|
127 |
|
}//destructor |
128 |
|
|
129 |
|
|
1245 |
|
} |
1246 |
|
|
1247 |
|
std::vector<std::string> lJECnames = (*iter).availableJECSets(); |
1248 |
< |
for (unsigned int iSet(0); iSet < lJECnames.size(); ++iSet){ |
1249 |
< |
if (debug_) std::cout << " -- JEC SET " << iSet << " " << lJECnames[iSet] << std::endl; |
1250 |
< |
std::vector<std::string> lJEClevels = (*iter).availableJECLevels(iSet); |
1251 |
< |
for (unsigned int iLev(0); iLev<lJEClevels.size(); ++iLev){ |
1252 |
< |
if (debug_) std::cout << " ---- JEC level " << iLev << " " << lJEClevels[iLev] |
1253 |
< |
<< " , factor = " << (*iter).jecFactor(iLev,pat::JetCorrFactors::NONE,iSet) |
1254 |
< |
<< std::endl; |
1255 |
< |
lEnergyCorrections.Levels.push_back(std::pair<std::string,double>(lJEClevels[iLev],(*iter).jecFactor(iLev,pat::JetCorrFactors::NONE,iSet))); |
1256 |
< |
} |
1257 |
< |
} |
1258 |
< |
if (debug_) std::cout << " -- Reco pT = " << lReco.pT |
1259 |
< |
<< std::endl; |
1260 |
< |
} |
1248 |
> |
for (unsigned int iSet(0); iSet < lJECnames.size(); ++iSet){ |
1249 |
> |
if (debug_) std::cout << " -- JEC SET " << iSet << " " << lJECnames[iSet] << std::endl; |
1250 |
> |
std::vector<std::string> lJEClevels = (*iter).availableJECLevels(iSet); |
1251 |
> |
for (unsigned int iLev(0); iLev<lJEClevels.size(); ++iLev){ |
1252 |
> |
if (debug_) std::cout << " ---- JEC level " << iLev << " " << lJEClevels[iLev] |
1253 |
> |
<< " , factor = " << (*iter).jecFactor(iLev,pat::JetCorrFactors::NONE,iSet) |
1254 |
> |
<< std::endl; |
1255 |
> |
lEnergyCorrections.Levels.push_back(std::pair<std::string,double>(lJEClevels[iLev],(*iter).jecFactor(iLev,pat::JetCorrFactors::NONE,iSet))); |
1256 |
> |
} |
1257 |
> |
} |
1258 |
> |
if (debug_) std::cout << " -- Reco pT = " << lReco.pT |
1259 |
> |
<< std::endl; |
1260 |
> |
} |
1261 |
> |
|
1262 |
> |
if ((*iter).isCaloJet()) { |
1263 |
> |
jecUncCalo->setJetEta((*iter).eta()); |
1264 |
> |
jecUncCalo->setJetPt((*iter).pt()); |
1265 |
> |
lEnergyCorrections.Levels.push_back(std::pair<std::string,double>("Uncertainty",jecUncCalo->getUncertainty(true))); |
1266 |
> |
} else if ((*iter).isPFJet()) { |
1267 |
> |
jecUncPF->setJetEta((*iter).eta()); |
1268 |
> |
jecUncPF->setJetPt((*iter).pt()); |
1269 |
> |
lEnergyCorrections.Levels.push_back(std::pair<std::string,double>("Uncertainty",jecUncPF->getUncertainty(true))); |
1270 |
> |
} else if ((*iter).isJPTJet()) { |
1271 |
> |
jecUncJPT->setJetEta((*iter).eta()); |
1272 |
> |
jecUncJPT->setJetPt((*iter).pt()); |
1273 |
> |
lEnergyCorrections.Levels.push_back(std::pair<std::string,double>("Uncertainty",jecUncJPT->getUncertainty(true))); |
1274 |
> |
} |
1275 |
|
|
1276 |
|
//lEnergyCorrections.L1 = (*iter).jecFactor("L1Offset","NONE",(*iter).currentJECSet()); |
1277 |
|
//lEnergyCorrections.L1JPT = (*iter).jecFactor("L1JPTOffset","NONE",(*iter).currentJECSet()); |