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

#include <DepoBagger.h>

Inheritance diagram for WireCell::Gen::DepoBagger:
WireCell::IDepoCollector WireCell::IConfigurable WireCell::IQueuedoutNode< IDepo, IDepoSet > WireCell::IComponent< IConfigurable > WireCell::IQueuedoutNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

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

int m_count
 
std::pair< double, double > m_gate
 
IDepo::vector m_depos
 

Additional Inherited Members

- Public Types inherited from WireCell::IDepoCollector
typedef std::shared_ptr< IDepoCollectorpointer
 
- Public Types inherited from WireCell::IQueuedoutNode< IDepo, IDepoSet >
typedef std::shared_ptr< IQueuedoutNodeBasepointer
 
typedef IDepo input_type
 
typedef IDepoSet output_type
 
typedef std::shared_ptr< const IDepoinput_pointer
 
typedef std::shared_ptr< const IDepoSetoutput_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

Definition at line 24 of file DepoBagger.h.

Constructor & Destructor Documentation

Gen::DepoBagger::DepoBagger ( )

Definition at line 10 of file DepoBagger.cxx.

11  : m_count(0)
12  , m_gate(0,0)
13 {
14 
15 }
std::pair< double, double > m_gate
Definition: DepoBagger.h:41
Gen::DepoBagger::~DepoBagger ( )
virtual

Definition at line 17 of file DepoBagger.cxx.

18 {
19 }

Member Function Documentation

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

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 32 of file DepoBagger.cxx.

33 {
34  m_gate = std::pair<double,double>(cfg["gate"][0].asDouble(),
35  cfg["gate"][1].asDouble());
36 }
std::pair< double, double > m_gate
Definition: DepoBagger.h:41
cfg
Definition: dbjson.py:29
WireCell::Configuration Gen::DepoBagger::default_configuration ( ) const
virtual

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

Set the time gate with a two element array of times. Only depos within the gate are output.

Reimplemented from WireCell::IConfigurable.

Definition at line 21 of file DepoBagger.cxx.

22 {
24 
25  /// Set the time gate with a two element array of times. Only
26  /// depos within the gate are output.
27  cfg["gate"] = Json::arrayValue;
28 
29  return cfg;
30 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
bool Gen::DepoBagger::operator() ( const input_pointer in,
output_queue outq 
)
virtual

The calling signature:

Implements WireCell::IQueuedoutNode< IDepo, IDepoSet >.

Definition at line 39 of file DepoBagger.cxx.

40 {
41  if (!depo) { // EOS
42  // even if empyt, must send out something to retain sync.
43  auto out = std::make_shared<SimpleDepoSet>(m_count, m_depos);
44  deposetqueue.push_back(out);
45  m_depos.clear();
46  deposetqueue.push_back(nullptr); // pass on EOS
47  ++m_count;
48  return true;
49  }
50 
51  const double t = depo->time();
52  if (m_gate.first <= t and t < m_gate.second) {
53  m_depos.push_back(depo);
54  }
55  return true;
56 }
std::pair< double, double > m_gate
Definition: DepoBagger.h:41
IDepo::vector m_depos
Definition: DepoBagger.h:44

Member Data Documentation

int WireCell::Gen::DepoBagger::m_count
private

Definition at line 38 of file DepoBagger.h.

IDepo::vector WireCell::Gen::DepoBagger::m_depos
private

Definition at line 44 of file DepoBagger.h.

std::pair<double,double> WireCell::Gen::DepoBagger::m_gate
private

Definition at line 41 of file DepoBagger.h.


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