LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CBAlgoPolyContain.cxx
Go to the documentation of this file.
2 
3 namespace cmtool {
4 
6  {
7  // Nothing to be done in the base class
8  this->reconfigure();
9  }
10 
12  {
13 
14  //not sure what needs to be reset/reconfigured for this algo
15 
16  } //end reconfigure function
17 
18  bool CBAlgoPolyContain::Bool(const ::cluster::ClusterParamsAlg& cluster1,
19  const ::cluster::ClusterParamsAlg& cluster2)
20  {
21 
22  if ((cluster1.GetParams().PolyObject.Size() < 3) or
23  (cluster2.GetParams().PolyObject.Size() < 3))
24  return false;
25 
26  //if either polygon is fully contained in other
27  //then return true! --> MERGE!
28  if ((cluster1.GetParams().PolyObject.Contained(cluster2.GetParams().PolyObject)) or
29  (cluster2.GetParams().PolyObject.Contained(cluster1.GetParams().PolyObject)))
30  return true;
31  else
32  return false;
33  }
34 
35 }
void reconfigure()
Method to re-configure the instance.
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
CBAlgoPolyContain()
Default constructor.
Class def header for a class CBAlgoPolyContain.