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

#include "CMergeHelper.h"

Public Member Functions

 CMergeHelper ()
 Default constructor. More...
 
virtual ~CMergeHelper ()
 Default destructor. More...
 
CMergeManagerGetManager (size_t mgr_id)
 
void SetAnaFile (TFile *fout)
 
void Process (const std::vector< std::vector< ::util::PxHit > > &clusters)
 
size_t size () const
 
const CMergeBookKeeperGetResult () const
 
const std::vector< ::cluster::ClusterParamsAlg > & GetClusters () const
 

Protected Attributes

std::vector< ::cmtool::CMergeManager_mgr_v
 
CMergeBookKeeper _bk
 

Detailed Description

User defined class CMergeHelper ... these comments are used to generate doxygen documentation!

Definition at line 26 of file CMergeHelper.h.

Constructor & Destructor Documentation

cmtool::CMergeHelper::CMergeHelper ( )
inline

Default constructor.

Definition at line 31 of file CMergeHelper.h.

31 {}
virtual cmtool::CMergeHelper::~CMergeHelper ( )
inlinevirtual

Default destructor.

Definition at line 34 of file CMergeHelper.h.

References GetManager(), Process(), SetAnaFile(), and lar::dump::vector().

34 {}

Member Function Documentation

const std::vector<::cluster::ClusterParamsAlg > & cmtool::CMergeHelper::GetClusters ( ) const

Definition at line 43 of file CMergeHelper.cxx.

References _mgr_v.

Referenced by GetResult(), Process(), cluster::SimpleClusterMerger::produce(), and cluster::FuzzyClusterMerger::produce().

44  {
45  if(!(_mgr_v.size())) throw CMTException("No manager = no output clusters...");
46  return _mgr_v.back().GetClusters();
47  }
std::vector< ::cmtool::CMergeManager > _mgr_v
Definition: CMergeHelper.h:50
cmtool::CMergeManager & cmtool::CMergeHelper::GetManager ( size_t  mgr_id)

Definition at line 8 of file CMergeHelper.cxx.

References _mgr_v.

Referenced by cluster::FuzzyClusterMerger::FuzzyClusterMerger(), cluster::SimpleClusterMerger::SimpleClusterMerger(), and ~CMergeHelper().

9  {
10  if(_mgr_v.size() <= mgr_id) _mgr_v.resize(mgr_id+1);
11  return _mgr_v[mgr_id];
12  }
std::vector< ::cmtool::CMergeManager > _mgr_v
Definition: CMergeHelper.h:50
const CMergeBookKeeper& cmtool::CMergeHelper::GetResult ( ) const
inline

Definition at line 44 of file CMergeHelper.h.

References _bk, and GetClusters().

Referenced by cluster::SimpleClusterMerger::produce(), and cluster::FuzzyClusterMerger::produce().

44 { return _bk; }
CMergeBookKeeper _bk
Definition: CMergeHelper.h:52
void cmtool::CMergeHelper::Process ( const std::vector< std::vector< ::util::PxHit > > &  clusters)

Definition at line 19 of file CMergeHelper.cxx.

References _bk, _mgr_v, cmtool::CMergeBookKeeper::Combine(), and GetClusters().

Referenced by cluster::SimpleClusterMerger::produce(), cluster::FuzzyClusterMerger::produce(), and ~CMergeHelper().

20  {
21  _bk = ::cmtool::CMergeBookKeeper(clusters.size());
22 
23  for(size_t i=0; i<_mgr_v.size(); ++i) {
24 
25  auto& mgr = _mgr_v[i];
26 
27  mgr.Reset();
28 
29  if(!i) mgr.SetClusters(clusters);
30  else mgr.SetClusters( _mgr_v[i-1].GetClusters() );
31 
32  mgr.Process();
33 
34  auto const& new_bk = mgr.GetBookKeeper();
35 
36  if(!i) _bk = new_bk;
37  else if(new_bk.GetResult().size() < new_bk.size())
38  _bk.Combine(new_bk);
39 
40  }
41  }
const std::vector< ::cluster::ClusterParamsAlg > & GetClusters() const
void Combine(const CMergeBookKeeper &another)
std::vector< ::cmtool::CMergeManager > _mgr_v
Definition: CMergeHelper.h:50
CMergeBookKeeper _bk
Definition: CMergeHelper.h:52
void cmtool::CMergeHelper::SetAnaFile ( TFile *  fout)

Definition at line 14 of file CMergeHelper.cxx.

References _mgr_v.

Referenced by ~CMergeHelper().

15  {
16  for(auto& mgr : _mgr_v) mgr.SetAnaFile(fout);
17  }
std::vector< ::cmtool::CMergeManager > _mgr_v
Definition: CMergeHelper.h:50
size_t cmtool::CMergeHelper::size ( void  ) const
inline

Definition at line 42 of file CMergeHelper.h.

References _mgr_v.

42 { return _mgr_v.size(); }
std::vector< ::cmtool::CMergeManager > _mgr_v
Definition: CMergeHelper.h:50

Member Data Documentation

CMergeBookKeeper cmtool::CMergeHelper::_bk
protected

Definition at line 52 of file CMergeHelper.h.

Referenced by GetResult(), and Process().

std::vector< ::cmtool::CMergeManager> cmtool::CMergeHelper::_mgr_v
protected

Definition at line 50 of file CMergeHelper.h.

Referenced by GetClusters(), GetManager(), Process(), SetAnaFile(), and size().


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