All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions

Classes

class  CFAlgoQRatio
 
class  CFAlgoShowerCompat
 
class  CFAlgoTimeOverlap
 
class  CFAlgoZOverlap
 
class  CBAlgoAngleAlign
 
class  CBAlgoAngleCompat
 
class  CBAlgoAngleIncompat
 
class  CBAlgoAngleSeparate
 
class  CBAlgoArray
 
class  CBAlgoCenterOfMass
 
class  CBAlgoCenterOfMassSmall
 
class  CBAlgoFake
 
class  CBAlgoMergeAll
 
class  CBAlgoMergeTinyWithBig
 
class  CBAlgoOutOfConeSeparate
 
class  CBAlgoPolyContain
 
class  CBAlgoPolyHitOverlap
 
class  CBAlgoPolyOverlap
 
class  CBAlgoPolyShortestDist
 
class  CBAlgoProhibitAllTracks
 
class  CBAlgoProhibitBigClusters
 
class  CBAlgoStartNearEnd
 
class  CBAlgoStartTrack
 
class  CPAlgoArray
 
class  CPAlgoIgnoreTracks
 
class  CPAlgoNHits
 
class  CPAlgoPolyArea
 
class  CPAlgoQSum
 
class  CMergeHelper
 
class  CBoolAlgoBase
 
class  CFloatAlgoBase
 
class  CMAlgoBase
 
class  CMatchBookKeeper
 
class  CMatchManager
 
class  CMergeBookKeeper
 
class  CMergeManager
 
class  CMManagerBase
 
class  CMTException
 
class  CPriorityAlgoBase
 

Functions

unsigned int CMFactorial (unsigned int n)
 
std::vector< std::vector
< size_t > > 
SimpleCombination (size_t n, size_t r)
 
std::vector< std::vector
< size_t > > 
ClusterCombinations (const std::vector< size_t > &seed)
 
std::vector< std::vector
< std::pair< size_t, size_t > > > 
PlaneClusterCombinations (const std::vector< size_t > &seed)
 

Function Documentation

std::vector<std::vector<size_t> > cmtool::ClusterCombinations ( const std::vector< size_t > &  seed)

Definition at line 107 of file CMatchManager.cxx.

108  {
109 
110  std::vector<size_t> ctr(seed.size(), 0);
111 
112  std::vector<std::vector<size_t>> res;
113 
114  while (1) {
115 
116  res.push_back(std::vector<size_t>(seed.size(), 0));
117  for (size_t index = 0; index < ctr.size(); ++index)
118 
119  (*res.rbegin())[index] = ctr.at(index);
120 
121  for (size_t i = 0; i < ctr.size(); ++i) {
122 
123  size_t index = (size_t)(ctr.size() - i - 1);
124 
125  ctr.at(index) += 1;
126 
127  if (ctr.at(index) < seed.at(index)) break;
128 
129  ctr.at(index) = 0;
130  }
131 
132  bool abort = true;
133  for (auto const& value : ctr)
134 
135  abort = abort && (!(value));
136 
137  if (abort) break;
138  }
139  return res;
140  }
temporary value
unsigned int cmtool::CMFactorial ( unsigned int  n)

Definition at line 76 of file CMatchManager.cxx.

77  {
78  return (n == 1 || n == 0) ? 1 : CMFactorial(n - 1) * n;
79  }
unsigned int CMFactorial(unsigned int n)
std::vector<std::vector<std::pair<size_t, size_t> > > cmtool::PlaneClusterCombinations ( const std::vector< size_t > &  seed)

Definition at line 143 of file CMatchManager.cxx.

144  {
145  // Result container
146  std::vector<std::vector<std::pair<size_t, size_t>>> result;
147 
148  // Loop over N-planes: start from max number of planes => down to 2 planes
149  for (size_t i = 0; i < seed.size(); ++i) {
150 
151  // If finish making clusters down to 2 palnes, break
152  if (seed.size() < 2 + i) break;
153 
154  // Compute possible N-plane combinations
155  auto const& plane_comb_v = SimpleCombination(seed.size(), seed.size() - i);
156 
157  // Loop over possible N-plane combinations
158  for (auto const& plane_comb : plane_comb_v) {
159 
160  // Make a seed for cluster combinations
161  std::vector<size_t> cluster_seed_v;
162  cluster_seed_v.reserve(plane_comb.size());
163  for (auto const& index : plane_comb)
164  cluster_seed_v.push_back(seed[index]);
165 
166  // Compute cluster combinations
167  for (auto const& cluster_comb : ClusterCombinations(cluster_seed_v)) {
168 
169  // Store result
170  result.push_back(std::vector<std::pair<size_t, size_t>>());
171  for (size_t i = 0; i < cluster_comb.size(); ++i)
172 
173  (*result.rbegin()).push_back(std::make_pair(plane_comb.at(i), cluster_comb.at(i)));
174  }
175  }
176  }
177  return result;
178  }
std::vector< std::vector< size_t > > ClusterCombinations(const std::vector< size_t > &seed)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
std::vector< std::vector< size_t > > SimpleCombination(size_t n, size_t r)
std::vector<std::vector<size_t> > cmtool::SimpleCombination ( size_t  n,
size_t  r 
)

Definition at line 82 of file CMatchManager.cxx.

83  {
84 
85  if (!n || !r) exit(1);
86  if (r > n) exit(1);
87 
88  std::vector<bool> v(n, false);
89  std::fill(v.begin() + n - r, v.end(), true);
90  std::vector<std::vector<size_t>> res;
91  res.reserve(CMFactorial(n) / CMFactorial(n - r) / CMFactorial(r));
92 
93  do {
94  std::vector<size_t> tmp;
95  tmp.reserve(r);
96 
97  for (size_t i = 0; i < n; ++i) {
98  if (v[i]) tmp.push_back(i);
99  }
100  res.push_back(tmp);
101  } while (std::next_permutation(v.begin(), v.end()));
102 
103  return res;
104  }
unsigned int CMFactorial(unsigned int n)
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
esac echo uname r