Public Member Functions | Protected Member Functions | List of all members
WireCell::Gen::DepoSplat Class Reference

#include <DepoSplat.h>

Inheritance diagram for WireCell::Gen::DepoSplat:
WireCell::Gen::Ductor WireCell::IDuctor WireCell::IConfigurable WireCell::IQueuedoutNode< IDepo, IFrame > WireCell::IComponent< IConfigurable > WireCell::IQueuedoutNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

 DepoSplat ()
 
virtual ~DepoSplat ()
 
- Public Member Functions inherited from WireCell::Gen::Ductor
 Ductor ()
 
virtual ~Ductor ()
 
virtual bool operator() (const input_pointer &depo, output_queue &frames)
 The calling signature: More...
 
virtual void configure (const WireCell::Configuration &config)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
- Public Member Functions inherited from WireCell::IDuctor
virtual ~IDuctor ()
 
virtual std::string signature ()
 
- Public Member Functions inherited from WireCell::IQueuedoutNode< IDepo, IFrame >
virtual ~IQueuedoutNode ()
 
virtual bool operator() (const boost::any &anyin, queuedany &outanyq)
 The calling signature: More...
 
virtual std::vector< std::stringinput_types ()
 
virtual std::vector< std::stringoutput_types ()
 
- Public Member Functions inherited from WireCell::IQueuedoutNodeBase
virtual ~IQueuedoutNodeBase ()
 
virtual NodeCategory category ()
 Return the behavior category type. More...
 
virtual int concurrency ()
 By default assume all subclasses maintain state. More...
 
- Public Member Functions inherited from WireCell::INode
virtual ~INode ()
 
virtual void reset ()
 
- Public Member Functions inherited from WireCell::IComponent< INode >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Protected Member Functions

virtual ITrace::vector process_face (IAnodeFace::pointer face, const IDepo::vector &depos)
 
- Protected Member Functions inherited from WireCell::Gen::Ductor
virtual void process (output_queue &frames)
 
bool start_processing (const input_pointer &depo)
 

Additional Inherited Members

- Public Types inherited from WireCell::IDuctor
typedef std::shared_ptr< IDuctorpointer
 
- Public Types inherited from WireCell::IQueuedoutNode< IDepo, IFrame >
typedef std::shared_ptr< IQueuedoutNodeBasepointer
 
typedef IDepo input_type
 
typedef IFrame output_type
 
typedef std::shared_ptr< const IDepoinput_pointer
 
typedef std::shared_ptr< const IFrameoutput_pointer
 
typedef std::deque< output_pointeroutput_queue
 
- Public Types inherited from WireCell::IQueuedoutNodeBase
typedef std::shared_ptr< IQueuedoutNodeBasepointer
 
typedef std::deque< boost::any > queuedany
 
- Public Types inherited from WireCell::INode
enum  NodeCategory {
  unknown, sourceNode, sinkNode, functionNode,
  queuedoutNode, joinNode, splitNode, faninNode,
  fanoutNode, multioutNode, hydraNode
}
 
- Public Types inherited from WireCell::IComponent< INode >
typedef std::shared_ptr< INodepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Protected Attributes inherited from WireCell::Gen::Ductor
std::string m_anode_tn
 
std::string m_rng_tn
 
std::vector< std::stringm_pir_tns
 
IAnodePlane::pointer m_anode
 
IRandom::pointer m_rng
 
std::vector< IPlaneImpactResponse::pointerm_pirs
 
IDepo::vector m_depos
 
double m_start_time
 
double m_readout_time
 
double m_tick
 
double m_drift_speed
 
double m_nsigma
 
bool m_fluctuate
 
std::string m_mode
 
int m_frame_count
 
Log::logptr_t l
 

Detailed Description

Definition at line 16 of file DepoSplat.h.

Constructor & Destructor Documentation

Gen::DepoSplat::DepoSplat ( )

Definition at line 17 of file DepoSplat.cxx.

18  : Ductor()
19 {
20 }
Gen::DepoSplat::~DepoSplat ( )
virtual

Definition at line 22 of file DepoSplat.cxx.

23 {
24 }

Member Function Documentation

ITrace::vector Gen::DepoSplat::process_face ( IAnodeFace::pointer  face,
const IDepo::vector depos 
)
protectedvirtual

Reimplemented from WireCell::Gen::Ductor.

Definition at line 27 of file DepoSplat.cxx.

30 {
31  // channel-charge map
32  std::unordered_map<int, std::vector<float> > chch;
33 
34  // tick-edged bins
37 
38  int iplane = -1;
39  for (auto plane : face->planes()) {
40  ++iplane;
41 
42  const Pimpos* pimpos = plane->pimpos();
43 
44  // wire-centered pitch bins
45  const Binning& wbins = pimpos->region_binning();
46 
47 
48  auto& wires = plane->wires();
49 
50  // std::cerr << "splat: plane " << plane->planeid() << " "
51  // << "wbins:" << wbins << " "
52  // << "tbins:" << tbins << " "
53  // << "#wires:" << wires.size() << " "
54  // << "#depos:" << depos.size() << "\n";
55 
56  int idepo = 0;
57  for (auto depo : depos) {
58 
59  const double pwid = m_nsigma * depo->extent_tran();
60  const double pcen = pimpos->distance(depo->pos());
61 
62  const double twid = m_nsigma*depo->extent_long();
63  const double tcen = depo->time();
64 
65  const int pbeg = std::max(wbins.bin(pcen-pwid), 0);
66  const int pend = std::min(wbins.bin(pcen+pwid)+1, (int)wires.size());
67  const int tbeg = tbins.bin(tcen-twid); // fixme what limits
68  const int tend = tbins.bin(tcen+twid)+1; // to enforce here?
69 
70  // if (idepo == 0) {
71  // std::cerr << "splat: depo=" << depo->pos()/units::mm << "mm "
72  // << "@" << depo->time()/units::ms<< " ms "
73  // << "p=(" << pcen << "+-" << pwid << "), t=(" << tcen << "+=" << twid << ") "
74  // << "pi=[" << pbeg << " " << pend << "], ti=[" << tbeg << " " << tend << "]\n";
75  // }
76 
77  for (int ip = pbeg; ip < pend; ++ip) {
78  auto iwire = wires[ip];
79  auto& charge = chch[iwire->channel()];
80  if ((int)charge.size() < tend) {
81  charge.resize(tend, 0.0);
82  }
83  for (int it = tbeg; it < tend; ++it) {
84  charge[it] += std::abs(depo->charge());
85  }
86  }
87  ++idepo;
88  }
89  }
90 
91  // make output traces
92  ITrace::vector traces;
93  for (auto& chchit : chch) {
94  const int chid = chchit.first;
95  auto& chv = chchit.second;
96  auto trace = std::make_shared<SimpleTrace>(chid, 0, chv);
97  traces.push_back(trace);
98  }
99  return traces;
100 }
double m_readout_time
Definition: Ductor.h:51
std::vector< pointer > vector
Definition: IData.h:21
Binning tbins(nticks, t0, t0+readout_time)
T abs(T value)
static int max(int a, int b)
double m_start_time
Definition: Ductor.h:50
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)

The documentation for this class was generated from the following files: