#include <TZProjPad.h>
Inheritance diagram for evd::TZProjPad:

Public Member Functions | |
| TZProjPad (const char *nm, const char *ti, double x1, double y1, double x2, double y2, const char *opt) | |
| ~TZProjPad () | |
| void | Draw () |
Private Member Functions | |
| void | AutoZoom () |
Private Attributes | |
| int | fXorY |
| 0 = X vs. Z, 1 = Y vs. Z | |
| TH2F * | fHisto |
| Histogram to draw object on. | |
| evdb::View2D * | fView |
| Collection of graphics objects to render. | |
Definition at line 18 of file TZProjPad.h.
|
||||||||||||||||||||||||||||||||
|
Create a pad showing a single X-Z or Y-Z projection of the detector
Definition at line 31 of file TZProjPad.cxx. References geo::Geometry::DetHalfHeight(), geo::Geometry::DetHalfWidth(), geo::Geometry::DetLength(), fHisto, fView, fXorY, evd::DrawingPad::Geometry(), and evd::DrawingPad::Pad(). 00035 : 00036 DrawingPad(nm, ti, x1, x2, y1, y2) 00037 { 00038 this->Pad()->cd(); 00039 00040 if (std::string(opt)=="x") fXorY = kX; 00041 if (std::string(opt)=="y") fXorY = kY; 00042 if (fXorY==kX) { 00043 this->Pad()->SetLeftMargin (0.050); 00044 this->Pad()->SetRightMargin (0.010); 00045 this->Pad()->SetTopMargin (0.110); 00046 this->Pad()->SetBottomMargin(0.005); 00047 fHisto = new TH2F("fTZXHisto",";z (cm); x (cm)", 00048 140, 00049 -0.05*this->Geometry().DetLength()-200.0, 00050 +1.05*this->Geometry().DetLength(), 00051 64, 00052 -1.05*this->Geometry().DetHalfWidth(), 00053 +1.05*this->Geometry().DetHalfWidth()); 00054 fHisto->SetTitleOffset(0.5,"Y"); 00055 fHisto->Draw("AB"); 00056 } 00057 if (fXorY==kY) { 00058 this->Pad()->SetLeftMargin (0.050); 00059 this->Pad()->SetRightMargin (0.010); 00060 this->Pad()->SetTopMargin (0.005); 00061 this->Pad()->SetBottomMargin(0.120); 00062 fHisto = new TH2F("fTZYHisto",";z (cm); y (cm)", 00063 140, 00064 -0.05*this->Geometry().DetLength()-200.0, 00065 +1.05*this->Geometry().DetLength(), 00066 64, 00067 -1.05*this->Geometry().DetHalfHeight(), 00068 +1.05*this->Geometry().DetHalfHeight()); 00069 fHisto->SetTitleOffset(0.5,"Y"); 00070 fHisto->Draw("AB"); 00071 } 00072 fView = new evdb::View2D(); 00073 }
|
|
|
Definition at line 77 of file TZProjPad.cxx. 00078 {
00079 if (fHisto) { delete fHisto; fHisto = 0; }
00080 if (fView) { delete fView; fView = 0; }
00081 }
|
|
|
Automatically zoom the view to a size just larger than the events. Also ensures that the aspect ratio is the same for the XZ and YZ projections. Definition at line 122 of file TZProjPad.cxx. References fHisto, fXorY, evd::RawDataDrawer::GetLimits(), and evd::DrawingPad::RawDataDraw(). Referenced by Draw(). 00123 {
00124 double xmin, ymin, zmin;
00125 double xmax, ymax, zmax;
00126 this->RawDataDraw()->GetLimits(&xmin, &xmax,
00127 &ymin, &ymax,
00128 &zmin, &zmax);
00129 double dx = xmax-xmin;
00130 double dy = ymax-ymin;
00131 double dz = zmax-zmin;
00132
00133 if (dx<dy) dx = dy;
00134 else dy = dx;
00135 xmin = 0.5*(xmin+xmax)-0.6*dx;
00136 xmax = 0.5*(xmin+xmax)+0.6*dx;
00137 ymin = 0.5*(ymin+ymax)-0.6*dy;
00138 ymax = 0.5*(ymin+ymax)+0.6*dy;
00139 zmin -= 0.1*dz;
00140 zmax += 0.1*dz;
00141
00142 fHisto->GetXaxis()->SetRangeUser(zmin,zmax);
00143 if (fXorY==kX) fHisto->GetYaxis()->SetRangeUser(xmin,xmax);
00144 else fHisto->GetYaxis()->SetRangeUser(ymin,ymax);
00145 }
|
|
|
Definition at line 85 of file TZProjPad.cxx. References AutoZoom(), evdb::View2D::Clear(), evdb::View2D::Draw(), evd::DrawingPad::EventHandle(), fHisto, evd::SimulationDrawer::FLSHit2D(), fView, fXorY, evd::DrawingPad::Geometry(), evd::SimulationDrawer::MCTruthVectors2D(), evd::DrawingPad::RawDataDraw(), evd::DrawingPad::RecoBaseDraw(), and evd::DrawingPad::SimulationDraw(). Referenced by evd::XZYZProjectionsView::Draw(), and evd::XZYZProjectionsView::XZYZProjectionsView(). 00086 {
00087 fView->Clear();
00088
00089 evdb::View2D* vx = 0;
00090 evdb::View2D* vy = 0;
00091 if (fXorY==kX) vx = fView; // fView is an XZ projection
00092 if (fXorY==kY) vy = fView; // fView is a YZ projection
00093
00094 const edm::EventHandle& evd = this->EventHandle();
00095 const geo::Geometry& geo = this->Geometry();
00096 this->RecoBaseDraw()-> Cluster2D (evd, geo, vx, vy);
00097 this->SimulationDraw()->MCTruthVectors2D(evd, vx, vy);
00098 this->SimulationDraw()->FLSHit2D (evd, geo, vx, vy);
00099 this->RawDataDraw()-> RawDigit2D (evd, "./", geo, vx, vy);
00100 this->RecoBaseDraw()-> CellHit2D (evd, geo, vx, vy);
00101
00102 fPad->cd();
00103 fPad->SetGridx();
00104 fPad->SetGridy();
00105 if (fXorY==kX) fHisto->Draw("X+");
00106 else fHisto->Draw("");
00107
00108 // Should eventually be a configuration option
00109 int fAutoZoom = 1;
00110 if (fAutoZoom) this->AutoZoom();
00111
00112 fView->Draw();
00113 }
|
|
|
Histogram to draw object on.
Definition at line 30 of file TZProjPad.h. Referenced by AutoZoom(), Draw(), TZProjPad(), and ~TZProjPad(). |
|
|
Collection of graphics objects to render.
Definition at line 31 of file TZProjPad.h. Referenced by Draw(), TZProjPad(), and ~TZProjPad(). |
|
|
0 = X vs. Z, 1 = Y vs. Z
Definition at line 29 of file TZProjPad.h. Referenced by AutoZoom(), Draw(), and TZProjPad(). |
1.3.9.1