20 return Store(maybe->second);
34 const int npoints = jpoints.size();
35 points.resize(npoints);
36 for (
int ipoint=0; ipoint<npoints; ++ipoint) {
38 points[ipoint].set(get<double>(jp,
"x"), get<double>(jp,
"y"), get<double>(jp,
"z"));
44 const int nwires = jwires.size();
45 std::vector<Wire>& wires = store->
wires;
47 for (
int iwire=0; iwire<
nwires; ++iwire) {
49 Wire& wire = wires[iwire];
50 wire.
ident = get<int>(jwire,
"ident");
51 wire.
channel = get<int>(jwire,
"channel");
52 wire.
segment = get<int>(jwire,
"segment");
54 int itail = get<int>(jwire,
"tail");
55 int ihead = get<int>(jwire,
"head");
56 wire.
tail = points[itail];
57 wire.
head = points[ihead];
64 const int nplanes = jplanes.size();
65 std::vector<Plane>& planes = store->
planes;
66 planes.resize(nplanes);
67 for (
int iplane=0; iplane<nplanes; ++iplane) {
69 Plane& plane = planes[iplane];
70 plane.
ident = get<int>(jplane,
"ident");
72 const int nwires = jwires.size();
73 plane.
wires.resize(nwires);
74 for (
int iwire=0; iwire<
nwires; ++iwire) {
82 const int nfaces = jfaces.size();
83 std::vector<Face>& faces = store->
faces;
85 for (
int iface=0; iface<nfaces; ++iface) {
87 Face& face = faces[iface];
88 face.
ident = get<int>(jface,
"ident");
90 const int nplanes = jplanes.size();
91 face.
planes.resize(nplanes);
92 for (
int iplane=0; iplane<nplanes; ++iplane) {
100 const int nanodes = janodes.size();
101 std::vector<Anode>& anodes = store->
anodes;
102 anodes.resize(nanodes);
103 for (
int ianode=0; ianode<nanodes; ++ianode) {
105 Anode& anode = anodes[ianode];
106 anode.
ident = get<int>(janode,
"ident");
108 const int nfaces = jfaces.size();
109 anode.
faces.resize(nfaces);
110 for (
int iface=0; iface<nfaces; ++iface) {
118 const int ndets = jdets.size();
119 std::vector<Detector>& dets = store->
detectors;
121 for (
int idet=0; idet<ndets; ++idet) {
124 det.
ident = get<int>(jdet,
"ident");
126 const int nanodes = janodes.size();
127 det.
anodes.resize(nanodes);
128 for (
int ianode=0; ianode<nanodes; ++ianode) {
134 return Store(gStoreCache[realpath]);
std::shared_ptr< const StoreDB > StoreDBPtr
static std::map< std::string, StoreDBPtr > gStoreCache
std::vector< Anode > anodes
std::vector< Face > faces
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
std::vector< int > planes
Json::Value load(const std::string &filename, const externalvars_t &extvar=externalvars_t(), const externalvars_t &extcode=externalvars_t())
std::vector< Wire > wires
int convert< int >(const Configuration &cfg, const int &def)
std::vector< Plane > planes
std::vector< Detector > detectors
std::vector< int > anodes
std::string resolve(const std::string &filename)