Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-03 08:16:04

0001 #include "CalAnalyzer.C"
0002 
0003 #include <format>
0004 
0005 void run_calanalyzer(const std::string& runflist = "run24pp.list")
0006 {
0007   // Load data
0008   std::ifstream runlistfile( runflist.c_str() );
0009   if (!runlistfile.is_open())
0010   {
0011     std::cerr << "Error: Could not open runlist file " << runflist << std::endl;
0012     return;
0013   }
0014 
0015   TString name = runflist.c_str();
0016   name.ReplaceAll(".list","");
0017 
0018   CalAnalyzer *cal = new CalAnalyzer( name );
0019 
0020   int run{0};
0021   TString savefname;
0022   while ( runlistfile >> run )
0023   {
0024     if (runlistfile.fail())
0025     {
0026       std::cerr << "Warning: Failed to read run number from " << runflist << std::endl;
0027       break;
0028     }
0029 
0030     savefname = "results/"; savefname += run; savefname += "/savefitspass2.3_mip-"; savefname += run; savefname += ".txt";
0031     cal->LoadRun( run, savefname.Data() );
0032   }
0033 
0034   cal->CalculateCleanStats();
0035 
0036   // Inspect results
0037   /*
0038      int ch = 127;
0039      for (int ipar=0; ipar<9; ipar++)
0040      {
0041      cal->DrawSummary(ch, ipar); // Show Hist for Param 0 and Graph for Ch 64/Param 0
0042      }
0043      */
0044 
0045   cal->SaveCleanMeans();
0046   cal->SaveParameterPDFs();
0047 }