11 #include "cetlib_except/exception.h" 22 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 23 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 25 #include "TPolyLine.h" 26 #include "TPolyLine3D.h" 48 void DrawGrids(
evdb::View3D* view,
double* coordsLo,
double* coordsHi,
bool verticalGrid,
int color=kGray,
int width = 1,
int style = 1);
80 bool axesNotDrawn(
true);
82 double xl,xu,yl,yu,zl,zu;
84 geo->
WorldBox(&xl,&xu,&yl,&yu,&zl,&zu);
86 std::cout <<
"--- building ICARUS 3D display, low coord: " << xl <<
", " << yl <<
", " << zl <<
", hi coord: " << xu <<
", " << yu <<
", " << zu << std::endl;
93 double cryoCoordsLo[] = {cryoGeo.
MinX(), cryoGeo.
MinY(), cryoGeo.
MinZ()};
94 double cryoCoordsHi[] = {cryoGeo.
MaxX(), cryoGeo.
MaxY(), cryoGeo.
MaxZ()};
96 std::cout <<
" - cryostat: " << cryoGeo.
ID() <<
", low coord: " << cryoCoordsLo[0] <<
", " << cryoCoordsLo[1] <<
", " << cryoCoordsLo[2] <<
", hi coord: " << cryoCoordsHi[0] <<
", " << cryoCoordsHi[1] <<
", " << cryoCoordsHi[2] << std::endl;
102 DrawAxes(view, cryoCoordsLo, cryoCoordsHi, kBlue, 1, 1);
107 for(
size_t tpcIdx = 0; tpcIdx < cryoGeo.
NTPC(); tpcIdx++)
115 double coordsLo[] = {tpcCenter.X() - tpcGeo.
HalfWidth(), tpcCenter.Y() - tpcGeo.
HalfHeight(), tpcCenter.Z() - 0.5 * tpcGeo.
Length()};
116 double coordsHi[] = {tpcCenter.X() + tpcGeo.
HalfWidth(), tpcCenter.Y() + tpcGeo.
HalfHeight(), tpcCenter.Z() + 0.5 * tpcGeo.
Length()};
118 std::cout <<
" - TPC: " << tpcGeo.
ID() <<
", low coord: " << coordsLo[0] <<
", " << coordsLo[1] <<
", " << coordsLo[2] <<
", hi coord: " << coordsHi[0] <<
", " << coordsHi[1] <<
", " << coordsHi[2] << std::endl;
134 TPolyLine3D& top = view->
AddPolyLine3D(5, color, width, style);
135 top.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
136 top.SetPoint(1, coordsHi[0], coordsHi[1], coordsLo[2]);
137 top.SetPoint(2, coordsHi[0], coordsHi[1], coordsHi[2]);
138 top.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
139 top.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
141 TPolyLine3D& side = view->
AddPolyLine3D(5, color, width, style);
142 side.SetPoint(0, coordsHi[0], coordsHi[1], coordsLo[2]);
143 side.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
144 side.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
145 side.SetPoint(3, coordsHi[0], coordsHi[1], coordsHi[2]);
146 side.SetPoint(4, coordsHi[0], coordsHi[1], coordsLo[2]);
148 TPolyLine3D& side2 = view->
AddPolyLine3D(5, color, width, style);
149 side2.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
150 side2.SetPoint(1, coordsLo[0], coordsLo[1], coordsLo[2]);
151 side2.SetPoint(2, coordsLo[0], coordsLo[1], coordsHi[2]);
152 side2.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
153 side2.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
155 TPolyLine3D& bottom = view->
AddPolyLine3D(5, color, width, style);
156 bottom.SetPoint(0, coordsLo[0], coordsLo[1], coordsLo[2]);
157 bottom.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
158 bottom.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
159 bottom.SetPoint(3, coordsLo[0], coordsLo[1], coordsHi[2]);
160 bottom.SetPoint(4, coordsLo[0], coordsLo[1], coordsLo[2]);
167 double z = coordsLo[2];
171 TPolyLine3D& gridt = view->
AddPolyLine3D(2, color, style, width);
172 gridt.SetPoint(0, coordsLo[0], coordsLo[1], z);
173 gridt.SetPoint(1, coordsHi[0], coordsLo[1], z);
177 TPolyLine3D& grids = view->
AddPolyLine3D(2, color, style, width);
178 grids.SetPoint(0, coordsHi[0], coordsLo[1], z);
179 grids.SetPoint(1, coordsHi[0], coordsHi[1], z);
183 if (z>coordsHi[2])
break;
187 double x = coordsLo[0];
190 TPolyLine3D& gridt = view->
AddPolyLine3D(2, color, style, width);
191 gridt.SetPoint(0, x, coordsLo[1], coordsLo[2]);
192 gridt.SetPoint(1, x, coordsLo[1], coordsHi[2]);
194 if (x>coordsHi[0])
break;
200 double y = coordsLo[1];
203 TPolyLine3D& grids = view->
AddPolyLine3D(2, color, style, width);
204 grids.SetPoint(0, coordsHi[0], y, coordsLo[2]);
205 grids.SetPoint(1, coordsHi[0], y, coordsHi[2]);
207 if (y>coordsHi[1])
break;
219 double y0 = 1.10*coordsLo[1];
220 double z0 = -0.10*coordsHi[2];
221 double sz = 0.20*coordsHi[2];
224 TPolyLine3D& yaxis = view->
AddPolyLine3D(2, color, style, width);
225 TPolyLine3D& zaxis = view->
AddPolyLine3D(2, color, style, width);
226 xaxis.SetPoint(0, x0, y0, z0);
227 xaxis.SetPoint(1, sz+x0, y0, z0);
229 yaxis.SetPoint(0, x0, y0, z0);
230 yaxis.SetPoint(1, x0, y0+sz, z0);
232 zaxis.SetPoint(0, x0, y0, z0);
233 zaxis.SetPoint(1, x0, y0, z0+sz);
235 TPolyLine3D& xpoint = view->
AddPolyLine3D(3, color, style, width);
236 TPolyLine3D& ypoint = view->
AddPolyLine3D(3, color, style, width);
237 TPolyLine3D& zpoint = view->
AddPolyLine3D(3, color, style, width);
239 xpoint.SetPoint(0, 0.95*sz+x0, y0, z0-0.05*sz);
240 xpoint.SetPoint(1, 1.00*sz+x0, y0, z0);
241 xpoint.SetPoint(2, 0.95*sz+x0, y0, z0+0.05*sz);
243 ypoint.SetPoint(0, x0, 0.95*sz+y0, z0-0.05*sz);
244 ypoint.SetPoint(1, x0, 1.00*sz+y0, z0);
245 ypoint.SetPoint(2, x0, 0.95*sz+y0, z0+0.05*sz);
247 zpoint.SetPoint(0, x0-0.05*sz, y0, 0.95*sz+z0);
248 zpoint.SetPoint(1, x0+0.00*sz, y0, 1.00*sz+z0);
249 zpoint.SetPoint(2, x0+0.05*sz, y0, 0.95*sz+z0);
251 TPolyLine3D& zleg = view->
AddPolyLine3D(4, color, style, width);
252 zleg.SetPoint(0, x0-0.05*sz, y0+0.05*sz, z0+1.05*sz);
253 zleg.SetPoint(1, x0+0.05*sz, y0+0.05*sz, z0+1.05*sz);
254 zleg.SetPoint(2, x0-0.05*sz, y0-0.05*sz, z0+1.05*sz);
255 zleg.SetPoint(3, x0+0.05*sz, y0-0.05*sz, z0+1.05*sz);
257 TPolyLine3D& yleg = view->
AddPolyLine3D(5, color, style, width);
258 yleg.SetPoint(0, x0-0.05*sz, y0+1.15*sz, z0);
259 yleg.SetPoint(1, x0+0.00*sz, y0+1.10*sz, z0);
260 yleg.SetPoint(2, x0+0.00*sz, y0+1.05*sz, z0);
261 yleg.SetPoint(3, x0+0.00*sz, y0+1.10*sz, z0);
262 yleg.SetPoint(4, x0+0.05*sz, y0+1.15*sz, z0);
264 TPolyLine3D& xleg = view->
AddPolyLine3D(7, color, style, width);
265 xleg.SetPoint(0, x0+1.05*sz, y0+0.05*sz, z0-0.05*sz);
266 xleg.SetPoint(1, x0+1.05*sz, y0+0.00*sz, z0-0.00*sz);
267 xleg.SetPoint(2, x0+1.05*sz, y0+0.05*sz, z0+0.05*sz);
268 xleg.SetPoint(3, x0+1.05*sz, y0+0.00*sz, z0-0.00*sz);
269 xleg.SetPoint(4, x0+1.05*sz, y0-0.05*sz, z0-0.05*sz);
270 xleg.SetPoint(5, x0+1.05*sz, y0+0.00*sz, z0-0.00*sz);
271 xleg.SetPoint(6, x0+1.05*sz, y0-0.05*sz, z0+0.05*sz);
281 lariov::ChannelStatusProvider
const& channelStatus
285 for(
size_t viewNo = 0; viewNo < geo->
Nviews(); viewNo++)
287 for(
size_t wireNo = 0; wireNo < geo->
Nwires(viewNo); wireNo++)
293 if (channelStatus.IsBad(channel))
303 TPolyLine3D& pl = view->
AddPolyLine3D(2, color, style, width);
304 pl.SetPoint(0, coords[0]-0.5, wireStart[1], wireStart[2]);
305 pl.SetPoint(1, coords[0]-0.5, wireEnd[1], wireEnd[2]);
geo::TPCID const & ID() const
Returns the identifier of this TPC.
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.
A collection of drawable 2-D objects.
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.
double Length() const
Length is associated with z coordinate [cm].
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
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.
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.
A collection of 3D drawable objects.
unsigned int Nviews() const
Returns the number of views (different wire orientations)
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Forward iterator browsing all geometry elements in the detector.
This is the interface class for drawing 3D detector geometries.
Namespace collecting geometry-related classes utilities.
double MinY() const
Returns the world y coordinate of the start of the box.
art framework interface to geometry description
double HalfWidth() const
Width is associated with x coordinate [cm].
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.