TrackDepos.h
Go to the documentation of this file.
1 #ifndef WIRECELL_TRACKDEPOS
2 #define WIRECELL_TRACKDEPOS
3 
6 #include "WireCellUtil/Units.h"
7 #include "WireCellUtil/Logging.h"
8 
9 #include <tuple>
10 #include <deque>
11 
12 namespace WireCell {
13 
14  namespace Gen {
15 
16  /// A producer of depositions created from some number of simple, linear tracks.
17  class TrackDepos : public IDepoSource, public IConfigurable
18  {
19  public:
20  /// Create tracks with depositions every stepsize and assumed
21  /// to be traveling at clight.
22  TrackDepos(double stepsize=1.0*units::millimeter,
23  double clight=1.0);
24  virtual ~TrackDepos();
25 
26  virtual void configure(const WireCell::Configuration& config);
28 
29  /// Add track starting at given <time> and stretching across given
30  /// ray. The <dedx> gives a uniform charge/distance and if < 0
31  /// then it gives the (negative of) absolute amount of charge per
32  /// deposition.
33  void add_track(double time, const WireCell::Ray& ray, double dedx=-1.0);
34 
35  /// ISourceNode
36  virtual bool operator()(IDepo::pointer& out);
37 
39 
40  typedef std::tuple<double, Ray, double> track_t;
41  std::vector<track_t> tracks() const { return m_tracks; }
42 
43  private:
44  double m_stepsize;
45  double m_clight;
46  std::deque<WireCell::IDepo::pointer> m_depos;
47  std::vector<track_t> m_tracks; // collect for posterity
48  int m_count;
50  };
51 
52  }
53 }
54 
55 #endif
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
float clight
Definition: units.py:274
std::shared_ptr< const IDepo > pointer
Definition: IData.h:19
void add_track(double time, const WireCell::Ray &ray, double dedx=-1.0)
Definition: TrackDepos.cxx:85
virtual bool operator()(IDepo::pointer &out)
ISourceNode.
Definition: TrackDepos.cxx:119
std::vector< pointer > vector
Definition: IData.h:21
TrackDepos(double stepsize=1.0 *units::millimeter, double clight=1.0)
Definition: TrackDepos.cxx:18
A producer of depositions created from some number of simple, linear tracks.
Definition: TrackDepos.h:17
static Config * config
Definition: config.cpp:1054
std::deque< WireCell::IDepo::pointer > m_depos
Definition: TrackDepos.h:46
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Definition: TrackDepos.cxx:45
WireCell::IDepo::vector depos()
Definition: TrackDepos.cxx:137
std::vector< track_t > tracks() const
Definition: TrackDepos.h:41
std::vector< track_t > m_tracks
Definition: TrackDepos.h:47
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
Definition: Main.h:22
static const double millimeter
Definition: Units.h:22
Json::Value Configuration
Definition: Configuration.h:50
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Definition: TrackDepos.cxx:30
std::tuple< double, Ray, double > track_t
Definition: TrackDepos.h:40