Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:16

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef JETRTRACK_H
0004 #define JETRTRACK_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <TF1.h>
0010 #include<string.h>
0011 #include<TProfile.h>
0012 #include<TH1.h>
0013 #include<TH2.h>
0014 #include <TFile.h>
0015 #include <TTree.h>
0016 
0017 
0018 class Fun4AllHistoManager;
0019 
0020 class PHCompositeNode;
0021 class TF1;
0022 class TH1D;
0023 class TH2D;
0024 class TTree;
0025 
0026 class jetrtrack : public SubsysReco
0027 {
0028  public:
0029 
0030   jetrtrack(const std::string &name = "jetrtrack");
0031 
0032   virtual ~jetrtrack();
0033 
0034   /** Called during initialization.
0035       Typically this is where you can book histograms, and e.g.
0036       register them to Fun4AllServer (so they can be output to file
0037       using Fun4AllServer::dumpHistos() method).
0038    */
0039   void SetOutputFileName(std::string outfilename)
0040   {
0041     m_outfilename = outfilename;
0042   }
0043 
0044   int Init(PHCompositeNode *topNode) override;
0045 
0046   /** Called for first event when run number is known.
0047       Typically this is where you may want to fetch data from
0048       database, because you know the run number. A place
0049       to book histograms which have to know the run number.
0050    */
0051   int InitRun(PHCompositeNode *topNode) override;
0052 
0053   /** Called for each event.
0054       This is where you do the real work.
0055    */
0056   int process_event(PHCompositeNode *topNode) override;
0057 
0058   /// Clean up internals after each event.
0059   int ResetEvent(PHCompositeNode *topNode) override;
0060 
0061   /// Called at the end of each run.
0062   int EndRun(const int runnumber) override;
0063 
0064   /// Called at the end of all processing.
0065   int End(PHCompositeNode *topNode) override;
0066 
0067   /// Reset
0068   int Reset(PHCompositeNode * /*topNode*/) override;
0069 
0070   void Print(const std::string &what = "ALL") const override;
0071 
0072  private:
0073   //---------------------------------------------
0074   //define the histogram manager
0075   //---------------------------------------------
0076   Fun4AllHistoManager *
0077   get_HistoManager();
0078 
0079   //-------------------------------------------------------------------------------
0080   //define some vectors in which we store jet information
0081   //-------------------------------------------------------------------------------
0082 
0083   std::vector<float> m_tjet_pt;
0084   std::vector<float> m_tjet_phi;
0085   std::vector<float> m_tjet_eta;
0086   std::vector<float> m_tjet_jcpt;
0087 
0088 
0089   std::vector<float> m_rjet_pt;
0090   std::vector<float> m_rjet_phi;
0091   std::vector<float> m_rjet_eta;
0092   std::vector<float> m_dr;
0093   std::vector<float> m_trk_pt;
0094   std::vector<float> m_trk_eta;
0095   std::vector<float> m_trk_phi;
0096   std::vector<float> m_trk_qual;
0097   std::vector<float> m_nmvtxhits;
0098 
0099   std::vector<float> m_tp_pt;
0100   std::vector<float> m_tp_px;
0101   std::vector<float> m_tp_py;
0102   std::vector<float> m_tp_pz;
0103   std::vector<float> m_tp_phi;
0104   std::vector<float> m_tp_eta;
0105 
0106 
0107   std::vector<float> m_jc_pt;
0108   std::vector<int> m_jc_index;
0109   std::vector<float> m_jc_phi;
0110   std::vector<float> m_jc_eta;
0111 
0112 
0113   std::vector<int> m_tp_pid;
0114 
0115   float m_zvtx;
0116   /* int m_nmvtxhits; */
0117   int m_centrality; 
0118   int m_impactparam;
0119   std::string m_outfilename;
0120 
0121   float m_tjet_pt2;
0122 
0123 
0124   
0125   TFile* outfile;
0126 
0127 };
0128 
0129 #endif // JETRTRACK_H