Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
art::RootOutput Class Referencefinal
Inheritance diagram for art::RootOutput:
art::OutputModule art::EventObserverBase art::Consumer

Classes

struct  Config
 

Public Types

using Parameters = fhicl::WrappedTable< Config, Config::KeysToIgnore >
 
using ModuleType = OutputModule
 
using WorkerType = OutputWorker
 

Public Member Functions

 RootOutput (Parameters const &)
 
void postSelectProducts () override
 
void beginJob () override
 
void endJob () override
 
void event (EventPrincipal const &) override
 
void beginSubRun (SubRunPrincipal const &) override
 
void endSubRun (SubRunPrincipal const &) override
 
void beginRun (RunPrincipal const &) override
 
void endRun (RunPrincipal const &) override
 
int maxEvents () const
 
int remainingEvents () const
 
bool fileIsOpen () const
 
OutputFileStatus fileStatus () const
 
bool selected (BranchDescription const &) const
 
SelectionsArray const & keptProducts () const
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
BranchChildren const & branchChildren () const
 
void selectProducts (ProductList const &)
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
bool modifiesEvent () const
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Static Public Attributes

static constexpr char const * default_tmpDir {"<parent-path-of-filename>"}
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
ModuleDescription const & description () const
 
detail::CachedProductscachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

std::string fileNameAtOpen () const
 
std::string fileNameAtClose (std::string const &currentFileName)
 
std::string const & lastClosedFileName () const override
 
void openFile (FileBlock const &) override
 
void respondToOpenInputFile (FileBlock const &) override
 
void readResults (ResultsPrincipal const &resp) override
 
void respondToCloseInputFile (FileBlock const &) override
 
void incrementInputFileNumber () override
 
Granularity fileGranularity () const override
 
void write (EventPrincipal &) override
 
void writeSubRun (SubRunPrincipal &) override
 
void writeRun (RunPrincipal &) override
 
void setSubRunAuxiliaryRangeSetID (RangeSet const &) override
 
void setRunAuxiliaryRangeSetID (RangeSet const &) override
 
bool isFileOpen () const override
 
void setFileStatus (OutputFileStatus) override
 
bool requestsToCloseFile () const override
 
void doOpenFile ()
 
void startEndFile () override
 
void writeFileFormatVersion () override
 
void writeFileIndex () override
 
void writeEventHistory () override
 
void writeProcessConfigurationRegistry () override
 
void writeProcessHistoryRegistry () override
 
void writeParameterSetRegistry () override
 
void writeProductDescriptionRegistry () override
 
void writeParentageRegistry () override
 
void doWriteFileCatalogMetadata (FileCatalogMetadata::collection_type const &md, FileCatalogMetadata::collection_type const &ssmd) override
 
void writeProductDependencies () override
 
void finishEndFile () override
 
void doRegisterProducts (MasterProductRegistry &mpr, ProductDescriptions &producedProducts, ModuleDescription const &md) override
 

Private Attributes

std::string const catalog_
 
bool dropAllEvents_ {false}
 
bool dropAllSubRuns_
 
std::string const moduleLabel_
 
bool enableLargeFileCatalogMetadata_ {true}
 
int inputFileCount_ {0}
 
std::unique_ptr< RootOutputFilerootOutputFile_ {nullptr}
 
FileStatsCollector fstats_
 
PostCloseFileRenamer fRenamer_ {fstats_}
 
std::string const filePattern_
 
std::string tmpDir_
 
std::string lastClosedFileName_ {}
 
int const compressionLevel_
 
int64_t const saveMemoryObjectThreshold_
 
int64_t const treeMaxVirtualSize_
 
int const splitLevel_
 
int const basketSize_
 
DropMetaData dropMetaData_
 
bool dropMetaDataForDroppedData_
 
bool fastCloningEnabled_ {true}
 
bool writeParameterSets_
 
ClosingCriteria fileProperties_
 
ProductTable producedResultsProducts_ {}
 
RPManager rpm_
 

Detailed Description

Definition at line 52 of file RootOutput_module.cc.

Member Typedef Documentation

Definition at line 60 of file OutputModule.h.

Definition at line 112 of file RootOutput_module.cc.

Definition at line 61 of file OutputModule.h.

Constructor & Destructor Documentation

art::RootOutput::RootOutput ( Parameters const &  config)
explicit

Definition at line 204 of file RootOutput_module.cc.

References basketSize_, catalog_, compressionLevel_, gen_flatrecord::config, default_tmpDir, dropAllEvents_, dropAllSubRuns_, dropMetaData_, dropMetaDataForDroppedData_, enableLargeFileCatalogMetadata_, fastCloningEnabled_, filePattern_, fileProperties_, fstats_, fhicl::WrappedTable< T, KeysToIgnore >::get_PSet(), moduleLabel_, art::parent_path(), art::EventObserverBase::processName(), rpm_, saveMemoryObjectThreshold_, art::detail::shouldDropEvents(), art::detail::shouldFastClone(), splitLevel_, tmpDir_, treeMaxVirtualSize_, art::detail::validateFileNamePattern(), art::EventObserverBase::wantAllEvents(), and writeParameterSets_.

205  : OutputModule{config().omConfig, config.get_PSet()}
206  , catalog_{config().catalog()}
207  , dropAllSubRuns_{config().dropAllSubRuns()}
208  , moduleLabel_{config.get_PSet().get<string>("module_label")}
209  , enableLargeFileCatalogMetadata_{config().enableLargeFileCatalogMetadata()}
211  , filePattern_{config().omConfig().fileName()}
213  config().tmpDir()}
214  , compressionLevel_{config().compressionLevel()}
215  , saveMemoryObjectThreshold_{config().saveMemoryObjectThreshold()}
216  , treeMaxVirtualSize_{config().treeMaxVirtualSize()}
217  , splitLevel_{config().splitLevel()}
218  , basketSize_{config().basketSize()}
219  , dropMetaData_{config().dropMetaData()}
220  , dropMetaDataForDroppedData_{config().dropMetaDataForDroppedData()}
221  , writeParameterSets_{config().writeParameterSets()}
222  , fileProperties_{(
224  config.get_PSet().has_key(config().fileProperties.name()),
225  filePattern_), // comma operator!
226  config().fileProperties())}
227  , rpm_{config.get_PSet()}
228 {
229  bool const dropAllEventsSet{config().dropAllEvents(dropAllEvents_)};
232 
233  // N.B. Any time file switching is enabled at a boundary other than
234  // InputFile, fastCloningEnabled_ ***MUST*** be deactivated. This is
235  // to ensure that the Event tree from the InputFile is not
236  // accidentally cloned to the output file before the output
237  // module has seen the events that are going to be processed.
238  bool const fastCloningSet{config().fastCloning(fastCloningEnabled_)};
241  if (!writeParameterSets_) {
242  mf::LogWarning("PROVENANCE")
243  << "Output module " << moduleLabel_
244  << " has parameter writeParameterSets set to false.\n"
245  << "Parameter set provenance will not be available in subsequent jobs.\n"
246  << "Check your experiment's policy on this issue to avoid future "
247  "problems\n"
248  << "with analysis reproducibility.\n";
249  }
250 }
std::string const filePattern_
bool shouldDropEvents(bool dropAllEventsSet, bool dropAllEvents, bool dropAllSubRuns)
ClosingCriteria fileProperties_
FileStatsCollector fstats_
std::string const moduleLabel_
void validateFileNamePattern(bool do_check, std::string const &pattern)
static constexpr char const * default_tmpDir
Definition: config.py:1
int64_t const treeMaxVirtualSize_
DropMetaData dropMetaData_
int const compressionLevel_
int64_t const saveMemoryObjectThreshold_
std::string parent_path(std::string const &path)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool shouldFastClone(bool fastCloningSet, bool fastCloning, bool wantAllEvents, ClosingCriteria const &fileProperties)
std::string const catalog_
std::string const & processName() const
OutputModule(OutputModule const &)=delete
bool enableLargeFileCatalogMetadata_

Member Function Documentation

void art::RootOutput::beginJob ( )
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 564 of file RootOutput_module.cc.

References art::ResultsProducer::doBeginJob(), art::RPManager::invoke(), and rpm_.

565 {
567 }
void invoke(invoke_function_t< void, ARGS... > mfunc, ARGS &&...args)
Definition: RPManager.h:65
void art::RootOutput::beginRun ( art::RunPrincipal const &  rp)
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 598 of file RootOutput_module.cc.

References art::ResultsProducer::doBeginRun(), art::RPManager::for_each_RPWorker(), art::RPWorker::rp(), rpm_, and w.

599 {
600  rpm_.for_each_RPWorker([&rp](RPWorker& w) { w.rp().doBeginRun(rp); });
601 }
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
Float_t w
Definition: plot.C:20
void art::RootOutput::beginSubRun ( art::SubRunPrincipal const &  srp)
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 583 of file RootOutput_module.cc.

References art::ResultsProducer::doBeginSubRun(), art::RPManager::for_each_RPWorker(), art::RPWorker::moduleDescription(), art::Consumer::non_module_context(), art::RPWorker::rp(), rpm_, sr, and w.

584 {
585  rpm_.for_each_RPWorker([&srp](RPWorker& w) {
586  SubRun const sr{srp, w.moduleDescription(), Consumer::non_module_context()};
587  w.rp().doBeginSubRun(srp);
588  });
589 }
static cet::exempt_ptr< Consumer > non_module_context()
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
caf::StandardRecord * sr
Float_t w
Definition: plot.C:20
art::BranchChildren const & art::OutputModule::branchChildren ( ) const
inlineinherited

Definition at line 347 of file OutputModule.h.

References art::OutputModule::branchChildren_.

Referenced by art::OutputModule::fileIsOpen().

348 {
349  return branchChildren_;
350 }
BranchChildren branchChildren_
Definition: OutputModule.h:170
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
art::CurrentProcessingContext const * art::OutputModule::currentContext ( ) const
inlineprotectedinherited

Definition at line 303 of file OutputModule.h.

References art::OutputModule::current_context_, and cet::exempt_ptr< Element >::get().

Referenced by art::OutputModule::fileIsOpen().

304 {
305  return current_context_.get();
306 }
pointer get() const noexcept
Definition: exempt_ptr.h:146
cet::exempt_ptr< CurrentProcessingContext const > current_context_
Definition: OutputModule.h:165
art::ModuleDescription const & art::OutputModule::description ( ) const
inlineprotectedinherited

Definition at line 309 of file OutputModule.h.

References art::OutputModule::moduleDescription_.

Referenced by doOpenFile(), art::OutputModule::fileIsOpen(), and startEndFile().

310 {
311  return moduleDescription_;
312 }
ModuleDescription moduleDescription_
Definition: OutputModule.h:164
void art::RootOutput::doOpenFile ( )
private

Definition at line 512 of file RootOutput_module.cc.

References basketSize_, compressionLevel_, art::ModuleDescription::dbEnabled(), art::OutputModule::description(), dropMetaData_, dropMetaDataForDroppedData_, fastCloningEnabled_, fileNameAtOpen(), filePattern_, fileProperties_, fstats_, inputFileCount_, art::detail::logFileAction(), art::errors::LogicError, art::ModuleDescription::parentageEnabled(), art::ModuleDescription::rangesEnabled(), art::FileStatsCollector::recordFileOpen(), rootOutputFile_, saveMemoryObjectThreshold_, splitLevel_, and treeMaxVirtualSize_.

Referenced by openFile().

513 {
514  if (inputFileCount_ == 0) {
516  << "Attempt to open output file before input file. "
517  << "Please report this to the core framework developers.\n";
518  }
520  std::make_unique<RootOutputFile>(this,
521  fileNameAtOpen(),
526  splitLevel_,
527  basketSize_,
533  description().dbEnabled());
535  detail::logFileAction("Opened output file with pattern ", filePattern_);
536 }
bool parentageEnabled() const
std::string const filePattern_
ClosingCriteria fileProperties_
std::string fileNameAtOpen() const
FileStatsCollector fstats_
void logFileAction(const char *msg, std::string const &file)
int64_t const treeMaxVirtualSize_
DropMetaData dropMetaData_
std::unique_ptr< RootOutputFile > rootOutputFile_
int const compressionLevel_
ModuleDescription const & description() const
Definition: OutputModule.h:309
int64_t const saveMemoryObjectThreshold_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void art::RootOutput::doRegisterProducts ( MasterProductRegistry mpr,
ProductDescriptions producedProducts,
ModuleDescription const &  md 
)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 454 of file RootOutput_module.cc.

References art::ModuleDescription::dbEnabled(), art::RPManager::for_each_RPWorker(), art::InResults, art::ModuleDescription::invalidID(), art::RPWorker::moduleDescription(), art::ModuleDescription::moduleLabel(), art::RPWorker::params(), art::ModuleDescription::parentageEnabled(), art::ModuleDescription::processConfiguration(), producedResultsProducts_, art::ModuleDescription::rangesEnabled(), art::ResultsProducer::registerProducts(), art::RPWorker::rp(), rpm_, art::RPWorker::setModuleDescription(), and w.

457 {
458  // Register Results products from ResultsProducers.
459  rpm_.for_each_RPWorker([&mpr, &producedProducts, &md](RPWorker& w) {
460  auto const& params = w.params();
461  w.setModuleDescription(
462  ModuleDescription{params.rpPSetID,
463  params.rpPluginType,
464  md.moduleLabel() + '#' + params.rpLabel,
465  md.processConfiguration(),
466  md.parentageEnabled(),
467  md.rangesEnabled(),
468  md.dbEnabled(),
470  w.rp().registerProducts(mpr, producedProducts, w.moduleDescription());
471  });
472 
473  // Form product table for Results products. We do this here so we
474  // can appropriately set the product tables for the
475  // ResultsPrincipal.
476  producedResultsProducts_ = ProductTable{producedProducts, InResults};
477 }
static constexpr ModuleDescriptionID invalidID()
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
ProductTable producedResultsProducts_
Float_t w
Definition: plot.C:20
void art::RootOutput::doWriteFileCatalogMetadata ( FileCatalogMetadata::collection_type const &  md,
FileCatalogMetadata::collection_type const &  ssmd 
)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 428 of file RootOutput_module.cc.

References fstats_, and rootOutputFile_.

431 {
432  rootOutputFile_->writeFileCatalogMetadata(fstats_, md, ssmd);
433 }
FileStatsCollector fstats_
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::endJob ( )
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 570 of file RootOutput_module.cc.

References art::ResultsProducer::doEndJob(), art::RPManager::invoke(), rpm_, and art::Consumer::showMissingConsumes().

571 {
574 }
void invoke(invoke_function_t< void, ARGS... > mfunc, ARGS &&...args)
Definition: RPManager.h:65
void showMissingConsumes() const
void art::RootOutput::endRun ( art::RunPrincipal const &  rp)
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 604 of file RootOutput_module.cc.

References DEFINE_ART_MODULE(), art::ResultsProducer::doEndRun(), art::RPManager::for_each_RPWorker(), art::RPWorker::rp(), rpm_, and w.

605 {
606  rpm_.for_each_RPWorker([&rp](RPWorker& w) { w.rp().doEndRun(rp); });
607 }
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
Float_t w
Definition: plot.C:20
void art::RootOutput::endSubRun ( art::SubRunPrincipal const &  srp)
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 592 of file RootOutput_module.cc.

References art::ResultsProducer::doEndSubRun(), art::RPManager::for_each_RPWorker(), art::RPWorker::rp(), rpm_, and w.

593 {
594  rpm_.for_each_RPWorker([&srp](RPWorker& w) { w.rp().doEndSubRun(srp); });
595 }
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
Float_t w
Definition: plot.C:20
void art::RootOutput::event ( EventPrincipal const &  ep)
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 577 of file RootOutput_module.cc.

References art::ResultsProducer::doEvent(), art::RPManager::for_each_RPWorker(), art::RPWorker::rp(), rpm_, and w.

578 {
579  rpm_.for_each_RPWorker([&ep](RPWorker& w) { w.rp().doEvent(ep); });
580 }
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
Float_t w
Definition: plot.C:20
art::Granularity art::RootOutput::fileGranularity ( ) const
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 506 of file RootOutput_module.cc.

References fileProperties_, and art::ClosingCriteria::granularity().

507 {
508  return fileProperties_.granularity();
509 }
ClosingCriteria fileProperties_
auto granularity() const
bool art::OutputModule::fileIsOpen ( ) const
inlineinherited
string art::RootOutput::fileNameAtClose ( std::string const &  currentFileName)
private

Definition at line 546 of file RootOutput_module.cc.

References filePattern_, fRenamer_, and art::PostCloseFileRenamer::maybeRenameFile().

Referenced by finishEndFile().

547 {
548  return filePattern_ == dev_null ?
549  dev_null :
550  fRenamer_.maybeRenameFile(currentFileName, filePattern_);
551 }
std::string const filePattern_
PostCloseFileRenamer fRenamer_
std::string maybeRenameFile(std::string const &inPath, std::string const &toPattern)
string art::RootOutput::fileNameAtOpen ( ) const
private

Definition at line 539 of file RootOutput_module.cc.

References filePattern_, tmpDir_, and art::unique_filename().

Referenced by doOpenFile().

540 {
541  return filePattern_ == dev_null ? dev_null :
542  unique_filename(tmpDir_ + "/RootOutput");
543 }
std::string const filePattern_
std::string unique_filename(std::string stem, std::string extension=".root")
OutputFileStatus art::OutputModule::fileStatus ( ) const
inherited
void art::RootOutput::finishEndFile ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 442 of file RootOutput_module.cc.

References art::ResultsProducer::doClear(), fileNameAtClose(), fstats_, art::RPManager::invoke(), lastClosedFileName_, art::detail::logFileAction(), art::FileStatsCollector::recordFileClose(), rootOutputFile_, rpm_, and string.

443 {
444  std::string const currentFileName{rootOutputFile_->currentFileName()};
445  rootOutputFile_->writeTTrees();
446  rootOutputFile_.reset();
448  lastClosedFileName_ = fileNameAtClose(currentFileName);
449  detail::logFileAction("Closed output file ", lastClosedFileName_);
451 }
FileStatsCollector fstats_
void logFileAction(const char *msg, std::string const &file)
std::string lastClosedFileName_
std::unique_ptr< RootOutputFile > rootOutputFile_
void invoke(invoke_function_t< void, ARGS... > mfunc, ARGS &&...args)
Definition: RPManager.h:65
std::string fileNameAtClose(std::string const &currentFileName)
enum BeamMode string
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
auto art::OutputModule::hasNewlyDroppedBranch ( ) const
inlineinherited

Definition at line 340 of file OutputModule.h.

References art::OutputModule::hasNewlyDroppedBranch_.

Referenced by art::OutputModule::fileIsOpen(), startEndFile(), write(), writeRun(), and writeSubRun().

342 {
343  return hasNewlyDroppedBranch_;
344 }
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: OutputModule.h:157
void art::RootOutput::incrementInputFileNumber ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 493 of file RootOutput_module.cc.

References isFileOpen(), and rootOutputFile_.

494 {
495  if (isFileOpen())
496  rootOutputFile_->incrementInputFileNumber();
497 }
bool isFileOpen() const override
std::unique_ptr< RootOutputFile > rootOutputFile_
bool art::RootOutput::isFileOpen ( ) const
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 487 of file RootOutput_module.cc.

References rootOutputFile_.

Referenced by incrementInputFileNumber(), openFile(), postSelectProducts(), requestsToCloseFile(), respondToCloseInputFile(), respondToOpenInputFile(), and setFileStatus().

488 {
489  return rootOutputFile_.get() != nullptr;
490 }
std::unique_ptr< RootOutputFile > rootOutputFile_
auto art::OutputModule::keptProducts ( ) const
inlineinherited

Definition at line 334 of file OutputModule.h.

References art::OutputModule::keptProducts_.

Referenced by art::OutputModule::fileIsOpen().

335 {
336  return keptProducts_;
337 }
SelectionsArray keptProducts_
Definition: OutputModule.h:156
string const & art::RootOutput::lastClosedFileName ( ) const
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 554 of file RootOutput_module.cc.

References lastClosedFileName_, and art::errors::LogicError.

555 {
556  if (lastClosedFileName_.empty()) {
557  throw Exception(errors::LogicError, "RootOutput::currentFileName(): ")
558  << "called before meaningful.\n";
559  }
560  return lastClosedFileName_;
561 }
std::string lastClosedFileName_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
int art::OutputModule::maxEvents ( ) const
inlineinherited

Definition at line 315 of file OutputModule.h.

References art::OutputModule::maxEvents_.

316 {
317  return maxEvents_;
318 }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::RootOutput::openFile ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 253 of file RootOutput_module.cc.

References doOpenFile(), isFileOpen(), and respondToOpenInputFile().

254 {
255  // Note: The file block here refers to the currently open input
256  // file, so we can find out about the available products by
257  // looping over the branches of the input file data trees.
258  if (!isFileOpen()) {
259  doOpenFile();
261  }
262 }
bool isFileOpen() const override
void respondToOpenInputFile(FileBlock const &) override
void art::RootOutput::postSelectProducts ( )
overridevirtual

Reimplemented from art::OutputModule.

Definition at line 265 of file RootOutput_module.cc.

References isFileOpen(), and rootOutputFile_.

266 {
267  if (isFileOpen()) {
268  rootOutputFile_->selectProducts();
269  }
270 }
bool isFileOpen() const override
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited

Definition at line 41 of file EventObserverBase.h.

References art::EventObserverBase::process_name_.

Referenced by art::FileDumperOutput::printPrincipal(), and RootOutput().

42  {
43  return process_name_;
44  }
void art::RootOutput::readResults ( ResultsPrincipal const &  resp)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 301 of file RootOutput_module.cc.

References art::ResultsProducer::doReadResults(), art::RPManager::for_each_RPWorker(), art::RPWorker::rp(), rpm_, and w.

302 {
303  rpm_.for_each_RPWorker([&resp](RPWorker& w) { w.rp().doReadResults(resp); });
304 }
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
Float_t w
Definition: plot.C:20
void art::OutputModule::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inherited
int art::OutputModule::remainingEvents ( ) const
inlineinherited

Definition at line 321 of file OutputModule.h.

References art::OutputModule::remainingEvents_.

Referenced by respondToOpenInputFile().

322 {
323  return remainingEvents_;
324 }
bool art::RootOutput::requestsToCloseFile ( ) const
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 500 of file RootOutput_module.cc.

References isFileOpen(), and rootOutputFile_.

501 {
502  return isFileOpen() ? rootOutputFile_->requestsToCloseFile() : false;
503 }
bool isFileOpen() const override
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::respondToCloseInputFile ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 307 of file RootOutput_module.cc.

References isFileOpen(), and rootOutputFile_.

308 {
309  if (isFileOpen()) {
310  rootOutputFile_->respondToCloseInputFile(fb);
311  }
312 }
bool isFileOpen() const override
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::respondToOpenInputFile ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 273 of file RootOutput_module.cc.

References submit_syst::const, fastCloningEnabled_, fb, art::FileBlock::fileName(), fstats_, inputFileCount_, isFileOpen(), art::FileStatsCollector::recordInputFile(), art::OutputModule::remainingEvents(), and rootOutputFile_.

Referenced by openFile().

274 {
275  ++inputFileCount_;
276  if (!isFileOpen())
277  return;
278 
279  auto const* rfb = dynamic_cast<RootFileBlock const*>(&fb);
280 
281  bool fastCloneThisOne = fastCloningEnabled_ && rfb &&
282  (rfb->tree() != nullptr) &&
283  ((remainingEvents() < 0) ||
284  (remainingEvents() >= rfb->tree()->GetEntries()));
285  if (fastCloningEnabled_ && !fastCloneThisOne) {
286  mf::LogWarning("FastCloning")
287  << "Fast cloning deactivated for this input file due to "
288  << "empty event tree and/or event limits.";
289  }
290  if (fastCloneThisOne && !rfb->fastClonable()) {
291  mf::LogWarning("FastCloning")
292  << "Fast cloning deactivated for this input file due to "
293  << "information in FileBlock.";
294  fastCloneThisOne = false;
295  }
296  rootOutputFile_->beginInputFile(rfb, fastCloneThisOne);
297  fstats_.recordInputFile(fb.fileName());
298 }
FileStatsCollector fstats_
bool isFileOpen() const override
std::unique_ptr< RootOutputFile > rootOutputFile_
void recordInputFile(std::string const &inputFileName)
int remainingEvents() const
Definition: OutputModule.h:321
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool art::OutputModule::selected ( BranchDescription const &  pd) const
inlineinherited

Definition at line 327 of file OutputModule.h.

References ana::assert(), and art::OutputModule::groupSelector_.

Referenced by art::OutputModule::fileIsOpen().

328 {
330  return groupSelector_->selected(pd);
331 }
std::unique_ptr< GroupSelector const > groupSelector_
Definition: OutputModule.h:160
assert(nhit_max >=nhit_nbins)
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::OutputModule::selectProducts ( ProductList const &  )
inherited
void art::RootOutput::setFileStatus ( OutputFileStatus  ofs)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 480 of file RootOutput_module.cc.

References isFileOpen(), and rootOutputFile_.

481 {
482  if (isFileOpen())
483  rootOutputFile_->setFileStatus(ofs);
484 }
bool isFileOpen() const override
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::setRunAuxiliaryRangeSetID ( RangeSet const &  rs)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 347 of file RootOutput_module.cc.

References rootOutputFile_.

348 {
349  rootOutputFile_->setRunAuxiliaryRangeSetID(rs);
350 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::setSubRunAuxiliaryRangeSetID ( RangeSet const &  rs)
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 328 of file RootOutput_module.cc.

References rootOutputFile_.

329 {
330  rootOutputFile_->setSubRunAuxiliaryRangeSetID(rs);
331 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by endJob().

void art::RootOutput::startEndFile ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 363 of file RootOutput_module.cc.

References art::OutputModule::description(), art::ResultsProducer::doWriteResults(), art::RPManager::for_each_RPWorker(), art::OutputModule::hasNewlyDroppedBranch(), art::InResults, art::ProductMetaData::instance(), art::ModuleDescription::processConfiguration(), producedResultsProducts_, rootOutputFile_, art::RPWorker::rp(), rpm_, and w.

364 {
365  auto resp = std::make_unique<ResultsPrincipal>(
366  ResultsAuxiliary{}, description().processConfiguration(), nullptr);
367  resp->setProducedProducts(producedResultsProducts_);
368  if (ProductMetaData::instance().productProduced(InResults) ||
370  resp->addToProcessHistory();
371  }
373  [&resp](RPWorker& w) { w.rp().doWriteResults(*resp); });
374  rootOutputFile_->writeResults(*resp);
375 }
void for_each_RPWorker(on_rpworker_t wfunc)
Definition: RPManager.h:75
static ProductMetaData const & instance()
ProductTable producedResultsProducts_
std::unique_ptr< RootOutputFile > rootOutputFile_
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: OutputModule.h:340
ModuleDescription const & description() const
Definition: OutputModule.h:309
Float_t w
Definition: plot.C:20
ProcessConfiguration const & processConfiguration() const
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
void art::RootOutput::write ( EventPrincipal ep)
overrideprivatevirtual

Implements art::OutputModule.

Definition at line 315 of file RootOutput_module.cc.

References art::Principal::addToProcessHistory(), dropAllEvents_, fstats_, art::OutputModule::hasNewlyDroppedBranch(), art::EventPrincipal::id(), art::InEvent, art::FileStatsCollector::recordEvent(), and rootOutputFile_.

316 {
317  if (dropAllEvents_) {
318  return;
319  }
321  ep.addToProcessHistory();
322  }
323  rootOutputFile_->writeOne(ep);
324  fstats_.recordEvent(ep.id());
325 }
FileStatsCollector fstats_
void recordEvent(EventID const &id)
std::unique_ptr< RootOutputFile > rootOutputFile_
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: OutputModule.h:340
void art::RootOutput::writeEventHistory ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 390 of file RootOutput_module.cc.

References rootOutputFile_.

391 {
392  rootOutputFile_->writeEventHistory();
393 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeFileFormatVersion ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 378 of file RootOutput_module.cc.

References rootOutputFile_.

379 {
380  rootOutputFile_->writeFileFormatVersion();
381 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeFileIndex ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 384 of file RootOutput_module.cc.

References rootOutputFile_.

385 {
386  rootOutputFile_->writeFileIndex();
387 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeParameterSetRegistry ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 408 of file RootOutput_module.cc.

References rootOutputFile_, and writeParameterSets_.

409 {
410  if (writeParameterSets_) {
411  rootOutputFile_->writeParameterSetRegistry();
412  }
413 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeParentageRegistry ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 422 of file RootOutput_module.cc.

References rootOutputFile_.

423 {
424  rootOutputFile_->writeParentageRegistry();
425 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeProcessConfigurationRegistry ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 396 of file RootOutput_module.cc.

References rootOutputFile_.

397 {
398  rootOutputFile_->writeProcessConfigurationRegistry();
399 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeProcessHistoryRegistry ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 402 of file RootOutput_module.cc.

References rootOutputFile_.

403 {
404  rootOutputFile_->writeProcessHistoryRegistry();
405 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeProductDependencies ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 436 of file RootOutput_module.cc.

References rootOutputFile_.

437 {
438  rootOutputFile_->writeProductDependencies();
439 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeProductDescriptionRegistry ( )
overrideprivatevirtual

Reimplemented from art::OutputModule.

Definition at line 416 of file RootOutput_module.cc.

References rootOutputFile_.

417 {
418  rootOutputFile_->writeProductDescriptionRegistry();
419 }
std::unique_ptr< RootOutputFile > rootOutputFile_
void art::RootOutput::writeRun ( RunPrincipal r)
overrideprivatevirtual

Implements art::OutputModule.

Definition at line 353 of file RootOutput_module.cc.

References art::Principal::addToProcessHistory(), fstats_, art::OutputModule::hasNewlyDroppedBranch(), art::RunPrincipal::id(), art::InRun, art::FileStatsCollector::recordRun(), and rootOutputFile_.

354 {
355  if (hasNewlyDroppedBranch()[InRun]) {
356  r.addToProcessHistory();
357  }
358  rootOutputFile_->writeRun(r);
359  fstats_.recordRun(r.id());
360 }
void recordRun(RunID const &id)
FileStatsCollector fstats_
std::unique_ptr< RootOutputFile > rootOutputFile_
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: OutputModule.h:340
TRandom3 r(0)
void art::RootOutput::writeSubRun ( SubRunPrincipal sr)
overrideprivatevirtual

Implements art::OutputModule.

Definition at line 334 of file RootOutput_module.cc.

References art::Principal::addToProcessHistory(), dropAllSubRuns_, fstats_, art::OutputModule::hasNewlyDroppedBranch(), art::SubRunPrincipal::id(), art::InSubRun, art::FileStatsCollector::recordSubRun(), and rootOutputFile_.

335 {
336  if (dropAllSubRuns_) {
337  return;
338  }
340  sr.addToProcessHistory();
341  }
342  rootOutputFile_->writeSubRun(sr);
343  fstats_.recordSubRun(sr.id());
344 }
FileStatsCollector fstats_
std::unique_ptr< RootOutputFile > rootOutputFile_
void recordSubRun(SubRunID const &id)
caf::StandardRecord * sr
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: OutputModule.h:340

Member Data Documentation

int const art::RootOutput::basketSize_
private

Definition at line 185 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

std::string const art::RootOutput::catalog_
private

Definition at line 167 of file RootOutput_module.cc.

Referenced by RootOutput().

int const art::RootOutput::compressionLevel_
private

Definition at line 181 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

constexpr char const* art::RootOutput::default_tmpDir {"<parent-path-of-filename>"}
static

Definition at line 54 of file RootOutput_module.cc.

Referenced by RootOutput().

bool art::RootOutput::dropAllEvents_ {false}
private

Definition at line 168 of file RootOutput_module.cc.

Referenced by RootOutput(), and write().

bool art::RootOutput::dropAllSubRuns_
private

Definition at line 169 of file RootOutput_module.cc.

Referenced by RootOutput(), and writeSubRun().

DropMetaData art::RootOutput::dropMetaData_
private

Definition at line 186 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

bool art::RootOutput::dropMetaDataForDroppedData_
private

Definition at line 187 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

bool art::RootOutput::enableLargeFileCatalogMetadata_ {true}
private

Definition at line 171 of file RootOutput_module.cc.

Referenced by RootOutput().

bool art::RootOutput::fastCloningEnabled_ {true}
private

Definition at line 191 of file RootOutput_module.cc.

Referenced by doOpenFile(), respondToOpenInputFile(), and RootOutput().

std::string const art::RootOutput::filePattern_
private

Definition at line 176 of file RootOutput_module.cc.

Referenced by doOpenFile(), fileNameAtClose(), fileNameAtOpen(), and RootOutput().

ClosingCriteria art::RootOutput::fileProperties_
private

Definition at line 197 of file RootOutput_module.cc.

Referenced by doOpenFile(), fileGranularity(), and RootOutput().

PostCloseFileRenamer art::RootOutput::fRenamer_ {fstats_}
private

Definition at line 175 of file RootOutput_module.cc.

Referenced by fileNameAtClose().

FileStatsCollector art::RootOutput::fstats_
private
int art::RootOutput::inputFileCount_ {0}
private

Definition at line 172 of file RootOutput_module.cc.

Referenced by doOpenFile(), and respondToOpenInputFile().

std::string art::RootOutput::lastClosedFileName_ {}
private

Definition at line 178 of file RootOutput_module.cc.

Referenced by finishEndFile(), and lastClosedFileName().

std::string const art::RootOutput::moduleLabel_
private

Definition at line 170 of file RootOutput_module.cc.

Referenced by RootOutput().

ProductTable art::RootOutput::producedResultsProducts_ {}
private

Definition at line 200 of file RootOutput_module.cc.

Referenced by doRegisterProducts(), and startEndFile().

std::unique_ptr<RootOutputFile> art::RootOutput::rootOutputFile_ {nullptr}
private
RPManager art::RootOutput::rpm_
private
int64_t const art::RootOutput::saveMemoryObjectThreshold_
private

Definition at line 182 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

int const art::RootOutput::splitLevel_
private

Definition at line 184 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

std::string art::RootOutput::tmpDir_
private

Definition at line 177 of file RootOutput_module.cc.

Referenced by fileNameAtOpen(), and RootOutput().

int64_t const art::RootOutput::treeMaxVirtualSize_
private

Definition at line 183 of file RootOutput_module.cc.

Referenced by doOpenFile(), and RootOutput().

bool art::RootOutput::writeParameterSets_
private

Definition at line 196 of file RootOutput_module.cc.

Referenced by RootOutput(), and writeParameterSetRegistry().


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