Pgrapher.h
Go to the documentation of this file.
1 /** A Pgrapher is an application that runs components via a
2  user-configured directect acyclic graph following wire-cell data
3  flow processing paradigm.
4 
5  The individual components must be configured on their own as
6  usual.
7 
8  The graph is specified as a list of edges. Each edge has a tail
9  (source) and a head (destination) endpoint. An endpoint is
10  specified by a "typename" and an optional "port". As usual, the
11  typename is in the form "type:name" or just "type" and as
12  typically constructed by the Jsonnet function wc.tn() from a
13  previously defined configuration object. The port is an index an
14  integer default to 0.
15 
16  A configuration might look like:
17 
18  local cosmics = { type:"TrackDepos", name:"cosmics", ...};
19  [ // main configuration sequence which includes config for
20  // TrackDepos:cosmics, TrackDepos:beam,
21  // DepoJoiner (which may not yet exist) but not
22  // DumpDepos as it is not a configurable....,
23  cosmics, beam, ...,
24  {
25  type:"Pgrapher",
26  data:{
27  edges:[
28  {
29  tail:{node:wc.tn(cosmics)},
30  head:{node:wc.tn(joiner), port:0}
31  },
32  {
33  tail:{node:wc.tn(beam)},
34  head:{node:"DepoJoiner", port:1}
35  },
36  {
37  tail:{node:"DepoJoiner"},
38  head:{node:"DumpDepos"}
39  },
40  ],
41  }}]
42 
43  Note the port number need really only be specified in the second
44  edge in order to send the data to port #1. port #0 is default.
45 
46  As when configuraing a component itself, the name need only be
47  specified in an edge pair if not using the default (empty string).
48 
49  */
50 
51 #ifndef WIRECELL_PGRAPH_PGRAPHER
52 #define WIRECELL_PGRAPH_PGRAPHER
53 
56 #include "WireCellUtil/Logging.h"
57 #include "WireCellPgraph/Graph.h"
58 
59 namespace WireCell {
60  namespace Pgraph {
61  class Pgrapher :
63  public:
64  Pgrapher();
65  virtual ~Pgrapher();
66 
67  // IApplication
68  virtual void execute();
69 
70  // IConfigurable
71  virtual void configure(const WireCell::Configuration& config);
73  private:
76  };
77  }
78 }
79 
80 
81 #endif
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Definition: Pgrapher.cxx:36
static Config * config
Definition: config.cpp:1054
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
Definition: Main.h:22
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Definition: Pgrapher.cxx:12
Json::Value Configuration
Definition: Configuration.h:50
virtual void execute()
Implement to run something.
Definition: Pgrapher.cxx:62