Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:54

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