ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
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
using namespace
std;
18
19
Fun4AllEventOutputManager::Fun4AllEventOutputManager
(
const
string
&myname,
const
string
&filerule,
const
unsigned
int
sizeInMB,
const
int
offset
,
const
int
increment)
20
:
Fun4AllOutputManager
(myname)
21
, m_OutFileRule(filerule)
22
{
23
m_OutStream
=
new
Fun4AllRolloverFileOutStream
(filerule, sizeInMB, offset, increment);
24
m_OutStream
->
SetManager
(
this
);
25
return
;
26
}
27
28
Fun4AllEventOutputManager::~Fun4AllEventOutputManager
()
29
{
30
delete
m_OutStream
;
31
return
;
32
}
33
34
void
Fun4AllEventOutputManager::Print
(
const
string
&what)
const
35
{
36
cout <<
Name
() <<
" writes "
<<
m_OutFileRule
<< endl;
37
// base class print method
38
Fun4AllOutputManager::Print
(what);
39
40
return
;
41
}
42
43
int
Fun4AllEventOutputManager::Write
(
PHCompositeNode
*
/*startNode*/
)
44
{
45
Fun4AllServer
*se =
Fun4AllServer::instance
();
46
PHCompositeNode
*topNode = se->
topNode
();
47
Event
*evt = findNode::getClass<Event>(topNode,
"PRDF"
);
48
if
(!evt)
49
{
50
cout <<
PHWHERE
<<
"0 Event Pointer"
<< endl;
51
return
-1;
52
}
53
m_OutStream
->
WriteEvent
(evt);
54
return
0;
55
}
56
57
int
Fun4AllEventOutputManager::AddPacket
(
const
int
ipkt)
58
{
59
int
iret = -1;
60
if
(
m_OutStream
)
61
{
62
iret =
m_OutStream
->
AddPacket
(ipkt);
63
}
64
else
65
{
66
cout <<
PHWHERE
<<
"Cannot add packet"
<< endl;
67
}
68
return
iret;
69
}
70
71
int
Fun4AllEventOutputManager::AddPacketRange
(
const
int
ipktmin,
const
int
ipktmax)
72
{
73
int
iret = -1;
74
if
(
m_OutStream
)
75
{
76
iret =
m_OutStream
->
AddPacketRange
(ipktmin, ipktmax);
77
}
78
else
79
{
80
cout <<
PHWHERE
<<
"Cannot add packet"
<< endl;
81
}
82
return
iret;
83
}
84
85
int
Fun4AllEventOutputManager::DropPacket
(
const
int
ipkt)
86
{
87
int
iret = -1;
88
if
(
m_OutStream
)
89
{
90
iret =
m_OutStream
->
DropPacket
(ipkt);
91
}
92
else
93
{
94
cout <<
PHWHERE
<<
"Cannot drop packet"
<< endl;
95
}
96
return
iret;
97
}
98
99
int
Fun4AllEventOutputManager::DropPacketRange
(
const
int
ipktmin,
const
int
ipktmax)
100
{
101
int
iret = -1;
102
if
(
m_OutStream
)
103
{
104
iret =
m_OutStream
->
DropPacketRange
(ipktmin, ipktmax);
105
}
106
else
107
{
108
cout <<
PHWHERE
<<
"Cannot drop packet"
<< endl;
109
}
110
return
iret;
111
}
112
113
void
Fun4AllEventOutputManager::SetOutfileName
(
const
std::string &
fname
)
114
{
115
OutFileName
(fname);
116
return
;
117
}
coresoftware
blob
master
offline
framework
fun4allraw
Fun4AllEventOutputManager.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:33
using
1.8.2 with
ECCE GitHub integration