Fork me on GitHub

Changeset d612dec in git for readers


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

Location:
readers
Files:
1 added
2 edited
1 moved

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);
  • readers/DelphesHepMC2.cpp

    ra5af1df rd612dec  
    3535#include "classes/DelphesClasses.h"
    3636#include "classes/DelphesFactory.h"
    37 #include "classes/DelphesHepMCReader.h"
     37#include "classes/DelphesHepMC2Reader.h"
    3838#include "modules/Delphes.h"
    3939
     
    5757int main(int argc, char *argv[])
    5858{
    59   char appName[] = "DelphesHepMC";
     59  char appName[] = "DelphesHepMC2";
    6060  stringstream message;
    6161  FILE *inputFile = 0;
     
    6868  DelphesFactory *factory = 0;
    6969  TObjArray *stableParticleOutputArray = 0, *allParticleOutputArray = 0, *partonOutputArray = 0;
    70   DelphesHepMCReader *reader = 0;
     70  DelphesHepMC2Reader *reader = 0;
    7171  Int_t i, maxEvents, skipEvents;
    7272  Long64_t length, eventCounter;
     
    132132    partonOutputArray = modularDelphes->ExportArray("partons");
    133133
    134     reader = new DelphesHepMCReader;
     134    reader = new DelphesHepMC2Reader;
    135135
    136136    modularDelphes->InitTask();
  • readers/DelphesPythia8.cpp

    ra5af1df rd612dec  
    296296
    297297    // jet matching
     298#if PYTHIA_VERSION_INTEGER < 8300
    298299    matching = combined->getHook(*pythia);
    299300    if(!matching)
     
    302303    }
    303304    pythia->setUserHooksPtr(matching);
     305#endif
    304306
    305307    if(pythia == NULL)
Note: See TracChangeset for help on using the changeset viewer.