14 #include "nuevdb/EventDisplayBase/View3D.h" 16 #include "TPolyLine3D.h" 32 void DrawRectangularBox(evdb::View3D* view,
double* coordsLo,
double* coordsHi,
int color=kGray,
int width = 1,
int style = 1);
33 void DrawGrids(evdb::View3D* view,
double* coordsLo,
double* coordsHi,
bool verticalGrid,
int color=kGray,
int width = 1,
int style = 1);
34 void DrawAxes(evdb::View3D* view,
double* coordsLo,
double* coordsHi,
int color=kGray,
int width = 1,
int style = 1);
65 bool axesNotDrawn(
true);
67 double xl,xu,yl,yu,zl,zu;
69 geo->
WorldBox(&xl,&xu,&yl,&yu,&zl,&zu);
71 std::cout <<
"--- building ICARUS 3D display, low coord: " << xl <<
", " << yl <<
", " << zl <<
", hi coord: " << xu <<
", " << yu <<
", " << zu <<
std::endl;
78 double cryoCoordsLo[] = {cryoGeo.
MinX(), cryoGeo.
MinY(), cryoGeo.
MinZ()};
79 double cryoCoordsHi[] = {cryoGeo.
MaxX(), cryoGeo.
MaxY(), cryoGeo.
MaxZ()};
81 std::cout <<
" - cryostat: " << cryoGeo.
ID() <<
", low coord: " << cryoCoordsLo[0] <<
", " << cryoCoordsLo[1] <<
", " << cryoCoordsLo[2] <<
", hi coord: " << cryoCoordsHi[0] <<
", " << cryoCoordsHi[1] <<
", " << cryoCoordsHi[2] <<
std::endl;
87 DrawAxes(view, cryoCoordsLo, cryoCoordsHi, kBlue, 1, 1);
92 for(
size_t tpcIdx = 0; tpcIdx < cryoGeo.
NTPC(); tpcIdx++)
100 double coordsLo[] = {tpcCenter.X() - tpcGeo.
HalfWidth(), tpcCenter.Y() - tpcGeo.
HalfHeight(), tpcCenter.Z() - 0.5 * tpcGeo.
Length()};
101 double coordsHi[] = {tpcCenter.X() + tpcGeo.
HalfWidth(), tpcCenter.Y() + tpcGeo.
HalfHeight(), tpcCenter.Z() + 0.5 * tpcGeo.
Length()};
103 std::cout <<
" - TPC: " << tpcGeo.
ID() <<
", low coord: " << coordsLo[0] <<
", " << coordsLo[1] <<
", " << coordsLo[2] <<
", hi coord: " << coordsHi[0] <<
", " << coordsHi[1] <<
", " << coordsHi[2] <<
std::endl;
119 TPolyLine3D&
top = view->AddPolyLine3D(5, color, width, style);
120 top.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
121 top.SetPoint(1, coordsHi[0], coordsHi[1], coordsLo[2]);
122 top.SetPoint(2, coordsHi[0], coordsHi[1], coordsHi[2]);
123 top.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
124 top.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
126 TPolyLine3D& side = view->AddPolyLine3D(5, color, width, style);
127 side.SetPoint(0, coordsHi[0], coordsHi[1], coordsLo[2]);
128 side.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
129 side.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
130 side.SetPoint(3, coordsHi[0], coordsHi[1], coordsHi[2]);
131 side.SetPoint(4, coordsHi[0], coordsHi[1], coordsLo[2]);
133 TPolyLine3D& side2 = view->AddPolyLine3D(5, color, width, style);
134 side2.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
135 side2.SetPoint(1, coordsLo[0], coordsLo[1], coordsLo[2]);
136 side2.SetPoint(2, coordsLo[0], coordsLo[1], coordsHi[2]);
137 side2.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
138 side2.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
140 TPolyLine3D&
bottom = view->AddPolyLine3D(5, color, width, style);
141 bottom.SetPoint(0, coordsLo[0], coordsLo[1], coordsLo[2]);
142 bottom.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
143 bottom.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
144 bottom.SetPoint(3, coordsLo[0], coordsLo[1], coordsHi[2]);
145 bottom.SetPoint(4, coordsLo[0], coordsLo[1], coordsLo[2]);
152 double z = coordsLo[2];
156 TPolyLine3D& gridt = view->AddPolyLine3D(2, color, style, width);
157 gridt.SetPoint(0, coordsLo[0], coordsLo[1], z);
158 gridt.SetPoint(1, coordsHi[0], coordsLo[1], z);
162 TPolyLine3D& grids = view->AddPolyLine3D(2, color, style, width);
163 grids.SetPoint(0, coordsHi[0], coordsLo[1], z);
164 grids.SetPoint(1, coordsHi[0], coordsHi[1], z);
168 if (z>coordsHi[2])
break;
172 double x = coordsLo[0];
175 TPolyLine3D& gridt = view->AddPolyLine3D(2, color, style, width);
176 gridt.SetPoint(0, x, coordsLo[1], coordsLo[2]);
177 gridt.SetPoint(1, x, coordsLo[1], coordsHi[2]);
179 if (x>coordsHi[0])
break;
185 double y = coordsLo[1];
188 TPolyLine3D& grids = view->AddPolyLine3D(2, color, style, width);
189 grids.SetPoint(0, coordsHi[0], y, coordsLo[2]);
190 grids.SetPoint(1, coordsHi[0], y, coordsHi[2]);
192 if (y>coordsHi[1])
break;
204 double y0 = 1.10*coordsLo[1];
205 double z0 = -0.10*coordsHi[2];
206 double sz = 0.20*coordsHi[2];
208 TPolyLine3D& xaxis = view->AddPolyLine3D(2, color, style, width);
209 TPolyLine3D& yaxis = view->AddPolyLine3D(2, color, style, width);
210 TPolyLine3D& zaxis = view->AddPolyLine3D(2, color, style, width);
211 xaxis.SetPoint(0, x0, y0, z0);
212 xaxis.SetPoint(1, sz+x0, y0, z0);
214 yaxis.SetPoint(0, x0, y0, z0);
215 yaxis.SetPoint(1, x0, y0+sz, z0);
217 zaxis.SetPoint(0, x0, y0, z0);
218 zaxis.SetPoint(1, x0, y0, z0+sz);
220 TPolyLine3D& xpoint = view->AddPolyLine3D(3, color, style, width);
221 TPolyLine3D& ypoint = view->AddPolyLine3D(3, color, style, width);
222 TPolyLine3D& zpoint = view->AddPolyLine3D(3, color, style, width);
224 xpoint.SetPoint(0, 0.95*sz+x0, y0, z0-0.05*sz);
225 xpoint.SetPoint(1, 1.00*sz+x0, y0, z0);
226 xpoint.SetPoint(2, 0.95*sz+x0, y0, z0+0.05*sz);
228 ypoint.SetPoint(0, x0, 0.95*sz+y0, z0-0.05*sz);
229 ypoint.SetPoint(1, x0, 1.00*sz+y0, z0);
230 ypoint.SetPoint(2, x0, 0.95*sz+y0, z0+0.05*sz);
232 zpoint.SetPoint(0, x0-0.05*sz, y0, 0.95*sz+z0);
233 zpoint.SetPoint(1, x0+0.00*sz, y0, 1.00*sz+z0);
234 zpoint.SetPoint(2, x0+0.05*sz, y0, 0.95*sz+z0);
236 TPolyLine3D& zleg = view->AddPolyLine3D(4, color, style, width);
237 zleg.SetPoint(0, x0-0.05*sz, y0+0.05*sz, z0+1.05*sz);
238 zleg.SetPoint(1, x0+0.05*sz, y0+0.05*sz, z0+1.05*sz);
239 zleg.SetPoint(2, x0-0.05*sz, y0-0.05*sz, z0+1.05*sz);
240 zleg.SetPoint(3, x0+0.05*sz, y0-0.05*sz, z0+1.05*sz);
242 TPolyLine3D& yleg = view->AddPolyLine3D(5, color, style, width);
243 yleg.SetPoint(0, x0-0.05*sz, y0+1.15*sz, z0);
244 yleg.SetPoint(1, x0+0.00*sz, y0+1.10*sz, z0);
245 yleg.SetPoint(2, x0+0.00*sz, y0+1.05*sz, z0);
246 yleg.SetPoint(3, x0+0.00*sz, y0+1.10*sz, z0);
247 yleg.SetPoint(4, x0+0.05*sz, y0+1.15*sz, z0);
249 TPolyLine3D& xleg = view->AddPolyLine3D(7, color, style, width);
250 xleg.SetPoint(0, x0+1.05*sz, y0+0.05*sz, z0-0.05*sz);
251 xleg.SetPoint(1, x0+1.05*sz, y0+0.00*sz, z0-0.00*sz);
252 xleg.SetPoint(2, x0+1.05*sz, y0+0.05*sz, z0+0.05*sz);
253 xleg.SetPoint(3, x0+1.05*sz, y0+0.00*sz, z0-0.00*sz);
254 xleg.SetPoint(4, x0+1.05*sz, y0-0.05*sz, z0-0.05*sz);
255 xleg.SetPoint(5, x0+1.05*sz, y0+0.00*sz, z0-0.00*sz);
256 xleg.SetPoint(6, x0+1.05*sz, y0-0.05*sz, z0+0.05*sz);
270 for(
size_t viewNo = 0; viewNo < geo->
Nviews(); viewNo++)
272 for(
size_t wireNo = 0; wireNo < geo->
Nwires(viewNo); wireNo++)
278 if (channelStatus.
IsBad(channel))
288 TPolyLine3D& pl = view->AddPolyLine3D(2, color, style, width);
289 pl.SetPoint(0, coords[0]-0.5, wireStart[1], wireStart[2]);
290 pl.SetPoint(1, coords[0]-0.5, wireEnd[1], wireEnd[2]);
geo::TPCID const & ID() const
Returns the identifier of this TPC.
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
void GetStart(double *xyz) const
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
void WorldBox(double *xlo, double *xhi, double *ylo, double *yhi, double *zlo, double *zhi) const
Fills the arguments with the boundaries of the world.
double MinX() const
Returns the world x coordinate of the start of the box.
cryostat_iterator end_cryostat() const
Returns an iterator pointing after the last cryostat.
Geometry information for a single TPC.
double MaxX() const
Returns the world x coordinate of the end of the box.
Geometry information for a single cryostat.
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
art framework interface to geometry description
double Length() const
Length is associated with z coordinate [cm].
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
T get(std::string const &key) const
double MinZ() const
Returns the world z coordinate of the start of the box.
unsigned int NTPC() const
Number of TPCs in this cryostat.
Class providing information about the quality of channels.
double MaxY() const
Returns the world y coordinate of the end of the box.
double HalfHeight() const
Height is associated with y coordinate [cm].
cryostat_iterator begin_cryostat() const
Returns an iterator pointing to the first cryostat.
std::size_t color(std::string const &procname)
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
void GetEnd(double *xyz) const
double MaxZ() const
Returns the world z coordinate of the end of the box.
Interface for experiment-specific channel quality info provider.
unsigned int Nviews() const
Returns the number of views (different wire orientations)
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Interface for experiment-specific service for channel quality info.
Forward iterator browsing all geometry elements in the detector.
This is the interface class for drawing 3D detector geometries.
LArSoft geometry interface.
double MinY() const
Returns the world y coordinate of the start of the box.
double HalfWidth() const
Width is associated with x coordinate [cm].
QTextStream & endl(QTextStream &s)
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
WireGeo const * WirePtr(geo::WireID const &wireid) const
Returns the specified wire.