Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OnlMon.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file OnlMon.cc
1 #include "OnlMon.h"
2 #include "OnlMonServer.h"
3 
4 #include <Event/msg_profile.h>
5 
6 #include <TH1.h>
7 
8 #include <cstdio> // for printf
9 #include <iostream>
10 #include <sstream>
11 
12 class Event;
13 
15  : OnlMonBase(name)
16 {
17  if (name.find('_') != std::string::npos)
18  {
19  std::cout << "No underscore (_) in online monitoring server name " << name << " allowed" << std::endl;
20  exit(1);
21  }
23  return;
24 }
25 
27 {
28  int iret = process_event(evt);
29  return iret;
30 }
31 
33 {
34  std::cout << "process_event(Event *evt) not implemented by daughter class" << std::endl;
35  return -1;
36 }
37 
39 {
40  // cout << "Reset() not implemented by daughter class" << endl;
41  return -1;
42 }
43 
44 void OnlMon::identify(std::ostream &out) const
45 {
46  out << "identify() not implemented by daughter class" << std::endl;
47  return;
48 }
49 
51 {
52 // m_LocalFrameWorkVars = static_cast<TH1 *>(se->getCommonHisto("FrameWorkVars")->Clone());
53  se->registerHisto(this,se->getCommonHisto("FrameWorkVars"));
54  return 0;
55 }
56 
57 int OnlMon::BeginRunCommon(const int /* runno */, OnlMonServer * /*se*/)
58 {
60  return 0;
61 }
62 
63 void OnlMon::SetStatus(const int newstatus)
64 {
65  if (newstatus != status)
66  {
68  status = newstatus;
69  se->SetSubsystemRunStatus(this, status);
70  }
71  return;
72 }
73 
74 void OnlMon::SetMonitorServerId(unsigned int i)
75 {
76  if (Name().find('_') != std::string::npos)
77  {
78  std::cout << "Monitor Server Id was already set " << Name() << std::endl;
79  return;
80  }
82  Name(Name() + '_' + std::to_string(i));
83  return;
84 }
85