LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
CPAlgoIgnoreTracks.cxx
Go to the documentation of this file.
1 #ifndef RECOTOOL_CPALGOIGNORETRACKS_CXX
2 #define RECOTOOL_CPALGOIGNORETRACKS_CXX
3 
4 #include "CPAlgoIgnoreTracks.h"
5 
6 namespace cmtool {
7 
8  //----------------------------------------------------------
10  //----------------------------------------------------------
11  {
12  SetMinHits(20);
13  SetMinModHitDens(1.4);
14  SetMinMHitWires(3.5);
15  //"fPrincipal" is log(1-eigenvalue_principal)
16  // >-7 means EP > 0.99908
17  SetMinPrincipal(-6.);
18  }
19 
20  //-----------------------------
22  //-----------------------------
23  {
24 
25  }
26 
27  //------------------------------------------------------------------------------
28  float CPAlgoIgnoreTracks::Priority(const ::cluster::ClusterParamsAlg &cluster)
29  //------------------------------------------------------------------------------
30  {
31  //return -1 for tracks, otherwise return nhits
32  auto nhit = cluster.GetNHits();
33 
34  //NOTE! default return value for non-track clusters is nhits
35  //but if you want to sort by a different way, use a separate
36  //CPAlgo in an array with this one, and use the kLastAlgo option
37  //to sort by that algo and still remove tracks!
38  return ( IsTrack(cluster) ? -1 : (float)nhit );
39  }
40 
41  //------------------------------
43  //------------------------------
44  {
45 
46  }
47 
48 
49  bool CPAlgoIgnoreTracks::IsTrack(const ::cluster::ClusterParamsAlg &cluster)
50  {
51  double fPrincipal = TMath::Log(1-cluster.GetParams().eigenvalue_principal);
52 
53  bool isTrack = false;
54  if(//cluster.GetNHits() > _min_hits &&
55  cluster.GetParams().modified_hit_density < _min_mod_hit_dens ||
56  cluster.GetParams().multi_hit_wires < _min_multihit_wires ||
57  fPrincipal < _min_principal)
58  isTrack = true;
59 
60  return isTrack;
61  }
62 }
63 #endif
bool IsTrack(const ::cluster::ClusterParamsAlg &cluster)
Function to check if cluster is a track.
void SetMinModHitDens(Double_t AHO)
Cluster finding and building.
void SetMinMHitWires(Double_t BOKE)
CPAlgoIgnoreTracks()
Default constructor.
void SetMinPrincipal(Double_t HEKOKI)
void SetMinHits(size_t BAKA)
Setter for track-like parameters.
virtual float Priority(const ::cluster::ClusterParamsAlg &cluster)
Class def header for a class CPAlgoIgnoreTracks.
virtual void Reset()
Function to reset the algorithm instance, called together with manager&#39;s Reset()