Public Member Functions | Private Attributes | List of all members
WireCell::Gen::DepoFramer Class Reference

#include <DepoFramer.h>

Inheritance diagram for WireCell::Gen::DepoFramer:
WireCell::IDepoFramer WireCell::IConfigurable WireCell::IFunctionNode< IDepoSet, IFrame > WireCell::IComponent< IConfigurable > WireCell::IFunctionNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

 DepoFramer (const std::string &drifter="Drifter", const std::string &ductor="Ductor")
 
virtual ~DepoFramer ()
 
virtual bool operator() (const input_pointer &in, output_pointer &out)
 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::IDepoFramer
virtual ~IDepoFramer ()
 
virtual std::string signature ()
 Set the signature for all subclasses. More...
 
- Public Member Functions inherited from WireCell::IFunctionNode< IDepoSet, IFrame >
virtual ~IFunctionNode ()
 
virtual bool operator() (const boost::any &anyin, boost::any &anyout)
 The calling signature: More...
 
virtual std::vector< std::stringinput_types ()
 
virtual std::vector< std::stringoutput_types ()
 
- Public Member Functions inherited from WireCell::IFunctionNodeBase
virtual ~IFunctionNodeBase ()
 
virtual NodeCategory category ()
 Return the behavior category type. More...
 
virtual int concurrency ()
 By default assume all subclasses are stateless. 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 ()
 

Private Attributes

std::string m_drifter_tn
 
std::string m_ductor_tn
 
IDrifter::pointer m_drifter
 
IDuctor::pointer m_ductor
 

Additional Inherited Members

- Public Types inherited from WireCell::IFunctionNode< IDepoSet, IFrame >
typedef IDepoSet input_type
 
typedef IFrame output_type
 
typedef std::shared_ptr< const IDepoSetinput_pointer
 
typedef std::shared_ptr< const IFrameoutput_pointer
 
typedef IFunctionNode< IDepoSet, IFramesignature_type
 
- Public Types inherited from WireCell::IFunctionNodeBase
typedef std::shared_ptr< IFunctionNodeBasepointer
 
- 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...
 

Detailed Description

DepoFramer handles simulating the signal from a set of depositions returning a frame of signal voltage traces. The frame ident is taken from the the ident of the input IDepoSet. It delegates to a "drifter" and a "ductor" to perform bulk drifting through the detector volume and conversion of charge distribution to signals via convolution with field and electronics response, respectively.

Because the output frame will span the entire signal corresponding to the sent of input depositions, it is up to the caller to limit this set accordingly.

Definition at line 26 of file DepoFramer.h.

Constructor & Destructor Documentation

Gen::DepoFramer::DepoFramer ( const std::string drifter = "Drifter",
const std::string ductor = "Ductor" 
)

Definition at line 12 of file DepoFramer.cxx.

13  : m_drifter_tn(drifter)
14  , m_ductor_tn(ductor)
15 {
16 }
std::string m_drifter_tn
Definition: DepoFramer.h:41
Gen::DepoFramer::~DepoFramer ( )
virtual

Definition at line 18 of file DepoFramer.cxx.

19 {
20 }

Member Function Documentation

void Gen::DepoFramer::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 31 of file DepoFramer.cxx.

32 {
33  m_drifter = Factory::find_tn<IDrifter>(get(cfg, "Drifter", m_drifter_tn));
34  m_ductor = Factory::find_tn<IDuctor>(get(cfg, "Ductor", m_ductor_tn));
35 
36 }
cfg
Definition: dbjson.py:29
IDrifter::pointer m_drifter
Definition: DepoFramer.h:42
std::string m_drifter_tn
Definition: DepoFramer.h:41
IDuctor::pointer m_ductor
Definition: DepoFramer.h:43
WireCell::Configuration Gen::DepoFramer::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 23 of file DepoFramer.cxx.

24 {
26  put(cfg, "Drifter", m_drifter_tn);
27  put(cfg, "Ductor", m_ductor_tn);
28  return cfg;
29 }
void put(Configuration &cfg, const std::string &dotpath, const T &val)
Put value in configuration at the dotted path.
cfg
Definition: dbjson.py:29
std::string m_drifter_tn
Definition: DepoFramer.h:41
Json::Value Configuration
Definition: Configuration.h:50
bool Gen::DepoFramer::operator() ( const input_pointer in,
output_pointer out 
)
virtual

The calling signature:

Implements WireCell::IFunctionNode< IDepoSet, IFrame >.

Definition at line 39 of file DepoFramer.cxx.

40 {
41 
42  const int ident = in->ident();
43 
44  // get depos into a mutable vector, sort and terminate
45  auto sdepos = in->depos();
46  std::vector<IDepo::pointer> depos(sdepos->begin(), sdepos->end()), drifted;
47  std::sort(depos.begin(), depos.end(), descending_time);
48  depos.push_back(nullptr);
49 
50  m_drifter->reset();
51  for (auto depo : depos) {
53  (*m_drifter)(depo, dq);
54  for (auto d : dq) {
55  drifted.push_back(d);
56  }
57  }
58  if (drifted.back()) {
59  // check if drifter is following protocol
60  std::cerr << "Gen::DepoFramer: warning: failed to get null on last drifted depo\n";
61  drifted.push_back(nullptr);
62  }
63 
64  m_ductor->reset();
65 
66  std::vector<IFrame::pointer> partial_frames;
67 
68  for (auto drifted_depo : drifted) {
69  IDuctor::output_queue frames;
70  (*m_ductor)(drifted_depo, frames);
71  for (auto f : frames) {
72  partial_frames.push_back(f);
73  }
74  }
75 
76  out = Gen::sum(partial_frames, ident);
77 
78  return true;
79 }
std::deque< output_pointer > output_queue
IFrame::pointer sum(std::vector< IFrame::pointer > frames, int ident)
Definition: FrameUtil.cxx:15
IDrifter::pointer m_drifter
Definition: DepoFramer.h:42
bool descending_time(const WireCell::IDepo::pointer &lhs, const WireCell::IDepo::pointer &rhs)
Compare two IDepo::pointers for by time, descending. x is used to break tie.
Definition: IDepo.cxx:29
IDuctor::pointer m_ductor
Definition: DepoFramer.h:43

Member Data Documentation

IDrifter::pointer WireCell::Gen::DepoFramer::m_drifter
private

Definition at line 42 of file DepoFramer.h.

std::string WireCell::Gen::DepoFramer::m_drifter_tn
private

Definition at line 41 of file DepoFramer.h.

IDuctor::pointer WireCell::Gen::DepoFramer::m_ductor
private

Definition at line 43 of file DepoFramer.h.

std::string WireCell::Gen::DepoFramer::m_ductor_tn
private

Definition at line 41 of file DepoFramer.h.


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