Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
pgraph
inc
WireCellPgraph
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
54
#include "
WireCellIface/IApplication.h
"
55
#include "
WireCellIface/IConfigurable.h
"
56
#include "
WireCellUtil/Logging.h
"
57
#include "
WireCellPgraph/Graph.h
"
58
59
namespace
WireCell
{
60
namespace
Pgraph {
61
class
Pgrapher
:
62
public
WireCell::IApplication
,
public
WireCell::IConfigurable
{
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
);
72
virtual
WireCell::Configuration
default_configuration
()
const
;
73
private
:
74
Graph
m_graph
;
75
Log::logptr_t
l
;
76
};
77
}
78
}
79
80
81
#endif
IApplication.h
WireCell::IConfigurable
Definition:
IConfigurable.h:13
Logging.h
WireCell::IApplication
Definition:
IApplication.h:12
IConfigurable.h
WireCell::Pgraph::Pgrapher::configure
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Definition:
Pgrapher.cxx:36
WireCell::Pgraph::Pgrapher::l
Log::logptr_t l
Definition:
Pgrapher.h:75
WireCell::Pgraph::Pgrapher
Definition:
Pgrapher.h:61
WireCell::Pgraph::Pgrapher::m_graph
Graph m_graph
Definition:
Pgrapher.h:74
config
static Config * config
Definition:
config.cpp:1054
WireCell::Pgraph::Pgrapher::~Pgrapher
virtual ~Pgrapher()
Definition:
Pgrapher.cxx:73
WireCell::Log::logptr_t
std::shared_ptr< spdlog::logger > logptr_t
Definition:
Logging.h:24
Graph.h
WireCell
Definition:
Main.h:22
WireCell::Pgraph::Pgrapher::default_configuration
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Definition:
Pgrapher.cxx:12
WireCell::Configuration
Json::Value Configuration
Definition:
Configuration.h:50
WireCell::Pgraph::Pgrapher::execute
virtual void execute()
Implement to run something.
Definition:
Pgrapher.cxx:62
WireCell::Pgraph::Graph
Definition:
Graph.h:35
WireCell::Pgraph::Pgrapher::Pgrapher
Pgrapher()
Definition:
Pgrapher.cxx:69
Generated by
1.8.11