Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ServerFuncs.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ServerFuncs.C
1 #include <onlmon/OnlMonServer.h>
2 #include <pmonitor/pmonitor.h>
3 
4 // cppcheck-suppress unknownMacro
5 R__LOAD_LIBRARY(libonlmonserver.so)
6 // cppcheck-suppress unknownMacro
7 R__LOAD_LIBRARY(libonlmonserver_funcs.so)
8 void CleanUpServer();
9 
10 void start_server(const std::string &prdffile = "")
11 {
12  OnlMonServer *se = OnlMonServer::instance(); // get pointer to Server Framework
13  if (prdffile.empty())
14  {
15  cout << "No Input file given" << endl;
16  return;
17  }
18  if (prdffile.find("seb") == 0 || prdffile.find("ebdc") == 0 || prdffile.find("intt") == 0 || prdffile.find("mvtx") == 0)
19  {
20  pidentify(0);
21  rcdaqopen(prdffile.c_str());
22  prun();
23  // if the rcdaq server is terminated we execute the EndRun and then
24  // save the histograms
25  se->EndRun(se->RunNumber()); //
26  se->WriteHistoFile();
27  // delete enablecorbabuf;
28  CleanUpServer();
29  }
30  else
31  {
32  pfileopen(prdffile.c_str());
33  }
34  return;
35 }
36 
38 {
39  pclose();
41  delete se;
42  gSystem->Exit(0);
43 }