LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CMergeManager.h
Go to the documentation of this file.
1 
14 #ifndef RECOTOOL_CMERGEMANAGER_H
15 #define RECOTOOL_CMERGEMANAGER_H
16 
19 
21 #include <vector>
22 
23 namespace cmtool {
24 
25  class CBoolAlgoBase;
26 
32  class CMergeManager : public CMManagerBase {
33  public:
34  CMergeManager();
35 
37  virtual ~CMergeManager() {}
38 
40  virtual void Reset();
41 
43  void AddMergeAlgo(CBoolAlgoBase* algo) { _merge_algo = algo; }
44 
47 
49  const std::vector<cluster::ClusterParamsAlg>& GetClusters() const { return _out_clusters; }
50 
52  const CMergeBookKeeper& GetBookKeeper() const { return _book_keeper; }
53 
54  protected:
55  //
56  // FMWK functions override
57  //
58 
60  virtual void EventBegin();
61 
63  virtual void IterationBegin();
64 
66  virtual bool IterationProcess(util::GeometryUtilities const& gser);
67 
69  virtual void IterationEnd();
70 
72  virtual void EventEnd();
73 
74  protected:
75  void RunMerge(const std::vector<cluster::ClusterParamsAlg>& in_clusters,
76  CMergeBookKeeper& book_keeper) const;
77 
78  void RunMerge(const std::vector<cluster::ClusterParamsAlg>& in_clusters,
79  const std::vector<bool>& merge_flag,
80  CMergeBookKeeper& book_keeper) const;
81 
82  void RunSeparate(const std::vector<cluster::ClusterParamsAlg>& in_clusters,
83  CMergeBookKeeper& book_keeper) const;
84 
85  protected:
87  std::vector<cluster::ClusterParamsAlg> _out_clusters;
88 
91 
94 
97 
98  size_t _iter_ctr;
99 
100  std::vector<CMergeBookKeeper> _book_keeper_v;
101 
102  std::vector<std::vector<unsigned short>> _tmp_merged_indexes;
103 
104  std::vector<cluster::ClusterParamsAlg> _tmp_merged_clusters;
105  };
106 }
107 
108 #endif
109  // end of doxygen group
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:93
virtual void EventBegin()
FMWK function called @ beginning of Process()
std::vector< cluster::ClusterParamsAlg > _out_clusters
Output clusters.
Definition: CMergeManager.h:87
const std::vector< cluster::ClusterParamsAlg > & GetClusters() const
A method to obtain output clusters.
Definition: CMergeManager.h:49
std::vector< cluster::ClusterParamsAlg > _tmp_merged_clusters
virtual bool IterationProcess(util::GeometryUtilities const &gser)
FMWK function called @ iterative loop inside Process()
virtual void IterationEnd()
FMWK function called @ end of iterative loop inside Process()
virtual ~CMergeManager()
Default destructor.
Definition: CMergeManager.h:37
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.
Definition: CMergeManager.h:96
CMergeBookKeeper _book_keeper
Book keeper instance.
Definition: CMergeManager.h:90
virtual void Reset()
Method to reset itself.
void AddMergeAlgo(CBoolAlgoBase *algo)
A simple method to add an algorithm for merging.
Definition: CMergeManager.h:43
const CMergeBookKeeper & GetBookKeeper() const
A method to obtain book keeper.
Definition: CMergeManager.h:52
Class def header for a class CMManagerBase.
void AddSeparateAlgo(CBoolAlgoBase *algo)
A simple method to add an algorithm for separation.
Definition: CMergeManager.h:46