33 int nx,
double x0,
double x1,
34 int ny,
double y0,
double y1)
35 : TH2F(a, b, nx, x0, x1, ny, y0, y1)
50 static const int kX = 0;
51 static const int kY = 1;
53 static const double kZsf = 1.015;
54 static const double kTsf = 1.035;
82 this->
Pad()->SetBit(TPad::kCannotMove);
88 this->
Pad()->SetLeftMargin (0.050);
89 this->
Pad()->SetRightMargin (0.010);
90 this->
Pad()->SetTopMargin (0.110);
91 this->
Pad()->SetBottomMargin(0.005);
94 this->
Pad()->SetLeftMargin (0.050);
95 this->
Pad()->SetRightMargin (0.010);
96 this->
Pad()->SetTopMargin (0.005);
97 this->
Pad()->SetBottomMargin(0.120);
119 if(!rezoom) rezoom = &
temp;
136 this->
GeometryDraw()-> FiducialVolumeUser2D (*evt, vx, vy);
137 this->
GeometryDraw()-> DrawBadBoxesPretty (*evt, vx, vy);
145 this->
GeometryDraw()-> DrawHighlightCell (*evt, vx, vy);
161 fPad->SetGridx(grid);
162 fPad->SetGridy(grid);
175 if (
fLastSlice != nav->CurrentSlice()) *rezoom =
true;
183 switch (drawopt->
fZoom) {
241 std::vector<art::Handle<std::vector<rb::CellHit>>> chits;
244 std::set<geo::OfflineChan> hmap;
245 for(
unsigned int i = 0;
i < chits.size(); ++
i){
246 for(
unsigned int j = 0;
j < chits[
i]->size(); ++
j){
267 nav->
GetBounds(*evt, xmin, xmax, ymin, ymax, zmin, zmax, .1);
280 nav->
GetBox(*evt, xmin, xmax, ymin, ymax, zmin, zmax, .1);
290 double zmin,
double zmax,
double safety)
292 const double dxy =
std::max(xmax-xmin, ymax-ymin);
293 const double dz = zmax-zmin;
295 const double xavg = (xmin+
xmax)/2;
296 const double yavg = (ymin+
ymax)/2;
298 xmin = xavg-(.5+safety)*dxy;
299 xmax = xavg+(.5+safety)*dxy;
300 ymin = yavg-(.5+safety)*dxy;
301 ymax = yavg+(.5+safety)*dxy;
305 fHisto->GetXaxis()->SetRangeUser(zmin, zmax);
306 if(
fXorY == kX)
fHisto->GetYaxis()->SetRangeUser(xmin, xmax);
307 else fHisto->GetYaxis()->SetRangeUser(ymin, ymax);
321 double zmin = -(kZsf-1.0)*g->
DetLength();
327 fHisto->GetXaxis()->SetRangeUser(zmin,zmax);
328 if (
fXorY==kX)
fHisto->GetYaxis()->SetRangeUser(xmin,xmax);
329 else fHisto->GetYaxis()->SetRangeUser(ymin,ymax);
342 double zmin = -(kZsf-1.0)*g->
DetLength();
348 fHisto->GetXaxis()->SetRangeUser(zmin,zmax);
349 if (
fXorY==kX)
fHisto->GetYaxis()->SetRangeUser(xmin,xmax);
350 else fHisto->GetYaxis()->SetRangeUser(ymin,ymax);
356 *i1 =
fHisto->GetYaxis()->GetFirst();
357 *i2 =
fHisto->GetYaxis()->GetLast();
364 *i1 =
fHisto->GetXaxis()->GetFirst();
365 *i2 =
fHisto->GetXaxis()->GetLast();
372 *i1 = axis->GetBinCenter( axis->GetFirst() );
373 *i2 = axis->GetBinCenter( axis->GetLast() );
381 *i1 = axis->GetBinCenter( axis->GetFirst() );
382 *i2 = axis->GetBinCenter( axis->GetLast() );
390 *i1 = axis->GetXmin();
391 *i2 = axis->GetXmax();
399 *i1 = axis->GetXmin();
400 *i2 = axis->GetXmax();
408 fHisto->GetXaxis()->SetRange(i1,i2);
416 axis->SetRange( axis->FindBin(i1) , axis->FindBin(i2) );
423 fHisto->GetYaxis()->SetRange(i1,i2);
431 axis->SetRange( axis->FindBin(i1) , axis->FindBin(i2) );
453 double zlo = -(kZsf-1.0)*geo->
DetLength();
457 if (zlo>zhi) {
double ztmp = zlo; zlo = zhi; zhi = ztmp; }
466 const char* xlabel =
";;x (cm)";
467 const char* ylabel =
";z (cm);y (cm)";
469 if (flipx) xlabel =
";;#leftarrow west x (cm) east #rightarrow";
470 else xlabel =
";;#leftarrow east x (cm) west #rightarrow";
471 if (flipz) ylabel =
";#leftarrow north z (cm) south #rightarrow;y (cm)";
472 else ylabel =
";#leftarrow south z (cm) north #rightarrow;y (cm)";
497 fHisto->GetYaxis()->CenterTitle();
498 fHisto->GetYaxis()->SetNdivisions(505);
499 fHisto->SetTitleOffset(0.5,
"Y");
501 fHisto->GetXaxis()->SetNoExponent();
static const int kZOOM_PARTIAL
T max(const caf::Proxy< T > &a, T b)
void SetZrange(int i1, int i2)
void GetWBoundCm(float *i1, float *i2) const
const art::Event * GetEvent() const
int fLabel
Which labels to draw?
std::map< std::string, double > xmax
void FLSHit2D(const art::Event &evt, evdb::View2D *xzview, evdb::View2D *yzview)
void GetBounds(const art::Event &evt, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, double trimfrac=0)
Float_t y1[n_points_granero]
correl_xv GetYaxis() -> SetDecimals()
Implement an UnZoom menu item.
unsigned int fLastRun
Last run number shown.
unsigned short Plane() const
void GetLimits(double *xmin, double *xmax, double *ymin, double *ymax, double *zmin, double *zmax)
Float_t x1[n_points_granero]
void GetBox(const art::Event &evt, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, double trimfrac=0)
static constexpr Double_t nm
void Draw(const char *opt=0, bool *rezoom=0)
GeometryDrawer * GeometryDraw()
void GetZBoundCm(float *i1, float *i2) const
void SetWrange(int i1, int i2)
static const int kZOOM_HITS
void AutoZoomSlice(const art::Event *evt)
void GetWrange(int *i1, int *i2) const
A collection of drawable 2-D objects.
TZProjPad(const char *nm, const char *ti, double x1, double y1, double x2, double y2, const char *opt)
void MCTruthVectors2D(const art::Event &evt, evdb::View2D *xzview, evdb::View2D *yzview)
void AutoZoomHelper(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double safety)
void GetWrangeCm(float *i1, float *i2) const
Singleton to hold the current art::Event for the event display.
static const int kZOOM_TRUTH
int fXorY
Which view? 0 = X vs. Z, 1 = Y vs. Z.
void SetWrangeCm(float i1, float i2)
unsigned short Cell() const
void MCTruthTrajectories2D(const art::Event &evt, evdb::View2D *xzview, evdb::View2D *yzview)
RawDataDrawer * RawDataDraw()
static EventHolder * Instance()
correl_xv GetXaxis() -> SetDecimals()
void SetZrangeCm(float i1, float i2)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Base class for event display drawing pads.
RecoBaseDrawer * RecoBaseDraw()
int fZoom
How to zoom the display.
void MCTruthVertices2D(const art::Event &evt, evdb::View2D *xzview, evdb::View2D *yzview)
void getManyByType(std::vector< Handle< PROD >> &results) const
double DetHalfHeight() const
SimulationDrawer * SimulationDraw()
Class to aid in the rendering of RecoBase objects.
void GetLimits(const art::Event *evt, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, const std::set< geo::OfflineChan > &hmap={})
Class to aid in the rendering of RawData objects.
unsigned int fLastEvt
Last event number shown.
Class to aid in the rendering of Geometry objects.
EventNumber_t event() const
static const int kZOOM_SLICEBOX
double DetHalfWidth() const
TH2F * fHisto
Histogram to draw objects on.
int fLastSlice
Last slice number shown.
void AutoZoomTruth(const art::Event *evt)
static const int kLABEL_COMPASS
int fLastZoom
Last zoom option applied.
Render the objects from the Simulation package.
assert(nhit_max >=nhit_nbins)
void GetZrangeCm(float *i1, float *i2) const
TPad * fPad
The ROOT graphics pad.
static const int kOUTLINE_GRID
THUnZoomable(const char *a, const char *b, int nx, double x0, double x1, int ny, double y0, double y1)
void GetZrange(int *i1, int *i2) const
evdb::View2D * fView
Collection of graphics objects to render.
int fFlip
Reverse the sense of any of the coordinate axes?
Encapsulate the geometry of one entire detector (near, far, ndos)
void AutoZoomBox(const art::Event *evt)
int fDetId
Detector display is configured for.
int fOutline
Which outlines to draw.
Global drawing options that apply to all displays.
static const int kZOOM_SLICE