Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "../EvtVtxZProtoTracklet.h"
0002 
0003 R__LOAD_LIBRARY(../libEvtVtxZProtoTracklet.so)
0004 
0005 void Run_EvtVtxZTracklet(
0006   int process_id = 0,
0007   int run_num = 54280,
0008   int nevents = -1,
0009   string input_directory = "/sphenix/user/ChengWei/INTT/INTT/general_codes/CWShih/INTTBcoResolution/macro",
0010   string input_filename = "file_list_54280_intt.txt",
0011   string output_directory = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280/completed/BCO_check",
0012   
0013   // todo : modify here
0014   std::string output_file_name_suffix = "",
0015   
0016   bool IsFieldOn = false,
0017   bool IsDCACutApplied = 1,
0018   std::pair<std::pair<double,double>,std::pair<double,double>> DeltaPhiCutInDegree = {{-0.6, 0.6},{-1000.,1000.}}, // note : in degree
0019   std::pair<std::pair<double,double>,std::pair<double,double>> DCAcutIncm = {{-0.1, 0.1},{-1000.,1000.}}, // note : in cm
0020   int ClusAdcCut = 35,
0021   int ClusPhiSizeCut = 40,
0022   
0023   bool PrintRecoDetails = 1,
0024   bool DrawEvtVtxZ = 1,
0025 
0026   bool RunInttBcoFullDiff = true,
0027   bool RunVtxZReco = 1,
0028   bool RunTrackletPair = false,
0029   bool RunTrackletPairRotate = false,
0030   
0031   bool HaveGeoOffsetTag = false
0032 )
0033 {
0034 
0035   // todo :
0036   // std::pair<double, double> vertexXYIncm_MC = {-0.0218978, 0.223183}; // note : in cm // note : MC HIJING
0037   // std::pair<double, double> vertexXYIncm_MC = {-0.0216964, 0.223331}; // note : in cm // note : MC HIJING + strangeness
0038   std::pair<double, double> vertexXYIncm_MC = {-0.0218667, 0.223296}; // note : in cm // note : MC AMPT
0039   // std::pair<double, double> vertexXYIncm_MC = {-0.021907, 0.223293}; // note : in cm // note : MC EPOS
0040 
0041   std::pair<double, double> vertexXYIncm_data = {-0.0220728, 0.222956}; // note : in cm // note : data {Run54280_HR_Feb/Run5}
0042 
0043   std::pair<double, double> vertexXYIncm = (run_num == -1) ? vertexXYIncm_MC : vertexXYIncm_data;
0044 
0045   std::cout<<"RunNumber: "<<run_num<<std::endl;
0046   std::cout<<"ProcessID: "<<process_id<<std::endl;
0047   std::cout<<"InputVtxXY: "<<vertexXYIncm.first<<", "<<vertexXYIncm.second<<std::endl;
0048 
0049   EvtVtxZProtoTracklet * evzpt = new EvtVtxZProtoTracklet(
0050     process_id,
0051     run_num,
0052     nevents,
0053     input_directory,
0054     input_filename,
0055     output_directory,
0056     output_file_name_suffix,
0057 
0058     vertexXYIncm,
0059     IsFieldOn,
0060     IsDCACutApplied,
0061     DeltaPhiCutInDegree,
0062     DCAcutIncm,
0063     ClusAdcCut,
0064     ClusPhiSizeCut,
0065       
0066     PrintRecoDetails,
0067     DrawEvtVtxZ,
0068 
0069     RunInttBcoFullDiff,
0070     RunVtxZReco,
0071     RunTrackletPair,
0072     RunTrackletPairRotate,
0073       
0074     HaveGeoOffsetTag
0075   );
0076 
0077   string final_output_file_name = evzpt->GetOutputFileName();
0078   string plot_final_output_file_name = "Plot_"+final_output_file_name;
0079   cout<<"final_output_file_name: "<<final_output_file_name<<endl;
0080   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()));  
0081   system(Form("if [ -f %s/completed/%s ]; then rm %s/completed/%s; fi;", output_directory.c_str(), plot_final_output_file_name.c_str(), output_directory.c_str(), plot_final_output_file_name.c_str()));  
0082 
0083   evzpt -> MainProcess();
0084   evzpt -> EndRun();
0085 
0086   system(Form("mv %s/%s %s/completed", output_directory.c_str(), final_output_file_name.c_str(), output_directory.c_str()));
0087   system(Form("mv %s/%s %s/completed", output_directory.c_str(), plot_final_output_file_name.c_str(), output_directory.c_str()));
0088 
0089   return;
0090 }