Exemplo n.º 1
0
int NeroAll::analyze(const edm::Event&iEvent)
{
    if(isMc_ <0 )
    {
        isMc_ = ( iEvent.isRealData() ) ? 0 : 1;
        isRealData = ( iEvent.isRealData() ) ? 1 : 0;
    }
    if( isSkim() == 0) 
    {
        //TODO FILL all_
        isRealData = ( iEvent.isRealData() ) ? 1 : 0;	
        runNum = iEvent.id().run();
        lumiNum = iEvent.luminosityBlock(); 	
        eventNum = iEvent.id().event();  
        iEvent.getByLabel(edm::InputTag("generator"), info_handle); // USE TOKEN AND INPUT TAG ?
        iEvent.getByLabel(edm::InputTag("addPileupInfo"), pu_handle);
        mcWeight = info_handle->weight();
        //PU
        puTrueInt = 0;
        for(const auto & pu : *pu_handle)
        {
            //Intime
            if (pu.getBunchCrossing() == 0)
                puTrueInt += pu.getTrueNumInteractions();
            //Out-of-time
        }
    }
    return 0;
}
Exemplo n.º 2
0
void ChPartTree::GetEvtId(const edm::Event& iEvent)
{
   using namespace std;

   if ( EvtIdDebug )
   {
     cout << "XJ: EvdId: " << iEvent.id() << endl ;
     cout << "XJ: Run  : " << iEvent.id().run() << endl ;
     cout << "XJ: Evt  : " << iEvent.id().event() << endl ;
     cout << "XJ: Lumbl: " << iEvent.luminosityBlock() << endl ;
//   cout << "XJ: proID: " << iEvent.processHistoryID() << endl;
//   cout << "XJ: GUID : " << iEvent.processGUID() << endl;
     edm::Timestamp Time=iEvent.time();
     cout << "XJ: time : " << Time.value() << endl;
     cout << "XJ: isDa : " << iEvent.isRealData() << endl;
     cout << "XJ: expTy: " << iEvent.experimentType() << endl ;
     cout << "XJ: Bx   : " << iEvent.bunchCrossing() << endl;
     cout << "XJ: Orbit: " << iEvent.orbitNumber() << endl;
//   cout << "XJ: Store: " << iEvent.storeNumber() << endl; 
   }

   EvtId.Reset();

   EvtId.Run       = iEvent.id().run() ;   
   EvtId.Evt       = iEvent.id().event() ;
   EvtId.LumiSect  = iEvent.luminosityBlock();
   edm::Timestamp Time=iEvent.time();
   EvtId.Time      = Time.value(); 
   EvtId.IsData    = iEvent.isRealData();
   EvtId.ExpType   = iEvent.experimentType();
   EvtId.Bunch     = iEvent.bunchCrossing();
   EvtId.Orbit     = iEvent.orbitNumber();

}
Exemplo n.º 3
0
EventInfo::EventInfo(const edm::Event& iEvent, const edm::Handle<reco::BeamSpot>& beamSpot, const edm::Handle<HcalNoiseSummary>& hcalNoiseSummary, const edm::Handle< std::vector<PileupSummaryInfo> >& puSummaryInfo, bool firstVertexIsGood_, float rho_):firstVertexIsGood(firstVertexIsGood_),rho(rho_)
{
  
  evt         = iEvent.id().event();
  run         = iEvent.id().run();
  lumiBlock   = iEvent.luminosityBlock();
  
  BSx = beamSpot->x0();
  BSy = beamSpot->y0();
  BSz = beamSpot->z0();
  
 
  if( hcalNoiseSummary.isValid() ){
    hcalnoiseLoose = hcalNoiseSummary->passLooseNoiseFilter();
    hcalnoiseTight = hcalNoiseSummary->passTightNoiseFilter();
  }
  
  if( puSummaryInfo.isValid() ){
    for(std::vector<PileupSummaryInfo>::const_iterator PVI = puSummaryInfo->begin(); PVI != puSummaryInfo->end(); ++PVI) {

      int BX = PVI->getBunchCrossing();

      sumNVtx  += float(PVI->getPU_NumInteractions());
      sumTrueNVtx += float(PVI->getTrueNumInteractions());

      if( BX==0 ){
	      numGenPV = PVI->getPU_NumInteractions();
	      numTruePV = PVI->getTrueNumInteractions();
      }

      if(BX == -1) { 
	      nm1 = PVI->getPU_NumInteractions();
	      nm1_true = PVI->getTrueNumInteractions();
      }
      else if(BX == 0) { 
	      n0 = PVI->getPU_NumInteractions();
	      n0_true = PVI->getTrueNumInteractions();
      }
      else if(BX == 1) { 
	      np1 = PVI->getPU_NumInteractions();
	      np1_true = PVI->getTrueNumInteractions();
      }
    }
  }
    
  
}