LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 897 of file MinSpanTreeAlg_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 900 of file MinSpanTreeAlg_tool.cc.

900 : 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 902 of file MinSpanTreeAlg_tool.cc.

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

903  {
904  // Check if primary view's hit is on the same wire
905  if (left->getWireIDs()[m_plane[0]] == right->getWireIDs()[m_plane[0]])
906  {
907  // Same wire but not same hit, order by primary hit time
908  if (left->getHits()[m_plane[0]] && right->getHits()[m_plane[0]] && left->getHits()[m_plane[0]] != right->getHits()[m_plane[0]])
909  {
910  return left->getHits()[m_plane[0]]->getHit().PeakTime() < right->getHits()[m_plane[0]]->getHit().PeakTime();
911  }
912 
913  // Primary view is same hit, look at next view's wire
914  if (left->getWireIDs()[m_plane[1]] == right->getWireIDs()[m_plane[1]])
915  {
916  // Same wire but not same hit, order by secondary hit time
917  if (left->getHits()[m_plane[1]] && right->getHits()[m_plane[1]] && left->getHits()[m_plane[1]] != right->getHits()[m_plane[1]])
918  {
919  return left->getHits()[m_plane[1]]->getHit().PeakTime() < right->getHits()[m_plane[1]]->getHit().PeakTime();
920  }
921 
922  // All that is left is the final view... and this can't be the same hit... (else it is the same 3D hit)
923  return left->getWireIDs()[m_plane[2]] < right->getWireIDs()[m_plane[2]];
924  }
925 
926  return left->getWireIDs()[m_plane[1]] < right->getWireIDs()[m_plane[1]];
927  }
928 
929  // Order by primary view's wire number
930  return left->getWireIDs()[m_plane[0]] < right->getWireIDs()[m_plane[0]];
931  }
const std::vector< size_t > & m_plane
const std::vector< geo::WireID > & getWireIDs() const
Definition: Cluster3D.h:160
const ClusterHit2DVec & getHits() const
Definition: Cluster3D.h:158

Member Data Documentation

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

Definition at line 934 of file MinSpanTreeAlg_tool.cc.


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