Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:12:39

0001 #include "sPhenixStyle.C"
0002 
0003 int MakePlot_Data_DeltaPhiInnerClusPhi()
0004 {
0005     std::string input_file_directory = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280_HR_Feb102025/Run5/AvgVtxXY_nominal/completed"; 
0006     std::string input_file_name = "Data_AvgVtxXY_00054280_00426";
0007     std::string target_plot1_name = "h2_8_3_InnerPhi_DCA";
0008 
0009     std::string output_directory = input_file_directory;
0010 
0011     // std::pair<std::string, std::string> axes_label = {"Inner cluster #phi", "#Delta#phi"};
0012     
0013     std::string sPH_label = "Internal";
0014     std::vector<std::tuple<double,double,std::string>> additional_text = {
0015         // {0.2, 0.9, "The cluster pairs post the VtxZ linking requirement are filled"},
0016 
0017         // {0.22, 0.9, "Au+Au 200 GeV"},
0018         // {0.16, 0.96, "Generator: HIJING"}
0019     };
0020     
0021     SetsPhenixStyle();
0022 
0023     TCanvas * c1 = new TCanvas("c1", "c1", 950, 800);
0024 
0025     TLatex * ltx = new TLatex();
0026     ltx->SetNDC();
0027     ltx->SetTextSize(0.045);
0028     ltx->SetTextAlign(31);
0029 
0030     TLatex * draw_text = new TLatex();
0031     draw_text -> SetNDC();
0032     draw_text -> SetTextSize(0.03);
0033 
0034     TFile * file_in = TFile::Open(Form("%s/%s.root", input_file_directory.c_str(), input_file_name.c_str()));
0035     TH2D * h2D_plot1 = (TH2D*)file_in->Get(target_plot1_name.c_str());
0036 
0037     // h2D_plot1 -> GetXaxis() -> SetTitle(axes_label.first.c_str());
0038     // h2D_plot1 -> GetYaxis() -> SetTitle(axes_label.second.c_str());
0039     h2D_plot1 -> GetXaxis() -> SetNdivisions(505);
0040     
0041 
0042     c1 -> cd();
0043     h2D_plot1 -> Draw("colz0");
0044     ltx->DrawLatex(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, Form("#it{#bf{sPHENIX}} %s", sPH_label.c_str()));
0045     
0046     for (auto text : additional_text){
0047         double x = std::get<0>(text);
0048         double y = std::get<1>(text);
0049         std::string text_str = std::get<2>(text);
0050 
0051         draw_text -> DrawLatex(x, y, text_str.c_str());
0052     }
0053 
0054     c1 -> Print(Form("%s/%s_%s.pdf", output_directory.c_str(),input_file_name.c_str(),target_plot1_name.c_str()));
0055     c1 -> Clear();
0056 
0057     return 0;
0058 
0059 
0060 }