LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
evd::Display3DPad Class Reference

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

#include "Display3DPad.h"

Inheritance diagram for evd::Display3DPad:
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 ()
 
void UpdateSeedCurve ()
 
TPad * Pad ()
 
HeaderDrawerHeaderDraw ()
 
evd_tool::IExperimentDrawerGeometryDraw ()
 
SimulationDrawerSimulationDraw ()
 
RawDataDrawerRawDataDraw ()
 
RecoBaseDrawerRecoBaseDraw ()
 
AnalysisBaseDrawerAnalysisBaseDraw ()
 
HitSelectorHitSelectorGet ()
 

Protected Types

using IExperimentDrawerPtr = std::unique_ptr< evd_tool::IExperimentDrawer >
 

Protected Attributes

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...
 

Private Attributes

evdb::View3DfView
 Collection of graphics objects to render. More...
 

Detailed Description

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

Definition at line 20 of file Display3DPad.h.

Member Typedef Documentation

using evd::DrawingPad::IExperimentDrawerPtr = std::unique_ptr<evd_tool::IExperimentDrawer>
protectedinherited

Definition at line 51 of file DrawingPad.h.

Constructor & Destructor Documentation

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 39 of file Display3DPad.cxx.

References fView, and evd::DrawingPad::Pad().

42  :
43  DrawingPad(nm, ti, x1, y1, x2, y2)
44  {
45  this->Pad()->SetFillColor(kBlack);
46  this->Pad()->Draw();
47  this->Pad()->cd();
48  fView = new evdb::View3D();
49  }
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
Float_t y2[n_points_geant4]
Definition: compare.C:26
TPad * Pad()
Definition: DrawingPad.h:37
Float_t x2[n_points_geant4]
Definition: compare.C:26
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:36
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:39
evd::Display3DPad::~Display3DPad ( )

Definition at line 53 of file Display3DPad.cxx.

References fView.

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

Member Function Documentation

AnalysisBaseDrawer * evd::DrawingPad::AnalysisBaseDraw ( )
inherited

Provide access to the drawer for AnalysisBase classes

Definition at line 132 of file DrawingPad.cxx.

References evd::DrawingPad::fAnalysisBaseDraw.

Referenced by evd::CalorPad::Draw().

133  {
134  if (fAnalysisBaseDraw==0) fAnalysisBaseDraw = new AnalysisBaseDrawer();
135  return fAnalysisBaseDraw;
136  }
AnalysisBaseDrawer * fAnalysisBaseDraw
Drawer for analysisbase objects.
Definition: DrawingPad.h:60
void evd::Display3DPad::Draw ( )

Definition at line 60 of file Display3DPad.cxx.

References evdb::View3D::Clear(), geo::GeometryCore::DetHalfHeight(), geo::GeometryCore::DetHalfWidth(), geo::GeometryCore::DetLength(), evd_tool::IExperimentDrawer::DetOutline3D(), evdb::View3D::Draw(), tca::evt, evd::EvdLayoutOptions::fMakeSeeds, evd::DrawingPad::fPad, fView, evd::DrawingPad::GeometryDraw(), evdb::EventHolder::GetEvent(), evdb::EventHolder::Instance(), evd::SimulationDrawer::MCTruth3D(), evd::DrawingPad::Pad(), evd::DrawingPad::RecoBaseDraw(), evd::DrawingPad::SimulationDraw(), and UpdateSeedCurve().

Referenced by evd::Display3DView::Draw().

61  {
62  fView->Clear();
63 
65 
66  // grab the event from the singleton
68 
69  if(evt){
71  this->SimulationDraw()->MCTruth3D (*evt, fView);
72  this->RecoBaseDraw()-> PFParticle3D(*evt, fView);
73  this->RecoBaseDraw()-> SpacePoint3D(*evt, fView);
74  this->RecoBaseDraw()-> Prong3D (*evt, fView);
75  this->RecoBaseDraw()-> Seed3D (*evt, fView);
76  this->RecoBaseDraw()-> BezierTrack3D (*evt, fView);
77  this->RecoBaseDraw()-> Vertex3D (*evt, fView);
78  this->RecoBaseDraw()-> Event3D (*evt, fView);
79  this->RecoBaseDraw()-> Slice3D (*evt, fView);
80 
82  if(evdlayoutoptions->fMakeSeeds)
84  }
85 
86  this->Pad()->Clear();
87  this->Pad()->cd();
88  if (fPad->GetView()==0) {
89  int irep;
90  double rmin[]={-2.1*geo->DetHalfWidth(),-2.1*geo->DetHalfHeight(),-0.5*geo->DetLength()};
91  double rmax[]={ 2.1*geo->DetHalfWidth(), 2.1*geo->DetHalfHeight(), 2.1*geo->DetLength()};
92  TView3D* v = new TView3D(1,rmin,rmax);
93  v->SetPerspective();
94  v->SetView(0.0,260.0,270.0,irep);
95  fPad->SetView(v); // ROOT takes ownership of object *v
96  }
97  fView->Draw();
98  fPad->Update();
99  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
void MCTruth3D(const art::Event &evt, evdb::View3D *view)
int fMakeSeeds
Draw two lines to make clusters if clicked.
evd_tool::IExperimentDrawer * GeometryDraw()
Definition: DrawingPad.cxx:84
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
static EventHolder * Instance()
Definition: EventHolder.cxx:15
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:120
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
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:99
void Draw()
Definition: View3D.cxx:30
void Clear()
Definition: View3D.cxx:40
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
TCEvent evt
Definition: DataStructs.cxx:5
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:36
Namespace collecting geometry-related classes utilities.
virtual void DetOutline3D(evdb::View3D *view)=0
evd_tool::IExperimentDrawer * evd::DrawingPad::GeometryDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 84 of file DrawingPad.cxx.

References evd::DrawingPad::fGeometryDraw, evd::EvdLayoutOptions::fParameterSet, and fhicl::ParameterSet::get().

Referenced by Draw().

85  {
86  if (fGeometryDraw==0)
87  {
89  const fhicl::ParameterSet& pset = layoutOptions->fParameterSet;
90 
91  fGeometryDraw = art::make_tool<evd_tool::IExperimentDrawer>(pset.get<fhicl::ParameterSet>("Experiment3DDrawer"));
92  }
93  return fGeometryDraw.get();
94  }
IExperimentDrawerPtr fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:56
const fhicl::ParameterSet & fParameterSet
T get(std::string const &key) const
Definition: ParameterSet.h:231
HeaderDrawer * evd::DrawingPad::HeaderDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 75 of file DrawingPad.cxx.

References evd::DrawingPad::fHeaderDraw.

Referenced by evd::HeaderPad::Draw().

76  {
77  if (fHeaderDraw==0) fHeaderDraw = new HeaderDrawer();
78  return fHeaderDraw;
79  }
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:54
HitSelector * evd::DrawingPad::HitSelectorGet ( )
inherited
RawDataDrawer * evd::DrawingPad::RawDataDraw ( )
inherited

Provide access to the drawer for the RawData classes

Definition at line 109 of file DrawingPad.cxx.

References evd::DrawingPad::fRawDataDraw.

Referenced by evd::TQPad::BookHistogram(), evd::TQPad::Draw(), evd::TWireProjPad::Draw(), evd::TWireProjPad::ShowFull(), and evd::TWireProjPad::TWireProjPad().

110  {
111  if (fRawDataDraw==0) fRawDataDraw = new RawDataDrawer();
112  return fRawDataDraw;
113  }
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:58
RecoBaseDrawer * evd::DrawingPad::RecoBaseDraw ( )
inherited

Provide access to the drawer for RecoBase classes

Definition at line 120 of file DrawingPad.cxx.

References evd::DrawingPad::fRecoBaseDraw.

Referenced by evd::TQPad::Draw(), Draw(), evd::TWireProjPad::Draw(), evd::Ortho3DPad::Draw(), and evd::TWireProjPad::ShowFull().

121  {
122  if (fRecoBaseDraw==0) fRecoBaseDraw = new RecoBaseDrawer();
123  return fRecoBaseDraw;
124 
125  }
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:59
SimulationDrawer * evd::DrawingPad::SimulationDraw ( )
inherited

Provide access to the drawer for the Simulation classes

Definition at line 99 of file DrawingPad.cxx.

References evd::DrawingPad::fSimulationDraw.

Referenced by evd::MCBriefPad::Draw(), Draw(), evd::TWireProjPad::Draw(), and evd::Ortho3DPad::Draw().

100  {
101  if (fSimulationDraw==0) fSimulationDraw = new SimulationDrawer();
102  return fSimulationDraw;
103 
104  }
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:57
void evd::Display3DPad::UpdateSeedCurve ( )

Definition at line 105 of file Display3DPad.cxx.

References evdb::View3D::AddPolyLine3D(), evdb::View3D::Draw(), fView, trkf::BezierTrack::GetTrackPoint(), evd::DrawingPad::HitSelectorGet(), evd::HitSelector::SeedVector(), x, y, and z.

Referenced by Draw().

106  {
107  std::vector<recob::Seed> SeedVec = this->HitSelectorGet()->SeedVector();
108  std::cout<<"Seeds available to Display3DPad : " << SeedVec.size()<<std::endl;
109  trkf::BezierTrack BTrack(SeedVec);
110 
111  int N=100;
112  TPolyLine3D& pl = fView->AddPolyLine3D(N,kOrange+5,2,0);
113  fView->Draw();
114 
115 
116  double xyzpt[3] ;
117 
118  for(int i=0; i!=N; i++)
119  {
120  BTrack.GetTrackPoint(float(i)/N,xyzpt );
121  double x = xyzpt[0];
122  double y = xyzpt[1];
123  double z = xyzpt[2];
124 
125  pl.SetPoint(i,x,y,z);
126 
127  }
128 
129  fView->Draw();
130  // UpdatePad();
131  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
Definition: View3D.cxx:105
void Draw()
Definition: View3D.cxx:30
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:36
std::vector< recob::Seed > & SeedVector()

Member Data Documentation

AnalysisBaseDrawer* evd::DrawingPad::fAnalysisBaseDraw
protectedinherited

Drawer for analysisbase objects.

Definition at line 60 of file DrawingPad.h.

Referenced by evd::DrawingPad::AnalysisBaseDraw(), and evd::DrawingPad::~DrawingPad().

IExperimentDrawerPtr evd::DrawingPad::fGeometryDraw
protectedinherited

Drawer for detector geometry.

Definition at line 56 of file DrawingPad.h.

Referenced by evd::DrawingPad::GeometryDraw().

HeaderDrawer* evd::DrawingPad::fHeaderDraw
protectedinherited

Drawer for event header info.

Definition at line 54 of file DrawingPad.h.

Referenced by evd::DrawingPad::HeaderDraw(), and evd::DrawingPad::~DrawingPad().

RawDataDrawer* evd::DrawingPad::fRawDataDraw
protectedinherited

Drawer for raw data.

Definition at line 58 of file DrawingPad.h.

Referenced by evd::DrawingPad::RawDataDraw(), and evd::DrawingPad::~DrawingPad().

RecoBaseDrawer* evd::DrawingPad::fRecoBaseDraw
protectedinherited

Drawer for recobase objects.

Definition at line 59 of file DrawingPad.h.

Referenced by evd::DrawingPad::RecoBaseDraw(), and evd::DrawingPad::~DrawingPad().

SimulationDrawer* evd::DrawingPad::fSimulationDraw
protectedinherited

Drawer for simulation objects.

Definition at line 57 of file DrawingPad.h.

Referenced by evd::DrawingPad::SimulationDraw(), and evd::DrawingPad::~DrawingPad().

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

Collection of graphics objects to render.

Definition at line 36 of file Display3DPad.h.

Referenced by Display3DPad(), Draw(), UpdateSeedCurve(), and ~Display3DPad().


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