LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CPAlgoIgnoreTracks.cxx
Go to the documentation of this file.
2 
3 #include "TMath.h"
4 
5 namespace cmtool {
6 
7  //----------------------------------------------------------
9  //----------------------------------------------------------
10  {
11  SetMinHits(20);
12  SetMinModHitDens(1.4);
13  SetMinMHitWires(3.5);
14  //"fPrincipal" is log(1-eigenvalue_principal)
15  // >-7 means EP > 0.99908
16  SetMinPrincipal(-6.);
17  }
18 
19  //-----------------------------
21  //-----------------------------
22  {}
23 
24  //------------------------------------------------------------------------------
25  float CPAlgoIgnoreTracks::Priority(const ::cluster::ClusterParamsAlg& cluster)
26  //------------------------------------------------------------------------------
27  {
28  //return -1 for tracks, otherwise return nhits
29  auto nhit = cluster.GetNHits();
30 
31  //NOTE! default return value for non-track clusters is nhits
32  //but if you want to sort by a different way, use a separate
33  //CPAlgo in an array with this one, and use the kLastAlgo option
34  //to sort by that algo and still remove tracks!
35  return (IsTrack(cluster) ? -1 : (float)nhit);
36  }
37 
38  //------------------------------
40  //------------------------------
41  {}
42 
43  bool CPAlgoIgnoreTracks::IsTrack(const ::cluster::ClusterParamsAlg& cluster)
44  {
45  double fPrincipal = TMath::Log(1 - cluster.GetParams().eigenvalue_principal);
46 
47  bool isTrack = false;
48  if ( //cluster.GetNHits() > _min_hits &&
49  cluster.GetParams().modified_hit_density < _min_mod_hit_dens ||
50  cluster.GetParams().multi_hit_wires < _min_multihit_wires || fPrincipal < _min_principal)
51  isTrack = true;
52 
53  return isTrack;
54  }
55 }
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()