LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
cmtool Namespace Reference

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  CBAlgoShortestDist
 
class  CBAlgoShortestDistNonEndpoint
 
class  CBAlgoShortestDistSmallCluster
 
class  CBAlgoStartInCone
 
class  CBAlgoStartInPoly
 
class  CBAlgoStartNearEnd
 
class  CBAlgoStartTrack
 
class  CBAlgoTrackSeparate
 
class  CBoolAlgoBase
 
class  CFAlgo3DAngle
 
class  CFAlgoArray
 
class  CFAlgoChargeDistrib
 
class  CFAlgoQRatio
 
class  CFAlgoShowerCompat
 
class  CFAlgoStartPointCompat
 
class  CFAlgoStartPointMatch
 
class  CFAlgoStartTimeCompat
 
class  CFAlgoTimeOverlap
 
class  CFAlgoTimeProf
 
class  CFAlgoVolumeOverlap
 
class  CFAlgoWireOverlap
 
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 81 of file CMatchManager.cxx.

References fhicl::detail::atom::value().

Referenced by PlaneClusterCombinations().

82  {
83 
84  std::vector<size_t> ctr(seed.size(),0);
85 
86  std::vector<std::vector<size_t> > res;
87 
88  while(1) {
89 
90  res.push_back(std::vector<size_t>(seed.size(),0));
91  for(size_t index=0; index<ctr.size(); ++index)
92 
93  (*res.rbegin())[index] = ctr.at(index);
94 
95  for(size_t i=0; i<ctr.size(); ++i) {
96 
97  size_t index = (size_t)(ctr.size()-i-1);
98 
99  ctr.at(index) +=1;
100 
101  if(ctr.at(index) < seed.at(index))
102 
103  break;
104 
105  ctr.at(index) = 0;
106 
107  }
108 
109  bool abort = true;
110  for(auto const& value : ctr)
111 
112  abort = abort && (!(value));
113 
114  if(abort) break;
115  }
116  return res;
117  }
std::string value(boost::any const &)
unsigned int cmtool::CMFactorial ( unsigned int  n)

Definition at line 57 of file CMatchManager.cxx.

References n.

Referenced by SimpleCombination().

58  {return (n == 1 || n == 0) ? 1 : CMFactorial(n - 1) * n;}
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 119 of file CMatchManager.cxx.

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

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

120  {
121  // Result container
122  std::vector<std::vector<std::pair<size_t,size_t> > > result;
123 
124  // Loop over N-planes: start from max number of planes => down to 2 planes
125  for(size_t i=0; i<seed.size(); ++i) {
126 
127  // If finish making clusters down to 2 palnes, break
128  if(seed.size() < 2+i) break;
129 
130  // Compute possible N-plane combinations
131  auto const& plane_comb_v = SimpleCombination(seed.size(),seed.size()-i);
132 
133  // Loop over possible N-plane combinations
134  for(auto const& plane_comb : plane_comb_v){
135 
136  // Make a seed for cluster combinations
137  std::vector<size_t> cluster_seed_v;
138  cluster_seed_v.reserve(plane_comb.size());
139  for(auto const& index : plane_comb) cluster_seed_v.push_back(seed[index]);
140 
141  // Compute cluster combinations
142  for(auto const& cluster_comb : ClusterCombinations(cluster_seed_v)) {
143 
144  // Store result
145  result.push_back(std::vector<std::pair<size_t,size_t> >());
146  for(size_t i=0; i<cluster_comb.size(); ++i)
147 
148  (*result.rbegin()).push_back(std::make_pair(plane_comb.at(i),cluster_comb.at(i)));
149  }
150  }
151  }
152  return result;
153 
154  }
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 60 of file CMatchManager.cxx.

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

Referenced by PlaneClusterCombinations().

60  {
61 
62  if(!n || !r) exit(1);
63  if(r > n) exit(1);
64 
65  std::vector<bool> v(n,false);
66  std::fill(v.begin()+n-r,v.end(),true);
67  std::vector<std::vector<size_t> > res;
68  res.reserve(CMFactorial(n)/CMFactorial(n-r)/CMFactorial(r));
69 
70  do {
71  std::vector<size_t> tmp;
72  tmp.reserve(r);
73 
74  for(size_t i=0; i<n; ++i) { if(v[i]) tmp.push_back(i); }
75  res.push_back(tmp);
76  } while (std::next_permutation(v.begin(),v.end()));
77 
78  return res;
79  }
unsigned int CMFactorial(unsigned int n)
Float_t tmp
Definition: plot.C:37
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
Char_t n[5]