ChannelSplitter.h
Go to the documentation of this file.
1 /* FrameSplitter = FrameFanout + ChannelSelector (almost)
2 
3  This can be useful in order not to keep the input alive as each of
4  the fan out branches are processed which otherwise defeats some
5  lazy loading
6  */
7 
8 #ifndef WIRECELL_SIGPROC_CHANNELSPLITTER
9 #define WIRECELL_SIGPROC_CHANNELSPLITTER
10 
13 #include "WireCellUtil/TagRules.h"
14 #include "WireCellUtil/Logging.h"
15 
16 #include <unordered_map>
17 
18 namespace WireCell {
19  namespace SigProc {
20 
21  class ChannelSplitter : public IFrameFanout, public IConfigurable {
22  public:
23  ChannelSplitter(size_t multiplicity = 0);
24  virtual ~ChannelSplitter();
25 
26  // INode, override because we get multiplicity at run time.
27  virtual std::vector<std::string> output_types();
28 
29  // IFanout
30  virtual bool operator()(const input_pointer& in, output_vector& outv);
31 
32  // IConfigurable
33  virtual void configure(const WireCell::Configuration& cfg);
35 
36  private:
37  // channel to port
38  std::unordered_map<int, int> m_c2p;
39  std::vector<std::string> m_tags;
43  };
44  }
45 }
46 
47 #endif
cfg
Definition: dbjson.py:29
ChannelSplitter(size_t multiplicity=0)
virtual void configure(const WireCell::Configuration &cfg)
Accept a configuration.
virtual bool operator()(const input_pointer &in, output_vector &outv)
std::vector< output_pointer > output_vector
Definition: IFanoutNode.h:45
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
Definition: Main.h:22
std::shared_ptr< const IFrame > input_pointer
Definition: IFanoutNode.h:43
virtual std::vector< std::string > output_types()
Json::Value Configuration
Definition: Configuration.h:50
std::unordered_map< int, int > m_c2p
std::vector< std::string > m_tags
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.