Public Member Functions | Private Attributes | List of all members
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 ()
 
- 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 ()
 

Private Attributes

evdb::View3D * fView
 Collection of graphics objects to render. More...
 
std::vector< std::unique_ptr< evdb_tool::ISim3DDrawer > > fSim3DDrawerVec
 
std::vector< std::unique_ptr< evdb_tool::I3DDrawer > > fReco3DDrawerVec
 

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 a 3D rendering of the detector.

Definition at line 22 of file Display3DPad.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 36 of file Display3DPad.cxx.

39  :
40  DrawingPad(nm, ti, x1, y1, x2, y2)
41 {
42  this->Pad()->SetFillColor(kBlack);
43  this->Pad()->Draw();
44  this->Pad()->cd();
45  fView = new evdb::View3D();
46 
47  // Set up the 3D drawing tools for the simulation
49 
50  // Implement the tools for handling the 3D simulation drawing tools
51  const fhicl::ParameterSet& drawSim3DTools = simDrawOpt->f3DDrawerParams;
52 
53  for(const std::string& draw3DTool : drawSim3DTools.get_pset_names())
54  {
55  const fhicl::ParameterSet& draw3DToolParamSet = drawSim3DTools.get<fhicl::ParameterSet>(draw3DTool);
56 
57  fSim3DDrawerVec.push_back(art::make_tool<evdb_tool::ISim3DDrawer>(draw3DToolParamSet));
58  }
59 
60  // Set up the 3D drawing tools for the reconstruction
62 
63  // Implement the tools for handling the 3D reco drawing tools
64  const fhicl::ParameterSet& drawReco3DTools = recoDrawOpt->f3DDrawerParams;
65 
66  for(const std::string& draw3DTool : drawReco3DTools.get_pset_names())
67  {
68  const fhicl::ParameterSet& draw3DToolParamSet = drawReco3DTools.get<fhicl::ParameterSet>(draw3DTool);
69 
70  fReco3DDrawerVec.push_back(art::make_tool<evdb_tool::I3DDrawer>(draw3DToolParamSet));
71  }
72 
73  return;
74 }
std::vector< std::unique_ptr< evdb_tool::I3DDrawer > > fReco3DDrawerVec
Definition: Display3DPad.h:39
std::string string
Definition: nybbler.cc:12
fhicl::ParameterSet f3DDrawerParams
FHICL paramegers for the 3D drawers.
std::vector< std::string > get_pset_names() const
T get(std::string const &key) const
Definition: ParameterSet.h:271
TPad * Pad()
Definition: DrawingPad.h:37
fhicl::ParameterSet f3DDrawerParams
FHICL paramegers for the 3D drawers.
std::vector< std::unique_ptr< evdb_tool::ISim3DDrawer > > fSim3DDrawerVec
Definition: Display3DPad.h:38
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:36
evd::Display3DPad::~Display3DPad ( )

Definition at line 78 of file Display3DPad.cxx.

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

Member Function Documentation

void evd::Display3DPad::Draw ( void  )

Definition at line 85 of file Display3DPad.cxx.

86 {
87  fView->Clear();
88 
90 
91  // grab the event from the singleton
92  const art::Event *evt = evdb::EventHolder::Instance()->GetEvent();
93 
94  if(evt){
96 // this->SimulationDraw()->MCTruth3D (*evt, fView);
97  this->RecoBaseDraw()-> PFParticle3D (*evt, fView);
98  this->RecoBaseDraw()-> Edge3D (*evt, fView);
99  this->RecoBaseDraw()-> SpacePoint3D (*evt, fView);
100  this->RecoBaseDraw()-> Prong3D (*evt, fView);
101  this->RecoBaseDraw()-> Seed3D (*evt, fView);
102  this->RecoBaseDraw()-> Vertex3D (*evt, fView);
103  this->RecoBaseDraw()-> Event3D (*evt, fView);
104  this->RecoBaseDraw()-> Slice3D (*evt, fView);
105 
106  // Call the 3D simulation drawing tools
107  for(auto& draw3D : fSim3DDrawerVec) draw3D->Draw(*evt, fView);
108 
109  // Call the 3D reco drawing tools
110  for(auto& draw3D : fReco3DDrawerVec) draw3D->Draw(*evt, fView);
111 
112  }
113 
114  this->Pad()->Clear();
115  this->Pad()->cd();
116  if (fPad->GetView()==0) {
117  int irep;
118  double rmin[]={-2.1*geo->DetHalfWidth(),-2.1*geo->DetHalfHeight(),-0.5*geo->DetLength()};
119  double rmax[]={ 2.1*geo->DetHalfWidth(), 2.1*geo->DetHalfHeight(), 0.5*geo->DetLength()};
120  TView3D* v = new TView3D(1,rmin,rmax);
121  v->SetPerspective();
122  v->SetView(0.0,260.0,270.0,irep);
123  fPad->SetView(v); // ROOT takes ownership of object *v
124  }
125  fView->Draw();
126  fPad->Update();
127 }
std::vector< std::unique_ptr< evdb_tool::I3DDrawer > > fReco3DDrawerVec
Definition: Display3DPad.h:39
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
evd_tool::IExperimentDrawer * GeometryDraw()
Definition: DrawingPad.cxx:81
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:117
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
std::vector< std::unique_ptr< evdb_tool::ISim3DDrawer > > fSim3DDrawerVec
Definition: Display3DPad.h:38
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
TCEvent evt
Definition: DataStructs.cxx:7
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:36
LArSoft geometry interface.
Definition: ChannelGeo.h:16
virtual void DetOutline3D(evdb::View3D *view)=0
void evd::Display3DPad::UpdateSeedCurve ( )

Member Data Documentation

std::vector<std::unique_ptr<evdb_tool::I3DDrawer> > evd::Display3DPad::fReco3DDrawerVec
private

Definition at line 39 of file Display3DPad.h.

std::vector<std::unique_ptr<evdb_tool::ISim3DDrawer> > evd::Display3DPad::fSim3DDrawerVec
private

Definition at line 38 of file Display3DPad.h.

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

Collection of graphics objects to render.

Definition at line 36 of file Display3DPad.h.


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