Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:22

0001 #include "L1Trigger/L1TNtuples/interface/L1AnalysisSimulation.h"
0002 
0003 #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
0004 
0005 L1Analysis::L1AnalysisSimulation::L1AnalysisSimulation() {}
0006 
0007 L1Analysis::L1AnalysisSimulation::~L1AnalysisSimulation() {}
0008 
0009 void L1Analysis::L1AnalysisSimulation::Set(const edm::Event& e) {
0010   if (!(e.eventAuxiliary().isRealData())) {
0011     // Grab the pileup information for this event
0012     edm::Handle<std::vector<PileupSummaryInfo> > puInfo;
0013     e.getByLabel(edm::InputTag("addPileupInfo"), puInfo);
0014 
0015     if (puInfo.isValid()) {
0016       std::vector<PileupSummaryInfo>::const_iterator pvi;
0017 
0018       for (pvi = puInfo->begin(); pvi != puInfo->end(); ++pvi) {
0019         int bx = pvi->getBunchCrossing();
0020 
0021         if (bx == 0) {
0022           sim_.meanInt = pvi->getTrueNumInteractions();
0023           sim_.actualInt = pvi->getPU_NumInteractions();
0024           continue;
0025         }
0026       }
0027     }
0028   } else {
0029     sim_.meanInt = -1.;
0030     sim_.actualInt = -1;
0031   }
0032 }