File indexing completed on 2025-08-06 08:12:25
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef ReadINTTZCombine_h
0009 #define ReadINTTZCombine_h
0010
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014
0015
0016
0017 class ReadINTTZCombine {
0018 public :
0019 TTree *fChain;
0020 Int_t fCurrent;
0021
0022
0023
0024
0025 Int_t eID;
0026 Long64_t bco_full;
0027 Int_t nclu_inner;
0028 Int_t nclu_outer;
0029 Int_t nclu_south;
0030 Int_t nclu_north;
0031 Double_t ES_zvtx;
0032 Double_t ES_zvtxE;
0033 Double_t ES_rangeL;
0034 Double_t ES_rangeR;
0035 Int_t ES_N_good;
0036 Double_t ES_Width_density;
0037 Double_t LB_Gaus_Mean_mean;
0038 Double_t LB_Gaus_Mean_meanE;
0039 Double_t LB_Gaus_Mean_chi2;
0040 Double_t LB_Gaus_Mean_width;
0041 Double_t LB_Gaus_Width_width;
0042 Double_t LB_Gaus_Width_offset;
0043 Double_t LB_Gaus_Width_size_width;
0044 Double_t LB_geo_mean;
0045 Bool_t good_zvtx_tag;
0046 Int_t mid_cut_Ngroup;
0047 Double_t mid_cut_peak_width;
0048 Double_t mid_cut_peak_ratio;
0049 Int_t LB_cut_Ngroup;
0050 Double_t LB_cut_peak_width;
0051 Double_t LB_cut_peak_ratio;
0052 Double_t MC_true_zvtx;
0053 Float_t Centrality_float;
0054 Double_t MBD_reco_z;
0055 Int_t is_min_bias;
0056 Int_t is_min_bias_wozdc;
0057 Double_t MBD_north_charge_sum;
0058 Double_t MBD_south_charge_sum;
0059
0060
0061 TBranch *b_eID;
0062 TBranch *b_bco_full;
0063 TBranch *b_nclu_inner;
0064 TBranch *b_nclu_outer;
0065 TBranch *b_nclu_south;
0066 TBranch *b_nclu_north;
0067 TBranch *b_ES_zvtx;
0068 TBranch *b_ES_zvtxE;
0069 TBranch *b_ES_rangeL;
0070 TBranch *b_ES_rangeR;
0071 TBranch *b_ES_N_good;
0072 TBranch *b_ES_Width_density;
0073 TBranch *b_LB_Gaus_Mean_mean;
0074 TBranch *b_LB_Gaus_Mean_meanE;
0075 TBranch *b_LB_Gaus_Mean_chi2;
0076 TBranch *b_LB_Gaus_Mean_width;
0077 TBranch *b_LB_Gaus_Width_width;
0078 TBranch *b_LB_Gaus_Width_offset;
0079 TBranch *b_LB_Gaus_Width_size_width;
0080 TBranch *b_LB_geo_mean;
0081 TBranch *b_good_zvtx_tag;
0082 TBranch *b_mid_cut_Ngroup;
0083 TBranch *b_mid_cut_peak_width;
0084 TBranch *b_mid_cut_peak_ratio;
0085 TBranch *b_LB_cut_Ngroup;
0086 TBranch *b_LB_cut_peak_width;
0087 TBranch *b_LB_cut_peak_ratio;
0088 TBranch *b_MC_true_zvtx;
0089 TBranch *b_Centrality_float;
0090 TBranch *b_MBD_reco_z;
0091 TBranch *b_is_min_bias;
0092 TBranch *b_is_min_bias_wozdc;
0093 TBranch *b_MBD_north_charge_sum;
0094 TBranch *b_MBD_south_charge_sum;
0095
0096 ReadINTTZCombine(TTree *tree=0);
0097 virtual ~ReadINTTZCombine();
0098 virtual Int_t Cut(Long64_t entry);
0099 virtual Int_t GetEntry(Long64_t entry);
0100 virtual Long64_t LoadTree(Long64_t entry);
0101 virtual void Init(TTree *tree);
0102 virtual void Loop();
0103 virtual Bool_t Notify();
0104 virtual void Show(Long64_t entry = -1);
0105 };
0106
0107 #endif
0108
0109 #ifdef ReadINTTZCombine_cxx
0110 ReadINTTZCombine::ReadINTTZCombine(TTree *tree) : fChain(0)
0111 {
0112
0113
0114 if (tree == 0) {
0115 TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("merged_file.root");
0116 if (!f || !f->IsOpen()) {
0117 f = new TFile("merged_file.root");
0118 }
0119 f->GetObject("tree_Z",tree);
0120
0121 }
0122 Init(tree);
0123 }
0124
0125 ReadINTTZCombine::~ReadINTTZCombine()
0126 {
0127 if (!fChain) return;
0128 delete fChain->GetCurrentFile();
0129 }
0130
0131 Int_t ReadINTTZCombine::GetEntry(Long64_t entry)
0132 {
0133
0134 if (!fChain) return 0;
0135 return fChain->GetEntry(entry);
0136 }
0137 Long64_t ReadINTTZCombine::LoadTree(Long64_t entry)
0138 {
0139
0140 if (!fChain) return -5;
0141 Long64_t centry = fChain->LoadTree(entry);
0142 if (centry < 0) return centry;
0143 if (fChain->GetTreeNumber() != fCurrent) {
0144 fCurrent = fChain->GetTreeNumber();
0145 Notify();
0146 }
0147 return centry;
0148 }
0149
0150 void ReadINTTZCombine::Init(TTree *tree)
0151 {
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161 if (!tree) return;
0162 fChain = tree;
0163 fCurrent = -1;
0164 fChain->SetMakeClass(1);
0165
0166 fChain->SetBranchAddress("eID", &eID, &b_eID);
0167 fChain->SetBranchAddress("bco_full", &bco_full, &b_bco_full);
0168 fChain->SetBranchAddress("nclu_inner", &nclu_inner, &b_nclu_inner);
0169 fChain->SetBranchAddress("nclu_outer", &nclu_outer, &b_nclu_outer);
0170 fChain->SetBranchAddress("nclu_south", &nclu_south, &b_nclu_south);
0171 fChain->SetBranchAddress("nclu_north", &nclu_north, &b_nclu_north);
0172 fChain->SetBranchAddress("ES_zvtx", &ES_zvtx, &b_ES_zvtx);
0173 fChain->SetBranchAddress("ES_zvtxE", &ES_zvtxE, &b_ES_zvtxE);
0174 fChain->SetBranchAddress("ES_rangeL", &ES_rangeL, &b_ES_rangeL);
0175 fChain->SetBranchAddress("ES_rangeR", &ES_rangeR, &b_ES_rangeR);
0176 fChain->SetBranchAddress("ES_N_good", &ES_N_good, &b_ES_N_good);
0177 fChain->SetBranchAddress("ES_Width_density", &ES_Width_density, &b_ES_Width_density);
0178 fChain->SetBranchAddress("LB_Gaus_Mean_mean", &LB_Gaus_Mean_mean, &b_LB_Gaus_Mean_mean);
0179 fChain->SetBranchAddress("LB_Gaus_Mean_meanE", &LB_Gaus_Mean_meanE, &b_LB_Gaus_Mean_meanE);
0180 fChain->SetBranchAddress("LB_Gaus_Mean_chi2", &LB_Gaus_Mean_chi2, &b_LB_Gaus_Mean_chi2);
0181 fChain->SetBranchAddress("LB_Gaus_Mean_width", &LB_Gaus_Mean_width, &b_LB_Gaus_Mean_width);
0182 fChain->SetBranchAddress("LB_Gaus_Width_width", &LB_Gaus_Width_width, &b_LB_Gaus_Width_width);
0183 fChain->SetBranchAddress("LB_Gaus_Width_offset", &LB_Gaus_Width_offset, &b_LB_Gaus_Width_offset);
0184 fChain->SetBranchAddress("LB_Gaus_Width_size_width", &LB_Gaus_Width_size_width, &b_LB_Gaus_Width_size_width);
0185 fChain->SetBranchAddress("LB_geo_mean", &LB_geo_mean, &b_LB_geo_mean);
0186 fChain->SetBranchAddress("good_zvtx_tag", &good_zvtx_tag, &b_good_zvtx_tag);
0187 fChain->SetBranchAddress("mid_cut_Ngroup", &mid_cut_Ngroup, &b_mid_cut_Ngroup);
0188 fChain->SetBranchAddress("mid_cut_peak_width", &mid_cut_peak_width, &b_mid_cut_peak_width);
0189 fChain->SetBranchAddress("mid_cut_peak_ratio", &mid_cut_peak_ratio, &b_mid_cut_peak_ratio);
0190 fChain->SetBranchAddress("LB_cut_Ngroup", &LB_cut_Ngroup, &b_LB_cut_Ngroup);
0191 fChain->SetBranchAddress("LB_cut_peak_width", &LB_cut_peak_width, &b_LB_cut_peak_width);
0192 fChain->SetBranchAddress("LB_cut_peak_ratio", &LB_cut_peak_ratio, &b_LB_cut_peak_ratio);
0193 fChain->SetBranchAddress("MC_true_zvtx", &MC_true_zvtx, &b_MC_true_zvtx);
0194 fChain->SetBranchAddress("Centrality_float", &Centrality_float, &b_Centrality_float);
0195 fChain->SetBranchAddress("MBD_reco_z", &MBD_reco_z, &b_MBD_reco_z);
0196 fChain->SetBranchAddress("is_min_bias", &is_min_bias, &b_is_min_bias);
0197 fChain->SetBranchAddress("is_min_bias_wozdc", &is_min_bias_wozdc, &b_is_min_bias_wozdc);
0198 fChain->SetBranchAddress("MBD_north_charge_sum", &MBD_north_charge_sum, &b_MBD_north_charge_sum);
0199 fChain->SetBranchAddress("MBD_south_charge_sum", &MBD_south_charge_sum, &b_MBD_south_charge_sum);
0200 Notify();
0201 }
0202
0203 Bool_t ReadINTTZCombine::Notify()
0204 {
0205
0206
0207
0208
0209
0210
0211 return kTRUE;
0212 }
0213
0214 void ReadINTTZCombine::Show(Long64_t entry)
0215 {
0216
0217
0218 if (!fChain) return;
0219 fChain->Show(entry);
0220 }
0221 Int_t ReadINTTZCombine::Cut(Long64_t entry)
0222 {
0223
0224
0225
0226 return 1;
0227 }
0228 #endif