Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
evd::XZYZProjectionsView Class Reference

View of event showing the XZ and YZ readout planes. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/EventDisplay/XZYZProjectionsView.h"

Inheritance diagram for evd::XZYZProjectionsView:
evdb::Canvas evdb::Printable

Public Member Functions

 XZYZProjectionsView (TGMainFrame *mf)
 
 ~XZYZProjectionsView ()
 
const char * Description () const
 
const char * PrintTag () const
 
void Draw (const char *opt="")
 
void RangeChanged ()
 
void AspectRatioHandler (int event, int key, int py, TObject *sel)
 
void FixAspectRatio ()
 
void SetAspectRatio ()
 
virtual void Print (const char *f)
 
void Connect ()
 Make signal/slot connections. More...
 

Static Public Member Functions

static void AddToListOfPrintables (const char *name, evdb::Printable *p)
 
static void RemoveFromListOfPrintables (evdb::Printable *p)
 
static std::map< std::string, evdb::Printable * > & GetPrintables ()
 

Protected Attributes

TGCompositeFrame * fFrame
 Graphics frame. More...
 
TGLayoutHints * fLayout
 Layout hints for frame. More...
 
TRootEmbeddedCanvas * fEmbCanvas
 Embedded canvas. More...
 
TCanvas * fCanvas
 The ROOT drawing canvas. More...
 
unsigned short fXsize
 Size of the canvas;. More...
 
unsigned short fYsize
 Size of the canvas;. More...
 
float fAspectRatio
 fYsize/fXsize More...
 

Private Member Functions

std::vector< float > GetRightAxesRange (int pix, float cm, float min, float max, float boundmin, float boundmax, int tpix, float tcm)
 

Private Attributes

HeaderPadfHeaderPad
 Show header information. More...
 
TQPadfRawQ
 Histogram of raw charges. More...
 
TQPadfRawT
 Histogram of raw times. More...
 
MCBriefPadfMC
 Short summary of MC event. More...
 
SliceButtonBarfSliceButtonBar
 Bar with slice controls. More...
 
TZProjPadfXview
 X - Z projection of the event. More...
 
TZProjPadfYview
 Y - Z projection of the event. More...
 
double fX0
 
double fX1
 
double fX3
 
double fX2
 
double fY0
 
double fY1
 
double fY2
 
double fY4
 
double fY3
 

Detailed Description

View of event showing the XZ and YZ readout planes.

Definition at line 21 of file XZYZProjectionsView.h.

Constructor & Destructor Documentation

evd::XZYZProjectionsView::XZYZProjectionsView ( TGMainFrame *  mf)

Definition at line 27 of file XZYZProjectionsView.cxx.

References evd::HeaderPad::Draw(), evd::MCBriefPad::Draw(), evd::TQPad::Draw(), evd::TZProjPad::Draw(), evdb::Canvas::fCanvas, evdb::Canvas::fEmbCanvas, fHeaderPad, evdb::Canvas::fLayout, fMC, fRawQ, fRawT, fSliceButtonBar, fX0, fX1, fX2, fX3, fXview, fY0, fY1, fY2, fY3, fY4, fYview, and evd::DrawingPad::Pad().

27  :
29  fX0(0.0),
30  fX1(0.135),
31  fX3(1.0),
32  fX2(0.5*(fX1+fX3)),
33  fY0(0.0),
34  fY1(0.14),
35  fY2(0.17),
36  fY4(1.0),
37  fY3(0.5*(fY2+fY4))
38  {
40  fHeaderPad = new HeaderPad("fHeaderPad","Header",fX0,fY0,fX1,fY2,"");
41  fHeaderPad->Draw();
42 
44  fRawT = new TQPad("fTPad", "Hit Times",fX1,fY0,fX2,fY1,"T");
45  fRawT->Draw();
46 
48  fRawQ = new TQPad("fQPad", "Hit Charges",fX2,fY0,fX3,fY1,"Q");
49  fRawQ->Draw();
50 
52  fMC = new MCBriefPad("fMCPad","MC Info.",fX1,fY1,fX3,fY2,"");
53  fMC->Draw();
54 
56  fXview = new TZProjPad("fXView","xz view",fX0,fY3,fX3,fY4,"x");
57  fXview->Draw();
58 
60  fYview = new TZProjPad("fYView","yz view",fX0,fY2,fX3,fY3,"y");
61  fYview->Draw();
62 
63  fXview->Pad()->Connect("RangeChanged()",
64  "evd::XZYZProjectionsView",
65  this,
66  "RangeChanged()");
67  fYview->Pad()->Connect("RangeChanged()",
68  "evd::XZYZProjectionsView",
69  this,
70  "RangeChanged()");
71 
72  // Want the slice bar top, but the canvas got there first. Remove it...
73  mf->RemoveFrame(fEmbCanvas);
74  // ...add the bar...
75  fSliceButtonBar = new SliceButtonBar(mf);
76  mf->AddFrame(fSliceButtonBar,
77  new TGLayoutHints(kLHintsTop | kLHintsExpandX,
78  0, 0, 1, 0));
79  // ...and put the canvas back
80  mf->AddFrame(fEmbCanvas, fLayout);
81 
82  fCanvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", "evd::XZYZProjectionsView",
83  this, "AspectRatioHandler(int, int, int, TObject*)");
84 
85  evdb::Canvas::fCanvas->Update();
86  }
HeaderPad * fHeaderPad
Show header information.
TZProjPad * fYview
Y - Z projection of the event.
MCBriefPad * fMC
Short summary of MC event.
void Draw(const char *opt=0, bool *rezoom=0)
Definition: TZProjPad.cxx:116
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void Draw()
Definition: TQPad.cxx:123
TGLayoutHints * fLayout
Layout hints for frame.
Definition: Canvas.h:40
TPad * Pad()
Definition: DrawingPad.h:27
void Draw(const char *opt="")
Definition: HeaderPad.cxx:40
SliceButtonBar * fSliceButtonBar
Bar with slice controls.
TZProjPad * fXview
X - Z projection of the event.
TRootEmbeddedCanvas * fEmbCanvas
Embedded canvas.
Definition: Canvas.h:41
TQPad * fRawT
Histogram of raw times.
TQPad * fRawQ
Histogram of raw charges.
evd::XZYZProjectionsView::~XZYZProjectionsView ( )

Definition at line 90 of file XZYZProjectionsView.cxx.

References fMC, fRawQ, fRawT, fSliceButtonBar, fXview, and fYview.

91  {
92  if (fRawT) { delete fRawT; fRawT = 0; }
93  if (fRawQ) { delete fRawQ; fRawQ = 0; }
94  if (fMC) { delete fMC; fMC = 0; }
95  if (fXview) { delete fXview; fXview = 0; }
96  if (fYview) { delete fYview; fYview = 0; }
97  if (fSliceButtonBar) { delete fSliceButtonBar; fSliceButtonBar = 0; }
98  }
TZProjPad * fYview
Y - Z projection of the event.
MCBriefPad * fMC
Short summary of MC event.
SliceButtonBar * fSliceButtonBar
Bar with slice controls.
TZProjPad * fXview
X - Z projection of the event.
TQPad * fRawT
Histogram of raw times.
TQPad * fRawQ
Histogram of raw charges.

Member Function Documentation

void evdb::Printable::AddToListOfPrintables ( const char *  name,
evdb::Printable p 
)
staticinherited

Definition at line 29 of file Printable.cxx.

References om::cerr, and string.

Referenced by evdb::Canvas::Connect(), evdb::ObjListCanvas::Connect(), evdb::Printable::Description(), and evdb::testCanvas1::testCanvas1().

31  {
33 
34  if (gsPrintables[s] == 0) {
35  gsPrintables[s] = p;
36  }
37  else {
38  if (gsPrintables[s] != p) {
39  std::cerr << "Printable: Name " << name << " reused.\n";
40  std::abort();
41  }
42  }
43  }
const XML_Char * name
Definition: expat.h:151
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
const char * p
Definition: xmltok.h:285
OStream cerr
Definition: OStream.cxx:7
const XML_Char * s
Definition: expat.h:262
enum BeamMode string
void evd::XZYZProjectionsView::AspectRatioHandler ( int  event,
int  key,
int  py,
TObject *  sel 
)

Definition at line 262 of file XZYZProjectionsView.cxx.

References FixAspectRatio().

Referenced by PrintTag().

263  {
264 
265  if (event != kKeyPress || key != '=' )
266  return;
267 
268  FixAspectRatio();
269  }
void evdb::Canvas::Connect ( )
inherited

Make signal/slot connections.

Definition at line 68 of file Canvas.cxx.

References evdb::Printable::AddToListOfPrintables(), and evdb::Canvas::Description().

Referenced by evdb::Canvas::Description(), and evdb::DisplayWindow::DisplayWindow().

69  {
70  // Make connections for drawing and printing
71  // IoModule::Instance()->Connect("NewEvent()",
72  // "evdb::Canvas",this,"Draw()");
74  }
virtual const char * Description() const
Definition: Canvas.h:33
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
Definition: Printable.cxx:29
const char* evd::XZYZProjectionsView::Description ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 28 of file XZYZProjectionsView.h.

28 { return "XZ/YZ Projections"; }
void evd::XZYZProjectionsView::Draw ( const char *  opt = "")
virtual

Implements evdb::Canvas.

Definition at line 177 of file XZYZProjectionsView.cxx.

References evd::HeaderPad::Draw(), evd::MCBriefPad::Draw(), evd::TQPad::Draw(), evd::TZProjPad::Draw(), evdb::Canvas::fCanvas, fHeaderPad, FixAspectRatio(), fMC, fRawQ, fRawT, fSliceButtonBar, fXview, fYview, SetAspectRatio(), and evd::SliceButtonBar::Update().

Referenced by PrintTag().

178  {
179  evdb::Canvas::fCanvas->cd();
180 
181  fHeaderPad->Draw();
182 
183  fRawT->Draw();
184  fRawQ->Draw();
185  fMC->Draw();
186 
187  bool rezoom = false;
188 
189  fXview->Draw(opt, &rezoom);
190  fYview->Draw(opt, &rezoom);
191 
192  // Any auto-zooming should always wind up in a state with correct aspect
193  // ratio.
194  if(rezoom) FixAspectRatio();
195 
197 
198  this->SetAspectRatio();
199 
200  evdb::Canvas::fCanvas->Update();
201  }
HeaderPad * fHeaderPad
Show header information.
TZProjPad * fYview
Y - Z projection of the event.
MCBriefPad * fMC
Short summary of MC event.
void Draw(const char *opt=0, bool *rezoom=0)
Definition: TZProjPad.cxx:116
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void Draw()
Definition: TQPad.cxx:123
void Draw(const char *opt="")
Definition: HeaderPad.cxx:40
SliceButtonBar * fSliceButtonBar
Bar with slice controls.
TZProjPad * fXview
X - Z projection of the event.
TQPad * fRawT
Histogram of raw times.
TQPad * fRawQ
Histogram of raw charges.
void evd::XZYZProjectionsView::FixAspectRatio ( )

Definition at line 273 of file XZYZProjectionsView.cxx.

References evdb::Canvas::fCanvas, fXview, fYview, GetRightAxesRange(), evd::TZProjPad::GetWBoundCm(), evd::TZProjPad::GetWrangeCm(), evd::TZProjPad::GetZBoundCm(), evd::TZProjPad::GetZrangeCm(), evd::DrawingPad::Pad(), evd::TZProjPad::SetWrangeCm(), evd::TZProjPad::SetZrangeCm(), xmax, make_mec_shifts_plots::xmin, ymax, ymin, and make_true_q0q3_plots::zmax.

Referenced by AspectRatioHandler(), Draw(), and PrintTag().

274  {
275  float xmin, xmax, ymin, ymax, zmin, zmax;
276  fXview->GetWrangeCm(&xmin, &xmax);
277  fYview->GetWrangeCm(&ymin, &ymax);
278  fXview->GetZrangeCm(&zmin, &zmax);
279 
280  float xcm = xmax - xmin;
281  float ycm = ymax - ymin;
282  float zcm = zmax - zmin;
283 
284  int xpix = fXview->Pad()->GetWh()*fXview->Pad()->GetHNDC();
285  int ypix = fYview->Pad()->GetWh()*fYview->Pad()->GetHNDC();
286  int zpix = fXview->Pad()->GetWw()*fXview->Pad()->GetWNDC();
287 
288  float xpixcm = xpix/xcm;
289  float ypixcm = ypix/ycm;
290  float zpixcm = zpix/zcm;
291 
292  float xboundmin, xboundmax, yboundmin, yboundmax, zboundmin, zboundmax;
293 
294  fXview->GetZBoundCm( &zboundmin, &zboundmax);
295  fXview->GetWBoundCm( &xboundmin, &xboundmax);
296  fYview->GetWBoundCm( &yboundmin, &yboundmax);
297 
298  if( xpixcm < ypixcm && xpixcm < zpixcm ){
299  // x is more zoomed out, zoom out on y,z as well.
300 
301  std::vector<float> zrange = GetRightAxesRange( zpix, zcm, zmin, zmax,
302  zboundmin, zboundmax,
303  xpix, xcm);
304 
305  std::vector<float> yrange = GetRightAxesRange( ypix, ycm, ymin, ymax,
306  yboundmin, yboundmax,
307  xpix, xcm);
308  fXview->SetZrangeCm( zrange[0], zrange[1]);
309  fYview->SetZrangeCm( zrange[0], zrange[1]);
310  fYview->SetWrangeCm( yrange[0], yrange[1]);
311  fXview->Pad()->Modified();
312  fYview->Pad()->Modified();
313  }
314 
315  else if( ypixcm < xpixcm && ypixcm < zpixcm ){
316 
317  // y is more zoomed out, zoom out on x,z as well.
318 
319  std::vector<float> zrange = GetRightAxesRange( zpix, zcm, zmin, zmax,
320  zboundmin, zboundmax,
321  ypix, ycm);
322 
323  std::vector<float> xrange = GetRightAxesRange( xpix, xcm, xmin, xmax,
324  xboundmin, xboundmax,
325  ypix, ycm);
326 
327  fXview->SetZrangeCm( zrange[0], zrange[1]);
328  fYview->SetZrangeCm( zrange[0], zrange[1]);
329  fXview->SetWrangeCm( xrange[0], xrange[1]);
330  fXview->Pad()->Modified();
331  fYview->Pad()->Modified();
332  }
333 
334  else if( zpixcm < ypixcm && zpixcm < xpixcm ){
335 
336  // x is more zoomed out, zoom out on y,z as well.
337 
338  std::vector<float> xrange = GetRightAxesRange( xpix, xcm, xmin, xmax,
339  xboundmin, xboundmax,
340  zpix, zcm);
341 
342  std::vector<float> yrange = GetRightAxesRange( ypix, ycm, ymin, ymax,
343  yboundmin, yboundmax,
344  zpix, zcm);
345 
346  fXview->SetWrangeCm( xrange[0], xrange[1]);
347  fYview->SetWrangeCm( yrange[0], yrange[1]);
348  fXview->Pad()->Modified();
349  fYview->Pad()->Modified();
350  }
351 
352  else if( ypixcm == xpixcm && ypixcm < zpixcm ){
353  // y,x are more zoomed out, zoom out on z as well.
354 
355  std::vector<float> zrange = GetRightAxesRange( zpix, zcm, zmin, zmax,
356  zboundmin, zboundmax,
357  ypix, ycm);
358 
359  fXview->SetZrangeCm( zrange[0], zrange[1]);
360  fYview->SetZrangeCm( zrange[0], zrange[1]);
361  fXview->Pad()->Modified();
362  fYview->Pad()->Modified();
363  }
364 
365  else if( zpixcm == xpixcm && zpixcm < ypixcm ){
366  // y,x are more zoomed out, zoom out on z as well.
367 
368  std::vector<float> yrange = GetRightAxesRange( ypix, ycm, ymin, ymax,
369  yboundmin, yboundmax,
370  zpix, zcm);
371 
372  fYview->SetWrangeCm( yrange[0], yrange[1]);
373  fYview->Pad()->Modified();
374  }
375 
376  else if( zpixcm == ypixcm && zpixcm < xpixcm ){
377  // y,x are more zoomed out, zoom out on z as well.
378 
379  std::vector<float> xrange = GetRightAxesRange( xpix, xcm, xmin, xmax,
380  xboundmin, xboundmax,
381  zpix, zcm);
382  fXview->SetWrangeCm( xrange[0], xrange[1]);
383  fXview->Pad()->Modified();
384  }
385 
386  fCanvas->Update();
387  }
void GetWBoundCm(float *i1, float *i2) const
Definition: TZProjPad.cxx:396
std::map< std::string, double > xmax
TZProjPad * fYview
Y - Z projection of the event.
void GetZBoundCm(float *i1, float *i2) const
Definition: TZProjPad.cxx:387
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void GetWrangeCm(float *i1, float *i2) const
Definition: TZProjPad.cxx:369
Double_t ymax
Definition: plot.C:25
void SetWrangeCm(float i1, float i2)
Definition: TZProjPad.cxx:428
std::vector< float > GetRightAxesRange(int pix, float cm, float min, float max, float boundmin, float boundmax, int tpix, float tcm)
void SetZrangeCm(float i1, float i2)
Definition: TZProjPad.cxx:413
TPad * Pad()
Definition: DrawingPad.h:27
Double_t ymin
Definition: plot.C:24
void GetZrangeCm(float *i1, float *i2) const
Definition: TZProjPad.cxx:378
TZProjPad * fXview
X - Z projection of the event.
std::map< std::string, evdb::Printable * > & evdb::Printable::GetPrintables ( )
staticinherited

Definition at line 61 of file Printable.cxx.

References evdb::gsPrintables.

Referenced by evdb::Printable::Description(), evd::SliceNavigator::postProcessEvent(), evdb::EventDisplay::postProcessEvent(), and evdb::PrintDialog::PrintDialog().

62  {
63  return gsPrintables;
64  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
std::vector< float > evd::XZYZProjectionsView::GetRightAxesRange ( int  pix,
float  cm,
float  min,
float  max,
float  boundmin,
float  boundmax,
int  tpix,
float  tcm 
)
private

A function that calculates the range to zoom out to on an axis.

Definition at line 391 of file XZYZProjectionsView.cxx.

References hi(), lo(), and PandAna.Demos.demo1::range.

Referenced by FixAspectRatio().

394  {
395  std::vector<float> range;
396 
397  float zoom = (tcm * pix / tpix ) -cm;
398  float lo = min - (zoom/2);
399  float hi = max + (zoom/2);
400 
401  if( lo < boundmin ){
402  float shift = boundmin - lo;
403  lo = boundmin;
404  hi = hi + shift;
405  }
406 
407  if( hi > boundmax ){
408  float shift = hi - boundmax;
409  lo = lo - shift;
410  hi = boundmax;
411  }
412  range.push_back( lo );
413  range.push_back( hi );
414 
415  return range;
416  }
TSpline3 lo("lo", xlo, ylo, 12,"0")
TSpline3 hi("hi", xhi, yhi, 18,"0")
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
static constexpr Double_t cm
Definition: Munits.h:140
void evdb::Canvas::Print ( const char *  f)
virtualinherited

Implements evdb::Printable.

Definition at line 88 of file Canvas.cxx.

References evdb::Canvas::fCanvas.

Referenced by evdb::Canvas::Description().

88 { fCanvas->Print(f); }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
const char* evd::XZYZProjectionsView::PrintTag ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 29 of file XZYZProjectionsView.h.

References AspectRatioHandler(), Draw(), FixAspectRatio(), findDuplicateFiles::key, MECModelEnuComparisons::opt, RangeChanged(), and SetAspectRatio().

29 { return "xzyz-proj"; }
void evd::XZYZProjectionsView::RangeChanged ( )

Definition at line 219 of file XZYZProjectionsView.cxx.

References fXview, fYview, evd::TZProjPad::GetZrange(), evd::gRefresher, evd::DrawingPad::Pad(), and evd::TZProjPad::SetZrange().

Referenced by PrintTag().

220  {
221  static int ilolast = -1;
222  static int ihilast = -1;
223 
224  int i1lo, i1hi;
225  int i2lo, i2hi;
226 
227  fXview->GetZrange(&i1lo, &i1hi);
228  fYview->GetZrange(&i2lo, &i2hi);
229 
230  bool axis1changed = (i1lo!=ilolast)||(i1hi!=ihilast);
231  bool axis2changed = (i2lo!=ilolast)||(i2hi!=ihilast);
232 
233  if (axis1changed==true) {
234  fYview->SetZrange(i1lo, i1hi);
235  fYview->Pad()->Modified();
236 
237  ilolast = i1lo;
238  ihilast = i1hi;
239  }
240  if (axis2changed==true) {
241  fXview->SetZrange(i2lo, i2hi);
242  fXview->Pad()->Modified();
243 
244  ilolast = i2lo;
245  ihilast = i2hi;
246  }
247 
248  if(axis1changed || axis2changed){
249  // We need to call gPad->Update() to get these new axis ranges
250  // drawn. Unfortunately, this function is called in the middle of another
251  // gPad->Update(), and ROOT prevents two calls from happening at
252  // once. Instead, arrange matters so that it will be called just as soon
253  // as we return to the event loop. This is the neatest way I could figure
254  // out to get a one-short timer (I can't make TTimer::SingleShot() work
255  // right).
256  gRefresher.TurnOn();
257  }
258  }
void SetZrange(int i1, int i2)
Definition: TZProjPad.cxx:406
TZProjPad * fYview
Y - Z projection of the event.
TPad * Pad()
Definition: DrawingPad.h:27
evd::Refresher gRefresher
void GetZrange(int *i1, int *i2) const
Definition: TZProjPad.cxx:362
TZProjPad * fXview
X - Z projection of the event.
void evdb::Printable::RemoveFromListOfPrintables ( evdb::Printable p)
staticinherited

Definition at line 47 of file Printable.cxx.

Referenced by evdb::Printable::Description(), evdb::Printable::~Printable(), and evdb::testCanvas1::~testCanvas1().

48  {
49  std::map<std::string,Printable*>::iterator itr(gsPrintables.begin());
50  std::map<std::string,Printable*>::iterator itrEnd(gsPrintables.end());
51  for (; itr!=itrEnd; ++itr) {
52  if ( itr->second == p) {
53  gsPrintables.erase(itr);
54  return;
55  }
56  }
57  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evd::XZYZProjectionsView::SetAspectRatio ( )

Definition at line 105 of file XZYZProjectionsView.cxx.

References stan::math::fabs(), evd::TZProjPad::fHisto, fX0, fX3, fXview, fY2, fY3, fY4, fYview, and evd::DrawingPad::Pad().

Referenced by Draw(), and PrintTag().

106  {
107  if(!fXview->fHisto || !fYview->fHisto) return;
108 
109  static double lastnx = 0.0;
110  static double lastny = 0.0;
111 
112  double nx =
113  fXview->fHisto->GetYaxis()->GetXmax()-
114  fXview->fHisto->GetYaxis()->GetXmin();
115  double ny =
116  fYview->fHisto->GetYaxis()->GetXmax()-
117  fYview->fHisto->GetYaxis()->GetXmin();
118 
119  //
120  // Is the current aspect ratio correct?
121  //
122  if (lastnx == nx && lastny==ny) return;
123  static const double tol = 0.001;
124  if (fabs(lastnx-nx)<tol && fabs(lastny-ny)<tol) return;
125 
126  lastnx = nx;
127  lastny = ny;
128 
129  //
130  // Reposition the boundary (fY3) between the X and Y views so that
131  // the distance between y3 and y4 scales with nx and the distance
132  // between y2 and y3 scales with ny
133  //
134  fY3 = (nx*fY2+ny*fY4)/(nx+ny);
135 
136  fXview->Pad()->SetPad(fX0,fY3,fX3,fY4);
137  fYview->Pad()->SetPad(fX0,fY2,fX3,fY3);
138 
139  //
140  // Along with scaling the views, we need to rescale the fonts sizes
141  // and offsets to keep them lined up
142  //
143  double sfx = (fY3-fY2)/(fY4-fY2);
144  double sfy = (fY4-fY3)/(fY4-fY2);
145 
146  TAxis* xvx = fXview->fHisto->GetXaxis();
147  TAxis* xvy = fXview->fHisto->GetYaxis();
148  xvx->SetTickLength(0.01);
149  xvy->SetTickLength(0.01);
150 
151  xvx->SetTitleSize(0.15*sfx);
152  xvy->SetTitleSize(0.15*sfx);
153 
154  xvx->SetTitleOffset(0.8);
155  xvy->SetTitleOffset(0.65*sfy);
156  xvx->SetLabelSize(0.12*sfx);
157  xvy->SetLabelSize(0.12*sfx);
158  xvx->SetLabelOffset(0.025*sfx);
159 
160  TAxis* yvx = fYview->fHisto->GetXaxis();
161  TAxis* yvy = fYview->fHisto->GetYaxis();
162 
163  yvx->SetTickLength(0.01);
164  yvy->SetTickLength(0.01);
165  yvx->SetTitleSize(0.15*sfy);
166  yvy->SetTitleSize(0.15*sfy);
167  yvx->SetTitleOffset(0.8);
168  yvy->SetTitleOffset(0.65*sfx);
169 
170  yvx->SetLabelSize(0.12*sfy);
171  yvy->SetLabelSize(0.12*sfy);
172  yvx->SetLabelOffset(0.025*sfy);
173  }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
TZProjPad * fYview
Y - Z projection of the event.
TPad * Pad()
Definition: DrawingPad.h:27
TH2F * fHisto
Histogram to draw objects on.
Definition: TZProjPad.h:73
TZProjPad * fXview
X - Z projection of the event.

Member Data Documentation

float evdb::Canvas::fAspectRatio
protectedinherited

fYsize/fXsize

Definition at line 46 of file Canvas.h.

Referenced by evdb::Canvas::Canvas().

TCanvas* evdb::Canvas::fCanvas
protectedinherited
TRootEmbeddedCanvas* evdb::Canvas::fEmbCanvas
protectedinherited

Embedded canvas.

Definition at line 41 of file Canvas.h.

Referenced by evdb::Canvas::Canvas(), XZYZProjectionsView(), and evdb::Canvas::~Canvas().

TGCompositeFrame* evdb::Canvas::fFrame
protectedinherited

Graphics frame.

Definition at line 39 of file Canvas.h.

Referenced by evdb::Canvas::Canvas(), and evdb::Canvas::~Canvas().

HeaderPad* evd::XZYZProjectionsView::fHeaderPad
private

Show header information.

Definition at line 38 of file XZYZProjectionsView.h.

Referenced by Draw(), and XZYZProjectionsView().

TGLayoutHints* evdb::Canvas::fLayout
protectedinherited

Layout hints for frame.

Definition at line 40 of file Canvas.h.

Referenced by evdb::Canvas::Canvas(), XZYZProjectionsView(), and evdb::Canvas::~Canvas().

MCBriefPad* evd::XZYZProjectionsView::fMC
private

Short summary of MC event.

Definition at line 43 of file XZYZProjectionsView.h.

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

TQPad* evd::XZYZProjectionsView::fRawQ
private

Histogram of raw charges.

Definition at line 39 of file XZYZProjectionsView.h.

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

TQPad* evd::XZYZProjectionsView::fRawT
private

Histogram of raw times.

Definition at line 40 of file XZYZProjectionsView.h.

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

SliceButtonBar* evd::XZYZProjectionsView::fSliceButtonBar
private

Bar with slice controls.

Definition at line 44 of file XZYZProjectionsView.h.

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

double evd::XZYZProjectionsView::fX0
private

Definition at line 50 of file XZYZProjectionsView.h.

Referenced by SetAspectRatio(), and XZYZProjectionsView().

double evd::XZYZProjectionsView::fX1
private

Definition at line 51 of file XZYZProjectionsView.h.

Referenced by XZYZProjectionsView().

double evd::XZYZProjectionsView::fX2
private

Definition at line 53 of file XZYZProjectionsView.h.

Referenced by XZYZProjectionsView().

double evd::XZYZProjectionsView::fX3
private

Definition at line 52 of file XZYZProjectionsView.h.

Referenced by SetAspectRatio(), and XZYZProjectionsView().

unsigned short evdb::Canvas::fXsize
protectedinherited

Size of the canvas;.

Definition at line 44 of file Canvas.h.

Referenced by evdb::Canvas::Canvas().

TZProjPad* evd::XZYZProjectionsView::fXview
private

X - Z projection of the event.

Definition at line 46 of file XZYZProjectionsView.h.

Referenced by Draw(), FixAspectRatio(), RangeChanged(), SetAspectRatio(), XZYZProjectionsView(), and ~XZYZProjectionsView().

double evd::XZYZProjectionsView::fY0
private

Definition at line 55 of file XZYZProjectionsView.h.

Referenced by XZYZProjectionsView().

double evd::XZYZProjectionsView::fY1
private

Definition at line 56 of file XZYZProjectionsView.h.

Referenced by XZYZProjectionsView().

double evd::XZYZProjectionsView::fY2
private

Definition at line 57 of file XZYZProjectionsView.h.

Referenced by SetAspectRatio(), and XZYZProjectionsView().

double evd::XZYZProjectionsView::fY3
private

Definition at line 59 of file XZYZProjectionsView.h.

Referenced by SetAspectRatio(), and XZYZProjectionsView().

double evd::XZYZProjectionsView::fY4
private

Definition at line 58 of file XZYZProjectionsView.h.

Referenced by SetAspectRatio(), and XZYZProjectionsView().

unsigned short evdb::Canvas::fYsize
protectedinherited

Size of the canvas;.

Definition at line 45 of file Canvas.h.

Referenced by evdb::Canvas::Canvas().

TZProjPad* evd::XZYZProjectionsView::fYview
private

Y - Z projection of the event.

Definition at line 47 of file XZYZProjectionsView.h.

Referenced by Draw(), FixAspectRatio(), RangeChanged(), SetAspectRatio(), XZYZProjectionsView(), and ~XZYZProjectionsView().


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