LArSoft  v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
HitCreator.cxx
Go to the documentation of this file.
1 
10 // declaration header
12 
13 // C/C++ standard library
14 #include <algorithm> // std::accumulate(), std::max()
15 #include <cassert>
16 #include <limits> // std::numeric_limits<>
17 #include <utility> // std::move()
18 
19 // art libraries
24 
25 // LArSoft libraries
30 
31 namespace {
32 
34  template <typename Left, typename Right, typename Metadata>
35  void ClearAssociations(art::Assns<Left, Right, Metadata>& assns)
36  {
38  assns.swap(empty);
39  } // ClearAssociations()
40 
41 } // local namespace
42 
44 namespace recob {
45 
46  //****************************************************************************
47  //*** HitCreator
48  //----------------------------------------------------------------------
50  geo::WireID const& wireID,
51  raw::TDCtick_t start_tick,
52  raw::TDCtick_t end_tick,
53  float rms,
54  float peak_time,
55  float sigma_peak_time,
56  float peak_amplitude,
57  float sigma_peak_amplitude,
58  float hit_integral,
59  float hit_sigma_integral,
60  float ROIsummedADC,
61  float HitsummedADC,
62  short int multiplicity,
63  short int local_index,
64  float goodness_of_fit,
65  int dof)
66  : hit(digits.Channel(),
67  start_tick,
68  end_tick,
69  peak_time,
70  sigma_peak_time,
71  rms,
72  peak_amplitude,
73  sigma_peak_amplitude,
74  ROIsummedADC,
75  HitsummedADC,
76  hit_integral,
77  hit_sigma_integral,
78  multiplicity,
79  local_index,
80  goodness_of_fit,
81  dof,
82  art::ServiceHandle<geo::Geometry const>()->View(digits.Channel()),
83  art::ServiceHandle<geo::Geometry const>()->SignalType(digits.Channel()),
84  wireID)
85  {} // HitCreator::HitCreator(RawDigit)
86 
87  //----------------------------------------------------------------------
89  geo::WireID const& wireID,
90  raw::TDCtick_t start_tick,
91  raw::TDCtick_t end_tick,
92  float rms,
93  float peak_time,
94  float sigma_peak_time,
95  float peak_amplitude,
96  float sigma_peak_amplitude,
97  float hit_integral,
98  float hit_sigma_integral,
99  float ROIsummedADC,
100  float HitsummedADC,
101  short int multiplicity,
102  short int local_index,
103  float goodness_of_fit,
104  int dof)
105  : hit(wire.Channel(),
106  start_tick,
107  end_tick,
108  peak_time,
109  sigma_peak_time,
110  rms,
111  peak_amplitude,
112  sigma_peak_amplitude,
113  ROIsummedADC,
114  HitsummedADC,
115  hit_integral,
116  hit_sigma_integral,
117  multiplicity,
118  local_index,
119  goodness_of_fit,
120  dof,
121  wire.View(),
122  art::ServiceHandle<geo::Geometry const>()->SignalType(wire.Channel()),
123  wireID)
124  {} // HitCreator::HitCreator(Wire)
125 
126  //----------------------------------------------------------------------
128  geo::WireID const& wireID,
129  raw::TDCtick_t start_tick,
130  raw::TDCtick_t end_tick,
131  float rms,
132  float peak_time,
133  float sigma_peak_time,
134  float peak_amplitude,
135  float sigma_peak_amplitude,
136  float hit_integral,
137  float hit_sigma_integral,
138  short int multiplicity,
139  short int local_index,
140  float goodness_of_fit,
141  int dof)
142  : HitCreator(
143  wire,
144  wireID,
145  start_tick,
146  end_tick,
147  rms,
148  peak_time,
149  sigma_peak_time,
150  peak_amplitude,
151  sigma_peak_amplitude,
152  hit_integral,
153  hit_sigma_integral,
154  std::accumulate(wire.SignalROI().begin() + start_tick,
155  wire.SignalROI().begin() + end_tick,
156  0.), // sum of ADC counts between start_tick and end_tic
157  std::accumulate(
158  wire.SignalROI().begin() + start_tick,
159  wire.SignalROI().begin() + end_tick,
160  0.), // sum of ADC counts between start_tick and end_tick TO BE MODIFIED IF HIT HAS TO BE CONSIDERED
161  multiplicity,
162  local_index,
163  goodness_of_fit,
164  dof)
165  {} // HitCreator::HitCreator(Wire; no summed ADC)
166 
167  //----------------------------------------------------------------------
169  geo::WireID const& wireID,
170  float rms,
171  float peak_time,
172  float sigma_peak_time,
173  float peak_amplitude,
174  float sigma_peak_amplitude,
175  float hit_integral,
176  float hit_sigma_integral,
177  float ROIsummedADC,
178  float HitsummedADC,
179  short int multiplicity,
180  short int local_index,
181  float goodness_of_fit,
182  int dof,
183  RegionOfInterest_t const& signal)
184  : HitCreator(wire,
185  wireID,
186  signal.begin_index(),
187  signal.end_index(),
188  rms,
189  peak_time,
190  sigma_peak_time,
191  peak_amplitude,
192  sigma_peak_amplitude,
193  hit_integral,
194  hit_sigma_integral,
195  ROIsummedADC,
196  HitsummedADC,
197  multiplicity,
198  local_index,
199  goodness_of_fit,
200  dof)
201  {} // HitCreator::HitCreator(Wire; RoI)
202 
203  //----------------------------------------------------------------------
205  geo::WireID const& wireID,
206  float rms,
207  float peak_time,
208  float sigma_peak_time,
209  float peak_amplitude,
210  float sigma_peak_amplitude,
211  float hit_integral,
212  float hit_sigma_integral,
213  float ROIsummedADC,
214  float HitsummedADC,
215  short int multiplicity,
216  short int local_index,
217  float goodness_of_fit,
218  int dof,
219  size_t iSignalRoI)
220  : HitCreator(wire,
221  wireID,
222  rms,
223  peak_time,
224  sigma_peak_time,
225  peak_amplitude,
226  sigma_peak_amplitude,
227  hit_integral,
228  hit_sigma_integral,
229  ROIsummedADC,
230  HitsummedADC,
231  multiplicity,
232  local_index,
233  goodness_of_fit,
234  dof,
235  wire.SignalROI().range(iSignalRoI))
236  {} // HitCreator::HitCreator(Wire; RoI index)
237 
238  HitCreator::HitCreator(recob::Hit const& from) : hit(from) {}
239 
240  HitCreator::HitCreator(recob::Hit const& from, geo::WireID const& wireID) : hit(from)
241  {
242  hit.fWireID = wireID;
243  } // HitCreator::HitCreator(new wire ID)
244 
245  //****************************************************************************
246  //*** HitAndAssociationsWriterBase
247  //----------------------------------------------------------------------
249  std::string instance_name,
250  bool doWireAssns,
251  bool doRawDigitAssns)
252  : prod_instance(instance_name)
253  , hits()
254  , WireAssns(doWireAssns ? new art::Assns<recob::Wire, recob::Hit> : nullptr)
255  , RawDigitAssns(doRawDigitAssns ? new art::Assns<raw::RawDigit, recob::Hit> : nullptr)
256  , event(&event)
257  , hitPtrMaker(*(this->event), prod_instance)
258  {} // HitAndAssociationsWriterBase::HitAndAssociationsWriterBase()
259 
260  //------------------------------------------------------------------------------
262  std::string instance_name /* = "" */,
263  bool doWireAssns /* = true */,
264  bool doRawDigitAssns /* = true */
265  )
266  {
267  collector.produces<std::vector<recob::Hit>>(instance_name);
268 
269  // declare the other products we are creating (if any)
270  if (doWireAssns) { collector.produces<art::Assns<recob::Wire, recob::Hit>>(instance_name); }
271  if (doRawDigitAssns) {
272  collector.produces<art::Assns<raw::RawDigit, recob::Hit>>(instance_name);
273  }
274  } // HitAndAssociationsWriterBase::declare_products()
275 
276  //------------------------------------------------------------------------------
278  {
279  assert(event);
280  if (hits) event->put(std::move(hits), prod_instance);
281  if (WireAssns) event->put(std::move(WireAssns), prod_instance);
282  if (RawDigitAssns) event->put(std::move(RawDigitAssns), prod_instance);
283  } // HitAndAssociationsWriterBase::put_into()
284 
285  //****************************************************************************
286  //*** HitCollectionCreator
287  //----------------------------------------------------------------------
289  std::string instance_name /* = "" */,
290  bool doWireAssns /* = true */,
291  bool doRawDigitAssns /* = true */
292  )
293  : HitAndAssociationsWriterBase(event, instance_name, doWireAssns, doRawDigitAssns)
294  {
295  hits.reset(new std::vector<recob::Hit>);
296  } // HitCollectionCreator::HitCollectionCreator()
297 
298  //----------------------------------------------------------------------
300  art::Ptr<recob::Wire> const& wire,
301  art::Ptr<raw::RawDigit> const& digits)
302  {
303 
304  // add the hit to the collection
305  hits->emplace_back(std::move(hit));
306 
307  CreateAssociationsToLastHit(wire, digits);
308  } // HitCollectionCreator::emplace_back(Hit&&)
309 
310  //----------------------------------------------------------------------
312  art::Ptr<recob::Wire> const& wire,
313  art::Ptr<raw::RawDigit> const& digits)
314  {
315 
316  // add the hit to the collection
317  hits->push_back(hit);
318 
319  CreateAssociationsToLastHit(wire, digits);
320  } // HitCollectionCreator::emplace_back(Hit)
321 
322  //----------------------------------------------------------------------
324  {
325  if (!hits) {
327  << "HitCollectionCreator is trying to put into the event"
328  " a hit collection that was never created!\n";
329  }
331  } // HitCollectionCreator::put_into()
332 
333  //----------------------------------------------------------------------
335  art::Ptr<raw::RawDigit> const& digits)
336  {
337  // if no association is required, we are done
338  if (!WireAssns && !RawDigitAssns) return;
339 
340  // art pointer to the hit we just created
341  HitPtr_t hit_ptr(CreatePtrToLastHit());
342 
343  // association with wires
344  if (WireAssns && wire.isNonnull())
345  WireAssns->addSingle(wire, hit_ptr); // if it fails, it throws
346 
347  // association with wires
348  if (RawDigitAssns && digits.isNonnull())
349  RawDigitAssns->addSingle(digits, hit_ptr); // if it fails, it throws
350 
351  } // HitCollectionCreator::CreateAssociationsToLastHit()
352 
353  //****************************************************************************
354  //*** HitCollectionAssociator
355  //----------------------------------------------------------------------
357  std::string instance_name,
358  art::InputTag const& WireModuleLabel,
359  art::InputTag const& RawDigitModuleLabel)
361  instance_name,
362  WireModuleLabel != "",
363  RawDigitModuleLabel != "")
364  , wires_label(WireModuleLabel)
365  , digits_label(RawDigitModuleLabel)
366  {
367  hits.reset(new std::vector<recob::Hit>);
368  } // HitCollectionAssociator::HitCollectionAssociator()
369 
370  //----------------------------------------------------------------------
372  std::string instance_name,
373  art::InputTag const& WireModuleLabel,
374  bool doRawDigitAssns /* = false */
375  )
376  : HitAndAssociationsWriterBase(event, instance_name, WireModuleLabel != "", doRawDigitAssns)
377  , wires_label(WireModuleLabel)
378  , digits_label()
379  {
380  if (RawDigitAssns && !WireAssns) {
382  << "HitCollectionAssociator can't create hit <--> raw digit"
383  " associations through wires, without wires!\n";
384  }
385  hits.reset(new std::vector<recob::Hit>);
386  } // HitCollectionAssociator::HitCollectionAssociator()
387 
388  //----------------------------------------------------------------------
389  void HitCollectionAssociator::use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits)
390  {
391  hits = std::move(srchits);
392  } // HitCollectionAssociator::use_hits()
393 
394  //----------------------------------------------------------------------
396  {
399  } // HitCollectionAssociator::put_into()
400 
401  //----------------------------------------------------------------------
402  void HitCollectionAssociator::prepare_associations(std::vector<recob::Hit> const& srchits)
403  {
404  if (!RawDigitAssns && !WireAssns) return; // no associations needed
405  assert(event);
406 
407  // we make the associations anew
408  if (RawDigitAssns) ClearAssociations(*RawDigitAssns);
409  if (WireAssns) ClearAssociations(*WireAssns);
410 
411  // the following is true is we want associations with digits
412  // but we don't know where digits are; in that case, we try to use wires
413  const bool bUseWiresForDigits = RawDigitAssns && (digits_label == "");
414 
415  if (WireAssns || bUseWiresForDigits) {
416  // do we use wires for digit associations too?
417 
418  // get the wire collection
420  event->getValidHandle<std::vector<recob::Wire>>(wires_label);
421 
422  // fill a map of wire index vs. channel number
423  std::vector<size_t> WireMap = util::MakeIndex(*hWires, std::mem_fn(&recob::Wire::Channel));
424 
425  // use raw rigit - wire association, assuming they have been produced
426  // by the same producer as the wire and with the same instance name;
427  // we don't check whether the data product is found, but the following
428  // code will have FindOneP throw if that was not the case
429  // (that's what we would do here anyway, maybe with a better message...)
430  std::unique_ptr<art::FindOneP<raw::RawDigit>> WireToDigit;
431  if (bUseWiresForDigits) {
432  WireToDigit.reset(new art::FindOneP<raw::RawDigit>(hWires, *event, wires_label));
433  }
434 
435  // add associations, hit by hit:
436  for (size_t iHit = 0; iHit < srchits.size(); ++iHit) {
437 
438  // find the channel
439  size_t iChannel = size_t(srchits[iHit].Channel()); // forcibly converted
440 
441  // find the wire associated to that channel
442  size_t iWire = std::numeric_limits<size_t>::max();
443  if (iChannel < WireMap.size()) iWire = WireMap[iChannel];
444  if (iWire == std::numeric_limits<size_t>::max()) {
446  << "No wire associated to channel #" << iChannel << " whence hit #" << iHit
447  << " comes!\n";
448  } // if no channel
449 
450  // make the association with wires
451  if (WireAssns) {
452  art::Ptr<recob::Wire> wire(hWires, iWire);
453  WireAssns->addSingle(wire, CreatePtr(iHit));
454  }
455 
456  if (bUseWiresForDigits) {
457  // find the digit associated to that channel
458  art::Ptr<raw::RawDigit> const& digit = WireToDigit->at(iWire);
459  if (digit.isNull()) {
461  << "No raw digit associated to channel #" << iChannel << " whence hit #" << iHit
462  << " comes!\n";
463  } // if no channel
464 
465  // make the association
466  RawDigitAssns->addSingle(digit, CreatePtr(iHit));
467  } // if create digit associations through wires
468  } // for hit
469 
470  } // if wire associations
471 
472  if (RawDigitAssns && !bUseWiresForDigits) {
473  // get the digit collection
475  event->getValidHandle<std::vector<raw::RawDigit>>(digits_label);
476 
477  // fill a map of wire index vs. channel number
478  std::vector<size_t> DigitMap =
479  util::MakeIndex(*hDigits, std::mem_fn(&raw::RawDigit::Channel));
480 
481  // add associations, hit by hit:
482  for (size_t iHit = 0; iHit < srchits.size(); ++iHit) {
483 
484  // find the channel
485  size_t iChannel = size_t(srchits[iHit].Channel()); // forcibly converted
486 
487  // find the digit associated to that channel
488  size_t iDigit = std::numeric_limits<size_t>::max();
489  if (iChannel < DigitMap.size()) iDigit = DigitMap[iChannel];
490  if (iDigit == std::numeric_limits<size_t>::max()) {
492  << "No raw digit associated to channel #" << iChannel << " whence hit #" << iHit
493  << " comes!\n";
494  } // if no channel
495 
496  // make the association
497  art::Ptr<raw::RawDigit> digit(hDigits, iDigit);
498  RawDigitAssns->addSingle(digit, CreatePtr(iHit));
499 
500  } // for hit
501  } // if we have rawdigit label
502 
503  } // HitCollectionAssociator::put_into()
504 
505  //****************************************************************************
506  //*** HitRefinerAssociator
507  //----------------------------------------------------------------------
509  art::InputTag const& HitModuleLabel,
510  std::string instance_name /* = "" */,
511  bool doWireAssns /* = true */,
512  bool doRawDigitAssns /* = true */
513  )
514  : HitAndAssociationsWriterBase(event, instance_name, doWireAssns, doRawDigitAssns)
515  , hits_label(HitModuleLabel)
516  {
517  hits.reset(new std::vector<recob::Hit>);
518  } // HitRefinerAssociator::HitRefinerAssociator()
519 
520  //----------------------------------------------------------------------
521  void HitRefinerAssociator::use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits)
522  {
523  hits = std::move(srchits);
524  } // HitRefinerAssociator::use_hits()
525 
526  //----------------------------------------------------------------------
528  {
531  } // HitRefinerAssociator::put_into()
532 
533  //----------------------------------------------------------------------
534  void HitRefinerAssociator::prepare_associations(std::vector<recob::Hit> const& srchits)
535  {
536  if (!RawDigitAssns && !WireAssns) return; // no associations needed
537  assert(event);
538 
539  // we make the associations anew
540  if (RawDigitAssns) ClearAssociations(*RawDigitAssns);
541 
542  // read the hits; this is going to hurt performances...
543  // no solution to that until there is a way to have a lazy read
545  event->getValidHandle<std::vector<recob::Hit>>(hits_label);
546 
547  // now get the associations
548  if (WireAssns) {
549  // we make the associations anew
550  ClearAssociations(*WireAssns);
551 
552  // find the associations between the hits and the wires
554  if (!HitToWire.isValid()) {
556  << "Can't find the associations between hits and wires produced by '" << hits_label
557  << "'!\n";
558  } // if no association
559 
560  // fill a map of wire vs. channel number
561  std::vector<art::Ptr<recob::Wire>> WireMap;
562  for (size_t iAssn = 0; iAssn < HitToWire.size(); ++iAssn) {
563  art::Ptr<recob::Wire> wire = HitToWire.at(iAssn);
564  if (wire.isNull()) continue;
565  size_t channelID = (size_t)wire->Channel();
566  if (WireMap.size() <= channelID) // expand the map of necessary
567  WireMap.resize(std::max(channelID + 1, 2 * WireMap.size()), {});
568  WireMap[channelID] = std::move(wire);
569  } // for
570 
571  // now go through all the hits...
572  for (size_t iHit = 0; iHit < srchits.size(); ++iHit) {
573  recob::Hit const& hit = srchits[iHit];
574  size_t channelID = (size_t)hit.Channel();
575 
576  // no association if there is no wire to associate with
577  if ((channelID >= WireMap.size()) || !WireMap[channelID]) continue;
578 
579  // create an association using the same wire pointer
580  WireAssns->addSingle(WireMap[channelID], CreatePtr(iHit));
581  } // for hits
582  } // if wire associations
583 
584  // now get the associations
585  if (RawDigitAssns) {
586  // we make the associations anew
587  ClearAssociations(*RawDigitAssns);
588 
589  // find the associations between the hits and the raw digits
590  art::FindOneP<raw::RawDigit> HitToDigits(hHits, *event, hits_label);
591  if (!HitToDigits.isValid()) {
593  << "Can't find the associations between hits and raw digits"
594  << " produced by '" << hits_label << "'!\n";
595  } // if no association
596 
597  // fill a map of digits vs. channel number
598  std::vector<art::Ptr<raw::RawDigit>> DigitMap;
599  for (size_t iAssn = 0; iAssn < HitToDigits.size(); ++iAssn) {
600  art::Ptr<raw::RawDigit> digits = HitToDigits.at(iAssn);
601  if (digits.isNull()) continue;
602  size_t channelID = (size_t)digits->Channel();
603  if (DigitMap.size() <= channelID) // expand the map of necessary
604  DigitMap.resize(std::max(channelID + 1, 2 * DigitMap.size()), {});
605  DigitMap[channelID] = std::move(digits);
606  } // for
607 
608  // now go through all the hits...
609  for (size_t iHit = 0; iHit < srchits.size(); ++iHit) {
610  recob::Hit const& hit = srchits[iHit];
611  size_t channelID = (size_t)hit.Channel();
612 
613  // no association if there is no digits to associate with
614  if ((channelID >= DigitMap.size()) || !DigitMap[channelID]) continue;
615 
616  // create an association using the same digits pointer
617  RawDigitAssns->addSingle(DigitMap[channelID], CreatePtr(iHit));
618  } // for hits
619  } // if digit associations
620 
621  } // HitRefinerAssociator::put_into()
622 
623 } // namespace recob
HitCreator(raw::RawDigit const &digits, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float ROIsummedADC, float HitsummedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
Constructor: extracts some information from raw digit.
Definition: HitCreator.cxx:49
HitPtr_t CreatePtrToLastHit() const
Creates an art pointer to the hit with the last index.
Definition: HitCreator.h:640
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:68
Reconstruction base classes.
void prepare_associations()
Finds out the associations for the current hits.
Definition: HitCreator.h:777
HitAndAssociationsWriterBase(art::Event &event, std::string instance_name, bool doWireAssns, bool doRawDigitAssns)
Constructor: sets instance name and whether to build associations.
Definition: HitCreator.cxx:248
std::string prod_instance
Tame of the instance for data products.
Definition: HitCreator.h:449
art::InputTag wires_label
Label of the collection of wires to associate.
Definition: HitCreator.h:769
Declaration of signal hit object.
Procedures to create maps of object locations.
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:213
std::unique_ptr< art::Assns< recob::Wire, recob::Hit > > WireAssns
Associations with wires.
Definition: HitCreator.h:454
STL namespace.
Raw data description.
Definition: RawTypes.h:6
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
Definition: HitCreator.cxx:389
std::vector< size_t > MakeIndex(Coll const &data, KeyOf key_of=KeyOf())
Creates a map of indices from an existing collection.
Definition: MakeIndex.h:43
void swap(art::Assns< L, R, D > &other)
Definition: Assns.h:591
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.cxx:261
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:25
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:87
Helper functions to create a hit.
void hits()
Definition: readHits.C:15
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
Definition: HitCreator.cxx:521
void prepare_associations()
Finds out the associations for the current hits.
Definition: HitCreator.h:876
void put_into()
Moves the data into the event.
Definition: HitCreator.cxx:527
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:223
void put_into()
Moves the data into the event.
Definition: HitCreator.cxx:395
HitPtr_t CreatePtr(size_t index) const
Creates an art pointer to the hit with the specified index.
Definition: HitCreator.h:478
details::FindAllP< recob::Hit, recob::Wire > HitToWire
Query object connecting a hit to a wire.
Definition: HitUtils.h:54
void CreateAssociationsToLastHit(art::Ptr< recob::Wire > const &wire, art::Ptr< raw::RawDigit > const &digits)
Creates associations between the last hit and the specified pointers.
Definition: HitCreator.cxx:334
bool isNull() const noexcept
Definition: Ptr.h:211
void emplace_back(recob::Hit &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >())
Adds the specified hit to the data collection.
Definition: HitCreator.cxx:299
Detector simulation of raw signals on wires.
HitRefinerAssociator(art::Event &event, art::InputTag const &HitModuleLabel, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Constructor: sets instance name and whether to build associations.
Definition: HitCreator.cxx:508
art::InputTag hits_label
Label of the collection of hits.
Definition: HitCreator.h:870
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
HitCollectionAssociator(art::Event &event, std::string instance_name, art::InputTag const &WireModuleLabel, art::InputTag const &RawDigitModuleLabel)
Constructor: sets instance name and whether to build associations.
Definition: HitCreator.cxx:356
bool isNonnull() const noexcept
Definition: Ptr.h:204
void put_into()
Moves the data into the event.
Definition: HitCreator.cxx:277
HitCollectionCreator(art::Event &event, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Constructor: sets instance name and whether to build associations.
Definition: HitCreator.cxx:288
Class holding the regions of interest of signal from a channel.
Definition: Wire.h:116
art::InputTag digits_label
Label of raw digits collection to associate.
Definition: HitCreator.h:771
Definition: MVAAlg.h:12
Declaration of basic channel signal object.
std::unique_ptr< art::Assns< raw::RawDigit, recob::Hit > > RawDigitAssns
Associations with raw digits.
Definition: HitCreator.h:456
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
void put_into()
Moves the data into the event.
Definition: HitCreator.cxx:323
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
recob::Wire::RegionsOfInterest_t::datarange_t RegionOfInterest_t
Type of one region of interest.
Definition: HitCreator.h:90
std::unique_ptr< std::vector< recob::Hit > > hits
Collection of hits.
Definition: HitCreator.h:452
Namespace collecting geometry-related classes utilities.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:278
Definition: fwd.h:26
Base class handling a collection of hits and its associations.
Definition: HitCreator.h:391
art framework interface to geometry description
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
Event finding and building.