LArSoft  v09_90_00
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 851 of file MinSpanTreeAlg_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 853 of file MinSpanTreeAlg_tool.cc.

853 : 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 855 of file MinSpanTreeAlg_tool.cc.

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

856  {
857  // Check if primary view's hit is on the same wire
858  if (left->getWireIDs()[m_plane[0]] == right->getWireIDs()[m_plane[0]]) {
859  // Same wire but not same hit, order by primary hit time
860  if (left->getHits()[m_plane[0]] && right->getHits()[m_plane[0]] &&
861  left->getHits()[m_plane[0]] != right->getHits()[m_plane[0]]) {
862  return left->getHits()[m_plane[0]]->getHit()->PeakTime() <
863  right->getHits()[m_plane[0]]->getHit()->PeakTime();
864  }
865 
866  // Primary view is same hit, look at next view's wire
867  if (left->getWireIDs()[m_plane[1]] == right->getWireIDs()[m_plane[1]]) {
868  // Same wire but not same hit, order by secondary hit time
869  if (left->getHits()[m_plane[1]] && right->getHits()[m_plane[1]] &&
870  left->getHits()[m_plane[1]] != right->getHits()[m_plane[1]]) {
871  return left->getHits()[m_plane[1]]->getHit()->PeakTime() <
872  right->getHits()[m_plane[1]]->getHit()->PeakTime();
873  }
874 
875  // All that is left is the final view... and this can't be the same hit... (else it is the same 3D hit)
876  return left->getWireIDs()[m_plane[2]] < right->getWireIDs()[m_plane[2]];
877  }
878 
879  return left->getWireIDs()[m_plane[1]] < right->getWireIDs()[m_plane[1]];
880  }
881 
882  // Order by primary view's wire number
883  return left->getWireIDs()[m_plane[0]] < right->getWireIDs()[m_plane[0]];
884  }
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 887 of file MinSpanTreeAlg_tool.cc.


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