LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
CBAlgoPolyContain.cxx
Go to the documentation of this file.
1 #ifndef RECOTOOL_CBALGOPOLYCONTAIN_CXX
2 #define RECOTOOL_CBALGOPOLYCONTAIN_CXX
3 
4 #include "CBAlgoPolyContain.h"
5 
6 namespace cmtool {
7 
9  {
10  // Nothing to be done in the base class
11  this->reconfigure();
12  }
13 
14 
16 
17  //not sure what needs to be reset/reconfigured for this algo
18 
19  }//end reconfigure function
20 
21 
22  bool CBAlgoPolyContain::Bool(const ::cluster::ClusterParamsAlg &cluster1,
23  const ::cluster::ClusterParamsAlg &cluster2)
24  {
25 
26  if ( (cluster1.GetParams().PolyObject.Size() < 3) or (cluster2.GetParams().PolyObject.Size() < 3) )
27  return false;
28 
29  //if either polygon is fully contained in other
30  //then return true! --> MERGE!
31  if ( (cluster1.GetParams().PolyObject.Contained(cluster2.GetParams().PolyObject)) or
32  (cluster2.GetParams().PolyObject.Contained(cluster1.GetParams().PolyObject)) )
33  return true;
34  else
35  return false;
36  }
37 
38 
39 }
40 
41 #endif
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.