LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
calo::CaloChecker Class Reference
Inheritance diagram for calo::CaloChecker:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 CaloChecker (fhicl::ParameterSet const &config)
 
void analyze (const art::Event &evt) override
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

std::vector< std::string > fCaloLabels
 
std::string fTrackLabel
 

Detailed Description

Definition at line 45 of file CaloChecker_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

calo::CaloChecker::CaloChecker ( fhicl::ParameterSet const &  config)
explicit

Definition at line 57 of file CaloChecker_module.cc.

References fCaloLabels, and fTrackLabel.

58  : EDAnalyzer{config}
59  , fCaloLabels(config.get<std::vector<std::string>>("CaloLabels"))
60  , fTrackLabel(config.get<std::string>("TrackLabel"))
61 {
62  assert(fCaloLabels.size() >= 2);
63 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
std::vector< std::string > fCaloLabels

Member Function Documentation

void calo::CaloChecker::analyze ( const art::Event evt)
override

Definition at line 65 of file CaloChecker_module.cc.

References util::abs(), DEFINE_ART_MODULE, e, fCaloLabels, art::fill_ptr_vector(), fTrackLabel, art::ProductRetriever::getByLabel(), X, Y, and Z.

66 {
68  std::vector<art::Ptr<recob::Track>> tracklist;
69  if (evt.getByLabel(fTrackLabel, trackListHandle)) {
70  art::fill_ptr_vector(tracklist, trackListHandle);
71  }
72 
73  std::vector<art::FindManyP<anab::Calorimetry>> calos;
74  for (const std::string& l : fCaloLabels) {
75  calos.emplace_back(tracklist, evt, l);
76  }
77 
78  float EPS = 1e-3;
79 
80  for (unsigned trk_i = 0; trk_i < tracklist.size(); trk_i++) {
81  std::vector<art::Ptr<anab::Calorimetry>> base = calos[0].at(trk_i);
82 
83  std::cout << "New Track!\n";
84  std::cout << "Base calo (" << fCaloLabels[0] << ") n calo: " << base.size() << std::endl;
85  for (unsigned plane = 0; plane < base.size(); plane++) {
86  std::cout << "N points on plane (" << plane << ") ID (" << base[plane]->PlaneID()
87  << ") n points: " << base[plane]->dEdx().size() << std::endl;
88  }
89 
90  for (unsigned i = 1; i < fCaloLabels.size(); i++) {
91  bool equal = true;
92  std::vector<art::Ptr<anab::Calorimetry>> othr = calos[i].at(trk_i);
93  if (base.size() != othr.size()) {
94  equal = false;
95  std::cout << "Track: " << trk_i << " calo (" << fCaloLabels[0] << ") has (" << base.size()
96  << "). Calo (" << fCaloLabels[i] << ") has size (" << othr.size() << ") mismatch."
97  << std::endl;
98  }
99 
100  for (unsigned plane = 0; plane < base.size(); plane++) {
101  // check plane index
102  if (base[plane]->PlaneID() != othr[plane]->PlaneID()) {
103  equal = false;
104  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
105  << ") plane " << plane << ": ";
106  std::cout << "Plane ID mismatch (" << base[plane]->PlaneID() << ") ("
107  << othr[plane]->PlaneID() << ")" << std::endl;
108  }
109 
110  // check the range
111  if (abs(base[plane]->Range() - othr[plane]->Range()) > EPS) {
112  equal = false;
113  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
114  << ") plane " << plane << ": ";
115  std::cout << "Range mismatch (" << base[plane]->Range() << ") (" << othr[plane]->Range()
116  << ")" << std::endl;
117  }
118 
119  // check the kinetic energy
120  if (abs(base[plane]->KineticEnergy() - othr[plane]->KineticEnergy()) > EPS) {
121  equal = false;
122  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
123  << ") plane " << plane << ": ";
124  std::cout << "KineticEnergy mismatch (" << base[plane]->KineticEnergy() << ") ("
125  << othr[plane]->KineticEnergy() << ")" << std::endl;
126  }
127 
128  // check dE dx
129  const std::vector<float>& base_dedx = base[plane]->dEdx();
130  const std::vector<float>& othr_dedx = othr[plane]->dEdx();
131 
132  if (base_dedx.size() == othr_dedx.size()) {
133  for (unsigned i_dedx = 0; i_dedx < base_dedx.size(); i_dedx++) {
134  if (abs(base_dedx[i_dedx] - othr_dedx[i_dedx]) > EPS) {
135  equal = false;
136  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
137  << fCaloLabels[i] << ") plane " << plane << ": ";
138  std::cout << "dEdx mismatch at index: " << i_dedx << " (" << base_dedx[i_dedx]
139  << ") (" << othr_dedx[i_dedx] << ")" << std::endl;
140  }
141  }
142  }
143  else {
144  equal = false;
145  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
146  << ") plane " << plane << ": "
147  << "dEdx size mismatch (" << base_dedx.size() << ") (" << othr_dedx.size()
148  << ")" << std::endl;
149  }
150 
151  // check dQdx
152  const std::vector<float>& base_dqdx = base[plane]->dQdx();
153  const std::vector<float>& othr_dqdx = othr[plane]->dQdx();
154 
155  if (base_dqdx.size() == othr_dqdx.size()) {
156  for (unsigned i_dqdx = 0; i_dqdx < base_dqdx.size(); i_dqdx++) {
157  if (abs(base_dqdx[i_dqdx] - othr_dqdx[i_dqdx]) > EPS) {
158  equal = false;
159  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
160  << fCaloLabels[i] << ") plane " << plane << ": ";
161  std::cout << "dQdx mismatch at index: " << i_dqdx << " (" << base_dqdx[i_dqdx]
162  << ") (" << othr_dqdx[i_dqdx] << ")" << std::endl;
163  }
164  }
165  }
166  else {
167  equal = false;
168  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
169  << ") plane " << plane << ": "
170  << "dQdx size mismatch (" << base_dqdx.size() << ") (" << othr_dqdx.size()
171  << ")" << std::endl;
172  }
173 
174  // check Residual Range
175  const std::vector<float>& base_rr = base[plane]->ResidualRange();
176  const std::vector<float>& othr_rr = othr[plane]->ResidualRange();
177 
178  if (base_rr.size() == othr_rr.size()) {
179  for (unsigned i_rr = 0; i_rr < base_rr.size(); i_rr++) {
180  if (abs(base_rr[i_rr] - othr_rr[i_rr]) > EPS) {
181  equal = false;
182  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
183  << fCaloLabels[i] << ") plane " << plane << ": ";
184  std::cout << "ResidualRange mismatch at index: " << i_rr << " (" << base_rr[i_rr]
185  << ") (" << othr_rr[i_rr] << ")" << std::endl;
186  }
187  }
188  }
189  else {
190  equal = false;
191  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
192  << ") plane " << plane << ": "
193  << "ResidualRange size mismatch (" << base_rr.size() << ") (" << othr_rr.size()
194  << ")" << std::endl;
195  }
196 
197  // check DeadWireRC
198  const std::vector<float>& base_dwrr = base[plane]->DeadWireResRC();
199  const std::vector<float>& othr_dwrr = othr[plane]->DeadWireResRC();
200 
201  if (base_dwrr.size() == othr_dwrr.size()) {
202  for (unsigned i_dwrr = 0; i_dwrr < base_dwrr.size(); i_dwrr++) {
203  if (abs(base_dwrr[i_dwrr] - othr_dwrr[i_dwrr]) > EPS) {
204  equal = false;
205  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
206  << fCaloLabels[i] << ") plane " << plane << ": ";
207  std::cout << "DeadWireResRC mismatch at index: " << i_dwrr << " ("
208  << base_dwrr[i_dwrr] << ") (" << othr_dwrr[i_dwrr] << ")" << std::endl;
209  }
210  }
211  }
212  else {
213  equal = false;
214  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
215  << ") plane " << plane << ": "
216  << "DeadWireResRC size mismatch (" << base_dwrr.size() << ") ("
217  << othr_dwrr.size() << ")" << std::endl;
218  }
219 
220  // check Track Pitch
221  const std::vector<float>& base_tpv = base[plane]->TrkPitchVec();
222  const std::vector<float>& othr_tpv = othr[plane]->TrkPitchVec();
223 
224  if (base_tpv.size() == othr_tpv.size()) {
225  for (unsigned i_tpv = 0; i_tpv < base_tpv.size(); i_tpv++) {
226  if (abs(base_tpv[i_tpv] - othr_tpv[i_tpv]) > EPS) {
227  equal = false;
228  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
229  << fCaloLabels[i] << ") plane " << plane << ": ";
230  std::cout << "TrkPitchVec mismatch at index: " << i_tpv << " (" << base_tpv[i_tpv]
231  << ") (" << othr_tpv[i_tpv] << ")" << std::endl;
232  }
233  }
234  }
235  else {
236  equal = false;
237  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
238  << ") plane " << plane << ": "
239  << "TrkPitchVec size mismatch (" << base_tpv.size() << ") (" << othr_tpv.size()
240  << ")" << std::endl;
241  }
242 
243  // check TP Indices
244  const std::vector<size_t>& base_tpi = base[plane]->TpIndices();
245  const std::vector<size_t>& othr_tpi = othr[plane]->TpIndices();
246 
247  if (base_tpi.size() == othr_tpi.size()) {
248  for (unsigned i_tpi = 0; i_tpi < base_tpi.size(); i_tpi++) {
249  if (base_tpi[i_tpi] != othr_tpi[i_tpi]) {
250  equal = false;
251  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
252  << fCaloLabels[i] << ") plane " << plane << ": ";
253  std::cout << "TpIndices mismatch at index: " << i_tpi << " (" << base_tpi[i_tpi]
254  << ") (" << othr_tpi[i_tpi] << ")" << std::endl;
255  }
256  }
257  }
258  else {
259  equal = false;
260  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
261  << ") plane " << plane << ": "
262  << "TpIndices size mismatch (" << base_tpi.size() << ") (" << othr_tpi.size()
263  << ")" << std::endl;
264  }
265 
266  // check XYZ
267  const std::vector<geo::Point_t>& base_xyz = base[plane]->XYZ();
268  const std::vector<geo::Point_t>& othr_xyz = othr[plane]->XYZ();
269 
270  if (base_xyz.size() == othr_xyz.size()) {
271  for (unsigned i_xyz = 0; i_xyz < base_xyz.size(); i_xyz++) {
272  if (abs(base_xyz[i_xyz].X() - othr_xyz[i_xyz].X()) > EPS ||
273  abs(base_xyz[i_xyz].Y() - othr_xyz[i_xyz].Y()) > EPS ||
274  abs(base_xyz[i_xyz].Z() - othr_xyz[i_xyz].Z()) > EPS) {
275  equal = false;
276  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") ("
277  << fCaloLabels[i] << ") plane " << plane << ": ";
278  std::cout << "XYZ mismatch at index: " << i_xyz;
279  std::cout << "X (" << base_xyz[i_xyz].X() << ") (" << othr_xyz[i_xyz].X() << ") ";
280  std::cout << "Y (" << base_xyz[i_xyz].Y() << ") (" << othr_xyz[i_xyz].Y() << ") ";
281  std::cout << "Z (" << base_xyz[i_xyz].Z() << ") (" << othr_xyz[i_xyz].Z() << ") "
282  << std::endl;
283  }
284  }
285  }
286  else {
287  equal = false;
288  std::cout << "Track: " << trk_i << " calos (" << fCaloLabels[0] << ") (" << fCaloLabels[i]
289  << ") plane " << plane << ": "
290  << "XYZ size mismatch (" << base_xyz.size() << ") (" << othr_xyz.size() << ")"
291  << std::endl;
292  }
293  }
294 
295  if (equal) {
296  std::cout << "Track: " << trk_i << " calo (" << fCaloLabels[0] << ") is equal to calo ("
297  << fCaloLabels[i] << ")" << std::endl;
298  }
299  }
300  }
301 }
Float_t Y
Definition: plot.C:37
constexpr auto abs(T v)
Returns the absolute value of the argument.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
Float_t Z
Definition: plot.C:37
std::vector< std::string > fCaloLabels
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:306
Float_t e
Definition: plot.C:35
Float_t X
Definition: plot.C:37
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

std::vector<std::string> calo::CaloChecker::fCaloLabels
private

Definition at line 51 of file CaloChecker_module.cc.

Referenced by analyze(), and CaloChecker().

std::string calo::CaloChecker::fTrackLabel
private

Definition at line 52 of file CaloChecker_module.cc.

Referenced by analyze(), and CaloChecker().


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