LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
KHitContainerWireLine.cxx
Go to the documentation of this file.
1 
11 #include <map>
12 
14 
15 #include "cetlib_except/exception.h"
16 
19 
20 namespace trkf {
21 
24  {}
25 
28  {}
29 
41  int only_plane)
42  {
43  // Get services.
44 
46 
47  // Loop over hits.
48 
50  ihit != hits.end(); ++ihit) {
51  const recob::Hit& hit = **ihit;
52 
53  // Extract the wireid from the Hit.
54  geo::WireID hitWireID = hit.WireID();
55 
56  uint32_t channel = hit.Channel();
57 
58  // Choose plane.
59  if(only_plane >= 0 && hitWireID.Plane != (unsigned int)(only_plane))
60  continue;
61 
62  // Make a new KHitGroup for each hit.
63 
64  getUnsorted().push_back(KHitGroup());
65  KHitGroup* pgr = &(getUnsorted().back());
66  if (!pgr) {
67  throw cet::exception("KHitContainerWireLine")
68  << __func__ << ": no group map for channel " << channel << "\n";
69  }
70 
71  // Get surface from KHitGroup (initially a null pointer).
72 
73  const std::shared_ptr<const Surface>& psurf = pgr->getSurface();
74 
75  // Construct KHitWireLine object.
76 
77  std::shared_ptr<const KHitBase> phit(new KHitWireLine(*ihit, psurf));
78 
79  // Insert hit into KHitGroup.
80 
81  pgr->addHit(phit);
82  }
83  }
84 
85 } // end namespace trkf
A KHitContainer for KHitWireLine type measurements.
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
iterator begin()
Definition: PtrVector.h:223
void hits()
Definition: readHits.C:15
virtual ~KHitContainerWireLine()
Destructor.
iterator end()
Definition: PtrVector.h:237
const std::list< KHitGroup > & getUnsorted() const
Unsorted list.
Definition: KHitContainer.h:72
KHitContainerWireLine()
Default constructor.
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane) override
Fill container.
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
Detector simulation of raw signals on wires.
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
void addHit(const std::shared_ptr< const KHitBase > &hit)
Add a mesaurement into the colleciton.
Definition: KHitGroup.cxx:39
Kalman filter wire-time measurement on a SurfWireLine surface.
const std::shared_ptr< const Surface > & getSurface() const
Surface accessor.
Definition: KHitGroup.h:50
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:231
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33