Private Member Functions | List of all members
trkf::KHitContainerWireLine Class Reference

#include <KHitContainerWireLine.h>

Inheritance diagram for trkf::KHitContainerWireLine:
trkf::KHitContainer

Private Member Functions

void fill (const detinfo::DetectorPropertiesData &detProp, const art::PtrVector< recob::Hit > &hits, int only_plane) override
 

Additional Inherited Members

- Public Member Functions inherited from trkf::KHitContainer
virtual ~KHitContainer ()=default
 
virtual void fill (detinfo::DetectorPropertiesData const &clock_data, const art::PtrVector< recob::Hit > &hits, int only_plane)=0
 
const std::list< KHitGroup > & getSorted () const
 
const std::list< KHitGroup > & getUnsorted () const
 
const std::list< KHitGroup > & getUnused () const
 
std::list< KHitGroup > & getSorted ()
 Sorted list. More...
 
std::list< KHitGroup > & getUnsorted ()
 Unsorted list. More...
 
std::list< KHitGroup > & getUnused ()
 Unused list. More...
 
void clear ()
 Clear all lists. More...
 
void reset ()
 Move all objects to unsorted list (from sorted and unused lists). More...
 
void sort (const KTrack &trk, bool addUnsorted, const Propagator &prop, Propagator::PropDirection dir=Propagator::UNKNOWN)
 (Re)sort objects in unsorted and sorted lists. More...
 
unsigned int getPreferredPlane () const
 Return the plane with the most KHitGroups in the unsorted list. More...
 

Detailed Description

Definition at line 25 of file KHitContainerWireLine.h.

Member Function Documentation

void trkf::KHitContainerWireLine::fill ( const detinfo::DetectorPropertiesData detProp,
const art::PtrVector< recob::Hit > &  hits,
int  only_plane 
)
overrideprivate

Fill container.

Arguments:

hits - RecoBase/Hit collection. only_plane - Choose hits from this plane if >= 0.

This method converts the hits in the input collection into KHitWireLine objects and inserts them into the base class.

Definition at line 31 of file KHitContainerWireLine.cxx.

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  }
geo::WireID WireID() const
Definition: Hit.h:233
iterator begin()
Definition: PtrVector.h:217
uint8_t channel
Definition: CRTFragment.hh:201
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:75
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
Detector simulation of raw signals on wires.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:230
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

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