LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OutputWorker.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_OutputWorker_h
2 #define art_Framework_Core_OutputWorker_h
3 // vim: set sw=2 expandtab :
4 
5 // The OutputModule as the schedule sees it. The job of this object
6 // is to call the output module.
7 //
8 // According to our current definition, a single output module can
9 // only appear in one worker.
10 
14 #include "art/Framework/Core/fwd.h"
20 
21 #include <memory>
22 
23 namespace art {
24  struct OutputModuleDescription;
25  class OutputWorker : public Worker {
26  public:
27  virtual ~OutputWorker();
29 
30  std::string const& lastClosedFileName() const;
31  void closeFile();
32  bool fileIsOpen() const;
34  bool requestsToCloseFile() const;
35  void openFile(FileBlock const& fb);
36  void writeRun(RunPrincipal& rp);
37  void writeSubRun(SubRunPrincipal& srp);
38  void writeEvent(EventPrincipal& ep, PathContext const& pc);
43  void selectProducts(ProductTables const&);
44 
45  private:
46  hep::concurrency::SerialTaskQueueChain* doSerialTaskQueueChain()
47  const override;
48  void doBeginJob(detail::SharedResources const&) override;
49  void doEndJob() override;
50  void doRespondToOpenInputFile(FileBlock const&) override;
51  void doRespondToCloseInputFile(FileBlock const&) override;
52  void doRespondToOpenOutputFiles(FileBlock const&) override;
53  void doRespondToCloseOutputFiles(FileBlock const&) override;
54  void doBegin(RunPrincipal&, ModuleContext const&) override;
55  void doEnd(RunPrincipal&, ModuleContext const&) override;
56  void doBegin(SubRunPrincipal&, ModuleContext const&) override;
57  void doEnd(SubRunPrincipal&, ModuleContext const&) override;
58  bool doProcess(EventPrincipal&, ModuleContext const&) override;
59 
60  // A module is co-owned by one worker per schedule. Only
61  // replicated modules have a one-to-one correspondence with their
62  // worker.
63  cet::exempt_ptr<OutputModule> module_;
67  };
68 } // namespace art
69 
70 #endif /* art_Framework_Core_OutputWorker_h */
71 
72 // Local Variables:
73 // mode: c++
74 // End:
bool doProcess(EventPrincipal &, ModuleContext const &) override
void setRunAuxiliaryRangeSetID(RangeSet const &)
void doRespondToOpenInputFile(FileBlock const &) override
Definition: OutputWorker.cc:53
void doRespondToCloseOutputFiles(FileBlock const &) override
Definition: OutputWorker.cc:71
void openFile(FileBlock const &fb)
std::string const & lastClosedFileName() const
void selectProducts(ProductTables const &)
Granularity fileGranularity_
Definition: OutputWorker.h:66
virtual ~OutputWorker()
void setFileStatus(OutputFileStatus)
bool fileIsOpen() const
OutputFileStatus
void setSubRunAuxiliaryRangeSetID(RangeSet const &)
hep::concurrency::SerialTaskQueueChain * doSerialTaskQueueChain() const override
Definition: OutputWorker.cc:35
void doBegin(RunPrincipal &, ModuleContext const &) override
Definition: OutputWorker.cc:77
cet::exempt_ptr< OutputModule > module_
Definition: OutputWorker.h:63
ActivityRegistry const & actReg_
Definition: OutputWorker.h:65
void doBeginJob(detail::SharedResources const &) override
Definition: OutputWorker.cc:41
void doEndJob() override
Definition: OutputWorker.cc:47
bool requestsToCloseFile() const
void doEnd(RunPrincipal &, ModuleContext const &) override
Definition: OutputWorker.cc:83
TFile fb("Li6.root")
Definition: MVAAlg.h:12
void incrementInputFileNumber()
OutputWorker(OutputModule *mod, WorkerParams const &)
Definition: OutputWorker.cc:18
void doRespondToCloseInputFile(FileBlock const &) override
Definition: OutputWorker.cc:59
void doRespondToOpenOutputFiles(FileBlock const &) override
Definition: OutputWorker.cc:65
void writeEvent(EventPrincipal &ep, PathContext const &pc)
void writeSubRun(SubRunPrincipal &srp)
ServiceHandle< CatalogInterface > ci_
Definition: OutputWorker.h:64
void writeRun(RunPrincipal &rp)
Granularity fileGranularity() const