DepoChunker.h
Go to the documentation of this file.
1 /* This collects depos over an advancing fixed window of time. Each
2  * time an input depo falls out of the window, a depo set is produced
3  * and the window advances. An input EOS flushes any accumulated
4  * depos and resets the clock to the original starting time.
5  *
6  * This component is useful when one wants to simulate time
7  * continuously but needs to chunk up the depos in order to, for
8  * example, feed them to an IDepoFramer.
9  *
10  * This component is equivalent to the input action of the Ductor in
11  * "continous" mode.
12  */
13 
14 #ifndef WIRECELLGEN_DEPOCHUNKER
15 #define WIRECELLGEN_DEPOCHUNKER
16 
19 
20 #include <map>
21 #include <vector>
22 
23 namespace WireCell {
24  namespace Gen {
25 
26  class DepoChunker : public IDepoCollector, public IConfigurable {
27  public:
28  DepoChunker();
29  virtual ~DepoChunker();
30 
31  // IDepoCollector
32  virtual bool operator()(const input_pointer& depo, output_queue& deposetqueue);
33 
34  // IConfigurable
35  virtual void configure(const WireCell::Configuration& config);
37  private:
38 
39  // Count how many we've produced, use this for the depo set ident.
40  int m_count;
41 
42  // The current and starting acceptance time gates
43  std::pair<double,double> m_gate, m_starting_gate;
44 
45  // Temporary holding of accepted depos.
47 
48  void emit(output_queue& out);
49  };
50  }
51 }
52 
53 #endif
void emit(output_queue &out)
Definition: DepoChunker.cxx:40
std::pair< double, double > m_gate
Definition: DepoChunker.h:43
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Definition: DepoChunker.cxx:23
std::vector< pointer > vector
Definition: IData.h:21
std::deque< output_pointer > output_queue
static Config * config
Definition: config.cpp:1054
std::pair< double, double > m_starting_gate
Definition: DepoChunker.h:43
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Definition: DepoChunker.cxx:34
Definition: Main.h:22
virtual bool operator()(const input_pointer &depo, output_queue &deposetqueue)
The calling signature:
Definition: DepoChunker.cxx:47
Json::Value Configuration
Definition: Configuration.h:50
std::shared_ptr< const IDepo > input_pointer