LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
KHitContainerWireLine.cxx
Go to the documentation of this file.
1 
12 
14 #include "cetlib_except/exception.h"
15 
18 
19 namespace trkf {
20 
33  int only_plane)
34  {
35  // Get services.
36 
38 
39  // Loop over hits.
40 
41  for (art::PtrVector<recob::Hit>::const_iterator ihit = hits.begin(); ihit != hits.end();
42  ++ihit) {
43  const recob::Hit& hit = **ihit;
44 
45  // Extract the wireid from the Hit.
46  geo::WireID hitWireID = hit.WireID();
47 
48  uint32_t channel = hit.Channel();
49 
50  // Choose plane.
51  if (only_plane >= 0 && hitWireID.Plane != (unsigned int)(only_plane)) continue;
52 
53  // Make a new KHitGroup for each hit.
54 
55  getUnsorted().push_back(KHitGroup());
56  KHitGroup* pgr = &(getUnsorted().back());
57  if (!pgr) {
58  throw cet::exception("KHitContainerWireLine")
59  << __func__ << ": no group map for channel " << channel << "\n";
60  }
61 
62  pgr->addHit(std::make_shared<KHitWireLine>(detProp, *ihit, pgr->getSurface()));
63  }
64  }
65 
66 } // end namespace trkf
void fill(const detinfo::DetectorPropertiesData &detProp, const art::PtrVector< recob::Hit > &hits, int only_plane) override
A KHitContainer for KHitWireLine type measurements.
iterator begin()
Definition: PtrVector.h:217
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:280
void hits()
Definition: readHits.C:15
typename data_t::const_iterator const_iterator
Definition: PtrVector.h:55
iterator end()
Definition: PtrVector.h:231
const std::list< KHitGroup > & getUnsorted() const
Definition: KHitContainer.h:70
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:481
Detector simulation of raw signals on wires.
void addHit(const std::shared_ptr< const KHitBase > &hit)
Add a mesaurement into the colleciton.
Definition: KHitGroup.cxx:34
Kalman filter wire-time measurement on a SurfWireLine surface.
const std::shared_ptr< const Surface > & getSurface() const
Surface accessor.
Definition: KHitGroup.h:48
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:268
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33