File indexing completed on 2025-08-06 08:16:33
0001
0002
0003 #ifndef ZDCSMDCOUNT_H
0004 #define ZDCSMDCOUNT_H
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <string>
0009 #include <map>
0010 class TFile;
0011 class TTree;
0012 class TH1;
0013 class TH2;
0014 class PHCompositeNode;
0015 class TGraphErrors;
0016
0017 class ZdcSmdCount : public SubsysReco
0018 {
0019 public:
0020 ZdcSmdCount(const std::string &name = "ZdcSmdCount", const int runnumber = 0,float cutvalue=0.,int roller=0);
0021
0022 ~ZdcSmdCount() override;
0023
0024
0025
0026
0027
0028
0029 int Init(PHCompositeNode *topNode) override;
0030
0031
0032
0033
0034
0035
0036 int InitRun(PHCompositeNode *topNode) override;
0037
0038
0039
0040
0041 int process_event(PHCompositeNode *topNode) override;
0042 int process_event_2(PHCompositeNode *topNode);
0043
0044
0045 int ResetEvent(PHCompositeNode *topNode) override;
0046
0047
0048 int EndRun(const int runnumber) override;
0049
0050
0051 int End(PHCompositeNode *topNode) override;
0052
0053
0054 int Reset(PHCompositeNode * ) override;
0055
0056 void Print(const std::string &what = "ALL") const override;
0057
0058
0059 void SetZDCAdcCut(unsigned int side, unsigned int module, float value);
0060 void GetSpinPatterns();
0061
0062 void InitGraph();
0063 void WriteGraph();
0064 void InitHist();
0065
0066 private:
0067 std::map<int, int> Chmapping;
0068 const unsigned int kZdc_num_ = 3;
0069 const unsigned int kSmd_num_ = 16;
0070 const unsigned int kSide_num_ = 2;
0071 static const int NBUNCHES = 120;
0072 float zdc_adc_cut_[2][3] = {0.};
0073 float smd_adc_cut_[2][2] = {0.};
0074 int spinPatternBlue[NBUNCHES] = {0};
0075 int spinPatternYellow[NBUNCHES] = {0};
0076 int crossingShift = 0;
0077 int runNum = 0;
0078 int event_counter_;
0079 int runnumber_;
0080 int bunchNum_;
0081 int bunchNum_previous_;
0082 bool b_s_smd_v12_ = false;
0083 bool b_n_smd_h12_ = false;
0084 bool b_s_smd_v67_ = false;
0085 bool b_n_smd_v67_ = false;
0086 bool b_s_smd_h12_ = false;
0087 bool b_n_smd_v12_ = false;
0088 bool b_s_smd_h78_ = false;
0089 bool b_n_smd_h78_ = false;
0090
0091 float cut_value_ = 5;
0092
0093
0094
0095 TFile *outfile_;
0096 std::string outfile_name_;
0097 TH1 *h1_NorthZDC_adc_;
0098 TH1 *h1_SouthZDC_adc_;
0099 TH1 *h1_SouthZDC_adc_origin_;
0100 TH1 *h1_NorthZDC_adc_origin_;
0101 TH1 *h1_SouthSMD_adc_origin_;
0102 TH1 *h1_NorthSMD_adc_origin_;
0103 TH1 *h1_SouthVeto_adc_origin_;
0104 TH1 *h1_NorthVeto_adc_origin_;
0105 TH1 *h1_SouthZDC_adc_ped_;
0106 TH1 *h1_NorthZDC_adc_ped_;
0107 TH1 *h1_SouthSMD_adc_ped_;
0108 TH1 *h1_NorthSMD_adc_ped_;
0109 TH1 *h1_SouthVeto_adc_;
0110 TH1 *h1_NorthVeto_adc_;
0111 TH1 *h1_SouthVeto_adc_ped_;
0112 TH1 *h1_NorthVeto_adc_ped_;
0113 TH1 *h1_NorthSMD_adc_;
0114 TH1 *h1_SouthSMD_adc_;
0115 TH1 *h1_NorthZDC1_adc_;
0116 TH1 *h1_SouthZDC1_adc_;
0117 TH1 *h1_NorthZDC2_adc_;
0118 TH1 *h1_SouthZDC2_adc_;
0119 TH1 *h1_NorthZDC3_adc_;
0120 TH1 *h1_SouthZDC3_adc_;
0121
0122 TH1 *h1_NorthSMD_Vertical_12_;
0123 TH1 *h1_NorthSMD_Vertical_67_;
0124 TH1 *h1_NorthSMD_Horizontal_12_;
0125 TH1 *h1_NorthSMD_Horizontal_78_;
0126 TH1 *h1_SouthSMD_Vertical_12_;
0127 TH1 *h1_SouthSMD_Vertical_67_;
0128 TH1 *h1_SouthSMD_Horizontal_12_;
0129 TH1 *h1_SouthSMD_Horizontal_78_;
0130
0131
0132
0133
0134
0135
0136 TH1 *h1_smd_hor_north_;
0137 TH1 *h1_smd_ver_north_;
0138 TH1 *h1_smd_hor_south_;
0139 TH1 *h1_smd_ver_south_;
0140
0141 TH1 *h1_smd_hor_south_up_;
0142 TH1 *h1_smd_ver_south_up_;
0143 TH1 *h1_smd_hor_south_down_;
0144 TH1 *h1_smd_ver_south_down_;
0145 TH1 *h1_smd_hor_north_up_;
0146 TH1 *h1_smd_ver_north_up_;
0147 TH1 *h1_smd_hor_north_down_;
0148 TH1 *h1_smd_ver_north_down_;
0149
0150 TH2 *h2_SouthZDC_;
0151 TH2 *h2_NorthZDC_;
0152 TH2 *h2_SouthSMD_;
0153 TH2 *h2_NorthSMD_;
0154 TH2 *h2_SouthVeto_;
0155 TH2 *h2_NorthVeto_;
0156 TH2 *h2_SouthZDC_cut_;
0157 TH2 *h2_NorthZDC_cut_;
0158 TH2 *h2_SouthSMD_cut_;
0159 TH2 *h2_NorthSMD_cut_;
0160 TH2 *h2_SouthVeto_cut_;
0161 TH2 *h2_NorthVeto_cut_;
0162
0163
0164 TGraphErrors *b_asymLR_north = nullptr;
0165 TGraphErrors *b_asymUD_north = nullptr;
0166 TGraphErrors *b_asym_north = nullptr;
0167 TGraphErrors *b_asymLR_south = nullptr;
0168 TGraphErrors *b_asymUD_south = nullptr;
0169 TGraphErrors *b_asym_south = nullptr;
0170
0171 TGraphErrors *y_asymLR_north = nullptr;
0172 TGraphErrors *y_asymUD_north = nullptr;
0173 TGraphErrors *y_asym_north = nullptr;
0174 TGraphErrors *y_asymLR_south = nullptr;
0175 TGraphErrors *y_asymUD_south = nullptr;
0176 TGraphErrors *y_asym_south = nullptr;
0177
0178
0179 TGraphErrors *b_sqasymLR_north = nullptr;
0180 TGraphErrors *b_sqasymUD_north = nullptr;
0181 TGraphErrors *b_sqasym_north = nullptr;
0182 TGraphErrors *b_sqasymLR_south = nullptr;
0183 TGraphErrors *b_sqasymUD_south = nullptr;
0184 TGraphErrors *b_sqasym_south = nullptr;
0185
0186 TGraphErrors *y_sqasymLR_north = nullptr;
0187 TGraphErrors *y_sqasymUD_north = nullptr;
0188 TGraphErrors *y_sqasym_north = nullptr;
0189 TGraphErrors *y_sqasymLR_south = nullptr;
0190 TGraphErrors *y_sqasymUD_south = nullptr;
0191 TGraphErrors *y_sqasym_south = nullptr;
0192 };
0193
0194 #endif