LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/

Classes

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  CBoolAlgoBase
 
class  CFAlgoQRatio
 
class  CFAlgoShowerCompat
 
class  CFAlgoTimeOverlap
 
class  CFAlgoZOverlap
 
class  CFloatAlgoBase
 
class  CMAlgoBase
 
class  CMatchBookKeeper
 
class  CMatchManager
 
class  CMergeBookKeeper
 
class  CMergeHelper
 
class  CMergeManager
 
class  CMManagerBase
 
class  CMTException
 
class  CPAlgoArray
 
class  CPAlgoIgnoreTracks
 
class  CPAlgoNHits
 
class  CPAlgoPolyArea
 
class  CPAlgoQSum
 
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 99 of file CMatchManager.cxx.

References value.

Referenced by PlaneClusterCombinations().

100  {
101 
102  std::vector<size_t> ctr(seed.size(), 0);
103 
104  std::vector<std::vector<size_t>> res;
105 
106  while (1) {
107 
108  res.push_back(std::vector<size_t>(seed.size(), 0));
109  for (size_t index = 0; index < ctr.size(); ++index)
110 
111  (*res.rbegin())[index] = ctr.at(index);
112 
113  for (size_t i = 0; i < ctr.size(); ++i) {
114 
115  size_t index = (size_t)(ctr.size() - i - 1);
116 
117  ctr.at(index) += 1;
118 
119  if (ctr.at(index) < seed.at(index)) break;
120 
121  ctr.at(index) = 0;
122  }
123 
124  bool abort = true;
125  for (auto const& value : ctr)
126 
127  abort = abort && (!(value));
128 
129  if (abort) break;
130  }
131  return res;
132  }
double value
Definition: spectrum.C:18
unsigned int cmtool::CMFactorial ( unsigned int  n)

Definition at line 70 of file CMatchManager.cxx.

References n.

Referenced by SimpleCombination().

71  {
72  return (n == 1 || n == 0) ? 1 : CMFactorial(n - 1) * n;
73  }
unsigned int CMFactorial(unsigned int n)
Char_t n[5]
std::vector<std::vector<std::pair<size_t, size_t> > > cmtool::PlaneClusterCombinations ( const std::vector< size_t > &  seed)

Definition at line 134 of file CMatchManager.cxx.

References ClusterCombinations(), SimpleCombination(), and lar::dump::vector().

Referenced by cmtool::CMatchManager::IterationProcess().

136  {
137  // Result container
138  std::vector<std::vector<std::pair<size_t, size_t>>> result;
139 
140  // Loop over N-planes: start from max number of planes => down to 2 planes
141  for (size_t i = 0; i < seed.size(); ++i) {
142 
143  // If finish making clusters down to 2 palnes, break
144  if (seed.size() < 2 + i) break;
145 
146  // Compute possible N-plane combinations
147  auto const& plane_comb_v = SimpleCombination(seed.size(), seed.size() - i);
148 
149  // Loop over possible N-plane combinations
150  for (auto const& plane_comb : plane_comb_v) {
151 
152  // Make a seed for cluster combinations
153  std::vector<size_t> cluster_seed_v;
154  cluster_seed_v.reserve(plane_comb.size());
155  for (auto const& index : plane_comb)
156  cluster_seed_v.push_back(seed[index]);
157 
158  // Compute cluster combinations
159  for (auto const& cluster_comb : ClusterCombinations(cluster_seed_v)) {
160 
161  // Store result
162  result.push_back(std::vector<std::pair<size_t, size_t>>());
163  for (size_t i = 0; i < cluster_comb.size(); ++i)
164 
165  (*result.rbegin()).push_back(std::make_pair(plane_comb.at(i), cluster_comb.at(i)));
166  }
167  }
168  }
169  return result;
170  }
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:289
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 75 of file CMatchManager.cxx.

References CMFactorial(), trkf::fill(), n, r, and tmp.

Referenced by PlaneClusterCombinations().

76  {
77 
78  if (!n || !r) exit(1);
79  if (r > n) exit(1);
80 
81  std::vector<bool> v(n, false);
82  std::fill(v.begin() + n - r, v.end(), true);
83  std::vector<std::vector<size_t>> res;
84  res.reserve(CMFactorial(n) / CMFactorial(n - r) / CMFactorial(r));
85 
86  do {
87  std::vector<size_t> tmp;
88  tmp.reserve(r);
89 
90  for (size_t i = 0; i < n; ++i) {
91  if (v[i]) tmp.push_back(i);
92  }
93  res.push_back(tmp);
94  } while (std::next_permutation(v.begin(), v.end()));
95 
96  return res;
97  }
unsigned int CMFactorial(unsigned int n)
TRandom r
Definition: spectrum.C:23
Float_t tmp
Definition: plot.C:35
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
Char_t n[5]