LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "TFileService.h"
Classes | |
struct | Config |
Public Types | |
using | Parameters = ServiceTable< Config > |
using | Callback_t = TFileDirectory::Callback_t |
Public Member Functions | |
TFileService (ServiceTable< Config > const &config, art::ActivityRegistry &r) | |
~TFileService () | |
void | registerFileSwitchCallback (Callback_t c) |
template<typename T > | |
void | registerFileSwitchCallback (T *provider, void(T::*)()) |
TFile & | file () const |
template<typename T , typename... ARGS> | |
T * | make (ARGS...args) const |
template<typename T , typename... ARGS> | |
T * | makeAndRegister (char const *name, char const *title, ARGS...args) const |
template<typename T , typename... ARGS> | |
T * | makeAndRegister (std::string const &name, std::string const &title, ARGS...args) const |
TFileDirectory | mkdir (std::string const &dir, std::string const &descr="") |
Static Public Attributes | |
static constexpr const char * | default_tmpDir = "<parent-path-of-filename>" |
Protected Member Functions | |
void | invokeCallbacks () |
void | registerCallback (Callback_t) |
std::string | fullPath () const |
Protected Attributes | |
TFile * | file_ |
std::string | dir_ |
std::string | descr_ |
bool | requireCallback_ {false} |
Private Member Functions | |
TFileService (TFileService const &)=delete | |
TFileService | operator= (TFileService const &)=delete |
void | setDirectoryName_ (art::ModuleDescription const &desc) |
void | openFile_ () |
void | closeFile_ () |
void | maybeSwitchFiles_ () |
bool | requestsToCloseFile_ () |
std::string | fileNameAtOpen_ () |
std::string | fileNameAtClose_ (std::string const &) |
Private Attributes | |
bool const | closeFileFast_ |
FileStatsCollector | fstats_ |
PostCloseFileRenamer | fRenamer_ {fstats_} |
std::string | filePattern_ |
std::string | uniqueFilename_ |
std::string | tmpDir_ |
std::string | lastClosedFile_ {} |
Granularity | currentGranularity_ {Granularity::Unset} |
std::chrono::steady_clock::time_point | beginTime_ {} |
ClosingCriteria | fileSwitchCriteria_ {ClosingCriteria::Config{}} |
OutputFileStatus | status_ {OutputFileStatus::Closed} |
FileProperties | fp_ {} |
Definition at line 31 of file TFileService.h.
Definition at line 54 of file TFileService.h.
Definition at line 48 of file TFileService.h.
|
privatedelete |
TFileService::TFileService | ( | ServiceTable< Config > const & | config, |
art::ActivityRegistry & | r | ||
) |
Definition at line 37 of file TFileService_service.cc.
References closeFileFast_, currentGranularity_, e, art::Granularity::Event, filePattern_, fileSwitchCriteria_, fp_, fstats_, art::Run::id(), art::SubRun::id(), art::Event::id(), art::Granularity::InputFile, maybeSwitchFiles_(), openFile_(), art::FileStatsCollector::recordEvent(), art::FileStatsCollector::recordInputFile(), art::FileStatsCollector::recordRun(), art::FileStatsCollector::recordSubRun(), requestsToCloseFile_(), art::TFileDirectory::requireCallback_, art::Granularity::Run, setDirectoryName_(), status_, art::Granularity::SubRun, tmpDir_, art::FileProperties::update(), and art::detail::validateFileNamePattern().
TFileService::~TFileService | ( | ) |
|
private |
Definition at line 165 of file TFileService_service.cc.
References art::Closed, closeFileFast_, art::TFileDirectory::file_, fileNameAtClose_(), fstats_, lastClosedFile_, art::FileStatsCollector::recordFileClose(), status_, and uniqueFilename_.
Referenced by maybeSwitchFiles_(), and ~TFileService().
|
inline |
Definition at line 63 of file TFileService.h.
|
private |
Definition at line 146 of file TFileService_service.cc.
References filePattern_, fRenamer_, and art::PostCloseFileRenamer::maybeRenameFile().
Referenced by closeFile_().
|
private |
Definition at line 136 of file TFileService_service.cc.
References default_tmpDir, filePattern_, art::parent_path(), tmpDir_, and art::unique_filename().
Referenced by openFile_().
|
protectedinherited |
Return the full pathname of the current directory, formed from appending 'dir' to the end of 'path'.
Definition at line 80 of file TFileDirectory.cc.
References art::TFileDirectory::dir_, and art::TFileDirectory::path_.
Referenced by art::TFileDirectory::cd(), and art::TFileDirectory::mkdir().
|
protectedinherited |
Definition at line 19 of file TFileDirectory.cc.
References art::TFileDirectory::callbacks_, art::TFileDirectory::dir_, and f.
Referenced by maybeSwitchFiles_().
|
inherited |
make new ROOT object of type T, using constructor parameters args. It will be made in the 'current directory', as established with a call to 'cd'.
Definition at line 82 of file TFileDirectory.h.
References art::TFileDirectory::cd().
Referenced by opdet::OpHitAna::analyze(), opdet::OpDigiAna::analyze(), opdet::OpFlashAna::analyze(), mvapid::MVAPID::beginJob(), lar_pandora::PFParticleTrackAna::beginJob(), lar_pandora::PFParticleCosmicAna::beginJob(), lar_pandora::PFParticleHitDumper::beginJob(), lar_pandora::PFParticleMonitoring::beginJob(), lar_pandora::PFParticleAnalysis::beginJob(), pid::PIDAAnalyzer::beginJob(), opdet::OpFlashSimpleAna::beginJob(), phot::PhotonLibraryAnalyzer::beginJob(), filt::FinalStateParticleFilter::beginJob(), opreco::OpticalRecoAna::beginJob(), filt::FinalStateSelectFilter::beginJob(), spacecharge::ShiftEdepSCE::beginJob(), opdet::FlashHypothesisAna::beginJob(), cluster::ClusterPCA::beginJob(), larg4::ISCalculationAna::beginJob(), vertex::AggregateVertexAna::beginJob(), evgen::CosmicsGen::beginJob(), DUNE::NeutrinoShowerEff::beginJob(), ShowerQuality::beginJob(), filt::EmptyFilter::beginJob(), hit::HitAnaModule::beginJob(), cluster::TrajCluster::beginJob(), cluster::DBcluster::beginJob(), shower::TCShowerTemplateMaker::beginJob(), rwgt::ReweightAna::beginJob(), shower::TCShowerElectronLikelihood::beginJob(), shower::TCShowerAnalysis::beginJob(), caldata::CalWireAna::beginJob(), cluster::fuzzyCluster::beginJob(), microboone::CosmicRemovalAna::beginJob(), detsim::SimWireAna::beginJob(), evgen::NUANCEGen::beginJob(), larg4::LArG4Ana::beginJob(), DUNE::NeutrinoTrackingEff::beginJob(), trkf::TrackKalmanCheater::beginJob(), pfpf::PFPAna::beginJob(), vertex::PrimaryVertexFinder::beginJob(), cluster::ClusterAna::beginJob(), DUNE::MuonTrackingEff::beginJob(), vertex::HarrisVertexFinder::beginJob(), detsim::WienerFilterAna::beginJob(), evgen::NDKGen::beginJob(), cluster::DBclusterAna::beginJob(), hit::GausHitFinderAna::beginJob(), hit::HitFinderAna::beginJob(), hit::GausHitFinder::beginJob(), cluster::HoughLineFinderAna::beginJob(), trkf::Track3DKalmanHit::beginJob(), NuShowerEff::beginJob(), vertex::VertexFinder2D::beginJob(), evgen::GaisserParam::beginJob(), opdet::SimPhotonCounter::beginJob(), shwf::ShowerReco::beginJob(), detsim::SimWire::beginJob(), hit::DPRawHitFinder::beginJob(), vertex::FeatureVertexFinderAna::beginJob(), trkf::Track3DKalman::beginJob(), evgen::GENIEGen::beginJob(), lbne::PhotonCounterT0Matching::beginJob(), trkf::Track3DKalmanSPS::beginJob(), t0::MCTruthT0Matching::beginJob(), evgen::MUSUN::beginJob(), ems::MultiEMShowers::beginJob(), lar::example::AnalysisExample::beginJob(), ems::MergeEMShower3D::beginJob(), cheat::RecoCheckAna::beginRun(), trkf::SpacePointAna::bookHistograms(), reco_tool::CandHitDerivative::configure(), reco_tool::CandHitMorphological::configure(), detsim::SimWire::ConvoluteResponseFunctions(), tca::HistStuff::CreateHists(), DUNE::NeutrinoShowerEff::doEfficiencies(), DUNE::NeutrinoTrackingEff::doEfficiencies(), NuShowerEff::doEfficiencies(), shower::EMShowerAlg::EMShowerAlg(), opdet::LEDCalibrationAna::endJob(), larg::LArSimChannelAna::ensureHists(), hit::MagDriftAna::ensureHists(), reco_tool::CandHitDerivative::findHitCandidates(), reco_tool::CandHitMorphological::findHitCandidates(), lar_cluster3d::ConvexHullPathFinder::initializeHistograms(), lar_cluster3d::VoronoiPathFinder::initializeHistograms(), lar_cluster3d::Cluster3D::InitializeMonitoring(), larg4::IonizationAndScintillation::IonizationAndScintillation(), opdet::LEDCalibrationAna::LEDCalibrationAna(), evgen::LightSource::LightSource(), evgen::MarleyTimeGen::make_nu_emission_histograms(), evgen::MarleyGen::MarleyGen(), evgen::MarleyTimeGen::MarleyTimeGen(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), cluster::MergeClusterAlg::MergeClusterAlg(), opdet::OpFlashAna::OpFlashAna(), opdet::OpHitAna::OpHitAna(), trkf::PMAlgTrackMaker::PMAlgTrackMaker(), cluster::ClusterMatchAlg::PrepareTTree(), trkf::SeedAna::RecoHists::RecoHists(), trkf::TrackAna::RecoHists::RecoHists(), detsim::SimWire::SetElectResponse(), detsim::SimWire::SetFieldResponse(), phot::PhotonLibrary::StoreLibraryToFile(), trk::TrackContainmentAnalyzer::TrackContainmentAnalyzer(), and trk::TrackContainmentTagger::TrackContainmentTagger().
|
inherited |
make and register a new ROOT object of type T, giving it the specified name and title, using constructor parameters 'args'. The type must be registerable, and must support naming and titling.
Definition at line 91 of file TFileDirectory.h.
References art::TFileDirectory::cd().
Referenced by art::TFileDirectory::makeAndRegister().
|
inherited |
Definition at line 106 of file TFileDirectory.h.
References art::TFileDirectory::makeAndRegister().
|
private |
Definition at line 180 of file TFileService_service.cc.
References closeFile_(), currentGranularity_, filePattern_, fileSwitchCriteria_, fp_, art::ClosingCriteria::granularity(), art::TFileDirectory::invokeCallbacks(), lastClosedFile_, art::detail::logFileAction(), openFile_(), status_, and art::Switching.
Referenced by TFileService().
|
inherited |
Create a new TFileDirectory, sharing the same TFile as this one, but with an additional 'dir', and with 'path' being the fullPath() of this one.
Definition at line 86 of file TFileDirectory.cc.
References art::TFileDirectory::cd(), dir, art::TFileDirectory::file_, and art::TFileDirectory::fullPath().
Referenced by opdet::FIFOHistogramAna::analyze(), trkf::TrackKalmanCheater::beginJob(), trkf::Track3DKalmanHit::beginJob(), trkf::SpacePointAna::bookHistograms(), reco_tool::CandHitMorphological::configure(), reco_tool::CandHitDerivative::configure(), reco_tool::CandHitDerivative::findHitCandidates(), reco_tool::CandHitMorphological::findHitCandidates(), lar_cluster3d::ConvexHullPathFinder::initializeHistograms(), lar_cluster3d::VoronoiPathFinder::initializeHistograms(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), trkf::SeedAna::RecoHists::RecoHists(), and trkf::TrackAna::RecoHists::RecoHists().
|
private |
Definition at line 154 of file TFileService_service.cc.
References beginTime_, art::TFileDirectory::file_, fileNameAtOpen_(), fstats_, art::Open, art::FileStatsCollector::recordFileOpen(), status_, and uniqueFilename_.
Referenced by maybeSwitchFiles_(), and TFileService().
|
privatedelete |
|
protectedinherited |
Definition at line 30 of file TFileDirectory.cc.
References art::TFileDirectory::callbacks_, and art::TFileDirectory::dir_.
Referenced by registerFileSwitchCallback().
void TFileService::registerFileSwitchCallback | ( | Callback_t | c | ) |
Definition at line 119 of file TFileService_service.cc.
References art::TFileDirectory::registerCallback().
void art::TFileService::registerFileSwitchCallback | ( | T * | provider, |
void(T::*)() | f | ||
) |
Definition at line 102 of file TFileService.h.
References DECLARE_ART_SERVICE, f, and art::LEGACY.
|
private |
Definition at line 198 of file TFileService_service.cc.
References beginTime_, DEFINE_ART_SERVICE, art::TFileDirectory::file_, fileSwitchCriteria_, fp_, art::ClosingCriteria::should_close(), art::FileProperties::updateAge(), and art::FileProperties::updateSize().
Referenced by TFileService().
|
private |
Definition at line 125 of file TFileService_service.cc.
References art::TFileDirectory::descr_, art::TFileDirectory::dir_, art::ModuleDescription::moduleLabel(), and art::ModuleDescription::moduleName().
Referenced by TFileService().
|
private |
Definition at line 79 of file TFileService.h.
Referenced by openFile_(), and requestsToCloseFile_().
|
private |
Definition at line 69 of file TFileService.h.
Referenced by closeFile_(), and TFileService().
|
private |
Definition at line 78 of file TFileService.h.
Referenced by maybeSwitchFiles_(), and TFileService().
|
static |
Definition at line 37 of file TFileService.h.
Referenced by fileNameAtOpen_().
|
protectedinherited |
Definition at line 69 of file TFileDirectory.h.
Referenced by art::TFileDirectory::cd(), setDirectoryName_(), and art::TFileDirectory::TFileDirectory().
|
protectedinherited |
Definition at line 68 of file TFileDirectory.h.
Referenced by art::TFileDirectory::cd(), art::TFileDirectory::fullPath(), art::TFileDirectory::invokeCallbacks(), art::TFileDirectory::registerCallback(), setDirectoryName_(), and art::TFileDirectory::TFileDirectory().
|
protectedinherited |
Definition at line 67 of file TFileDirectory.h.
Referenced by art::TFileDirectory::cd(), closeFile_(), art::TFileDirectory::mkdir(), openFile_(), and requestsToCloseFile_().
|
private |
Definition at line 72 of file TFileService.h.
Referenced by fileNameAtClose_(), fileNameAtOpen_(), maybeSwitchFiles_(), and TFileService().
|
private |
Definition at line 83 of file TFileService.h.
Referenced by maybeSwitchFiles_(), requestsToCloseFile_(), and TFileService().
|
private |
Definition at line 85 of file TFileService.h.
Referenced by maybeSwitchFiles_(), requestsToCloseFile_(), and TFileService().
|
private |
Definition at line 71 of file TFileService.h.
Referenced by fileNameAtClose_().
|
private |
Definition at line 70 of file TFileService.h.
Referenced by closeFile_(), openFile_(), and TFileService().
|
private |
Definition at line 77 of file TFileService.h.
Referenced by closeFile_(), and maybeSwitchFiles_().
|
protectedinherited |
Definition at line 70 of file TFileDirectory.h.
Referenced by art::TFileDirectory::cd(), and TFileService().
|
private |
Definition at line 84 of file TFileService.h.
Referenced by closeFile_(), maybeSwitchFiles_(), openFile_(), and TFileService().
|
private |
Definition at line 74 of file TFileService.h.
Referenced by fileNameAtOpen_(), and TFileService().
|
private |
Definition at line 73 of file TFileService.h.
Referenced by closeFile_(), and openFile_().