LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
showerreco::ShowerRecoManager Class Reference

#include "ShowerRecoManager.h"

Public Member Functions

 ShowerRecoManager ()
 Default constructor. More...
 
 ~ShowerRecoManager ()
 Default destructor. More...
 
void Algo (ShowerRecoAlgBase *alg)
 
const ShowerRecoAlgBaseAlgo () const
 
void Reset ()
 
ClusterAss_t Reconstruct (const std::vector< std::vector< util::PxHit > > &clusters, std::vector< ::recob::Shower > &showers)
 
void Reconstruct (const std::vector< std::vector< util::PxHit > > &clusters, const ClusterAss_t &ass, std::vector< ::recob::Shower > &showers)
 
::cmtool::CMatchManagerMatchManager ()
 

Private Member Functions

void Process (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 33 of file ShowerRecoManager.h.

Constructor & Destructor Documentation

showerreco::ShowerRecoManager::ShowerRecoManager ( )

Default constructor.

Definition at line 8 of file ShowerRecoManager.cxx.

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

9  : fShowerAlgo(nullptr)
10  , fMatchMgr(nullptr)
11  {
12  fMatch = true;
13  //auto geom = ::larutil::Geometry::GetME();
15  fMatchMgr = new ::cmtool::CMatchManager(geom->Nplanes());
16  }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
bool fMatch
Boolean flag to whether or not to run matching.
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
showerreco::ShowerRecoManager::~ShowerRecoManager ( )
inline

Default destructor.

Definition at line 41 of file ShowerRecoManager.h.

41 {}

Member Function Documentation

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

Definition at line 43 of file ShowerRecoManager.h.

References fShowerAlgo.

Referenced by ShowerReco3D::ShowerReco3D().

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

Definition at line 45 of file ShowerRecoManager.h.

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

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

Definition at line 56 of file ShowerRecoManager.h.

References fMatchMgr.

Referenced by ShowerReco3D::ShowerReco3D().

56 { return *fMatchMgr; }
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
void showerreco::ShowerRecoManager::Process ( const ClusterAss_t ass,
std::vector< ::recob::Shower > &  showers 
)
private

Definition at line 55 of file ShowerRecoManager.cxx.

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

Referenced by Reconstruct().

57  {
58 
59  for(auto const& pair : ass) {
60 
61  std::vector< ::cluster::ClusterParamsAlg> cpans;
62 
63  cpans.reserve(pair.size());
64 
65  for(auto const& index : pair)
66 
67  cpans.push_back(fMatchMgr->GetInputClusters()[index]);
68 
70  }
71 
72  // Run shower reco
73  showers = fShowerAlgo->Reconstruct();
74  }
::showerreco::ShowerRecoAlgBase * fShowerAlgo
Shower reconstruction algorithm.
virtual void AppendInputClusters(const std::vector< cluster::ClusterParamsAlg > &cpan_v)
Setter for a matched combination of clusters.
const std::vector< cluster::ClusterParamsAlg > & GetInputClusters() const
A getter for input clusters.
Definition: CMManagerBase.h:76
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
std::vector< recob::Shower > Reconstruct()
Execute reconstruction.
ClusterAss_t showerreco::ShowerRecoManager::Reconstruct ( const std::vector< std::vector< util::PxHit > > &  clusters,
std::vector< ::recob::Shower > &  showers 
)

Definition at line 24 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 Algo(), and ShowerReco3D::produce().

26  {
27  showers.clear();
28  fMatchMgr->SetClusters(clusters);
29 
30  ClusterAss_t res_ass;
31  // Run matching & retrieve matched cluster indices
32  try{
33  fMatchMgr->Process();
34  }catch( ::cmtool::CMTException &e){
35  e.what();
36  return res_ass;
37  }
38  res_ass = fMatchMgr->GetBookKeeper().GetResult();
39 
40  Process(res_ass, showers);
41 
42  return res_ass;
43  }
std::vector< std::vector< unsigned int > > ClusterAss_t
void SetClusters(const std::vector< std::vector< util::PxHit > > &clusters)
A simple method to add a cluster.
void Process()
A method to execute the main action, to be called per event.
const CMatchBookKeeper & GetBookKeeper() const
A method to obtain book keeper.
Definition: CMatchManager.h:51
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
Float_t e
Definition: plot.C:34
virtual const char * what() const
Definition: CMTException.h:33
std::vector< std::vector< unsigned int > > GetResult() const
Method to get result.
void Process(const ClusterAss_t &ass, std::vector< ::recob::Shower > &showers)
void showerreco::ShowerRecoManager::Reconstruct ( const std::vector< std::vector< util::PxHit > > &  clusters,
const ClusterAss_t ass,
std::vector< ::recob::Shower > &  showers 
)

Definition at line 45 of file ShowerRecoManager.cxx.

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

48  {
49  showers.clear();
50  fMatchMgr->SetClusters(clusters);
51 
52  Process(ass,showers);
53  }
void SetClusters(const std::vector< std::vector< util::PxHit > > &clusters)
A simple method to add a cluster.
::cmtool::CMatchManager * fMatchMgr
Cluster matching code.
void Process(const ClusterAss_t &ass, std::vector< ::recob::Shower > &showers)
void showerreco::ShowerRecoManager::Reset ( )

Definition at line 18 of file ShowerRecoManager.cxx.

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

Referenced by Algo(), and ShowerReco3D::produce().

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

Member Data Documentation

bool showerreco::ShowerRecoManager::fMatch
private

Boolean flag to whether or not to run matching.

Definition at line 61 of file ShowerRecoManager.h.

Referenced by ShowerRecoManager().

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

Cluster matching code.

Definition at line 67 of file ShowerRecoManager.h.

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

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

Shower reconstruction algorithm.

Definition at line 64 of file ShowerRecoManager.h.

Referenced by Algo(), Process(), and Reset().


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