Differences
This shows you the differences between two versions of the page.
| |
users:taarre:edm [2014/05/28 10:56] – created taarre | users:taarre:edm [2014/05/28 11:10] (current) – taarre |
---|
vector<reco::GenParticle> "genParticles" "" "SIM" | vector<reco::GenParticle> "genParticles" "" "SIM" |
vector<reco::Track> "generalTracks" "" "RECO" | vector<reco::Track> "generalTracks" "" "RECO" |
You then need you own analyzer. Check out [[https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookWriteFrameworkModule|Writing your own EDAnalyzer]] | First column is the name of the class, second is the label. |
| Google your class reference to see the functions of the class. For instance "reco::GenParticle reference" gives you the page [[https://cmssdt.cern.ch/SDT/doxygen/CMSSW_5_3_6/doc/html/d5/dd4/classreco_1_1GenParticle.html| reco::GenParticle class reference]]. |
Google your class reference to see the functions of the class. For instance "reco::GenParticle reference" gives you the page [[https://cmssdt.cern.ch/SDT/doxygen/CMSSW_5_3_6/doc/html/d5/dd4/classreco_1_1GenParticle.html| reco::GenParticle class reference]] | You then need you own analyzer. Check out [[https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookWriteFrameworkModule|Writing your own EDAnalyzer]].\\ |
| For examples, check out /shome/jngadiub/TestPAT/CMSSW_5_3_11/src/Demo/MyEdmNtupleProducer/src/CandGenParticlesProducer.cc.\\ |
| To get your class |
| edm::Handle<reco::GenParticleCollection> genParticles; |
| iEvent.getByLabel(genSrc_, genParticles); |
| To loop |
| for(size_t i = 0; i < genParticles->size(); ++i ) |
| { |
| const reco::GenParticle & ParticleCand = (*genParticles)[i]; |
| const reco::GenParticleRefVector & motherRefs = ParticleCand.motherRefVector(); |
| const reco::GenParticleRefVector & daughterRefs = ParticleCand.daughterRefVector(); |
| } |
| To for instance get eta and pt |
| ParticleCand.eta() |
| ParticleCand.pt() |
| |
| |
| |