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