All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
26  //------------------------------------------------------------------------------
27  float CPAlgoIgnoreTracks::Priority(const ::cluster::ClusterParamsAlg &cluster)
28  //------------------------------------------------------------------------------
29  {
30  //return -1 for tracks, otherwise return nhits
31  auto nhit = cluster.GetNHits();
32 
33  //NOTE! default return value for non-track clusters is nhits
34  //but if you want to sort by a different way, use a separate
35  //CPAlgo in an array with this one, and use the kLastAlgo option
36  //to sort by that algo and still remove tracks!
37  return ( IsTrack(cluster) ? -1 : (float)nhit );
38  }
39 
40  //------------------------------
42  //------------------------------
43  {
44 
45  }
46 
47 
48  bool CPAlgoIgnoreTracks::IsTrack(const ::cluster::ClusterParamsAlg &cluster)
49  {
50  double fPrincipal = TMath::Log(1-cluster.GetParams().eigenvalue_principal);
51 
52  bool isTrack = false;
53  if(//cluster.GetNHits() > _min_hits &&
54  cluster.GetParams().modified_hit_density < _min_mod_hit_dens ||
55  cluster.GetParams().multi_hit_wires < _min_multihit_wires ||
56  fPrincipal < _min_principal)
57  isTrack = true;
58 
59  return isTrack;
60  }
61 }
process_name cluster
Definition: cheaterreco.fcl:51
bool IsTrack(const ::cluster::ClusterParamsAlg &cluster)
Function to check if cluster is a track.
void SetMinModHitDens(Double_t AHO)
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()