LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Display3DPad.cxx
Go to the documentation of this file.
1 #include <iostream>
7 #include "TPad.h"
8 #include "TView3D.h"
9 #include "TGLViewer.h"
10 #include "TPolyLine3D.h"
11 
16 //#include "lareventdisplay/EventDisplay/GeometryDrawer.h"
26 
27 namespace evd{
28 
39  Display3DPad::Display3DPad(const char* nm, const char* ti,
40  double x1, double y1,
41  double x2, double y2,
42  const char* /*opt*/) :
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 
51  //......................................................................
52 
54  {
55  if (fView) { delete fView; fView = 0; }
56  }
57 
58  //......................................................................
59 
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  }
100 
101 
103 
104 
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  }
132 
133 }//namespace
Float_t x
Definition: compare.C:6
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.
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
void MCTruth3D(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.
void GetTrackPoint(double s, double *xyz) const
Float_t y2[n_points_geant4]
Definition: compare.C:26
Display3DPad(const char *nm, const char *ti, double x1, double y1, double x2, double y2, const char *opt)
int fMakeSeeds
Draw two lines to make clusters if clicked.
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
Definition: View3D.cxx:105
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.
LArSoft includes.
Class to perform operations needed to select hits and pass them to a cluster.
static EventHolder * Instance()
Definition: EventHolder.cxx:15
Base class for event display drawing pads.
Definition: DrawingPad.h:29
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
Class to aid in the rendering of RecoBase objects.
void Draw()
Definition: View3D.cxx:30
Class to aid in the rendering of RawData objects.
void Clear()
Definition: View3D.cxx:40
Render the objects from the Simulation package.
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
A collection of 3D drawable objects.
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
TCEvent evt
Definition: DataStructs.cxx:5
Float_t x2[n_points_geant4]
Definition: compare.C:26
evdb::View3D * fView
Collection of graphics objects to render.
Definition: Display3DPad.h:36
This is the interface class for drawing 3D detector geometries.
Namespace collecting geometry-related classes utilities.
art framework interface to geometry description
std::vector< recob::Seed > & SeedVector()
virtual void DetOutline3D(evdb::View3D *view)=0