LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
CMergeManager.h
Go to the documentation of this file.
1 
14 #ifndef RECOTOOL_CMERGEMANAGER_H
15 #define RECOTOOL_CMERGEMANAGER_H
16 
17 #include <iostream>
18 
19 #include "CMManagerBase.h"
20 #include "CMergeBookKeeper.h"
21 #include "CBoolAlgoBase.h"
22 
23 namespace cmtool {
24 
30  class CMergeManager : public CMManagerBase {
31 
32  public:
33 
35  CMergeManager();
36 
38  virtual ~CMergeManager(){}
39 
41  virtual void Reset();
42 
44  void AddMergeAlgo(CBoolAlgoBase* algo) {_merge_algo = algo;}
45 
48 
50  const std::vector<cluster::ClusterParamsAlg>& GetClusters() const { return _out_clusters; }
51 
53  const CMergeBookKeeper& GetBookKeeper() const { return _book_keeper; }
54 
55  protected:
56 
57  //
58  // FMWK functions override
59  //
60 
62  virtual void EventBegin();
63 
65  virtual void IterationBegin();
66 
68  virtual bool IterationProcess();
69 
71  virtual void IterationEnd();
72 
74  virtual void EventEnd();
75 
76  protected:
77 
78  void RunMerge(const std::vector<cluster::ClusterParamsAlg > &in_clusters,
79  CMergeBookKeeper &book_keeper) const;
80 
81  void RunMerge(const std::vector<cluster::ClusterParamsAlg > &in_clusters,
82  const std::vector<bool> &merge_flag,
83  CMergeBookKeeper &book_keeper) const;
84 
85  void RunSeparate(const std::vector<cluster::ClusterParamsAlg > &in_clusters,
86  CMergeBookKeeper &book_keeper) const;
87 
88  protected:
89 
91  std::vector<cluster::ClusterParamsAlg> _out_clusters;
92 
95 
98 
101 
102  size_t _iter_ctr;
103 
104  std::vector<CMergeBookKeeper> _book_keeper_v;
105 
106  std::vector<std::vector<unsigned short> > _tmp_merged_indexes;
107 
108  std::vector<cluster::ClusterParamsAlg> _tmp_merged_clusters;
109 
110  };
111 }
112 
113 #endif
114  // end of doxygen group
115 
Class def header for algorithm classes for CMergeManager.
virtual bool IterationProcess()
FMWK function called @ iterative loop inside Process()
virtual void EventEnd()
FMWK function called @ end of Process()
std::vector< CMergeBookKeeper > _book_keeper_v
std::vector< std::vector< unsigned short > > _tmp_merged_indexes
::cmtool::CBoolAlgoBase * _merge_algo
Merging algorithm.
Definition: CMergeManager.h:97
virtual void EventBegin()
FMWK function called @ beginning of Process()
std::vector< cluster::ClusterParamsAlg > _out_clusters
Output clusters.
Definition: CMergeManager.h:91
CMergeManager()
Default constructor.
const std::vector< cluster::ClusterParamsAlg > & GetClusters() const
A method to obtain output clusters.
Definition: CMergeManager.h:50
std::vector< cluster::ClusterParamsAlg > _tmp_merged_clusters
virtual void IterationEnd()
FMWK function called @ end of iterative loop inside Process()
virtual ~CMergeManager()
Default destructor.
Definition: CMergeManager.h:38
Class def header for a class CMergeBookKeeper.
virtual void IterationBegin()
FMWK function called @ beginning of iterative loop inside Process()
void RunMerge(const std::vector< cluster::ClusterParamsAlg > &in_clusters, CMergeBookKeeper &book_keeper) const
void RunSeparate(const std::vector< cluster::ClusterParamsAlg > &in_clusters, CMergeBookKeeper &book_keeper) const
::cmtool::CBoolAlgoBase * _separate_algo
Separation algorithm.
CMergeBookKeeper _book_keeper
Book keeper instance.
Definition: CMergeManager.h:94
virtual void Reset()
Method to reset itself.
void AddMergeAlgo(CBoolAlgoBase *algo)
A simple method to add an algorithm for merging.
Definition: CMergeManager.h:44
const CMergeBookKeeper & GetBookKeeper() const
A method to obtain book keeper.
Definition: CMergeManager.h:53
Class def header for a class CMManagerBase.
void AddSeparateAlgo(CBoolAlgoBase *algo)
A simple method to add an algorithm for separation.
Definition: CMergeManager.h:47