User Tools

Site Tools


users:taarre:edm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

users:taarre:edm [2014/05/28 10:56] – created taarreusers:taarre:edm [2014/05/28 11:10] (current) taarre
Line 17: Line 17:
   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 analyzerCheck 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() 
 + 
 + 
  
users/taarre/edm.1401267385.txt.gz · Last modified: 2014/05/28 10:56 by taarre