KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVCanvas.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Fri Feb 17 17:47:35 2012
2 //Author: dgruyer
3 
4 #include "KVCanvas.h"
5 #include "TROOT.h"
6 #include "TBox.h"
7 #include "TAxis.h"
8 #include "TContextMenu.h"
9 #include "TRootCanvas.h"
10 #include "TGWindow.h"
11 #include "KVKeyHandler.h"
12 #include <KeySymbols.h>
13 #include "TMath.h"
14 #include "KVHistoManipulator.h"
15 #include "TProfile.h"
16 #include "TF1.h"
17 #include "TGMsgBox.h"
18 #include "TVirtualX.h"
19 #include <Riostream.h>
20 
22 
24 
25 
26 
27 
28 //________________________________________________________________
29 
31 
33 {
34  fKeyHandler = new KVKeyHandler(this);
35  fAgeOfEmpire = false;
36  fVenerMode = false;
37  fHasDisabledClasses = false;
38  fDisabledClasses = "";
39  fFreezed = kFALSE;
40  fPPressed = kFALSE;
41  fJPressed = kFALSE;
42  InitInfos();
43 
44  // Default constructor
45 }
46 
47 
48 
50 
52 {
53  gCopyObject = 0;
54 }
55 
56 
57 
60 
61 KVCanvas::KVCanvas(const char* name, const char* title, Int_t ww, Int_t wh, Bool_t): TCanvas(name, title, ww, wh)
62 {
63  // if(keyHandler) fKeyHandler = new KVKeyHandler(this);
64  fAgeOfEmpire = false;
65  fVenerMode = false;
66  fHasDisabledClasses = false;
67  fDisabledClasses = "";
68  fFreezed = kFALSE;
69  fPPressed = kFALSE;
70  fJPressed = kFALSE;
71  InitInfos();
72 }
73 
74 
75 
78 
79 KVCanvas::KVCanvas(const char* name, Int_t ww, Int_t wh, Int_t winid): TCanvas(name, ww, wh, winid)
80 {
81  // fKeyHandler = new KVKeyHandler(this);
82  fAgeOfEmpire = false;
83  fVenerMode = false;
84  fHasDisabledClasses = false;
85  fHasDisabledObject = false;
86  fDisabledClasses = "";
87  fFreezed = kFALSE;
88  fPPressed = kFALSE;
89  fJPressed = kFALSE;
90  InitInfos();
91 }
92 
93 
94 
96 
98 {
99  return fLogz;
100 }
101 
102 
103 
105 
107 {
108  return fLogy;
109 }
110 
111 
112 
114 
116 {
117  return fLogx;
118 }
119 
120 
121 
124 
126 {
127  // Execute the list of TExecs in the current pad.
128 
129  if (!TestBit(kAutoExec)) return;
130  if (!gPad) return;
131  ((TPad*)gPad)->AutoExec();
132 
133 }
134 
135 
136 
138 
139 void KVCanvas::DisableClass(const char* className)
140 {
141  fHasDisabledClasses = true;
142  fDisabledClasses += className;
143 
144 }
145 
146 
147 
149 
151 {
152  fHasDisabledClasses = false;
153  fDisabledClasses = "";
154 }
155 
156 
157 
159 
161 {
162  fHasDisabledObject = true;
164 }
165 
166 
167 
169 
171 {
172  if (!obj) return;
173  fHasDisabledObject = true;
175 }
176 
177 
178 
184 
186 {
187  // Report name and title of primitive below the cursor.
188  //
189  // This function is called when the option "Event Status"
190  // in the canvas menu "Options" is selected.
191 
192  const Int_t kTMAX = 256;
193  static char atext[kTMAX];
194 
195  if (!TestBit(kShowEventStatus) || !selected) return;
196 
197  if (!fCanvasImp) return; //this may happen when closing a TAttCanvas
198 
199  TVirtualPad* savepad;
200  savepad = gPad;
201  gPad = GetSelectedPad();
202 
203  fCanvasImp->SetStatusText(selected->GetTitle(), 0);
204  fCanvasImp->SetStatusText(selected->GetName(), 1);
205  if (event == kKeyPress)
206  snprintf(atext, kTMAX, "%c", (char) px);
207  else
208  snprintf(atext, kTMAX, "%d,%d", px, py);
209  fCanvasImp->SetStatusText(atext, 2);
210  fCanvasImp->SetStatusText(selected->GetObjectInfo(px, py), 3);
211  gPad = savepad;
212 }
213 
214 
215 
220 
222 {
223  // Handle Input Events.
224  //
225  // Handle input events, like button up/down in current canvas.
226 
227  if (fFreezed) return;
228 
229  TPad* pad;
230  TPad* prevSelPad = (TPad*) fSelectedPad;
231  TObject* prevSelObj = fSelected;
232 
233  fPadSave = (TPad*)gPad;
234  cd(); // make sure this canvas is the current canvas
235 
236  fEvent = event;
237  fEventX = px;
238  fEventY = py;
239 
240  Int_t sign = 0;
241  Bool_t sendOrder = true;
242 
244  if (fDisabledClasses.Contains(fSelected->ClassName())) sendOrder = false;
245  }
246 
247  if (fHasDisabledObject && fSelected) {
248  if (fDisabledObjects.Contains(fSelected)) sendOrder = false;
249  }
250 
251  switch (event) {
252 
253  case kMouseMotion:
254  // highlight object tracked over
255  pad = Pick(px, py, prevSelObj);
256  if (!pad) return;
257 
258  EnterLeave(prevSelPad, prevSelObj);
259 
260  gPad = pad; // don't use cd() we will use the current
261  // canvas via the GetCanvas member and not via
262  // gPad->GetCanvas
263 
264  if (sendOrder) fSelected->ExecuteEvent(event, px, py);
265 
266  RunAutoExec();
267 
268  if (fAgeOfEmpire && (fSelected->InheritsFrom("TH2"))) {
269  TH2* TheHisto = (TH2*) FindHisto();//fSelected;
270 
271  Double_t size = 0.4 - 0.35 * fVenerMode;
272 
273  Int_t dX = 0;
274  Int_t dY = 0;
275 
276  Double_t ppx = AbsPixeltoX(px);
277  Double_t ppy = AbsPixeltoY(py);
278 
279  TAxis* ax = TheHisto->GetXaxis();
280  Int_t X0 = ax->GetFirst();
281  Int_t X1 = ax->GetLast();
282  Int_t NbinsX = ax->GetNbins();
283  px = ax->FindBin(ppx);
284 
285  Double_t ddX = (X1 + X0) * 0.5 - px;
286  Double_t distX = TMath::Abs(ddX) / (X1 - X0);
287  if (distX >= 0.5) return;
288 
289  TAxis* ay = TheHisto->GetYaxis();
290  Int_t Y0 = ay->GetFirst();
291  Int_t Y1 = ay->GetLast();
292  Int_t NbinsY = ay->GetNbins();
293  py = ay->FindBin(ppy);
294 
295  Double_t ddY = (Y1 + Y0) * 0.5 - py;
296  Double_t distY = TMath::Abs(ddY) / (Y1 - Y0);
297  if (distY >= 0.5) return;
298 
299  if ((distX <= size) && (distY <= size)) return;
300  dX = TMath::Nint(ddX * (0.05 + 0.05 * fVenerMode));
301  dY = TMath::Nint(ddY * (0.05 + 0.05 * fVenerMode));
302 
303  if (TMath::Abs(dX) < 1) dX = TMath::Sign(1., ddX);
304  if (TMath::Abs(dY) < 1) dY = TMath::Sign(1., ddY);
305 
306 
307  Bool_t up = false;
308  if ((X0 - dX > 0) && (X1 - dX < NbinsX)) {
309  ax->SetRange(X0 - dX, X1 - dX);
310  up = true;
311  }
312  if ((Y0 - dY > 0) && (Y1 - dY < NbinsY)) {
313  ay->SetRange(Y0 - dY, Y1 - dY);
314  up = true;
315  }
316  if (up) {
317  Modified();
318  Update();
319  }
320  }
321 
322  break;
323 
324  case kMouseEnter:
325  // mouse enters canvas
327  break;
328 
329  case kMouseLeave:
330  // mouse leaves canvas
331  {
332  // force popdown of tooltips
333  TObject* sobj = fSelected;
334  TPad* spad = fSelectedPad;
335  fSelected = 0;
336  fSelectedPad = 0;
337  EnterLeave(prevSelPad, prevSelObj);
338  fSelected = sobj;
339  fSelectedPad = spad;
341  }
342  break;
343 
344  case kButton1Double:
345  // triggered on the second button down within 350ms and within
346  // 3x3 pixels of the first button down, button up finishes action
347 
348  case kButton1Down:
349  // find pad in which input occured
350  pad = Pick(px, py, prevSelObj);
351  if (!pad) return;
352 
353  gPad = pad; // don't use cd() because we won't draw in pad
354  // we will only use its coordinate system
355 
356  if (fSelected) {
357  FeedbackMode(kTRUE); // to draw in rubberband mode
358  fSelected->ExecuteEvent(event, px, py);
359 
360  RunAutoExec();
361 
362  if (fSelected->InheritsFrom("TH2")) {
363  oldx = GetEventX();
364  oldy = GetEventY();
365  xmin = AbsPixeltoX(oldx);
366  ymin = AbsPixeltoY(oldy);
368  }
369 
370  }
371 
372  break;
373 
374  case kButton1Motion:
375  if (fSelected) {
376  if (fSelected->InheritsFrom("TH2")) {
378  oldx = GetEventX();
379  oldy = GetEventY();
381  moved = true;
382  }
383  }
384  case kButton1ShiftMotion: //8 == kButton1Motion + shift modifier
385  if (fSelected) {
386  gPad = fSelectedPad;
387 
388  if (sendOrder) fSelected->ExecuteEvent(event, px, py);
389  gVirtualX->Update();
390 
391  if (!fSelected->InheritsFrom(TAxis::Class())) {
392  Bool_t resize = kFALSE;
393  if (fSelected->InheritsFrom(TBox::Class()))
394  resize = ((TBox*)fSelected)->IsBeingResized();
395  if (fSelected->InheritsFrom(TVirtualPad::Class()))
396  resize = ((TVirtualPad*)fSelected)->IsBeingResized();
397 
398  if ((!resize && TestBit(kMoveOpaque)) || (resize && TestBit(kResizeOpaque))) {
399  gPad = fPadSave;
400  Update();
402  }
403  }
404 
405  RunAutoExec();
406  }
407 
408  break;
409 
410  case kButton1Up:
411 
412  if (fSelected) {
413  gPad = fSelectedPad;
414 
415  if (sendOrder) fSelected->ExecuteEvent(event, px, py);
416 
417  RunAutoExec();
418 
419  if (fPadSave)
420  gPad = fPadSave;
421  else {
422  gPad = this;
423  fPadSave = this;
424  }
425  if (fSelected->InheritsFrom("TH2") && moved && !fSelected->InheritsFrom("TH3")) {
428  Double_t toto = 0;
429  if (xmax < xmin) {
430  toto = xmax;
431  xmax = xmin;
432  xmin = toto;
433  }
434  if (ymax < ymin) {
435  toto = ymax;
436  ymax = ymin;
437  ymin = toto;
438  }
440 // ZoomSelected((TH2*)fSelected);
441  moved = false;
442  }
443  Update(); // before calling update make sure gPad is reset
444  }
445  break;
446 
447  //*-*----------------------------------------------------------------------
448 
449  case kButton2Down:
450  // find pad in which input occured
451  pad = Pick(px, py, prevSelObj);
452  if (!pad) return;
453 
454  gPad = pad; // don't use cd() because we won't draw in pad
455  // we will only use its coordinate system
456 
458 
459  if (!fSelected->InheritsFrom("TH1")) fSelected->Pop(); // pop object to foreground
460  pad->cd(); // and make its pad the current pad
461 
462  if (fSelected->InheritsFrom("TH2") && !fSelected->InheritsFrom("TH3")) {
463  // implement pan & scan
464  X0 = px;
465  Y0 = py; // u clikd here
466  theXaxis = ((TH2*)FindHisto())->GetXaxis();
467  theYaxis = ((TH2*)FindHisto())->GetYaxis();
468  NXbins = theXaxis->GetNbins(); // maximum bin number in X
469  NYbins = theYaxis->GetNbins(); // maximum bin number in Y
470  Xf1 = Xfirst0 = theXaxis->GetFirst(); // initial displayed bin range in X
471  Xl1 = Xlast0 = theXaxis->GetLast();
472  Yf1 = Yfirst0 = theYaxis->GetFirst(); // initial displayed bin range in Y
473  Yl1 = Ylast0 = theYaxis->GetLast();
474  // size of axes in pixels
475  Int_t pixelWidthX = gPad->XtoAbsPixel(gPad->GetUxmax()) - gPad->XtoAbsPixel(gPad->GetUxmin());
476  Int_t pixelWidthY = gPad->YtoAbsPixel(gPad->GetUymax()) - gPad->YtoAbsPixel(gPad->GetUymin());
477  // sizes of bins in pixels
478  NdisXbins = Xlast0 - Xfirst0 + 1;
479  NdisYbins = Ylast0 - Yfirst0 + 1;
480  XbinPixel = pixelWidthX / (1.0 * NdisXbins);
481  YbinPixel = pixelWidthY / (1.0 * NdisYbins);
482  }
483 
484 
485 
486 
487  if (gDebug)
488  printf("Current Pad: %s / %s\n", pad->GetName(), pad->GetTitle());
489 
490  // loop over all canvases to make sure that only one pad is highlighted
491  {
492  TIter next(gROOT->GetListOfCanvases());
493  TCanvas* tc;
494  while ((tc = (TCanvas*)next()))
495  tc->Update();
496  }
497 
498  /*if (pad->GetGLDevice() != -1 && fSelected)
499  fSelected->ExecuteEvent(event, px, py);*/
500 
501  break; // don't want fPadSave->cd() to be executed at the end
502 
503  case kButton2Motion:
504  //was empty!
505  if (fSelected && fSelected->InheritsFrom("TH2") && !fSelected->InheritsFrom("TH3")) {
506  // implement pan & scan
507  Int_t dX = px - X0; // how far have i moved ?
508  Int_t dY = py - Y0;
509  Int_t dXbins = dX / XbinPixel;
510  Int_t dYbins = dY / YbinPixel;
511  Bool_t changed = kFALSE;
512  Int_t newXfirst = Xfirst0 - dXbins;
513  Int_t newXlast;
514  if (newXfirst < 1) {
515  newXfirst = 1;
516  newXlast = NdisXbins;
517  }
518  else {
519  newXlast = Xlast0 - dXbins;
520  if (newXlast > NXbins) {
521  newXlast = NXbins;
522  newXfirst = newXlast - NdisXbins + 1;
523  }
524  }
525  if (newXfirst != Xf1) {
526  Xf1 = newXfirst;
527  Xl1 = newXlast;
529  changed = kTRUE;
530  }
531  Int_t newYfirst = Yfirst0 - dYbins;
532  Int_t newYlast;
533  if (newYfirst < 1) {
534  newYfirst = 1;
535  newYlast = NdisYbins;
536  }
537  else {
538  newYlast = Ylast0 - dYbins;
539  if (newYlast > NYbins) {
540  newYlast = NYbins;
541  newYfirst = newYlast - NdisYbins + 1;
542  }
543  }
544  if (newYfirst != Yf1) {
545  Yf1 = newYfirst;
546  Yl1 = newYlast;
548  changed = kTRUE;
549  }
550  if (changed) {
551  Modified();
552  Update();
553  }
554  }
555 
556 
557  case kButton2Up:
558  if (fSelected) {
559  gPad = fSelectedPad;
560 
561  if (sendOrder) fSelected->ExecuteEvent(event, px, py);
562  RunAutoExec();
563  }
564  break;
565 
566  case kButton2Double:
567  break;
568 
569  //*-*----------------------------------------------------------------------
570 
571  case kButton3Down:
572  // popup context menu
573  pad = Pick(px, py, prevSelObj);
574  if (!pad) return;
575 
577 
579  if (sendOrder) fContextMenu->Popup(px, py, fSelected, this, pad);
580  else fSelected->ExecuteEvent(event, px, py);
581  }
582 
583  break;
584 
585  case kButton3Motion:
586  break;
587 
588  case kButton3Up:
590  break;
591 
592  case kButton3Double:
593  break;
594 
595  case kKeyDown:
596  // Info("HandleInput","Key down: %d %d",px,py);
597  break;
598 
599  case kKeyUp:
600  // Info("HandleInput","Key up: %d %d",px,py);
601  break;
602 
603  case kKeyPress:
604  if (!fSelectedPad || !fSelected) return;
605  gPad = fSelectedPad; // don't use cd() because we won't draw in pad
606  // we will only use its coordinate system
607  fSelected->ExecuteEvent(event, px, py);
608 
609  HandleKey(px, py);
610  RunAutoExec();
611 
612  break;
613  case kButton1Shift:
614  // Try to select
615  pad = Pick(px, py, prevSelObj);
616 
617  if (!pad) return;
618 
619  EnterLeave(prevSelPad, prevSelObj);
620 
621  gPad = pad; // don't use cd() we will use the current
622  // canvas via the GetCanvas member and not via
623  // gPad->GetCanvas
624  fSelected->ExecuteEvent(event, px, py);
625  RunAutoExec();
626 
627  break;
628  case kWheelUp:
629  case kWheelDown:
630  pad = Pick(px, py, prevSelObj);
631  if (!pad) return;
632 
633  sign = (event == kWheelUp ? 1 : -1);
634 
635  gPad = pad;
636  if (fSelected->InheritsFrom("TAxis")) fSelected->ExecuteEvent(event, px, py);
637  else if (fSelected->InheritsFrom("TH2")) DynamicZoom(sign, px, py);
638 
639  RunAutoExec();
640 
641  break;
642  default:
643  break;
644  }
645 
646  if (fPadSave && event != kButton2Down)
647  fPadSave->cd();
648 
649  if (event != kMouseLeave) { // signal was already emitted for this event
650  ProcessedEvent(event, px, py, fSelected); // emit signal
651  DrawEventStatus(event, px, py, fSelected);
652  }
653 }
654 
655 
656 
658 
660 {
661  if (!TheHisto) return;
662  TAxis* ax = TheHisto->GetXaxis();
663 
664  Double_t ratio1 = (xmin - GetUxmin()) / (GetUxmax() - GetUxmin());
665  Double_t ratio2 = (xmax - GetUxmin()) / (GetUxmax() - GetUxmin());
666  if ((ratio2 - ratio1 > 0.05)) ax->SetRangeUser(xmin, xmax);
667 
668  ax = TheHisto->GetYaxis();
669 
670  ratio1 = (ymin - GetUymin()) / (GetUymax() - GetUymin());
671  ratio2 = (ymax - GetUymin()) / (GetUymax() - GetUymin());
672  if ((ratio2 - ratio1 > 0.05)) ax->SetRangeUser(ymin, ymax);
673 
674  xmax = xmin = ymax = ymin = 0.;
675  return;
676 }
677 
678 
679 
682 
684 {
685  // Zoom in or out of histogram with mouse wheel
686 
687  if (!fSelected) return;
688  TH1* TheHisto = (TH1*) FindHisto();//fSelected;
689 
690  Double_t percent = 0.15 - Sign * 0.05;
691 
692  Int_t dX = 0;
693 
694  px = AbsPixeltoX(px);
695 
696  TAxis* ax = TheHisto->GetXaxis();
697  Int_t NbinsXtmp = ax->GetNbins();
698  Int_t X0tmp = ax->GetFirst();
699  Int_t X1tmp = ax->GetLast();
700  Int_t step = TMath::Min(TMath::Max(1, (Int_t)(percent * (X1tmp - X0tmp))), NbinsXtmp / 2);
701  step *= Sign;
702  X0tmp = TMath::Min(TMath::Max(X0tmp + step, 1), X1tmp - step);
703  X1tmp = TMath::Max(TMath::Min(X1tmp - step, NbinsXtmp), X0tmp);
704  if (X0tmp >= X1tmp) X0tmp = X1tmp - 1;
705  if (Sign > 0) dX = (Int_t)(X0tmp + (X1tmp - X0tmp) * 0.5 - ax->FindBin(px));
706  if ((X0tmp - dX) < 0) ax->SetRange(0, X1tmp - X0tmp);
707  else if ((X1tmp - dX) > ax->GetNbins()) ax->SetRange(ax->GetNbins() - (X1tmp - X0tmp), ax->GetNbins());
708  else ax->SetRange(X0tmp - dX, X1tmp - dX);
709 
710 
711  Modified();
712  Update();
713  return;
714 }
715 
716 
717 
721 
723 {
724  // Zoom in or out of histogram with mouse wheel
725 
726  // Info("DynamicZoom","px=%d py=%d",px,py);
727 
728  if (!fSelected) return;
729  TH2* TheHisto = (TH2*) FindHisto();//fSelected;
730 
731  Double_t percent = 0.15 - Sign * 0.05;
732 
733  Int_t dX = 0;
734  Int_t dY = 0;
735 
736  Double_t ppx = AbsPixeltoX(px);
737  Double_t ppy = AbsPixeltoY(py);
738 
739  TAxis* ax = TheHisto->GetXaxis();
740  Int_t NbinsXtmp = ax->GetNbins();
741  Int_t X0tmp = ax->GetFirst();
742  Int_t X1tmp = ax->GetLast();
743  Int_t step = TMath::Min(TMath::Max(1, (Int_t)(percent * (X1tmp - X0tmp))), NbinsXtmp / 2);
744  step *= Sign;
745  X0tmp = TMath::Min(TMath::Max(X0tmp + step, 1), X1tmp - step);
746  X1tmp = TMath::Max(TMath::Min(X1tmp - step, NbinsXtmp), X0tmp);
747  if (X0tmp >= X1tmp) X0tmp = X1tmp - 1;
748  if (Sign > 0) dX = (Int_t)(X0tmp + (X1tmp - X0tmp) * 0.5 - ax->FindBin(ppx));
749  if ((X0tmp - dX) < 0) ax->SetRange(0, X1tmp - X0tmp);
750  else if ((X1tmp - dX) > ax->GetNbins()) ax->SetRange(ax->GetNbins() - (X1tmp - X0tmp), ax->GetNbins());
751  else ax->SetRange(X0tmp - dX, X1tmp - dX);
752 
753  ax = TheHisto->GetYaxis();
754  Int_t NbinsYtmp = ax->GetNbins();
755  Int_t Y0tmp = ax->GetFirst();
756  Int_t Y1tmp = ax->GetLast();
757  step = TMath::Min(TMath::Max(1, (Int_t)(percent * (Y1tmp - Y0tmp))), NbinsYtmp / 2);
758  step *= Sign;
759  Y0tmp = TMath::Min(TMath::Max(Y0tmp + step, 1), Y1tmp - step);
760  Y1tmp = TMath::Max(TMath::Min(Y1tmp - step, NbinsYtmp), Y0tmp);
761  if (Y0tmp >= Y1tmp) Y0tmp = Y1tmp - 1;
762  if (Sign > 0) dY = (Int_t)(Y0tmp + (Y1tmp - Y0tmp) * 0.5 - ax->FindBin(ppy));
763  if ((Y0tmp - dY) < 0) ax->SetRange(0, Y1tmp - Y0tmp);
764  else if ((Y1tmp - dY) > ax->GetNbins()) ax->SetRange(ax->GetNbins() - (Y1tmp - Y0tmp), ax->GetNbins());
765  else ax->SetRange(Y0tmp - dY, Y1tmp - dY);
766 
767  Modified();
768  Update();
769  return;
770 }
771 
772 
773 
777 
779 {
780  // Handle keys
781 
782 // Info("HandleKey","key pressed : %d %d",px,py);
783 
784  TObject* obj = 0;
785  TIter next(GetListOfPrimitives());
786 
787  if (!fEnabledShortcuts) return kTRUE;
788 
789  if (fSelected->InheritsFrom("TFrame")) fSelected = FindHisto();
790  if (fSelected->InheritsFrom("TH2")) fSelected = FindHisto();
791  if (!fSelected) return kTRUE;
792 
793  switch ((EKeySym)py) {
794  case kKey_F1:
795  break;
796 
797  case kKey_F2:
798  break;
799 
800  case kKey_F3:
801  break;
802 
803  case kKey_F4:
804  break;
805 
806  case kKey_F5:
807  break;
808 
809  case kKey_F6:
810  break;
811 
812  case kKey_F7:
813  break;
814 
815  case kKey_F8:
816  break;
817 
818  case kKey_F9:
819  SetLogx(!fLogx);
820  Modified();
821  Update();
822  break;
823 
824  case kKey_F10:
825  SetLogy(!fLogy);
826  Modified();
827  Update();
828  break;
829 
830  case kKey_F11:
831  SetLogz(!fLogz);
832  Modified();
833  Update();
834  break;
835 
836  case kKey_F12:
837  if (fSelected->InheritsFrom("TH1")) {
838  gPad->cd();
839  ((TH1*)fSelected)->GetXaxis()->UnZoom();
840  ((TH1*)fSelected)->GetYaxis()->UnZoom();
841  Modified();
842  Update();
843  }
844  else if (fSelected->InheritsFrom("TAxis")) {
845  ((TAxis*)fSelected)->UnZoom();
846  Modified();
847  Update();
848  }
849  break;
850 
851  case kKey_a:
852  break;
853 
854  case kKey_b:
855  break;
856 
857  case kKey_c:
858  if (gCopyObject) {
859  gCopyObject->Delete();
860  gCopyObject = 0;
861  }
863 // gCopyObject = fSelected;
864  break;
865 
866  case kKey_d:
867  if (fSelected->InheritsFrom("TF1")) {
868  TH1* hh = 0;
869  if ((hh = FindHisto())) hh->GetListOfFunctions()->Remove(fSelected);
870  }
872  Modified();
873  Update();
874  break;
875 
876  case kKey_e:
877  GetCanvasImp()->ShowEditor(!GetCanvasImp()->HasEditor());
878  break;
879 
880  case kKey_f:
881  if (fSelected->InheritsFrom("TH1"))((TH1*)fSelected)->FitPanel();
882  break;
883 
884  case kKey_g:
885  if (GetGridx() && GetGridy()) {
886  SetGrid(0, 0);
887  while ((obj = next())) {
888  if (obj->InheritsFrom(TPad::Class())) {
889  ((TPad*)obj)->SetGrid(0, 0);
890  }
891  }
892  }
893  else {
894  SetGrid();
895  while ((obj = next())) {
896  if (obj->InheritsFrom(TPad::Class())) {
897  ((TPad*)obj)->SetGrid();
898  }
899  }
900  }
901  Modified();
902  Update();
903  break;
904 
905  case kKey_i:
907  break;
908 
909  case kKey_j:
910  fJPressed = kTRUE;
911  return kTRUE;
912  break;
913 
914  case kKey_l:
915  if (fSelected->InheritsFrom("TH2")) SetLogz(!fLogz);
916  else if (fSelected->InheritsFrom("TH1")) SetLogy(!fLogy);
917  Modified();
918  Update();
919  break;
920 
921  case kKey_n:
922  if (fSelected->InheritsFrom("TH1")) {
923  ((TH1*)fSelected)->Sumw2();
924  ((TH1*)fSelected)->Scale(1. / ((TH1*)fSelected)->Integral());
925  }
926  Modified();
927  Update();
928  break;
929 
930  case kKey_p:
931  fPPressed = kTRUE;
932  return kTRUE;
933  break;
934 
935 // case kKey_q:
936 // Close();
937 // return kTRUE;
938 // break;
939 
940  case kKey_r:
941  if (ExpandFunctionRange()) {
942  Modified();
943  Update();
944  }
945  break;
946 
947  case kKey_s:
948  SaveCanvasAs();
949  break;
950 
951  case kKey_t:
952  break;
953 
954  case kKey_u:
955  Modified();
956  Update();
957  break;
958 
959  case kKey_v:
960  if (gCopyObject) {
961  cd();
962  Modified();
963  Update();
964  TString option = "";
965  if (FindHisto()) option += "same";
966  gCopyObject->Draw(option.Data());
967  Modified();
968  Update();
969  gCopyObject = 0;
970  }
971  break;
972 
973  case kKey_w:
975  break;
976 
977  case kKey_x:
980  if (!fPPressed && !fJPressed) {
983  Modified();
984  Update();
985  }
986  break;
987 
988  case kKey_y:
991  break;
992 
993  case kKey_Left:
994  if (fSelected->InheritsFrom("TAxis")) MoveAxis((TAxis*)fSelected, -1);
995  else if (fSelected->InheritsFrom("TH1")) MoveAxis(FindHisto()->GetXaxis(), -1);
996  break;
997 
998  case kKey_Down:
999  if (fSelected->InheritsFrom("TAxis")) MoveAxis((TAxis*)fSelected, -1);
1000  else if (fSelected->InheritsFrom("TH1")) MoveAxis(FindHisto()->GetYaxis(), -1);
1001  break;
1002 
1003  case kKey_Right:
1004  if (fSelected->InheritsFrom("TAxis")) MoveAxis((TAxis*)fSelected, 1);
1005  else if (fSelected->InheritsFrom("TH1")) MoveAxis(FindHisto()->GetXaxis(), 1);
1006  break;
1007 
1008  case kKey_Up:
1009  if (fSelected->InheritsFrom("TAxis")) MoveAxis((TAxis*)fSelected, 1);
1010  else if (fSelected->InheritsFrom("TH1")) MoveAxis(FindHisto()->GetYaxis(), 1);
1011  break;
1012 
1013  case kKey_Plus:
1014  if (fSelected->InheritsFrom("TH2")) {
1015  ((TH2*)fSelected)->SetMinimum(((TH1*)fSelected)->GetMinimum() + 1);
1016  Modified();
1017  Update();
1018  }
1019  else if (fSelected->InheritsFrom("TF1")) {
1020  ((TF1*)fSelected)->SetNpx(((TF1*)fSelected)->GetNpx() + 50);
1021  Modified();
1022  Update();
1023  }
1024  else if (fSelected->InheritsFrom("TH1")) {
1025  TObject* obj = 0;
1026  TIter it(((TH1*)fSelected)->GetListOfFunctions());
1027  while ((obj = it())) {
1028  ((TF1*)obj)->SetNpx(((TF1*)obj)->GetNpx() + 50);
1029  }
1030  Modified();
1031  Update();
1032  }
1033  break;
1034 
1035  case kKey_Minus:
1036  if (fSelected->InheritsFrom("TH2")) {
1037  if (((TH1*)fSelected)->GetMinimum() > 0)((TH2*)fSelected)->SetMinimum(((TH1*)fSelected)->GetMinimum() - 1);
1038  Modified();
1039  Update();
1040  }
1041  else if (fSelected->InheritsFrom("TF1")) {
1042  ((TF1*)fSelected)->SetNpx(((TF1*)fSelected)->GetNpx() - 50);
1043  Modified();
1044  Update();
1045  }
1046  else if (fSelected->InheritsFrom("TH1")) {
1047  TObject* obj = 0;
1048  TIter it(((TH1*)fSelected)->GetListOfFunctions());
1049  while ((obj = it()))((TF1*)obj)->SetNpx(((TF1*)obj)->GetNpx() - 50);
1050  Modified();
1051  Update();
1052  }
1053  break;
1054 
1055  case kKey_Space:
1056  break;
1057 
1058  default:
1059  fPPressed = kFALSE;
1060  fJPressed = kFALSE;
1061  return kTRUE;
1062  }
1063  fPPressed = kFALSE;
1064  fJPressed = kFALSE;
1065  return kTRUE;
1066 }
1067 
1068 
1069 
1071 
1073 {
1074  Int_t nBins = ax->GetNbins();
1075  Int_t first = ax->GetFirst();
1076  Int_t last = ax->GetLast();
1077 
1078  Int_t dX = (last - first) / 10;
1079  if (dX == 0) dX++;
1080 
1081  if ((last + 2 < nBins) && (sign > 0)) {
1082  ax->SetRange(first + dX, last + dX);
1083  Modified();
1084  Update();
1085  }
1086  if ((first - 2 >= 0) && (sign < 0)) {
1087  ax->SetRange(first - dX, last - dX);
1088  Modified();
1089  Update();
1090  }
1091 }
1092 
1093 
1094 
1096 
1097 void KVCanvas::AddShortcutsInfo(const char* cut, const char* desc)
1098 {
1099  fShortCuts.AddLast(new TNamed(cut, desc));
1100 }
1101 
1102 
1103 
1105 
1107 {
1108  std::cout << std::endl << std::endl;
1109  TNamed* info = 0;
1110  TIter it(&fShortCuts);
1111  while ((info = (TNamed*)it())) {
1112  std::cout << Form("%20s", info->GetName()) << " " << info->GetTitle() << std::endl;
1113  }
1114  std::cout << std::endl;
1115 }
1116 
1117 
1118 
1120 
1122 {
1123  fVenerMode = value;
1124 }
1125 
1126 
1127 
1129 
1131 {
1132  fEnabledShortcuts = 1;
1133  fSavedAs = "";
1134 
1135  AddShortcutsInfo("<ctrl> c", "copy the object under cursor");
1136  AddShortcutsInfo("<ctrl> d", "undraw the object under cursor (object not deleted)");
1137  AddShortcutsInfo("<ctrl> e", "show editor");
1138  AddShortcutsInfo("<ctrl> f", "start fit panel (TH1)");
1139  AddShortcutsInfo("<ctrl> g", "set/unset grid on X and Y axes");
1140  AddShortcutsInfo("<ctrl> i", "show shortcuts infos");
1141  AddShortcutsInfo("<ctrl> j x", "draw projection X (TH2)");
1142  AddShortcutsInfo("<ctrl> j y", "draw projection Y (TH2)");
1143  AddShortcutsInfo("<ctrl> l", "set/unset log scale on Y axis (TH1) or Z axis (TH2)");
1144  AddShortcutsInfo("<ctrl> n", "normalize histogram");
1145  AddShortcutsInfo("<ctrl> p x", "draw profile X (TH2)");
1146  AddShortcutsInfo("<ctrl> p y", "draw profile Y (TH2)");
1147  AddShortcutsInfo("<ctrl> s", "save canvas as");
1148  AddShortcutsInfo("<ctrl> u", "update canvas");
1149  AddShortcutsInfo("<ctrl> v", "paste");
1150  AddShortcutsInfo("<ctrl> w", "set/unset 'Age Of Empire' mode (TH2)");
1151  AddShortcutsInfo("<ctrl> x", "cut the object under cursor");
1152  AddShortcutsInfo("<ctrl> +", "set minimum +1 (TH2)");
1153  AddShortcutsInfo("<ctrl> -", "set minimum -1 (TH2)");
1154  AddShortcutsInfo("F9", "set/unset log scale on X axis");
1155  AddShortcutsInfo("F10", "set/unset log scale on Y axis");
1156  AddShortcutsInfo("F11", "set/unset log scale on Z axis");
1157  AddShortcutsInfo("F12", "unzoom");
1158  AddShortcutsInfo("Arrows", "move on histogram or axis");
1159 }
1160 
1161 
1162 
1164 
1166 {
1167  TObject* pfx = 0;
1168  if ((pfx = FindObject(Form("%s_pfx", hh->GetName())))) pfx->Delete();
1169  hh->ProfileX("_pfx", 1, -1, "i,d,same");
1170  if ((pfx = FindObject(Form("%s_pfx", hh->GetName()))))((TProfile*)pfx)->SetLineColor(kBlack);
1171  Modified();
1172  Update();
1173 }
1174 
1175 
1176 
1178 
1180 {
1181  TObject* obj = 0;
1182  if ((obj = gROOT->FindObject(Form("%s_pfy", hh->GetName())))) obj->Delete();
1183  TProfile* pfy = hh->ProfileY("_pfy", 1, -1, "i");
1185  pfy->Delete();
1187  gr->Delete();
1188  gg->SetName(Form("%s_pfy", hh->GetName()));
1189  gg->SetLineColor(kBlack);
1190  gg->Draw("PEZ");
1191  Modified();
1192  Update();
1193 }
1194 
1195 
1196 
1198 
1200 {
1201 
1202  if (strcmp("", fSavedAs)) {
1203  Int_t ret_val;
1204  TString file = fSavedAs.Data();
1205  file.ReplaceAll(gSystem->DirName(fSavedAs.Data()), "");
1206  file.ReplaceAll("/", "");
1207  new TGMsgBox(gClient->GetDefaultRoot(), gClient->GetDefaultRoot(), "File name exist",
1208  Form("File name '%s' already exists, OK to owerwrite it?", file.Data()),
1209  kMBIconExclamation, kMBOk | kMBCancel, &ret_val);
1210 
1211  if (ret_val & kMBOk) {
1213  return;
1214  }
1215  }
1216 
1217  const char* SaveAsTypes[] = {
1218  "PDF", "*.pdf",
1219  "PostScript", "*.ps",
1220  "Encapsulated PostScript", "*.eps",
1221  "SVG", "*.svg",
1222  "TeX", "*.tex",
1223  "GIF", "*.gif",
1224  "ROOT macros", "*.C",
1225  "ROOT files", "*.root",
1226  "XML", "*.xml",
1227  "PNG", "*.png",
1228  "XPM", "*.xpm",
1229  "JPEG", "*.jpg",
1230  "TIFF", "*.tiff",
1231  "XCF", "*.xcf",
1232  "All files", "*",
1233  0, 0
1234  };
1235 
1236  TString workdir = gSystem->WorkingDirectory();
1237  static TString dir(".");
1238  static Int_t typeidx = 0;
1239  static Bool_t overwr = kFALSE;
1240  TGFileInfo fi;
1241  fi.fFileTypes = SaveAsTypes;
1242  fi.fIniDir = StrDup(dir);
1243  fi.fFileTypeIdx = typeidx;
1244  fi.fOverwrite = overwr;
1245  new TGFileDialog(gClient->GetDefaultRoot(), gClient->GetDefaultRoot(), kFDSave, &fi);
1246  gSystem->ChangeDirectory(workdir.Data());
1247  if (!fi.fFilename) return;
1248  TString fn = fi.fFilename;
1249  dir = fi.fIniDir;
1250  typeidx = fi.fFileTypeIdx;
1251  overwr = fi.fOverwrite;
1252  fCanvas->SaveAs(fn);
1253  fSavedAs = fn;
1254 }
1255 
1256 
1257 
1259 
1261 {
1262  TObject* hh = 0;
1263  TIter it(GetListOfPrimitives());
1264  while ((hh = (TObject*)it())) {
1265  if (hh->InheritsFrom("TH1")) return (TH1*) hh;
1266  }
1267  return 0;
1268 }
1269 
1270 
1271 
1273 
1275 {
1276  Bool_t up = kFALSE;
1277  TH1* hh = FindHisto();
1278  if (!hh) return up;
1279  TObject* obj = 0;
1280  TIter it(hh->GetListOfFunctions());
1281  while ((obj = it())) {
1282  ((TF1*)obj)->SetRange(hh->GetXaxis()->GetXmin(), hh->GetXaxis()->GetXmax());
1283  up = kTRUE;
1284  }
1285  return up;
1286 }
1287 
1288 
1289 
1291 
1293 {
1294  fEnabledShortcuts = value;
1295 }
1296 
1297 
1298 
1300 
1302 {
1303  TString pname = Form("%s_px", hh->GetName());
1304  Int_t ip = 1;
1305  while (gROOT->FindObject(pname.Data())) {
1306  pname = Form("%s_px%d", hh->GetName(), ip);
1307  ip++;
1308  }
1309 
1310  TH1* px = hh->ProjectionX(pname.Data());
1311  if (!px) return;
1312  Double_t minY = (hh->GetYaxis()->GetXmin());
1313  Double_t maxY = (hh->GetYaxis()->GetXmax());
1314  Double_t dY = (maxY - minY) * 0.8;
1315 
1316  Double_t maxH = px->GetBinContent(px->GetMaximumBin());
1317 
1318  TGraph* gg = 0;
1319  if ((gg = (TGraph*)gROOT->FindObject(Form("%s_gjx", hh->GetName())))) gg->Delete();
1320 
1321  gg = new TGraph;
1322  for (int i = 0; i < px->GetNbinsX(); i++) {
1323  gg->SetPoint(i, px->GetBinCenter(i), minY + px->GetBinContent(i)*dY / maxH);
1324  }
1325 
1326  gg->SetName(Form("%s_gjx", hh->GetName()));
1327  gg->SetTitle(Form("%s_gjx", hh->GetName()));
1328  gg->SetLineColor(kBlack);
1329  gg->SetMarkerColor(kBlack);
1330  gg->SetMarkerStyle(8);
1331  gg->Draw("PL");
1332 
1333  Modified();
1334  Update();
1335 }
1336 
1337 
1338 
1340 
1342 {
1343  TString pname = Form("%s_py", hh->GetName());
1344  Int_t ip = 1;
1345 
1346  while (gROOT->FindObject(pname.Data())) {
1347  pname = Form("%s_py%d", hh->GetName(), ip);
1348  ip++;
1349  }
1350 
1351  TH1* py = hh->ProjectionY(pname.Data());
1352  if (!py) return;
1353  Double_t minY = (hh->GetXaxis()->GetXmin());
1354  Double_t maxY = (hh->GetXaxis()->GetXmax());
1355  Double_t dY = (maxY - minY) * 0.8;
1356 
1357  Double_t maxH = py->GetBinContent(py->GetMaximumBin());
1358 
1359  TGraph* gg = 0;
1360  if ((gg = (TGraph*)gROOT->FindObject(Form("%s_gjy", hh->GetName())))) gg->Delete();
1361 
1362  gg = new TGraph;
1363  for (int i = 0; i < py->GetNbinsX(); i++) {
1364  gg->SetPoint(i, minY + py->GetBinContent(i)*dY / maxH, py->GetBinCenter(i));
1365  }
1366 
1367  gg->SetName(Form("%s_gjy", hh->GetName()));
1368  gg->SetTitle(Form("%s_gjy", hh->GetName()));
1369  gg->SetLineColor(kBlack);
1370  gg->SetMarkerColor(kBlack);
1371  gg->SetMarkerStyle(8);
1372  gg->Draw("PL");
1373 
1374  Modified();
1375  Update();
1376 }
1377 
1378 
1379 
1380 
1381 
1382 
1383 
1384 
1385 
1386 
EEventType
kButton1ShiftMotion
kMouseMotion
kWheelUp
kButton3Up
kButton2Motion
kButton3Motion
kButton3Down
kButton2Down
kKeyPress
kButton2Double
kButton1Double
kButton3Double
kButton1Shift
kKeyDown
kButton1Motion
kKeyUp
kButton1Up
kWheelDown
kButton2Up
kMouseLeave
kButton1Down
kMouseEnter
int Int_t
TObject * gCopyObject
Definition: KVCanvas.cpp:23
KVHistoManipulator * gHistoManipulator
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
EKeySym
kKey_Right
kKey_Down
kKey_Space
kKey_F1
kKey_f
kKey_F9
kKey_F4
kKey_F5
kKey_F12
kKey_F6
kKey_F8
kKey_Up
kKey_r
kKey_v
kKey_l
kKey_j
kKey_x
kKey_p
kKey_F3
kKey_Left
kKey_y
kKey_s
kKey_e
kKey_w
kKey_g
kKey_c
kKey_u
kKey_Plus
kKey_t
kKey_i
kKey_a
kKey_F2
kKey_Minus
kKey_d
kKey_F11
kKey_b
kKey_F7
kKey_n
kKey_F10
size_t size(const MatrixT &matrix)
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
kBlack
#define gClient
kFDSave
kMBCancel
kMBOk
kMBIconExclamation
Int_t gDebug
#define gROOT
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
#define gPad
#define gVirtualX
#define snprintf
TCanvas with mouse-controlled dynamic zoom and pan & scan.
Definition: KVCanvas.h:53
void ShowShortcutsInfos()
Definition: KVCanvas.cpp:1106
void ProjectionY(TH2 *hh)
Definition: KVCanvas.cpp:1341
Int_t Xlast0
number of bins on x-axis, initial displayed bins
Definition: KVCanvas.h:62
TString fSavedAs
Definition: KVCanvas.h:80
Bool_t IsLogy()
Definition: KVCanvas.cpp:106
Bool_t IsLogz()
Definition: KVCanvas.cpp:97
void AddShortcutsInfo(const char *cut, const char *desc)
Definition: KVCanvas.cpp:1097
Bool_t fFreezed
Definition: KVCanvas.h:83
void MoveAxis(TAxis *ax, Int_t sign)
Definition: KVCanvas.cpp:1072
Double_t XbinPixel
Definition: KVCanvas.h:65
TList fShortCuts
Definition: KVCanvas.h:78
Double_t ymin
Definition: KVCanvas.h:57
Int_t fEnabledShortcuts
Definition: KVCanvas.h:79
TAxis * theXaxis
Definition: KVCanvas.h:64
Double_t ymax
Definition: KVCanvas.h:57
Int_t Xf1
Definition: KVCanvas.h:66
Bool_t fVenerMode
Definition: KVCanvas.h:72
Bool_t fPPressed
Definition: KVCanvas.h:69
Bool_t ExpandFunctionRange()
Definition: KVCanvas.cpp:1274
void DisableObject(TObject *obj)
Definition: KVCanvas.cpp:170
Double_t oldx
Definition: KVCanvas.h:58
Bool_t IsLogx()
Definition: KVCanvas.cpp:115
void HandleInput(EEventType event, Int_t px, Int_t py)
Definition: KVCanvas.cpp:221
Int_t X0
! variables for pan & scan
Definition: KVCanvas.h:60
void DisableClass(const char *className)
Definition: KVCanvas.cpp:139
KVCanvas()
Definition: KVCanvas.cpp:32
Int_t NdisYbins
number of displayed bins on X & Y
Definition: KVCanvas.h:61
Bool_t fHasDisabledClasses
Definition: KVCanvas.h:73
Int_t NYbins
Definition: KVCanvas.h:63
Bool_t fJPressed
Definition: KVCanvas.h:70
void ResetDisabledObject()
Definition: KVCanvas.cpp:160
void ProfileY(TH2 *hh)
Definition: KVCanvas.cpp:1179
virtual ~KVCanvas()
Definition: KVCanvas.cpp:51
TAxis * theYaxis
the axes of the histogram
Definition: KVCanvas.h:64
void RunAutoExec()
Execute the list of TExecs in the current pad.
Definition: KVCanvas.cpp:125
Int_t Ylast0
number of bins on y-axis, initial displayed bins
Definition: KVCanvas.h:63
Int_t Yfirst0
Definition: KVCanvas.h:63
void SetEnabledShortcuts(Int_t value=1)
Definition: KVCanvas.cpp:1292
TList fDisabledObjects
Definition: KVCanvas.h:77
TString fDisabledClasses
Definition: KVCanvas.h:74
void DrawEventStatus(Int_t event, Int_t px, Int_t py, TObject *selected)
Definition: KVCanvas.cpp:185
void ProfileX(TH2 *hh)
Definition: KVCanvas.cpp:1165
Double_t xmax
Definition: KVCanvas.h:57
void InitInfos()
Definition: KVCanvas.cpp:1130
Int_t NdisXbins
Definition: KVCanvas.h:61
Int_t Yf1
Definition: KVCanvas.h:66
Bool_t fAgeOfEmpire
Definition: KVCanvas.h:71
Double_t xmin
Definition: KVCanvas.h:57
Int_t Xl1
Definition: KVCanvas.h:66
void ZoomSelected(TH2 *TheHisto)
Definition: KVCanvas.cpp:659
void DynamicZoomTH1(Int_t Sign, Int_t px, Int_t py)
Zoom in or out of histogram with mouse wheel.
Definition: KVCanvas.cpp:683
TH1 * FindHisto()
Definition: KVCanvas.cpp:1260
void SetVenerMode(Int_t value=1)
Definition: KVCanvas.cpp:1121
Double_t oldy
Definition: KVCanvas.h:58
Double_t YbinPixel
size of bins in pixels
Definition: KVCanvas.h:65
Int_t Xfirst0
Definition: KVCanvas.h:62
virtual Bool_t HandleKey(Int_t, Int_t py)
virtual Bool_t HandleKey(Event_t* /*event*‍/){return kTRUE;}
Definition: KVCanvas.cpp:778
void DynamicZoom(Int_t Sign, Int_t px, Int_t py)
Definition: KVCanvas.cpp:722
void ResetDisabledClass()
Definition: KVCanvas.cpp:150
Int_t Y0
coordinates of initial click in pad pixels
Definition: KVCanvas.h:60
Int_t Yl1
last modification to axis limits
Definition: KVCanvas.h:66
void SaveCanvasAs()
Definition: KVCanvas.cpp:1199
Int_t NXbins
Definition: KVCanvas.h:62
Bool_t fHasDisabledObject
Definition: KVCanvas.h:75
void ProjectionX(TH2 *hh)
Definition: KVCanvas.cpp:1301
Bool_t moved
Definition: KVCanvas.h:68
TGraphErrors * MakeGraphFrom(TProfile *pf, Bool_t Error=kTRUE)
Utility class to redirect keyboard events to KVCanvas.
Definition: KVKeyHandler.h:19
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual Int_t FindBin(const char *label)
Double_t GetXmax() const
Int_t GetLast() const
Double_t GetXmin() const
Int_t GetNbins() const
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
virtual void SetRange(Int_t first=0, Int_t last=0)
Int_t GetFirst() const
virtual void ShowEditor(Bool_t show=kTRUE)
virtual void SetStatusText(const char *text=0, Int_t partidx=0)
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
TPad * fPadSave
Int_t GetEventY() const override
Int_t fEventX
TCanvasImp * GetCanvasImp() const override
virtual TPad * Pick(Int_t px, Int_t py, TObject *prevSelObj)
virtual void ProcessedEvent(Int_t event, Int_t x, Int_t y, TObject *selected)
Int_t GetEventX() const override
Int_t fEventY
TVirtualPad * cd(Int_t subpadnumber=0) override
TPad * fSelectedPad
TObject * fSelected
TContextMenu * fContextMenu
void FeedbackMode(Bool_t set)
TVirtualPad * GetSelectedPad() const override
void Update() override
TCanvasImp * fCanvasImp
Int_t fDoubleBuffer
Int_t fEvent
Bool_t Contains(const char *name) const
virtual void Popup(Int_t x, Int_t y, TObject *obj, TBrowser *b)
char * fFilename
Int_t fFileTypeIdx
const char ** fFileTypes
char * fIniDir
Bool_t fOverwrite
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual void SetName(const char *name="")
virtual void SetTitle(const char *title="")
virtual void Draw(Option_t *chopt="")
virtual Double_t GetBinCenter(Int_t bin) const
TAxis * GetXaxis()
TList * GetListOfFunctions() const
TAxis * GetYaxis()
virtual Int_t GetNbinsX() const
virtual Int_t GetMaximumBin() const
virtual Double_t GetBinContent(Int_t bin) const
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
TProfile * ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const
TProfile * ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
TObject * Remove(const TObjLinkPtr_t &lnk)
virtual void AddLast(TObject *obj)
virtual void Clear(Option_t *option="")
virtual const char * GetName() const
virtual const char * GetTitle() const
virtual const char * GetName() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * Clone(const char *newname="") const
virtual const char * ClassName() const
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual void Delete(Option_t *option="")
virtual Bool_t InheritsFrom(const char *classname) const
virtual const char * GetTitle() const
virtual void Draw(Option_t *option="")
virtual void Pop()
const char * GetTitle() const override
Double_t AbsPixeltoY(Int_t py) override
Double_t GetUymax() const override
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
Double_t GetUxmax() const override
Bool_t GetGridx() const override
void SetLogz(Int_t value=1) override
Double_t GetUymin() const override
Int_t fLogz
Double_t AbsPixeltoX(Int_t px) override
void Modified(Bool_t flag=1) override
void SetLogy(Int_t value=1) override
TCanvas * fCanvas
Double_t GetUxmin() const override
Bool_t GetGridy() const override
Int_t fLogx
Int_t YtoAbsPixel(Double_t y) const override
const char * GetName() const override
void SaveAs(const char *filename="", Option_t *option="") const override
TObject * FindObject(const char *name) const override
TVirtualPad * cd(Int_t subpadnumber=0) override
Int_t fLogy
void SetLogx(Int_t value=1) override
Int_t XtoAbsPixel(Double_t x) const override
TList * GetListOfPrimitives() const override
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * DirName(const char *pathname)
virtual Bool_t ChangeDirectory(const char *path)
virtual const char * WorkingDirectory()
int Sign(const T &x)
TGraphErrors * gr
Double_t Min(Double_t a, Double_t b)
Int_t Nint(T x)
Double_t Sign(Double_t a, Double_t b)
Double_t Abs(Double_t d)
Double_t Max(Double_t a, Double_t b)