File indexing completed on 2025-08-05 08:17:29
0001 #ifndef CALOVALID_CALOVALID_H
0002 #define CALOVALID_CALOVALID_H
0003
0004 #include <calotrigger/TriggerAnalyzer.h>
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <string>
0009 #include <vector>
0010
0011
0012 class PHCompositeNode;
0013 class TH1;
0014 class TH2;
0015 class TH3;
0016 class TProfile2D;
0017 class TProfile;
0018
0019 class CaloValid : public SubsysReco
0020 {
0021 public:
0022
0023 CaloValid(const std::string& name = "CaloValid");
0024
0025
0026 ~CaloValid() override;
0027
0028
0029 int Init(PHCompositeNode*) override;
0030
0031 int InitRun(PHCompositeNode*) override;
0032
0033
0034 int process_event(PHCompositeNode*) override;
0035
0036
0037 int End(PHCompositeNode*) override;
0038
0039 int process_g4hits(PHCompositeNode*);
0040 int process_g4cells(PHCompositeNode*);
0041 int process_towers(PHCompositeNode*);
0042 int process_clusters(PHCompositeNode*);
0043
0044 void set_timing_cut_width(const int& t) { _range = t; }
0045
0046 void set_debug(bool debug) { m_debug = debug; }
0047 void SetSpecies(const std::string& species) { m_species = species; }
0048 static TH2* LogYHist2D(const std::string& name, const std::string& title, int, double, double, int, double, double);
0049
0050 private:
0051 void createHistos();
0052 static void MirrorHistogram(TH1* histogram);
0053 std::string getHistoPrefix() const;
0054 std::string m_species = "pp";
0055
0056 TriggerAnalyzer* trigAna{nullptr};
0057 TH3* h_pi0_trigIB_mass{nullptr};
0058 std::vector<int> triggerIndices{10, 28, 29, 30, 31};
0059
0060 TH1* h_cemc_channel_pedestal[128 * 192]{nullptr};
0061 TH1* h_ihcal_channel_pedestal[32 * 48]{nullptr};
0062 TH1* h_ohcal_channel_pedestal[32 * 48]{nullptr};
0063
0064 TH1* h_cemc_channel_energy[128 * 192]{nullptr};
0065 TH1* h_ihcal_channel_energy[32 * 48]{nullptr};
0066 TH1* h_ohcal_channel_energy[32 * 48]{nullptr};
0067 TH2* h_emcal_mbd_correlation{nullptr};
0068 TH1* h_mbd_hits{nullptr};
0069 TH2* h_ohcal_mbd_correlation{nullptr};
0070 TH2* h_ihcal_mbd_correlation{nullptr};
0071 TH2* h_emcal_hcal_correlation{nullptr};
0072 TH2* h_cemc_etaphi{nullptr};
0073 TH2* h_ihcal_etaphi{nullptr};
0074 TH2* h_ohcal_etaphi{nullptr};
0075 TH2* h_cemc_etaphi_wQA{nullptr};
0076 TH2* h_ihcal_etaphi_wQA{nullptr};
0077 TH2* h_ohcal_etaphi_wQA{nullptr};
0078 TH1* h_ihcal_status{nullptr};
0079 TH1* h_ohcal_status{nullptr};
0080 TH1* h_cemc_status{nullptr};
0081 TH2* h_cemc_e_chi2{nullptr};
0082 TH2* h_ihcal_e_chi2{nullptr};
0083 TH2* h_ohcal_e_chi2{nullptr};
0084 TProfile2D* h_cemc_etaphi_time{nullptr};
0085 TProfile2D* h_ihcal_etaphi_time{nullptr};
0086 TProfile2D* h_ohcal_etaphi_time{nullptr};
0087 TProfile2D* h_cemc_etaphi_fracHitADC{nullptr};
0088 TProfile2D* h_cemc_etaphi_fracHit{nullptr};
0089 TProfile2D* h_ihcal_etaphi_fracHitADC{nullptr};
0090 TProfile2D* h_ohcal_etaphi_fracHitADC{nullptr};
0091 TProfile2D* h_cemc_etaphi_pedRMS{nullptr};
0092 TProfile2D* h_ihcal_etaphi_pedRMS{nullptr};
0093 TProfile2D* h_ohcal_etaphi_pedRMS{nullptr};
0094 TProfile2D* h_cemc_etaphi_ZSpedRMS{nullptr};
0095 TProfile2D* h_ohcal_etaphi_ZSpedRMS{nullptr};
0096 TProfile2D* h_ihcal_etaphi_ZSpedRMS{nullptr};
0097 TProfile2D* h_cemc_etaphi_badChi2{nullptr};
0098 TProfile2D* h_ohcal_etaphi_badChi2{nullptr};
0099 TProfile2D* h_ihcal_etaphi_badChi2{nullptr};
0100 TH1* h_InvMass{nullptr};
0101 TH1* h_channel_pedestal_0{nullptr};
0102 TH1* h_vtx_z_raw{nullptr};
0103 TH1* h_vtx_z_cut{nullptr};
0104 TH1* h_emcaltime_cut{nullptr};
0105 TH1* h_ihcaltime_cut{nullptr};
0106 TH1* h_ohcaltime_cut{nullptr};
0107 TH1* h_emcaltime{nullptr};
0108 TH1* h_ihcaltime{nullptr};
0109 TH1* h_ohcaltime{nullptr};
0110 TH1* h_emcal_tower_e{nullptr};
0111 TH1* h_emcal_tower_e_wide_range{nullptr};
0112 TH1* h_emcal_tower_e_saturated{nullptr};
0113 TH1* h_ihcal_tower_e{nullptr};
0114 TH1* h_ihcal_tower_e_wide_range{nullptr};
0115 TH1* h_ihcal_tower_e_saturated{nullptr};
0116 TH1* h_ohcal_tower_e{nullptr};
0117 TH1* h_ohcal_tower_e_wide_range{nullptr};
0118 TH1* h_ohcal_tower_e_saturated{nullptr};
0119 TH2* h_etaphi_clus{nullptr};
0120 TH1* h_clusE{nullptr};
0121
0122 TProfile2D* h_cemc_etaphi_time_raw{nullptr};
0123 TProfile2D* h_ohcal_etaphi_time_raw{nullptr};
0124 TProfile2D* h_ihcal_etaphi_time_raw{nullptr};
0125
0126
0127 TH1* h_triggerVec{nullptr};
0128 TH2* h_edist[64] = {nullptr};
0129 TH1* h_ldClus_trig[64] = {nullptr};
0130 TProfile* pr_evtNum_ldClus_trig[64] = {nullptr};
0131 TProfile* pr_rejection[64] = {nullptr};
0132 TProfile* pr_livetime[64] = {nullptr};
0133 TProfile* pr_ldClus_trig{nullptr};
0134 std::vector<int> trigOfInterest = {3, 10, 11, 21, 22, 23, 25, 26, 27};
0135
0136 int _eventcounter{0};
0137 int _range{1};
0138
0139 bool m_debug{false};
0140
0141 std::string m_outputFileName;
0142 std::string OutputFileName;
0143 };
0144
0145 #endif