Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "../GetMultiplicityMap.h"
0002 
0003 R__LOAD_LIBRARY(../libGetMultiplicityMap.so)
0004 
0005 int Run_GetMultiplicityMap()
0006 {
0007     string sub_folder_name = "noPhiCut";
0008     std::pair<bool, std::pair<double, double>> isClusQA = {true, {35,350}}; // note : {adc, phi size}
0009 
0010     // string sub_folder_name = "noAdcCut";
0011     // std::pair<bool, std::pair<double, double>> isClusQA = {true, {0,40}}; // note : {adc, phi size}
0012 
0013     // string sub_folder_name = "50AdcCut";
0014     // std::pair<bool, std::pair<double, double>> isClusQA = {true, {50,40}}; // note : {adc, phi size}
0015 
0016     // string sub_folder_name = "baseline";
0017     // std::pair<bool, std::pair<double, double>> isClusQA = {true, {35,40}}; // note : {adc, phi size}
0018 
0019     int runnumber = 54280;
0020     std::string data_directory = Form("/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280_HR_Feb102025/Run6_EvtZFitWidthChange/EvtVtxZ/ColumnCheck/%s/completed", sub_folder_name.c_str());
0021     std::string data_file_name = Form("Data_ColumnCheck_BcoFullDiffCut_Mbin70_VtxZ-30to30cm_ClusQAAdc%.0fPhiSize%.0f_00054280_merged.root", isClusQA.second.first, isClusQA.second.second);
0022 
0023     // std::string MC_directory = Form("/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_HIJING_MDC2_ana472_20250307/Run7/EvtVtxZ/ColumnCheck/%s/completed", sub_folder_name.c_str());
0024     // std::string MC_file_name = Form("MC_ColumnCheck_Mbin70_VtxZ-30to30cm_ClusQAAdc%.0fPhiSize%.0f_merged.root", isClusQA.second.first, isClusQA.second.second);
0025     // std::string output_directory = MC_directory + "/MulMap"; // note : AUTO
0026 
0027     std::string MC_directory = Form("/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_HIJING_strangeness_MDC2_ana472_20250310/Run7/EvtVtxZ/ColumnCheck/%s/completed", sub_folder_name.c_str());
0028     std::string MC_file_name = Form("MC_ColumnCheck_Mbin70_VtxZ-30to30cm_ClusQAAdc%.0fPhiSize%.0f_merged.root", isClusQA.second.first, isClusQA.second.second);
0029     std::string output_directory = MC_directory + "/MulMap"; // note : AUTO
0030 
0031     std::string output_file_name_suffix = "";
0032 
0033     system(Form("if [ ! -d %s ]; then mkdir -p %s/completed; fi;", output_directory.c_str(), output_directory.c_str()));
0034 
0035     double SetMbinFloat = 70; // note : 0-100
0036     std::pair<double, double> VtxZRange = {-30, 30}; // note : cm
0037     bool IsZClustering = false;
0038     bool BcoFullDiffCut = true;
0039     
0040 
0041 
0042     GetMultiplicityMap * GMM = new GetMultiplicityMap(
0043         runnumber,
0044         data_directory,
0045         data_file_name,
0046         MC_directory,
0047         MC_file_name,
0048         output_directory,
0049 
0050         output_file_name_suffix,
0051 
0052         SetMbinFloat,
0053         VtxZRange,
0054         IsZClustering,
0055         BcoFullDiffCut,
0056         isClusQA
0057     );
0058 
0059     string final_output_file_name = GMM->GetOutputFileName();
0060     cout<<"final_output_file_name: "<<final_output_file_name<<endl;
0061     system(Form("if [ -f %s/completed/%s ]; then rm %s/completed/%s; fi;", output_directory.c_str(), final_output_file_name.c_str(), output_directory.c_str(), final_output_file_name.c_str()));  
0062 
0063     GMM -> GetUsedZIDVec();
0064     GMM -> h2DNormalizedByRadius();
0065     GMM -> h2DNormalized();
0066     GMM -> DataMCDivision();
0067     GMM -> PrepareMulMap();
0068     GMM -> EndRun();
0069 
0070     system(Form("mv %s/%s %s/completed", output_directory.c_str(), final_output_file_name.c_str(), output_directory.c_str()));
0071 
0072     return 0;
0073 }