Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:41

0001 #ifndef __HIJBKG_UPC_H__
0002 #define __HIJBKG_UPC_H__
0003 
0004 #include <Rtypes.h>
0005 #include <fun4all/SubsysReco.h>
0006 
0007 #include <string>
0008 #include <vector>
0009 #include <TParticle.h>
0010 
0011 class PHCompositeNode;
0012 class PHG4Particle;
0013 class TTree;
0014 class TFile;
0015 
0016 class hijbkg_upc : public SubsysReco
0017 {
0018  public:
0019 
0020   hijbkg_upc(const std::string &name = "hijbkg_upc");
0021 
0022   ~hijbkg_upc() override;
0023 
0024   /** Called during initialization.
0025       Typically this is where you can book histograms, and e.g.
0026       register them to Fun4AllServer (so they can be output to file
0027       using Fun4AllServer::dumpHistos() method).
0028    */
0029   int Init(PHCompositeNode *topNode) override;
0030 
0031   /** Called for first event when run number is known.
0032       Typically this is where you may want to fetch data from
0033       database, because you know the run number. A place
0034       to book histograms which have to know the run number.
0035    */
0036   int InitRun(PHCompositeNode *topNode) override;
0037 
0038   /** Called for each event.
0039       This is where you do the real work.
0040    */
0041   int process_event(PHCompositeNode *topNode) override;
0042 
0043   /// Clean up internals after each event.
0044   int ResetEvent(PHCompositeNode *topNode) override;
0045 
0046   /// Called at the end of each run.
0047   int EndRun(const int runnumber) override;
0048 
0049   /// Called at the end of all processing.
0050   int End(PHCompositeNode *topNode) override;
0051 
0052   /// Reset
0053   int Reset(PHCompositeNode * /*topNode*/) override;
0054 
0055   void Print(const std::string &what = "ALL") const override;
0056 
0057  private:
0058 
0059   TTree *T;
0060   int m_evt {0};            // event number
0061   Float_t m_cent = 0;       // centrality
0062   Float_t m_b = 0;          // impact parameter
0063   TParticle m_part[2];      // particle 1 and 2
0064 
0065   std::vector<int> m_pid = {0};
0066   std::vector<Float_t> m_pt =  {0};
0067   std::vector<Float_t> m_eta = {0};
0068   std::vector<Float_t> m_phi = {0};
0069   std::vector<Float_t> m_e = {0};
0070   std::vector<Float_t> m_p = {0};
0071   Float_t m_psi2 = 0;
0072 
0073   std::string Outfile;
0074   TFile *out;
0075 
0076   int isStableCharged(int pid);
0077   float getpT(PHG4Particle *particle);
0078   float getPhi(PHG4Particle *particle);
0079   float getEta(PHG4Particle *particle);
0080   float getP(PHG4Particle *particle);
0081   
0082 };
0083 
0084 #endif // __HIJBKG_UPC_H__