Analysis Software
Documentation for sPHENIX simulation 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 <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 ( )
virtual

destructor. All non close TFiles are closed, with a warning.

Definition at line 23 of file PHTFileServer.cc.

View newest version in sPHENIX GitHub at line 23 of file PHTFileServer.cc

References close(), and PHTFileServer::SafeTFile::file_map().

+ Here is the call graph for this function:

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 82 of file PHTFileServer.cc.

View newest version in sPHENIX GitHub at line 82 of file PHTFileServer.cc

References end, and PHTFileServer::SafeTFile::file_map().

Referenced by TPCIntegratedCharge::End(), TemplateCreation::End(), MvtxQAHisto::End(), PHAna::End(), AnaSvtxTracksForGenFit::End(), Proto4ShowerCalib::End(), TPCDataStreamEmulator::End(), Proto2ShowerCalib::End(), Proto3ShowerCalib::End(), FastTrackingEval::End(), EpFinderEval::End(), Proto4SampleFrac::End(), Proto4TowerCalib::End(), TPCMLDataInterface::End(), Prototype2DSTReader::End(), EMCalLikelihood::End(), PHG4DSTReader::End(), PHG4TrackFastSimEval::End(), PHG4ScoringManager::End(), Prototype3DSTReader::End(), Prototype4DSTReader::End(), TPCFEETestRecov1::End(), UEvsEtaCentrality::End(), Calib::End(), JetUnderlyingEvent::End(), HCalJetPhiShift::End(), ExampleAnalysisModule::End(), TpcPrototypeUnpacker::End(), TpcPrototypeGenFitTrkFinder::End(), GenFitTrackProp::End(), AnaMvtxTestBeam2019::End(), EMCalCalib::End(), EMCalAna::End(), JetSeedCount::End(), RandomConeAna::End(), MyJetAnalysis::End(), jetrtrack::End(), analysis::End(), JetBkgdSub::End(), JetKinematicCheck::End(), FillTruthRecoMatchTree::End(), JetValidation::End(), dNdEtaINTT::End(), TpcPrototypeGenFitTrkFitter::End(), PHGenFitTrkFitter::End(), EMCalCalib_TestBeam::End(), JetNconstituents::EndRun(), Calib::Init(), and Proto4ShowerCalib::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHTFileServer::close ( void  )

close all TFiles

Definition at line 141 of file PHTFileServer.cc.

View newest version in sPHENIX GitHub at line 141 of file PHTFileServer.cc

References PHTFileServer::SafeTFile::file_map().

Referenced by AnaMvtxTestBeam2019::End(), and ~PHTFileServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool PHTFileServer::flush ( const std::string &  filename)

flush TFile matching filename

Definition at line 63 of file PHTFileServer.cc.

View newest version in sPHENIX GitHub at line 63 of file PHTFileServer.cc

References end, and PHTFileServer::SafeTFile::file_map().

Referenced by Proto4ShowerCalib::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHTFileServer& PHTFileServer::get ( void  )
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 Prototype2DSTReader::build_tree(), Prototype4DSTReader::build_tree(), Prototype3DSTReader::build_tree(), PHG4DSTReader::build_tree(), TPCIntegratedCharge::End(), TemplateCreation::End(), MvtxQAHisto::End(), PHAna::End(), AnaSvtxTracksForGenFit::End(), Proto4ShowerCalib::End(), TPCDataStreamEmulator::End(), Proto2ShowerCalib::End(), Proto3ShowerCalib::End(), FastTrackingEval::End(), EpFinderEval::End(), Proto4SampleFrac::End(), Proto4TowerCalib::End(), TPCMLDataInterface::End(), Prototype2DSTReader::End(), EMCalLikelihood::End(), PHG4DSTReader::End(), PHG4TrackFastSimEval::End(), PHG4ScoringManager::End(), Prototype3DSTReader::End(), Prototype4DSTReader::End(), TPCFEETestRecov1::End(), UEvsEtaCentrality::End(), Calib::End(), JetUnderlyingEvent::End(), HCalJetPhiShift::End(), ExampleAnalysisModule::End(), jetHistogrammer::End(), TpcPrototypeGenFitTrkFinder::End(), TpcPrototypeUnpacker::End(), GenFitTrackProp::End(), AnaMvtxTestBeam2019::End(), EMCalCalib::End(), EMCalAna::End(), JetSeedCount::End(), RandomConeAna::End(), MyJetAnalysis::End(), analysis::End(), JetBkgdSub::End(), jetrtrack::End(), FullJetFinder::End(), JetKinematicCheck::End(), FillTruthRecoMatchTree::End(), JetValidation::End(), dNdEtaINTT::End(), TpcPrototypeGenFitTrkFitter::End(), PHGenFitTrkFitter::End(), EMCalCalib_TestBeam::End(), JetNconstituents::EndRun(), TemplateCreation::Init(), PHAna::Init(), MvtxQAHisto::Init(), AnaSvtxTracksForGenFit::Init(), UEvsEtaCentrality::Init(), JetUnderlyingEvent::Init(), HCalJetPhiShift::Init(), Proto4ShowerCalib::Init(), Proto3ShowerCalib::Init(), Proto2ShowerCalib::Init(), EpFinderEval::Init(), Proto4TowerCalib::Init(), Proto4SampleFrac::Init(), FastTrackingEval::Init(), JetSeedCount::Init(), ExampleAnalysisModule::Init(), Calib::Init(), EMCalLikelihood::Init(), JetNconstituents::Init(), GenFitTrackProp::Init(), EMCalAna::Init(), FullJetFinder::Init(), EMCalCalib::Init(), JetKinematicCheck::Init(), RandomConeAna::Init(), MyJetAnalysis::Init(), JetBkgdSub::Init(), JetValidation::Init(), dNdEtaINTT::Init(), EMCalCalib_TestBeam::Init(), TPCIntegratedCharge::InitRun(), TPCDataStreamEmulator::InitRun(), PHG4ScoringManager::InitRun(), PHG4TrackFastSimEval::InitRun(), TPCMLDataInterface::InitRun(), TPCFEETestRecov1::InitRun(), TpcPrototypeGenFitTrkFinder::InitRun(), TpcPrototypeUnpacker::InitRun(), analysis::InitRun(), jetrtrack::InitRun(), TpcPrototypeGenFitTrkFitter::InitRun(), PHGenFitTrkFitter::InitRun(), and Proto4ShowerCalib::process_event().

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 32 of file PHTFileServer.cc.

View newest version in sPHENIX GitHub at line 32 of file PHTFileServer.cc

References end, file, and PHTFileServer::SafeTFile::file_map().

Referenced by Prototype2DSTReader::build_tree(), Prototype4DSTReader::build_tree(), Prototype3DSTReader::build_tree(), PHG4DSTReader::build_tree(), jetHistogrammer::End(), AnaMvtxTestBeam2019::End(), TemplateCreation::Init(), MvtxQAHisto::Init(), PHAna::Init(), AnaSvtxTracksForGenFit::Init(), UEvsEtaCentrality::Init(), HCalJetPhiShift::Init(), JetUnderlyingEvent::Init(), Proto4ShowerCalib::Init(), EpFinderEval::Init(), Proto2ShowerCalib::Init(), Proto3ShowerCalib::Init(), FastTrackingEval::Init(), Proto4SampleFrac::Init(), Proto4TowerCalib::Init(), JetSeedCount::Init(), ExampleAnalysisModule::Init(), EMCalLikelihood::Init(), Calib::Init(), JetNconstituents::Init(), GenFitTrackProp::Init(), FullJetFinder::Init(), EMCalAna::Init(), EMCalCalib::Init(), JetKinematicCheck::Init(), RandomConeAna::Init(), MyJetAnalysis::Init(), JetBkgdSub::Init(), JetValidation::Init(), dNdEtaINTT::Init(), EMCalCalib_TestBeam::Init(), TPCIntegratedCharge::InitRun(), TPCDataStreamEmulator::InitRun(), PHG4TrackFastSimEval::InitRun(), PHG4ScoringManager::InitRun(), TPCMLDataInterface::InitRun(), TPCFEETestRecov1::InitRun(), TpcPrototypeGenFitTrkFinder::InitRun(), TpcPrototypeUnpacker::InitRun(), jetrtrack::InitRun(), analysis::InitRun(), TpcPrototypeGenFitTrkFitter::InitRun(), and PHGenFitTrkFitter::InitRun().

+ Here is the call graph for this function:

+ 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 101 of file PHTFileServer.cc.

View newest version in sPHENIX GitHub at line 101 of file PHTFileServer.cc

References end, and PHTFileServer::SafeTFile::file_map().

Referenced by MvtxQAHisto::End(), Calib::End(), AnaMvtxTestBeam2019::End(), RandomConeAna::End(), and JetBkgdSub::End().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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