LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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...
 
std::vector< std::unique_ptr< evdb_tool::ISim3DDrawer > > fSim3DDrawerVec
 
std::vector< std::unique_ptr< evdb_tool::I3DDrawer > > fReco3DDrawerVec
 

Detailed Description

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

Definition at line 26 of file Display3DPad.h.

Member Typedef Documentation

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

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

References evd::SimulationDrawingOptions::f3DDrawerParams, evd::RecoDrawingOptions::f3DDrawerParams, fReco3DDrawerVec, fSim3DDrawerVec, fView, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_pset_names(), and evd::DrawingPad::Pad().

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 
50  // Set up the 3D drawing tools for the simulation
52 
53  // Implement the tools for handling the 3D simulation drawing tools
54  const fhicl::ParameterSet& drawSim3DTools = simDrawOpt->f3DDrawerParams;
55 
56  for (const std::string& draw3DTool : drawSim3DTools.get_pset_names()) {
57  const fhicl::ParameterSet& draw3DToolParamSet =
58  drawSim3DTools.get<fhicl::ParameterSet>(draw3DTool);
59 
60  fSim3DDrawerVec.push_back(art::make_tool<evdb_tool::ISim3DDrawer>(draw3DToolParamSet));
61  }
62 
63  // Set up the 3D drawing tools for the reconstruction
65 
66  // Implement the tools for handling the 3D reco drawing tools
67  const fhicl::ParameterSet& drawReco3DTools = recoDrawOpt->f3DDrawerParams;
68 
69  for (const std::string& draw3DTool : drawReco3DTools.get_pset_names()) {
70  const fhicl::ParameterSet& draw3DToolParamSet =
71  drawReco3DTools.get<fhicl::ParameterSet>(draw3DTool);
72 
73  fReco3DDrawerVec.push_back(art::make_tool<evdb_tool::I3DDrawer>(draw3DToolParamSet));
74  }
75 
76  return;
77  }
std::vector< std::unique_ptr< evdb_tool::I3DDrawer > > fReco3DDrawerVec
Definition: Display3DPad.h:45
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
fhicl::ParameterSet f3DDrawerParams
FHICL paramegers for the 3D drawers.
Float_t y2[n_points_geant4]
Definition: compare.C:26
std::vector< std::string > get_pset_names() const
T get(std::string const &key) const
Definition: ParameterSet.h:314
TPad * Pad()
Definition: DrawingPad.h:31
fhicl::ParameterSet f3DDrawerParams
FHICL paramegers for the 3D drawers.
std::vector< std::unique_ptr< evdb_tool::ISim3DDrawer > > fSim3DDrawerVec
Definition: Display3DPad.h:44
Float_t x2[n_points_geant4]
Definition: compare.C:26
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:42
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 81 of file Display3DPad.cxx.

References fView.

82  {
83  if (fView) {
84  delete fView;
85  fView = 0;
86  }
87  }
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:42

Member Function Documentation

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

Provide access to the drawer for AnalysisBase classes

Definition at line 143 of file DrawingPad.cxx.

References evd::DrawingPad::fAnalysisBaseDraw.

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

144  {
145  if (fAnalysisBaseDraw == 0) fAnalysisBaseDraw = new AnalysisBaseDrawer();
146  return fAnalysisBaseDraw;
147  }
AnalysisBaseDrawer * fAnalysisBaseDraw
Drawer for analysisbase objects.
Definition: DrawingPad.h:51
void evd::Display3DPad::Draw ( )

Definition at line 91 of file Display3DPad.cxx.

References evdb::View3D::Clear(), geo::GeometryCore::DetHalfHeight(), geo::GeometryCore::DetHalfWidth(), geo::GeometryCore::DetLength(), evd_tool::IExperimentDrawer::DetOutline3D(), evdb::View3D::Draw(), evd::RecoBaseDrawer::Edge3D(), evd::RecoBaseDrawer::Event3D(), tca::evt, evd::DrawingPad::fPad, fReco3DDrawerVec, fSim3DDrawerVec, fView, evd::DrawingPad::GeometryDraw(), evdb::EventHolder::GetEvent(), evdb::EventHolder::Instance(), evd::DrawingPad::Pad(), evd::RecoBaseDrawer::PFParticle3D(), evd::RecoBaseDrawer::Prong3D(), evd::DrawingPad::RecoBaseDraw(), evd::RecoBaseDrawer::Seed3D(), evd::RecoBaseDrawer::Slice3D(), evd::RecoBaseDrawer::SpacePoint3D(), and evd::RecoBaseDrawer::Vertex3D().

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

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

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

Referenced by Draw().

98  {
99  if (fGeometryDraw == 0) {
101  const fhicl::ParameterSet& pset = layoutOptions->fParameterSet;
102 
103  fGeometryDraw = art::make_tool<evd_tool::IExperimentDrawer>(
104  pset.get<fhicl::ParameterSet>("Experiment3DDrawer"));
105  }
106  return fGeometryDraw.get();
107  }
IExperimentDrawerPtr fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:47
T get(std::string const &key) const
Definition: ParameterSet.h:314
fhicl::ParameterSet const & fParameterSet
HeaderDrawer * evd::DrawingPad::HeaderDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 88 of file DrawingPad.cxx.

References evd::DrawingPad::fHeaderDraw.

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

89  {
90  if (fHeaderDraw == 0) fHeaderDraw = new HeaderDrawer();
91  return fHeaderDraw;
92  }
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:46
HitSelector * evd::DrawingPad::HitSelectorGet ( )
inherited

Provide access to the HitSelector

Definition at line 155 of file DrawingPad.cxx.

References evd::gTheHitSelector.

Referenced by evd::TWireProjPad::ClearHitList(), evd::TWireProjPad::Draw(), evd::TWireProjPad::SaveHitList(), evd::TWireProjPad::SaveSeedList(), and evd::TWireProjPad::SelectOneHit().

156  {
157  if (gTheHitSelector == 0) gTheHitSelector = new HitSelector();
158  return gTheHitSelector;
159  }
HitSelector * gTheHitSelector
Definition: DrawingPad.cxx:25
RawDataDrawer * evd::DrawingPad::RawDataDraw ( )
inherited

Provide access to the drawer for the RawData classes

Definition at line 121 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().

122  {
123  if (fRawDataDraw == 0) fRawDataDraw = new RawDataDrawer();
124  return fRawDataDraw;
125  }
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:49
RecoBaseDrawer * evd::DrawingPad::RecoBaseDraw ( )
inherited

Provide access to the drawer for RecoBase classes

Definition at line 132 of file DrawingPad.cxx.

References evd::DrawingPad::fRecoBaseDraw.

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

133  {
134  if (fRecoBaseDraw == 0) fRecoBaseDraw = new RecoBaseDrawer();
135  return fRecoBaseDraw;
136  }
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:50
SimulationDrawer * evd::DrawingPad::SimulationDraw ( )
inherited

Provide access to the drawer for the Simulation classes

Definition at line 112 of file DrawingPad.cxx.

References evd::DrawingPad::fSimulationDraw.

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

113  {
114  if (fSimulationDraw == 0) fSimulationDraw = new SimulationDrawer();
115  return fSimulationDraw;
116  }
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:48
void evd::Display3DPad::UpdateSeedCurve ( )

Member Data Documentation

AnalysisBaseDrawer* evd::DrawingPad::fAnalysisBaseDraw
protectedinherited

Drawer for analysisbase objects.

Definition at line 51 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 47 of file DrawingPad.h.

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

HeaderDrawer* evd::DrawingPad::fHeaderDraw
protectedinherited

Drawer for event header info.

Definition at line 46 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 49 of file DrawingPad.h.

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

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

Definition at line 45 of file Display3DPad.h.

Referenced by Display3DPad(), and Draw().

RecoBaseDrawer* evd::DrawingPad::fRecoBaseDraw
protectedinherited

Drawer for recobase objects.

Definition at line 50 of file DrawingPad.h.

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

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

Definition at line 44 of file Display3DPad.h.

Referenced by Display3DPad(), and Draw().

SimulationDrawer* evd::DrawingPad::fSimulationDraw
protectedinherited

Drawer for simulation objects.

Definition at line 48 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 42 of file Display3DPad.h.

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


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