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

#include "CMatchManager.h"

Inheritance diagram for cmtool::CMatchManager:
cmtool::CMManagerBase

Public Types

enum  CMMSGLevel_t { kPerMerging, kPerIteration, kPerEvent, kNone }
 Enum to specify message output level. More...
 

Public Member Functions

 CMatchManager (size_t nplanes)
 
virtual ~CMatchManager ()
 Default destructor. More...
 
virtual void Reset ()
 Method to reset itself. More...
 
void AddMatchAlgo (CFloatAlgoBase *algo)
 A simple method to add an algorithm for merging. More...
 
const CMatchBookKeeperGetBookKeeper () const
 A method to obtain book keeper. More...
 
void DebugMode (CMMSGLevel_t level)
 Method to enable debug mode (lots of couts) More...
 
void ReportTimings (bool time_report=true)
 Method to enable timing profile cout. More...
 
void AddPriorityAlgo (CPriorityAlgoBase *algo)
 Setter to add an algorithm for priority determination. More...
 
void MergeTillConverge (bool doit=true)
 Switch to continue merging till converges. More...
 
void SetClusters (const std::vector< std::vector< util::PxHit > > &clusters)
 A simple method to add a cluster. More...
 
void SetClusters (const std::vector< cluster::ClusterParamsAlg > &clusters)
 A simple method to add a cluster. More...
 
const std::vector< cluster::ClusterParamsAlg > & GetInputClusters () const
 A getter for input clusters. More...
 
void SetMinNHits (unsigned int n)
 A setter for minimum # of hits ... passed onto ClusterParamsAlg. More...
 
void Process ()
 A method to execute the main action, to be called per event. More...
 
void SetAnaFile (TFile *fout)
 A setter for an analysis output file. More...
 

Protected Member Functions

virtual void EventBegin ()
 FMWK function called @ beginning of Process() More...
 
virtual void IterationBegin ()
 FMWK function called @ beginning of iterative loop inside Process() More...
 
virtual bool IterationProcess ()
 FMWK function called @ iterative loop inside Process() More...
 
virtual void IterationEnd ()
 FMWK function called @ end of iterative loop inside Process() More...
 
virtual void EventEnd ()
 FMWK function called @ end of Process() More...
 
void ComputePriority (const std::vector< cluster::ClusterParamsAlg > &clusters)
 Function to compute priority. More...
 

Protected Attributes

CMatchBookKeeper _book_keeper
 Book keeper instance. More...
 
::cmtool::CFloatAlgoBase_match_algo
 Merging algorithm. More...
 
size_t _nplanes
 Number of planes. More...
 
bool _time_report
 Timing verbosity flag. More...
 
unsigned int _min_nhits
 Minimum number of hits: the limit set for ClusterParamsAlg. More...
 
CMMSGLevel_t _debug_mode
 Debug mode switch. More...
 
std::vector< cluster::ClusterParamsAlg_in_clusters
 Input clusters. More...
 
::cmtool::CPriorityAlgoBase_priority_algo
 Priority algorithm. More...
 
TFile * _fout
 Output analysis plot TFile. More...
 
std::multimap< float, size_t > _priority
 Priority record. More...
 
bool _merge_till_converge
 Iteration loop switch. More...
 
std::set< UChar_t > _planes
 A holder for # of unique planes in the clusters, computed in ComputePriority() function. More...
 

Private Member Functions

 CMatchManager ()
 Default constructor is private because we need an argument to configure w/ # planes in the detector. More...
 

Detailed Description

A class that instantiates merging algorithm(s) and run. The book-keeping of merged cluster sets are done by CMatchBookKeeper.

Definition at line 30 of file CMatchManager.h.

Member Enumeration Documentation

Enum to specify message output level.

Enumerator
kPerMerging 

Extremely verbose (cout per individual algorithm execution)

kPerIteration 

Somewhat verbose (cout per merging iteration)

kPerEvent 

Bit verbose (cout per event)

kNone 

Normal.

Definition at line 34 of file CMManagerBase.h.

34  {
40  kPerEvent,
42  kNone
43  };
Somewhat verbose (cout per merging iteration)
Definition: CMManagerBase.h:38
Bit verbose (cout per event)
Definition: CMManagerBase.h:40
Extremely verbose (cout per individual algorithm execution)
Definition: CMManagerBase.h:36

Constructor & Destructor Documentation

cmtool::CMatchManager::CMatchManager ( )
private

Default constructor is private because we need an argument to configure w/ # planes in the detector.

Definition at line 8 of file CMatchManager.cxx.

8  : CMManagerBase()
9  {
10  throw CMTException("Default ctor needs # planes as an argument!");
11  }
CMManagerBase()
Default constructor.
cmtool::CMatchManager::CMatchManager ( size_t  nplanes)

Definition at line 13 of file CMatchManager.cxx.

References _match_algo, _nplanes, and Reset().

13  : CMManagerBase()
14  {
15  _match_algo = nullptr;
16  _nplanes = nplanes;
17  Reset();
18  }
virtual void Reset()
Method to reset itself.
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
size_t _nplanes
Number of planes.
Definition: CMatchManager.h:83
CMManagerBase()
Default constructor.
virtual cmtool::CMatchManager::~CMatchManager ( )
inlinevirtual

Default destructor.

Definition at line 42 of file CMatchManager.h.

References Reset().

42 {}

Member Function Documentation

void cmtool::CMatchManager::AddMatchAlgo ( CFloatAlgoBase algo)
inline

A simple method to add an algorithm for merging.

Definition at line 48 of file CMatchManager.h.

References _match_algo.

Referenced by ShowerReco3D::ShowerReco3D().

48 {_match_algo = algo;}
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
void cmtool::CMManagerBase::AddPriorityAlgo ( CPriorityAlgoBase algo)
inlineinherited

Setter to add an algorithm for priority determination.

Definition at line 63 of file CMManagerBase.h.

References cmtool::CMManagerBase::_priority_algo.

Referenced by cluster::FuzzyClusterMerger::FuzzyClusterMerger(), and ShowerReco3D::ShowerReco3D().

63 { _priority_algo = algo; }
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
void cmtool::CMManagerBase::ComputePriority ( const std::vector< cluster::ClusterParamsAlg > &  clusters)
protectedinherited

Function to compute priority.

Definition at line 147 of file CMManagerBase.cxx.

References cmtool::CMManagerBase::_planes, cmtool::CMManagerBase::_priority, cmtool::CMManagerBase::_priority_algo, cmtool::CMManagerBase::_time_report, and cmtool::CPriorityAlgoBase::Priority().

Referenced by IterationProcess(), cmtool::CMergeManager::IterationProcess(), and cmtool::CMManagerBase::SetAnaFile().

147  {
148 
149  TStopwatch localWatch;
150  localWatch.Start();
151 
152  _priority.clear();
153  _planes.clear();
154 
155  if(!clusters.size()) return;
156 
157  // Priority is computed cluster-by-cluster. In case of two clusters having the same priority
158  // value the one with lower cluster index gets the priority. Also, clusters with priority < 0
159  // are not logged (assumed not to be used)
160 
161  for(size_t i=0; i<clusters.size(); ++i) {
162 
163  size_t c_index = clusters.size() - i - 1;
164 
165  float priority = clusters.at(c_index).GetNHits();
166 
167  if(_priority_algo) {
168 
169  priority = _priority_algo->Priority(clusters.at(c_index));
170 
171  }
172 
173  if(priority>0) {
174 
175  _priority.insert(std::make_pair(priority,c_index));
176 
177  if( _planes.find(clusters.at(c_index).Plane()) == _planes.end() )
178 
179  _planes.insert(clusters.at(c_index).Plane());
180 
181  }
182 
183  }
184 
185  if(_time_report) std::cout << Form(" CMManagerBase Time Report: ComputePriority = %g [s]",
186  localWatch.RealTime())
187  << std::endl;
188 
189  }
bool _time_report
Timing verbosity flag.
std::multimap< float, size_t > _priority
Priority record.
virtual float Priority(const cluster::ClusterParamsAlg &cluster)
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
std::set< UChar_t > _planes
A holder for # of unique planes in the clusters, computed in ComputePriority() function.
void cmtool::CMManagerBase::DebugMode ( CMMSGLevel_t  level)
inlineinherited

Method to enable debug mode (lots of couts)

Definition at line 54 of file CMManagerBase.h.

References cmtool::CMManagerBase::_debug_mode.

Referenced by cluster::SimpleClusterMerger::SimpleClusterMerger().

54 {_debug_mode=level;}
CMMSGLevel_t _debug_mode
Debug mode switch.
void cmtool::CMatchManager::EventBegin ( )
protectedvirtual

FMWK function called @ beginning of Process()

Reimplemented from cmtool::CMManagerBase.

Definition at line 28 of file CMatchManager.cxx.

References cmtool::CMManagerBase::_debug_mode, cmtool::CMManagerBase::_in_clusters, _match_algo, cmtool::CMManagerBase::_priority_algo, cmtool::CMAlgoBase::IterationBegin(), cmtool::CMManagerBase::kPerMerging, and cmtool::CMAlgoBase::SetVerbose().

Referenced by GetBookKeeper().

29  {
30  if(_debug_mode <= kPerMerging) {
33  }
34 
37  }
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
CMMSGLevel_t _debug_mode
Debug mode switch.
virtual void IterationBegin(const std::vector< cluster::ClusterParamsAlg > &clusters)
Definition: CMAlgoBase.h:59
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
virtual void SetVerbose(bool doit=true)
Setter function for verbosity.
Definition: CMAlgoBase.h:80
Extremely verbose (cout per individual algorithm execution)
Definition: CMManagerBase.h:36
void cmtool::CMatchManager::EventEnd ( )
protectedvirtual

FMWK function called @ end of Process()

Reimplemented from cmtool::CMManagerBase.

Definition at line 51 of file CMatchManager.cxx.

References _match_algo, cmtool::CMManagerBase::_priority_algo, and cmtool::CMAlgoBase::EventEnd().

Referenced by GetBookKeeper().

52  {
55  }
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
virtual void EventEnd()
Definition: CMAlgoBase.h:51
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
const CMatchBookKeeper& cmtool::CMatchManager::GetBookKeeper ( ) const
inline

A method to obtain book keeper.

Definition at line 51 of file CMatchManager.h.

References _book_keeper, EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), and IterationProcess().

Referenced by showerreco::ShowerRecoManager::Reconstruct().

51 { return _book_keeper; }
CMatchBookKeeper _book_keeper
Book keeper instance.
Definition: CMatchManager.h:77
const std::vector<cluster::ClusterParamsAlg>& cmtool::CMManagerBase::GetInputClusters ( ) const
inlineinherited

A getter for input clusters.

Definition at line 76 of file CMManagerBase.h.

References cmtool::CMManagerBase::_in_clusters.

Referenced by showerreco::ShowerRecoManager::Process().

77  { return _in_clusters; }
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
void cmtool::CMatchManager::IterationBegin ( )
protectedvirtual

FMWK function called @ beginning of iterative loop inside Process()

Reimplemented from cmtool::CMManagerBase.

Definition at line 39 of file CMatchManager.cxx.

References cmtool::CMManagerBase::_in_clusters, _match_algo, cmtool::CMManagerBase::_priority_algo, and cmtool::CMAlgoBase::IterationBegin().

Referenced by GetBookKeeper().

40  {
43  }
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
virtual void IterationBegin(const std::vector< cluster::ClusterParamsAlg > &clusters)
Definition: CMAlgoBase.h:59
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
void cmtool::CMatchManager::IterationEnd ( )
protectedvirtual

FMWK function called @ end of iterative loop inside Process()

Reimplemented from cmtool::CMManagerBase.

Definition at line 45 of file CMatchManager.cxx.

References _match_algo, cmtool::CMManagerBase::_priority_algo, and cmtool::CMAlgoBase::IterationEnd().

Referenced by GetBookKeeper().

46  {
49  }
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
virtual void IterationEnd()
Definition: CMAlgoBase.h:65
bool cmtool::CMatchManager::IterationProcess ( )
protectedvirtual

FMWK function called @ iterative loop inside Process()

Implements cmtool::CMManagerBase.

Definition at line 156 of file CMatchManager.cxx.

References _book_keeper, cmtool::CMManagerBase::_debug_mode, cmtool::CMManagerBase::_in_clusters, _match_algo, _nplanes, cmtool::CMManagerBase::_planes, cmtool::CMManagerBase::_priority, cmtool::CMManagerBase::_priority_algo, cmtool::CMManagerBase::ComputePriority(), cmtool::CFloatAlgoBase::Float(), cmtool::CMManagerBase::kPerIteration, cmtool::CMManagerBase::kPerMerging, cmtool::CMatchBookKeeper::Match(), cmtool::PlaneClusterCombinations(), cmtool::CMAlgoBase::Report(), and seed.

Referenced by GetBookKeeper().

157  {
158 
159  TStopwatch localWatch;
160 
161  //
162  // Create plane-by-plane vectors
163  //
165 
166  if(_planes.size()<2) return false;
167 
168  if(_planes.size() > _nplanes)
169 
170  throw CMTException("Found more plane IDs than specified number of planes!");
171 
172  // Index array of clusters per plane
173  std::vector<std::vector<size_t> > cluster_array;
174 
175  // Resize to # of planes w/ clusters
176  cluster_array.reserve(_planes.size());
177 
178  // plane-to-index map
179  std::vector<size_t> plane_to_index(_nplanes,_nplanes);
180 
181  // Fill plane-to-index map
182  for(size_t plane=0; plane<_nplanes; ++plane){
183 
184  if( _planes.find(plane) != _planes.end() ) {
185 
186  plane_to_index[plane] = cluster_array.size();
187 
188  cluster_array.push_back(std::vector<size_t>());
189  }
190  }
191 
192  // Fill cluster_array
193  for(auto riter = _priority.rbegin();
194  riter != _priority.rend();
195  ++riter)
196 
197  cluster_array.at( plane_to_index.at(_in_clusters.at((*riter).second).Plane()) ).push_back((*riter).second);
198 
199  // Find combinations
200  std::vector<size_t> seed;
201  seed.reserve(cluster_array.size());
202  for(auto const& clusters_per_plane : cluster_array)
203 
204  seed.push_back(clusters_per_plane.size());
205 
206  auto const& combinations = PlaneClusterCombinations(seed);
207 
208  // Loop over combinations and call algorithm
209  for(auto const& comb : combinations) {
210 
211  std::vector<const cluster::ClusterParamsAlg*> ptr_v;
212 
213  std::vector<unsigned int> tmp_index_v;
214 
215  tmp_index_v.reserve(comb.size());
216 
217  ptr_v.reserve(comb.size());
218 
219  for(auto const& plane_cluster : comb) {
220 
221  auto const& in_cluster_index = cluster_array.at(plane_cluster.first).at(plane_cluster.second);
222 
223  tmp_index_v.push_back(in_cluster_index);
224 
225  ptr_v.push_back(&(_in_clusters.at(in_cluster_index)));
226 
227  }
228 
229  if(_debug_mode <= kPerMerging){
230 
231  std::cout
232  << " \033[93m"
233  << "Inspecting a pair (";
234  for(auto const& index : tmp_index_v)
235  std::cout << index << " ";
236  std::cout<<") \033[00m" << std::flush;
237 
238  localWatch.Start();
239 
240  }
241 
242  auto const& score = _match_algo->Float(ptr_v);
243 
244  if(_debug_mode <= kPerMerging)
245 
246  std::cout << " ... Time taken = " << localWatch.RealTime() << " [s]" << std::endl;
247 
248  if(score>0)
249 
250  _book_keeper.Match(tmp_index_v,score);
251 
252  }
253 
254  if(_debug_mode <= kPerIteration) {
257  }
258 
259  return false;
260 
261  }
Somewhat verbose (cout per merging iteration)
Definition: CMManagerBase.h:38
virtual void Report()
Definition: CMAlgoBase.h:73
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
std::multimap< float, size_t > _priority
Priority record.
CMatchBookKeeper _book_keeper
Book keeper instance.
Definition: CMatchManager.h:77
void ComputePriority(const std::vector< cluster::ClusterParamsAlg > &clusters)
Function to compute priority.
void Match(const std::vector< unsigned int > &matched_indexes, const float &score)
Method to register matched clusters.
long seed
Definition: chem4.cc:68
std::vector< std::vector< std::pair< size_t, size_t > > > PlaneClusterCombinations(const std::vector< size_t > &seed)
virtual float Float(const std::vector< const cluster::ClusterParamsAlg * > &clusters)
CMMSGLevel_t _debug_mode
Debug mode switch.
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
std::set< UChar_t > _planes
A holder for # of unique planes in the clusters, computed in ComputePriority() function.
Extremely verbose (cout per individual algorithm execution)
Definition: CMManagerBase.h:36
size_t _nplanes
Number of planes.
Definition: CMatchManager.h:83
void cmtool::CMManagerBase::MergeTillConverge ( bool  doit = true)
inlineinherited
void cmtool::CMManagerBase::Process ( )
inherited

A method to execute the main action, to be called per event.

Definition at line 83 of file CMManagerBase.cxx.

References cmtool::CMManagerBase::_debug_mode, cmtool::CMManagerBase::_in_clusters, cmtool::CMManagerBase::_merge_till_converge, cmtool::CMManagerBase::_time_report, cmtool::CMManagerBase::EventBegin(), cmtool::CMManagerBase::EventEnd(), cmtool::CMManagerBase::IterationBegin(), cmtool::CMManagerBase::IterationEnd(), cmtool::CMManagerBase::IterationProcess(), and cmtool::CMManagerBase::kPerIteration.

Referenced by cluster::ClusterMergeHelper::Process(), showerreco::ShowerRecoManager::Reconstruct(), and cmtool::CMManagerBase::SetMinNHits().

84  {
85 
86  if(!(_in_clusters.size()))
87 
88  return;
89 
90  TStopwatch localWatch;
91 
92  localWatch.Start();
93 
94  EventBegin();
95 
96  if(_time_report) std::cout << Form(" CMManagerBase Time Report: EventBegin = %g [s]",
97  localWatch.RealTime())
98  << std::endl;
99 
100  bool keep_going = true;
101 
102  while(keep_going) {
103 
104  localWatch.Start();
105 
106  IterationBegin();
107 
108  if(_time_report) std::cout << Form(" CMManagerBase Time Report: IterationBegin = %g [s]",
109  localWatch.RealTime())
110  << std::endl;
111 
112  localWatch.Start();
113 
114  keep_going = IterationProcess();
115 
116  if(_time_report) std::cout << Form(" CMManagerBase Time Report: IterationProcess = %g [s]",
117  localWatch.RealTime())
118  << std::endl;
119  localWatch.Start();
120 
121  IterationEnd();
122 
123  if(_time_report) std::cout << Form(" CMManagerBase Time Report: IterationEnd = %g [s]",
124  localWatch.RealTime())
125  << std::endl;
126 
127  if(!_merge_till_converge) {
128 
130 
131  std::cout << "\033[93m Iterative approach = OFF ... exiting from iteration loop. \033[00m" << std::endl;
132 
133  break;
134  }
135  }
136 
137  localWatch.Start();
138 
139  EventEnd();
140 
141  if(_time_report) std::cout << Form(" CMManagerBase Time Report: EventEnd = %g [s]",
142  localWatch.RealTime())
143  << std::endl;
144 
145  }
Somewhat verbose (cout per merging iteration)
Definition: CMManagerBase.h:38
bool _time_report
Timing verbosity flag.
bool _merge_till_converge
Iteration loop switch.
virtual void EventBegin()
FMWK function called @ beginning of Process()
Definition: CMManagerBase.h:94
virtual void IterationEnd()
FMWK function called @ end of iterative loop inside Process()
CMMSGLevel_t _debug_mode
Debug mode switch.
virtual void IterationBegin()
FMWK function called @ beginning of iterative loop inside Process()
Definition: CMManagerBase.h:97
virtual bool IterationProcess()=0
FMWK function called @ iterative loop inside Process()
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
virtual void EventEnd()
FMWK function called @ end of Process()
void cmtool::CMManagerBase::ReportTimings ( bool  time_report = true)
inlineinherited

Method to enable timing profile cout.

Definition at line 57 of file CMManagerBase.h.

References cmtool::CMManagerBase::_time_report, and cmtool::CMManagerBase::Reset().

57 { _time_report = time_report; }
bool _time_report
Timing verbosity flag.
void cmtool::CMatchManager::Reset ( )
virtual

Method to reset itself.

Definition at line 20 of file CMatchManager.cxx.

References _book_keeper, _match_algo, cmtool::CMManagerBase::_priority_algo, cmtool::CMatchBookKeeper::Reset(), cmtool::CMAlgoBase::Reset(), and cmtool::CMManagerBase::Reset().

Referenced by CMatchManager(), showerreco::ShowerRecoManager::Reset(), and ~CMatchManager().

21  {
26  }
::cmtool::CFloatAlgoBase * _match_algo
Merging algorithm.
Definition: CMatchManager.h:80
CMatchBookKeeper _book_keeper
Book keeper instance.
Definition: CMatchManager.h:77
virtual void Reset()
Function to reset the algorithm instance called within CMergeManager/CMatchManager&#39;s Reset() ...
Definition: CMAlgoBase.h:40
::cmtool::CPriorityAlgoBase * _priority_algo
Priority algorithm.
void Reset()
Reset method.
void Reset()
Method to reset itself.
void cmtool::CMManagerBase::SetAnaFile ( TFile *  fout)
inlineinherited

A setter for an analysis output file.

Definition at line 86 of file CMManagerBase.h.

References cmtool::CMManagerBase::_fout, and cmtool::CMManagerBase::ComputePriority().

86 { _fout = fout; }
TFile * _fout
Output analysis plot TFile.
void cmtool::CMManagerBase::SetClusters ( const std::vector< std::vector< util::PxHit > > &  clusters)
inherited

A simple method to add a cluster.

Definition at line 26 of file CMManagerBase.cxx.

References cmtool::CMManagerBase::_in_clusters, cmtool::CMManagerBase::_min_nhits, cmtool::CMManagerBase::_time_report, Initialize(), cmtool::CMManagerBase::Reset(), cluster::ClusterParamsAlg::SetMinNHits(), and cluster::ClusterParamsAlg::SetVerbose().

Referenced by cmtool::CMManagerBase::MergeTillConverge(), showerreco::ShowerRecoManager::Reconstruct(), and cluster::ClusterMergeHelper::SetClusters().

27  {
28 
29  TStopwatch localWatch;
30 
31  // Reset
32  this->Reset();
33 
34  // Clear & fill cluster info
35 
36  _in_clusters.clear();
37 
38  _in_clusters.reserve(clusters.size());
39 
41  tmp_alg.SetMinNHits(_min_nhits);
42  tmp_alg.SetVerbose(false);
43 
44  for(auto const &c : clusters) {
45 
46  _in_clusters.push_back(tmp_alg);
47  (*_in_clusters.rbegin()).Initialize();
48 
49  if((*_in_clusters.rbegin()).SetHits(c) < 3) continue;
50  (*_in_clusters.rbegin()).DisableFANN();
51  //(*_in_clusters.rbegin()).FillParams(true,true,true,true,true,false);
52  (*_in_clusters.rbegin()).FillParams(false,false,false,false,false,false);
53  (*_in_clusters.rbegin()).FillPolygon();
54 
55  }
56 
57  if(_time_report) {
58  std::cout << Form(" CMManagerBase Time Report: SetClusters (CPAN computation) = %g [s]",
59  localWatch.RealTime())
60  << " ... details below." << std::endl;
61 
62  for(auto const& c : _in_clusters)
63 
64  c.TimeReport(std::cout);
65 
66  }
67 
68  }
bool _time_report
Timing verbosity flag.
void Initialize()
Definition: errprop.cc:101
void SetMinNHits(size_t nhit)
unsigned int _min_nhits
Minimum number of hits: the limit set for ClusterParamsAlg.
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
void SetVerbose(bool yes=true)
void Reset()
Method to reset itself.
void cmtool::CMManagerBase::SetClusters ( const std::vector< cluster::ClusterParamsAlg > &  clusters)
inherited

A simple method to add a cluster.

Definition at line 70 of file CMManagerBase.cxx.

References cmtool::CMManagerBase::_in_clusters, and cmtool::CMManagerBase::_time_report.

71  {
72  TStopwatch localWatch;
73 
74  localWatch.Start();
75 
76  _in_clusters = clusters;
77 
78  if(_time_report) std::cout << Form(" CMManagerBase Time Report: SetClusters (copy) = %g [s]",
79  localWatch.RealTime())
80  << std::endl;
81  }
bool _time_report
Timing verbosity flag.
std::vector< cluster::ClusterParamsAlg > _in_clusters
Input clusters.
void cmtool::CMManagerBase::SetMinNHits ( unsigned int  n)
inlineinherited

A setter for minimum # of hits ... passed onto ClusterParamsAlg.

Definition at line 80 of file CMManagerBase.h.

References cmtool::CMManagerBase::_min_nhits, n, and cmtool::CMManagerBase::Process().

80 { _min_nhits = n; }
unsigned int _min_nhits
Minimum number of hits: the limit set for ClusterParamsAlg.
Char_t n[5]

Member Data Documentation

CMatchBookKeeper cmtool::CMatchManager::_book_keeper
protected

Book keeper instance.

Definition at line 77 of file CMatchManager.h.

Referenced by GetBookKeeper(), IterationProcess(), and Reset().

TFile* cmtool::CMManagerBase::_fout
protectedinherited
::cmtool::CFloatAlgoBase* cmtool::CMatchManager::_match_algo
protected

Merging algorithm.

Definition at line 80 of file CMatchManager.h.

Referenced by AddMatchAlgo(), CMatchManager(), EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), and Reset().

bool cmtool::CMManagerBase::_merge_till_converge
protectedinherited
unsigned int cmtool::CMManagerBase::_min_nhits
protectedinherited

Minimum number of hits: the limit set for ClusterParamsAlg.

Definition at line 114 of file CMManagerBase.h.

Referenced by cmtool::CMManagerBase::CMManagerBase(), cmtool::CMManagerBase::SetClusters(), and cmtool::CMManagerBase::SetMinNHits().

size_t cmtool::CMatchManager::_nplanes
protected

Number of planes.

Definition at line 83 of file CMatchManager.h.

Referenced by CMatchManager(), and IterationProcess().

std::set<UChar_t> cmtool::CMManagerBase::_planes
protectedinherited

A holder for # of unique planes in the clusters, computed in ComputePriority() function.

Definition at line 135 of file CMManagerBase.h.

Referenced by cmtool::CMManagerBase::ComputePriority(), IterationProcess(), cmtool::CMergeManager::IterationProcess(), and cmtool::CMManagerBase::Reset().

std::multimap<float,size_t> cmtool::CMManagerBase::_priority
protectedinherited
bool cmtool::CMManagerBase::_time_report
protectedinherited

The documentation for this class was generated from the following files: