13 cerr <<
"Loading twice, should read but once\n";
17 Assert(store1.db().get() == store2.db().get());
19 cerr <<
"Total store has:\n";
20 cerr <<
"\t" << store1.detectors().size() <<
" detectors\n";
21 cerr <<
"\t" << store1.anodes().size() <<
" anodes\n";
22 cerr <<
"\t" << store1.faces().size() <<
" faces\n";
23 cerr <<
"\t" << store1.planes().size() <<
" planes\n";
24 cerr <<
"\t" << store1.wires().size() <<
" wires\n";
26 Assert(store1.wires().size() > 0);
28 auto&
a0 = store1.anode(0);
29 cerr <<
"Got anode 0 with " << store1.faces(a0).size() <<
" faces\n";
32 const int bogusid = 0xdeadbeaf;
34 store1.anode(bogusid);
35 cerr <<
"Unexpectedly got bogus anode ID "<<bogusid<<
"\n";
39 cerr <<
"Correctly caught exception with unlikely anode id "<<bogusid<<
":\n" 45 for (
const auto& anode : store1.anodes()) {
46 for (
const auto& face: store1.faces(anode)) {
47 for (
const auto& plane: store1.planes(face)) {
49 auto bb = store1.bounding_box(plane);
50 auto wp = store1.wire_pitch(plane);
51 auto ex = wp.first.cross(wp.second);
53 cerr <<
"anode:" << anode.ident
54 <<
" face:" << face.ident
55 <<
" plane:" << plane.ident <<
":\n" 56 <<
"\tdrift: " <<
ex <<
"\n" 57 <<
"\twire: " << wp.first <<
"\n" 58 <<
"\tpitch: " << wp.second <<
"\n" 59 <<
"\tbb: " << bb.bounds()/
units::cm <<
"cm\n";
61 auto wplane = store1.planes(face).back();
62 auto wires = store1.wires(wplane);
63 const double zmax = wires.back().head.z();
64 const double zmin = wires.front().head.z();
65 const double dd = zmax-zmin;
66 const int n = wires.size();
67 cerr <<
"\tW plane: " << n <<
" wires, " 76 const char*
filename =
"microboone-celltree-wires-v2.1.json.bz2";
char const * what() const
void test_read(const char *filename)
int main(int argc, char *argv[])
The base wire cell exception.
def load(filename, jpath="depos")