LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CMManagerBase.h
Go to the documentation of this file.
1 
14 #ifndef RECOTOOL_CMMANAGERBASE_H
15 #define RECOTOOL_CMMANAGERBASE_H
16 
17 #include <map>
18 #include <set>
19 #include <stddef.h>
20 #include <vector>
21 
22 #include "RtypesCore.h"
23 class TFile;
24 
27 
28 namespace util {
29  class GeometryUtilities;
30 }
31 
32 namespace cmtool {
33 
34  class CPriorityAlgoBase;
35 
41  class CMManagerBase {
42  public:
44  enum CMMSGLevel_t {
53  };
54 
56  CMManagerBase();
57 
59  virtual ~CMManagerBase() = default;
60 
62  void DebugMode(CMMSGLevel_t level) { _debug_mode = level; }
63 
65  void ReportTimings(bool time_report = true) { _time_report = time_report; }
66 
68  void Reset();
69 
71  void AddPriorityAlgo(CPriorityAlgoBase* algo) { _priority_algo = algo; }
72 
74  void MergeTillConverge(bool doit = true) { _merge_till_converge = doit; }
75 
77  void SetClusters(util::GeometryUtilities const& gser,
78  const std::vector<std::vector<util::PxHit>>& clusters);
79 
81  void SetClusters(const std::vector<cluster::ClusterParamsAlg>& clusters);
82 
84  const std::vector<cluster::ClusterParamsAlg>& GetInputClusters() const { return _in_clusters; }
85 
87  void SetMinNHits(unsigned int n) { _min_nhits = n; }
88 
90  void Process(util::GeometryUtilities const& gser);
91 
93  void SetAnaFile(TFile* fout) { _fout = fout; }
94 
95  protected:
97  void ComputePriority(const std::vector<cluster::ClusterParamsAlg>& clusters);
98 
100  virtual void EventBegin() {}
101 
103  virtual void IterationBegin() {}
104 
106  virtual bool IterationProcess(util::GeometryUtilities const& gser) = 0;
107 
109  virtual void IterationEnd() {}
110 
112  virtual void EventEnd() {}
113 
114  protected:
117 
119  unsigned int _min_nhits;
120 
123 
125  std::vector<cluster::ClusterParamsAlg> _in_clusters;
126 
129 
131  TFile* _fout;
132 
134  std::multimap<float, size_t> _priority;
135 
138 
140  std::set<UChar_t> _planes;
141  };
142 }
143 
144 #endif
145  // end of doxygen group
Somewhat verbose (cout per merging iteration)
Definition: CMManagerBase.h:48
bool _time_report
Timing verbosity flag.
Namespace for general, non-LArSoft-specific utilities.
Definition: PIDAAlg.h:26
bool _merge_till_converge
Iteration loop switch.
TFile * _fout
Output analysis plot TFile.
void SetAnaFile(TFile *fout)
A setter for an analysis output file.
Definition: CMManagerBase.h:93
void SetMinNHits(unsigned int n)
A setter for minimum # of hits ... passed onto ClusterParamsAlg.
Definition: CMManagerBase.h:87
no compression
Definition: RawTypes.h:9
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
const std::vector< cluster::ClusterParamsAlg > & GetInputClusters() const
A getter for input clusters.
Definition: CMManagerBase.h:84
virtual void EventBegin()
FMWK function called @ beginning of Process()
std::multimap< float, size_t > _priority
Priority record.
ntupleExperimental Reset()
virtual void IterationEnd()
FMWK function called @ end of iterative loop inside Process()
CMMSGLevel_t
Enum to specify message output level.
Definition: CMManagerBase.h:44
CMMSGLevel_t _debug_mode
Debug mode switch.
virtual void IterationBegin()
FMWK function called @ beginning of iterative loop inside Process()
Bit verbose (cout per event)
Definition: CMManagerBase.h:50
unsigned int _min_nhits
Minimum number of hits: the limit set for ClusterParamsAlg.
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
std::set< UChar_t > _planes
A holder for # of unique planes in the clusters, computed in ComputePriority() function.
void DebugMode(CMMSGLevel_t level)
Method to enable debug mode (lots of couts)
Definition: CMManagerBase.h:62
Char_t n[5]
Extremely verbose (cout per individual algorithm execution)
Definition: CMManagerBase.h:46
void MergeTillConverge(bool doit=true)
Switch to continue merging till converges.
Definition: CMManagerBase.h:74
void AddPriorityAlgo(CPriorityAlgoBase *algo)
Setter to add an algorithm for priority determination.
Definition: CMManagerBase.h:71
virtual void EventEnd()
FMWK function called @ end of Process()
void ReportTimings(bool time_report=true)
Method to enable timing profile cout.
Definition: CMManagerBase.h:65