Changeset 1157 in svn for trunk/examples/DelphesCMSFWLite.cpp
- Timestamp:
- Jul 2, 2013, 5:45:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/DelphesCMSFWLite.cpp
r1147 r1157 1 #include <algorithm> 1 2 #include <stdexcept> 2 3 #include <iostream> … … 5 6 6 7 #include <map> 8 #include <vector> 7 9 8 10 #include <stdlib.h> … … 41 43 void ConvertInput(fwlite::Event &event, DelphesFactory *factory, TObjArray *allParticleOutputArray, TObjArray *stableParticleOutputArray, TObjArray *partonOutputArray) 42 44 { 43 size_t i;44 45 fwlite::Handle< vector< reco::GenParticle > > handleParticle; 46 vector< reco::GenParticle >::const_iterator itParticle; 47 48 vector< const reco::Candidate * > vectorCandidate; 49 vector< const reco::Candidate * >::iterator itCandidate; 50 45 51 handleParticle.getByLabel(event, "genParticles"); 46 52 … … 56 62 pdg = TDatabasePDG::Instance(); 57 63 58 for(i = 0; i < handleParticle->size(); ++i) 59 { 60 const reco::GenParticle &particle = (*handleParticle)[i]; 64 for(itParticle = handleParticle->begin(); itParticle != handleParticle->end(); ++itParticle) 65 { 66 vectorCandidate.push_back(&*itParticle); 67 } 68 69 for(itParticle = handleParticle->begin(); itParticle != handleParticle->end(); ++itParticle) 70 { 71 const reco::GenParticle &particle = *itParticle; 61 72 62 73 pid = particle.pdgId(); … … 71 82 72 83 candidate->Status = status; 84 85 itCandidate = find(vectorCandidate.begin(), vectorCandidate.end(), particle.daughter(0)); 86 if(itCandidate != vectorCandidate.end()) candidate->D1 = distance(vectorCandidate.begin(), itCandidate); 87 88 itCandidate = find(vectorCandidate.begin(), vectorCandidate.end(), particle.daughter(particle.numberOfDaughters() - 1)); 89 if(itCandidate != vectorCandidate.end()) candidate->D2 = distance(vectorCandidate.begin(), itCandidate); 73 90 74 91 pdgParticle = pdg->GetParticle(pid);
Note:
See TracChangeset
for help on using the changeset viewer.