LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CBAlgoArray.h
Go to the documentation of this file.
1 
14 #ifndef RECOTOOL_CBALGOARRAY_H
15 #define RECOTOOL_CBALGOARRAY_H
16 
19 
20 namespace cmtool {
26  class CBAlgoArray : public CBoolAlgoBase {
27 
28  public:
30  CBAlgoArray();
31 
33  virtual ~CBAlgoArray(){};
34 
36  void AddAlgo(CBoolAlgoBase* algo, bool ask_and = true)
37  {
38  if (ask_and) _last_and_algo_index = _algo_array.size();
39  _algo_array.push_back(algo);
40  _ask_and.push_back(ask_and);
41  }
42 
46  virtual void EventBegin(const std::vector<cluster::ClusterParamsAlg>& clusters);
47 
51  virtual void EventEnd();
52 
56  virtual void IterationBegin(const std::vector<cluster::ClusterParamsAlg>& clusters);
57 
61  virtual void IterationEnd();
62 
67  virtual bool Bool(const ::cluster::ClusterParamsAlg& cluster1,
68  const ::cluster::ClusterParamsAlg& cluster2);
69 
74  virtual void Report();
75 
77  virtual void SetVerbose(bool doit = true)
78  {
79  for (auto& algo : _algo_array)
80  algo->SetVerbose(doit);
81  }
82 
84  virtual void Reset();
85 
86  protected:
94  std::vector<CBoolAlgoBase*> _algo_array;
95 
100  std::vector<bool> _ask_and;
101 
104  };
105 }
106 #endif
107  // end of doxygen group
Class def header for algorithm classes for CMergeManager.
std::vector< bool > _ask_and
Definition: CBAlgoArray.h:100
virtual void Report()
Definition: CBAlgoArray.cxx:97
virtual void SetVerbose(bool doit=true)
Function to set verbosity.
Definition: CBAlgoArray.h:77
virtual ~CBAlgoArray()
Default destructor.
Definition: CBAlgoArray.h:33
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:6
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
Definition: CBAlgoArray.cxx:54
virtual void Reset()
Function to reset the algorithm instance ... maybe implemented via child class.
Definition: CBAlgoArray.cxx:14
std::vector< CBoolAlgoBase * > _algo_array
Definition: CBAlgoArray.h:94
virtual void IterationEnd()
Definition: CBAlgoArray.cxx:46
virtual void EventEnd()
Definition: CBAlgoArray.cxx:30
virtual void EventBegin(const std::vector< cluster::ClusterParamsAlg > &clusters)
Definition: CBAlgoArray.cxx:22
void AddAlgo(CBoolAlgoBase *algo, bool ask_and=true)
A simple method to add a one merging step.
Definition: CBAlgoArray.h:36