LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
CBAlgoArray.h
Go to the documentation of this file.
1 
14 #ifndef RECOTOOL_CBALGOARRAY_H
15 #define RECOTOOL_CBALGOARRAY_H
16 
17 #include <iostream>
19 
20 namespace cmtool {
26  class CBAlgoArray : public CBoolAlgoBase {
27 
28  public:
29 
31  CBAlgoArray();
32 
34  virtual ~CBAlgoArray(){};
35 
37  void AddAlgo(CBoolAlgoBase* algo,
38  bool ask_and = true)
39  {
40  if(ask_and) _last_and_algo_index = _algo_array.size();
41  _algo_array.push_back(algo);
42  _ask_and.push_back(ask_and);
43  }
44 
48  virtual void EventBegin(const std::vector<cluster::ClusterParamsAlg> &clusters);
49 
53  virtual void EventEnd();
54 
58  virtual void IterationBegin(const std::vector<cluster::ClusterParamsAlg> &clusters);
59 
63  virtual void IterationEnd();
64 
69  virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1,
70  const ::cluster::ClusterParamsAlg &cluster2);
71 
76  virtual void Report();
77 
79  virtual void SetVerbose(bool doit=true)
80  { for(auto &algo : _algo_array) algo->SetVerbose(doit); }
81 
83  virtual void Reset();
84 
85  protected:
86 
94  std::vector<CBoolAlgoBase*> _algo_array;
95 
100  std::vector<bool> _ask_and;
101 
104 
105  };
106 }
107 #endif
108  // end of doxygen group
109 
Class def header for algorithm classes for CMergeManager.
std::vector< bool > _ask_and
Definition: CBAlgoArray.h:100
virtual void Report()
Definition: CBAlgoArray.cxx:95
virtual void SetVerbose(bool doit=true)
Function to set verbosity.
Definition: CBAlgoArray.h:79
virtual ~CBAlgoArray()
Default destructor.
Definition: CBAlgoArray.h:34
virtual void IterationBegin(const std::vector< cluster::ClusterParamsAlg > &clusters)
Definition: CBAlgoArray.cxx:38
size_t _last_and_algo_index
Index of last AND condition algorithm to speed execution.
Definition: CBAlgoArray.h:103
CBAlgoArray()
Default constructor.
Definition: CBAlgoArray.cxx:9
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
Definition: CBAlgoArray.cxx:52
virtual void Reset()
Function to reset the algorithm instance ... maybe implemented via child class.
Definition: CBAlgoArray.cxx:17
std::vector< CBoolAlgoBase * > _algo_array
Definition: CBAlgoArray.h:94
virtual void IterationEnd()
Definition: CBAlgoArray.cxx:45
virtual void EventEnd()
Definition: CBAlgoArray.cxx:31
virtual void EventBegin(const std::vector< cluster::ClusterParamsAlg > &clusters)
Definition: CBAlgoArray.cxx:24
void AddAlgo(CBoolAlgoBase *algo, bool ask_and=true)
A simple method to add a one merging step.
Definition: CBAlgoArray.h:37