Public Member Functions | Private Attributes | List of all members
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 861 of file MinSpanTreeAlg_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 864 of file MinSpanTreeAlg_tool.cc.

864 : 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 866 of file MinSpanTreeAlg_tool.cc.

867  {
868  // Check if primary view's hit is on the same wire
869  if (left->getWireIDs()[m_plane[0]] == right->getWireIDs()[m_plane[0]])
870  {
871  // Same wire but not same hit, order by primary hit time
872  if (left->getHits()[m_plane[0]] && right->getHits()[m_plane[0]] && left->getHits()[m_plane[0]] != right->getHits()[m_plane[0]])
873  {
874  return left->getHits()[m_plane[0]]->getHit()->PeakTime() < right->getHits()[m_plane[0]]->getHit()->PeakTime();
875  }
876 
877  // Primary view is same hit, look at next view's wire
878  if (left->getWireIDs()[m_plane[1]] == right->getWireIDs()[m_plane[1]])
879  {
880  // Same wire but not same hit, order by secondary hit time
881  if (left->getHits()[m_plane[1]] && right->getHits()[m_plane[1]] && left->getHits()[m_plane[1]] != right->getHits()[m_plane[1]])
882  {
883  return left->getHits()[m_plane[1]]->getHit()->PeakTime() < right->getHits()[m_plane[1]]->getHit()->PeakTime();
884  }
885 
886  // All that is left is the final view... and this can't be the same hit... (else it is the same 3D hit)
887  return left->getWireIDs()[m_plane[2]] < right->getWireIDs()[m_plane[2]];
888  }
889 
890  return left->getWireIDs()[m_plane[1]] < right->getWireIDs()[m_plane[1]];
891  }
892 
893  // Order by primary view's wire number
894  return left->getWireIDs()[m_plane[0]] < right->getWireIDs()[m_plane[0]];
895  }
const std::vector< size_t > & m_plane
const std::vector< geo::WireID > & getWireIDs() const
Definition: Cluster3D.h:173
const ClusterHit2DVec & getHits() const
Definition: Cluster3D.h:171

Member Data Documentation

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

Definition at line 898 of file MinSpanTreeAlg_tool.cc.


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