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