69 |
|
#include "SimDataFormats/Vertex/interface/SimVertex.h" |
70 |
|
|
71 |
|
#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" |
72 |
+ |
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" |
73 |
|
|
74 |
|
#include "UserCode/HbbAnalysis/plugins/HbbTreeMaker.hh" |
75 |
|
|
234 |
|
if (lLHEEvt.isValid()){ |
235 |
|
HbbLHEInfo(lLHEEvt,event_->lheParticles()); |
236 |
|
} |
237 |
+ |
|
238 |
+ |
edm::Handle<std::vector<PileupSummaryInfo> > lPUInfo; |
239 |
+ |
try { |
240 |
+ |
aEvt.getByLabel("addPileupInfo",lPUInfo); |
241 |
+ |
} catch(cms::Exception& e) { |
242 |
+ |
std::cout << "AMM: Collection of PileupSummaryInfo not available! Exception : " << e.what() << ". " << std::endl; |
243 |
+ |
} |
244 |
+ |
|
245 |
+ |
if (lPUInfo.isValid()){ |
246 |
+ |
HbbPUInfo(lPUInfo,event_->puVars()); |
247 |
+ |
} |
248 |
+ |
|
249 |
|
try { |
250 |
|
aEvt.getByLabel(genParticleSrc_,lGenParticles); |
251 |
|
if (debug_) std::cout << "** ngenParticles = " << lGenParticles->size() << std::endl; |
1866 |
|
|
1867 |
|
} |
1868 |
|
|
1869 |
+ |
void HbbTreeMaker::HbbPUInfo(const edm::Handle<std::vector<PileupSummaryInfo> > & aPUInfo, |
1870 |
+ |
std::vector<HbbAnalysis::PUVars> & aVec) { |
1871 |
+ |
std::vector<PileupSummaryInfo>::const_iterator PVI; |
1872 |
+ |
for (PVI = aPUInfo->begin(); PVI != aPUInfo->end(); ++PVI) { |
1873 |
+ |
HbbAnalysis::PUVars aVars; |
1874 |
+ |
aVars.bunchCrossing = PVI->getBunchCrossing(); |
1875 |
+ |
aVars.numInteractions = PVI->getPU_NumInteractions(); |
1876 |
+ |
aVec.push_back(aVars); |
1877 |
+ |
} |
1878 |
+ |
} |
1879 |
+ |
|
1880 |
|
void HbbTreeMaker::HbbLHEInfo(const edm::Handle<LHEEventProduct> & aLHEEvt, |
1881 |
|
std::vector<HbbAnalysis::GenParticle> & aVec) { |
1882 |
|
|