LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ShowerRecoAlgBase.cxx
Go to the documentation of this file.
1 #ifndef RECOTOOL_SHOWERRECOALGBASE_CXX
2 #define RECOTOOL_SHOWERRECOALGBASE_CXX
3 
4 #include "ShowerRecoAlgBase.h"
5 
6 namespace showerreco {
7 
9  {
10  fVerbosity = false;
11  }
12 
14  {
15  fInputClusters.clear();
16  }
17 
18  void ShowerRecoAlgBase::AppendInputClusters(const std::vector< ::cluster::ClusterParamsAlg>& cpan_v)
19  {
20  std::vector< ::showerreco::ShowerCluster_t> clusters;
21  clusters.reserve(cpan_v.size());
22 
23  for(auto const& cpan : cpan_v) {
24 
25  clusters.push_back( ::showerreco::ShowerCluster_t() );
26 
27  (*clusters.rbegin()).start_point = cpan.GetParams().start_point;
28  (*clusters.rbegin()).end_point = cpan.GetParams().end_point;
29  (*clusters.rbegin()).angle_2d = cpan.GetParams().angle_2d;
30  (*clusters.rbegin()).plane_id = cpan.Plane();
31  (*clusters.rbegin()).hit_vector = cpan.GetHitVector();
32 
33  }
34 
35  fInputClusters.push_back(clusters);
36 
37  }
38 
39  std::vector< ::recob::Shower> ShowerRecoAlgBase::Reconstruct()
40  {
41 
42  if(!fCaloAlg) throw ShowerRecoException("Calorimetry algorithm must be provided!");
43 
45 
46  std::vector< ::recob::Shower> output;
47 
48  output.reserve(fInputClusters.size());
49 
50  for(auto const& clusters : fInputClusters)
51 
52  output.push_back( RecoOneShower(clusters) );
53 
54  return output;
55 
56  }
57 
58 
59 }
60 
61 #endif
virtual void ProcessInputClusters()
Function to reorganize input cluster information.
::calo::CalorimetryAlg * fCaloAlg
Calorimetry algorithm.
std::vector< std::vector< showerreco::ShowerCluster_t > > fInputClusters
Input clusters.
virtual void AppendInputClusters(const std::vector< cluster::ClusterParamsAlg > &cpan_v)
Setter for a matched combination of clusters.
bool fVerbosity
Verbosity flag.
Class def header for a class ShowerRecoAlgBase.
virtual ::recob::Shower RecoOneShower(const std::vector< showerreco::ShowerCluster_t > &clusters)=0
Function to reconstruct one shower.
ShowerRecoAlgBase()
Default constructor.
std::vector< recob::Shower > Reconstruct()
Execute reconstruction.
virtual void Reset()=0
Function to reset algorithm, to be called @ beginning of each event.