ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/plugins/HbbTreeMaker.cc
(Generate patch)

Comparing UserCode/HbbAnalysis/plugins/HbbTreeMaker.cc (file contents):
Revision 1.36 by agilbert, Thu Jun 23 08:39:31 2011 UTC vs.
Revision 1.37 by agilbert, Thu Jun 23 13:03:51 2011 UTC

# Line 69 | Line 69
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  
# Line 233 | Line 234 | void HbbTreeMaker::analyze(const edm::Ev
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;
# Line 1853 | Line 1866 | void HbbTreeMaker::HbbGenInfo(const edm:
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines