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
DumpObject.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DumpObject.cc
1
#include "
DumpObject.h
"
2
3
#include "
PHNodeDump.h
"
4
5
#include <fstream>
6
#include <iostream>
7
#include <string>
8
9
DumpObject::DumpObject
(
const
std::string
&NodeName)
10
: ThisName(NodeName)
11
{
12
return
;
13
}
14
15
int
DumpObject::Init
()
16
{
17
if
(
ThisName
!=
"DUMMY"
)
18
{
19
OpenOutFile
();
20
}
21
return
0;
22
}
23
24
int
DumpObject::OpenOutFile
()
25
{
26
if
(
no_output
)
27
{
28
return
0;
29
}
30
std::string
fname
=
OutDir
+
"/"
+
ThisName
+
".list"
;
31
fout
=
new
std::ofstream(fname.c_str());
32
return
0;
33
}
34
35
void
DumpObject::Print
(
const
char
*
/*what*/
)
const
36
{
37
std::cout <<
ThisName
<<
" did not implement Print method"
<< std::endl;
38
return
;
39
}
40
41
int
DumpObject::process_event
(
PHNode
*myNode)
42
{
43
if
(
fout
&&
write_run_event
)
44
{
45
if
(
fp_precision
> 0)
46
{
47
(*fout).precision(
fp_precision
);
48
}
49
*
fout
<< std::endl
50
<<
"RunNumber: "
<<
myNodeDump
->
RunNumber
();
51
if
(
print_evtseq
)
52
{
53
*
fout
<<
", Event Sequence: "
<<
myNodeDump
->
EvtSequence
();
54
}
55
*
fout
<< std::endl;
56
}
57
process_Node
(myNode);
58
// std::cout << ThisName << " did not implement process_event method" << std::endl;
59
return
0;
60
}
61
62
int
DumpObject::process_Node
(
PHNode
*
/*myNode*/
)
63
{
64
// std::cout << ThisName << " did not implement process_event method" << std::endl;
65
return
0;
66
}
67
68
int
DumpObject::CloseOutputFile
()
69
{
70
delete
fout
;
71
fout
=
nullptr
;
72
return
0;
73
}
coresoftware
blob
master
offline
packages
NodeDump
DumpObject.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:07
using
1.8.2 with
sPHENIX GitHub integration