LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CPAlgoArray.cxx
Go to the documentation of this file.
2 
3 namespace cmtool {
4 
5  //-------------------------------------------------------
7  //-------------------------------------------------------
8  {
10  _algo_array.clear();
11  }
12 
13  //----------------------------------------------------------------------------------------------
15  //----------------------------------------------------------------------------------------------
16  {
17 
18  std::vector<float> score_array;
19  score_array.reserve(_algo_array.size());
20 
21  for (auto const& algo : _algo_array) {
22 
23  float score = algo->Priority(cluster);
24 
25  if (_mode != kSimpleAddition && score < 0) return score;
26 
27  score_array.push_back(score);
28  }
29 
30  float score_result = 0;
31 
32  switch (_mode) {
33 
34  case kLastAlgo: score_result = (*score_array.rbegin()); break;
35 
36  case kSimpleAddition:
37  case kPositiveAddition:
38 
39  for (auto const& score : score_array)
40  score_result += score;
41  break;
42 
43  case kMultiplication:
44 
45  for (auto const& score : score_array)
46  score_result *= score;
47  break;
48  }
49 
50  return score_result;
51  }
52 
53 }
Cluster finding and building.
CPAlgoArray()
Default constructor.
Definition: CPAlgoArray.cxx:6
Class def header for a class CPAlgoArray.
std::vector< CPriorityAlgoBase * > _algo_array
vector of algorithms
Definition: CPAlgoArray.h:130
virtual float Priority(const ::cluster::ClusterParamsAlg &cluster)
Definition: CPAlgoArray.cxx:14
EvaluationMode_t _mode
evaluation mode
Definition: CPAlgoArray.h:133