|
|
|||
File indexing completed on 2026-07-16 08:11:20
0001 std::string getDate()
0002 {
0003 std::time_t t = std::time(0); // get time now
0004 std::tm* now = std::localtime(&t);
0005
0006 std::stringstream date;
0007 date << (now->tm_mon + 1) << '/'
0008 << now->tm_mday << '/'
0009 << (now->tm_year + 1900);
0010 return date.str();
0011 }
0012
0013 /*
0014 void CutEfficiency()
0015 {
0016 string sim_inFile_Xi = "/sphenix/user/rosstom/TrackingAnalysis/Physics_Val_TF/sim/pTComp/KFParticle_2Mcascade_nopTCut.root";
0017 TFile* sim_file_Xi = new TFile(sim_inFile_Xi.c_str());
0018 TTree* sim_tree_Xi = (TTree*)sim_file_Xi->Get("DecayTree");
0019
0020 const int nBins_pT = 5;
0021 double pTbins[nBins_pT + 1] = {0.75, 0.909375, 1.05792, 1.23212, 1.46559, 2.0};
0022
0023 const int nBins_phi = 10;
0024 double phibins[nBins_phi + 1] = {-M_PI,-2.51177,-2.0196,-1.55623,-1.0106,-0.530045,0.0583016,1.05245,2.12079,2.59601,M_PI};
0025
0026 const int nBins_eta = 10;
0027 double etabins[nBins_eta + 1] = {-1.1,-0.916345,-0.755196,-0.585922,-0.390321,-0.159045,0.122585,0.394623,0.637892,0.849511,1.1};
0028
0029 std::string truthCut = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && abs(Ximinus_rapidity) <= 1.0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0";
0030 //std::string truthDataCut = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && Lambda0_track_1_MVTX_nStates > 0 && Lambda0_track_2_MVTX_nStates > 0 && track_3_MVTX_nStates > 0 && Lambda0_track_1_INTT_nStates > 0 && Lambda0_track_2_INTT_nStates > 0 && track_3_INTT_nStates > 0 && Lambda0_track_1_TPC_nStates > 19 && Lambda0_track_2_TPC_nStates > 19 && track_3_TPC_nStates > 19 && abs(Lambda0_mass - 1.1157) <= 0.01 && Ximinus_decayLength_xy >= 0.15 && Lambda0_decayLength_xy >= 0.01 && (Lambda0_track_1_chi2/Lambda0_track_1_nDoF) <= 400 && (Lambda0_track_2_chi2/Lambda0_track_2_nDoF) <= 400 && (track_3_chi2/track_3_nDoF) <= 400 && track_1_track_2_DCA <= 0.5 && Ximinus_chi2/Ximinus_nDoF <= 50 && track_1_track_3_DCA <= 0.5 && track_2_track_3_DCA <= 0.5 && Lambda0_chi2/Lambda0_nDoF <= 50";
0031 std::string truthDataCut = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0 && Lambda0_track_1_INTT_nHits > 0 && Lambda0_track_2_INTT_nHits > 0 && track_3_INTT_nHits > 0 && Lambda0_track_1_TPC_nHits > 19 && Lambda0_track_2_TPC_nHits > 19 && track_3_TPC_nHits > 19 && abs(Lambda0_mass - 1.1157) <= 0.01 && Ximinus_decayLength_xy >= 0.15 && Lambda0_decayLength_xy >= 0.01 && (Lambda0_track_1_chi2/Lambda0_track_1_nDoF) <= 400 && (Lambda0_track_2_chi2/Lambda0_track_2_nDoF) <= 400 && (track_3_chi2/track_3_nDoF) <= 400 && track_1_track_2_DCA <= 0.5 && track_1_track_3_DCA <= 0.5 && track_2_track_3_DCA <= 0.5 && Ximinus_chi2/Ximinus_nDoF <= 50 && Lambda0_chi2/Lambda0_nDoF <= 50 && abs(Ximinus_rapidity) <= 1.0";
0032
0033 TH1F* h_pT_truth = new TH1F("h_pT_truth",";#Xi^{-} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0034 TH1F* h_pT_truthCuts = new TH1F("h_pT_truthCuts",";#Xi^{-} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0035
0036 TH1F* h_eta_truth = new TH1F("h_eta_truth",";#Xi^{-} #eta;Cut Efficiency",nBins_eta,etabins);
0037 TH1F* h_eta_truthCuts = new TH1F("h_eta_truthCuts",";#Xi^{-} #eta;Cut Efficiency",nBins_eta,etabins);
0038
0039 TH1F* h_phi_truth = new TH1F("h_phi_truth",";#Xi^{-} #phi;Cut Efficiency",nBins_phi,phibins);
0040 TH1F* h_phi_truthCuts = new TH1F("h_phi_truthCuts",";#Xi^{-} #phi;Cut Efficiency",nBins_phi,phibins);
0041
0042 TH1F* h_y_truth = new TH1F("h_y_truth",";#Xi^{-} y;Cut Efficiency",10,-1.0,1.0);
0043 TH1F* h_y_truthCuts = new TH1F("h_y_truthCuts",";#Xi^{-} y;Cut Efficiency",10,-1.0,1.0);
0044
0045 h_pT_truth->Sumw2();
0046 h_pT_truthCuts->Sumw2();
0047 h_eta_truth->Sumw2();
0048 h_eta_truthCuts->Sumw2();
0049 h_phi_truth->Sumw2();
0050 h_phi_truthCuts->Sumw2();
0051 h_y_truth->Sumw2();
0052 h_y_truthCuts->Sumw2();
0053
0054 sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_truth",truthCut.c_str());
0055 sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_truthCuts",truthDataCut.c_str());
0056 sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_truth",truthCut.c_str());
0057 sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_truthCuts",truthDataCut.c_str());
0058 sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_truth",truthCut.c_str());
0059 sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_truthCuts",truthDataCut.c_str());
0060 sim_tree_Xi->Draw("Ximinus_rapidity>>+h_y_truth",truthCut.c_str());
0061 sim_tree_Xi->Draw("Ximinus_rapidity>>+h_y_truthCuts",truthDataCut.c_str());
0062
0063 TEfficiency* h_pT_eff = new TEfficiency(*h_pT_truthCuts, *h_pT_truth);
0064 TEfficiency* h_eta_eff = new TEfficiency(*h_eta_truthCuts, *h_eta_truth);
0065 TEfficiency* h_phi_eff = new TEfficiency(*h_phi_truthCuts, *h_phi_truth);
0066 TEfficiency* h_y_eff = new TEfficiency(*h_y_truthCuts, *h_y_truth);
0067 h_pT_eff->SetStatisticOption(TEfficiency::kFCP);
0068 h_pT_eff->SetMarkerStyle(20);
0069 h_pT_eff->SetMarkerSize(1.2);
0070 h_eta_eff->SetStatisticOption(TEfficiency::kFCP);
0071 h_eta_eff->SetMarkerStyle(20);
0072 h_eta_eff->SetMarkerSize(1.2);
0073 h_phi_eff->SetStatisticOption(TEfficiency::kFCP);
0074 h_phi_eff->SetMarkerStyle(20);
0075 h_phi_eff->SetMarkerSize(1.2);
0076 h_y_eff->SetStatisticOption(TEfficiency::kFCP);
0077 h_y_eff->SetMarkerStyle(20);
0078 h_y_eff->SetMarkerSize(1.2);
0079 //h_pT_eff->GetXaxis()->SetTitle("#Xi^{-} p_{T} [GeV/c]");
0080 //h_pT_eff->GetYaxis()->SetTitle("Cut Efficiency");
0081
0082 TCanvas *c1 = new TCanvas("myCanvas", "myCanvas",1600,1600);
0083 c1->Divide(2,2);
0084 //pT
0085 c1->cd(1);
0086 h_pT_eff->Draw("AP");
0087 c1->Update();
0088
0089 TGraph* g = h_pT_eff->GetPaintedGraph();
0090 if (g)
0091 {
0092 g->GetXaxis()->SetTitle("#Xi^{-} p_{T} [GeV/c]");
0093 //g->GetXaxis()->SetTitle("#Xi^{-} #eta");
0094 //g->GetXaxis()->SetTitle("#Xi^{-} #phi");
0095 //g->GetXaxis()->SetTitle("#Xi^{-} y");
0096 g->GetYaxis()->SetTitle("Cut Efficiency");
0097 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0098 g->GetXaxis()->SetLimits(pTbins[0], pTbins[nBins_pT]);
0099 //g->GetXaxis()->SetLimits(etabins[0], etabins[nBins_eta]);
0100 //g->GetXaxis()->SetLimits(phibins[0], phibins[nBins_phi]);
0101 //g->GetXaxis()->SetLimits(-1.5,1.5);
0102 }
0103 h_pT_eff->Draw("AP");
0104
0105 TPaveText *pt;
0106 pt = new TPaveText(0.15,0.75,0.65,1., "NDC");
0107 pt->SetFillColor(0);
0108 pt->SetFillStyle(0);
0109 pt->SetTextFont(42);
0110 string label = "#it{#bf{sPHENIX}} Simulation";
0111 TText *pt_LaTex = pt->AddText(label.c_str());
0112 pt->SetBorderSize(0);
0113 pt->Draw();
0114 gPad->Modified();
0115
0116 TPaveText *ptDate;
0117 ptDate = new TPaveText(0.67,0.79,0.85,0.95, "NDC");
0118 ptDate->SetFillColor(0);
0119 ptDate->SetFillStyle(0);
0120 ptDate->SetTextFont(42);
0121 std::string compilation_date = getDate();
0122 TText *pt_LaTexDate = ptDate->AddText(compilation_date.c_str());
0123 ptDate->SetBorderSize(0);
0124 ptDate->Draw();
0125 gPad->Modified();
0126
0127 //eta
0128 c1->cd(2);
0129 h_eta_eff->Draw("AP");
0130 c1->Update();
0131
0132 g = h_eta_eff->GetPaintedGraph();
0133 if (g)
0134 {
0135 g->GetXaxis()->SetTitle("#Xi^{-} #eta");
0136 g->GetYaxis()->SetTitle("Cut Efficiency");
0137 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0138 g->GetXaxis()->SetLimits(etabins[0], etabins[nBins_eta]);
0139 }
0140 h_eta_eff->Draw("AP");
0141
0142 pt->Draw();
0143 gPad->Modified();
0144
0145 ptDate->Draw();
0146 gPad->Modified();
0147
0148 //phi
0149 c1->cd(3);
0150 h_phi_eff->Draw("AP");
0151 c1->Update();
0152
0153 g = h_phi_eff->GetPaintedGraph();
0154 if (g)
0155 {
0156 g->GetXaxis()->SetTitle("#Xi^{-} #phi [rad]");
0157 g->GetYaxis()->SetTitle("Cut Efficiency");
0158 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0159 g->GetXaxis()->SetLimits(phibins[0], phibins[nBins_phi]);
0160 }
0161 h_phi_eff->Draw("AP");
0162
0163 pt->Draw();
0164 gPad->Modified();
0165
0166 ptDate->Draw();
0167 gPad->Modified();
0168
0169 //rapidity
0170 c1->cd(4);
0171 h_y_eff->Draw("AP");
0172 c1->Update();
0173
0174 g = h_y_eff->GetPaintedGraph();
0175 if (g)
0176 {
0177 g->GetXaxis()->SetTitle("#Xi^{-} y");
0178 g->GetYaxis()->SetTitle("Cut Efficiency");
0179 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0180 g->GetXaxis()->SetLimits(-1.0,1.0);
0181 }
0182 h_y_eff->Draw("AP");
0183
0184 pt->Draw();
0185 gPad->Modified();
0186
0187 ptDate->Draw();
0188 gPad->Modified();
0189
0190 string extensions[] = {".png"};
0191 for (auto extension : extensions)
0192 {
0193 string output = "Xi_all_cutEff" + extension;
0194 //string output = "Xi_pT_cutEff" + extension;
0195 //string output = "Xi_eta_cutEff" + extension;
0196 //string output = "Xi_phi_cutEff" + extension;
0197 //string output = "Xi_y_cutEff" + extension;
0198 c1->SaveAs(output.c_str());
0199 }
0200 }
0201 */
0202 /*
0203 void CutEfficiency()
0204 {
0205 string sim_inFile_KS0 = "/sphenix/user/cdean/software/analysis/LightFlavorRatios/geometric_acceptance/simulation/outputKFParticle_Kshort_reco.root";
0206 TFile* sim_file_KS0 = new TFile(sim_inFile_KS0.c_str());
0207 TTree* sim_tree_KS0 = (TTree*)sim_file_KS0->Get("DecayTree");
0208
0209 const int nBins_pT = 5;
0210 double pTbins[nBins_pT + 1] = {0.75, 0.909375, 1.05792, 1.23212, 1.46559, 2.0};
0211
0212 const int nBins_phi = 10;
0213 double phibins[nBins_phi + 1] = {-M_PI,-2.51177,-2.0196,-1.55623,-1.0106,-0.530045,0.0583016,1.05245,2.12079,2.59601,M_PI};
0214
0215 const int nBins_eta = 10;
0216 double etabins[nBins_eta + 1] = {-1.1,-0.916345,-0.755196,-0.585922,-0.390321,-0.159045,0.122585,0.394623,0.637892,0.849511,1.1};
0217
0218 std::string truthCut_KS0 = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0";
0219 std::string truthDataCut_KS0 = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0 && track_1_INTT_nHits > 0 && track_2_INTT_nHits > 0 && track_1_TPC_nHits > 19 && track_2_TPC_nHits > 19 && (track_1_chi2/track_1_nDoF) <= 300 && (track_2_chi2/track_2_nDoF) <= 300 && abs(track_1_IP_xy) >= 0.05 && abs(track_2_IP_xy) >= 0.05 && track_1_track_2_DCA <= 0.5 && track_1_track_2_DCA_xy <= 1.0 && K_S0_DIRA >= 0.99 && (K_S0_chi2/K_S0_nDoF) <= 20 && abs(K_S0_mass - 0.5) <= 0.1";
0220
0221 TH1F* h_pT_truth_KS0 = new TH1F("h_pT_truth_KS0",";K_{S}^{0} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0222 TH1F* h_pT_truthCuts_KS0 = new TH1F("h_pT_truthCuts_KS0",";K_{S}^{0} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0223
0224 TH1F* h_eta_truth_KS0 = new TH1F("h_eta_truth_KS0",";K_{S}^{0} #eta;Cut Efficiency",nBins_eta,etabins);
0225 TH1F* h_eta_truthCuts_KS0 = new TH1F("h_eta_truthCuts_KS0",";K_{S}^{0} #eta;Cut Efficiency",nBins_eta,etabins);
0226
0227 TH1F* h_phi_truth_KS0 = new TH1F("h_phi_truth_KS0",";K_{S}^{0} #phi;Cut Efficiency",nBins_phi,phibins);
0228 TH1F* h_phi_truthCuts_KS0 = new TH1F("h_phi_truthCuts_KS0",";K_{S}^{0} #phi;Cut Efficiency",nBins_phi,phibins);
0229
0230 TH1F* h_y_truth_KS0 = new TH1F("h_y_truth_KS0",";K_{S}^{0} y;Cut Efficiency",10,-1.0,1.0);
0231 TH1F* h_y_truthCuts_KS0 = new TH1F("h_y_truthCuts_KS0",";K_{S}^{0} y;Cut Efficiency",10,-1.0,1.0);
0232
0233 h_pT_truth_KS0->Sumw2();
0234 h_pT_truthCuts_KS0->Sumw2();
0235 h_eta_truth_KS0->Sumw2();
0236 h_eta_truthCuts_KS0->Sumw2();
0237 h_phi_truth_KS0->Sumw2();
0238 h_phi_truthCuts_KS0->Sumw2();
0239 h_y_truth_KS0->Sumw2();
0240 h_y_truthCuts_KS0->Sumw2();
0241
0242 sim_tree_KS0->Draw("K_S0_pT>>+h_pT_truth_KS0",truthCut_KS0.c_str());
0243 sim_tree_KS0->Draw("K_S0_pT>>+h_pT_truthCuts_KS0",truthDataCut_KS0.c_str());
0244 sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_truth_KS0",truthCut_KS0.c_str());
0245 sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_truthCuts_KS0",truthDataCut_KS0.c_str());
0246 sim_tree_KS0->Draw("K_S0_phi>>+h_phi_truth_KS0",truthCut_KS0.c_str());
0247 sim_tree_KS0->Draw("K_S0_phi>>+h_phi_truthCuts_KS0",truthDataCut_KS0.c_str());
0248 sim_tree_KS0->Draw("K_S0_rapidity>>+h_y_truth_KS0",truthCut_KS0.c_str());
0249 sim_tree_KS0->Draw("K_S0_rapidity>>+h_y_truthCuts_KS0",truthDataCut_KS0.c_str());
0250
0251 TEfficiency* h_pT_eff_KS0 = new TEfficiency(*h_pT_truthCuts_KS0, *h_pT_truth_KS0);
0252 TEfficiency* h_eta_eff_KS0 = new TEfficiency(*h_eta_truthCuts_KS0, *h_eta_truth_KS0);
0253 TEfficiency* h_phi_eff_KS0 = new TEfficiency(*h_phi_truthCuts_KS0, *h_phi_truth_KS0);
0254 TEfficiency* h_y_eff_KS0 = new TEfficiency(*h_y_truthCuts_KS0, *h_y_truth_KS0);
0255 h_pT_eff_KS0->SetStatisticOption(TEfficiency::kFCP);
0256 h_pT_eff_KS0->SetMarkerStyle(20);
0257 h_pT_eff_KS0->SetMarkerSize(1.2);
0258 h_eta_eff_KS0->SetStatisticOption(TEfficiency::kFCP);
0259 h_eta_eff_KS0->SetMarkerStyle(20);
0260 h_eta_eff_KS0->SetMarkerSize(1.2);
0261 h_phi_eff_KS0->SetStatisticOption(TEfficiency::kFCP);
0262 h_phi_eff_KS0->SetMarkerStyle(20);
0263 h_phi_eff_KS0->SetMarkerSize(1.2);
0264 h_y_eff_KS0->SetStatisticOption(TEfficiency::kFCP);
0265 h_y_eff_KS0->SetMarkerStyle(20);
0266 h_y_eff_KS0->SetMarkerSize(1.2);
0267
0268 TCanvas *c1 = new TCanvas("myCanvas", "myCanvas",1600,1600);
0269 c1->Divide(2,2);
0270 //pT
0271 c1->cd(1);
0272 h_pT_eff_KS0->Draw("AP");
0273 c1->Update();
0274
0275 TGraph* g = h_pT_eff_KS0->GetPaintedGraph();
0276 if (g)
0277 {
0278 g->GetXaxis()->SetTitle("K_{S}^{0} p_{T} [GeV/c]");
0279 g->GetYaxis()->SetTitle("Cut Efficiency");
0280 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0281 g->GetXaxis()->SetLimits(pTbins[0], pTbins[nBins_pT]);
0282 }
0283 h_pT_eff_KS0->Draw("AP");
0284
0285 TPaveText *pt;
0286 pt = new TPaveText(0.15,0.75,0.65,1., "NDC");
0287 pt->SetFillColor(0);
0288 pt->SetFillStyle(0);
0289 pt->SetTextFont(42);
0290 string label = "#it{#bf{sPHENIX}} Simulation";
0291 TText *pt_LaTex = pt->AddText(label.c_str());
0292 pt->SetBorderSize(0);
0293 pt->Draw();
0294 gPad->Modified();
0295
0296 TPaveText *ptDate;
0297 ptDate = new TPaveText(0.67,0.79,0.85,0.95, "NDC");
0298 ptDate->SetFillColor(0);
0299 ptDate->SetFillStyle(0);
0300 ptDate->SetTextFont(42);
0301 std::string compilation_date = getDate();
0302 TText *pt_LaTexDate = ptDate->AddText(compilation_date.c_str());
0303 ptDate->SetBorderSize(0);
0304 ptDate->Draw();
0305 gPad->Modified();
0306
0307 //eta
0308 c1->cd(2);
0309 h_eta_eff_KS0->Draw("AP");
0310 c1->Update();
0311
0312 g = h_eta_eff_KS0->GetPaintedGraph();
0313 if (g)
0314 {
0315 g->GetXaxis()->SetTitle("K_{S}^{0} #eta");
0316 g->GetYaxis()->SetTitle("Cut Efficiency");
0317 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0318 g->GetXaxis()->SetLimits(etabins[0], etabins[nBins_eta]);
0319 }
0320 h_eta_eff_KS0->Draw("AP");
0321
0322 pt->Draw();
0323 gPad->Modified();
0324
0325 ptDate->Draw();
0326 gPad->Modified();
0327
0328 //phi
0329 c1->cd(3);
0330 h_phi_eff_KS0->Draw("AP");
0331 c1->Update();
0332
0333 g = h_phi_eff_KS0->GetPaintedGraph();
0334 if (g)
0335 {
0336 g->GetXaxis()->SetTitle("K_{S}^{0} #phi [rad]");
0337 g->GetYaxis()->SetTitle("Cut Efficiency");
0338 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0339 g->GetXaxis()->SetLimits(phibins[0], phibins[nBins_phi]);
0340 }
0341 h_phi_eff_KS0->Draw("AP");
0342
0343 pt->Draw();
0344 gPad->Modified();
0345
0346 ptDate->Draw();
0347 gPad->Modified();
0348
0349 //rapidity
0350 c1->cd(4);
0351 h_y_eff_KS0->Draw("AP");
0352 c1->Update();
0353
0354 g = h_y_eff_KS0->GetPaintedGraph();
0355 if (g)
0356 {
0357 g->GetXaxis()->SetTitle("K_{S}^{0} y");
0358 g->GetYaxis()->SetTitle("Cut Efficiency");
0359 g->GetYaxis()->SetRangeUser(0.0, 1.05);
0360 g->GetXaxis()->SetLimits(-1.0,1.0);
0361 }
0362 h_y_eff_KS0->Draw("AP");
0363
0364 pt->Draw();
0365 gPad->Modified();
0366
0367 ptDate->Draw();
0368 gPad->Modified();
0369
0370 string extensions[] = {".png"};
0371 for (auto extension : extensions)
0372 {
0373 string output = "KS0_all_cutEff" + extension;
0374 c1->SaveAs(output.c_str());
0375 }
0376 }
0377 */
0378 void CutEfficiency()
0379 {
0380 string sim_inFile_Xi = "/sphenix/user/rosstom/TrackingAnalysis/Physics_Val_TF/sim/pTComp/KFParticle_4Mcascade_nopTCut.root";
0381 TFile* sim_file_Xi = new TFile(sim_inFile_Xi.c_str());
0382 TTree* sim_tree_Xi = (TTree*)sim_file_Xi->Get("DecayTree");
0383
0384 /*
0385 const int nBins_pT = 5;
0386 double pTbins[nBins_pT + 1] = {0.75, 0.909375, 1.05792, 1.23212, 1.46559, 2.0};
0387
0388 const int nBins_phi = 10;
0389 double phibins[nBins_phi + 1] = {-M_PI,-2.51177,-2.0196,-1.55623,-1.0106,-0.530045,0.0583016,1.05245,2.12079,2.59601,M_PI};
0390
0391 const int nBins_eta = 10;
0392 double etabins[nBins_eta + 1] = {-1.1,-0.916345,-0.755196,-0.585922,-0.390321,-0.159045,0.122585,0.394623,0.637892,0.849511,1.1};
0393 */
0394
0395 const int nBins_pT = 4;
0396 double pTbins[nBins_pT + 1] = {0.75, 1.07, 1.25, 1.49, 2.0};
0397
0398 const int nBins_phi = 6;
0399 //double phibins[nBins_phi + 1] = {-M_PI,-2.14,-1.37,-0.61,0.35,2.21,M_PI};
0400 double phibins[nBins_phi + 1] = {-M_PI,-2.09439,-1.04719,0.0,1.04721,2.09441,M_PI};
0401
0402 const int nBins_eta = 6;
0403 //double etabins[nBins_eta + 1] = {-1.1,-0.82,-0.56,-0.20,0.30,0.72,1.1};
0404 double etabins[nBins_eta + 1] = {-1.1,-0.733333,-0.366666,0.0,0.366668,0.733335,1.1};
0405
0406 const int nBins_rap = 6;
0407 //double rapbins[nBins_rap + 1] = {-1.0,-0.64,-0.41,-0.15,0.21,0.55,1.0};
0408 double rapbins[nBins_rap + 1] = {-1.0,-0.66,-0.33,0.0,0.33,0.66,1.0};
0409
0410 std::string truthCut = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && abs(Ximinus_rapidity) <= 1.0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && Lambda0_track_1_charge == track_3_charge";
0411 std::string truthDataCut = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && Lambda0_track_1_charge == track_3_charge && Lambda0_track_1_INTT_nHits > 0 && Lambda0_track_2_INTT_nHits > 0 && track_3_INTT_nHits > 0 && Lambda0_track_1_TPC_nHits > 19 && Lambda0_track_2_TPC_nHits > 19 && track_3_TPC_nHits > 19 && abs(Lambda0_mass - 1.1157) <= 0.01 && Ximinus_decayLength_xy >= 0.15 && Lambda0_decayLength_xy >= 0.01 && (Lambda0_track_1_chi2/Lambda0_track_1_nDoF) <= 400 && (Lambda0_track_2_chi2/Lambda0_track_2_nDoF) <= 400 && (track_3_chi2/track_3_nDoF) <= 400 && track_1_track_2_DCA <= 0.5 && track_1_track_3_DCA <= 0.5 && track_2_track_3_DCA <= 0.5 && Ximinus_chi2/Ximinus_nDoF <= 50 && Lambda0_chi2/Lambda0_nDoF <= 50 && abs(Ximinus_rapidity) <= 1.0 && Lambda0_track_1_pT >= 0.2 && Lambda0_track_2_pT >= 0.2 && track_3_pT >= 0.2";
0412
0413 TH1F* h_pT_truth = new TH1F("h_pT_truth",";#Xi^{-} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0414 TH1F* h_pT_truthCuts = new TH1F("h_pT_truthCuts",";#Xi^{-} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0415
0416 TH1F* h_eta_truth = new TH1F("h_eta_truth",";#Xi^{-} #eta;Cut Efficiency",nBins_eta,etabins);
0417 TH1F* h_eta_truthCuts = new TH1F("h_eta_truthCuts",";#Xi^{-} #eta;Cut Efficiency",nBins_eta,etabins);
0418
0419 TH1F* h_phi_truth = new TH1F("h_phi_truth",";#Xi^{-} #phi;Cut Efficiency",nBins_phi,phibins);
0420 TH1F* h_phi_truthCuts = new TH1F("h_phi_truthCuts",";#Xi^{-} #phi;Cut Efficiency",nBins_phi,phibins);
0421
0422 TH1F* h_y_truth = new TH1F("h_y_truth",";#Xi^{-} y;Cut Efficiency",nBins_rap,rapbins);
0423 TH1F* h_y_truthCuts = new TH1F("h_y_truthCuts",";#Xi^{-} y;Cut Efficiency",nBins_rap,rapbins);
0424
0425 h_pT_truth->Sumw2();
0426 h_pT_truthCuts->Sumw2();
0427 h_eta_truth->Sumw2();
0428 h_eta_truthCuts->Sumw2();
0429 h_phi_truth->Sumw2();
0430 h_phi_truthCuts->Sumw2();
0431 h_y_truth->Sumw2();
0432 h_y_truthCuts->Sumw2();
0433
0434 sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_truth",truthCut.c_str());
0435 sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_truthCuts",truthDataCut.c_str());
0436 sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_truth",truthCut.c_str());
0437 sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_truthCuts",truthDataCut.c_str());
0438 sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_truth",truthCut.c_str());
0439 sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_truthCuts",truthDataCut.c_str());
0440 sim_tree_Xi->Draw("Ximinus_rapidity>>+h_y_truth",truthCut.c_str());
0441 sim_tree_Xi->Draw("Ximinus_rapidity>>+h_y_truthCuts",truthDataCut.c_str());
0442
0443 string sim_inFile_KS0 = "/sphenix/user/cdean/software/analysis/LightFlavorRatios/geometric_acceptance/simulation/outputKFParticle_Kshort_reco.root";
0444 TFile* sim_file_KS0 = new TFile(sim_inFile_KS0.c_str());
0445 TTree* sim_tree_KS0 = (TTree*)sim_file_KS0->Get("DecayTree");
0446
0447 std::string truthCut_KS0 = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0 && abs(primary_vertex_z) < 10";
0448 std::string truthDataCut_KS0 = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && track_1_INTT_nHits > 0 && track_2_INTT_nHits > 0 && track_1_TPC_nHits > 19 && track_2_TPC_nHits > 19 && (track_1_chi2/track_1_nDoF) <= 300 && (track_2_chi2/track_2_nDoF) <= 300 && abs(track_1_IP_xy) >= 0.05 && abs(track_2_IP_xy) >= 0.05 && track_1_track_2_DCA <= 0.5 && track_1_track_2_DCA_xy <= 1.0 && K_S0_DIRA >= 0.99 && (K_S0_chi2/K_S0_nDoF) <= 20 && abs(K_S0_mass - 0.5) <= 0.1 && track_1_pT >= 0.2 && track_2_pT >= 0.2";
0449
0450 TH1F* h_pT_truth_KS0 = new TH1F("h_pT_truth_KS0",";K_{S}^{0} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0451 TH1F* h_pT_truthCuts_KS0 = new TH1F("h_pT_truthCuts_KS0",";K_{S}^{0} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0452
0453 TH1F* h_eta_truth_KS0 = new TH1F("h_eta_truth_KS0",";K_{S}^{0} #eta;Cut Efficiency",nBins_eta,etabins);
0454 TH1F* h_eta_truthCuts_KS0 = new TH1F("h_eta_truthCuts_KS0",";K_{S}^{0} #eta;Cut Efficiency",nBins_eta,etabins);
0455
0456 TH1F* h_phi_truth_KS0 = new TH1F("h_phi_truth_KS0",";K_{S}^{0} #phi;Cut Efficiency",nBins_phi,phibins);
0457 TH1F* h_phi_truthCuts_KS0 = new TH1F("h_phi_truthCuts_KS0",";K_{S}^{0} #phi;Cut Efficiency",nBins_phi,phibins);
0458
0459 TH1F* h_y_truth_KS0 = new TH1F("h_y_truth_KS0",";K_{S}^{0} y;Cut Efficiency",nBins_rap,rapbins);
0460 TH1F* h_y_truthCuts_KS0 = new TH1F("h_y_truthCuts_KS0",";K_{S}^{0} y;Cut Efficiency",nBins_rap,rapbins);
0461
0462 h_pT_truth_KS0->Sumw2();
0463 h_pT_truthCuts_KS0->Sumw2();
0464 h_eta_truth_KS0->Sumw2();
0465 h_eta_truthCuts_KS0->Sumw2();
0466 h_phi_truth_KS0->Sumw2();
0467 h_phi_truthCuts_KS0->Sumw2();
0468 h_y_truth_KS0->Sumw2();
0469 h_y_truthCuts_KS0->Sumw2();
0470
0471 sim_tree_KS0->Draw("K_S0_pT>>+h_pT_truth_KS0",truthCut_KS0.c_str());
0472 sim_tree_KS0->Draw("K_S0_pT>>+h_pT_truthCuts_KS0",truthDataCut_KS0.c_str());
0473 sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_truth_KS0",truthCut_KS0.c_str());
0474 sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_truthCuts_KS0",truthDataCut_KS0.c_str());
0475 sim_tree_KS0->Draw("K_S0_phi>>+h_phi_truth_KS0",truthCut_KS0.c_str());
0476 sim_tree_KS0->Draw("K_S0_phi>>+h_phi_truthCuts_KS0",truthDataCut_KS0.c_str());
0477 sim_tree_KS0->Draw("K_S0_rapidity>>+h_y_truth_KS0",truthCut_KS0.c_str());
0478 sim_tree_KS0->Draw("K_S0_rapidity>>+h_y_truthCuts_KS0",truthDataCut_KS0.c_str());
0479
0480 // -------------------------------------------------------------------------
0481 // Build TEfficiency objects for Xi and KS0
0482 // -------------------------------------------------------------------------
0483 TEfficiency* eff_pT_Xi = new TEfficiency(*h_pT_truthCuts, *h_pT_truth);
0484 TEfficiency* eff_eta_Xi = new TEfficiency(*h_eta_truthCuts, *h_eta_truth);
0485 TEfficiency* eff_phi_Xi = new TEfficiency(*h_phi_truthCuts, *h_phi_truth);
0486 TEfficiency* eff_y_Xi = new TEfficiency(*h_y_truthCuts, *h_y_truth);
0487
0488 TEfficiency* eff_pT_KS0 = new TEfficiency(*h_pT_truthCuts_KS0, *h_pT_truth_KS0);
0489 TEfficiency* eff_eta_KS0 = new TEfficiency(*h_eta_truthCuts_KS0, *h_eta_truth_KS0);
0490 TEfficiency* eff_phi_KS0 = new TEfficiency(*h_phi_truthCuts_KS0, *h_phi_truth_KS0);
0491 TEfficiency* eff_y_KS0 = new TEfficiency(*h_y_truthCuts_KS0, *h_y_truth_KS0);
0492
0493 TH1F* h_cutEff_pT_KS0 = (TH1F*)h_pT_truthCuts_KS0->Clone("h_cutEff_pT_KS0");
0494 h_cutEff_pT_KS0->Divide(h_pT_truthCuts_KS0, h_pT_truth_KS0, 1, 1, "B");
0495 TH1F* h_cutEff_phi_KS0 = (TH1F*)h_phi_truthCuts_KS0->Clone("h_cutEff_phi_KS0");
0496 h_cutEff_phi_KS0->Divide(h_phi_truthCuts_KS0, h_phi_truth_KS0, 1, 1, "B");
0497 TH1F* h_cutEff_eta_KS0 = (TH1F*)h_eta_truthCuts_KS0->Clone("h_cutEff_eta_KS0");
0498 h_cutEff_eta_KS0->Divide(h_eta_truthCuts_KS0, h_eta_truth_KS0, 1, 1, "B");
0499 TH1F* h_cutEff_rap_KS0 = (TH1F*)h_y_truthCuts_KS0->Clone("h_cutEff_rap_KS0");
0500 h_cutEff_rap_KS0->Divide(h_y_truthCuts_KS0, h_y_truth_KS0, 1, 1, "B");
0501
0502 TH1F* h_cutEff_pT_Xi = (TH1F*)h_pT_truthCuts->Clone("h_cutEff_pT_Xi");
0503 h_cutEff_pT_Xi->Divide(h_pT_truthCuts, h_pT_truth, 1, 1, "B");
0504 TH1F* h_cutEff_phi_Xi = (TH1F*)h_phi_truthCuts->Clone("h_cutEff_phi_Xi");
0505 h_cutEff_phi_Xi->Divide(h_phi_truthCuts, h_phi_truth, 1, 1, "B");
0506 TH1F* h_cutEff_eta_Xi = (TH1F*)h_eta_truthCuts->Clone("h_cutEff_eta_Xi");
0507 h_cutEff_eta_Xi->Divide(h_eta_truthCuts, h_eta_truth, 1, 1, "B");
0508 TH1F* h_cutEff_rap_Xi = (TH1F*)h_y_truthCuts->Clone("h_cutEff_rap_Xi");
0509 h_cutEff_rap_Xi->Divide(h_y_truthCuts, h_y_truth, 1, 1, "B");
0510
0511 TFile* outputFile = TFile::Open("cutEfficiencyCorrections.root", "RECREATE");
0512 h_cutEff_pT_KS0->Write();
0513 h_cutEff_phi_KS0->Write();
0514 h_cutEff_eta_KS0->Write();
0515 h_cutEff_rap_KS0->Write();
0516 h_cutEff_pT_Xi->Write();
0517 h_cutEff_phi_Xi->Write();
0518 h_cutEff_eta_Xi->Write();
0519 h_cutEff_rap_Xi->Write();
0520 outputFile->Close();
0521
0522 /*
0523 for (auto* e : {eff_pT_Xi, eff_eta_Xi, eff_phi_Xi, eff_y_Xi,
0524 eff_pT_KS0, eff_eta_KS0, eff_phi_KS0, eff_y_KS0})
0525 e->SetStatisticOption(TEfficiency::kFCP);
0526
0527 auto makeEffGraph = [](TEfficiency* eff) -> TGraphAsymmErrors*
0528 {
0529 int n = eff->GetTotalHistogram()->GetNbinsX();
0530 TGraphAsymmErrors* g = new TGraphAsymmErrors(n);
0531 for (int i = 1; i <= n; ++i)
0532 {
0533 double x = eff->GetTotalHistogram()->GetBinCenter(i);
0534 double exlo = eff->GetTotalHistogram()->GetBinCenter(i) - eff->GetTotalHistogram()->GetBinLowEdge(i);
0535 double exhi = eff->GetTotalHistogram()->GetBinLowEdge(i+1) - eff->GetTotalHistogram()->GetBinCenter(i);
0536 double y = eff->GetEfficiency(i);
0537 double eylo = eff->GetEfficiencyErrorLow(i);
0538 double eyhi = eff->GetEfficiencyErrorUp(i);
0539 g->SetPoint(i-1, x, y);
0540 g->SetPointError(i-1, exlo, exhi, eylo, eyhi);
0541 }
0542 return g;
0543 };
0544
0545 auto makeRatioGraph = [](TGraphAsymmErrors* gXi, TGraphAsymmErrors* gKS0,
0546 bool XiOverKS0) -> TGraphAsymmErrors*
0547 {
0548 int n = gXi->GetN();
0549 TGraphAsymmErrors* ratio = new TGraphAsymmErrors(n);
0550
0551 for (int i = 0; i < n; ++i)
0552 {
0553 double x, yXi, yKS0;
0554 gXi ->GetPoint(i, x, yXi);
0555 double dummy;
0556 gKS0->GetPoint(i, dummy, yKS0);
0557
0558 double exlo = gXi->GetErrorXlow(i);
0559 double exhi = gXi->GetErrorXhigh(i);
0560
0561 // Numerator and denominator depend on which ratio we want
0562 double num = XiOverKS0 ? yXi : yKS0;
0563 double den = XiOverKS0 ? yKS0 : yXi;
0564
0565 double numElo = XiOverKS0 ? gXi->GetErrorYlow(i) : gKS0->GetErrorYlow(i);
0566 double numEhi = XiOverKS0 ? gXi->GetErrorYhigh(i) : gKS0->GetErrorYhigh(i);
0567 double denElo = XiOverKS0 ? gKS0->GetErrorYlow(i) : gXi->GetErrorYlow(i);
0568 double denEhi = XiOverKS0 ? gKS0->GetErrorYhigh(i): gXi->GetErrorYhigh(i);
0569
0570 if (den <= 0.)
0571 {
0572 ratio->SetPoint(i, x, 0.);
0573 ratio->SetPointError(i, exlo, exhi, 0., 0.);
0574 continue;
0575 }
0576
0577 double r = num / den;
0578
0579 // Error propagation for ratio f = a/b:
0580 // delta_f = f * sqrt((delta_a/a)^2 + (delta_b/b)^2)
0581 // Use asymmetric errors: propagate lo and hi separately
0582 double eylo = (num > 0.) ? r * sqrt(pow(numElo/num, 2) + pow(denEhi/den, 2)) : 0.;
0583 double eyhi = (num > 0.) ? r * sqrt(pow(numEhi/num, 2) + pow(denElo/den, 2)) : 0.;
0584
0585 ratio->SetPoint(i, x, r);
0586 ratio->SetPointError(i, exlo, exhi, eylo, eyhi);
0587 }
0588 return ratio;
0589 };
0590
0591 TGraphAsymmErrors* g_pT_Xi = makeEffGraph(eff_pT_Xi);
0592 TGraphAsymmErrors* g_pT_KS0 = makeEffGraph(eff_pT_KS0);
0593 TGraphAsymmErrors* g_eta_Xi = makeEffGraph(eff_eta_Xi);
0594 TGraphAsymmErrors* g_eta_KS0 = makeEffGraph(eff_eta_KS0);
0595 TGraphAsymmErrors* g_phi_Xi = makeEffGraph(eff_phi_Xi);
0596 TGraphAsymmErrors* g_phi_KS0 = makeEffGraph(eff_phi_KS0);
0597 TGraphAsymmErrors* g_y_Xi = makeEffGraph(eff_y_Xi);
0598 TGraphAsymmErrors* g_y_KS0 = makeEffGraph(eff_y_KS0);
0599
0600 // Xi/KS0 ratios
0601 TGraphAsymmErrors* ratio_pT_XiOverKS0 = makeRatioGraph(g_pT_Xi, g_pT_KS0, true);
0602 TGraphAsymmErrors* ratio_eta_XiOverKS0 = makeRatioGraph(g_eta_Xi, g_eta_KS0, true);
0603 TGraphAsymmErrors* ratio_phi_XiOverKS0 = makeRatioGraph(g_phi_Xi, g_phi_KS0, true);
0604 TGraphAsymmErrors* ratio_y_XiOverKS0 = makeRatioGraph(g_y_Xi, g_y_KS0, true);
0605
0606 // KS0/Xi ratios
0607 TGraphAsymmErrors* ratio_pT_KS0OverXi = makeRatioGraph(g_pT_Xi, g_pT_KS0, false);
0608 TGraphAsymmErrors* ratio_eta_KS0OverXi = makeRatioGraph(g_eta_Xi, g_eta_KS0, false);
0609 TGraphAsymmErrors* ratio_phi_KS0OverXi = makeRatioGraph(g_phi_Xi, g_phi_KS0, false);
0610 TGraphAsymmErrors* ratio_y_KS0OverXi = makeRatioGraph(g_y_Xi, g_y_KS0, false);
0611
0612 TCanvas *c1 = new TCanvas("myCanvas", "myCanvas",800,800);
0613 ratio_pT_XiOverKS0->Draw("AP");
0614 ratio_pT_XiOverKS0->GetXaxis()->SetTitle("Mother p_{T} [GeV/c]");
0615 ratio_pT_XiOverKS0->GetYaxis()->SetTitle("#Xi^{-}/K_{S}^{0} Cut Efficiency");
0616 ratio_pT_XiOverKS0->GetYaxis()->SetRangeUser(0.0, 1.05);
0617 ratio_pT_XiOverKS0->GetXaxis()->SetLimits(pTbins[0], pTbins[nBins_pT]);
0618 c1->Update();
0619
0620 TPaveText *pt;
0621 pt = new TPaveText(0.15,0.75,0.65,1., "NDC");
0622 pt->SetFillColor(0);
0623 pt->SetFillStyle(0);
0624 pt->SetTextFont(42);
0625 string label = "#it{#bf{sPHENIX}} Simulation";
0626 TText *pt_LaTex = pt->AddText(label.c_str());
0627 pt->SetBorderSize(0);
0628 pt->Draw();
0629 gPad->Modified();
0630
0631 TPaveText *ptDate;
0632 ptDate = new TPaveText(0.67,0.79,0.85,0.95, "NDC");
0633 ptDate->SetFillColor(0);
0634 ptDate->SetFillStyle(0);
0635 ptDate->SetTextFont(42);
0636 std::string compilation_date = getDate();
0637 TText *pt_LaTexDate = ptDate->AddText(compilation_date.c_str());
0638 ptDate->SetBorderSize(0);
0639 ptDate->Draw();
0640 gPad->Modified();
0641
0642 string extensions[] = {".png",".root"};
0643 for (auto extension : extensions)
0644 {
0645 string output = "XiKS0ratio_pT_cutEff" + extension;
0646 c1->SaveAs(output.c_str());
0647 }
0648 c1->Close();
0649
0650 TCanvas *c2 = new TCanvas("myCanvas", "myCanvas",800,800);
0651 ratio_eta_XiOverKS0->Draw("AP");
0652 ratio_eta_XiOverKS0->GetXaxis()->SetTitle("Mother #eta");
0653 ratio_eta_XiOverKS0->GetYaxis()->SetTitle("#Xi^{-}/K_{S}^{0} Cut Efficiency");
0654 ratio_eta_XiOverKS0->GetYaxis()->SetRangeUser(0.0, 1.05);
0655 ratio_eta_XiOverKS0->GetXaxis()->SetLimits(etabins[0], etabins[nBins_eta]);
0656 c2->Update();
0657
0658 pt->Draw();
0659 gPad->Modified();
0660
0661 ptDate->Draw();
0662 gPad->Modified();
0663
0664 for (auto extension : extensions)
0665 {
0666 string output = "XiKS0ratio_eta_cutEff" + extension;
0667 c2->SaveAs(output.c_str());
0668 }
0669 c2->Close();
0670
0671 TCanvas *c3 = new TCanvas("myCanvas", "myCanvas",800,800);
0672 ratio_phi_XiOverKS0->Draw("AP");
0673 ratio_phi_XiOverKS0->GetXaxis()->SetTitle("Mother #phi [rad]");
0674 ratio_phi_XiOverKS0->GetYaxis()->SetTitle("#Xi^{-}/K_{S}^{0} Cut Efficiency");
0675 ratio_phi_XiOverKS0->GetYaxis()->SetRangeUser(0.0, 1.05);
0676 ratio_phi_XiOverKS0->GetXaxis()->SetLimits(phibins[0], phibins[nBins_phi]);
0677 c3->Update();
0678
0679 pt->Draw();
0680 gPad->Modified();
0681
0682 ptDate->Draw();
0683 gPad->Modified();
0684
0685 for (auto extension : extensions)
0686 {
0687 string output = "XiKS0ratio_phi_cutEff" + extension;
0688 c3->SaveAs(output.c_str());
0689 }
0690 c3->Close();
0691
0692 TCanvas *c4 = new TCanvas("myCanvas", "myCanvas",800,800);
0693 ratio_y_XiOverKS0->Draw("AP");
0694 ratio_y_XiOverKS0->GetXaxis()->SetTitle("Mother Rapidity");
0695 ratio_y_XiOverKS0->GetYaxis()->SetTitle("#Xi^{-}/K_{S}^{0} Cut Efficiency");
0696 ratio_y_XiOverKS0->GetYaxis()->SetRangeUser(0.0, 1.05);
0697 ratio_y_XiOverKS0->GetXaxis()->SetLimits(rapbins[0], rapbins[nBins_rap]);
0698 c4->Update();
0699
0700 pt->Draw();
0701 gPad->Modified();
0702
0703 ptDate->Draw();
0704 gPad->Modified();
0705
0706 for (auto extension : extensions)
0707 {
0708 string output = "XiKS0ratio_y_cutEff" + extension;
0709 c4->SaveAs(output.c_str());
0710 }
0711 c4->Close();
0712 */
0713
0714 /*
0715 c1->Divide(2,2);
0716 //pT
0717 c1->cd(1);
0718
0719 //ratio_pT_XiOverKS0->Draw("AP");
0720 //ratio_pT_XiOverKS0->GetXaxis()->SetTitle("Mother p_{T} [GeV/c]");
0721 //ratio_pT_XiOverKS0->GetYaxis()->SetTitle("#Xi^{-}/K_{S}^{0} Cut Efficiency");
0722 //ratio_pT_XiOverKS0->GetYaxis()->SetRangeUser(0.0, 1.05);
0723 //ratio_pT_XiOverKS0->GetXaxis()->SetLimits(pTbins[0], pTbins[nBins_pT]);
0724
0725 ratio_pT_KS0OverXi->Draw("AP");
0726 ratio_pT_KS0OverXi->GetXaxis()->SetTitle("Mother p_{T} [GeV/c]");
0727 ratio_pT_KS0OverXi->GetYaxis()->SetTitle("K_{S}^{0}/#Xi^{-} Cut Efficiency");
0728 ratio_pT_KS0OverXi->GetYaxis()->SetRangeUser(0.0, 5.00);
0729 ratio_pT_KS0OverXi->GetXaxis()->SetLimits(pTbins[0], pTbins[nBins_pT]);
0730 c1->Update();
0731
0732 TPaveText *pt;
0733 pt = new TPaveText(0.15,0.75,0.65,1., "NDC");
0734 pt->SetFillColor(0);
0735 pt->SetFillStyle(0);
0736 pt->SetTextFont(42);
0737 string label = "#it{#bf{sPHENIX}} Simulation";
0738 TText *pt_LaTex = pt->AddText(label.c_str());
0739 pt->SetBorderSize(0);
0740 pt->Draw();
0741 gPad->Modified();
0742
0743 TPaveText *ptDate;
0744 ptDate = new TPaveText(0.67,0.79,0.85,0.95, "NDC");
0745 ptDate->SetFillColor(0);
0746 ptDate->SetFillStyle(0);
0747 ptDate->SetTextFont(42);
0748 std::string compilation_date = getDate();
0749 TText *pt_LaTexDate = ptDate->AddText(compilation_date.c_str());
0750 ptDate->SetBorderSize(0);
0751 ptDate->Draw();
0752 gPad->Modified();
0753
0754 //eta
0755 c1->cd(2);
0756 ratio_eta_KS0OverXi->Draw("AP");
0757 ratio_eta_KS0OverXi->GetXaxis()->SetTitle("Mother #eta");
0758 ratio_eta_KS0OverXi->GetYaxis()->SetTitle("K_{S}^{0}/#Xi^{-} Cut Efficiency");
0759 ratio_eta_KS0OverXi->GetYaxis()->SetRangeUser(0.0, 5.0);
0760 ratio_eta_KS0OverXi->GetXaxis()->SetLimits(etabins[0], etabins[nBins_eta]);
0761 c1->Update();
0762
0763 pt->Draw();
0764 gPad->Modified();
0765
0766 ptDate->Draw();
0767 gPad->Modified();
0768
0769 //phi
0770 c1->cd(3);
0771 ratio_phi_KS0OverXi->Draw("AP");
0772 ratio_phi_KS0OverXi->GetXaxis()->SetTitle("Mother #phi [rad]");
0773 ratio_phi_KS0OverXi->GetYaxis()->SetTitle("K_{S}^{0}/#Xi^{-} Cut Efficiency");
0774 ratio_phi_KS0OverXi->GetYaxis()->SetRangeUser(0.0, 5.0);
0775 ratio_phi_KS0OverXi->GetXaxis()->SetLimits(phibins[0], phibins[nBins_phi]);
0776 c1->Update();
0777
0778 pt->Draw();
0779 gPad->Modified();
0780
0781 ptDate->Draw();
0782 gPad->Modified();
0783
0784 //rapidity
0785 c1->cd(4);
0786 ratio_y_KS0OverXi->Draw("AP");
0787 ratio_y_KS0OverXi->GetXaxis()->SetTitle("Mother Rapidity");
0788 ratio_y_KS0OverXi->GetYaxis()->SetTitle("K_{S}^{0}/#Xi^{-} Cut Efficiency");
0789 ratio_y_KS0OverXi->GetYaxis()->SetRangeUser(0.0, 5.0);
0790 ratio_y_KS0OverXi->GetXaxis()->SetLimits(-1.,1.);
0791 c1->Update();
0792
0793 pt->Draw();
0794 gPad->Modified();
0795
0796 ptDate->Draw();
0797 gPad->Modified();
0798
0799
0800 string extensions[] = {".png",".root"};
0801 for (auto extension : extensions)
0802 {
0803 //string output = "XiKS0ratio_all_cutEff" + extension;
0804 string output = "KS0Xiratio_all_cutEff" + extension;
0805 c1->SaveAs(output.c_str());
0806 }
0807 */
0808 }
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|