Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
evd::Ortho3DPad Class Reference

A drawing pad showing an orthographic rendering of 3D objects. More...

#include <Ortho3DPad.h>

Inheritance diagram for evd::Ortho3DPad:
evd::DrawingPad

Public Member Functions

 Ortho3DPad (const char *nm, const char *ti, evd::OrthoProj_t proj, double x1, double y1, double x2, double y2)
 
 ~Ortho3DPad ()
 
double GetMarkerSize () const
 
void Draw (const char *opt=0)
 
void SetZoom (double xlo, double ylo, double xhi, double yhi, bool update)
 
void UnZoom (bool update)
 
void SetMarkerSize (double size, bool update)
 
void SetMSizeEntry (TGNumberEntry *p)
 
void SetMSize ()
 
void MouseEvent ()
 
- Public Member Functions inherited from evd::DrawingPad
 DrawingPad (const char *nm, const char *ti, double x1, double y1, double y2, double x2)
 
 ~DrawingPad ()
 
TPad * Pad ()
 
HeaderDrawerHeaderDraw ()
 
evd_tool::IExperimentDrawerGeometryDraw ()
 
SimulationDrawerSimulationDraw ()
 
RawDataDrawerRawDataDraw ()
 
RecoBaseDrawerRecoBaseDraw ()
 
AnalysisBaseDrawerAnalysisBaseDraw ()
 
HitSelectorHitSelectorGet ()
 

Static Public Member Functions

static void MouseEvent (evd::Ortho3DPad *p)
 

Private Attributes

TH1F * fHisto
 Enclosing histogram. More...
 
evd::OrthoProj_t fProj
 Projection. More...
 
double fXLo
 Low x value. More...
 
double fXHi
 High x value. More...
 
double fYLo
 Low y value. More...
 
double fYHi
 High y value. More...
 
double fMSize
 Marker size. More...
 
std::vector< TBox > TPCBox
 TPC box. More...
 
evdb::View2D * fView
 Collection of graphics objects to render. More...
 
TGNumberEntry * fMSizeEntry
 For changing marker size. More...
 
bool fPress
 Is button 1 pressed? More...
 
bool fBoxDrawn
 Is selection box drawn? More...
 
int fPressPx
 Pixel location where button 1 was pressed. More...
 
int fPressPy
 Poxel location where button 1 was pressed. More...
 
int fCurrentPx
 Current pixel location of mouse. More...
 
int fCurrentPy
 Current pixel location of mouse. More...
 
double fPressX
 User location where button 1 was pressed. More...
 
double fPressY
 User location where button 1 was pressed. More...
 
double fReleaseX
 User location where button 1 was released. More...
 
double fReleaseY
 User location where button 1 was released. More...
 

Static Private Attributes

static Ortho3DPadfMousePad = 0
 Selected pad for mouse action. More...
 

Additional Inherited Members

- Protected Types inherited from evd::DrawingPad
using IExperimentDrawerPtr = std::unique_ptr< evd_tool::IExperimentDrawer >
 
- Protected Attributes inherited from evd::DrawingPad
TPad * fPad
 The ROOT graphics pad. More...
 
HeaderDrawerfHeaderDraw
 Drawer for event header info. More...
 
IExperimentDrawerPtr fGeometryDraw
 Drawer for detector geometry. More...
 
SimulationDrawerfSimulationDraw
 Drawer for simulation objects. More...
 
RawDataDrawerfRawDataDraw
 Drawer for raw data. More...
 
RecoBaseDrawerfRecoBaseDraw
 Drawer for recobase objects. More...
 
AnalysisBaseDrawerfAnalysisBaseDraw
 Drawer for analysisbase objects. More...
 

Detailed Description

A drawing pad showing an orthographic rendering of 3D objects.

Definition at line 26 of file Ortho3DPad.h.

Constructor & Destructor Documentation

evd::Ortho3DPad::Ortho3DPad ( const char *  name,
const char *  title,
evd::OrthoProj_t  proj,
double  x1,
double  y1,
double  x2,
double  y2 
)

Create a pad to show an orthographic rendering of 3D objcts.

Parameters
name: Name of the pad
title: Title of the pad
proj: Choose orthographic projection
x1: Location of left edge of pad (0-1)
x2: Location of right edge of pad (0-1)
y1: Location of bottom edge of pad (0-1)
y2: Location of top edge of pad (0-1)

Definition at line 44 of file Ortho3DPad.cxx.

51  : DrawingPad(name, title, x1, y1, x2, y2)
52  , fHisto(0)
53  , fProj(proj)
54  , fXLo(0.)
55  , fXHi(0.)
56  , fYLo(0.)
57  , fYHi(0.)
58  , fMSize(0.25)
59  , fMSizeEntry(0)
60  , fPress(false)
61  , fBoxDrawn(false)
62  , fPressPx(0)
63  , fPressPy(0)
64  , fCurrentPx(0)
65  , fCurrentPy(0)
66  , fPressX(0.)
67  , fPressY(0.)
68  , fReleaseX(0.)
69  , fReleaseY(0.)
70 {
71  // Get services.
72 
74 
75  // Set up pad.
76 
77  // Pad()->SetBit(kCannotPick); // workaround for issue #16169
78  Pad()->SetBit(TPad::kCannotMove);
79  Pad()->Draw();
80  Pad()->cd();
81  Pad()->SetLeftMargin(0.080);
82  Pad()->SetRightMargin(0.010);
83  Pad()->SetTopMargin(0.010);
84  Pad()->SetBottomMargin(0.10);
85 
86  // Define histogram boundaries (cm).
87  // For now only draw cryostat=0.
88  double minx = 1e9;
89  double maxx = -1e9;
90  double miny = 1e9;
91  double maxy = -1e9;
92  double minz = 1e9;
93  double maxz = -1e9;
94  for (size_t i = 0; i < geo->NTPC(); ++i) {
95  double local[3] = {0., 0., 0.};
96  double world[3] = {0., 0., 0.};
97  const geo::TPCGeo& tpc = geo->TPC(i);
98  tpc.LocalToWorld(local, world);
99  if (minx > world[0] - geo->DetHalfWidth(i)) minx = world[0] - geo->DetHalfWidth(i);
100  if (maxx < world[0] + geo->DetHalfWidth(i)) maxx = world[0] + geo->DetHalfWidth(i);
101  if (miny > world[1] - geo->DetHalfHeight(i)) miny = world[1] - geo->DetHalfHeight(i);
102  if (maxy < world[1] + geo->DetHalfHeight(i)) maxy = world[1] + geo->DetHalfHeight(i);
103  if (minz > world[2] - geo->DetLength(i) / 2.) minz = world[2] - geo->DetLength(i) / 2.;
104  if (maxz < world[2] + geo->DetLength(i) / 2.) maxz = world[2] + geo->DetLength(i) / 2.;
105 
106  switch (proj) {
107  case evd::kXY:
108  TPCBox.push_back(TBox(world[0] - geo->DetHalfWidth(i),
109  world[1] - geo->DetHalfHeight(i),
110  world[0] + geo->DetHalfWidth(i),
111  world[1] + geo->DetHalfHeight(i)));
112  break;
113  case evd::kXZ:
114  TPCBox.push_back(TBox(world[2] - geo->DetLength(i) / 2.,
115  world[0] - geo->DetHalfWidth(i),
116  world[2] + geo->DetLength(i) / 2.,
117  world[0] + geo->DetHalfWidth(i)));
118  break;
119  case evd::kYZ:
120  TPCBox.push_back(TBox(world[2] - geo->DetLength(i) / 2.,
121  world[1] - geo->DetHalfHeight(i),
122  world[2] + geo->DetLength(i) / 2.,
123  world[1] + geo->DetHalfHeight(i)));
124  break;
125  default:
126  throw cet::exception("Ortho3DPad")
127  << __func__ << ": unwknow projection " << ((int)proj) << "\n";
128  } // switch
129  TPCBox.back().SetFillStyle(0);
130  TPCBox.back().SetLineStyle(2);
131  TPCBox.back().SetLineWidth(2);
132  TPCBox.back().SetLineColor(16);
133  }
134 
135  switch (proj) {
136  case evd::kXY:
137  fXLo = minx;
138  fXHi = maxx;
139  fYLo = miny;
140  fYHi = maxy;
141  break;
142  case evd::kXZ:
143  fXLo = minz;
144  fXHi = maxz;
145  fYLo = minx;
146  fYHi = maxx;
147  break;
148  case evd::kYZ:
149  fXLo = minz;
150  fXHi = maxz;
151  fYLo = miny;
152  fYHi = maxy;
153  break;
154  default:
155  throw cet::exception("Ortho3DPad")
156  << __func__ << ": unwknow projection " << ((int)proj) << "\n";
157  } // switch
158 
159  // Make enclosing histogram.
160 
161  fHisto = new TH1F(*(Pad()->DrawFrame(fXLo, fYLo, fXHi, fYHi)));
162  fHisto->SetBit(kCannotPick);
163  fHisto->SetBit(TPad::kCannotMove);
164  fHisto->SetTitleOffset(1., "Y");
165  fHisto->SetTitleOffset(1., "X");
166  fHisto->GetXaxis()->SetLabelSize(0.04);
167  fHisto->GetXaxis()->SetTitleSize(0.04);
168  switch (proj) {
169  case evd::kXY:
170  fHisto->GetXaxis()->SetTitle("x (cm)");
171  fHisto->GetYaxis()->SetTitle("y (cm)");
172  break;
173  case evd::kXZ:
174  fHisto->GetXaxis()->SetTitle("z (cm)");
175  fHisto->GetYaxis()->SetTitle("x (cm)");
176  break;
177  case evd::kYZ:
178  fHisto->GetXaxis()->SetTitle("z (cm)");
179  fHisto->GetYaxis()->SetTitle("y (cm)");
180  break;
181  default:
182  throw cet::exception("Ortho3DPad")
183  << __func__ << ": unexpected flow (projection: " << ((int)proj) << ")\n";
184  } // switch
185 
186  fHisto->GetXaxis()->CenterTitle();
187  fHisto->GetYaxis()->SetLabelSize(0.04);
188  fHisto->GetYaxis()->SetTitleSize(0.04);
189  fHisto->GetYaxis()->CenterTitle();
190  fHisto->SetFillColor(18);
191  fHisto->Draw("AB");
192 
193  fView = new evdb::View2D();
194 
195  // Set pad fill color
196  Pad()->SetFillColor(18);
197  Pad()->SetFrameFillColor(18);
198  Pad()->GetPainter()->SetFillColor(18);
199  Pad()->Modified();
200  Pad()->Update();
201 
202  // Install mouse event handler.
203 
204  std::ostringstream ostr;
205  ostr << "evd::Ortho3DPad::MouseEvent((evd::Ortho3DPad*)" << this << ")";
206  fPad->AddExec("getmousezoom", ostr.str().c_str());
207 }
static QCString name
Definition: declinfo.cpp:673
double fXHi
High x value.
Definition: Ortho3DPad.h:75
int fPressPy
Poxel location where button 1 was pressed.
Definition: Ortho3DPad.h:91
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
double fReleaseX
User location where button 1 was released.
Definition: Ortho3DPad.h:96
double fYHi
High y value.
Definition: Ortho3DPad.h:77
Geometry information for a single TPC.
Definition: TPCGeo.h:38
int fCurrentPy
Current pixel location of mouse.
Definition: Ortho3DPad.h:93
int fPressPx
Pixel location where button 1 was pressed.
Definition: Ortho3DPad.h:90
double fXLo
Low x value.
Definition: Ortho3DPad.h:74
TH1F * DrawFrame(TGraph *gr0, TGraph *gr1, TPad *p, const char *xt, const char *yt, double yminsc, double ymaxsc)
Definition: gXSecComp.cxx:529
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
double fReleaseY
User location where button 1 was released.
Definition: Ortho3DPad.h:97
evd::OrthoProj_t fProj
Projection.
Definition: Ortho3DPad.h:73
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
double fYLo
Low y value.
Definition: Ortho3DPad.h:76
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
TPad * Pad()
Definition: DrawingPad.h:37
double fPressX
User location where button 1 was pressed.
Definition: Ortho3DPad.h:94
double fPressY
User location where button 1 was pressed.
Definition: Ortho3DPad.h:95
int fCurrentPx
Current pixel location of mouse.
Definition: Ortho3DPad.h:92
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
std::vector< TBox > TPCBox
TPC box.
Definition: Ortho3DPad.h:79
TH1F * fHisto
Enclosing histogram.
Definition: Ortho3DPad.h:72
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
bool fPress
Is button 1 pressed?
Definition: Ortho3DPad.h:88
LArSoft geometry interface.
Definition: ChannelGeo.h:16
TGNumberEntry * fMSizeEntry
For changing marker size.
Definition: Ortho3DPad.h:84
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:563
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:36
evdb::View2D * fView
Collection of graphics objects to render.
Definition: Ortho3DPad.h:80
double fMSize
Marker size.
Definition: Ortho3DPad.h:78
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
evd::Ortho3DPad::~Ortho3DPad ( )

Definition at line 212 of file Ortho3DPad.cxx.

213 {
214  if (fHisto) {
215  delete fHisto;
216  fHisto = nullptr;
217  }
218  if (fView) {
219  delete fView;
220  fView = nullptr;
221  }
222 }
TH1F * fHisto
Enclosing histogram.
Definition: Ortho3DPad.h:72
evdb::View2D * fView
Collection of graphics objects to render.
Definition: Ortho3DPad.h:80

Member Function Documentation

void evd::Ortho3DPad::Draw ( const char *  opt = 0)

Definition at line 228 of file Ortho3DPad.cxx.

229 {
230  fPad->Clear();
231  fView->Clear();
232 
233  // Remove zoom.
234 
235  UnZoom(false);
236 
237  // grab the event from the singleton
238 
239  // Insert graphic objects into fView collection.
240 
241  if (art::Event const* evtPtr = evdb::EventHolder::Instance()->GetEvent()) {
242  auto const& evt = *evtPtr;
243  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
244  auto const detProp =
246 
252  RecoBaseDraw()->OpFlashOrtho(evt, clockData, detProp, fProj, fView);
254  }
255  // Draw objects on pad.
256 
257  fPad->cd();
258  fPad->GetPainter()->SetFillColor(18);
259  fHisto->Draw("X-");
260  fView->Draw();
261  TLatex latex;
262  latex.SetTextColor(16);
263  latex.SetTextSize(0.05);
264  for (size_t i = 0; i < TPCBox.size(); ++i) {
265  TPCBox[i].Draw();
266  double x1 = TPCBox[i].GetX2() - 0.02 * (fXHi - fXLo);
267  double y1 = TPCBox[i].GetY2() - 0.05 * (fYHi - fYLo);
268  for (size_t j = 0; j < i; ++j) {
269  if (std::abs(x1 - (TPCBox[j].GetX2() - 0.02 * (fXHi - fXLo))) < 1e-6 &&
270  std::abs(y1 - (TPCBox[j].GetY2() - 0.05 * (fYHi - fYLo))) < 1e-6) {
271  y1 -= 0.05 * (fYHi - fYLo);
272  }
273  }
274  latex.DrawLatex(x1, y1, Form("%lu", i));
275  }
276  fPad->Modified();
277  fPad->Update();
278  fBoxDrawn = false;
279 }
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
double fXHi
High x value.
Definition: Ortho3DPad.h:75
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void UnZoom(bool update)
Definition: Ortho3DPad.cxx:300
void SeedOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
double fYHi
High y value.
Definition: Ortho3DPad.h:77
void ProngOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
double fXLo
Low x value.
Definition: Ortho3DPad.h:74
T abs(T value)
const double e
evd::OrthoProj_t fProj
Projection.
Definition: Ortho3DPad.h:73
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
double fYLo
Low y value.
Definition: Ortho3DPad.h:76
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:117
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:96
std::vector< TBox > TPCBox
TPC box.
Definition: Ortho3DPad.h:79
void MCTruthOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
TH1F * fHisto
Enclosing histogram.
Definition: Ortho3DPad.h:72
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
void OpFlashOrtho(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evd::OrthoProj_t proj, evdb::View2D *view)
TCEvent evt
Definition: DataStructs.cxx:7
evdb::View2D * fView
Collection of graphics objects to render.
Definition: Ortho3DPad.h:80
void VertexOrtho(const art::PtrVector< recob::Vertex > &vertex, evd::OrthoProj_t proj, evdb::View2D *view, int marker)
double fMSize
Marker size.
Definition: Ortho3DPad.h:78
double evd::Ortho3DPad::GetMarkerSize ( ) const
inline

Definition at line 45 of file Ortho3DPad.h.

45 {return 4.*fMSize;} // Size in pixels.
double fMSize
Marker size.
Definition: Ortho3DPad.h:78
void evd::Ortho3DPad::MouseEvent ( evd::Ortho3DPad p)
static

Definition at line 390 of file Ortho3DPad.cxx.

391 {
392  TObject* select = gPad->GetSelected();
393  if (!select) return;
394  if (!select->InheritsFrom("TBox")) return;
395  ((TBox*)select)->SetBit(TBox::kCannotMove);
396 
397  // This line is a workaround for a root bug that sends mouse events
398  // to the wrong pad.
399 
400  if (fMousePad != 0) p = fMousePad;
401 
402  p->MouseEvent();
403 }
auto select(T const &...t)
Definition: select.h:146
static void MouseEvent(evd::Ortho3DPad *p)
Definition: Ortho3DPad.cxx:390
static Ortho3DPad * fMousePad
Selected pad for mouse action.
Definition: Ortho3DPad.h:68
void evd::Ortho3DPad::MouseEvent ( )

Definition at line 409 of file Ortho3DPad.cxx.

410 {
411  // Get event type and location.
412 
413  int event = gPad->GetEvent();
414  int px = gPad->GetEventX(); // pixels.
415  int py = gPad->GetEventY(); // pixels.
416  double x = gPad->AbsPixeltoX(px); // User coordinates.
417  double y = gPad->AbsPixeltoY(py); // User coordinates.
418 
419  // Handle different events.
420 
421  switch (event) {
422  case kMouseEnter:
423 
424  // Main purpose of this case is to set the cursor shape.
425 
426  gPad->SetCursor(kCross);
427  fCurrentPx = px;
428  fCurrentPy = py;
429  fMousePad = this;
430  break;
431 
432  case kMouseMotion:
433 
434  // Not really needed...
435 
436  gPad->SetCursor(kCross);
437  fCurrentPx = px;
438  fCurrentPy = py;
439  break;
440 
441  case kMouseLeave:
442 
443  // Undraw box.
444 
445  //if(fBoxDrawn) {
446  // double pxlo = std::min(fPressPx, fCurrentPx);
447  // double pxhi = std::max(fPressPx, fCurrentPx);
448  // double pylo = std::min(fPressPy, fCurrentPy);
449  // double pyhi = std::max(fPressPy, fCurrentPy);
450  // gVirtualX->DrawBox(pxlo, pylo, pxhi, pyhi, TVirtualX::kHollow);
451  // fBoxDrawn = false;
452  //}
453 
454  // Set everything to default.
455 
456  fPress = false;
457  fPressPx = 0;
458  fPressPy = 0;
459  fCurrentPx = 0;
460  fCurrentPy = 0;
461  fPressX = 0.;
462  fPressY = 0.;
463  fReleaseX = 0.;
464  fReleaseY = 0.;
465  fMousePad = 0;
466  break;
467 
468  case kButton1Motion:
469 
470  // Undraw old selection box.
471 
472  //if(fBoxDrawn) {
473  // double pxlo = std::min(fPressPx, fCurrentPx);
474  // double pxhi = std::max(fPressPx, fCurrentPx);
475  // double pylo = std::min(fPressPy, fCurrentPy);
476  // double pyhi = std::max(fPressPy, fCurrentPy);
477  // gVirtualX->DrawBox(pxlo, pylo, pxhi, pyhi, TVirtualX::kHollow);
478  // fBoxDrawn = false;
479  //}
480 
481  // Update cursor location.
482 
483  gPad->SetCursor(kCross);
484  fCurrentPx = px;
485  fCurrentPy = py;
486 
487  // Draw new selection box.
488 
489  {
490  double pxlo = std::min(fPressPx, fCurrentPx);
491  double pxhi = std::max(fPressPx, fCurrentPx);
492  double pylo = std::min(fPressPy, fCurrentPy);
493  double pyhi = std::max(fPressPy, fCurrentPy);
494  gVirtualX->DrawBox(pxlo, pylo, pxhi, pyhi, TVirtualX::kHollow);
495  fBoxDrawn = true;
496  }
497  break;
498 
499  case kButton1Down:
500  gVirtualX->SetLineColor(-1);
501  gVirtualX->SetLineStyle(0);
502  gVirtualX->SetLineWidth(1);
503 
504  // Record the location of the button press event, which will be
505  // one corner of zoom region.
506 
507  gPad->SetCursor(kCross);
508  fPress = true;
509  fPressPx = px;
510  fPressPy = py;
511  fCurrentPx = px;
512  fCurrentPy = py;
513  fPressX = x;
514  fPressY = y;
515  fReleaseX = 0.;
516  fReleaseY = 0.;
517  fMousePad = this;
518  break;
519 
520  case kButton1Up:
521 
522  // Get the location of button release event, then zoom.
523 
524  gPad->SetCursor(kCross);
525  fPress = false;
526  fCurrentPx = px;
527  fCurrentPy = py;
528  fReleaseX = x;
529  fReleaseY = y;
530  {
531  double xlo = std::min(fPressX, fReleaseX);
532  double xhi = std::max(fPressX, fReleaseX);
533  double ylo = std::min(fPressY, fReleaseY);
534  double yhi = std::max(fPressY, fReleaseY);
535  SetZoom(xlo, ylo, xhi, yhi, true);
536  }
537  fMousePad = 0;
538  break;
539  }
540 }
void SetZoom(double xlo, double ylo, double xhi, double yhi, bool update)
Definition: Ortho3DPad.cxx:285
int fPressPy
Poxel location where button 1 was pressed.
Definition: Ortho3DPad.h:91
double fReleaseX
User location where button 1 was released.
Definition: Ortho3DPad.h:96
int fCurrentPy
Current pixel location of mouse.
Definition: Ortho3DPad.h:93
int fPressPx
Pixel location where button 1 was pressed.
Definition: Ortho3DPad.h:90
double fReleaseY
User location where button 1 was released.
Definition: Ortho3DPad.h:97
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
static int max(int a, int b)
double fPressX
User location where button 1 was pressed.
Definition: Ortho3DPad.h:94
double fPressY
User location where button 1 was pressed.
Definition: Ortho3DPad.h:95
int fCurrentPx
Current pixel location of mouse.
Definition: Ortho3DPad.h:92
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
list x
Definition: train.py:276
bool fPress
Is button 1 pressed?
Definition: Ortho3DPad.h:88
static Ortho3DPad * fMousePad
Selected pad for mouse action.
Definition: Ortho3DPad.h:68
Event finding and building.
void evd::Ortho3DPad::SetMarkerSize ( double  size,
bool  update 
)

Definition at line 320 of file Ortho3DPad.cxx.

321 {
322  // Update marker size.
323 
324  if (fMSize != size / 4.) {
325 
326  // Update marker size attribute.
327 
328  fMSize = size / 4.; // Scale to pixels.
329 
330  // Update widget.
331 
332  if (fMSizeEntry) fMSizeEntry->SetNumber(size);
333 
334  // Loop over graphic objects that are currently drawn on
335  // pad, and update any that are polymarkers.
336 
337  TIter next(fPad->GetListOfPrimitives());
338  while (TObject* obj = next()) {
339  if (obj->InheritsFrom(TPolyMarker::Class())) {
340  TPolyMarker* pm = (TPolyMarker*)obj;
341  pm->SetMarkerSize(fMSize);
342  }
343  }
344 
345  fPad->Modified();
346  if (update) {
347  fPad->Update();
348  fBoxDrawn = false;
349  }
350  }
351 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
TGNumberEntry * fMSizeEntry
For changing marker size.
Definition: Ortho3DPad.h:84
double fMSize
Marker size.
Definition: Ortho3DPad.h:78
void evd::Ortho3DPad::SetMSize ( )

Definition at line 371 of file Ortho3DPad.cxx.

372 {
373 
374  // Get marker size from number entry widget.
375 
376  if (!fMSizeEntry) throw cet::exception("Ortho3DPad") << __func__ << ": no MSize entry\n";
377  double val = fMSizeEntry->GetNumber();
378 
379  // Scale the marker size such that the displayed marker size
380  // is measured in pixels.
381 
382  SetMarkerSize(val, true);
383 }
void SetMarkerSize(double size, bool update)
Definition: Ortho3DPad.cxx:320
TGNumberEntry * fMSizeEntry
For changing marker size.
Definition: Ortho3DPad.h:84
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evd::Ortho3DPad::SetMSizeEntry ( TGNumberEntry *  p)

Definition at line 360 of file Ortho3DPad.cxx.

361 {
362  fMSizeEntry = p;
363  if (fMSizeEntry) fMSizeEntry->SetNumber(4. * fMSize);
364 }
p
Definition: test.py:223
TGNumberEntry * fMSizeEntry
For changing marker size.
Definition: Ortho3DPad.h:84
double fMSize
Marker size.
Definition: Ortho3DPad.h:78
void evd::Ortho3DPad::SetZoom ( double  xlo,
double  ylo,
double  xhi,
double  yhi,
bool  update 
)

Definition at line 285 of file Ortho3DPad.cxx.

286 {
287  fHisto->GetXaxis()->SetRangeUser(xlo, xhi);
288  fHisto->GetYaxis()->SetRangeUser(ylo, yhi);
289  fPad->Modified();
290  if (update) {
291  fPad->Update();
292  fBoxDrawn = false;
293  }
294 }
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
TH1F * fHisto
Enclosing histogram.
Definition: Ortho3DPad.h:72
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
void evd::Ortho3DPad::UnZoom ( bool  update)

Definition at line 300 of file Ortho3DPad.cxx.

301 {
302  fHisto->GetXaxis()->SetRangeUser(fXLo, fXHi);
303  fHisto->GetYaxis()->SetRangeUser(fYLo, fYHi);
304  fPad->Modified();
305 
306  // Also set marker size to default one pixel.
307 
308  SetMarkerSize(1., false);
309 
310  if (update) {
311  fPad->Update();
312  fBoxDrawn = false;
313  }
314 }
double fXHi
High x value.
Definition: Ortho3DPad.h:75
void SetMarkerSize(double size, bool update)
Definition: Ortho3DPad.cxx:320
double fYHi
High y value.
Definition: Ortho3DPad.h:77
double fXLo
Low x value.
Definition: Ortho3DPad.h:74
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
double fYLo
Low y value.
Definition: Ortho3DPad.h:76
TH1F * fHisto
Enclosing histogram.
Definition: Ortho3DPad.h:72
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52

Member Data Documentation

bool evd::Ortho3DPad::fBoxDrawn
private

Is selection box drawn?

Definition at line 89 of file Ortho3DPad.h.

int evd::Ortho3DPad::fCurrentPx
private

Current pixel location of mouse.

Definition at line 92 of file Ortho3DPad.h.

int evd::Ortho3DPad::fCurrentPy
private

Current pixel location of mouse.

Definition at line 93 of file Ortho3DPad.h.

TH1F* evd::Ortho3DPad::fHisto
private

Enclosing histogram.

Definition at line 72 of file Ortho3DPad.h.

evd::Ortho3DPad * evd::Ortho3DPad::fMousePad = 0
staticprivate

Selected pad for mouse action.

Define static data members.

Definition at line 68 of file Ortho3DPad.h.

double evd::Ortho3DPad::fMSize
private

Marker size.

Definition at line 78 of file Ortho3DPad.h.

TGNumberEntry* evd::Ortho3DPad::fMSizeEntry
private

For changing marker size.

Definition at line 84 of file Ortho3DPad.h.

bool evd::Ortho3DPad::fPress
private

Is button 1 pressed?

Definition at line 88 of file Ortho3DPad.h.

int evd::Ortho3DPad::fPressPx
private

Pixel location where button 1 was pressed.

Definition at line 90 of file Ortho3DPad.h.

int evd::Ortho3DPad::fPressPy
private

Poxel location where button 1 was pressed.

Definition at line 91 of file Ortho3DPad.h.

double evd::Ortho3DPad::fPressX
private

User location where button 1 was pressed.

Definition at line 94 of file Ortho3DPad.h.

double evd::Ortho3DPad::fPressY
private

User location where button 1 was pressed.

Definition at line 95 of file Ortho3DPad.h.

evd::OrthoProj_t evd::Ortho3DPad::fProj
private

Projection.

Definition at line 73 of file Ortho3DPad.h.

double evd::Ortho3DPad::fReleaseX
private

User location where button 1 was released.

Definition at line 96 of file Ortho3DPad.h.

double evd::Ortho3DPad::fReleaseY
private

User location where button 1 was released.

Definition at line 97 of file Ortho3DPad.h.

evdb::View2D* evd::Ortho3DPad::fView
private

Collection of graphics objects to render.

Definition at line 80 of file Ortho3DPad.h.

double evd::Ortho3DPad::fXHi
private

High x value.

Definition at line 75 of file Ortho3DPad.h.

double evd::Ortho3DPad::fXLo
private

Low x value.

Definition at line 74 of file Ortho3DPad.h.

double evd::Ortho3DPad::fYHi
private

High y value.

Definition at line 77 of file Ortho3DPad.h.

double evd::Ortho3DPad::fYLo
private

Low y value.

Definition at line 76 of file Ortho3DPad.h.

std::vector<TBox> evd::Ortho3DPad::TPCBox
private

TPC box.

Definition at line 79 of file Ortho3DPad.h.


The documentation for this class was generated from the following files: