All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Shower.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 //
3 // \brief Definition of shower object for LArSoft
4 //
5 // \author brebel@fnal.gov
6 //
7 ////////////////////////////////////////////////////////////////////////////
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 }
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
walls no right
Definition: selectors.fcl:105
const std::vector< double > & dEdx() const
Definition: Shower.h:203
int best_plane() const
Definition: Shower.h:200
process_name gaushit a
static constexpr double InvalidOpeningAngle
The magic constant indicating the invalidity of the opening angle variable.
Definition: Shower.h:88
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2687
int ID() const
Definition: Shower.h:187
const std::vector< double > & Energy() const
Definition: Shower.h:195
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173