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
PHIODataNode.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHIODataNode.h
1
#ifndef PHOOL_PHIODATANODE_H
2
#define PHOOL_PHIODATANODE_H
3
4
// Declaration of class PHIODataNode which can hold persistent data
5
// Author: Matthias Messer
6
7
#include "
PHDataNode.h
"
8
#include "
PHIOManager.h
"
9
#include "
PHNodeIOManager.h
"
10
#include "
PHTypedNodeIterator.h
"
11
#include "
phooldefs.h
"
12
13
#include <TObject.h>
14
15
#include <string>
16
17
template
<
typename
T>
18
class
PHIODataNode
:
public
PHDataNode
<T>
19
{
20
friend
class
PHNodeIOManager
;
21
22
public
:
23
T
*
operator*
() {
return
this->
getData
(); }
24
PHIODataNode
(
T
*,
const
std::string
&);
25
PHIODataNode
(
T
*,
const
std::string
&,
const
std::string
&);
26
virtual
~PHIODataNode
() {}
27
typedef
PHTypedNodeIterator<T>
iterator
;
28
void
BufferSize
(
int
size
) {
buffersize
=
size
;}
29
void
SplitLevel
(
int
split) {
splitlevel
= split;}
30
31
protected
:
32
bool
write
(
PHIOManager
*,
const
std::string
& =
""
)
override
;
33
PHIODataNode
() =
delete
;
34
int
buffersize
;
35
int
splitlevel
;
36
};
37
38
template
<
class
T>
39
PHIODataNode<T>::PHIODataNode
(
T
*d,
const
std::string
&
n
)
40
:
PHDataNode
<
T
>(d, n)
41
, buffersize(32000)
42
, splitlevel(99)
43
{
44
this->
type
=
"PHIODataNode"
;
45
TObject *TO =
static_cast<
TObject *
>
(d);
46
this->
objectclass
= TO->GetName();
47
}
48
49
template
<
class
T>
50
PHIODataNode<T>::PHIODataNode
(
T
*d,
const
std::string
&
n
,
51
const
std::string
&objtype)
52
:
PHDataNode
<
T
>(d, n, objtype)
53
, buffersize(32000)
54
, splitlevel(99)
55
{
56
this->
type
=
"PHIODataNode"
;
57
TObject *TO =
static_cast<
TObject *
>
(d);
58
this->
objectclass
= TO->GetName();
59
}
60
61
template
<
class
T>
62
bool
PHIODataNode<T>::write
(
PHIOManager
*IOManager,
const
std::string
&
path
)
63
{
64
if
(this->persistent)
65
{
66
PHNodeIOManager
*np =
dynamic_cast<
PHNodeIOManager
*
>
(IOManager);
67
if
(np)
68
{
69
std::string
newPath = path +
phooldefs::branchpathdelim
+ this->
name
;
70
bool
bret =
false
;
71
if
(dynamic_cast<TObject *>(this->
data
.data))
72
{
73
bret = np->
write
(&(this->
data
.tobj), newPath, buffersize, splitlevel);
74
}
75
return
bret;
76
}
77
}
78
return
true
;
79
}
80
81
#endif
/* PHOOL_PHIODATANODE_H */
coresoftware
blob
master
offline
framework
phool
PHIODataNode.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:05
using
1.8.2 with
sPHENIX GitHub integration