LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
Display3DPad.cxx
Go to the documentation of this file.
1 #include "TPad.h"
7 #include "TView3D.h"
8 
19 
23 
24 namespace evd {
25 
37  const char* ti,
38  double x1,
39  double y1,
40  double x2,
41  double y2)
42  : DrawingPad(nm, ti, x1, y1, x2, y2)
43  {
44  Pad()->SetFillColor(kBlack);
45  Pad()->Draw();
46  Pad()->cd();
47  fView = new evdb::View3D();
48 
49  // Set up the 3D drawing tools for the simulation
51 
52  // Implement the tools for handling the 3D simulation drawing tools
53  const fhicl::ParameterSet& drawSim3DTools = simDrawOpt->f3DDrawerParams;
54 
55  for (const std::string& draw3DTool : drawSim3DTools.get_pset_names()) {
56  const fhicl::ParameterSet& draw3DToolParamSet =
57  drawSim3DTools.get<fhicl::ParameterSet>(draw3DTool);
58 
59  fSim3DDrawerVec.push_back(art::make_tool<evdb_tool::ISim3DDrawer>(draw3DToolParamSet));
60  }
61 
62  // Set up the 3D drawing tools for the reconstruction
64 
65  // Implement the tools for handling the 3D reco drawing tools
66  const fhicl::ParameterSet& drawReco3DTools = recoDrawOpt->f3DDrawerParams;
67 
68  for (const std::string& draw3DTool : drawReco3DTools.get_pset_names()) {
69  const fhicl::ParameterSet& draw3DToolParamSet =
70  drawReco3DTools.get<fhicl::ParameterSet>(draw3DTool);
71 
72  fReco3DDrawerVec.push_back(art::make_tool<evdb_tool::I3DDrawer>(draw3DToolParamSet));
73  }
74  }
75 
76  //......................................................................
77 
79  {
80  delete fView;
81  fView = nullptr;
82  }
83 
84  //......................................................................
85 
87  {
88  fView->Clear();
89 
91 
92  // grab the event from the singleton
94 
95  if (evt) {
98  RecoBaseDraw()->Edge3D(*evt, fView);
100  RecoBaseDraw()->Prong3D(*evt, fView);
101  RecoBaseDraw()->Seed3D(*evt, fView);
102  RecoBaseDraw()->Vertex3D(*evt, fView);
103  RecoBaseDraw()->Event3D(*evt, fView);
104  RecoBaseDraw()->Slice3D(*evt, fView);
105 
106  // Call the 3D simulation drawing tools
107  for (auto& draw3D : fSim3DDrawerVec)
108  draw3D->Draw(*evt, fView);
109 
110  // Call the 3D reco drawing tools
111  for (auto& draw3D : fReco3DDrawerVec)
112  draw3D->Draw(*evt, fView);
113  }
114 
115  Pad()->Clear();
116  Pad()->cd();
117  if (fPad->GetView() == nullptr) {
118  auto const& tpc = geo->TPC({0, 0});
119  double rmin[] = {-2.1 * tpc.HalfWidth(), -2.1 * tpc.HalfHeight(), -0.5 * tpc.Length()};
120  double rmax[] = {2.1 * tpc.HalfWidth(), 2.1 * tpc.HalfHeight(), 0.5 * tpc.Length()};
121  int irep;
122  TView3D* v = new TView3D(1, rmin, rmax);
123  v->SetPerspective();
124  v->SetView(0.0, 260.0, 270.0, irep);
125  fPad->SetView(v); // ROOT takes ownership of object *v
126  }
127  fView->Draw();
128  fPad->Update();
129  }
130 
131 } //namespace
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:38
Float_t y1[n_points_granero]
Definition: compare.C:5
void Prong3D(const art::Event &evt, evdb::View3D *view)
Float_t x1[n_points_granero]
Definition: compare.C:5
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)
Singleton to hold the current art::Event for the event display.
Drawing pad showing a 3D rendering of the detector.
fhicl::ParameterSet f3DDrawerParams
FHICL paramegers for the 3D drawers.
Float_t y2[n_points_geant4]
Definition: compare.C:26
void Seed3D(const art::Event &evt, evdb::View3D *view)
std::vector< std::string > get_pset_names() const
evd_tool::IExperimentDrawer * GeometryDraw()
Definition: DrawingPad.cxx:97
LArSoft includes.
static EventHolder * Instance()
Definition: EventHolder.cxx:15
void PFParticle3D(const art::Event &evt, evdb::View3D *view)
T get(std::string const &key) const
Definition: ParameterSet.h:314
Base class for event display drawing pads.
Definition: DrawingPad.h:26
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:132
void Slice3D(const art::Event &evt, evdb::View3D *view)
TPad * Pad()
Definition: DrawingPad.h:30
fhicl::ParameterSet f3DDrawerParams
FHICL paramegers for the 3D drawers.
Display3DPad(const char *nm, const char *ti, double x1, double y1, double x2, double y2)
std::vector< std::unique_ptr< evdb_tool::ISim3DDrawer > > fSim3DDrawerVec
Definition: Display3DPad.h:37
Class to aid in the rendering of RecoBase objects.
void Draw()
Definition: View3D.cxx:30
void Clear()
Definition: View3D.cxx:40
A collection of 3D drawable objects.
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:44
TCEvent evt
Definition: DataStructs.cxx:8
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:448
Float_t x2[n_points_geant4]
Definition: compare.C:26
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:35
This is the interface class for drawing 3D detector geometries.
ROOT libraries.
art framework interface to geometry description
double HalfWidth() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:102
virtual void DetOutline3D(evdb::View3D *view)=0