Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __DirectPhotonPythia_H__
0002 #define __DirectPhotonPythia_H__
0003 
0004 // --- need to check all these includes...
0005 #include <fun4all/SubsysReco.h>
0006 #include <vector>
0007 #include <cmath>
0008 #include <string>
0009 #include <limits.h>
0010 #include <TNtuple.h>
0011 
0012 class TTree;
0013 class TFile;
0014 class TH2D;
0015 class TH1D;
0016 
0017 
0018 class PHCompositeNode;
0019 class Jet;
0020 namespace HepMC
0021 {
0022   class GenEvent;
0023 }
0024 
0025 class DirectPhotonPythia : public SubsysReco
0026 {
0027 
0028 public:
0029 
0030   DirectPhotonPythia(std::string filename);
0031 
0032   int
0033   Init(PHCompositeNode*);
0034   int
0035   process_event(PHCompositeNode*);
0036   int
0037   End(PHCompositeNode*);
0038 
0039   float
0040   deltaR(float eta1, float eta2, float phi1, float phi2)
0041   {
0042 
0043     float deta = eta1 - eta2;
0044     float dphi = phi1 - phi2;
0045     if (dphi > +3.14159)
0046       dphi -= 2 * 3.14159;
0047     if (dphi < -3.14159)
0048       dphi += 2 * 3.14159;
0049 
0050     return sqrt(pow(deta, 2) + pow(dphi, 2));
0051 
0052   }
0053 
0054   double
0055   get_eta_max() const
0056   {
0057     return _eta_max;
0058   }
0059 
0060   void
0061   set_eta_max(double etaMax)
0062   {
0063     _eta_max = etaMax;
0064   }
0065 
0066   double
0067   get_eta_min() const
0068   {
0069     return _eta_min;
0070   }
0071 
0072   void
0073   set_eta_min(double etaMin)
0074   {
0075     _eta_min = etaMin;
0076   }
0077 
0078   double
0079   get_pt_max() const
0080   {
0081     return _pt_max;
0082   }
0083 
0084   void
0085   set_pt_max(double ptMax)
0086   {
0087     _pt_max = ptMax;
0088   }
0089 
0090   double
0091   get_pt_min() const
0092   {
0093     return _pt_min;
0094   }
0095 
0096   void
0097   set_pt_min(double ptMin)
0098   {
0099     _pt_min = ptMin;
0100   }
0101 
0102   //! action to take if no jet fitting _flavor requirement found. Action defined in <fun4all/Fun4AllReturnCodes.h>
0103   //! Default action is DISCARDEVENT for DST level filtering, one can further choose ABORTEVENT to use it as processing level filtering
0104   void
0105   set_rejection_action(int action)
0106   {
0107     _rejection_action = action;
0108   }
0109 
0110   //! The embedding ID for the HepMC subevent to be analyzed.
0111   //! embedding ID for the event
0112   //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0113   //! negative IDs are backgrounds, .e.g out of time pile up collisions
0114   //! Usually, ID = 0 means the primary Au+Au collision background
0115   int get_embedding_id() const { return _embedding_id; }
0116   //
0117   //! The embedding ID for the HepMC subevent to be analyzed.
0118   //! embedding ID for the event
0119   //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0120   //! negative IDs are backgrounds, .e.g out of time pile up collisions
0121   //! Usually, ID = 0 means the primary Au+Au collision background
0122   void set_embedding_id(int id) { _embedding_id = id; }
0123 private:
0124 
0125   //! tag jet flavor by parton matching, like PRL 113, 132301 (2014)
0126   int
0127   parton_tagging(Jet * jet, HepMC::GenEvent*, const double match_radius);
0128 
0129   //! tag jet flavor by hadron matching, like MIE proposal
0130   int
0131   hadron_tagging(Jet * jet, HepMC::GenEvent*, const double match_radius);
0132 
0133   bool _verbose;
0134 
0135   int _ievent;
0136   int _total_pass;
0137 
0138   TFile *_f;
0139  
0140   TH1D *_h1;
0141   TH2D *_h2;
0142   TH2D *_h2all;
0143   TH2D *_h2_b;
0144   TH2D *_h2_c;
0145   TNtuple *_ntp_gamma;
0146 
0147   std::string _foutname;
0148 
0149   int _flavor;
0150   int _maxevent;
0151 
0152   double _pt_min;
0153   double _pt_max;
0154 
0155   double _eta_min;
0156   double _eta_max;
0157 
0158   std::string _jet_name;
0159 
0160   //! action to take if no jet fitting _flavor requirement found. Action defined in <fun4all/Fun4AllReturnCodes.h>
0161   int _rejection_action;
0162   //! The embedding ID for the HepMC subevent to be analyzed.
0163   //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0164   //! negative IDs are backgrounds, .e.g out of time pile up collisions
0165   //! Usually, ID = 0 means the primary Au+Au collision background
0166   int _embedding_id;
0167 };
0168 
0169 #endif // __DirectPhotonPythia_H__