DrawingPad.cxx
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////////
2 /// \file DrawingPad.cxx
3 /// \brief Base class for all event display drawing pads
4 /// \author messier@indiana.edu
5 /// \version $Id: DrawingPad.cxx,v 1.7 2011-10-31 15:32:18 greenc Exp $:
6 /////////////////////////////////////////////////////////////////////////////
7 #include <iostream>
8 #include <vector>
9 
10 #include "TPad.h"
11 
14 
22 
23 namespace evd
24 {
25  /// Create a drawing pad for the event display
26  ///
27  /// @param nm : Name of the TPad
28  /// @param ti : Title of the TPad
29  /// @param x1 : Relative x position (0-1) of lower left corner
30  /// @param y1 : Relative y position (0-1) of lower left corner
31  /// @param x2 : Relative x position (0-1) of upper right corner
32  /// @param y2 : Relative y position (0-1) of upper right corner
33  ///
35  const char* ti,
36  double x1, double y1,
37  double x2, double y2) :
38  fHeaderDraw(0),
39  fGeometryDraw(0),
40  fSimulationDraw(0),
41  fRawDataDraw(0),
42  fRecoBaseDraw(0)
43  {
44  fPad = new TPad(nm,ti,x1,y1,x2,y2);
45  fPad->Draw();
46  fPad->cd();
47  }
48 
49  //......................................................................
51  {
52  if (fHeaderDraw) { delete fHeaderDraw; fHeaderDraw = 0; }
53  if (fGeometryDraw) { delete fGeometryDraw; fGeometryDraw = 0; }
54  if (fSimulationDraw) { delete fSimulationDraw; fSimulationDraw = 0; }
55  if (fRawDataDraw) { delete fRawDataDraw; fRawDataDraw = 0; }
56  if (fRecoBaseDraw) { delete fRecoBaseDraw; fRecoBaseDraw = 0; }
57  if (fPad) { delete fPad; fPad = 0; }
58  }
59 
60  //......................................................................
61  ///
62  /// Provide access to the drawer for the event header
63  ///
65  {
66  if (fHeaderDraw==0) fHeaderDraw = new HeaderDrawer();
67  return fHeaderDraw;
68  }
69 
70  ///
71  /// Provide access to the drawer for the detector geometry
72  ///
74  {
76  return fGeometryDraw;
77  }
78 
79  ///
80  /// Provide access to the drawer for the Simulation classes
81  ///
83  {
85  return fSimulationDraw;
86  }
87 
88  ///
89  /// Provide access to the drawer for the RawData classes
90  ///
92  {
93  if (fRawDataDraw==0) fRawDataDraw = new RawDataDrawer();
94  return fRawDataDraw;
95  }
96 
97  //......................................................................
98  ///
99  /// Provide access to the drawer for RecoBase classes
100  ///
102  {
104  return fRecoBaseDraw;
105  }
106 
107 } // end namespace evd
108 ////////////////////////////////////////////////////////////////////////
Render the objects from the Simulation package.
HeaderDrawer * HeaderDraw()
Definition: DrawingPad.cxx:64
Aid in the rendering of RecoBase objects.
Float_t y1[n_points_granero]
Definition: compare.C:5
GeometryDrawer * fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:39
Float_t x1[n_points_granero]
Definition: compare.C:5
static constexpr Double_t nm
Definition: Munits.h:133
GeometryDrawer * GeometryDraw()
Definition: DrawingPad.cxx:73
Aid in the rendering of Geometry objects.
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:42
Base class for all event display drawing pads.
nova event display
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:91
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:101
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:82
Class to aid in the rendering of RecoBase objects.
Class to aid in the rendering of RawData objects.
Class to aid in the rendering of Geometry objects.
Render the objects from the Simulation package.
Aid in the rendering of RawData objects.
Definition: RawDataDrawer.h:27
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:41
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:37
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:34
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:38
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:40