Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "ServerFuncs.C"
0002 
0003 #include <onlmon/tpot/TpotMon.h>
0004 #include <onlmon/OnlMonServer.h>
0005 
0006 #include <fstream>
0007 
0008 R__LOAD_LIBRARY(libonltpotmon_server.so)
0009 
0010 void run_tpot_server(
0011   const std::string &name = "TPOTMON",
0012   unsigned int serverid = 0,
0013   const std::string &evtfile = "/sphenix/lustre01/sphnxpro/physics/TPOT/physics/TPOT_ebdc39_physics-00051926-0000.evt"
0014   )
0015 {
0016   // create subsystem Monitor object
0017   auto m = new TpotMon(name);
0018   m->SetMonitorServerId(serverid);
0019   m->set_max_sample(1024);
0020   m->set_sample_window_signal( {3, 18} );
0021 
0022   // prefer local calibration filename if exists
0023   const std::string local_calibration_filename( "TPOT_Pedestal-000.root" );
0024   if( std::ifstream( local_calibration_filename ).good() )
0025   { m->set_calibration_file( local_calibration_filename ); }
0026 
0027   // get pointer to Server Framework
0028   auto se = OnlMonServer::instance();
0029 
0030   // register subsystem Monitor with Framework
0031   se->registerMonitor(m);
0032 
0033   // and start
0034   start_server(evtfile);
0035   return;
0036 }