Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __DVMPHELPER__
0002 #define __DVMPHELPER__
0003 
0004 #include <vector>
0005 #include <stdlib.h>
0006 class DVMPHelper
0007 {
0008 
0009  public:
0010   /* Primary constructor */
0011   DVMPHelper(std::vector<float> reco_eta, std::vector<float> reco_phi,
0012          std::vector<float> reco_ptotal, std::vector<int> reco_charge,
0013          std::vector<float> reco_cluster_e,
0014          std::vector<bool> reco_is_scattered_lepton,
0015          std::vector<float> true_eta, std::vector<float> true_phi,
0016          std::vector<float> true_ptotal, std::vector<int> pid,
0017          std::vector<bool> is_scattered_lepton);
0018 
0019   /* Default destructor */
0020   ~DVMPHelper() {}
0021 
0022   /* Reco Particle Struct */
0023   struct particle_reco{
0024     float eta;
0025     float phi;
0026     float ptotal;
0027     int charge;
0028     float e;
0029     bool is_scattered_lepton;
0030   };
0031 
0032   /* True Particle Struct */ 
0033   struct particle_truth{
0034     float eta;
0035     float phi;
0036     float ptotal;
0037     int pid;
0038     bool is_scattered_lepton;
0039   };
0040 
0041   /* Return invariant mass float from reco particles */
0042   std::vector<float> calculateInvariantMass_1();
0043   
0044   /* Return invariant mass float from truth particles */
0045   std::vector<float> calculateInvariantMass_2();
0046 
0047   /* Return invariant mass float from reco particles (decay particles) */
0048   std::vector<float> calculateInvariantMass_3();
0049 
0050   /* Return invariant mass float from reco particles (positron+scattered electron */
0051   std::vector<float> calculateInvariantMass_4();
0052 
0053   /* Return invariant mass float from truth particles (decay particles) */
0054   std::vector<float> calculateInvariantMass_5();
0055   
0056   /* Return invariant mass float from truth particles (positron+scattered e-) */
0057   std::vector<float> calculateInvariantMass_6();
0058 
0059   
0060   /* Size of reco/truth */
0061   int _size_reco;
0062   int _size_truth;
0063 
0064   /* Array of event particles */
0065   DVMPHelper::particle_reco * rparticles;
0066   DVMPHelper::particle_truth * tparticles;
0067 
0068   /* Return reco particle */
0069   particle_reco GetParticleReco(float eta, float phi, float ptotal, int charge, float e,bool is_scattered_lepton);
0070 
0071   /* Return truth particle */
0072   particle_truth GetParticleTruth(float eta, float phi, float ptotal, int pid, bool is_scattered_lepton);
0073   
0074   /* Return invariant mass from reco particles */
0075   float get_invariant_mass(DVMPHelper::particle_reco, DVMPHelper::particle_reco);
0076 
0077   /* Return invariant mass from truth particles */
0078   float get_invariant_mass(DVMPHelper::particle_truth, DVMPHelper::particle_truth);
0079 
0080   /* Quick method to grab transverse momentum */
0081   float get_pt(float eta, float ptotal);
0082 
0083   /* Test if a positron was found in the event */
0084   bool find_positron();
0085 
0086   /* Test if particle passes E/p cut */
0087   bool pass_cut(int index);
0088 
0089  private:
0090   
0091   
0092 };
0093 
0094 #endif