LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "CMergeManager.h"
Public Types | |
enum | CMMSGLevel_t { kPerMerging, kPerIteration, kPerEvent, kNone } |
Enum to specify message output level. More... | |
Public Member Functions | |
CMergeManager () | |
Default constructor. More... | |
virtual | ~CMergeManager () |
Default destructor. More... | |
virtual void | Reset () |
Method to reset itself. More... | |
void | AddMergeAlgo (CBoolAlgoBase *algo) |
A simple method to add an algorithm for merging. More... | |
void | AddSeparateAlgo (CBoolAlgoBase *algo) |
A simple method to add an algorithm for separation. More... | |
const std::vector< cluster::ClusterParamsAlg > & | GetClusters () const |
A method to obtain output clusters. More... | |
const CMergeBookKeeper & | GetBookKeeper () 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 | RunMerge (const std::vector< cluster::ClusterParamsAlg > &in_clusters, CMergeBookKeeper &book_keeper) const |
void | RunMerge (const std::vector< cluster::ClusterParamsAlg > &in_clusters, const std::vector< bool > &merge_flag, CMergeBookKeeper &book_keeper) const |
void | RunSeparate (const std::vector< cluster::ClusterParamsAlg > &in_clusters, CMergeBookKeeper &book_keeper) const |
void | ComputePriority (const std::vector< cluster::ClusterParamsAlg > &clusters) |
Function to compute priority. More... | |
Protected Attributes | |
std::vector< cluster::ClusterParamsAlg > | _out_clusters |
Output clusters. More... | |
CMergeBookKeeper | _book_keeper |
Book keeper instance. More... | |
::cmtool::CBoolAlgoBase * | _merge_algo |
Merging algorithm. More... | |
::cmtool::CBoolAlgoBase * | _separate_algo |
Separation algorithm. More... | |
size_t | _iter_ctr |
std::vector< CMergeBookKeeper > | _book_keeper_v |
std::vector< std::vector< unsigned short > > | _tmp_merged_indexes |
std::vector< cluster::ClusterParamsAlg > | _tmp_merged_clusters |
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... | |
A class that instantiates merging algorithm(s) and run. The book-keeping of merged cluster sets are done by CMergeBookKeeper.
Definition at line 30 of file CMergeManager.h.
|
inherited |
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.
cmtool::CMergeManager::CMergeManager | ( | ) |
Default constructor.
Definition at line 8 of file CMergeManager.cxx.
References _iter_ctr, _merge_algo, _separate_algo, and Reset().
|
inlinevirtual |
|
inline |
A simple method to add an algorithm for merging.
Definition at line 44 of file CMergeManager.h.
References _merge_algo.
Referenced by cluster::FuzzyClusterMerger::FuzzyClusterMerger(), and cluster::SimpleClusterMerger::SimpleClusterMerger().
|
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().
|
inline |
A simple method to add an algorithm for separation.
Definition at line 47 of file CMergeManager.h.
References _separate_algo.
Referenced by cluster::FuzzyClusterMerger::FuzzyClusterMerger(), and cluster::SimpleClusterMerger::SimpleClusterMerger().
|
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 cmtool::CMatchManager::IterationProcess(), IterationProcess(), and cmtool::CMManagerBase::SetAnaFile().
|
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().
|
protectedvirtual |
FMWK function called @ beginning of Process()
Reimplemented from cmtool::CMManagerBase.
Definition at line 30 of file CMergeManager.cxx.
References _book_keeper, _book_keeper_v, cmtool::CMManagerBase::_debug_mode, cmtool::CMManagerBase::_fout, cmtool::CMManagerBase::_in_clusters, _iter_ctr, _merge_algo, cmtool::CMManagerBase::_priority_algo, _separate_algo, _tmp_merged_clusters, _tmp_merged_indexes, cmtool::CMAlgoBase::EventBegin(), cmtool::CMManagerBase::kPerMerging, cmtool::CMergeBookKeeper::Reset(), cmtool::CMAlgoBase::SetAnaFile(), and cmtool::CMAlgoBase::SetVerbose().
Referenced by GetBookKeeper().
|
protectedvirtual |
FMWK function called @ end of Process()
Reimplemented from cmtool::CMManagerBase.
Definition at line 138 of file CMergeManager.cxx.
References _book_keeper, _book_keeper_v, _merge_algo, cmtool::CMManagerBase::_priority_algo, _separate_algo, _tmp_merged_clusters, _tmp_merged_indexes, cmtool::CMergeBookKeeper::Combine(), and cmtool::CMAlgoBase::EventEnd().
Referenced by GetBookKeeper().
|
inline |
A method to obtain book keeper.
Definition at line 53 of file CMergeManager.h.
References _book_keeper, EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), RunMerge(), and RunSeparate().
Referenced by cluster::ClusterMergeHelper::Process().
|
inline |
A method to obtain output clusters.
Definition at line 50 of file CMergeManager.h.
References _out_clusters.
Referenced by cluster::ClusterMergeHelper::GetMergedCPAN(), and cluster::ClusterMergeHelper::Process().
|
inlineinherited |
A getter for input clusters.
Definition at line 76 of file CMManagerBase.h.
References cmtool::CMManagerBase::_in_clusters.
Referenced by showerreco::ShowerRecoManager::Process().
|
protectedvirtual |
FMWK function called @ beginning of iterative loop inside Process()
Reimplemented from cmtool::CMManagerBase.
Definition at line 70 of file CMergeManager.cxx.
References cmtool::CMManagerBase::_debug_mode, cmtool::CMManagerBase::_in_clusters, _iter_ctr, _merge_algo, _out_clusters, cmtool::CMManagerBase::_priority_algo, _separate_algo, _tmp_merged_clusters, cmtool::CMAlgoBase::IterationBegin(), and cmtool::CMManagerBase::kPerIteration.
Referenced by GetBookKeeper().
|
protectedvirtual |
FMWK function called @ end of iterative loop inside Process()
Reimplemented from cmtool::CMManagerBase.
Definition at line 103 of file CMergeManager.cxx.
References cmtool::CMManagerBase::_debug_mode, _iter_ctr, _merge_algo, cmtool::CMManagerBase::_merge_till_converge, _out_clusters, cmtool::CMManagerBase::_priority_algo, _separate_algo, _tmp_merged_clusters, cmtool::CMAlgoBase::IterationEnd(), cmtool::CMManagerBase::kPerIteration, and cmtool::CMAlgoBase::Report().
Referenced by GetBookKeeper().
|
protectedvirtual |
FMWK function called @ iterative loop inside Process()
Implements cmtool::CMManagerBase.
Definition at line 155 of file CMergeManager.cxx.
References _book_keeper_v, cmtool::CMManagerBase::_debug_mode, cmtool::CMManagerBase::_in_clusters, _iter_ctr, _merge_algo, _out_clusters, cmtool::CMManagerBase::_planes, _separate_algo, _tmp_merged_clusters, _tmp_merged_indexes, cmtool::CMManagerBase::ComputePriority(), cmtool::CMManagerBase::kPerIteration, cmtool::CMergeBookKeeper::PassResult(), cmtool::CMAlgoBase::Report(), cmtool::CMergeBookKeeper::Reset(), RunMerge(), and RunSeparate().
Referenced by GetBookKeeper().
|
inlineinherited |
Switch to continue merging till converges.
Definition at line 66 of file CMManagerBase.h.
References cmtool::CMManagerBase::_merge_till_converge, cmtool::CMManagerBase::SetClusters(), and lar::dump::vector().
Referenced by cluster::FuzzyClusterMerger::FuzzyClusterMerger(), and cluster::SimpleClusterMerger::SimpleClusterMerger().
|
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().
|
inlineinherited |
Method to enable timing profile cout.
Definition at line 57 of file CMManagerBase.h.
References cmtool::CMManagerBase::_time_report, and cmtool::CMManagerBase::Reset().
|
virtual |
Method to reset itself.
Definition at line 16 of file CMergeManager.cxx.
References _book_keeper, _book_keeper_v, _iter_ctr, _merge_algo, _out_clusters, _separate_algo, _tmp_merged_clusters, _tmp_merged_indexes, cmtool::CMAlgoBase::Reset(), cmtool::CMergeBookKeeper::Reset(), and cmtool::CMManagerBase::Reset().
Referenced by CMergeManager(), cluster::ClusterMergeHelper::SetClusters(), and ~CMergeManager().
|
protected |
Definition at line 236 of file CMergeManager.cxx.
Referenced by GetBookKeeper(), and IterationProcess().
|
protected |
Definition at line 244 of file CMergeManager.cxx.
References cmtool::CMManagerBase::_debug_mode, _merge_algo, cmtool::CMManagerBase::_priority, cmtool::CBoolAlgoBase::Bool(), cmtool::CMergeBookKeeper::GetResult(), cmtool::CMManagerBase::kPerIteration, cmtool::CMManagerBase::kPerMerging, cmtool::CMergeBookKeeper::Merge(), and cmtool::CMergeBookKeeper::MergeAllowed().
|
protected |
Definition at line 337 of file CMergeManager.cxx.
References cmtool::CMManagerBase::_debug_mode, _separate_algo, cmtool::CBoolAlgoBase::Bool(), cmtool::CMManagerBase::kPerIteration, cmtool::CMManagerBase::kPerMerging, and cmtool::CMergeBookKeeper::ProhibitMerge().
Referenced by GetBookKeeper(), and IterationProcess().
|
inlineinherited |
A setter for an analysis output file.
Definition at line 86 of file CMManagerBase.h.
References cmtool::CMManagerBase::_fout, and cmtool::CMManagerBase::ComputePriority().
|
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().
|
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.
|
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().
|
protected |
Book keeper instance.
Definition at line 94 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), GetBookKeeper(), and Reset().
|
protected |
Definition at line 104 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), IterationProcess(), and Reset().
|
protectedinherited |
Debug mode switch.
Definition at line 117 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), cmtool::CMManagerBase::DebugMode(), cmtool::CMatchManager::EventBegin(), EventBegin(), IterationBegin(), IterationEnd(), cmtool::CMatchManager::IterationProcess(), IterationProcess(), cmtool::CMManagerBase::Process(), RunMerge(), and RunSeparate().
|
protectedinherited |
Output analysis plot TFile.
Definition at line 126 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), EventBegin(), and cmtool::CMManagerBase::SetAnaFile().
|
protectedinherited |
Input clusters.
Definition at line 120 of file CMManagerBase.h.
Referenced by cmtool::CMatchManager::EventBegin(), EventBegin(), cmtool::CMManagerBase::GetInputClusters(), cmtool::CMatchManager::IterationBegin(), IterationBegin(), cmtool::CMatchManager::IterationProcess(), IterationProcess(), cmtool::CMManagerBase::Process(), cmtool::CMManagerBase::Reset(), and cmtool::CMManagerBase::SetClusters().
|
protected |
Definition at line 102 of file CMergeManager.h.
Referenced by CMergeManager(), EventBegin(), IterationBegin(), IterationEnd(), IterationProcess(), and Reset().
|
protected |
Merging algorithm.
Definition at line 97 of file CMergeManager.h.
Referenced by AddMergeAlgo(), CMergeManager(), EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), Reset(), and RunMerge().
|
protectedinherited |
Iteration loop switch.
Definition at line 132 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), IterationEnd(), cmtool::CMManagerBase::MergeTillConverge(), and cmtool::CMManagerBase::Process().
|
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().
|
protected |
Output clusters.
Definition at line 91 of file CMergeManager.h.
Referenced by GetClusters(), IterationBegin(), IterationEnd(), IterationProcess(), and Reset().
|
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(), cmtool::CMatchManager::IterationProcess(), IterationProcess(), and cmtool::CMManagerBase::Reset().
|
protectedinherited |
Priority record.
Definition at line 129 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::ComputePriority(), cmtool::CMatchManager::IterationProcess(), and RunMerge().
|
protectedinherited |
Priority algorithm.
Definition at line 123 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::AddPriorityAlgo(), cmtool::CMManagerBase::CMManagerBase(), cmtool::CMManagerBase::ComputePriority(), cmtool::CMatchManager::EventBegin(), EventBegin(), cmtool::CMatchManager::EventEnd(), EventEnd(), cmtool::CMatchManager::IterationBegin(), IterationBegin(), cmtool::CMatchManager::IterationEnd(), IterationEnd(), cmtool::CMatchManager::IterationProcess(), cmtool::CMatchManager::Reset(), and cmtool::CMManagerBase::Reset().
|
protected |
Separation algorithm.
Definition at line 100 of file CMergeManager.h.
Referenced by AddSeparateAlgo(), CMergeManager(), EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), Reset(), and RunSeparate().
|
protectedinherited |
Timing verbosity flag.
Definition at line 111 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), cmtool::CMManagerBase::ComputePriority(), cmtool::CMManagerBase::Process(), cmtool::CMManagerBase::ReportTimings(), and cmtool::CMManagerBase::SetClusters().
|
protected |
Definition at line 108 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), and Reset().
|
protected |
Definition at line 106 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), IterationProcess(), and Reset().