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