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

#include <TimeGatedDepos.h>

Inheritance diagram for WireCell::Gen::TimeGatedDepos:
WireCell::IDrifter WireCell::IConfigurable WireCell::IQueuedoutNode< IDepo, IDepo > WireCell::IComponent< IConfigurable > WireCell::IQueuedoutNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

 TimeGatedDepos ()
 
virtual ~TimeGatedDepos ()
 
virtual bool operator() (const input_pointer &depo, output_queue &outq)
 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::IDrifter
virtual ~IDrifter ()
 
virtual std::string signature ()
 
- Public Member Functions inherited from WireCell::IQueuedoutNode< IDepo, IDepo >
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 ()
 

Private Attributes

bool m_accept
 
double m_period
 
double m_start
 
double m_duration
 

Additional Inherited Members

- Public Types inherited from WireCell::IDrifter
typedef std::shared_ptr< IDrifterpointer
 
- Public Types inherited from WireCell::IQueuedoutNode< IDepo, IDepo >
typedef std::shared_ptr< IQueuedoutNodeBasepointer
 
typedef IDepo input_type
 
typedef IDepo output_type
 
typedef std::shared_ptr< const IDepoinput_pointer
 
typedef std::shared_ptr< const IDepooutput_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...
 

Detailed Description

TimeGatedDepos outputs depos which pass a time based selection.

The selection is defined as a time gate expressed as a start time and a duration.

If a period is provided than the time gate is advanced by the configured period each time an EOS is received.

It operates in one of accept or reject modes. To be output in the former mode depos must have times within the gate, in the latter they must not.

The gate is half inclusive. Depo landing exactly at the end of the gate is considered outside the gate.

Definition at line 33 of file TimeGatedDepos.h.

Constructor & Destructor Documentation

Gen::TimeGatedDepos::TimeGatedDepos ( )

Definition at line 36 of file TimeGatedDepos.cxx.

37  : m_accept(true)
38  , m_period(0.0)
39  , m_start(0.0)
40  , m_duration(0.0)
41 
42 {
43 }
Gen::TimeGatedDepos::~TimeGatedDepos ( )
virtual

Definition at line 44 of file TimeGatedDepos.cxx.

45 {
46 }

Member Function Documentation

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

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 64 of file TimeGatedDepos.cxx.

65 {
66  m_accept = cfg["accept"].asString() == "accept";
67  m_period = get(cfg, "period", m_period);
68  m_start = get(cfg, "start", m_start);
69  m_duration = get(cfg, "duration", m_duration);
70 }
cfg
Definition: dbjson.py:29
WireCell::Configuration Gen::TimeGatedDepos::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 24 of file TimeGatedDepos.cxx.

25 {
27  cfg["accept"] = m_accept;
28  cfg["period"] = m_period;
29  cfg["start"] = m_start;
30  cfg["duration"] = m_duration;
31  return cfg;
32 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
bool Gen::TimeGatedDepos::operator() ( const input_pointer in,
output_queue outq 
)
virtual

The calling signature:

Implements WireCell::IQueuedoutNode< IDepo, IDepo >.

Definition at line 48 of file TimeGatedDepos.cxx.

49 {
50  if (!depo) {
51  m_start += m_period;
52  outq.push_back(nullptr);
53  return true;
54  }
55 
56  const double t = depo->time();
57  const bool ingate = m_start <= t && t < m_start + m_duration;
58  if (ingate == m_accept) {
59  outq.push_back(depo);
60  }
61  return true;
62 }

Member Data Documentation

bool WireCell::Gen::TimeGatedDepos::m_accept
private

Definition at line 42 of file TimeGatedDepos.h.

double WireCell::Gen::TimeGatedDepos::m_duration
private

Definition at line 45 of file TimeGatedDepos.h.

double WireCell::Gen::TimeGatedDepos::m_period
private

Definition at line 43 of file TimeGatedDepos.h.

double WireCell::Gen::TimeGatedDepos::m_start
private

Definition at line 44 of file TimeGatedDepos.h.


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