LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
cmtool::CMergeHelper Class Reference

#include "CMergeHelper.h"

Public Member Functions

CMergeManagerGetManager (size_t mgr_id)
 
void SetAnaFile (TFile *fout)
 
void Process (util::GeometryUtilities const &gser, 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 27 of file CMergeHelper.h.

Member Function Documentation

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

Definition at line 45 of file CMergeHelper.cxx.

References _mgr_v.

Referenced by GetResult(), and Process().

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

Definition at line 7 of file CMergeHelper.cxx.

References _mgr_v.

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

Definition at line 39 of file CMergeHelper.h.

References _bk, and GetClusters().

39 { return _bk; }
CMergeBookKeeper _bk
Definition: CMergeHelper.h:46
void cmtool::CMergeHelper::Process ( util::GeometryUtilities const &  gser,
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().

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

Definition at line 13 of file CMergeHelper.cxx.

References _mgr_v.

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

Definition at line 37 of file CMergeHelper.h.

References _mgr_v.

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

Member Data Documentation

CMergeBookKeeper cmtool::CMergeHelper::_bk
protected

Definition at line 46 of file CMergeHelper.h.

Referenced by GetResult(), and Process().

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

Definition at line 44 of file CMergeHelper.h.

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


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