Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "../PreparedNdEtaEach.h"
0002 
0003 R__LOAD_LIBRARY(../libPreparedNdEtaEach.so)
0004 
0005 void Run_PreparedNdEtaEach(
0006   int process_id = 1,
0007   int run_num = -1,
0008   string input_directory = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_Ntuple_HIJING_ana443_20241102/Run3/TrackHist_ForGeoOffset/completed",
0009   string input_filename = "MC_TrackHist_VtxZQA_ClusQAAdc35PhiSize500_ForGeoOffset_merged.root",
0010   string output_directory = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_Ntuple_HIJING_ana443_20241102/Run3/TrackHist_ForGeoOffset/completed/dNdEta",
0011   
0012   // todo : modify here
0013   std::string output_file_name_suffix = "_ForGeoOffset",
0014 
0015   bool ApplyAlphaCorr = false,
0016   bool isTypeA = false,
0017   std::pair<double,double> cut_INTTvtxZ = {-10, 10},
0018   int SelectedMbin = 70
0019 )
0020 {
0021 
0022   PreparedNdEtaEach * PNEE = new PreparedNdEtaEach(
0023     process_id,
0024     run_num,
0025     input_directory,
0026     input_filename,
0027     output_directory,
0028 
0029     output_file_name_suffix,
0030 
0031     ApplyAlphaCorr,
0032     isTypeA,
0033     cut_INTTvtxZ,
0034     SelectedMbin
0035   );
0036   
0037 
0038   std::vector<std::string> final_output_file_name = PNEE->GetOutputFileName();
0039   for (auto filename : final_output_file_name){
0040     cout<<"final_output_file_name: "<<filename<<endl;
0041     system(Form("if [ -f %s/completed/%s ]; then rm %s/completed/%s; fi;", output_directory.c_str(), filename.c_str(), output_directory.c_str(), filename.c_str()));  
0042   }
0043   
0044 
0045   PNEE -> PrepareStacks();
0046   std::cout<<111<<endl;
0047   PNEE -> DoFittings();
0048   std::cout<<222<<endl;
0049   PNEE -> PrepareMultiplicity();
0050   std::cout<<333<<endl;
0051   PNEE -> PreparedNdEtaHist();
0052   std::cout<<444<<endl;
0053   PNEE -> DeriveAlphaCorrection();
0054   std::cout<<555<<endl;
0055   PNEE -> EndRun();
0056 
0057 
0058   for (auto filename : final_output_file_name){
0059     system(Form("mv %s/%s %s/completed", output_directory.c_str(), filename.c_str(), output_directory.c_str()));
0060   }
0061 
0062   return;
0063 }