Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
gen
test
test_anodeplane.cxx
Go to the documentation of this file.
1
#include "
WireCellGen/AnodePlane.h
"
2
#include "
WireCellGen/AnodeFace.h
"
3
#include "
WireCellGen/WirePlane.h
"
4
#include "
WireCellUtil/Units.h
"
5
#include "
WireCellUtil/NamedFactory.h
"
6
#include "
WireCellUtil/Exceptions.h
"
7
#include <iostream>
8
9
#include "
anode_loader.h
"
10
11
using namespace
WireCell
;
12
using namespace
std
;
13
14
int
main
(
int
argc
,
char
*
argv
[])
15
{
16
std::string
detector =
"uboone"
;
17
if
(argc > 1) {
18
detector = argv[1];
19
}
20
auto
anode_tns =
anode_loader
(detector);
21
22
for
(
std::string
anode_tn : anode_tns) {
23
auto
iap = Factory::find_tn<IAnodePlane>(anode_tn);
24
auto
chans = iap->channels();
25
cerr <<
"Anode "
<< anode_tn <<
" with "
<< chans.size() <<
" channels:\n"
;
26
27
for
(
auto
face : iap->faces()) {
28
cerr <<
"face: "
<< face->ident() <<
"\n"
;
29
std::vector<float> originx;
30
for
(
auto
plane : face->planes()) {
31
cerr <<
"\tplane: "
<< plane->ident() <<
"\n"
;
32
33
auto
pimpos
= plane->pimpos();
34
cerr <<
"\torigin: "
<<
pimpos
->
origin
()/
units::mm
<<
"mm\n"
;
35
for
(
int
axis : {0,1,2}) {
36
cerr <<
"\taxis "
<< axis <<
": "
<<
pimpos
->
axis
(axis)/
units::mm
<<
"mm\n"
;
37
}
38
originx.push_back(
pimpos
->
origin
()[0]);
39
}
40
41
42
float
diff =
std::abs
(originx.front() - originx.back());
43
if
(diff > 0.1*
units::mm
) {
44
cerr <<
"ERROR, field response and wire location data do not match: diff = "
<< diff/
units::mm
<<
"mm\n"
;
45
cerr <<
"front: "
<< originx.front()/
units::mm
<<
"mm, back="
<< originx.back()/
units::mm
<<
"mm out of "
<< originx.size() <<
endl
;
46
THROW
(
ValueError
() <<
errmsg
{
"field response and wire location data do not match"
});
47
}
48
}
49
}
50
51
52
return
0;
53
54
}
NamedFactory.h
Exceptions.h
string
std::string string
Definition:
nybbler.cc:12
AnodeFace.h
WireCell::errmsg
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition:
Exceptions.h:54
WireCell::Pimpos::origin
const Point & origin() const
Return given 3-point origin for plane pitch.
Definition:
Pimpos.h:85
std
STL namespace.
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
abs
T abs(T value)
Definition:
sparse_vector_test.cc:30
anode_loader.h
THROW
#define THROW(e)
Definition:
Exceptions.h:25
WirePlane.h
WireCell::ValueError
Thrown when a wrong value has been encountered.
Definition:
Exceptions.h:37
WireCell::units::mm
static const double mm
Definition:
Units.h:55
WireCell
Definition:
Main.h:22
pimpos
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)
AnodePlane.h
main
int main(int argc, char *argv[])
Definition:
test_anodeplane.cxx:14
test_gen_rays_pdsp.argc
argc
Definition:
test_gen_rays_pdsp.py:6
WireCell::Pimpos::axis
const Vector & axis(int i) const
Definition:
Pimpos.h:89
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Units.h
Generated by
1.8.11