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

#include "ShowerRecoManager.h"

Public Member Functions

 ShowerRecoManager ()
 Default constructor. More...
 
void Algo (ShowerRecoAlgBase *alg)
 
const ShowerRecoAlgBaseAlgo () const
 
void Reset ()
 
ClusterAss_t Reconstruct (geo::GeometryCore const &geom, 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, 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, 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 50 of file ShowerRecoManager.h.

Constructor & Destructor Documentation

showerreco::ShowerRecoManager::ShowerRecoManager ( )

Default constructor.

Definition at line 16 of file ShowerRecoManager.cxx.

References fMatch, fMatchMgr, and geo::GeometryCore::Nplanes().

16  : fShowerAlgo(nullptr), fMatchMgr(nullptr)
17  {
18  fMatch = true;
20  fMatchMgr = new ::cmtool::CMatchManager(geom->Nplanes());
21  }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
bool fMatch
Boolean flag to whether or not to run matching.
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977

Member Function Documentation

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

Definition at line 55 of file ShowerRecoManager.h.

Referenced by ShowerReco3D::ShowerReco3D().

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

Definition at line 57 of file ShowerRecoManager.h.

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

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

Definition at line 74 of file ShowerRecoManager.h.

Referenced by ShowerReco3D::ShowerReco3D().

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

Definition at line 69 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, 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, 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,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const std::vector< std::vector< util::PxHit >> &  clusters,
std::vector<::recob::Shower > &  showers 
)

Definition at line 29 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().

34  {
35  util::GeometryUtilities const gser{geom, clockData, detProp};
36  showers.clear();
37  fMatchMgr->SetClusters(gser, clusters);
38 
39  ClusterAss_t res_ass;
40  // Run matching & retrieve matched cluster indices
41  try {
42  fMatchMgr->Process(gser);
43  }
44  catch (::cmtool::CMTException& e) {
45  e.what();
46  return res_ass;
47  }
48  res_ass = fMatchMgr->GetBookKeeper().GetResult();
49 
50  Process(geom, clockData, detProp, res_ass, showers);
51 
52  return res_ass;
53  }
std::vector< std::vector< unsigned int > > ClusterAss_t
const char * what() const noexcept override
Definition: CMTException.h:30
void Process(geo::GeometryCore const &geom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const ClusterAss_t &ass, std::vector<::recob::Shower > &showers)
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.
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,
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 55 of file ShowerRecoManager.cxx.

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

61  {
62  showers.clear();
63  util::GeometryUtilities const gser{geom, clockData, detProp};
64  fMatchMgr->SetClusters(gser, clusters);
65 
66  Process(geom, clockData, detProp, ass, showers);
67  }
void Process(geo::GeometryCore const &geom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const ClusterAss_t &ass, std::vector<::recob::Shower > &showers)
::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 showerreco::ShowerRecoManager::Reset ( )

Definition at line 23 of file ShowerRecoManager.cxx.

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

Referenced by ShowerReco3D::produce().

24  {
26  fMatchMgr->Reset();
27  }
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 78 of file ShowerRecoManager.h.

Referenced by ShowerRecoManager().

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

Cluster matching code.

Definition at line 84 of file ShowerRecoManager.h.

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

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

Shower reconstruction algorithm.

Definition at line 81 of file ShowerRecoManager.h.

Referenced by Process(), and Reset().


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