Shower.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file Shower.cxx
3 // \brief A shower is a \ref rb::Prong with a length, other variables which can be commonly used by analysis showers will be added.
4 // \version $Id: Shower.h,v 1.00 2013-07-12 21:31:55 bianjm Exp $
5 // \author Jianming Bian - bianjm@physics.umn.edu
6 // \date $Date: 2013-07-12 21:31:55 $
7 ////////////////////////////////////////////////////////////////////////
8 
9 #include "RecoBase/Shower.h"
10 
11 namespace rb
12 {
13  //......................................................................
14  Shower::Shower(const rb::Prong& prong,
15  int id,
16  double length)
17  : rb::Prong(prong)
18  {
19  SetID(id);
20  SetTotalLength(length);
21  }
22 
23  //......................................................................
25  std::vector<double> const& weights,
26  double const& length,
27  TVector3 const& start,
28  TVector3 const& dir,
29  int const& id)
30  : Prong(cellHits, start, dir, id)
31  , fTotalLength(length)
32  {
33  // set the cell weights
34  for(size_t w = 0; w < weights.size(); ++w) SetWeight(w, weights[w]);
35  }
36 
37  //......................................................................
39  {
40  }
41 
42  //......................................................................
43  double Shower::TotalLength() const
44  {
45  return fTotalLength;
46  }
47 
48  //......................................................................
50  {
52  }
53 
54  //......................................................................
55  TVector3 Shower::Stop() const
56  {
57  return fStart + fDir * TotalLength();
58  }
59 
60 } // end namespace rb
61 //////////////////////////////////////////////////////////////////////////////
TVector3 fDir
Direction at starting point.
Definition: Prong.h:112
void SetWeight(unsigned int globalIdx, double weight)
Set weight of the cell at this index.
Definition: Cluster.cxx:327
void SetTotalLength(double length)
Set length of a shower.
Definition: Shower.cxx:49
virtual double TotalLength() const
Length (cm) of a shower.
Definition: Shower.cxx:43
length
Definition: demo0.py:21
TVector3 Stop() const
Endpoint of the shower.
Definition: Shower.cxx:55
Var weights
void SetID(int id)
Definition: Cluster.h:74
Perform a "2 point" Hough transform on a collection of hits.
double fTotalLength
Definition: Shower.h:51
TVector3 fStart
Start location (xyz, cm)
Definition: Prong.h:111
Shower()
Definition: Shower.h:25
A Cluster with defined start position and direction.
Definition: Prong.h:19
TDirectory * dir
Definition: macro.C:5
virtual ~Shower()
Definition: Shower.cxx:38
Float_t w
Definition: plot.C:20