Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:12:32

0001 #ifndef __TRUTHTRACKERHEPMC_H__
0002 #define __TRUTHTRACKERHEPMC_H__
0003 
0004 /*HepMC include */
0005 #include <HepMC/GenParticle.h>
0006 #include <phhepmc/PHHepMCGenEvent.h>
0007 #include <phhepmc/PHHepMCGenEventMap.h>
0008 //#include <phhepmc/PHHepMCGenParticle.h>
0009 /**
0010    Class with helpful functions to trace particle and event information through HepMC event records.
0011 
0012    Some useful PDG codes:
0013 
0014    particle   ...   PGD code
0015    -------------------------
0016    LQ_ue      ...    39
0017    tau-       ...    15
0018    pi+        ...    211
0019    pi-        ...   -211
0020    u          ...    2
0021    d          ...    1
0022 */
0023 class TruthTrackerHepMC
0024 {
0025 
0026 public:
0027 
0028   /** Default constructor. */
0029   TruthTrackerHepMC();
0030 
0031   /** Default destructor. */
0032   ~TruthTrackerHepMC() {}
0033 
0034   /** Set pointer to PHHeoMCGenEventMap to use for this event. */
0035   void set_hepmc_geneventmap( PHHepMCGenEventMap* evtmap )
0036   {
0037     _genevtmap = evtmap;
0038   }
0039 
0040   /** Locate a particle with specific PDG code in event record. Return pointer to first particle with matching ID found. */
0041   HepMC::GenParticle* FindParticle( int );
0042 
0043   /** Locate a daughet particle with specific PDG code in event record that is a child of a given particle.
0044       Return pointer to first daughter particle with matching ID found. */
0045   HepMC::GenParticle* FindDaughterParticle( int , HepMC::GenParticle* );
0046 
0047   /** Locate beam lepton; the incident lepton is assumed to be the first particle in the particle list. */
0048   HepMC::GenParticle* FindBeamLepton();
0049 
0050   /** Locate beam hadron; the incident hadron is assumed to be the second particle in the particle list. */
0051   HepMC::GenParticle* FindBeamHadron();
0052 
0053   /** Locate scattered lepton; the scattered lepton beam is assumed to be the first final-state particle in the particle list with the same PDG code as the incident lepton beam. */
0054   HepMC::GenParticle* FindScatteredLepton( );
0055 
0056 
0057   /** Function to find final decay products of given particle */
0058   void FindDecayParticles(HepMC::GenParticle *, uint&, uint&, uint&);
0059 
0060   /** Function to calculate missing transverse momentum (pT_miss) and azimuthal angle of missing pT (pT_miss_phi) */
0061   void FindMissingPt( float & , float & );
0062 
0063 private:
0064 
0065   /** The PHHepMCGenEvent map with all HepMC information for this event */
0066   PHHepMCGenEventMap* _genevtmap;
0067 
0068   /** Check if this is the final state particle or not- update pointer if needed */
0069   void UpdateFinalStateParticle( HepMC::GenParticle *& );
0070 
0071   //  void FindDecayParticles(HepMC::GenParticle *, int&, int&, int&);
0072 
0073 };
0074 
0075 
0076 #endif