All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
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 49 of file CMergeHelper.cxx.

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

Definition at line 8 of file CMergeHelper.cxx.

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:52
const CMergeBookKeeper& cmtool::CMergeHelper::GetResult ( ) const
inline

Definition at line 44 of file CMergeHelper.h.

45  {
46  return _bk;
47  }
CMergeBookKeeper _bk
Definition: CMergeHelper.h:54
void cmtool::CMergeHelper::Process ( util::GeometryUtilities const &  gser,
const std::vector< std::vector<::util::PxHit >> &  clusters 
)

Definition at line 22 of file CMergeHelper.cxx.

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

Definition at line 15 of file CMergeHelper.cxx.

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

Definition at line 38 of file CMergeHelper.h.

39  {
40  return _mgr_v.size();
41  }
std::vector<::cmtool::CMergeManager > _mgr_v
Definition: CMergeHelper.h:52

Member Data Documentation

CMergeBookKeeper cmtool::CMergeHelper::_bk
protected

Definition at line 54 of file CMergeHelper.h.

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

Definition at line 52 of file CMergeHelper.h.


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