Changes in readers/DelphesCMSFWLite.cpp [7611cb9:355a7d7] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
readers/DelphesCMSFWLite.cpp
r7611cb9 r355a7d7 65 65 ExRootTreeBranch *branchEvent, ExRootTreeBranch *branchRwgt, 66 66 DelphesFactory *factory, TObjArray *allParticleOutputArray, 67 TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray , Bool_t firstEvent)67 TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray) 68 68 { 69 70 69 fwlite::Handle< GenEventInfoProduct > handleGenEventInfo; 70 71 71 fwlite::Handle< LHEEventProduct > handleLHEEvent; 72 72 73 fwlite::Handle< vector< reco::GenParticle > > handleParticle; 73 74 74 vector< reco::GenParticle >::const_iterator itParticle; 75 75 … … 78 78 79 79 handleGenEventInfo.getByLabel(event, "generator"); 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 if (firstEvent) 90 { 91 std::cout<<"Wrong LHEEvent Label! Please, check the input file."<<std::endl; 92 } 93 94 if (!((handleParticle.getBranchNameFor(event, "genParticles")).empty())) 95 { 96 handleParticle.getByLabel(event, "genParticles"); 97 } 98 else if (!((handleParticle.getBranchNameFor(event, "prunedGenParticles")).empty())) 99 { 100 handleParticle.getByLabel(event, "prunedGenParticles"); 101 } 102 else 103 { 104 std::cout<<"Wrong GenParticle Label! Please, check the input file."<<std::endl; 105 exit(-1); 106 } 107 108 Bool_t foundLHE = !((handleLHEEvent.getBranchNameFor(event, "source")).empty()) || !((handleLHEEvent.getBranchNameFor(event, "externalLHEProducer")).empty()); 80 handleLHEEvent.getByLabel(event, "externalLHEProducer"); 81 handleParticle.getByLabel(event, "genParticles"); 109 82 110 83 HepMCEvent *element; … … 118 91 Double_t px, py, pz, e, mass; 119 92 Double_t x, y, z; 93 94 const vector< gen::WeightsInfo > &vectorWeightsInfo = handleLHEEvent->weights(); 95 vector< gen::WeightsInfo >::const_iterator itWeightsInfo; 120 96 121 97 element = static_cast<HepMCEvent *>(branchEvent->NewEntry()); … … 141 117 element->ProcTime = 0.0; 142 118 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 } 119 for(itWeightsInfo = vectorWeightsInfo.begin(); itWeightsInfo != vectorWeightsInfo.end(); ++itWeightsInfo) 120 { 121 weight = static_cast<Weight *>(branchRwgt->NewEntry()); 122 weight->Weight = itWeightsInfo->wgt; 154 123 } 155 124 … … 238 207 Int_t i; 239 208 Long64_t eventCounter, numberOfEvents; 240 Bool_t firstEvent = kTRUE;241 209 242 210 if(argc < 4) … … 272 240 273 241 branchEvent = treeWriter->NewBranch("Event", HepMCEvent::Class()); 274 branchRwgt = treeWriter->NewBranch(" Rwgt", Weight::Class());242 branchRwgt = treeWriter->NewBranch("Weight", Weight::Class()); 275 243 276 244 confReader = new ExRootConfReader; … … 313 281 modularDelphes->Clear(); 314 282 treeWriter->Clear(); 315 316 283 for(event.toBegin(); !event.atEnd() && !interrupted; ++event) 317 284 { 318 285 ConvertInput(event, eventCounter, branchEvent, branchRwgt, factory, 319 allParticleOutputArray, stableParticleOutputArray, partonOutputArray , firstEvent);286 allParticleOutputArray, stableParticleOutputArray, partonOutputArray); 320 287 modularDelphes->ProcessTask(); 321 322 firstEvent = kFALSE;323 288 324 289 treeWriter->Fill();
Note:
See TracChangeset
for help on using the changeset viewer.