TransportedDepo.h
Go to the documentation of this file.
1 #ifndef WIRECELL_NAV_TRANSPORTEDDEPO
2 #define WIRECELL_NAV_TRANSPORTEDDEPO
3 
4 #include "WireCellIface/IDepo.h"
5 
6 namespace WireCell {
7  namespace Gen {
8 
9  // This is like SimpleDepo but requires a prior from which it
10  // gets the charge.
14  double m_time;
15  public:
16 
17  TransportedDepo(const WireCell::IDepo::pointer& from, double location, double velocity)
18  : m_from(from), m_pos(from->pos()) {
19  double dx = m_pos.x() - location;
20  m_pos.x(location);
21  m_time = from->time() + dx/velocity;
22  }
23  virtual ~TransportedDepo() {};
24 
25  virtual const WireCell::Point& pos() const { return m_pos; }
26  virtual double time() const { return m_time; }
27  virtual double charge() const { return m_from->charge(); }
28  virtual int id() const { return m_from->id(); }
29  virtual int pdg() const { return m_from->pdg(); }
30  virtual double energy() const { return m_from->energy(); }
31  virtual WireCell::IDepo::pointer prior() const { return m_from; }
32  };
33 
34  }
35 }
36 #endif
std::shared_ptr< const IDepo > pointer
Definition: IData.h:19
WireCell::IDepo::pointer m_from
virtual double charge() const
The number charge (in units of number of electrons) deposited.
virtual double energy() const
The energy (in units of MeV) deposited.
virtual double time() const
TransportedDepo(const WireCell::IDepo::pointer &from, double location, double velocity)
virtual const WireCell::Point & pos() const
The location of the deposition.
T x(const T &val)
Definition: D3Vector.h:55
Definition: Main.h:22
virtual WireCell::IDepo::pointer prior() const
If the deposition is drifted, this may allow access to the original.
virtual int pdg() const
PDG code from Geant4.
virtual int id() const
Track ID from Geant4.