Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
pgraph
test
test_pipegraphwrappers.cxx
Go to the documentation of this file.
1
#include "
WireCellPgraph/Factory.h
"
2
#include "
WireCellPgraph/Graph.h
"
3
4
#include "
WireCellUtil/PluginManager.h
"
5
#include "
WireCellUtil/NamedFactory.h
"
6
#include "
WireCellIface/IConfigurable.h
"
7
#include "
WireCellIface/IDepoSink.h
"
8
#include "
WireCellUtil/Testing.h
"
9
#include "
WireCellUtil/Type.h
"
10
11
#include <iostream>
12
13
using namespace
std
;
14
using namespace
WireCell
;
15
16
17
int
main
()
18
{
19
PluginManager
&
pm
=
PluginManager::instance
();
20
pm.
add
(
"WireCellPgraph"
);
21
pm.
add
(
"WireCellGen"
);
22
23
// User code normally does not see any construction/configuration
24
// related stuff. Don't replicate this in non-test code!
25
{
26
auto
obj = Factory::lookup<IConfigurable>(
"TrackDepos"
);
27
auto
cfg
= obj->default_configuration();
28
cfg[
"tracks"
][0][
"time"
] = 100.0*
units::ms
;
29
cfg[
"tracks"
][0][
"charge"
] = 10000;
30
cfg[
"tracks"
][0][
"ray"
][
"tail"
][
"x"
] = 0.0;
31
cfg[
"tracks"
][0][
"ray"
][
"tail"
][
"y"
] = 0.0;
32
cfg[
"tracks"
][0][
"ray"
][
"tail"
][
"z"
] = 0.0;
33
cfg[
"tracks"
][0][
"ray"
][
"head"
][
"x"
] = 1*
units::cm
;
34
cfg[
"tracks"
][0][
"ray"
][
"head"
][
"y"
] = 1*
units::cm
;
35
cfg[
"tracks"
][0][
"ray"
][
"head"
][
"z"
] = 1*
units::cm
;
36
cerr <<
"TrackDepos cfg:\n"
<< cfg <<
endl
;
37
obj->configure(cfg);
38
}
39
// DumpDepos needs no config.
40
41
// Pretend like we are some app with a hard-coded graph structure
42
INode::pointer
ds
= Factory::lookup<INode>(
"TrackDepos"
);
43
INode::pointer
dd = Factory::lookup<INode>(
"DumpDepos"
);
44
45
46
Pgraph::Factory
pgwfac;
47
48
auto
dsnode = pgwfac(ds);
49
cerr <<
"TrackDepos node is type: "
<<
type
(dsnode) <<
endl
;
50
51
auto
ddnode = pgwfac(dd);
52
cerr <<
"DumpDepos node is type: "
<<
type
(ddnode) <<
endl
;
53
54
Pgraph::Graph
graph
;
55
graph.
connect
(dsnode, ddnode);
56
graph.
execute
();
57
58
return
0;
59
}
NamedFactory.h
lariov::DataSource::ds
ds
Definition:
IOVDataConstants.h:15
Type.h
wirecell.util.wires.apa.graph
def graph(desc, maker=maker)
Definition:
apa.py:294
instance
const std::string instance
Definition:
BlipMaker_module.cc:27
std
STL namespace.
IConfigurable.h
dbjson.cfg
cfg
Definition:
dbjson.py:29
main
int main()
Definition:
test_pipegraphwrappers.cxx:17
Factory.h
WireCell::Pgraph::Graph::connect
bool connect(Node *tail, Node *head, size_t tpind=0, size_t hpind=0)
Definition:
Graph.cxx:21
WireCell::Pgraph::Graph::execute
bool execute()
Definition:
Graph.cxx:105
Testing.h
WireCell::Interface::pointer
std::shared_ptr< Interface > pointer
Definition:
Interface.h:16
Graph.h
WireCell
Definition:
Main.h:22
genie::units::ms
static const double ms
Definition:
Units.h:100
PluginManager.h
IDepoSink.h
type
static QCString type
Definition:
declinfo.cpp:672
genie::units::cm
static const double cm
Definition:
Units.h:76
WireCell::PluginManager::add
Plugin * add(const std::string &plugin_name, const std::string &libname="")
Add a plugin. If libname is not given, try to derive it.
Definition:
PluginManager.cxx:32
WireCell::Pgraph::Factory
Definition:
Factory.h:28
ResimTags.pm
pm
Definition:
ResimTags.py:94
WireCell::Pgraph::Graph
Definition:
Graph.h:35
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
WireCell::PluginManager
Definition:
PluginManager.h:32
Generated by
1.8.11