- Timestamp:
- Jun 10, 2015, 4:04:47 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 8707eeb
- Parents:
- 6ec8d18 (diff), 9c491e1 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
readers/DelphesCMSFWLite.cpp
r6ec8d18 rdd514ae 56 56 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" 57 57 #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" 58 #include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h" 59 #include "SimDataFormats/GeneratorProducts/interface/WeightsInfo.h" 58 60 59 61 using namespace std; … … 62 64 63 65 void ConvertInput(fwlite::Event &event, Long64_t eventCounter, 64 ExRootTreeBranch *branchEvent, DelphesFactory *factory,65 TObjArray *allParticleOutputArray, TObjArray *stableParticleOutputArray,66 TObjArray * partonOutputArray)66 ExRootTreeBranch *branchEvent, ExRootTreeBranch *branchRwgt, 67 DelphesFactory *factory, TObjArray *allParticleOutputArray, 68 TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray) 67 69 { 68 70 fwlite::Handle< GenEventInfoProduct > handleGenEventInfo; 69 71 72 fwlite::Handle< LHEEventProduct > handleLHEEvent; 73 70 74 fwlite::Handle< vector< reco::GenParticle > > handleParticle; 71 75 vector< reco::GenParticle >::const_iterator itParticle; … … 75 79 76 80 handleGenEventInfo.getByLabel(event, "generator"); 81 handleLHEEvent.getByLabel(event, "source"); 77 82 handleParticle.getByLabel(event, "genParticles"); 78 83 79 84 HepMCEvent *element; 85 Weight *weight; 80 86 Candidate *candidate; 81 87 TDatabasePDG *pdg; … … 86 92 Double_t px, py, pz, e, mass; 87 93 Double_t x, y, z; 94 95 const vector< gen::WeightsInfo > &vectorWeightsInfo = handleLHEEvent->weights(); 96 vector< gen::WeightsInfo >::const_iterator itWeightsInfo; 88 97 89 98 element = static_cast<HepMCEvent *>(branchEvent->NewEntry()); … … 108 117 element->ReadTime = 0.0; 109 118 element->ProcTime = 0.0; 119 120 for(itWeightsInfo = vectorWeightsInfo.begin(); itWeightsInfo != vectorWeightsInfo.end(); ++itWeightsInfo) 121 { 122 weight = static_cast<Weight *>(branchRwgt->NewEntry()); 123 weight->Weight = itWeightsInfo->wgt; 124 } 110 125 111 126 pdg = TDatabasePDG::Instance(); … … 186 201 TStopwatch eventStopWatch; 187 202 ExRootTreeWriter *treeWriter = 0; 188 ExRootTreeBranch *branchEvent = 0 ;203 ExRootTreeBranch *branchEvent = 0, *branchRwgt = 0; 189 204 ExRootConfReader *confReader = 0; 190 205 Delphes *modularDelphes = 0; … … 226 241 227 242 branchEvent = treeWriter->NewBranch("Event", HepMCEvent::Class()); 243 branchRwgt = treeWriter->NewBranch("Rwgt", Weight::Class()); 228 244 229 245 confReader = new ExRootConfReader; … … 268 284 for(event.toBegin(); !event.atEnd() && !interrupted; ++event) 269 285 { 270 ConvertInput(event, eventCounter, branchEvent, factory,286 ConvertInput(event, eventCounter, branchEvent, branchRwgt, factory, 271 287 allParticleOutputArray, stableParticleOutputArray, partonOutputArray); 272 288 modularDelphes->ProcessTask();
Note:
See TracChangeset
for help on using the changeset viewer.