- Timestamp:
- Aug 23, 2016, 1:52:03 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 98ce52a
- Parents:
- 5175bbe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
readers/DelphesCMSFWLite.cpp
r5175bbe r7611cb9 65 65 ExRootTreeBranch *branchEvent, ExRootTreeBranch *branchRwgt, 66 66 DelphesFactory *factory, TObjArray *allParticleOutputArray, 67 TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray )67 TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray, Bool_t firstEvent) 68 68 { 69 69 … … 87 87 handleLHEEvent.getByLabel(event, "externalLHEProducer"); 88 88 } 89 else 89 else if (firstEvent) 90 90 { 91 91 std::cout<<"Wrong LHEEvent Label! Please, check the input file."<<std::endl; 92 exit(-1);93 92 } 94 93 … … 106 105 exit(-1); 107 106 } 107 108 Bool_t foundLHE = !((handleLHEEvent.getBranchNameFor(event, "source")).empty()) || !((handleLHEEvent.getBranchNameFor(event, "externalLHEProducer")).empty()); 108 109 109 110 HepMCEvent *element; … … 117 118 Double_t px, py, pz, e, mass; 118 119 Double_t x, y, z; 119 120 const vector< gen::WeightsInfo > &vectorWeightsInfo = handleLHEEvent->weights();121 vector< gen::WeightsInfo >::const_iterator itWeightsInfo;122 120 123 121 element = static_cast<HepMCEvent *>(branchEvent->NewEntry()); … … 143 141 element->ProcTime = 0.0; 144 142 145 for(itWeightsInfo = vectorWeightsInfo.begin(); itWeightsInfo != vectorWeightsInfo.end(); ++itWeightsInfo) 146 { 147 weight = static_cast<Weight *>(branchRwgt->NewEntry()); 148 weight->Weight = itWeightsInfo->wgt; 143 144 if(foundLHE) 145 { 146 const vector< gen::WeightsInfo > &vectorWeightsInfo = handleLHEEvent->weights(); 147 vector< gen::WeightsInfo >::const_iterator itWeightsInfo; 148 149 for(itWeightsInfo = vectorWeightsInfo.begin(); itWeightsInfo != vectorWeightsInfo.end(); ++itWeightsInfo) 150 { 151 weight = static_cast<Weight *>(branchRwgt->NewEntry()); 152 weight->Weight = itWeightsInfo->wgt; 153 } 149 154 } 150 155 … … 233 238 Int_t i; 234 239 Long64_t eventCounter, numberOfEvents; 240 Bool_t firstEvent = kTRUE; 235 241 236 242 if(argc < 4) … … 307 313 modularDelphes->Clear(); 308 314 treeWriter->Clear(); 315 309 316 for(event.toBegin(); !event.atEnd() && !interrupted; ++event) 310 317 { 311 318 ConvertInput(event, eventCounter, branchEvent, branchRwgt, factory, 312 allParticleOutputArray, stableParticleOutputArray, partonOutputArray );319 allParticleOutputArray, stableParticleOutputArray, partonOutputArray, firstEvent); 313 320 modularDelphes->ProcessTask(); 321 322 firstEvent = kFALSE; 314 323 315 324 treeWriter->Fill();
Note:
See TracChangeset
for help on using the changeset viewer.