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
Fun4AllEventOutputManager.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Fun4AllEventOutputManager.cc
1
#include "
Fun4AllEventOutputManager.h
"
2
3
#include "
Fun4AllEventOutStream.h
"
4
#include "
Fun4AllRolloverFileOutStream.h
"
5
6
#include <
fun4all/Fun4AllOutputManager.h
>
// for Fun4AllOutputManager
7
#include <
fun4all/Fun4AllServer.h
>
8
9
#include <
phool/getClass.h
>
10
#include <
phool/phool.h
>
// for PHWHERE
11
12
#include <Event/Event.h>
13
14
#include <iostream>
15
#include <string>
16
17
Fun4AllEventOutputManager::Fun4AllEventOutputManager
(
const
std::string
&myname,
const
std::string
&filerule,
const
unsigned
int
nEvents
,
const
unsigned
int
sizeInMB,
const
int
offset
,
const
int
increment)
18
:
Fun4AllOutputManager
(myname)
19
, m_OutFileRule(filerule)
20
{
21
m_OutStream
=
new
Fun4AllRolloverFileOutStream
(filerule, nEvents, sizeInMB, offset, increment);
22
m_OutStream
->
SetManager
(
this
);
23
return
;
24
}
25
26
Fun4AllEventOutputManager::~Fun4AllEventOutputManager
()
27
{
28
delete
m_OutStream
;
29
return
;
30
}
31
32
void
Fun4AllEventOutputManager::Print
(
const
std::string
&what)
const
33
{
34
std::cout <<
Name
() <<
" writes "
<<
m_OutFileRule
<< std::endl;
35
// base class print method
36
Fun4AllOutputManager::Print
(what);
37
38
return
;
39
}
40
41
int
Fun4AllEventOutputManager::Write
(
PHCompositeNode
*
/*startNode*/
)
42
{
43
Fun4AllServer
*se =
Fun4AllServer::instance
();
44
PHCompositeNode
*topNode = se->
topNode
();
45
Event
*evt = findNode::getClass<Event>(topNode,
"PRDF"
);
46
if
(!evt)
47
{
48
std::cout <<
PHWHERE
<<
"0 Event Pointer"
<< std::endl;
49
return
-1;
50
}
51
m_OutStream
->
WriteEvent
(evt);
52
return
0;
53
}
54
55
int
Fun4AllEventOutputManager::AddPacket
(
const
int
ipkt)
56
{
57
int
iret = -1;
58
if
(
m_OutStream
)
59
{
60
iret =
m_OutStream
->
AddPacket
(ipkt);
61
}
62
else
63
{
64
std::cout <<
PHWHERE
<<
"Cannot add packet"
<< std::endl;
65
}
66
return
iret;
67
}
68
69
int
Fun4AllEventOutputManager::AddPacketRange
(
const
int
ipktmin,
const
int
ipktmax)
70
{
71
int
iret = -1;
72
if
(
m_OutStream
)
73
{
74
iret =
m_OutStream
->
AddPacketRange
(ipktmin, ipktmax);
75
}
76
else
77
{
78
std::cout <<
PHWHERE
<<
"Cannot add packet"
<< std::endl;
79
}
80
return
iret;
81
}
82
83
int
Fun4AllEventOutputManager::DropPacket
(
const
int
ipkt)
84
{
85
int
iret = -1;
86
if
(
m_OutStream
)
87
{
88
iret =
m_OutStream
->
DropPacket
(ipkt);
89
}
90
else
91
{
92
std::cout <<
PHWHERE
<<
"Cannot drop packet"
<< std::endl;
93
}
94
return
iret;
95
}
96
97
int
Fun4AllEventOutputManager::DropPacketRange
(
const
int
ipktmin,
const
int
ipktmax)
98
{
99
int
iret = -1;
100
if
(
m_OutStream
)
101
{
102
iret =
m_OutStream
->
DropPacketRange
(ipktmin, ipktmax);
103
}
104
else
105
{
106
std::cout <<
PHWHERE
<<
"Cannot drop packet"
<< std::endl;
107
}
108
return
iret;
109
}
110
111
void
Fun4AllEventOutputManager::SetOutfileName
(
const
std::string
&
fname
)
112
{
113
OutFileName
(fname);
114
return
;
115
}
116
117
void
Fun4AllEventOutputManager::Verbosity
(
const
int
i
)
118
{
119
Fun4AllBase::Verbosity
(i);
120
if
(
m_OutStream
)
121
{
122
m_OutStream
->
Verbosity
(i);
123
}
124
return
;
125
}
coresoftware
blob
master
offline
framework
fun4allraw
Fun4AllEventOutputManager.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:04
using
1.8.2 with
sPHENIX GitHub integration