ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
TFile clean handling. It allow independant classes to access the same TFile and write ntuple to it. TFiles get written only when as many write request are achieved as open request. It get closed when the server is deleted. More...
#include <coresoftware/blob/master/offline/framework/fun4all/PHTFileServer.h>
Classes | |
class | SafeTFile |
local class to store TFile and counter More... | |
Public Member Functions | |
virtual | ~PHTFileServer () |
destructor. All non close TFiles are closed, with a warning. | |
void | open (const std::string &filename, const std::string &type="RECREATE") |
open a SafeTFile. If filename is not found in the map, create a new TFile and append to the map; increment counter otherwise | |
bool | flush (const std::string &filename) |
flush TFile matching filename | |
bool | cd (const std::string &filename) |
change to directory of TFile matching filename | |
bool | write (const std::string &filename) |
if TFile is found in map and counter is 0, close the TFile, decrement counter otherwise | |
void | close (void) |
close all TFiles | |
Static Public Member Functions | |
static PHTFileServer & | get (void) |
return reference to class singleton | |
Private Member Functions | |
PHTFileServer (void) | |
constructor | |
TFile clean handling. It allow independant classes to access the same TFile and write ntuple to it. TFiles get written only when as many write request are achieved as open request. It get closed when the server is deleted.
Definition at line 28 of file PHTFileServer.h.
View newest version in sPHENIX GitHub at line 28 of file PHTFileServer.h
|
virtual |
destructor. All non close TFiles are closed, with a warning.
Definition at line 25 of file PHTFileServer.cc.
View newest version in sPHENIX GitHub at line 25 of file PHTFileServer.cc
References close().
|
inlineprivate |
constructor
Definition at line 64 of file PHTFileServer.h.
View newest version in sPHENIX GitHub at line 64 of file PHTFileServer.h
bool PHTFileServer::cd | ( | const std::string & | filename | ) |
change to directory of TFile matching filename
Definition at line 76 of file PHTFileServer.cc.
View newest version in sPHENIX GitHub at line 76 of file PHTFileServer.cc
Referenced by TPCIntegratedCharge::End(), TrackFastSimEval::End(), TPCDataStreamEmulator::End(), PHG4DSTReader::End(), B0TrackFastSimEval::End(), PHG4TrackFastSimEval::End(), MyJetAnalysis::End(), PHG4ScoringManager::End(), TPCFEETestRecov1::End(), and PHGenFitTrkFitter::End().
close all TFiles
Definition at line 133 of file PHTFileServer.cc.
View newest version in sPHENIX GitHub at line 133 of file PHTFileServer.cc
bool PHTFileServer::flush | ( | const std::string & | filename | ) |
flush TFile matching filename
Definition at line 59 of file PHTFileServer.cc.
View newest version in sPHENIX GitHub at line 59 of file PHTFileServer.cc
|
inlinestatic |
return reference to class singleton
Definition at line 32 of file PHTFileServer.h.
View newest version in sPHENIX GitHub at line 32 of file PHTFileServer.h
Referenced by PHG4DSTReader::build_tree(), TPCIntegratedCharge::End(), TrackFastSimEval::End(), TPCDataStreamEmulator::End(), B0TrackFastSimEval::End(), PHG4DSTReader::End(), MyJetAnalysis::End(), PHG4ScoringManager::End(), PHG4TrackFastSimEval::End(), TPCFEETestRecov1::End(), PHGenFitTrkFitter::End(), TrackFastSimEval::Init(), MyJetAnalysis::Init(), TPCIntegratedCharge::InitRun(), TPCDataStreamEmulator::InitRun(), B0TrackFastSimEval::InitRun(), PHG4ScoringManager::InitRun(), PHG4TrackFastSimEval::InitRun(), TPCFEETestRecov1::InitRun(), and PHGenFitTrkFitter::InitRun().
void PHTFileServer::open | ( | const std::string & | filename, |
const std::string & | type = "RECREATE" |
||
) |
open a SafeTFile. If filename is not found in the map, create a new TFile and append to the map; increment counter otherwise
Definition at line 31 of file PHTFileServer.cc.
View newest version in sPHENIX GitHub at line 31 of file PHTFileServer.cc
References file.
Referenced by PHG4DSTReader::build_tree(), TrackFastSimEval::Init(), MyJetAnalysis::Init(), TPCIntegratedCharge::InitRun(), TPCDataStreamEmulator::InitRun(), B0TrackFastSimEval::InitRun(), PHG4ScoringManager::InitRun(), PHG4TrackFastSimEval::InitRun(), TPCFEETestRecov1::InitRun(), and PHGenFitTrkFitter::InitRun().
bool PHTFileServer::write | ( | const std::string & | filename | ) |
if TFile is found in map and counter is 0, close the TFile, decrement counter otherwise
Definition at line 93 of file PHTFileServer.cc.
View newest version in sPHENIX GitHub at line 93 of file PHTFileServer.cc