CFAlgoShowerCompat.h
Go to the documentation of this file.
1 /**
2  * \file CFAlgoShowerCompat.h
3  *
4  * \ingroup CMTAlgMatch
5  *
6  * \brief This algo only matches clusters if they are not track-like.
7  * This is implemented in an algo because it allows the comparison of
8  * cluster parameters across planes, rather than individually.
9  * It is intended to be added as the last matching algo, with the
10  * "kLastAlgo" mode.
11  *
12  * @author davidkaleko_NAME
13  */
14 
15 /** \addtogroup CMTAlgMatch
16 
17  @{*/
18 #ifndef CFALGOSHOWERCOMPAT_HH
19 #define CFALGOSHOWERCOMPAT_HH
20 
21 #include "TFile.h"
22 #include "TTree.h"
24 
25 namespace cmtool {
26  /**
27  \class CFAlgoShowerCompat
28  User implementation for CFloatAlgoBase class
29  doxygen documentation!
30  */
32  public:
33  /// Default constructor
35 
36  //
37  // Author should be aware of 3 functions at least: Float, Report,
38  // and Reset. More possibly-useful functions can be found in the later
39  // part but commented out. All of these functions are virtual and defined
40  // in the base class.
41 
42  /**
43  Core function: given a set of CPANs, return a float which indicates
44  the compatibility the cluster combination.
45  */
46  float Float(util::GeometryUtilities const&,
47  const std::vector<const cluster::ClusterParamsAlg*>& clusters) override;
48 
49  /**
50  Optional function: called after each iterative approach if a manager class is
51  run with verbosity level <= kPerIteration. Maybe useful for debugging.
52  */
53  void Report() override;
54 
55  /// Function to reset the algorithm instance, called together with manager's Reset()
56  void Reset() override;
57 
59 
60  void
62  {
63  _fout_hax->cd();
64  _ana_tree->Write();
65  _fout_hax->Close();
66  };
67 
68  /**
69  Optional function: called at the beginning of 1st iteration. This is called per event.
70  */
71  //virtual void EventBegin(const std::vector<cluster::ClusterParamsAlg> &clusters);
72 
73  /**
74  Optional function: called at the end of event ... after the last merging iteration is over.
75  */
76  //virtual void EventEnd();
77 
78  /**
79  Optional function: called at the beggining of each iterative loop.
80  This provides all clusters' information in case the algorithm need them. Note this
81  is called per iteration which may be more than once per event.
82  */
83  //virtual void IterationBegin(const std::vector<cluster::ClusterParamsAlg> &clusters);
84 
85  /**
86  Optional function: called at the end of each iterative loop.
87  */
88  //virtual void IterationEnd();
89 
90  private:
91  TTree* _ana_tree;
92  double _o_ang_avg;
93  double _o_ang_rms;
94  double _o_ang_wt_avg;
95  double _o_ang_wt_rms;
101 
102  TFile* _fout_hax;
103  };
104 }
105 #endif
106 /** @} */ // end of doxygen group
float Float(util::GeometryUtilities const &, const std::vector< const cluster::ClusterParamsAlg * > &clusters) override
Class def header for a class CFloatAlgoBase.
void Reset() override
Function to reset the algorithm instance, called together with manager&#39;s Reset()
void PrintClusterInfo(const cluster::ClusterParamsAlg &c)
CFAlgoShowerCompat()
Default constructor.