Public Member Functions | Private Member Functions | Private Attributes | List of all members
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.

16  : fShowerAlgo(nullptr), fMatchMgr(nullptr)
17  {
18  fMatch = true;
20  fMatchMgr = new ::cmtool::CMatchManager(geom->Nplanes());
21  }
::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.

Member Function Documentation

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

Definition at line 56 of file ShowerRecoManager.h.

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

Definition at line 62 of file ShowerRecoManager.h.

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

Definition at line 83 of file ShowerRecoManager.h.

84  {
85  return *fMatchMgr;
86  }
::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 73 of file ShowerRecoManager.cxx.

78  {
79 
80  for (auto const& pair : ass) {
81  std::vector<::cluster::ClusterParamsAlg> cpans;
82 
83  cpans.reserve(pair.size());
84 
85  for (auto const& index : pair)
86  cpans.push_back(fMatchMgr->GetInputClusters()[index]);
87 
89  }
90 
91  // Run shower reco
92  showers = fShowerAlgo->Reconstruct(geom, clockData, detProp);
93  }
::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.
::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 31 of file ShowerRecoManager.cxx.

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

64  {
65  showers.clear();
66  util::GeometryUtilities const gser{geom, clockData, detProp};
67  fMatchMgr->SetClusters(gser, clusters);
68 
69  Process(geom, clockData, detProp, ass, showers);
70  }
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 ( void  )

Definition at line 24 of file ShowerRecoManager.cxx.

25  {
27  fMatchMgr->Reset();
28  }
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 90 of file ShowerRecoManager.h.

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

Cluster matching code.

Definition at line 96 of file ShowerRecoManager.h.

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

Shower reconstruction algorithm.

Definition at line 93 of file ShowerRecoManager.h.


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