EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHTFileServer Class Reference

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 <fun4all_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 PHTFileServerget (void)
 return reference to class singleton
 

Private Member Functions

 PHTFileServer (void)
 constructor
 

Detailed Description

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

Constructor & Destructor Documentation

PHTFileServer::~PHTFileServer ( void  )
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

PHTFileServer::PHTFileServer ( void  )
inlineprivate

constructor

Definition at line 64 of file PHTFileServer.h.

View newest version in sPHENIX GitHub at line 64 of file PHTFileServer.h

Member Function Documentation

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(), B0TrackFastSimEval::End(), PHG4DSTReader::End(), PHG4TrackFastSimEval::End(), MyJetAnalysis::End(), PHG4ScoringManager::End(), TPCFEETestRecov1::End(), and PHGenFitTrkFitter::End().

+ Here is the caller graph for this function:

void PHTFileServer::close ( void  )

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

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 eicpy.qaplots::file.

Referenced by PHG4DSTReader::build_tree(), TrackFastSimEval::Init(), MyJetAnalysis::Init(), TPCIntegratedCharge::InitRun(), TPCDataStreamEmulator::InitRun(), B0TrackFastSimEval::InitRun(), PHG4TrackFastSimEval::InitRun(), PHG4ScoringManager::InitRun(), TPCFEETestRecov1::InitRun(), and PHGenFitTrkFitter::InitRun().

+ Here is the caller graph for this function:

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


The documentation for this class was generated from the following files: