All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusterMergeHelper.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file ClusterMergeHelper.h
3 //
4 // \brief ClusterMergeHelper header file
5 //
6 // \author kazuhiro@nevis.columbia.edu
7 //
8 ////////////////////////////////////////////////////////////////////////
9 
10 #ifndef CLUSTERMERGEHELPER_H
11 #define CLUSTERMERGEHELPER_H
12 
13 // ART includes
14 
15 namespace art {
16  class Event;
17 }
18 
19 #include "canvas/Persistency/Common/Assns.h"
20 #include "canvas/Persistency/Common/Ptr.h"
21 
22 namespace fhicl {
23  class ParameterSet;
24 }
25 
26 // LArSoft
32 
33 // STL
34 #include <vector>
35 
36 namespace cluster {
37 
39  public:
42  {
43  return fMgr;
44  }
45 
46  /// Utility method to set cluster input information to CMergeManager from LArSoft data product (vector of recob::Hit art::Ptr)
47  void SetClusters(util::GeometryUtilities const& gser,
48  const std::vector<std::vector<art::Ptr<recob::Hit>>>& clusters);
49 
50  /// Utility method to set cluster input information to CMerteManager from art::Event and cluster data product label
51  void SetClusters(util::GeometryUtilities const& gser,
52  const art::Event& evt,
53  const std::string& cluster_module_label);
54 
55  /// Function to execute CMergeManager::Process()
56  void Process(util::GeometryUtilities const& gser);
57 
58  /// Utility method to retrieve merged clusters in terms of a vector of art::Ptr<recob::Hit>
59  const std::vector<std::vector<art::Ptr<recob::Hit>>>& GetMergedClusterHits() const;
60 
61  /// Utility method to retrieve merged clusters in terms of a vector of CPAN
62  const std::vector<cluster::ClusterParamsAlg>& GetMergedCPAN() const;
63 
64  /// Utility method to append result set to user's data product storage
65  void AppendResult(util::GeometryUtilities const& gser,
66  art::Event& ev,
67  std::vector<recob::Cluster>& out_clusters,
68  art::Assns<recob::Cluster, recob::Hit>& assns) const;
69 
70  protected:
71  /// Internal method to transfer input cluster information in the right format to CMergeManager
72  void
74  const std::vector<std::vector<util::PxHit>>& clusters)
75  {
76  fMgr.Reset();
77  fMgr.SetClusters(gser, clusters);
78  }
79 
80  protected:
81  /// CMergeManager instance
83 
84  /// GeometryUtilities
86 
87  /// Input clusters in terms of a vector of art::Ptr<recob::Hit> collection
88  std::vector<std::vector<art::Ptr<recob::Hit>>> fInputClusters;
89 
90  /// Output clusters in terms of a vector of art::Ptr<recob::Hit> collection
91  std::vector<std::vector<art::Ptr<recob::Hit>>> fOutputClusters;
92 
93  }; // class ClusterMergeHelper
94 
95 } //namespace cluster
96 #endif
void SetClusters(util::GeometryUtilities const &gser, const std::vector< std::vector< util::PxHit >> &clusters)
Internal method to transfer input cluster information in the right format to CMergeManager.
std::vector< std::vector< art::Ptr< recob::Hit > > > fInputClusters
Input clusters in terms of a vector of art::Ptr&lt;recob::Hit&gt; collection.
process_name cluster
Definition: cheaterreco.fcl:51
Declaration of signal hit object.
const std::vector< std::vector< art::Ptr< recob::Hit > > > & GetMergedClusterHits() const
Utility method to retrieve merged clusters in terms of a vector of art::Ptr&lt;recob::Hit&gt; ...
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
virtual void Reset()
Method to reset itself.
void AppendResult(util::GeometryUtilities const &gser, art::Event &ev, std::vector< recob::Cluster > &out_clusters, art::Assns< recob::Cluster, recob::Hit > &assns) const
Utility method to append result set to user&#39;s data product storage.
std::vector< std::vector< art::Ptr< recob::Hit > > > fOutputClusters
Output clusters in terms of a vector of art::Ptr&lt;recob::Hit&gt; collection.
void Process(util::GeometryUtilities const &gser)
Function to execute CMergeManager::Process()
::util::GeometryUtilities fGeoU
GeometryUtilities.
Declaration of cluster object.
void SetClusters(util::GeometryUtilities const &gser, const std::vector< std::vector< util::PxHit >> &clusters)
A simple method to add a cluster.
::cmtool::CMergeManager & GetManager()
const std::vector< cluster::ClusterParamsAlg > & GetMergedCPAN() const
Utility method to retrieve merged clusters in terms of a vector of CPAN.
void SetClusters(util::GeometryUtilities const &gser, const std::vector< std::vector< art::Ptr< recob::Hit >>> &clusters)
Utility method to set cluster input information to CMergeManager from LArSoft data product (vector of...
TCEvent evt
Definition: DataStructs.cxx:8
::cmtool::CMergeManager fMgr
CMergeManager instance.
Class def header for a class CMergeManager.