Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:57:46

0001 #ifndef PhysicsTools_HepMCCandAlgos_GenParticlesHelper_h
0002 #define PhysicsTools_HepMCCandAlgos_GenParticlesHelper_h
0003 
0004 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
0005 
0006 #include <iostream>
0007 
0008 namespace GenParticlesHelper {
0009 
0010   typedef reco::GenParticleCollection::const_iterator IG;
0011   typedef reco::GenParticleRefVector::const_iterator IGR;
0012 
0013   /// find all particles of a given pdgId and status
0014   void findParticles(const reco::GenParticleCollection& sourceParticles,
0015                      reco::GenParticleRefVector& particleRefs,
0016                      int pdgId,
0017                      int status);
0018 
0019   /// find all descendents of a given status and pdgId (recursive)
0020   void findDescendents(const reco::GenParticleRef& base,
0021                        reco::GenParticleRefVector& descendents,
0022                        int status,
0023                        int pdgId = 0);
0024 
0025   /// find the particles having the same daughter as baseSister
0026   void findSisters(const reco::GenParticleRef& baseSister, reco::GenParticleRefVector& sisterRefs);
0027 
0028   /// does the particle have an ancestor with this pdgId and this status?
0029   bool hasAncestor(const reco::GenParticle* particle, int pdgId, int status);
0030 
0031   /// check if particle is direct (has status 3 or is a daughter of particle with status 3)
0032   bool isDirect(const reco::GenParticleRef& particle);
0033 }  // namespace GenParticlesHelper
0034 
0035 namespace edm {
0036   std::ostream& operator<<(std::ostream& out, const reco::GenParticleRef& genRef);
0037 }
0038 #endif