Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "../AvgVtxXY.h"
0002 
0003 R__LOAD_LIBRARY(../libavgvtxxy.so)
0004 
0005 void Run_AvgVtxXY(
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   std::pair<double,double> MBD_vtxZ_cut = {-20, 20}, // note : unit : cm
0017   std::pair<int,int> INTTNClus_cut = {20, 350},
0018   double ClusAdc_cut = 35,
0019   double ClusPhiSize_cut = 40,
0020 
0021   bool HaveGeoOffsetTag = false,
0022   double random_range_XYZ = 0.02, // note : unit : cm
0023   int random_seed = -999,
0024   std::string input_offset_map = "no_map" // note : full map
0025 )
0026 {
0027 
0028   AvgVtxXY * avgvtxxy = new AvgVtxXY(
0029     process_id,
0030     run_num,
0031     nevents,
0032     input_directory,
0033     input_filename,
0034     output_directory,
0035     output_file_name_suffix,
0036 
0037     MBD_vtxZ_cut,
0038     INTTNClus_cut,
0039     ClusAdc_cut,
0040     ClusPhiSize_cut,
0041 
0042     HaveGeoOffsetTag,
0043     random_range_XYZ,
0044     random_seed,
0045     input_offset_map
0046   );
0047 
0048   string final_output_file_name = avgvtxxy->GetOutputFileName();
0049   cout<<"final_output_file_name: "<<final_output_file_name<<endl;
0050   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()));  
0051 
0052   avgvtxxy -> PreparePairs();
0053   
0054   // avgvtxxy -> FindVertexQuadrant( 1, 0.4, {0, 0} ); // note : unit : cm
0055   // avgvtxxy -> FindVertexLineFill({-0.022,0.2229}, 100, 0.25, 0.0001); // note : unit : cm
0056   // avgvtxxy -> EndRun();
0057 
0058   avgvtxxy -> FindVertexQuadrant( 9, 0.4, {0, 0} ); // note : unit : cm
0059   avgvtxxy -> FindVertexLineFill(avgvtxxy -> GetVertexQuadrant(), 100, 0.25, 0.0001); // note : unit : cm
0060   avgvtxxy -> EndRun();
0061 
0062 
0063   system(Form("mv %s/%s %s/completed", output_directory.c_str(), final_output_file_name.c_str(), output_directory.c_str()));
0064 
0065   return;
0066 }