Fork me on GitHub

Changeset d612dec in git for readers/DelphesCMSFWLite.cpp


Ignore:
Timestamp:
Dec 9, 2021, 7:52:15 AM (3 years ago)
Author:
christinaw97 <christina.wang@…>
Children:
29b722a
Parents:
a5af1df (diff), 0c0c9af (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:Christinaw97/delphes into HEAD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • readers/DelphesCMSFWLite.cpp

    ra5af1df rd612dec  
    217217      // Prevent duplicated particle.
    218218      if(!isMiniAOD) stableParticleOutputArray->Add(candidate);
    219     }
    220     else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 15)
     219      if (pdgCode == 11 || pdgCode == 13) partonOutputArray->Add(candidate);
     220    }
     221    //else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 15)
     222    else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 11 || pdgCode == 13 || pdgCode == 15)
    221223    {
    222224      partonOutputArray->Add(candidate);
     
    309311  DelphesFactory *factory = 0;
    310312  TObjArray *allParticleOutputArray = 0, *stableParticleOutputArray = 0, *partonOutputArray = 0;
    311   Int_t i;
     313  Int_t i, maxEvents, skipEvents;
    312314  Long64_t eventCounter, numberOfEvents;
    313315  Bool_t firstEvent = kTRUE;
     
    351353    confReader = new ExRootConfReader;
    352354    confReader->ReadFile(argv[1]);
     355   
     356    maxEvents = confReader->GetInt("::MaxEvents", 0);
     357    skipEvents = confReader->GetInt("::SkipEvents", 0);
     358   
     359    if(maxEvents < 0)
     360    {
     361      throw runtime_error("MaxEvents must be zero or positive");
     362    }
     363   
     364    if(skipEvents < 0)
     365    {
     366      throw runtime_error("SkipEvents must be zero or positive");
     367    }
    353368
    354369    modularDelphes = new Delphes("Delphes");
     
    389404      treeWriter->Clear();
    390405
    391       for(event.toBegin(); !event.atEnd() && !interrupted; ++event)
     406      for(event.toBegin(); !event.atEnd() && !interrupted && (maxEvents <= 0 || eventCounter-skipEvents < maxEvents); ++event)
    392407      {
    393         ConvertInput(event, eventCounter, branchEvent, branchWeight, factory,
    394           allParticleOutputArray, stableParticleOutputArray, partonOutputArray, firstEvent);
    395         modularDelphes->ProcessTask();
    396 
    397         firstEvent = kFALSE;
    398 
    399         treeWriter->Fill();
    400 
    401         modularDelphes->Clear();
    402         treeWriter->Clear();
     408        if(eventCounter >= skipEvents){
     409          ConvertInput(event, eventCounter, branchEvent, branchWeight, factory,
     410            allParticleOutputArray, stableParticleOutputArray, partonOutputArray, firstEvent);
     411          modularDelphes->ProcessTask();
     412
     413          firstEvent = kFALSE;
     414
     415          treeWriter->Fill();
     416
     417          modularDelphes->Clear();
     418          treeWriter->Clear();
     419        }
    403420
    404421        progressBar.Update(eventCounter, eventCounter);
Note: See TracChangeset for help on using the changeset viewer.