Public Member Functions | Private Attributes | List of all members
gar::evd::Display3DPad Class Reference

A drawing pad showing a 3D rendering of the detector. More...

#include <Display3DPad.h>

Inheritance diagram for gar::evd::Display3DPad:
gar::evd::DrawingPad

Public Member Functions

 Display3DPad (const char *nm, const char *ti, double x1, double y1, double x2, double y2, const char *opt)
 
 ~Display3DPad ()
 
void Draw ()
 
- Public Member Functions inherited from gar::evd::DrawingPad
 DrawingPad (const char *nm, const char *ti, double x1, double y1, double y2, double x2)
 
 ~DrawingPad ()
 
TPad * Pad ()
 
HeaderDrawerHeaderDraw ()
 
GeometryDrawerGeometryDraw ()
 
SimulationDrawerSimulationDraw ()
 
RawDataDrawerRawDataDraw ()
 
RecoBaseDrawerRecoBaseDraw ()
 
AnalysisBaseDrawerAnalysisBaseDraw ()
 
HitSelector * HitSelectorGet ()
 

Private Attributes

evdb::View3D * fView
 Collection of graphics objects to render. More...
 

Additional Inherited Members

- Protected Attributes inherited from gar::evd::DrawingPad
TPad * fPad
 The ROOT graphics pad. More...
 
HeaderDrawerfHeaderDraw
 Drawer for event header info. More...
 
GeometryDrawerfGeometryDraw
 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 a 3D rendering of the detector.

Definition at line 39 of file Display3DPad.h.

Constructor & Destructor Documentation

gar::evd::Display3DPad::Display3DPad ( const char *  nm,
const char *  ti,
double  x1,
double  y1,
double  x2,
double  y2,
const char *  opt 
)

Create a pad to show a 3D rendering of the detector and events

Parameters
nm: Name of the pad
ti: Title of the pad
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)
optOptions. Currently just a place holder

Definition at line 38 of file Display3DPad.cxx.

45  : DrawingPad(nm, ti, x1, y1, x2, y2)
46  {
47  this->Pad()->SetFillColor(kBlack);
48  this->Pad()->Draw();
49  this->Pad()->cd();
50  fView = new evdb::View3D();
51  }
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:38
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:54
gar::evd::Display3DPad::~Display3DPad ( )

Definition at line 55 of file Display3DPad.cxx.

56  {
57  if (fView) { delete fView; fView = 0; }
58  }
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:54

Member Function Documentation

void gar::evd::Display3DPad::Draw ( void  )

Definition at line 62 of file Display3DPad.cxx.

63  {
64  fView->Clear();
65 
67 
68  // grab the event from the singleton
69  const art::Event *evt = evdb::EventHolder::Instance()->GetEvent();
70 
71  if(evt){
72  this->HeaderDraw() ->Header (fView);
73  this->GeometryDraw() ->DetOutline3D (fView);
74  this->SimulationDraw()->MCTruth3D (*evt, fView);
75  this->RecoBaseDraw() ->Track3D (*evt, fView);
76  this->RecoBaseDraw() ->Hit3D (*evt, fView);
77  this->RecoBaseDraw() ->TPCCluster3D (*evt, fView);
78  this->RecoBaseDraw() ->CaloCluster3D(*evt, fView);
79  this->RecoBaseDraw() ->CaloHit3D (*evt, fView);
80  this->RecoBaseDraw() ->Vertex3D (*evt, fView);
81  this->RecoBaseDraw() ->VecHit3D (*evt, fView);
82  this->RawDataDraw() ->RawDigit3D (*evt, fView);
83  }
84 
85  this->Pad()->Clear();
86  this->Pad()->cd();
87  if (fPad->GetView()==0) {
88  //int irep=0;
89  // nb. coordinates are so Y is up, but ROOT thinks Z is up, so report (z,x,y)
90  double rmin[]={geo->TPCZCent() - 0.7*geo->TPCLength(), geo->TPCXCent() - 0.7*geo->TPCRadius(), geo->TPCYCent() - 0.7*geo->TPCRadius()};
91  double rmax[]={geo->TPCZCent() + 0.7*geo->TPCLength(), geo->TPCXCent() + 0.7*geo->TPCRadius(), geo->TPCYCent() + 0.7*geo->TPCRadius()};
92  TView3D* v = new TView3D(1,rmin,rmax);
93  v->SetPerspective();
94  //v->SetView(-90.0,75.0,0,irep);
95  //v->ZoomView(0, 3);
96  v->ResizePad();
97  //v->ToggleZoom(0);
98  //v->SetView(geo->TPCXCent(),geo->TPCYCent(),geo->TPCZCent(),irep);
99  fPad->SetView(v); // ROOT takes ownership of object *v
100  }
101  fView->Draw();
102  fPad->Update();
103  }
HeaderDrawer * HeaderDraw()
Definition: DrawingPad.cxx:76
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:94
void MCTruth3D(const art::Event &evt, evdb::View3D *view)
void RawDigit3D(art::Event const &evt, evdb::View3D *view)
Draws raw digit content in 2D wire plane representation.
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:42
void TPCCluster3D(art::Event const &evt, evdb::View3D *view)
GeometryDrawer * GeometryDraw()
Definition: DrawingPad.cxx:85
void VecHit3D(art::Event const &evt, evdb::View3D *view)
void CaloCluster3D(art::Event const &evt, evdb::View3D *view)
void Track3D(art::Event const &evt, evdb::View3D *view)
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:104
void CaloHit3D(art::Event const &evt, evdb::View3D *view)
void DetOutline3D(evdb::View3D *view)
void Vertex3D(art::Event const &evt, evdb::View3D *view)
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:115
void Header(evdb::View2D *view)
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:54
TCEvent evt
Definition: DataStructs.cxx:7
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void Hit3D(art::Event const &evt, evdb::View3D *view)

Member Data Documentation

evdb::View3D* gar::evd::Display3DPad::fView
private

Collection of graphics objects to render.

Definition at line 54 of file Display3DPad.h.


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