17 #include "TPolyLine3D.h" 57 double const* coordsLo,
58 double const* coordsHi,
63 double const* coordsLo,
64 double const* coordsHi,
69 double const* coordsLo,
70 double const* coordsHi,
105 auto const& geom = *(lar::providerFrom<geo::Geometry>());
122 for (
geo::TPCGeo const& TPC : cryo.IterateTPCs()) {
129 std::array<double, 3U>
const tpcLow{{TPC.MinX(), TPC.MinY(), TPC.MinZ()}},
130 tpcHigh{{TPC.MaxX(), TPC.MaxY(), TPC.MaxZ()}};
131 DrawGrids(view, tpcLow.data(), tpcHigh.data(), kGray + 2, 1, kSolid);
144 std::array<double, 3U>
const detLow = {{detector.MinX(), detector.MinY(), detector.MinZ()}},
145 detHigh = {{detector.MaxX(), detector.MaxY(), detector.MaxZ()}};
147 DrawAxes(view, detLow.data(), detHigh.data(), kBlue, 1, kSolid);
158 std::array<double, 3U>
const low{{bb.
MinX(), bb.
MinY(), bb.
MinZ()}},
184 double const* coordsLo,
185 double const* coordsHi,
190 TPolyLine3D& top = view->
AddPolyLine3D(5, color, width, style);
191 top.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
192 top.SetPoint(1, coordsHi[0], coordsHi[1], coordsLo[2]);
193 top.SetPoint(2, coordsHi[0], coordsHi[1], coordsHi[2]);
194 top.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
195 top.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
197 TPolyLine3D& side = view->
AddPolyLine3D(5, color, width, style);
198 side.SetPoint(0, coordsHi[0], coordsHi[1], coordsLo[2]);
199 side.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
200 side.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
201 side.SetPoint(3, coordsHi[0], coordsHi[1], coordsHi[2]);
202 side.SetPoint(4, coordsHi[0], coordsHi[1], coordsLo[2]);
204 TPolyLine3D& side2 = view->
AddPolyLine3D(5, color, width, style);
205 side2.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
206 side2.SetPoint(1, coordsLo[0], coordsLo[1], coordsLo[2]);
207 side2.SetPoint(2, coordsLo[0], coordsLo[1], coordsHi[2]);
208 side2.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
209 side2.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
211 TPolyLine3D& bottom = view->
AddPolyLine3D(5, color, width, style);
212 bottom.SetPoint(0, coordsLo[0], coordsLo[1], coordsLo[2]);
213 bottom.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
214 bottom.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
215 bottom.SetPoint(3, coordsLo[0], coordsLo[1], coordsHi[2]);
216 bottom.SetPoint(4, coordsLo[0], coordsLo[1], coordsLo[2]);
222 double const* coordsLo,
223 double const* coordsHi,
233 double const gridStep = std::min(25.0,
235 std::min({
std::abs(coordsHi[0] - coordsLo[0]),
236 std::abs(coordsHi[1] - coordsLo[1]),
237 std::abs(coordsHi[2] - coordsLo[2])})) /
241 for (
double z = coordsLo[2];
z <= coordsHi[2];
z += gridStep) {
244 TPolyLine3D& gridt = view->
AddPolyLine3D(2, color, style, width);
245 gridt.SetPoint(0, coordsLo[0], coordsLo[1],
z);
246 gridt.SetPoint(1, coordsHi[0], coordsLo[1],
z);
249 TPolyLine3D& grids = view->
AddPolyLine3D(2, color, style, width);
250 grids.SetPoint(0, coordsHi[0], coordsLo[1],
z);
251 grids.SetPoint(1, coordsHi[0], coordsHi[1],
z);
255 for (
double x = coordsLo[0];
x <= coordsHi[0];
x += gridStep) {
257 TPolyLine3D& gridt = view->
AddPolyLine3D(2, color, style, width);
258 gridt.SetPoint(0,
x, coordsLo[1], coordsLo[2]);
259 gridt.SetPoint(1,
x, coordsLo[1], coordsHi[2]);
263 for (
double y = coordsLo[1];
y <= coordsHi[1];
y += gridStep) {
265 TPolyLine3D& grids = view->
AddPolyLine3D(2, color, style, width);
266 grids.SetPoint(0, coordsHi[0],
y, coordsLo[2]);
267 grids.SetPoint(1, coordsHi[0],
y, coordsHi[2]);
274 double const* coordsLo,
275 double const* coordsHi,
284 double const vertexMargin = 0.06;
285 double const axisLength = 0.40;
287 double const dx = (coordsHi[0] - coordsLo[0]);
288 double const dy = (coordsHi[1] - coordsLo[1]);
289 double const dz = (coordsHi[2] - coordsLo[2]);
292 double const x0 = coordsLo[0] - dx * vertexMargin;
293 double const y0 = coordsLo[1] - dy * vertexMargin;
294 double const z0 = coordsLo[2] - dz * vertexMargin;
299 TPolyLine3D& yaxis = view->
AddPolyLine3D(2, color, style, width);
300 TPolyLine3D& zaxis = view->
AddPolyLine3D(2, color, style, width);
301 xaxis.SetPoint(0, x0, y0, z0);
302 xaxis.SetPoint(1, sz + x0, y0, z0);
304 yaxis.SetPoint(0, x0, y0, z0);
305 yaxis.SetPoint(1, x0, y0 + sz, z0);
307 zaxis.SetPoint(0, x0, y0, z0);
308 zaxis.SetPoint(1, x0, y0, z0 + sz);
310 TPolyLine3D& xpoint = view->
AddPolyLine3D(3, color, style, width);
311 TPolyLine3D& ypoint = view->
AddPolyLine3D(3, color, style, width);
312 TPolyLine3D& zpoint = view->
AddPolyLine3D(3, color, style, width);
314 xpoint.SetPoint(0, 0.95 * sz + x0, y0, z0 - 0.05 * sz);
315 xpoint.SetPoint(1, 1.00 * sz + x0, y0, z0);
316 xpoint.SetPoint(2, 0.95 * sz + x0, y0, z0 + 0.05 * sz);
318 ypoint.SetPoint(0, x0, 0.95 * sz + y0, z0 - 0.05 * sz);
319 ypoint.SetPoint(1, x0, 1.00 * sz + y0, z0);
320 ypoint.SetPoint(2, x0, 0.95 * sz + y0, z0 + 0.05 * sz);
322 zpoint.SetPoint(0, x0 - 0.05 * sz, y0, 0.95 * sz + z0);
323 zpoint.SetPoint(1, x0 + 0.00 * sz, y0, 1.00 * sz + z0);
324 zpoint.SetPoint(2, x0 + 0.05 * sz, y0, 0.95 * sz + z0);
326 TPolyLine3D& zleg = view->
AddPolyLine3D(4, color, style, width);
327 zleg.SetPoint(0, x0 - 0.05 * sz, y0 + 0.05 * sz, z0 + 1.05 * sz);
328 zleg.SetPoint(1, x0 + 0.05 * sz, y0 + 0.05 * sz, z0 + 1.05 * sz);
329 zleg.SetPoint(2, x0 - 0.05 * sz, y0 - 0.05 * sz, z0 + 1.05 * sz);
330 zleg.SetPoint(3, x0 + 0.05 * sz, y0 - 0.05 * sz, z0 + 1.05 * sz);
332 TPolyLine3D& yleg = view->
AddPolyLine3D(5, color, style, width);
333 yleg.SetPoint(0, x0 - 0.05 * sz, y0 + 1.15 * sz, z0);
334 yleg.SetPoint(1, x0 + 0.00 * sz, y0 + 1.10 * sz, z0);
335 yleg.SetPoint(2, x0 + 0.00 * sz, y0 + 1.05 * sz, z0);
336 yleg.SetPoint(3, x0 + 0.00 * sz, y0 + 1.10 * sz, z0);
337 yleg.SetPoint(4, x0 + 0.05 * sz, y0 + 1.15 * sz, z0);
339 TPolyLine3D& xleg = view->
AddPolyLine3D(7, color, style, width);
340 xleg.SetPoint(0, x0 + 1.05 * sz, y0 + 0.05 * sz, z0 - 0.05 * sz);
341 xleg.SetPoint(1, x0 + 1.05 * sz, y0 + 0.00 * sz, z0 - 0.00 * sz);
342 xleg.SetPoint(2, x0 + 1.05 * sz, y0 + 0.05 * sz, z0 + 0.05 * sz);
343 xleg.SetPoint(3, x0 + 1.05 * sz, y0 + 0.00 * sz, z0 - 0.00 * sz);
344 xleg.SetPoint(4, x0 + 1.05 * sz, y0 - 0.05 * sz, z0 - 0.05 * sz);
345 xleg.SetPoint(5, x0 + 1.05 * sz, y0 + 0.00 * sz, z0 - 0.00 * sz);
346 xleg.SetPoint(6, x0 + 1.05 * sz, y0 - 0.05 * sz, z0 + 0.05 * sz);
Utilities related to art service access.
Encapsulate the construction of a single cyostat.
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
double MinX() const
Returns the world x coordinate of the start of the box.
Geometry information for a single TPC.
constexpr auto abs(T v)
Returns the absolute value of the argument.
double MaxX() const
Returns the world x coordinate of the end of the box.
Geometry information for a single cryostat.
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
double ActiveHalfLength() const
Length (associated with z coordinate) of active TPC volume [cm].
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
T get(std::string const &key) const
double MinZ() const
Returns the world z coordinate of the start of the box.
Point_t GetActiveVolumeCenter() const
Returns the center of the TPC active volume in world coordinates [cm].
double MaxY() const
Returns the world y coordinate of the end of the box.
std::size_t color(std::string const &procname)
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
double MaxZ() const
Returns the world z coordinate of the end of the box.
void ExtendToInclude(Coord_t x, Coord_t y, Coord_t z)
Extends the current box to also include the specified point.
A collection of 3D drawable objects.
This is the interface class for drawing 3D detector geometries.
double MinY() const
Returns the world y coordinate of the start of the box.
art framework interface to geometry description
Encapsulate the construction of a single detector plane.