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
Poms.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Poms.h
1
/****************************************************************************\
2
* Poms.h, header for:
3
*
4
* PomsClient.C -- A program to graphically launch and control all online
5
* monitoring for PHENIX subsystems.
6
* This program requires the ROOT runtime environment and each subsystems
7
* individual online monitoring client macros.
8
*
9
* Program developed at Brookhaven National Laboratory for the PHENIX
10
* collaboration to be used by offline shifters.
11
*
12
*
13
*
14
* Copyright 2003 Phenix Collaboration
15
*
16
*
17
* M. McCain (mcm99c@acu.edu) January 2003
18
*
19
* Credit to Ryan Roth (LANL) for coding style and example of ROOT GUI
20
* in his implementation of HVDP (High Voltage Display Program)
21
****************************************************************************
22
*/
23
24
/* ROOT headers */
25
#pragma GCC diagnostic push
26
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
27
#include <TGFrame.h>
28
#include <TGShutter.h>
29
#pragma GCC diagnostic pop
30
31
/* Standard C++ headers */
32
33
#include <list>
34
#include <map>
35
#include <string>
36
37
/* forward declarations to speed up compilation */
38
class
TList;
39
class
TGMenuBar;
40
class
TGButton;
41
class
TGPopupMenu;
42
class
TGHotString;
43
class
TGWindow;
44
45
#define POMS_VER "POMS Ver 1.0: "
46
47
enum
EMessageID
48
{
49
M_FILE_TEST
,
50
M_FILE_EXIT
,
51
M_WINDOW_ALIGNRIGHT
,
52
M_WINDOW_TILEALL
,
53
B_QUIT
54
};
55
56
// Declare all classes to preven compiler errors
57
class
SubSystem
;
58
class
SubSystemAction
;
59
60
// Declare list types
61
typedef
std::list<SubSystem*>
SubSystemList
;
62
typedef
std::list<SubSystemAction*>
SubSystemActionList
;
63
typedef
std::less<int>
lessp
;
64
typedef
std::map<int, SubSystemAction*, lessp>
SubSystemActionMap
;
65
67
// Class that defines the main Window //
68
// //
69
// (actual main window obtained from gClient->GetRoot() since we //
70
// are running in CINT environment) //
71
// //
72
// Implements Singleton Pattern //
74
75
class
PomsMainFrame
:
public
TGMainFrame
76
{
77
private
:
78
static
PomsMainFrame
*
_instance
;
79
80
//Paths
81
std::string
_macroPath
;
82
83
int
looping
;
84
//Root Screen Properties
85
/*** See constructor to change default values ***/
86
UInt_t
_rootWidth
;
87
UInt_t
_rootHeight
;
88
UInt_t
_rootHorizPad
;
89
UInt_t
_rootVertPad
;
90
UInt_t
_windowPad
;
91
92
//GUI OBJECTS -- Main Window
93
TGButton*
_closeButton
;
94
TGMenuBar*
_menuBar
;
95
TGPopupMenu*
_menuFile
;
96
TGPopupMenu*
_menuWindow
;
97
TGShutter*
_shutter
;
98
99
TGButton*
startloop
;
100
TGButton*
stoploop
;
101
//Collections
102
SubSystemList
_subSystemList
;
103
104
//MEMBER FUNCTIONS
105
TGShutter*
BuildShutter
();
106
int
HandleButtonPoms
(Long_t parm1);
107
void
LoopDiLoop
();
108
109
// Singleton, private constructure
110
PomsMainFrame
(
const
TGWindow*
p
, UInt_t w, UInt_t
h
);
111
112
public
:
113
static
PomsMainFrame
*
Instance
();
114
virtual
~PomsMainFrame
();
115
void
StopLoop
();
116
117
void
SetMacroPath
(
const
char
*
path
);
118
virtual
void
CloseWindow
();
119
virtual
Bool_t
ProcessMessage
(Long_t
msg
, Long_t parm1, Long_t
/* parm2 */
);
120
#pragma GCC diagnostic push
121
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
122
void
Draw
();
123
#pragma GCC diagnostic pop
124
void
AlignRight
();
125
void
TileCanvases
(TList* canvasList);
126
void
CascadeCanvases
(TList* canvasList);
127
void
TileAllCanvases
();
128
129
//Accessors
130
UInt_t
GetRootWidth
() {
return
_rootWidth
; };
131
UInt_t
GetRootHeight
() {
return
_rootHeight
; };
132
const
std::string
&
GetMacroPath
() {
return
_macroPath
; };
133
134
//CONFIGURATION FUNCTIONS
135
SubSystem
*
RegisterSubSystem
(
const
char
*
name
,
const
char
*
prefix
,
136
int
addDefaultActions = 1,
int
loadLibrary = 1);
137
SubSystem
*
RegisterSubSystem
(
SubSystem
* subSystem);
138
};
139
141
// Class to store information on each subsystem that is registered //
143
144
class
SubSystem
145
{
146
private
:
147
std::string
_name
;
148
std::string
_prefix
;
149
TList*
_canvasList
;
150
SubSystemActionList
_actions
;
151
int
_initialized
;
152
153
public
:
154
SubSystem
(
const
char
*
name
,
const
char
*
prefix
,
int
loadLibrary = 1);
155
virtual
~SubSystem
();
156
157
// Public Functions
158
TList*
GetCanvases
(
int
forceReQuery = 0);
159
void
PrintCanvasList
();
160
void
ShowCanvases
();
161
162
SubSystemAction
*
AddAction
(
const
char
*
cmd
,
const
char
*
description
);
163
SubSystemAction
*
AddAction
(
const
std::string
&
cmd
,
const
std::string
&
description
);
164
SubSystemAction
*
AddAction
(
SubSystemAction
*
action
);
165
void
AddDefaultActions
();
166
167
void
TileCanvases
();
168
void
CascadeCanvases
();
169
170
// Accessor Methods
171
const
std::string
&
GetName
() {
return
_name
; };
172
const
std::string
&
GetPrefix
() {
return
_prefix
; };
173
SubSystemActionList
*
GetActions
() {
return
&
_actions
; };
174
int
isInitialized
() {
return
_initialized
; }
175
void
setInitialized
(
const
int
i
) {
_initialized
=
i
; }
176
};
177
179
// Class to store subsystem actions, commands to be added to shutter //
181
182
class
SubSystemAction
183
{
184
protected
:
185
bool
_running
;
186
int
_id
;
187
static
int
_nextId
;
188
static
SubSystemActionMap
_map
;
189
190
// Member Functions
191
int
NextId
() {
return
_nextId
++; };
192
193
SubSystem
*
_parent
;
194
std::string
_cmd
;
195
std::string
_description
;
196
197
public
:
198
SubSystemAction
(
SubSystem
* parent);
199
SubSystemAction
(
SubSystem
* parent,
const
char
*
description
);
200
SubSystemAction
(
SubSystem
* parent,
const
char
*
cmd
,
const
char
*
description
);
201
virtual
~SubSystemAction
();
202
203
virtual
int
Execute
();
204
205
// Accessor Methods
206
const
std::string
&
GetCmd
() {
return
_cmd
; };
207
const
std::string
&
GetDescription
() {
return
_description
; };
208
int
GetId
()
const
{
return
_id
; };
209
static
SubSystemAction
*
FindById
(
int
id
) {
return
_map
[
id
]; };
210
};
211
212
class
SubSystemActionDraw
:
public
SubSystemAction
213
{
214
public
:
215
SubSystemActionDraw
(
SubSystem
* parent);
216
virtual
~SubSystemActionDraw
(){};
217
int
Execute
();
218
};
219
220
class
SubSystemActionSavePlot
:
public
SubSystemAction
221
{
222
public
:
223
SubSystemActionSavePlot
(
SubSystem
* parent);
224
virtual
~SubSystemActionSavePlot
(){};
225
int
Execute
();
226
};
227
228
class
SubSystemActionDrawPS
:
public
SubSystemAction
229
{
230
public
:
231
SubSystemActionDrawPS
(
SubSystem
* parent);
232
virtual
~SubSystemActionDrawPS
(){};
233
int
Execute
();
234
};
235
236
class
SubSystemActionDrawHtml
:
public
SubSystemAction
237
{
238
public
:
239
SubSystemActionDrawHtml
(
SubSystem
* parent);
240
virtual
~SubSystemActionDrawHtml
(){};
241
int
Execute
();
242
};
243
244
class
SubSystemActionShowCanvases
:
public
SubSystemAction
245
{
246
public
:
247
SubSystemActionShowCanvases
(
SubSystem
* parent);
248
virtual
~SubSystemActionShowCanvases
(){};
249
int
Execute
();
250
};
251
252
class
SubSystemActionTileCanvases
:
public
SubSystemAction
253
{
254
public
:
255
SubSystemActionTileCanvases
(
SubSystem
* parent);
256
virtual
~SubSystemActionTileCanvases
(){};
257
int
Execute
();
258
};
259
260
class
ColorShutterItem
:
public
TGShutterItem
261
{
262
public
:
263
ColorShutterItem
(
const
ULong_t bgColor,
const
TGWindow*
p
, TGHotString*
s
,
264
Int_t
id
= -1, UInt_t
options
= 0);
265
virtual
~ColorShutterItem
(){};
266
};
OnlMon
blob
main
poms
Poms.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:28
using
1.8.2 with
sPHENIX GitHub integration