Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
gen
test
test_empnomo.cxx
Go to the documentation of this file.
1
#include "
WireCellUtil/Persist.h
"
2
#include "
WireCellUtil/String.h
"
3
#include "
WireCellUtil/Units.h
"
4
#include "
WireCellUtil/PluginManager.h
"
5
#include "
WireCellUtil/NamedFactory.h
"
6
#include "
WireCellIface/IChannelStatus.h
"
7
#include "
WireCellIface/IChannelSpectrum.h
"
8
9
#include <cstdlib>
10
#include <string>
11
12
#include "
anode_loader.h
"
// ignore everything in this file
13
14
using namespace
std
;
15
using namespace
WireCell
;
16
17
int
main
(
int
argc
,
char
*
argv
[])
18
{
19
std::string
detector =
"uboone"
;
20
21
22
// In the real WCT this is done by wire-cell and driven by user
23
// configuration.
24
auto
anode_tns =
anode_loader
(detector);
25
26
cerr <<
"Using AnodePlane: \""
<< anode_tns[0] <<
"\"\n"
;
27
28
{
29
{
30
auto
icfg = Factory::lookup<IConfigurable>(
"StaticChannelStatus"
);
31
// In the real app this would be in a JSON or Jsonnet config
32
// file in wire-cell-cfg. Here, just to avoid an external
33
// file we define a couple hard-coded deviant values somewhat
34
// laboriously
35
auto
cfg
= icfg->default_configuration();
36
cfg[
"anode"
] = anode_tns[0];
37
// cfg["deviants"] = Json::arrayValue;
38
// cfg["deviants"][0]["chid"] = 100;
39
// cfg["deviants"][0]["gain"] = 4.7*units::mV/units::fC;
40
// cfg["deviants"][0]["shaping"] = 1.0*units::us;
41
// cfg["deviants"][1]["chid"] = 200;
42
// cfg["deviants"][1]["gain"] = 4.7*units::mV/units::fC;
43
// cfg["deviants"][1]["shaping"] = 1.0*units::us;
44
icfg->configure(cfg);
45
}
46
{
47
auto
icfg = Factory::lookup<IConfigurable>(
"EmpiricalNoiseModel"
);
48
auto
cfg
= icfg->default_configuration();
49
cfg[
"anode"
] = anode_tns[0];
50
cfg[
"spectra_file"
] =
"microboone-noise-spectra-v2.json.bz2"
;
51
icfg->configure(cfg);
52
}
53
}
54
auto
anode = Factory::find_tn<IAnodePlane>(anode_tns[0]);
55
56
cerr <<
"Creating EmpiricalNoiseModel...\n"
;
57
58
auto
empnomo = Factory::find_tn<IChannelSpectrum>(
"EmpiricalNoiseModel"
);
59
60
auto
chids = anode->channels();
61
cerr <<
"Got "
<< chids.size() <<
" channels\n"
;
62
for
(
auto
chid : chids) {
63
const
auto
& amp = (*empnomo)(chid);
64
double
tot = 0;
65
for
(
auto
v : amp) {
66
tot += v;
67
}
68
cerr <<
"ch:"
<< chid <<
" "
<< amp.size()
69
<<
" tot="
<< tot
70
<<
endl
;
71
}
72
73
74
return
0;
75
}
IChannelStatus.h
NamedFactory.h
string
std::string string
Definition:
nybbler.cc:12
std
STL namespace.
dbjson.cfg
cfg
Definition:
dbjson.py:29
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
anode_loader
std::vector< std::string > anode_loader(std::string detector)
Definition:
anode_loader.h:35
anode_loader.h
WireCell
Definition:
Main.h:22
Persist.h
PluginManager.h
main
int main(int argc, char *argv[])
Definition:
test_empnomo.cxx:17
test_gen_rays_pdsp.argc
argc
Definition:
test_gen_rays_pdsp.py:6
String.h
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Units.h
IChannelSpectrum.h
Generated by
1.8.11