LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 <iostream>
18 
19 #include "CPriorityAlgoBase.h"
20 #include "TStopwatch.h"
21 
22 namespace cmtool {
23 
30 
31  public:
32 
34  enum CMMSGLevel_t {
43  };
44 
45  public:
46 
48  CMManagerBase();
49 
51  virtual ~CMManagerBase(){}
52 
54  void DebugMode(CMMSGLevel_t level) {_debug_mode=level;}
55 
57  void ReportTimings(bool time_report=true) { _time_report = time_report; }
58 
60  void Reset();
61 
64 
66  void MergeTillConverge(bool doit=true) {_merge_till_converge = doit;}
67 
69  void SetClusters(const std::vector<std::vector<util::PxHit> > &clusters);
70  //void SetClusters(const std::vector<std::vector<larutil::PxHit> > &clusters);
71 
73  void SetClusters(const std::vector<cluster::ClusterParamsAlg> &clusters);
74 
76  const std::vector<cluster::ClusterParamsAlg>& GetInputClusters() const
77  { return _in_clusters; }
78 
80  void SetMinNHits(unsigned int n) { _min_nhits = n; }
81 
83  void Process();
84 
86  void SetAnaFile(TFile* fout) { _fout = fout; }
87 
88  protected:
89 
91  void ComputePriority(const std::vector<cluster::ClusterParamsAlg>& clusters);
92 
94  virtual void EventBegin(){}
95 
97  virtual void IterationBegin(){}
98 
100  virtual bool IterationProcess()=0;
101 
103  virtual void IterationEnd(){}
104 
106  virtual void EventEnd(){}
107 
108  protected:
109 
112 
114  unsigned int _min_nhits;
115 
118 
120  std::vector<cluster::ClusterParamsAlg> _in_clusters;
121 
124 
126  TFile* _fout;
127 
129  std::multimap<float,size_t> _priority;
130 
133 
135  std::set<UChar_t> _planes;
136 
137  };
138 }
139 
140 #endif
141  // end of doxygen group
142 
Somewhat verbose (cout per merging iteration)
Definition: CMManagerBase.h:38
bool _time_report
Timing verbosity flag.
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:86
void SetMinNHits(unsigned int n)
A setter for minimum # of hits ... passed onto ClusterParamsAlg.
Definition: CMManagerBase.h:80
void SetClusters(const std::vector< std::vector< util::PxHit > > &clusters)
A simple method to add a cluster.
std::multimap< float, size_t > _priority
Priority record.
void ComputePriority(const std::vector< cluster::ClusterParamsAlg > &clusters)
Function to compute priority.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Class def header for a class CPriorityAlgoBase.
const std::vector< cluster::ClusterParamsAlg > & GetInputClusters() const
A getter for input clusters.
Definition: CMManagerBase.h:76
virtual void EventBegin()
FMWK function called @ beginning of Process()
Definition: CMManagerBase.h:94
void Process()
A method to execute the main action, to be called per event.
virtual void IterationEnd()
FMWK function called @ end of iterative loop inside Process()
CMMSGLevel_t
Enum to specify message output level.
Definition: CMManagerBase.h:34
CMMSGLevel_t _debug_mode
Debug mode switch.
virtual void IterationBegin()
FMWK function called @ beginning of iterative loop inside Process()
Definition: CMManagerBase.h:97
virtual bool IterationProcess()=0
FMWK function called @ iterative loop inside Process()
virtual ~CMManagerBase()
Default destructor.
Definition: CMManagerBase.h:51
Bit verbose (cout per event)
Definition: CMManagerBase.h:40
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:54
Char_t n[5]
Extremely verbose (cout per individual algorithm execution)
Definition: CMManagerBase.h:36
void MergeTillConverge(bool doit=true)
Switch to continue merging till converges.
Definition: CMManagerBase.h:66
void AddPriorityAlgo(CPriorityAlgoBase *algo)
Setter to add an algorithm for priority determination.
Definition: CMManagerBase.h:63
virtual void EventEnd()
FMWK function called @ end of Process()
CMManagerBase()
Default constructor.
void ReportTimings(bool time_report=true)
Method to enable timing profile cout.
Definition: CMManagerBase.h:57
void Reset()
Method to reset itself.