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 ///
6 #include "TPad.h"
7 
17 
20 
21 namespace evd{
22 
23  // Declare singleton HitSelector
24 
26 
27  /// Create a drawing pad for the event display
28  ///
29  /// @param nm : Name of the TPad
30  /// @param ti : Title of the TPad
31  /// @param x1 : Relative x position (0-1) of lower left corner
32  /// @param y1 : Relative y position (0-1) of lower left corner
33  /// @param x2 : Relative x position (0-1) of upper right corner
34  /// @param y2 : Relative y position (0-1) of upper right corner
35  ///
37  const char* ti,
38  double x1, double y1,
39  double x2, double y2)
40  : fPad(0)
41  , fHeaderDraw(0) //Every pointer checked for a 0 value in the destructor should be set to 0 here. aoliv23@lsu.edu
42  , fSimulationDraw(0)
43  , fRawDataDraw(0)
44  , fRecoBaseDraw(0)
45  , fAnalysisBaseDraw(0)
46  {
47  fPad = new TPad(nm,ti,x1,y1,x2,y2);
48  fPad->Draw();
49  fPad->cd();
50  }
51 
52  //......................................................................
53 
55  {
56  if (fHeaderDraw) { delete fHeaderDraw; fHeaderDraw = 0; }
57  if (fSimulationDraw) { delete fSimulationDraw; fSimulationDraw = 0; }
58  if (fRawDataDraw) { delete fRawDataDraw; fRawDataDraw = 0; }
59  if (fRecoBaseDraw) { delete fRecoBaseDraw; fRecoBaseDraw = 0; }
61  // if (fHitSelector) { delete fHitSelector; fHitSelector = 0; }
62  if (fPad) { delete fPad; fPad = 0; }
63  }
64 
65  // //......................................................................
66 
67  //......................................................................
68 
69  ///
70  /// Provide access to the drawer for the detector geometry
71  ///
73  {
74  if (fHeaderDraw==0) fHeaderDraw = new HeaderDrawer();
75  return fHeaderDraw;
76  }
77 
78  ///
79  /// Provide access to the drawer for the detector geometry
80  ///
82  {
83  if (fGeometryDraw==0)
84  {
86  const fhicl::ParameterSet& pset = layoutOptions->fParameterSet;
87 
88  fGeometryDraw = art::make_tool<evd_tool::IExperimentDrawer>(pset.get<fhicl::ParameterSet>("Experiment3DDrawer"));
89  }
90  return fGeometryDraw.get();
91  }
92 
93  ///
94  /// Provide access to the drawer for the Simulation classes
95  ///
97  {
99  return fSimulationDraw;
100 
101  }
102 
103  ///
104  /// Provide access to the drawer for the RawData classes
105  ///
107  {
108  if (fRawDataDraw==0) fRawDataDraw = new RawDataDrawer();
109  return fRawDataDraw;
110  }
111 
112  //......................................................................
113 
114  ///
115  /// Provide access to the drawer for RecoBase classes
116  ///
118  {
120  return fRecoBaseDraw;
121 
122  }
123 
124  //......................................................................
125 
126  ///
127  /// Provide access to the drawer for AnalysisBase classes
128  ///
130  {
132  return fAnalysisBaseDraw;
133  }
134 
135  //......................................................................
136  //......................................................................
137 
138  ///
139  /// Provide access to the HitSelector
140  ///
142  {
143  if (gTheHitSelector==0) gTheHitSelector = new HitSelector();
144  return gTheHitSelector;
145  }
146 
147 }// namespace
148 ////////////////////////////////////////////////////////////////////////
AnalysisBaseDrawer * AnalysisBaseDraw()
Definition: DrawingPad.cxx:129
HeaderDrawer * HeaderDraw()
Definition: DrawingPad.cxx:72
Aid in the rendering of RecoBase objects.
IExperimentDrawerPtr fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:54
AnalysisBaseDrawer * fAnalysisBaseDraw
Drawer for analysisbase objects.
Definition: DrawingPad.h:58
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:57
HitSelector * gTheHitSelector
Definition: DrawingPad.cxx:25
evd_tool::IExperimentDrawer * GeometryDraw()
Definition: DrawingPad.cxx:81
LArSoft includes.
Definition: InfoTransfer.h:33
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:106
Class to perform operations needed to select hits and pass them to a cluster.
T get(std::string const &key) const
Definition: ParameterSet.h:271
Aid in the rendering of AnalysisBase objects.
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:117
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:96
fhicl::ParameterSet const & fParameterSet
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:141
Aid in the rendering of RawData objects.
Definition: RawDataDrawer.h:40
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:56
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
This is the interface class for drawing 3D detector geometries.
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:36
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:53
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:55