LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
recob::Shower Class Reference

#include "Shower.h"

Public Member Functions

 Shower ()
 
 Shower (TVector3 const &dcosVtx, TVector3 const &dcosVtxErr, TVector3 const &xyz, TVector3 const &xyzErr, std::vector< double > TotalEnergy, std::vector< double > TotalEnergyErr, std::vector< double > dEdx, std::vector< double > dEdxErr, int bestplane, int id, double length, double openAngle)
 
 Shower (TVector3 const &dcosVtx, TVector3 const &dcosVtxErr, TVector3 const &xyz, TVector3 const &xyzErr, std::vector< double > TotalEnergy, std::vector< double > TotalEnergyErr, std::vector< double > dEdx, std::vector< double > dEdxErr, int bestplane, int id=util::kBogusI)
 
void set_id (const int id)
 
void set_total_energy (const std::vector< double > &q)
 
void set_total_energy_err (const std::vector< double > &q)
 
void set_total_MIPenergy (const std::vector< double > &q)
 
void set_total_MIPenergy_err (const std::vector< double > &q)
 
void set_total_best_plane (const int q)
 
void set_direction (const TVector3 &dir)
 
void set_direction_err (const TVector3 &dir_e)
 
void set_start_point (const TVector3 &xyz)
 
void set_start_point_err (const TVector3 &xyz_e)
 
void set_dedx (const std::vector< double > &q)
 
void set_dedx_err (const std::vector< double > &q)
 
void set_length (const double &l)
 
void set_open_angle (const double &a)
 
int ID () const
 
const TVector3 & Direction () const
 
const TVector3 & DirectionErr () const
 
const TVector3 & ShowerStart () const
 
const TVector3 & ShowerStartErr () const
 
const std::vector< double > & Energy () const
 
const std::vector< double > & EnergyErr () const
 
const std::vector< double > & MIPEnergy () const
 
const std::vector< double > & MIPEnergyErr () const
 
int best_plane () const
 
double Length () const
 
double OpenAngle () const
 
const std::vector< double > & dEdx () const
 
const std::vector< double > & dEdxErr () const
 
bool has_open_angle () const
 Returns whether the shower has a valid opening angle. More...
 
bool has_length () const
 Returns whether the shower has a valid length. More...
 

Private Attributes

int fID
 Default constructor. More...
 
TVector3 fDCosStart
 direction cosines at start of shower More...
 
TVector3 fSigmaDCosStart
 uncertainty on initial direction cosines More...
 
TVector3 fXYZstart
 direction cosines at start of shower More...
 
TVector3 fSigmaXYZstart
 uncertainty on initial direction cosines More...
 
std::vector< double > fTotalEnergy
 Calculated Energy per each plane. More...
 
std::vector< double > fSigmaTotalEnergy
 Calculated Energy per each plane. More...
 
std::vector< double > fdEdx
 Calculated dE/dx per each plane. More...
 
std::vector< double > fSigmadEdx
 Calculated dE/dx per each plane. More...
 
std::vector< double > fTotalMIPEnergy
 Calculated Energy per each plane. More...
 
std::vector< double > fSigmaTotalMIPEnergy
 Calculated Energy per each plane. More...
 
int fBestPlane
 
double fLength
 Shower length [cm]. More...
 
double fOpenAngle
 Opening angle [rad]. More...
 

Static Private Attributes

static constexpr double InvalidLength = std::numeric_limits<double>::lowest()
 The magic constant indicating the invalidity of the shower length variable. More...
 
static constexpr double InvalidOpeningAngle = std::numeric_limits<double>::lowest()
 The magic constant indicating the invalidity of the opening angle variable. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, Shower const &a)
 
bool operator< (const Shower &a, const Shower &b)
 

Detailed Description

Definition at line 19 of file Shower.h.

Constructor & Destructor Documentation

recob::Shower::Shower ( )

Definition at line 20 of file Shower.cxx.

20 {}
recob::Shower::Shower ( TVector3 const &  dcosVtx,
TVector3 const &  dcosVtxErr,
TVector3 const &  xyz,
TVector3 const &  xyzErr,
std::vector< double >  TotalEnergy,
std::vector< double >  TotalEnergyErr,
std::vector< double >  dEdx,
std::vector< double >  dEdxErr,
int  bestplane,
int  id,
double  length,
double  openAngle 
)

Definition at line 23 of file Shower.cxx.

35  : fID(id)
36  , fDCosStart(dcosVtx)
37  , fSigmaDCosStart(dcosVtxErr)
38  , fXYZstart(xyz)
39  , fSigmaXYZstart(xyzErr)
40  , fTotalEnergy(std::move(TotalEnergy))
41  , fSigmaTotalEnergy(std::move(TotalEnergyErr))
42  , fdEdx(std::move(dEdx))
43  , fSigmadEdx(std::move(dEdxErr))
44  , fBestPlane(bestplane)
45  , fLength(length)
46  , fOpenAngle(openAngle)
47  {}
std::vector< double > fdEdx
Calculated dE/dx per each plane.
Definition: Shower.h:32
std::vector< double > fSigmadEdx
Calculated dE/dx per each plane.
Definition: Shower.h:33
TVector3 fSigmaXYZstart
uncertainty on initial direction cosines
Definition: Shower.h:29
std::vector< double > fTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:30
TVector3 fDCosStart
direction cosines at start of shower
Definition: Shower.h:26
int fID
Default constructor.
Definition: Shower.h:25
TVector3 fSigmaDCosStart
uncertainty on initial direction cosines
Definition: Shower.h:27
double fOpenAngle
Opening angle [rad].
Definition: Shower.h:62
double fLength
Shower length [cm].
Definition: Shower.h:48
int fBestPlane
Definition: Shower.h:37
std::vector< double > fSigmaTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:31
TVector3 fXYZstart
direction cosines at start of shower
Definition: Shower.h:28
recob::Shower::Shower ( TVector3 const &  dcosVtx,
TVector3 const &  dcosVtxErr,
TVector3 const &  xyz,
TVector3 const &  xyzErr,
std::vector< double >  TotalEnergy,
std::vector< double >  TotalEnergyErr,
std::vector< double >  dEdx,
std::vector< double >  dEdxErr,
int  bestplane,
int  id = util::kBogusI 
)
inline

Legacy constructor (with no length and no opening angle).

Deprecated:
Use the complete constructor instead!

Definition at line 102 of file Shower.h.

112  : Shower(dcosVtx,
113  dcosVtxErr,
114  xyz,
115  xyzErr,
116  TotalEnergy,
117  TotalEnergyErr,
118  dEdx,
119  dEdxErr,
120  bestplane,
121  id,
124  {}
static constexpr double InvalidLength
The magic constant indicating the invalidity of the shower length variable.
Definition: Shower.h:73
static constexpr double InvalidOpeningAngle
The magic constant indicating the invalidity of the opening angle variable.
Definition: Shower.h:84

Member Function Documentation

int recob::Shower::best_plane ( ) const
inline

Definition at line 223 of file Shower.h.

References fBestPlane.

Referenced by lar_pandora::PFParticleAnalysis::analyze(), recob::operator<<(), DUNE::NeutrinoShowerEff::processEff(), and set_open_angle().

224 {
225  return fBestPlane;
226 }
int fBestPlane
Definition: Shower.h:37
const std::vector< double > & recob::Shower::dEdx ( ) const
inline

Definition at line 235 of file Shower.h.

References fdEdx.

Referenced by ems::MultiEMShowers::analyze(), evd::RecoBaseDrawer::DrawShower3D(), recob::operator<<(), DUNE::NeutrinoShowerEff::processEff(), and set_open_angle().

236 {
237  return fdEdx;
238 }
std::vector< double > fdEdx
Calculated dE/dx per each plane.
Definition: Shower.h:32
const std::vector< double > & recob::Shower::dEdxErr ( ) const
inline

Definition at line 239 of file Shower.h.

References fSigmadEdx.

Referenced by set_open_angle().

240 {
241  return fSigmadEdx;
242 }
std::vector< double > fSigmadEdx
Calculated dE/dx per each plane.
Definition: Shower.h:33
const TVector3 & recob::Shower::DirectionErr ( ) const
inline

Definition at line 192 of file Shower.h.

References fSigmaDCosStart.

Referenced by set_open_angle().

193 {
194  return fSigmaDCosStart;
195 }
TVector3 fSigmaDCosStart
uncertainty on initial direction cosines
Definition: Shower.h:27
const std::vector< double > & recob::Shower::Energy ( ) const
inline

Definition at line 206 of file Shower.h.

References fTotalEnergy.

Referenced by recob::operator<<(), DUNE::NeutrinoShowerEff::processEff(), TrackProducerFromPFParticle::produce(), and set_open_angle().

207 {
208  return fTotalEnergy;
209 }
std::vector< double > fTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:30
const std::vector< double > & recob::Shower::EnergyErr ( ) const
inline

Definition at line 210 of file Shower.h.

References fSigmaTotalEnergy.

Referenced by set_open_angle().

211 {
212  return fSigmaTotalEnergy;
213 }
std::vector< double > fSigmaTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:31
bool recob::Shower::has_length ( ) const
inline

Returns whether the shower has a valid length.

Definition at line 252 of file Shower.h.

References fLength.

Referenced by evd::RecoBaseDrawer::DrawShower3D(), and set_open_angle().

253 {
254  return fLength >= 0.0;
255 }
double fLength
Shower length [cm].
Definition: Shower.h:48
bool recob::Shower::has_open_angle ( ) const
inline

Returns whether the shower has a valid opening angle.

Definition at line 248 of file Shower.h.

References fOpenAngle.

Referenced by evd::RecoBaseDrawer::DrawShower3D(), and set_open_angle().

249 {
250  return fOpenAngle >= 0.0;
251 }
double fOpenAngle
Opening angle [rad].
Definition: Shower.h:62
double recob::Shower::Length ( ) const
inline
const std::vector< double > & recob::Shower::MIPEnergy ( ) const
inline

Definition at line 215 of file Shower.h.

References fTotalMIPEnergy.

Referenced by DUNE::NeutrinoShowerEff::processEff(), and set_open_angle().

216 {
217  return fTotalMIPEnergy;
218 }
std::vector< double > fTotalMIPEnergy
Calculated Energy per each plane.
Definition: Shower.h:35
const std::vector< double > & recob::Shower::MIPEnergyErr ( ) const
inline

Definition at line 219 of file Shower.h.

References fSigmaTotalMIPEnergy.

Referenced by set_open_angle().

220 {
221  return fSigmaTotalMIPEnergy;
222 }
std::vector< double > fSigmaTotalMIPEnergy
Calculated Energy per each plane.
Definition: Shower.h:36
double recob::Shower::OpenAngle ( ) const
inline

Definition at line 231 of file Shower.h.

References fOpenAngle.

Referenced by lar_pandora::PFParticleAnalysis::analyze(), evd::RecoBaseDrawer::DrawShower3D(), lar_pandora::LArPandoraEventDump::PrintShower(), and set_open_angle().

232 {
233  return fOpenAngle;
234 }
double fOpenAngle
Opening angle [rad].
Definition: Shower.h:62
void recob::Shower::set_dedx ( const std::vector< double > &  q)
inline

Definition at line 138 of file Shower.h.

Referenced by cluster::TrajCluster::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

138 { fdEdx = q; }
std::vector< double > fdEdx
Calculated dE/dx per each plane.
Definition: Shower.h:32
void recob::Shower::set_dedx_err ( const std::vector< double > &  q)
inline

Definition at line 139 of file Shower.h.

Referenced by cluster::TrajCluster::produce().

139 { fSigmadEdx = q; }
std::vector< double > fSigmadEdx
Calculated dE/dx per each plane.
Definition: Shower.h:33
void recob::Shower::set_direction ( const TVector3 &  dir)
inline

Definition at line 134 of file Shower.h.

References dir.

Referenced by shwf::ShowerCheater::produce(), cluster::TrajCluster::produce(), shwf::ShowerReco::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

134 { fDCosStart = dir; }
TVector3 fDCosStart
direction cosines at start of shower
Definition: Shower.h:26
TDirectory * dir
Definition: macro.C:5
void recob::Shower::set_direction_err ( const TVector3 &  dir_e)
inline

Definition at line 135 of file Shower.h.

Referenced by shwf::ShowerCheater::produce(), cluster::TrajCluster::produce(), and shwf::ShowerReco::produce().

135 { fSigmaDCosStart = dir_e; }
TVector3 fSigmaDCosStart
uncertainty on initial direction cosines
Definition: Shower.h:27
void recob::Shower::set_id ( const int  id)
inline

Definition at line 127 of file Shower.h.

Referenced by shwf::ShowerCheater::produce(), cluster::TrajCluster::produce(), and shower::EMShower::produce().

127 { fID = id; }
int fID
Default constructor.
Definition: Shower.h:25
void recob::Shower::set_length ( const double &  l)
inline

Definition at line 140 of file Shower.h.

Referenced by cluster::TrajCluster::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

140 { fLength = l; }
double fLength
Shower length [cm].
Definition: Shower.h:48
void recob::Shower::set_open_angle ( const double &  a)
inline
void recob::Shower::set_start_point ( const TVector3 &  xyz)
inline

Definition at line 136 of file Shower.h.

Referenced by cluster::TrajCluster::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

136 { fXYZstart = xyz; }
TVector3 fXYZstart
direction cosines at start of shower
Definition: Shower.h:28
void recob::Shower::set_start_point_err ( const TVector3 &  xyz_e)
inline

Definition at line 137 of file Shower.h.

Referenced by cluster::TrajCluster::produce().

137 { fSigmaXYZstart = xyz_e; }
TVector3 fSigmaXYZstart
uncertainty on initial direction cosines
Definition: Shower.h:29
void recob::Shower::set_total_best_plane ( const int  q)
inline

Definition at line 132 of file Shower.h.

Referenced by cluster::TrajCluster::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

132 { fBestPlane = q; }
int fBestPlane
Definition: Shower.h:37
void recob::Shower::set_total_energy ( const std::vector< double > &  q)
inline

Definition at line 128 of file Shower.h.

Referenced by cluster::TrajCluster::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

128 { fTotalEnergy = q; }
std::vector< double > fTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:30
void recob::Shower::set_total_energy_err ( const std::vector< double > &  q)
inline

Definition at line 129 of file Shower.h.

Referenced by cluster::TrajCluster::produce().

129 { fSigmaTotalEnergy = q; }
std::vector< double > fSigmaTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:31
void recob::Shower::set_total_MIPenergy ( const std::vector< double > &  q)
inline

Definition at line 130 of file Shower.h.

Referenced by cluster::TrajCluster::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

130 { fTotalMIPEnergy = q; }
std::vector< double > fTotalMIPEnergy
Calculated Energy per each plane.
Definition: Shower.h:35
void recob::Shower::set_total_MIPenergy_err ( const std::vector< double > &  q)
inline

Definition at line 131 of file Shower.h.

Referenced by cluster::TrajCluster::produce().

131 { fSigmaTotalMIPEnergy = q; }
std::vector< double > fSigmaTotalMIPEnergy
Calculated Energy per each plane.
Definition: Shower.h:36
const TVector3 & recob::Shower::ShowerStartErr ( ) const
inline

Definition at line 201 of file Shower.h.

References fSigmaXYZstart.

Referenced by set_open_angle().

202 {
203  return fSigmaXYZstart;
204 }
TVector3 fSigmaXYZstart
uncertainty on initial direction cosines
Definition: Shower.h:29

Friends And Related Function Documentation

bool operator< ( const Shower a,
const Shower b 
)
friend

Definition at line 62 of file Shower.cxx.

Referenced by set_open_angle().

63  {
64  if (a.ID() != b.ID()) return a.ID() < b.ID();
65 
66  return false; //They are equal
67  }
std::ostream& operator<< ( std::ostream &  stream,
Shower const &  a 
)
friend

Definition at line 50 of file Shower.cxx.

Referenced by set_open_angle().

51  {
52  o << std::setiosflags(std::ios::fixed) << std::setprecision(3);
53  o << " Shower ID " << std::setw(4) << std::right << a.ID();
54  o << " Energy " << std::setw(4) << std::right << a.Energy()[a.best_plane()];
55  o << " dEdx " << std::setw(4) << std::right << a.dEdx()[a.best_plane()];
56  return o;
57  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102

Member Data Documentation

int recob::Shower::fBestPlane
private

Definition at line 37 of file Shower.h.

Referenced by best_plane().

TVector3 recob::Shower::fDCosStart
private

direction cosines at start of shower

Definition at line 26 of file Shower.h.

Referenced by Direction().

std::vector<double> recob::Shower::fdEdx
private

Calculated dE/dx per each plane.

Definition at line 32 of file Shower.h.

Referenced by dEdx().

int recob::Shower::fID
private

Default constructor.

Definition at line 25 of file Shower.h.

Referenced by ID().

double recob::Shower::fLength
private

Shower length [cm].

The length of a shower, and should be greater than 0. The characteristic depends on shower reconstruction algorithms. For example, in PCAShowerParticleBuildingAlgorithm (larpandora), it is defined as the three standard deviations of the spacepoint distribution along the principal axis.

Definition at line 48 of file Shower.h.

Referenced by has_length(), and Length().

double recob::Shower::fOpenAngle
private

Opening angle [rad].

The angle is defined in the $ [ 0, \pi/2 ] $ range. It is defined as the angle of the shower cone. The characteristic depends on shower reconstruction algorithms. For example, in PCAShowerParticleBuildingAlgorithm (larpandora), it is defined as the ratio of the standard deviation of the spacepoint distribution along the principal axis to that along the secondary axis.

Definition at line 62 of file Shower.h.

Referenced by has_open_angle(), and OpenAngle().

TVector3 recob::Shower::fSigmaDCosStart
private

uncertainty on initial direction cosines

Definition at line 27 of file Shower.h.

Referenced by DirectionErr().

std::vector<double> recob::Shower::fSigmadEdx
private

Calculated dE/dx per each plane.

Definition at line 33 of file Shower.h.

Referenced by dEdxErr().

std::vector<double> recob::Shower::fSigmaTotalEnergy
private

Calculated Energy per each plane.

Definition at line 31 of file Shower.h.

Referenced by EnergyErr().

std::vector<double> recob::Shower::fSigmaTotalMIPEnergy
private

Calculated Energy per each plane.

Definition at line 36 of file Shower.h.

Referenced by MIPEnergyErr().

TVector3 recob::Shower::fSigmaXYZstart
private

uncertainty on initial direction cosines

Definition at line 29 of file Shower.h.

Referenced by ShowerStartErr().

std::vector<double> recob::Shower::fTotalEnergy
private

Calculated Energy per each plane.

Definition at line 30 of file Shower.h.

Referenced by Energy().

std::vector<double> recob::Shower::fTotalMIPEnergy
private

Calculated Energy per each plane.

Definition at line 35 of file Shower.h.

Referenced by MIPEnergy().

TVector3 recob::Shower::fXYZstart
private

direction cosines at start of shower

Definition at line 28 of file Shower.h.

Referenced by ShowerStart().

constexpr double recob::Shower::InvalidLength = std::numeric_limits<double>::lowest()
staticprivate

The magic constant indicating the invalidity of the shower length variable.

This internal constant represents invalid shower length. It is how the function has_length() determines the validity of fLength.

Definition at line 73 of file Shower.h.

constexpr double recob::Shower::InvalidOpeningAngle = std::numeric_limits<double>::lowest()
staticprivate

The magic constant indicating the invalidity of the opening angle variable.

This internal constant represents invalid opening angle. It is how the function has_open_angle() determines the validity of fOpenAngle.

Definition at line 84 of file Shower.h.


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