LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
lar_cluster3d::SetCheckHitOrder Class Reference

Public Member Functions

 SetCheckHitOrder (const std::vector< size_t > &plane)
 
bool operator() (const reco::ClusterHit3D *left, const reco::ClusterHit3D *right) const
 

Private Attributes

const std::vector< size_t > & m_plane
 

Detailed Description

Definition at line 791 of file MinSpanTreeAlg_tool.cc.

Constructor & Destructor Documentation

lar_cluster3d::SetCheckHitOrder::SetCheckHitOrder ( const std::vector< size_t > &  plane)
inline

Definition at line 793 of file MinSpanTreeAlg_tool.cc.

793 : m_plane(plane) {}
const std::vector< size_t > & m_plane

Member Function Documentation

bool lar_cluster3d::SetCheckHitOrder::operator() ( const reco::ClusterHit3D left,
const reco::ClusterHit3D right 
) const
inline

Definition at line 795 of file MinSpanTreeAlg_tool.cc.

References reco::ClusterHit3D::getHits(), and reco::ClusterHit3D::getWireIDs().

796  {
797  // Check if primary view's hit is on the same wire
798  if (left->getWireIDs()[m_plane[0]] == right->getWireIDs()[m_plane[0]]) {
799  // Same wire but not same hit, order by primary hit time
800  if (left->getHits()[m_plane[0]] && right->getHits()[m_plane[0]] &&
801  left->getHits()[m_plane[0]] != right->getHits()[m_plane[0]]) {
802  return left->getHits()[m_plane[0]]->getHit()->PeakTime() <
803  right->getHits()[m_plane[0]]->getHit()->PeakTime();
804  }
805 
806  // Primary view is same hit, look at next view's wire
807  if (left->getWireIDs()[m_plane[1]] == right->getWireIDs()[m_plane[1]]) {
808  // Same wire but not same hit, order by secondary hit time
809  if (left->getHits()[m_plane[1]] && right->getHits()[m_plane[1]] &&
810  left->getHits()[m_plane[1]] != right->getHits()[m_plane[1]]) {
811  return left->getHits()[m_plane[1]]->getHit()->PeakTime() <
812  right->getHits()[m_plane[1]]->getHit()->PeakTime();
813  }
814 
815  // All that is left is the final view... and this can't be the same hit... (else it is the same 3D hit)
816  return left->getWireIDs()[m_plane[2]] < right->getWireIDs()[m_plane[2]];
817  }
818 
819  return left->getWireIDs()[m_plane[1]] < right->getWireIDs()[m_plane[1]];
820  }
821 
822  // Order by primary view's wire number
823  return left->getWireIDs()[m_plane[0]] < right->getWireIDs()[m_plane[0]];
824  }
const std::vector< size_t > & m_plane
const std::vector< geo::WireID > & getWireIDs() const
Definition: Cluster3D.h:170
const ClusterHit2DVec & getHits() const
Definition: Cluster3D.h:168

Member Data Documentation

const std::vector<size_t>& lar_cluster3d::SetCheckHitOrder::m_plane
private

Definition at line 827 of file MinSpanTreeAlg_tool.cc.


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