LArSoft
v09_90_00
Liquid Argon Software toolkit - https://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 () | |
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 (util::GeometryUtilities const &gser, 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 (util::GeometryUtilities const &gser) |
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 (util::GeometryUtilities const &gser) |
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 32 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 44 of file CMManagerBase.h.
cmtool::CMergeManager::CMergeManager | ( | ) |
Definition at line 19 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 43 of file CMergeManager.h.
References _merge_algo.
|
inlineinherited |
Setter to add an algorithm for priority determination.
Definition at line 71 of file CMManagerBase.h.
Referenced by ShowerReco3D::ShowerReco3D().
|
inline |
A simple method to add an algorithm for separation.
Definition at line 46 of file CMergeManager.h.
References _separate_algo.
|
protectedinherited |
Function to compute priority.
Definition at line 155 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(), and IterationProcess().
|
inlineinherited |
Method to enable debug mode (lots of couts)
Definition at line 62 of file CMManagerBase.h.
|
protectedvirtual |
FMWK function called @ beginning of Process()
Reimplemented from cmtool::CMManagerBase.
Definition at line 41 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 142 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 52 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 49 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 84 of file CMManagerBase.h.
Referenced by showerreco::ShowerRecoManager::Process().
|
protectedvirtual |
FMWK function called @ beginning of iterative loop inside Process()
Reimplemented from cmtool::CMManagerBase.
Definition at line 80 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 109 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 159 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 74 of file CMManagerBase.h.
References lar::dump::vector().
|
inherited |
A method to execute the main action, to be called per event.
Definition at line 89 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(), and showerreco::ShowerRecoManager::Reconstruct().
|
inlineinherited |
Method to enable timing profile cout.
Definition at line 65 of file CMManagerBase.h.
References Reset().
|
virtual |
Method to reset itself.
Definition at line 27 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(), and ~CMergeManager().
|
protected |
Definition at line 230 of file CMergeManager.cxx.
Referenced by GetBookKeeper(), and IterationProcess().
|
protected |
Definition at line 236 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 318 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 93 of file CMManagerBase.h.
|
inherited |
A simple method to add a cluster.
Definition at line 34 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 showerreco::ShowerRecoManager::Reconstruct().
|
inherited |
A simple method to add a cluster.
Definition at line 75 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 87 of file CMManagerBase.h.
References n.
|
protected |
Book keeper instance.
Definition at line 90 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), GetBookKeeper(), and Reset().
|
protected |
Definition at line 100 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), IterationProcess(), and Reset().
|
protectedinherited |
Debug mode switch.
Definition at line 122 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), cmtool::CMatchManager::EventBegin(), EventBegin(), IterationBegin(), IterationEnd(), cmtool::CMatchManager::IterationProcess(), IterationProcess(), cmtool::CMManagerBase::Process(), RunMerge(), and RunSeparate().
|
protectedinherited |
Output analysis plot TFile.
Definition at line 131 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), and EventBegin().
|
protectedinherited |
Input clusters.
Definition at line 125 of file CMManagerBase.h.
Referenced by cmtool::CMatchManager::EventBegin(), EventBegin(), cmtool::CMatchManager::IterationBegin(), IterationBegin(), cmtool::CMatchManager::IterationProcess(), IterationProcess(), cmtool::CMManagerBase::Process(), cmtool::CMManagerBase::Reset(), and cmtool::CMManagerBase::SetClusters().
|
protected |
Definition at line 98 of file CMergeManager.h.
Referenced by CMergeManager(), EventBegin(), IterationBegin(), IterationEnd(), IterationProcess(), and Reset().
|
protected |
Merging algorithm.
Definition at line 93 of file CMergeManager.h.
Referenced by AddMergeAlgo(), CMergeManager(), EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), Reset(), and RunMerge().
|
protectedinherited |
Iteration loop switch.
Definition at line 137 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), IterationEnd(), and cmtool::CMManagerBase::Process().
|
protectedinherited |
Minimum number of hits: the limit set for ClusterParamsAlg.
Definition at line 119 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), and cmtool::CMManagerBase::SetClusters().
|
protected |
Output clusters.
Definition at line 87 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 140 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::ComputePriority(), cmtool::CMatchManager::IterationProcess(), IterationProcess(), and cmtool::CMManagerBase::Reset().
|
protectedinherited |
Priority record.
Definition at line 134 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::ComputePriority(), cmtool::CMatchManager::IterationProcess(), and RunMerge().
|
protectedinherited |
Priority algorithm.
Definition at line 128 of file CMManagerBase.h.
Referenced by 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 96 of file CMergeManager.h.
Referenced by AddSeparateAlgo(), CMergeManager(), EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), Reset(), and RunSeparate().
|
protectedinherited |
Timing verbosity flag.
Definition at line 116 of file CMManagerBase.h.
Referenced by cmtool::CMManagerBase::CMManagerBase(), cmtool::CMManagerBase::ComputePriority(), cmtool::CMManagerBase::Process(), and cmtool::CMManagerBase::SetClusters().
|
protected |
Definition at line 104 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), IterationBegin(), IterationEnd(), IterationProcess(), and Reset().
|
protected |
Definition at line 102 of file CMergeManager.h.
Referenced by EventBegin(), EventEnd(), IterationProcess(), and Reset().