LArSoft  v08_35_01
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 
14 namespace recob{
15 
16  // the value is assigned in the class definition:
17  constexpr double Shower::InvalidOpeningAngle;
18 
19  //----------------------------------------------------------------------
21  {
22  }
23 
24  //----------------------------------------------------------------------
25  Shower::Shower(TVector3 const& dcosVtx,
26  TVector3 const& dcosVtxErr,
27  TVector3 const& xyz,
28  TVector3 const& xyzErr,
29  std::vector< double > TotalEnergy,
30  std::vector< double > TotalEnergyErr,
31  std::vector< double > dEdx,
32  std::vector< double > dEdxErr,
33  int bestplane,
34  int id,
35  double length,
36  double openAngle)
37  : fID(id)
38  , fDCosStart(dcosVtx)
39  , fSigmaDCosStart(dcosVtxErr)
40  , fXYZstart(xyz)
41  , fSigmaXYZstart(xyzErr)
42  , fTotalEnergy(std::move(TotalEnergy))
43  , fSigmaTotalEnergy(std::move(TotalEnergyErr))
44  , fdEdx(std::move(dEdx))
45  , fSigmadEdx(std::move(dEdxErr))
46  , fBestPlane(bestplane)
47  , fLength(length)
48  , fOpenAngle(openAngle)
49  {
50 
51  }
52 
53  //----------------------------------------------------------------------
54  std::ostream& operator<< (std::ostream& o, Shower const& a)
55  {
56  o << std::setiosflags(std::ios::fixed) << std::setprecision(3);
57  o << " Shower ID " << std::setw(4) << std::right << a.ID();
58  o << " Energy " << std::setw(4) << std::right << a.Energy()[a.best_plane()];
59  o << " dEdx " << std::setw(4) << std::right << a.dEdx()[a.best_plane()];
60  return o;
61  }
62 
63  //----------------------------------------------------------------------
64  // < operator.
65  //
66  bool operator < (const Shower & a, const Shower & b)
67  {
68  if(a.ID() != b. ID())
69  return a.ID() < b.ID();
70 
71  return false; //They are equal
72  }
73 
74 
75 }
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:104
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:66
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:54
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