Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
14
OnlMon::OnlMon
(
const
std::string
&
name
)
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
}
22
status
=
OnlMon::ACTIVE
;
23
return
;
24
}
25
26
int
OnlMon::process_event_common
(
Event
*evt)
27
{
28
int
iret =
process_event
(evt);
29
return
iret;
30
}
31
32
int
OnlMon::process_event
(
Event
*
/*evt*/
)
33
{
34
std::cout <<
"process_event(Event *evt) not implemented by daughter class"
<< std::endl;
35
return
-1;
36
}
37
38
int
OnlMon::Reset
()
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
50
int
OnlMon::InitCommon
(
OnlMonServer
* se)
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
{
59
SetStatus
(
OnlMon::OK
);
60
return
0;
61
}
62
63
void
OnlMon::SetStatus
(
const
int
newstatus)
64
{
65
if
(newstatus !=
status
)
66
{
67
OnlMonServer
*se =
OnlMonServer::instance
();
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
}
81
m_MonitorServerId
=
i
;
82
Name
(
Name
() +
'_'
+
std::to_string
(i));
83
return
;
84
}
85
OnlMon
blob
main
onlmonserver
OnlMon.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:28
using
1.8.2 with
sPHENIX GitHub integration