LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
showerreco::ShowerRecoManager Class Reference

#include "ShowerRecoManager.h"

Public Member Functions

 ShowerRecoManager (unsigned int num_planes)
 
void Algo (ShowerRecoAlgBase *alg)
 
const ShowerRecoAlgBaseAlgo () const
 
void Reset ()
 
ClusterAss_t Reconstruct (geo::GeometryCore const &geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< std::vector< util::PxHit >> &clusters, std::vector<::recob::Shower > &showers)
 
void Reconstruct (geo::GeometryCore const &geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< std::vector< util::PxHit >> &clusters, const ClusterAss_t &ass, std::vector<::recob::Shower > &showers)
 
::cmtool::CMatchManagerMatchManager ()
 

Private Member Functions

void Process (geo::GeometryCore const &geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const ClusterAss_t &ass, std::vector<::recob::Shower > &showers)
 

Private Attributes

bool fMatch
 Boolean flag to whether or not to run matching. More...
 
::showerreco::ShowerRecoAlgBasefShowerAlgo
 Shower reconstruction algorithm. More...
 
::cmtool::CMatchManagerfMatchMgr
 Cluster matching code. More...
 

Detailed Description

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

Definition at line 47 of file ShowerRecoManager.h.

Constructor & Destructor Documentation

showerreco::ShowerRecoManager::ShowerRecoManager ( unsigned int  num_planes)
explicit

Definition at line 13 of file ShowerRecoManager.cxx.

References fMatch, and fMatchMgr.

14  : fShowerAlgo(nullptr), fMatchMgr(nullptr)
15  {
16  fMatch = true;
17  fMatchMgr = new ::cmtool::CMatchManager(num_planes);
18  }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
bool fMatch
Boolean flag to whether or not to run matching.
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.

Member Function Documentation

void showerreco::ShowerRecoManager::Algo ( ShowerRecoAlgBase alg)
inline

Definition at line 51 of file ShowerRecoManager.h.

Referenced by ShowerReco3D::ShowerReco3D().

51 { fShowerAlgo = alg; }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
const ShowerRecoAlgBase* showerreco::ShowerRecoManager::Algo ( ) const
inline

Definition at line 53 of file ShowerRecoManager.h.

References Reset(), and lar::dump::vector().

53 { return fShowerAlgo; }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
::cmtool::CMatchManager& showerreco::ShowerRecoManager::MatchManager ( )
inline

Definition at line 72 of file ShowerRecoManager.h.

Referenced by ShowerReco3D::ShowerReco3D().

72 { return *fMatchMgr; }
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
void showerreco::ShowerRecoManager::Process ( geo::GeometryCore const &  geom,
geo::WireReadoutGeom const &  wireReadoutGeom,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const ClusterAss_t ass,
std::vector<::recob::Shower > &  showers 
)
private

Definition at line 68 of file ShowerRecoManager.cxx.

References showerreco::ShowerRecoAlgBase::AppendInputClusters(), fMatchMgr, fShowerAlgo, cmtool::CMManagerBase::GetInputClusters(), and showerreco::ShowerRecoAlgBase::Reconstruct().

Referenced by Reconstruct().

74  {
75 
76  for (auto const& pair : ass) {
77  std::vector<::cluster::ClusterParamsAlg> cpans;
78 
79  cpans.reserve(pair.size());
80 
81  for (auto const& index : pair)
82  cpans.push_back(fMatchMgr->GetInputClusters()[index]);
83 
85  }
86 
87  // Run shower reco
88  showers = fShowerAlgo->Reconstruct(geom, wireReadoutGeom, clockData, detProp);
89  }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
virtual void AppendInputClusters(const std::vector< cluster::ClusterParamsAlg > &cpan_v)
Setter for a matched combination of clusters.
std::vector< recob::Shower > Reconstruct(geo::GeometryCore const &geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp)
Execute reconstruction.
const std::vector< cluster::ClusterParamsAlg > & GetInputClusters() const
A getter for input clusters.
Definition: CMManagerBase.h:84
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
ClusterAss_t showerreco::ShowerRecoManager::Reconstruct ( geo::GeometryCore const &  geom,
geo::WireReadoutGeom const &  wireReadoutGeom,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const std::vector< std::vector< util::PxHit >> &  clusters,
std::vector<::recob::Shower > &  showers 
)

Definition at line 26 of file ShowerRecoManager.cxx.

References e, fMatchMgr, cmtool::CMatchManager::GetBookKeeper(), cmtool::CMatchBookKeeper::GetResult(), Process(), cmtool::CMManagerBase::Process(), cmtool::CMManagerBase::SetClusters(), and cmtool::CMTException::what().

Referenced by ShowerReco3D::produce().

32  {
33  util::GeometryUtilities const gser{geom, wireReadoutGeom, clockData, detProp};
34  showers.clear();
35  fMatchMgr->SetClusters(gser, clusters);
36 
37  ClusterAss_t res_ass;
38  // Run matching & retrieve matched cluster indices
39  try {
40  fMatchMgr->Process(gser);
41  }
42  catch (::cmtool::CMTException& e) {
43  e.what();
44  return res_ass;
45  }
46  res_ass = fMatchMgr->GetBookKeeper().GetResult();
47 
48  Process(geom, wireReadoutGeom, clockData, detProp, res_ass, showers);
49 
50  return res_ass;
51  }
std::vector< std::vector< unsigned int > > ClusterAss_t
const char * what() const noexcept override
Definition: CMTException.h:30
const CMatchBookKeeper & GetBookKeeper() const
A method to obtain book keeper.
Definition: CMatchManager.h:49
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
void SetClusters(util::GeometryUtilities const &gser, const std::vector< std::vector< util::PxHit >> &clusters)
A simple method to add a cluster.
void Process(util::GeometryUtilities const &gser)
A method to execute the main action, to be called per event.
void Process(geo::GeometryCore const &geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const ClusterAss_t &ass, std::vector<::recob::Shower > &showers)
Float_t e
Definition: plot.C:35
std::vector< std::vector< unsigned int > > GetResult() const
Method to get result.
void showerreco::ShowerRecoManager::Reconstruct ( geo::GeometryCore const &  geom,
geo::WireReadoutGeom const &  wireReadoutGeom,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const std::vector< std::vector< util::PxHit >> &  clusters,
const ClusterAss_t ass,
std::vector<::recob::Shower > &  showers 
)

Definition at line 53 of file ShowerRecoManager.cxx.

References fMatchMgr, Process(), and cmtool::CMManagerBase::SetClusters().

60  {
61  showers.clear();
62  util::GeometryUtilities const gser{geom, wireReadoutGeom, clockData, detProp};
63  fMatchMgr->SetClusters(gser, clusters);
64 
65  Process(geom, wireReadoutGeom, clockData, detProp, ass, showers);
66  }
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
void SetClusters(util::GeometryUtilities const &gser, const std::vector< std::vector< util::PxHit >> &clusters)
A simple method to add a cluster.
void Process(geo::GeometryCore const &geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const ClusterAss_t &ass, std::vector<::recob::Shower > &showers)
void showerreco::ShowerRecoManager::Reset ( )

Definition at line 20 of file ShowerRecoManager.cxx.

References fMatchMgr, fShowerAlgo, cmtool::CMatchManager::Reset(), and showerreco::ShowerRecoAlgBase::Reset().

Referenced by ShowerReco3D::produce().

21  {
23  fMatchMgr->Reset();
24  }
virtual void Reset()
Method to reset itself.
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
virtual void Reset()
Function to reset algorithm, to be called @ beginning of each event.
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.

Member Data Documentation

bool showerreco::ShowerRecoManager::fMatch
private

Boolean flag to whether or not to run matching.

Definition at line 76 of file ShowerRecoManager.h.

Referenced by ShowerRecoManager().

::cmtool::CMatchManager* showerreco::ShowerRecoManager::fMatchMgr
private

Cluster matching code.

Definition at line 82 of file ShowerRecoManager.h.

Referenced by Process(), Reconstruct(), Reset(), and ShowerRecoManager().

::showerreco::ShowerRecoAlgBase* showerreco::ShowerRecoManager::fShowerAlgo
private

Shower reconstruction algorithm.

Definition at line 79 of file ShowerRecoManager.h.

Referenced by Process(), and Reset().


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