LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 <utility> // std::move()
12 #include <iomanip>
13 #include <iostream>
14 
15 namespace recob{
16 
17  // the value is assigned in the class definition:
18  constexpr double Shower::InvalidOpeningAngle;
19 
20  //----------------------------------------------------------------------
22  {
23  }
24 
25  //----------------------------------------------------------------------
26  Shower::Shower(TVector3 const& dcosVtx,
27  TVector3 const& dcosVtxErr,
28  TVector3 const& xyz,
29  TVector3 const& xyzErr,
30  std::vector< double > TotalEnergy,
31  std::vector< double > TotalEnergyErr,
32  std::vector< double > dEdx,
33  std::vector< double > dEdxErr,
34  int bestplane,
35  int id,
36  double length,
37  double openAngle)
38  : fID(id)
39  , fDCosStart(dcosVtx)
40  , fSigmaDCosStart(dcosVtxErr)
41  , fXYZstart(xyz)
42  , fSigmaXYZstart(xyzErr)
43  , fTotalEnergy(std::move(TotalEnergy))
44  , fSigmaTotalEnergy(std::move(TotalEnergyErr))
45  , fdEdx(std::move(dEdx))
46  , fSigmadEdx(std::move(dEdxErr))
47  , fBestPlane(bestplane)
48  , fLength(length)
49  , fOpenAngle(openAngle)
50  {
51 
52  }
53 
54  //----------------------------------------------------------------------
55  std::ostream& operator<< (std::ostream& o, Shower const& a)
56  {
57  o << std::setiosflags(std::ios::fixed) << std::setprecision(3);
58  o << " Shower ID " << std::setw(4) << std::right << a.ID();
59  o << " Energy " << std::setw(4) << std::right << a.Energy()[a.best_plane()];
60  o << " dEdx " << std::setw(4) << std::right << a.dEdx()[a.best_plane()];
61  return o;
62  }
63 
64  //----------------------------------------------------------------------
65  // < operator.
66  //
67  bool operator < (const Shower & a, const Shower & b)
68  {
69  if(a.ID() != b. ID())
70  return a.ID() < b.ID();
71 
72  return false; //They are equal
73  }
74 
75 
76 }
int best_plane() const
Definition: Shower.h:200
const std::vector< double > & dEdxErr() const
Definition: Shower.h:204
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
std::vector< double > fTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:32
Reconstruction base classes.
std::vector< double > fSigmadEdx
Calculated dE/dx per each plane.
Definition: Shower.h:35
TVector3 fSigmaXYZstart
uncertainty on initial direction cosines
Definition: Shower.h:31
const std::vector< double > & Energy() const
Definition: Shower.h:195
friend bool operator<(const Shower &a, const Shower &b)
Definition: Shower.cxx:67
STL namespace.
const std::vector< double > & dEdx() const
Definition: Shower.h:203
static constexpr double InvalidOpeningAngle
The magic constant indicating the invalidity of the opening angle variable.
Definition: Shower.h:88
TVector3 fDCosStart
direction cosines at start of shower
Definition: Shower.h:28
int fID
Default constructor.
Definition: Shower.h:27
TVector3 fSigmaDCosStart
uncertainty on initial direction cosines
Definition: Shower.h:29
std::vector< double > fdEdx
Calculated dE/dx per each plane.
Definition: Shower.h:34
double fOpenAngle
Opening angle [rad].
Definition: Shower.h:64
double fLength
Shower length [cm].
Definition: Shower.h:50
int fBestPlane
Definition: Shower.h:39
friend std::ostream & operator<<(std::ostream &stream, Shower const &a)
Definition: Shower.cxx:55
TVector3 fXYZstart
direction cosines at start of shower
Definition: Shower.h:30
int ID() const
Definition: Shower.h:187
std::vector< double > fSigmaTotalEnergy
Calculated Energy per each plane.
Definition: Shower.h:33