LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
EDAnalyzer.cc
Go to the documentation of this file.
2 
8 #include "cetlib_except/demangle.h"
10 
11 namespace art {
12 
14  : EventObserverBase{pset}
15  {}
16 
17  bool
19  CPC_exempt_ptr cpc,
20  CountingStatistics& counts)
21  {
23  detail::PVSentry pvSentry{cachedProducts()};
24  Event const e{ep, moduleDescription_, this};
25  if (wantAllEvents() || wantEvent(e)) {
26  // Run is incremented before analyze(e); to properly count
27  // whenever an exception is thrown in the user's module.
28  counts.increment<stats::Run>();
29  analyze(e);
30  counts.increment<stats::Passed>();
31  }
32  return true;
33  }
34 
35  void
37  {
38  auto const& mainID = moduleDescription_.mainParameterSetID();
39  auto const& scheduler_pset =
41  "services.scheduler");
42  prepareForJob(scheduler_pset);
43  beginJob();
44  }
45 
46  void
48  {
49  endJob();
51  }
52 
53  bool
55  {
57  Run const r{rp, moduleDescription_, this};
58  beginRun(r);
59  return true;
60  }
61 
62  bool
64  {
66  Run const r{rp, moduleDescription_, this};
67  endRun(r);
68  return true;
69  }
70 
71  bool
73  {
75  SubRun const sr{srp, moduleDescription_, this};
76  beginSubRun(sr);
77  return true;
78  }
79 
80  bool
82  {
84  SubRun const sr{srp, moduleDescription_, this};
85  endSubRun(sr);
86  return true;
87  }
88 
89  void
91  {
93  }
94 
95  void
97  {
99  }
100 
101  void
103  {
105  }
106 
107  void
109  {
111  }
112 
115  {
116  return current_context_.get();
117  }
118 
119 } // art
fhicl::ParameterSetID const & mainParameterSetID() const
void doBeginJob()
Definition: EDAnalyzer.cc:36
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:96
bool doBeginRun(RunPrincipal const &rp, CPC_exempt_ptr cpc)
Definition: EDAnalyzer.cc:54
virtual void beginRun(Run const &)
Definition: EDAnalyzer.h:144
virtual void analyze(Event const &)=0
void doRespondToCloseOutputFiles(FileBlock const &fb)
Definition: EDAnalyzer.cc:108
void doRespondToOpenOutputFiles(FileBlock const &fb)
Definition: EDAnalyzer.cc:102
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDAnalyzer.h:159
bool wantEvent(Event const &e)
static collection_type const & get() noexcept
virtual void endRun(Run const &)
Definition: EDAnalyzer.h:147
bool doEvent(EventPrincipal const &ep, CPC_exempt_ptr cpc, CountingStatistics &)
Definition: EDAnalyzer.cc:18
bool doEndSubRun(SubRunPrincipal const &srp, CPC_exempt_ptr cpc)
Definition: EDAnalyzer.cc:81
bool doEndRun(RunPrincipal const &rp, CPC_exempt_ptr cpc)
Definition: EDAnalyzer.cc:63
bool doBeginSubRun(SubRunPrincipal const &srp, CPC_exempt_ptr cpc)
Definition: EDAnalyzer.cc:72
Definition: Run.h:30
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:90
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDAnalyzer.h:156
virtual void beginSubRun(SubRun const &)
Definition: EDAnalyzer.h:150
cet::exempt_ptr< CurrentProcessingContext const > CPC_exempt_ptr
Definition: EDAnalyzer.h:120
virtual void respondToOpenOutputFiles(FileBlock const &)
Definition: EDAnalyzer.h:162
TFile fb("Li6.root")
CurrentProcessingContext const * currentContext() const
Definition: EDAnalyzer.cc:114
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
virtual void endJob()
Definition: EDAnalyzer.h:141
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
detail::CachedProducts & cachedProducts()
virtual void endSubRun(SubRun const &)
Definition: EDAnalyzer.h:153
void prepareForJob(fhicl::ParameterSet const &pset)
Definition: Consumer.cc:89
virtual void respondToCloseOutputFiles(FileBlock const &)
Definition: EDAnalyzer.h:165
virtual void beginJob()
Definition: EDAnalyzer.h:138
void showMissingConsumes() const
Definition: Consumer.cc:125
ModuleDescription moduleDescription_
Definition: EDAnalyzer.h:178
HLT enums.
Float_t e
Definition: plot.C:34