Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-09 08:12:18

0001 #include "../../Constants.cpp"
0002 
0003 #include "../FinalResult.h"
0004 R__LOAD_LIBRARY(../libFinalResult.so)
0005 
0006 int Run_Final_new(int Mbin = 70)
0007 {
0008     // int Mbin = 70; 
0009     double Hist_Y_max = Constants::centrality_Hist_Ymax[Mbin] * 1.15;
0010     std::pair<double,double> vtxZ_range = {-10,10}; // note : cm
0011 
0012     int runnumber = 54280;
0013     std::string sPH_label = "Internal";
0014     std::string Collision_str = "Au+Au #sqrt{s_{NN}} = 200 GeV";
0015 
0016     std::string mother_folder = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_HIJING_MDC2_ana472_20250307/Run7/EvtVtxZ/FinalResult_10cm_Pol2BkgFit_DeltaPhi0p026/completed";
0017     // std::string mother_folder = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280_HR_Feb102025/Run6_EvtZFitWidthChange/EvtVtxZ/FinalResult_Nominal0Adc/completed";
0018 
0019     std::string HS_folder = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_HIJING_strangeness_MDC2_ana472_20250310/Run7/EvtVtxZ/FinalResult_10cm_Pol2BkgFit_DeltaPhi0p026/completed";
0020     std::string EPOS_folder = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_EPOS_MDC2_ana472_20250310/Run7/EvtVtxZ/FinalResult_10cm_Pol2BkgFit_DeltaPhi0p026/completed";
0021     std::string AMPT_folder = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_AMPT_MDC2_ana472_20250310/Run7/EvtVtxZ/FinalResult_10cm_Pol2BkgFit_DeltaPhi0p026/completed";
0022 
0023     std::string range_folder = Form("vtxZ_%.0f_%.0fcm_MBin%d",vtxZ_range.first, vtxZ_range.second, Mbin);
0024 
0025     std::string Centrality_str = Constants::centrality_text[Mbin];
0026 
0027     std::vector<std::tuple<double,double,std::string>> additional_text = {
0028         {0.22, 0.9, Collision_str},
0029         {0.22, 0.86, "HIJING"},
0030         {0.22, 0.82, Form("Centrality [%s]%%", Centrality_str.c_str())},
0031         {0.22, 0.78, Form("|INTT vtxZ|#kern[1]{#leq} %.0f cm", vtxZ_range.second)}
0032     };
0033 
0034     string PHOBOS_directory = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/DataPoint_PHOBOS-PhysRevC.83.024913";
0035     string PHOBOS_filename = Form("AuAu_200GeV_Centrality_%s.txt",Constants::centrality_text[Mbin].c_str());
0036 
0037     std::string StandardData_directory = mother_folder + "/" + range_folder + "/Folder_BaseLine/Run_0/completed";
0038     std::string StandardData_file_name = Form("Data_PreparedNdEtaEach_AlphaCorr_AllSensor_VtxZ%.0f_Mbin%d_00054280_00000_dNdEta.root", vtxZ_range.second, Mbin);
0039     std::string StandardMC_directory = StandardData_directory;
0040     std::string StandardMC_file_name = Form("MC_PreparedNdEtaEach_AlphaCorr_AllSensor_VtxZ%.0f_Mbin%d_00002_dNdEta.root", vtxZ_range.second, Mbin);
0041 
0042     FinalResult * final = new FinalResult(
0043         runnumber,
0044         Mbin,
0045         StandardData_directory,
0046         StandardData_file_name,
0047         StandardMC_directory,
0048         StandardMC_file_name,
0049         sPH_label,
0050         mother_folder + "/" + range_folder
0051     );
0052     final -> SetSystUncPlot_Ymax(0.2);
0053     final -> SetEtaRange({-1.1, 1.1});
0054     final -> SetCollisionStr({{0.2, 0.96}, Collision_str});
0055     final -> SetAnaDescription({{0.21, 0.9}, Form("Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)});
0056     final -> SetPHOBOSData(PHOBOS_directory, PHOBOS_filename);
0057 
0058     final -> SetFinal_Data_MC_text(
0059         {
0060             "Data (PHOBOS approach)",
0061             "HIJING (generator)"
0062         }
0063     );
0064 
0065     final -> PrepareBaseLineTGraph();
0066     final -> PrepareMCClosureTGraph();
0067 
0068 
0069     std::string output_folder_name = final -> GetOutputFileName();
0070     std::cout << "output_folder_name = " << output_folder_name << std::endl;
0071 
0072     final -> PrepareStatisticalError();
0073 
0074 
0075 
0076 
0077     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0078     std::string RunSegMother_directory = mother_folder + "/" + range_folder + "/Folder_RunSegment"; 
0079     final -> PrepareRunSegmentError(
0080         {
0081             RunSegMother_directory + Form("/Run_0/completed/%s",StandardData_file_name.c_str())
0082             // RunSegMother_directory + Form("/Run_1/completed/%s",StandardData_file_name.c_str())
0083         },
0084         {
0085             "Segment1 (Second 4.39M)",
0086             // "Segment2 (Second 4M)",
0087             "Baseline (First 4.39M)"
0088         },
0089         Form("Run segment variation, Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)
0090     ); // note : run1, run2
0091 
0092     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0093     std::string ClusAdcMother_directory = mother_folder + "/" + range_folder + "/Folder_ClusAdcCut";
0094     final -> PrepareClusAdcError(
0095         {
0096             ClusAdcMother_directory + Form("/Run_0/completed/%s",StandardData_file_name.c_str()),
0097             ClusAdcMother_directory + Form("/Run_1/completed/%s",StandardData_file_name.c_str())
0098         },
0099         {
0100             "w.o Cluster ADC cut",
0101             "Cluster ADC > 50",
0102             "Baseline (Cluster ADC > 35)"
0103 
0104             // "data > 35 only",
0105             // "data > 35, MC > 35",
0106             // "Baseline (w.o Cluster ADC cut)"
0107         },
0108         Form("Cluster ADC variation, Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)
0109     ); 
0110     
0111     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0112     final -> PrepareGeoOffsetError(
0113         "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_HIJING_MDC2_ana472_20250307/GeoOffset/completed/merged_result/FromdNdEta_New.root",
0114         StandardData_directory + "/" + Form("MC_PreparedNdEtaEach_AllSensor_VtxZ%.0f_Mbin%d_00001_dNdEta.root", vtxZ_range.second, Mbin) // note : for the alpha correction
0115     );
0116 
0117     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0118     std::string DeltaPhiMother_directory = mother_folder + "/" + range_folder + "/Folder_DeltaPhiCut";
0119     final -> PrepareDeltaPhiError(
0120         {
0121             DeltaPhiMother_directory + Form("/Run_0/completed/%s",StandardData_file_name.c_str()),
0122             DeltaPhiMother_directory + Form("/Run_1/completed/%s",StandardData_file_name.c_str())
0123             // DeltaPhiMother_directory + Form("/Run_2/completed/%s",StandardData_file_name.c_str())
0124             // DeltaPhiMother_directory + Form("/Run_6/completed/%s",StandardData_file_name.c_str())
0125         },
0126         {
0127             "|#Delta#phi|#kern[1.0]{#leq} 0.021",
0128             "|#Delta#phi|#kern[1.0]{#leq} 0.031",
0129             // "|#Delta#phi|#kern[1.0]{#leq} 0.030",
0130             // "|#Delta#phi|#kern[1.0]{#leq} 0.050",
0131             "Baseline (|#Delta#phi|#kern[1.0]{#leq} 0.026)"
0132         },
0133         Form("#Delta#phi variation, Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)
0134 
0135     ); // note : 0.018 and 0.024
0136 
0137     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0138     std::string ClusPhiSizeMother_directory = mother_folder + "/" + range_folder + "/Folder_ClusPhiCut";
0139     final -> PrepareClusPhiSizeError(
0140         {
0141             ClusPhiSizeMother_directory + Form("/Run_0/completed/%s",StandardData_file_name.c_str())
0142         },
0143         {
0144             "w.o Cluster#kern[0.4]{#phi} size cut",
0145             "Baseline (Cluster#kern[0.4]{#phi} size#kern[0.4]{#leq} 40)" // todo; should be < or <=
0146         },
0147         Form("Cluster#kern[0.4]{#phi} size variation, Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)
0148     );
0149 
0150     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0151     std::string HS_baseline_folder = HS_folder + "/" + range_folder + "/Folder_BaseLine";
0152     final -> PrepareStrangenessError(
0153         {
0154             HS_baseline_folder + Form("/Run_0/completed/%s",StandardData_file_name.c_str())
0155         },
0156         {
0157             "HIJING with 40% strangeness enchacement",
0158             "Baseline (Nominal HIJING)" // todo; should be < or <=
0159         },
0160         Form("Strangeness variation, Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)
0161     );
0162 
0163     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0164     std::string EPOS_baseline_folder = EPOS_folder + "/" + range_folder + "/Folder_BaseLine";
0165     std::string AMPT_baseline_folder = AMPT_folder + "/" + range_folder + "/Folder_BaseLine";
0166     final -> PrepareGeneratorError(
0167         {
0168             EPOS_baseline_folder + Form("/Run_0/completed/%s",StandardData_file_name.c_str()),
0169             AMPT_baseline_folder + Form("/Run_0/completed/%s",StandardData_file_name.c_str())
0170         },
0171         {
0172             "EPOS",
0173             "AMPT",
0174             "Baseline (Nominal HIJING)" // todo; should be < or <=
0175         },
0176         Form("Simulation generator variation, Centrality [%s]%%, VtxZ [%.0f, %.0f] cm", Centrality_str.c_str(), vtxZ_range.first, vtxZ_range.second)
0177     );
0178 
0179     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0180     // std::string MCMergedMother_directory = CW_folder + data_folder_mother + "/EvtVtxZ/TrackHist/completed";
0181     // final -> PrepareMCMergedError(
0182     //     {
0183     //         MCMergedMother_directory + "/dNdEta_MCMergeError1/dNdEta_AllSensor_GeoAccCorr_VtxZ10_Mbin70/completed/Data_PreparedNdEtaEach_AlphaCorr_GeoAccCorr_AllSensor_VtxZ10_Mbin70_00054280_00000_dNdEta.root",
0184     //         MCMergedMother_directory + "/dNdEta_MCMergeError2/dNdEta_AllSensor_GeoAccCorr_VtxZ10_Mbin70/completed/Data_PreparedNdEtaEach_AlphaCorr_GeoAccCorr_AllSensor_VtxZ10_Mbin70_00054280_00000_dNdEta.root",
0185     //         MCMergedMother_directory + "/dNdEta_MCMergeError3/dNdEta_AllSensor_GeoAccCorr_VtxZ10_Mbin70/completed/Data_PreparedNdEtaEach_AlphaCorr_GeoAccCorr_AllSensor_VtxZ10_Mbin70_00054280_00000_dNdEta.root",
0186     //         MCMergedMother_directory + "/dNdEta_MCMergeError4/dNdEta_AllSensor_GeoAccCorr_VtxZ10_Mbin70/completed/Data_PreparedNdEtaEach_AlphaCorr_GeoAccCorr_AllSensor_VtxZ10_Mbin70_00054280_00000_dNdEta.root"
0187     //     }
0188     // );
0189 
0190     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0191     final -> DrawAlphaCorrectionPlots(
0192         StandardData_directory + "/" + Form("MC_PreparedNdEtaEach_AllSensor_VtxZ%.0f_Mbin%d_00001_dNdEta.root", vtxZ_range.second, Mbin), // note : for the alpha correction
0193         
0194         additional_text,
0195 
0196         {
0197             {2, "HIJING generator level", "l"},
0198             {4, "Reco. Tracklets", "l"}
0199         }
0200     );
0201 
0202     final -> DrawGoodPair2DFineBinPlot();
0203 
0204     final -> DrawRecoTrackletDataMCPlot(
0205         additional_text,
0206 
0207         {
0208             {1, "Data", "pl"},
0209             {2, "HIJING", "l"}
0210         }
0211     );
0212 
0213     // Division : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0214     final -> PrepareFinalError();
0215     final -> PrepareFinalResult(Hist_Y_max);
0216     final -> EndRun();
0217 
0218     return 888;
0219 }