Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
Analysis Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
acts-fatras
analysis
analysis_tpc_prototype
coresoftware
blob
master
calibrations
generators
offline
database
framework
ffamodules
ffaobjects
ffarawmodules
ffarawobjects
frog
fun4all
Fun4AllBase.cc
Fun4AllBase.h
Fun4AllDstInputManager.cc
Fun4AllDstInputManager.h
Fun4AllDstOutputManager.cc
Fun4AllDstOutputManager.h
Fun4AllDummyInputManager.cc
Fun4AllDummyInputManager.h
Fun4AllHistoBinDefs.h
Fun4AllHistoManager.cc
Fun4AllHistoManager.h
Fun4AllInputManager.cc
Fun4AllInputManager.h
Fun4AllMemoryTracker.cc
Fun4AllMemoryTracker.h
Fun4AllMonitoring.cc
Fun4AllMonitoring.h
Fun4AllNoSyncDstInputManager.cc
Fun4AllNoSyncDstInputManager.h
Fun4AllOutputManager.cc
Fun4AllOutputManager.h
Fun4AllReturnCodes.h
Fun4AllRunNodeInputManager.cc
Fun4AllRunNodeInputManager.h
Fun4AllServer.cc
Fun4AllServer.h
Fun4AllSyncManager.cc
Fun4AllSyncManager.h
Fun4AllUtils.cc
Fun4AllUtils.h
InputFileHandler.cc
InputFileHandler.h
PHTFileServer.cc
PHTFileServer.h
SubsysReco.h
TDirectoryHelper.cc
TDirectoryHelper.h
fun4allraw
fun4allutils
phool
phoolraw
packages
QA
simulation
validation
Doxygen_Assist
g4exampledetector
GenFit
JETSCAPE
KFParticle
macros
online_distribution
OnlMon
prototype
pythia6
rcdaq
RDBC
tutorials
doxygen_mainpage.h
File Members
Examples
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHTFileServer.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHTFileServer.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
4
11
12
13
#ifndef FUN4ALL_PHTFILESERVER_H
14
#define FUN4ALL_PHTFILESERVER_H
15
16
#include <TFile.h>
17
18
#include <map>
19
#include <sstream>
20
#include <string>
21
28
class
PHTFileServer
29
{
30
public
:
32
static
PHTFileServer
&
get
(void)
33
{
34
static
PHTFileServer
singleton;
35
return
singleton;
36
}
37
39
virtual
~PHTFileServer
();
40
45
void
open
(
const
std::string
&
filename
,
const
std::string
&
type
=
"RECREATE"
);
46
48
bool
flush
(
const
std::string
&
filename
);
49
51
bool
cd
(
const
std::string
&
filename
);
52
57
bool
write
(
const
std::string
&
filename
);
58
60
void
close
(
void
);
61
62
private
:
64
PHTFileServer
(
void
)
65
{
66
}
67
69
class
SafeTFile
:
public
TFile
70
{
71
public
:
73
SafeTFile
(
const
std::string
&
filename
,
const
std::string
&
type
=
"RECREATE"
)
74
: TFile(filename.c_str(),
type
.c_str())
75
,
_filename
(filename)
76
,
_counter
(1)
77
{
78
}
79
81
~SafeTFile
(
void
)
override
;
82
84
int
&
counter
()
85
{
86
return
_counter
;
87
}
88
90
const
int
&
counter
()
const
91
{
92
return
_counter
;
93
}
94
96
typedef
std::map<std::string, SafeTFile*>
TFileMap
;
97
98
static
TFileMap
&
file_map
(
void
)
99
{
100
return
_map
;
101
}
102
103
private
:
105
std::string
_filename
;
106
108
int
_counter
;
109
111
static
TFileMap
_map
;
112
};
113
};
114
115
#endif
coresoftware
blob
master
offline
framework
fun4all
PHTFileServer.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:04
using
1.8.2 with
sPHENIX GitHub integration