Fork me on GitHub

Changeset 480f9ed in git for readers


Ignore:
Timestamp:
Aug 23, 2016, 11:17:28 AM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
5175bbe
Parents:
29fe90c
Message:

added #974 suggested modification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • readers/DelphesCMSFWLite.cpp

    r29fe90c r480f9ed  
    6767  TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray)
    6868{
     69
    6970  fwlite::Handle< GenEventInfoProduct > handleGenEventInfo;
    70 
    7171  fwlite::Handle< LHEEventProduct > handleLHEEvent;
    72 
    7372  fwlite::Handle< vector< reco::GenParticle > > handleParticle;
     73
    7474  vector< reco::GenParticle >::const_iterator itParticle;
    7575
     
    7878
    7979  handleGenEventInfo.getByLabel(event, "generator");
    80   handleLHEEvent.getByLabel(event, "externalLHEProducer");
    81   handleParticle.getByLabel(event, "genParticles");
     80
     81  if (!((handleLHEEvent.getBranchNameFor(event, "source")).empty()))
     82  {
     83    handleLHEEvent.getByLabel(event, "source");
     84  }
     85  else if (!((handleLHEEvent.getBranchNameFor(event, "externalLHEProducer")).empty()))
     86  {
     87    handleLHEEvent.getByLabel(event, "externalLHEProducer");
     88  }
     89  else
     90  {
     91    std::cout<<"Wrong LHEEvent Label! Please, check the input file."<<std::endl;
     92    exit(-1);
     93  }
     94
     95  if (!((handleParticle.getBranchNameFor(event, "genParticles")).empty()))
     96  {
     97    handleParticle.getByLabel(event, "genParticles");
     98  }
     99  else if (!((handleParticle.getBranchNameFor(event, "prunedGenParticles")).empty()))
     100  {
     101    handleParticle.getByLabel(event, "prunedGenParticles");
     102  }
     103  else
     104  {
     105    std::cout<<"Wrong GenParticle Label! Please, check the input file."<<std::endl;
     106    exit(-1);
     107  }
    82108
    83109  HepMCEvent *element;
Note: See TracChangeset for help on using the changeset viewer.