Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:43

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PHOTONJETSKINEMATICS_H
0004 #define PHOTONJETSKINEMATICS_H
0005 
0006 #include "JetQADefs.h"
0007 
0008 #include <fun4all/SubsysReco.h>
0009 
0010 #include <string>
0011 
0012 class Fun4AllHistoManager;
0013 class PHCompositeNode;
0014 class TH1;
0015 class TH2;
0016 class TriggerAnalyzer;
0017 
0018 class PhotonJetsKinematics : public SubsysReco
0019 {
0020  public:
0021 
0022 
0023   PhotonJetsKinematics(const std::string &modulename = "PhotonJetsKinematics", const std::string &inputnode = "CLUSTERINFO_CEMC", const std::string &histtag = "");
0024   ~PhotonJetsKinematics() override;
0025 
0026   /** Called during initialization.
0027       Typically this is where you can book histograms, and e.g.
0028       register them to Fun4AllServer (so they can be output to file
0029       using Fun4AllServer::dumpHistos() method).
0030    */
0031   int Init(PHCompositeNode *topNode) override;
0032 
0033   /** Called for first event when run number is known.
0034       Typically this is where you may want to fetch data from
0035       database, because you know the run number. A place
0036       to book histograms which have to know the run number.
0037    */
0038   int InitRun(PHCompositeNode *topNode) override;
0039 
0040   /** Called for each event.
0041       This is where you do the real work.
0042    */
0043   int process_event(PHCompositeNode *topNode) override;
0044 
0045   /// Clean up internals after each event.
0046   int ResetEvent(PHCompositeNode *topNode) override;
0047 
0048   /// Called at the end of each run.
0049   int EndRun(const int runnumber) override;
0050 
0051   /// Called at the end of all processing.
0052   int End(PHCompositeNode *topNode) override;
0053 
0054   /// Reset
0055   int Reset(PHCompositeNode * /*topNode*/) override;
0056 
0057   void Print(const std::string &what = "ALL") const override;
0058 
0059   /// specifies a trigger to select
0060   void SetTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSPhoton1)
0061   {
0062     m_doTrgSelect = true;
0063     m_trgToSelect = trig;
0064   }
0065 
0066   /// set histogram tag
0067   void SetHistTag(const std::string& tag)
0068   {
0069     m_histtag = tag;
0070   }
0071 
0072   /// turn on/off optional histograms
0073   void SetDoOptHist(const bool opt)
0074   {
0075     m_doOptHist = opt;
0076   }
0077 
0078  private:
0079   // std::string outfilename;
0080   // TFile *outfile;
0081  // hist manager
0082 
0083  TriggerAnalyzer* m_analyzer {nullptr};
0084  Fun4AllHistoManager* m_manager {nullptr};
0085  std::string m_modulename;
0086  std::string m_inputnode;
0087  std::string m_histtag;
0088  uint32_t m_trgToSelect;
0089  bool m_doTrgSelect;
0090  bool m_doOptHist;
0091 
0092  ///Output histograms
0093  TH1 *h_emcal_cluster_chi2 {nullptr};
0094  TH1 *h_emcal_cluster_energy {nullptr};
0095  TH2 *h_emcal_cluster_eta_phi {nullptr};
0096  TH1 *h_emcal_cluster_eta {nullptr};    // <-- Declare eta histogram
0097  TH1 *h_emcal_cluster_phi {nullptr};    // <-- Declare phi histogram
0098  TH2 *h_emcal_cluster_energy_eta {nullptr};
0099  TH2 *h_emcal_cluster_chi2_eta {nullptr};
0100  TH1 *h_emcal_cluster_eta_with_cuts{nullptr};
0101  TH1 *h_emcal_cluster_phi_with_cuts{nullptr};
0102  TH2 *h_emcal_cluster_eta_phi_with_cuts{nullptr};
0103  TH2 *h_emcal_cluster_energy_phi {nullptr};
0104  TH2 *h_emcal_cluster_chi2_phi {nullptr};
0105  TH1 *h_emcal_cluster_eta_with_energy_cut{nullptr};
0106  TH2 *h_emcal_cluster_chi2_energy{nullptr};
0107 };
0108 
0109 #endif // PHOTONJETSKINEMATICS_H