LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Shower.cxx
Go to the documentation of this file.
1 //
3 // \brief Definition of shower object for LArSoft
4 //
5 // \author brebel@fnal.gov
6 //
8 
10 
11 #include <iomanip>
12 #include <utility> // std::move()
13 
14 namespace recob {
15 
16  // the value is assigned in the class definition:
17  constexpr double Shower::InvalidOpeningAngle;
18 
19  //----------------------------------------------------------------------
21 
22  //----------------------------------------------------------------------
23  Shower::Shower(TVector3 const& dcosVtx,
24  TVector3 const& dcosVtxErr,
25  TVector3 const& xyz,
26  TVector3 const& xyzErr,
27  std::vector<double> TotalEnergy,
28  std::vector<double> TotalEnergyErr,
29  std::vector<double> dEdx,
30  std::vector<double> dEdxErr,
31  int bestplane,
32  int id,
33  double length,
34  double openAngle)
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  {}
48 
49  //----------------------------------------------------------------------
50  std::ostream& operator<<(std::ostream& o, Shower const& a)
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  }
58 
59  //----------------------------------------------------------------------
60  // < operator.
61  //
62  bool operator<(const Shower& a, const Shower& b)
63  {
64  if (a.ID() != b.ID()) return a.ID() < b.ID();
65 
66  return false; //They are equal
67  }
68 
69 }
int best_plane() const
Definition: Shower.h:223
const std::vector< double > & dEdxErr() const
Definition: Shower.h:239
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
Reconstruction base classes.
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
const std::vector< double > & Energy() const
Definition: Shower.h:206
friend bool operator<(const Shower &a, const Shower &b)
Definition: Shower.cxx:62
STL namespace.
std::vector< double > fTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:30
const std::vector< double > & dEdx() const
Definition: Shower.h:235
static constexpr double InvalidOpeningAngle
The magic constant indicating the invalidity of the opening angle variable.
Definition: Shower.h:84
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
friend std::ostream & operator<<(std::ostream &stream, Shower const &a)
Definition: Shower.cxx:50
TVector3 fXYZstart
direction cosines at start of shower
Definition: Shower.h:28
int ID() const
Definition: Shower.h:183