LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
EDFilter.cc
Go to the documentation of this file.
2 
12 #include "cetlib_except/demangle.h"
14 
15 namespace art {
16 
17  bool
19  CPC_exempt_ptr cpc,
20  CountingStatistics& counts)
21  {
23  Event e{ep, moduleDescription_, this};
24  counts.increment<stats::Run>();
25  bool const rc = filter(e);
26  e.commit(ep, checkPutProducts_, expectedProducts<InEvent>());
27  counts.update(rc);
28  return rc;
29  }
30 
31  void
33  {
34  // 'checkPutProducts_' cannot be set during the c'tor
35  // initialization list since 'moduleDescription_' is empty there.
36  auto const& mainID = moduleDescription_.mainParameterSetID();
37  auto const& scheduler_pset =
39  "services.scheduler");
40  auto const& module_pset =
43  detail::get_failureToPut_flag(scheduler_pset, module_pset);
44  prepareForJob(scheduler_pset);
45  beginJob();
46  }
47 
48  void
50  {
51  endJob();
53  }
54 
55  bool
57  {
59  Run r{rp, moduleDescription_, this, RangeSet::forRun(rp.id())};
60  bool const rc = beginRun(r);
61  r.commit(rp);
62  return rc;
63  }
64 
65  bool
67  {
69  Run r{rp, moduleDescription_, this, rp.seenRanges()};
70  bool const rc = endRun(r);
71  r.commit(rp);
72  return rc;
73  }
74 
75  bool
77  {
79  SubRun sr{srp, moduleDescription_, this, RangeSet::forSubRun(srp.id())};
80  bool const rc = beginSubRun(sr);
81  sr.commit(srp);
82  return rc;
83  }
84 
85  bool
87  {
89  SubRun sr{srp, moduleDescription_, this, srp.seenRanges()};
90  bool const rc = endSubRun(sr);
91  sr.commit(srp);
92  return rc;
93  }
94 
95  void
97  {
99  }
100 
101  void
103  {
105  }
106 
107  void
109  {
111  }
112 
113  void
115  {
117  }
118 
121  {
122  return current_context_.get();
123  }
124 
125 } // art
fhicl::ParameterSetID const & mainParameterSetID() const
virtual void endJob()
Definition: EDFilter.h:79
bool doEvent(EventPrincipal &ep, CPC_exempt_ptr cpc, CountingStatistics &)
Definition: EDFilter.cc:18
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDFilter.cc:102
virtual void respondToOpenOutputFiles(FileBlock const &)
Definition: EDFilter.h:108
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDFilter.cc:96
CurrentProcessingContext const * currentContext() const
Definition: EDFilter.cc:120
static collection_type const & get() noexcept
void doEndJob()
Definition: EDFilter.cc:49
void doRespondToOpenOutputFiles(FileBlock const &fb)
Definition: EDFilter.cc:108
virtual bool filter(Event &)=0
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDFilter.h:105
virtual bool endSubRun(SubRun &)
Definition: EDFilter.h:97
cet::exempt_ptr< CurrentProcessingContext const > CPC_exempt_ptr
Definition: EDFilter.h:54
Definition: Run.h:30
bool checkPutProducts_
Definition: EDFilter.h:126
RangeSet seenRanges() const override
bool doEndSubRun(SubRunPrincipal &srp, CPC_exempt_ptr cpc)
Definition: EDFilter.cc:86
SubRunID id() const
CPC_exempt_ptr current_context_
Definition: EDFilter.h:125
TFile fb("Li6.root")
fhicl::ParameterSetID const & parameterSetID() const
bool doEndRun(RunPrincipal &rp, CPC_exempt_ptr cpc)
Definition: EDFilter.cc:66
RangeSet seenRanges() const override
Definition: RunPrincipal.h:87
static RangeSet forRun(RunID)
Definition: RangeSet.cc:52
virtual void respondToCloseOutputFiles(FileBlock const &)
Definition: EDFilter.h:111
void doBeginJob()
Definition: EDFilter.cc:32
virtual bool beginSubRun(SubRun &)
Definition: EDFilter.h:92
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:58
virtual bool beginRun(Run &)
Definition: EDFilter.h:82
RunID const & id() const
Definition: RunPrincipal.h:46
void prepareForJob(fhicl::ParameterSet const &pset)
Definition: Consumer.cc:89
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDFilter.h:102
void doRespondToCloseOutputFiles(FileBlock const &fb)
Definition: EDFilter.cc:114
virtual bool endRun(Run &)
Definition: EDFilter.h:87
void showMissingConsumes() const
Definition: Consumer.cc:125
HLT enums.
virtual void beginJob()
Definition: EDFilter.h:76
bool get_failureToPut_flag(fhicl::ParameterSet const &scheduler_pset, fhicl::ParameterSet const &module_pset)
Float_t e
Definition: plot.C:34
void update(bool const rc)
bool doBeginSubRun(SubRunPrincipal &srp, CPC_exempt_ptr cpc)
Definition: EDFilter.cc:76
bool doBeginRun(RunPrincipal &rp, CPC_exempt_ptr cpc)
Definition: EDFilter.cc:56