File indexing completed on 2025-08-06 08:18:40
0001 #ifndef CALOFITTINGQA_CALOFITTINGQA_H
0002 #define CALOFITTINGQA_CALOFITTINGQA_H
0003
0004 #include <fun4all/SubsysReco.h>
0005
0006 #include <caloreco/CaloTowerDefs.h>
0007
0008 #include <string>
0009 #include <vector>
0010
0011
0012 class CDBTTree;
0013 class PHCompositeNode;
0014 class TH1;
0015 class TH2;
0016 class TProfile2D;
0017
0018 class CaloFittingQA : public SubsysReco
0019 {
0020 public:
0021
0022 CaloFittingQA(const std::string& name = "CaloFittingQA");
0023
0024
0025 ~CaloFittingQA() override;
0026
0027
0028 int Init(PHCompositeNode*) override;
0029 int InitRun(PHCompositeNode*) override;
0030
0031
0032 int process_event(PHCompositeNode*) override;
0033
0034
0035 int End(PHCompositeNode*) override;
0036
0037 int process_towers(PHCompositeNode*);
0038 int process_data(PHCompositeNode* topNode, CaloTowerDefs::DetectorSystem dettype, std::vector<std::vector<float>>& waveforms);
0039 static bool skipChannel(int ich, int pid, CaloTowerDefs::DetectorSystem dettype);
0040
0041 void set_offlineflag(const bool f = true)
0042 {
0043 m_UseOfflinePacketFlag = f;
0044 }
0045 void set_simflag(const bool f = false)
0046 {
0047 m_SimFlag = f;
0048 }
0049 void set_cemc_lowadcthreshold(int lath)
0050 {
0051 m_cemc_adc_threshold = lath;
0052 }
0053 void set_cemc_highadcthreshold(int hath)
0054 {
0055 m_cemc_high_adc_threshold = hath;
0056 }
0057 void set_hcal_lowadcthreshold(int lath)
0058 {
0059 m_hcal_adc_threshold = lath;
0060 }
0061 void set_hcal_highadcthreshold(int hath)
0062 {
0063 m_hcal_high_adc_threshold = hath;
0064 }
0065 void set_cemc_hit_threshold(int hthres)
0066 {
0067 m_cemc_hit_threshold = hthres;
0068 }
0069 void set_ihcal_hit_threshold(int hthres)
0070 {
0071 m_ihcal_hit_threshold = hthres;
0072 }
0073 void set_ohcal_hit_threshold(int hthres)
0074 {
0075 m_ohcal_hit_threshold = hthres;
0076 }
0077
0078 private:
0079 void createHistos();
0080 std::string getHistoPrefix() const;
0081 TProfile2D* h_cemc_etaphi_ZScrosscalib{nullptr};
0082 TProfile2D* h_ihcal_etaphi_ZScrosscalib{nullptr};
0083 TProfile2D* h_ohcal_etaphi_ZScrosscalib{nullptr};
0084 TProfile2D* h_cemc_etaphi_pedestal{nullptr};
0085 TProfile2D* h_ihcal_etaphi_pedestal{nullptr};
0086 TProfile2D* h_ohcal_etaphi_pedestal{nullptr};
0087 TH2* h_cemc_zs_frac_vs_multiplicity{nullptr};
0088 TH2* h_ihcal_zs_frac_vs_multiplicity{nullptr};
0089 TH2* h_ohcal_zs_frac_vs_multiplicity{nullptr};
0090 TH1* h_packet_events{nullptr};
0091 TH1* h_empty_packets{nullptr};
0092 TH1* h_missing_packets{nullptr};
0093
0094 CDBTTree* cdbttree = nullptr;
0095
0096 int _eventcounter{0};
0097
0098 bool m_UseOfflinePacketFlag{true};
0099 bool m_SimFlag{false};
0100
0101 float m_cemc_adc_threshold = 200.;
0102 float m_cemc_high_adc_threshold = 2000.;
0103 float m_hcal_adc_threshold = 100.;
0104 float m_hcal_high_adc_threshold = 2000.;
0105
0106 float m_cemc_hit_threshold = 200;
0107 float m_ihcal_hit_threshold = 600;
0108 float m_ohcal_hit_threshold = 100;
0109 bool m_PacketNodesFlag{false};
0110
0111 std::string m_calibName;
0112 std::string m_fieldname;
0113 std::string m_outputFileName;
0114 std::string OutputFileName;
0115 };
0116
0117 #endif