Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:09

0001 #ifndef CALOANA_H__
0002 #define CALOANA_H__
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <vector>
0006 // Forward declarations
0007 class Fun4AllHistoManager;
0008 class PHCompositeNode;
0009 class TFile;
0010 class TNtuple;
0011 class TTree;
0012 class TH2F;
0013 class TH1F;
0014 class TH1;
0015 class TProfile2D;
0016 
0017 class CaloAna : public SubsysReco
0018 {
0019  public:
0020   //! constructor
0021   CaloAna(const std::string &name = "CaloAna", const std::string &fname = "MyNtuple.root");
0022 
0023   //! destructor
0024   virtual ~CaloAna();
0025 
0026   //! full initialization
0027   int Init(PHCompositeNode *);
0028 
0029   //! event processing method
0030   int process_event(PHCompositeNode *);
0031 
0032   //! end of run method
0033   int End(PHCompositeNode *);
0034 
0035   int process_g4hits(PHCompositeNode *);
0036   int process_g4cells(PHCompositeNode *);
0037   int process_towers(PHCompositeNode *);
0038   int process_clusters(PHCompositeNode *);
0039 
0040 
0041   void Detector(const std::string &name) { detector = name; }
0042   void set_timing_cut_width(const int &t) { _range = t;}
0043   void set_vertex_cut(const float &v) { _vz = v;}
0044   void apply_vertex_cut(bool Vtx_cut) { m_vtxCut = Vtx_cut; }
0045 
0046  protected:
0047   std::string detector;
0048   std::string outfilename;
0049   int Getpeaktime(TH1 *h);
0050   Fun4AllHistoManager *hm = nullptr;
0051   TFile *outfile = nullptr;
0052   TH2F* h_emcal_mbd_correlation = nullptr;
0053   TH2F* h_ohcal_mbd_correlation = nullptr;
0054   TH2F* h_ihcal_mbd_correlation = nullptr;
0055   TH2F* h_emcal_hcal_correlation = nullptr;
0056   TH2F* h_emcal_zdc_correlation = nullptr;
0057   
0058   TH1F* h_InvMass = nullptr;
0059 
0060   TH2F* h_cemc_etaphi = nullptr;
0061   TH2F* h_hcalin_etaphi = nullptr;
0062   TH2F* h_hcalout_etaphi = nullptr;
0063   TH2F* h_cemc_etaphi_wQA = nullptr;
0064   TH2F* h_hcalin_etaphi_wQA = nullptr;
0065   TH2F* h_hcalout_etaphi_wQA = nullptr;
0066   TH1* h_totalzdc_e;
0067 
0068   TProfile2D*    h_cemc_etaphi_time = nullptr;
0069   TProfile2D*  h_hcalin_etaphi_time = nullptr;
0070   TProfile2D* h_hcalout_etaphi_time = nullptr;
0071 
0072   TH2F* h_cemc_e_chi2 = nullptr;
0073   TH2F* h_ohcal_e_chi2 = nullptr;
0074   TH2F* h_ihcal_e_chi2 = nullptr;
0075 
0076   TProfile2D* h_cemc_etaphi_badChi2 = nullptr;
0077   TProfile2D* h_hcalin_etaphi_badChi2 = nullptr;
0078   TProfile2D* h_hcalout_etaphi_badChi2 = nullptr;
0079 
0080   TH1* hzdctime;
0081   TH1* hmbdtime;
0082   TH1* hemcaltime;
0083   TH1* hihcaltime;
0084   TH1* hohcaltime;
0085 
0086   TH1* hzdctime_cut;
0087   TH1* hmbdtime_cut;
0088   TH1* hemcaltime_cut;
0089   TH1* hihcaltime_cut;
0090   TH1* hohcaltime_cut;
0091 
0092   TH1* hvtx_z_raw;
0093   TH1* hvtx_z_cut;
0094 
0095   TH1* hzdcSouthraw;
0096   TH1* hzdcNorthraw;
0097   TH1* hzdcSouthcalib;
0098   TH1* hzdcNorthcalib;
0099 
0100   TH1F* h_clusE;
0101   TH2F* h_etaphi_clus;
0102 
0103   TNtuple *g4hitntuple = nullptr;
0104   TNtuple *g4cellntuple = nullptr;
0105   TTree *towerntuple = nullptr;
0106   TNtuple *clusterntuple = nullptr;
0107   std::vector<float> m_energy;
0108   std::vector<int> m_etabin;
0109   std::vector<int> m_phibin;
0110   std::vector<int> m_time;
0111 
0112   std::vector<float> m_hcalin_energy;
0113   std::vector<int> m_hcalin_etabin;
0114   std::vector<int> m_hcalin_phibin;
0115   std::vector<int> m_hcalin_time;
0116 
0117   std::vector<float> m_hcalout_energy;
0118   std::vector<int> m_hcalout_etabin;
0119   std::vector<int> m_hcalout_phibin;
0120   std::vector<int> m_hcalout_time;
0121 
0122 
0123   std::vector<float> m_zdc_energy;
0124   std::vector<int> m_zdc_index;
0125   std::vector<int> m_zdc_side;
0126 
0127 
0128   std::vector<float> m_bbc_energy;
0129   std::vector<int> m_bbc_type;
0130   std::vector<int> m_bbc_side;
0131   int _eventcounter;
0132   int _range = 1;
0133   float _vz = 0.;
0134   bool m_vtxCut = false;
0135   bool dynMaskClus = true;
0136 };
0137 
0138 #endif