Logo ROOT  
Reference Guide
TH2Editor.cxx
Go to the documentation of this file.
1 // @(#)root/ged:$Id$
2 // Author: Carsten Hof 09/08/04
3 // Authors mail: Carsten_Hof@web.de
4 
5 /*************************************************************************
6  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 //////////////////////////////////////////////////////////////////////////
14 // //
15 // TH2Editor //
16 // Editor for changing TH2 histogram attributes, rebinning & fitting. //
17 // For all possible draw options (there are a few which are not imple- //
18 // mentable in a graphical user interface) see THistPainter::Paint in //
19 // root/histpainter/THistPainter.cxx //
20 //
21 //Begin_Html
22 /*
23 <img src="gif/TH2Editor_1.gif">
24 */
25 //End_Html
26 //Begin_Html
27 /*
28 <img src="gif/TH2Editor_2.gif">
29 */
30 //End_Html
31 // These changes can be made via the TH2Editor: //
32 // Style Tab: //
33 // 'Line' : change Line attributes (color, thickness) //
34 // see TAttLineEditor //
35 // 'Fill' : change Fill attributes (color, pattern) //
36 // see TAttFillEditor //
37 // 'Title' : TextEntry: set the title of the histogram //
38 // 'Histogram': change the draw options of the histogram //
39 // 'Plot' : Radiobutton: draw a 2D or 3D plot of the histogram //
40 // according to the Plot dimension there will be //
41 // different drawing possibilities (ComboBoxes/ //
42 // CheckBoxes) //
43 // 2d Plot: //
44 // 'Contour' : ComboBox: draw a contour plot (None, Cont0..4) //
45 // 'Cont #' : TGNumberEntry: set the number of Contours //
46 // 2d Plot checkboxes: //
47 // 'Arrow' : arrow mode. Shows gradient between adjacent cells //
48 // 'Col' : a box is drawn for each cell with a color scale //
49 // varying with contents //
50 // 'Text' : Draw bin contents as text //
51 // 'Box' : a box is drawn for each cell with surface //
52 // proportional to contents //
53 // 'Scat' : Draw a scatter-plot (default) //
54 // 'Palette' : the color palette is drawn //
55 // //
56 // 3d Plot: //
57 // 'Type' : ComboBox: set histogram type Lego or Surface-Plot //
58 // draw(Lego, Lego1..4, Surf, Surf1..5) //
59 // see THistPainter::Paint //
60 // 'Coords' : ComboBox: set the coordinate system (Cartesian, .. //
61 // Spheric) see THistPainter::Paint //
62 // 'Cont #' : TGNumberEntry: set the number of Contours (for e.g. //
63 // Lego2 drawoption //
64 // 3d Plot checkboxes: //
65 // 'Errors' : draw errors in a cartesian lego plot //
66 // 'Palette' : the color palette is drawn //
67 // 'Front' : draw the front box of a cartesian lego plot //
68 // 'Back' : draw the back box of a cartesian lego plot //
69 // Available for a 3D lego plot: //
70 // 'Bar' : change the bar attributes //
71 // 'W' : change Bar Width //
72 // 'O' : change Bar Offset //
73 // Further Editor: //
74 // 'Marker' : change the Marker attributes (color, appearance, //
75 // thickness) see TAttMarkerEditor //
76 // //
77 //Begin_Html
78 /*
79 <img src="gif/TH2Editor1_1.gif">
80 */
81 //End_Html
82 //Begin_Html
83 /*
84 <img src="gif/TH2Editor1_2.gif">
85 */
86 //End_Html
87 // //
88 // Rebinning Tab: //
89 // This Tab has two different layouts. One is for a histogram which//
90 // is not drawn from an ntuple. The other one is available for a //
91 // histogram which is drawn from an ntuple. In this case the rebin //
92 // algorithm can create a rebinned histogram from the original data//
93 // i.e. the ntuple. //
94 // To see te differences do for example: //
95 // TFile f("hsimple.root"); //
96 // hpxpy->Draw("Lego2"); // non ntuple histogram //
97 // ntuple->Draw("px:py","","Lego2"); // ntuple histogram //
98 // Non ntuple histogram: //
99 // 'Rebin': with the Sliders (one for the x, one for the y axis) //
100 // the number of bins (shown in the field below the //
101 // Slider) can be changed to any number which divides //
102 // the number of bins of the original histogram. //
103 // Pushing 'Apply' will delete the origin histogram and //
104 // replace it by the rebinned one on the screen. //
105 // Pushing 'Ignore' the origin histogram will be restored//
106 // Histogram drawn from an ntuple: //
107 // 'Rebin' with the sliders the number of bins can be enlarged by//
108 // a factor of 2,3,4,5 (moving to the right) or reduced //
109 // by a factor of 1/2, 1/3, 1/4, 1/5 //
110 // 'BinOffset': with the BinOffset slider the origin of the //
111 // histogram can be changed within one binwidth //
112 // Using this slider the effect of binning the data into //
113 // bins can be made visible => statistical fluctuations //
114 // 'Axis Range': with the DoubleSlider it is possible to zoom into//
115 // the specified axis range. It is also possible to set //
116 // the upper and lower limit in fields below the slider //
117 // 'Delayed drawing': all the Binning sliders can be set to delay //
118 // draw mode. Then the changes on the histogram are only //
119 // updated, when the Slider is released. This should be //
120 // activated if the redrawing of the histogram is too //
121 // time consuming. //
122 //////////////////////////////////////////////////////////////////////////
123 
124 
125 #include "TH2Editor.h"
126 #include "TGedEditor.h"
127 #include "TGComboBox.h"
128 #include "TGTextEntry.h"
129 #include "TGLabel.h"
130 #include "TVirtualPad.h"
131 #include "TString.h"
132 #include "TGButtonGroup.h"
133 #include "TGNumberEntry.h"
134 #include "TG3DLine.h"
135 #include "TGDoubleSlider.h"
136 #include "TGSlider.h"
137 #include "TView.h"
138 #include "TCanvas.h"
139 #include "TGedPatternSelect.h"
140 #include "TGColorSelect.h"
141 #include "TColor.h"
142 #include "TTreePlayer.h"
143 #include "TSelectorDraw.h"
144 #include "TGTab.h"
145 #include "TGMsgBox.h"
146 #include "TH2.h"
147 #include "TROOT.h"
148 #include "TVirtualX.h"
149 
150 
152 
153 enum ETH2Wid {
154  kTH2_TITLE,
169 };
170 
171 ////////////////////////////////////////////////////////////////////////////////
172 /// Constructor of histogram attribute GUI.
173 
175  Int_t height, UInt_t options, Pixel_t back)
176  : TGedFrame(p, width, height, options | kVerticalFrame, back),
177  fHist(0),
178  fBin(0),
179  fBinHist(0)
180 {
181  MakeTitle("Title");
182 
183  // Histogram title
184  fTitlePrec = 2;
185  fTitle = new TGTextEntry(this, new TGTextBuffer(50), kTH2_TITLE);
186  fTitle->Resize(135, fTitle->GetDefaultHeight());
187  fTitle->SetToolTipText("Enter the histogram title string");
188  AddFrame(fTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
189 
190 
191  // 2D or 3D Plot?
192  TGCompositeFrame *f2 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
193  fDimGroup = new TGHButtonGroup(f2,"Plot");
194  fDim = new TGRadioButton(fDimGroup,"2-D",kDIM_SIMPLE);
195  fDim->SetToolTipText("A 2-d plot of the histogram is dawn");
196  fDim0 = new TGRadioButton(fDimGroup,"3-D",kDIM_COMPLEX);
197  fDim0->SetToolTipText("A 3-d plot of the histogram is dawn");
198  fDimGroup->SetLayoutHints(fDimlh=new TGLayoutHints(kLHintsLeft ,-2,3,3,-7),fDim);
199  fDimGroup->SetLayoutHints(fDim0lh=new TGLayoutHints(kLHintsLeft ,16,-1,3,-7),fDim0);
200  fDimGroup->Show();
201  fDimGroup->ChangeOptions(kFitWidth|kChildFrame|kHorizontalFrame);
202  f2->AddFrame(fDimGroup, new TGLayoutHints(kLHintsTop, 4, 1, 0, 0));
203  AddFrame(f2, new TGLayoutHints(kLHintsTop, 1, 1, 2, 5));
204 
205  // 2D Plot drawoptions
206  f6 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
207  AddFrame(f6, new TGLayoutHints(kLHintsTop, 3, 1, 4, 2));
208 
209  TGCompositeFrame *f7 = new TGCompositeFrame(f6, 40, 20);
210  f6->AddFrame(f7, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
211 
212  TGLabel *fAddLabel = new TGLabel(f7, "Contour:");
213  f7->AddFrame(fAddLabel, new TGLayoutHints(kLHintsLeft, 6, 4, 4, 4));
214 
215  fColContLbl = new TGLabel(f7, "Cont #:");
216  f7->AddFrame(fColContLbl, new TGLayoutHints( kLHintsLeft, 6, 4, 4, 4));
217 
218  fAddArr = new TGCheckButton(f7, "Arrow", kARROW_ONOFF);
219  fAddArr ->SetToolTipText("Shows gradient between adjacent cells");
220  f7->AddFrame(fAddArr, new TGLayoutHints(kLHintsLeft, 6, 1, 2, 0));
221 
222  fAddCol = new TGCheckButton(f7, "Col", kCOL_ONOFF);
223  fAddCol ->SetToolTipText("A box is drawn for each cell with a color scale varying with contents");
224  f7->AddFrame(fAddCol, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
225 
226  fAddText = new TGCheckButton(f7, "Text", kTEXT_ONOFF);
227  fAddText ->SetToolTipText("Draw bin contents as text");
228  f7->AddFrame(fAddText, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 3));
229 
230  TGCompositeFrame *f8 = new TGCompositeFrame(f6, 40, 20, kVerticalFrame);
231  f6->AddFrame(f8, new TGLayoutHints(kLHintsLeft, 5, 1, 0, 0));
232 
233  fContCombo = BuildHistContComboBox(f8, kCONT_TYPE);
234  f8->AddFrame(fContCombo, new TGLayoutHints(kLHintsLeft, 6, 1, 2, 1));
235  fContCombo->Resize(61, 20);
236  fContCombo->Associate(this);
237 
238  fContLevels = new TGNumberEntry(f8, 20, 0, kCONT_LEVELS,
242  f8->AddFrame(fContLevels, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
243  fContLevels->GetNumberEntry()->SetToolTipText("Set number of contours (1..99)");
244  fContLevels->Resize(60,20);
245 
246  fAddBox = new TGCheckButton(f8, "Box", kBOX_ONOFF);
247  fAddBox ->SetToolTipText("A box is drawn for each cell with surface proportional to contents");
248  f8->AddFrame(fAddBox, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 0));
249 
250  fAddScat = new TGCheckButton(f8, "Scat", kSCAT_ONOFF);
251  fAddScat ->SetToolTipText("Draw a scatter-plot");
252  f8->AddFrame(fAddScat, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
253 
254  fAddPalette = new TGCheckButton(f8, "Palette", kPALETTE_ONOFF);
255  fAddPalette ->SetToolTipText("Add color palette beside the histogram");
256  f8->AddFrame(fAddPalette, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
257 
258  f9 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
259  AddFrame(f9, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
260 
261  TGCompositeFrame *f10 = new TGCompositeFrame(f9, 40, 20);
262  f9->AddFrame(f10, new TGLayoutHints(kLHintsLeft, 0, 0, 3, 0));
263 
264  TGLabel *fType = new TGLabel(f10, "Type:");
265  f10->AddFrame(fType, new TGLayoutHints(kLHintsNormal, 1, 1, 1, 1));
266 
267  TGLabel *fCoords = new TGLabel(f10, "Coords:");
268  f10->AddFrame(fCoords, new TGLayoutHints(kLHintsLeft, 1, 1, 5, 1));
269 
270  fColContLbl1 = new TGLabel(f10, "Cont #:");
271  f10->AddFrame(fColContLbl1, new TGLayoutHints( kLHintsLeft, 1, 1, 5, 3));
272 
273  fAddFB = new TGCheckButton(f10, "Front", kFRONTBOX_ONOFF);
274  fAddFB ->SetToolTipText("Supress the drawing of the front box");
275  f10->AddFrame(fAddFB, new TGLayoutHints(kLHintsLeft, 0, 1, 6, 0));
276  fAddBB = new TGCheckButton(f10, "Back", kBACKBOX_ONOFF);
277  fAddBB ->SetToolTipText("Supress the drawing of the back box");
278  f10->AddFrame(fAddBB, new TGLayoutHints(kLHintsLeft, 0, 1, 3, 0));
279 
280  TGCompositeFrame *f11 = new TGCompositeFrame(f9, 40, 20);
281  f9->AddFrame(f11, new TGLayoutHints(kLHintsLeft, 5, 1, 0, 0));
282 
283  fTypeCombo = BuildHistTypeComboBox(f11, kHIST_TYPE);
284  f11->AddFrame(fTypeCombo, new TGLayoutHints(kLHintsLeft, 0, 1, 2, 1));
285  fTypeCombo->Resize(80, 20);
286  fTypeCombo->Associate(this);
287 
288  fCoordsCombo = BuildHistCoordsComboBox(f11, kCOORD_TYPE);
289  f11->AddFrame(fCoordsCombo, new TGLayoutHints(kLHintsLeft, 0, 1, 2, 1));
290  fCoordsCombo->Resize(80, 20);
291  fCoordsCombo->Associate(this);
292 
293  fContLevels1 = new TGNumberEntry(f11, 20, 0, kCONT_LEVELS1,
297  fContLevels1->GetNumberEntry()->SetToolTipText("Set number of contours (1..99)");
298  fContLevels1->Resize(78,20);
299  f11->AddFrame(fContLevels1, new TGLayoutHints(kLHintsLeft, 0, 1, 2, 1));
300 
301  fAddError = new TGCheckButton(f11, "Errors", kERROR_ONOFF);
302  fAddError ->SetToolTipText("Add color palette beside the histogram");
303  f11->AddFrame(fAddError, new TGLayoutHints(kLHintsLeft, 0, 1, 4, 0));
304  fAddPalette1 = new TGCheckButton(f11, "Palette", kPALETTE_ONOFF1);
305  fAddPalette1 ->SetToolTipText("Add color palette beside the histogram");
306  f11->AddFrame(fAddPalette1, new TGLayoutHints(kLHintsLeft, 0, 1, 3, 0));
307 
308 
309  // Bin bar settings
310  f12 = new TGCompositeFrame(this, 145, 10, kHorizontalFrame |
312  kFixedWidth |
314  f12->AddFrame(new TGLabel(f12,"Bar"),
315  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
316  f12->AddFrame(new TGHorizontal3DLine(f12),
317  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
318  AddFrame(f12, new TGLayoutHints(kLHintsTop,0,0,6,4));
319 
320  f13 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
321  TGLabel *fWidthLbl = new TGLabel(f13, "W:");
322  f13->AddFrame(fWidthLbl, new TGLayoutHints( kLHintsLeft, 1, 3, 4, 1));
323  fBarWidth = new TGNumberEntry(f13, 1.00, 6, kBAR_WIDTH,
327  fBarWidth->GetNumberEntry()->SetToolTipText("Set bar chart width");
328  fBarWidth->Resize(45,20);
329  f13->AddFrame(fBarWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 1));
330 
331  TGLabel *fOffsetLbl = new TGLabel(f13, "O:");
332  f13->AddFrame(fOffsetLbl, new TGLayoutHints(kLHintsLeft, 6,3, 4, 1));
333  fBarOffset = new TGNumberEntry(f13, 0.00, 5, kBAR_OFFSET,
337  fBarOffset->GetNumberEntry()->SetToolTipText("Set bar chart offset");
338  fBarOffset->Resize(50,20);
339  f13->AddFrame(fBarOffset, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 1));
340  AddFrame(f13, new TGLayoutHints(kLHintsTop, 1, 1, 0, 4));
341 
342 
343  // Set the color and pattern of the Frame (only for Cartesian 3D plot).
344  f38 = new TGCompositeFrame(this, 80, 20, kVerticalFrame);
345  TGCompositeFrame *f39 = new TGCompositeFrame(f38, 145, 10, kHorizontalFrame |
347  kFixedWidth |
349  f39->AddFrame(new TGLabel(f39,"Frame Fill"),
350  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
351  f39->AddFrame(new TGHorizontal3DLine(f39),
352  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
353  f38->AddFrame(f39, new TGLayoutHints(kLHintsTop,0,0,6,1));
354 
355  TGCompositeFrame *f21 = new TGCompositeFrame(f38, 80, 20, kHorizontalFrame);
356  fFrameColor = new TGColorSelect(f21, 0, kCOLOR);
357  f21->AddFrame(fFrameColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 0));
358  fFrameColor->Associate(f38);
359  fFramePattern = new TGedPatternSelect(f21, 1, kPATTERN);
360  f21->AddFrame(fFramePattern, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 0));
361  fFramePattern->Associate(f38);
362  f38->AddFrame(f21, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
363  AddFrame(f38, new TGLayoutHints(kLHintsTop));
364 
365  fCutString = "";
366 
367  CreateBinTab();
368 
369  // add itself in the least of cleanups to be notified when attached histogram is deleted
370  gROOT->GetListOfCleanups()->Add(this);
371 }
372 
373 ////////////////////////////////////////////////////////////////////////////////
374 /// Create the Binning tab.
375 
377 {
378  fBin = CreateEditorTabSubFrame("Binning");
379 
380  // Editor for rebinning a histogram which does NOT derive from an Ntuple
382  TGCompositeFrame *title1 = new TGCompositeFrame(fBinXCont, 145, 10,
385  kFixedWidth |
387  title1->AddFrame(new TGLabel(title1, "Rebin"),
388  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
389  title1->AddFrame(new TGHorizontal3DLine(title1),
390  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
391  fBinXCont->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
392 
393  TGCompositeFrame *f22 = new TGCompositeFrame(fBinXCont, 80, 20,
395  TGLabel *binSliderXLbl = new TGLabel(f22,"x:");
396  f22->AddFrame(binSliderXLbl,
397  new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4,0, 4, 1));
398  fBinXSlider = new TGHSlider(f22, 100, kSlider1 | kScaleBoth);
399  fBinXSlider->Resize(107,20);
400  f22->AddFrame(fBinXSlider, new TGLayoutHints(kLHintsLeft, 2,0,0,3));
401  fBinXCont->AddFrame(f22, new TGLayoutHints(kLHintsTop, 3, 7, 3, 5));
402 
403  TGCompositeFrame *f23 = new TGCompositeFrame(fBinXCont, 80, 20,
405  TGLabel *binXLabel1 = new TGLabel(f23, "# of Bins:");
406  f23->AddFrame(binXLabel1, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 1));
409  ((TGTextEntry*)fBinXNumberEntry)->SetToolTipText("Set the number of x axis bins in the rebinned histogram");
410  fBinXNumberEntry->Resize(57,20);
411  f23->AddFrame(fBinXNumberEntry, new TGLayoutHints(kLHintsRight, 8, 0, 0, 0));
412  fBinXCont->AddFrame(f23, new TGLayoutHints(kLHintsTop, 0, 7, 3, 4));
413 
414  TGCompositeFrame *f37 = new TGCompositeFrame(fBinXCont, 80, 20,
416  TGLabel *binSliderYLbl = new TGLabel(f37,"y:");
417  f37->AddFrame(binSliderYLbl,
418  new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4,0, 4, 1));
419  fBinYSlider = new TGHSlider(f37, 100, kSlider1 | kScaleBoth);
420  fBinYSlider->Resize(107,20);
421  f37->AddFrame(fBinYSlider, new TGLayoutHints(kLHintsLeft, 1,0,0,3));
422  fBinXCont->AddFrame(f37, new TGLayoutHints(kLHintsTop, 3, 7, 3, 5));
423 
424  TGCompositeFrame *f36 = new TGCompositeFrame(fBinXCont, 80, 20,
426  TGLabel *binYLabel1 = new TGLabel(f36, "# of Bins:");
427  f36->AddFrame(binYLabel1, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 1));
430  ((TGTextEntry*)fBinYNumberEntry)->SetToolTipText("Set the number of y axis bins in the rebinned histogram");
431  fBinYNumberEntry->Resize(57,20);
432  f36->AddFrame(fBinYNumberEntry, new TGLayoutHints(kLHintsRight, 8, 0, 0, 0));
433  fBinXCont->AddFrame(f36, new TGLayoutHints(kLHintsTop, 0, 7, 3, 4));
434 
435  // Text buttons Apply & Ignore for rebinned histogram shown on the screen.
436  TGCompositeFrame *f24 = new TGCompositeFrame(fBinXCont, 118, 20,
438  kFixedWidth);
439  fApply = new TGTextButton(f24, " &Apply ");
440  f24->AddFrame(fApply,
441  new TGLayoutHints(kLHintsExpandX | kLHintsLeft ,0, 3, 4, 4));
442  fCancel = new TGTextButton(f24, " &Ignore ");
443  f24->AddFrame(fCancel,
444  new TGLayoutHints(kLHintsExpandX | kLHintsLeft, 3, 0, 4, 4));
445  fBinXCont->AddFrame(f24, new TGLayoutHints(kLHintsTop, 20, 3, 3, 4));
447 
448  // Widgets for rebinning a histogram which derives from an Ntuple
449 
451  TGCompositeFrame *title2 = new TGCompositeFrame(fBinXCont1, 145, 10,
454  kFixedWidth |
456  title2->AddFrame(new TGLabel(title2, "X-Axis"),
457  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
458  title2->AddFrame(new TGHorizontal3DLine(title2),
459  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
460  fBinXCont1->AddFrame(title2, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
461 
462  TGCompositeFrame *f26 = new TGCompositeFrame(fBinXCont1, 80, 20,
464  fBinXSlider1 = new TGHSlider(f26, 100, kSlider1 | kScaleBoth);
465  fBinXSlider1->Resize(120,20);
466  fBinXSlider1->SetRange(1,9);
467  fBinXSlider1->SetScale(14);
469  f26->AddFrame(fBinXSlider1, new TGLayoutHints(kLHintsLeft, 2,0,0,0));
470  fBinXCont1->AddFrame(f26, new TGLayoutHints(kLHintsTop, 3, 7, 3, 0));
471 
472  // Lettering of the Rebin Slider
473  TGCompositeFrame *f27 = new TGCompositeFrame(fBinXCont1, 80, 20,
475  TGLabel *l1 = new TGLabel(f27, "-5");
476  f27->AddFrame(l1, new TGLayoutHints(kLHintsLeft, 5, 1, -1, 0));
477  TGLabel *l2 = new TGLabel(f27, "-2");
478  f27->AddFrame(l2, new TGLayoutHints(kLHintsLeft, 31, 2, -1, 0));
479  TGLabel *l3 = new TGLabel(f27, "2");
480  f27->AddFrame(l3, new TGLayoutHints(kLHintsLeft, 21, 2, -1, 0));
481  TGLabel *l4 = new TGLabel(f27, "5");
482  f27->AddFrame(l4, new TGLayoutHints(kLHintsLeft, 36, 3, -1, 0));
483  fBinXCont1->AddFrame(f27, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
484 
485  TGCompositeFrame *f28 = new TGCompositeFrame(fBinXCont1, 140, 20,
487  TGLabel *binXLabel2 = new TGLabel(f28, "# of Bins:");
488  f28->AddFrame(binXLabel2, new TGLayoutHints(kLHintsLeft, 8, 1, 4, 1));
489 
492  ((TGTextEntry*)fBinXNumberEntry1)->SetToolTipText("Set the number of x axis bins in the rebinned histogram");
493  fBinXNumberEntry1->Resize(57,20);
495  new TGLayoutHints(kLHintsLeft, 21, 0, 2, 0));
496  fBinXCont1->AddFrame(f28, new TGLayoutHints(kLHintsTop, 0, 7, 2, 4));
497 
498  TGCompositeFrame *f29 = new TGCompositeFrame(fBinXCont1, 80, 20,
500  TGLabel *xOffsetLbl = new TGLabel(f29, "BinOffset:");
501  f29->AddFrame(xOffsetLbl, new TGLayoutHints(kLHintsLeft, 7, 1, 2, 1));
506  0., 1.);
507  ((TGTextEntry*)fXOffsetNumberEntry)->SetToolTipText("Add an x-offset to the origin of the histogram");
508  fXOffsetNumberEntry->Resize(57,20);
510  new TGLayoutHints(kLHintsRight, 21, 0, 0, 0));
511  fBinXCont1->AddFrame(f29, new TGLayoutHints(kLHintsTop, 0, 7, 3, 1));
512 
513  TGCompositeFrame *f30 = new TGCompositeFrame(fBinXCont1, 80, 20,
515  fXBinOffsetSld = new TGHSlider(f30, 100, kSlider1 | kScaleBoth);
516  fXBinOffsetSld->Resize(120,20);
517  f30->AddFrame(fXBinOffsetSld, new TGLayoutHints(kLHintsLeft, 2,0,0,0));
518  fBinXCont1->AddFrame(f30, new TGLayoutHints(kLHintsTop, 3, 7, 3, 3));
520 
521  // Same for Y-Axis:
522  // Widgets for rebinning a histogram which derives from an Ntuple
523 
525  TGCompositeFrame *title3 = new TGCompositeFrame(fBinYCont1, 145, 10,
528  kFixedWidth |
530  title3->AddFrame(new TGLabel(title3, "Y-Axis"),
531  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
532  title3->AddFrame(new TGHorizontal3DLine(title3),
533  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
534  fBinYCont1->AddFrame(title3, new TGLayoutHints(kLHintsTop, 0, 0, 7, 0));
535 
536  TGCompositeFrame *f31 = new TGCompositeFrame(fBinYCont1, 80, 20,
538  fBinYSlider1 = new TGHSlider(f31, 100, kSlider1 | kScaleBoth);
539  fBinYSlider1->Resize(120,20);
540  fBinYSlider1->SetRange(1,9);
541  fBinYSlider1->SetScale(14);
543  f31->AddFrame(fBinYSlider1, new TGLayoutHints(kLHintsLeft, 2,0,0,0));
544  fBinYCont1->AddFrame(f31, new TGLayoutHints(kLHintsTop, 3, 7, 3, 0));
545 
546  // Lettering of the Rebin Slider
547  TGCompositeFrame *f32 = new TGCompositeFrame(fBinYCont1, 80, 20,
549  TGLabel *l5 = new TGLabel(f32, "-5");
550  f32->AddFrame(l5, new TGLayoutHints(kLHintsLeft, 5, 1, -1, 0));
551  TGLabel *l6 = new TGLabel(f32, "-2");
552  f32->AddFrame(l6, new TGLayoutHints(kLHintsLeft, 31, 2, -1, 0));
553  TGLabel *l7 = new TGLabel(f32, "2");
554  f32->AddFrame(l7, new TGLayoutHints(kLHintsLeft, 21, 2, -1, 0));
555  TGLabel *l8 = new TGLabel(f32, "5");
556  f32->AddFrame(l8, new TGLayoutHints(kLHintsLeft, 36, 3, -1, 0));
557  fBinYCont1->AddFrame(f32, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
558 
559  TGCompositeFrame *f33 = new TGCompositeFrame(fBinYCont1, 140, 20,
561  TGLabel *binYLabel2 = new TGLabel(f33, "# of Bins:");
562  f33->AddFrame(binYLabel2, new TGLayoutHints(kLHintsLeft, 8, 1, 4, 1));
563 
566  ((TGTextEntry*)fBinYNumberEntry1)->SetToolTipText("Set the number of Y axis bins in the rebinned histogram");
567  fBinYNumberEntry1->Resize(57,20);
569  new TGLayoutHints(kLHintsLeft, 21, 0, 2, 0));
570  fBinYCont1->AddFrame(f33, new TGLayoutHints(kLHintsTop, 0, 7, 2, 4));
571 
572  TGCompositeFrame *f34 = new TGCompositeFrame(fBinYCont1, 80, 20,
574  TGLabel *yOffsetLbl = new TGLabel(f34, "BinOffset:");
575  f34->AddFrame(yOffsetLbl, new TGLayoutHints(kLHintsLeft, 7, 1, 2, 1));
580  0., 1.);
581  ((TGTextEntry*)fYOffsetNumberEntry)->SetToolTipText("Add an Y-offset to the origin of the histogram");
582  fYOffsetNumberEntry->Resize(57,20);
584  new TGLayoutHints(kLHintsRight, 21, 0, 0, 0));
585  fBinYCont1->AddFrame(f34, new TGLayoutHints(kLHintsTop, 0, 7, 3, 1));
586 
587  TGCompositeFrame *f35 = new TGCompositeFrame(fBinYCont1, 80, 20,
589  fYBinOffsetSld = new TGHSlider(f35, 100, kSlider1 | kScaleBoth);
590  fYBinOffsetSld->Resize(120,20);
592  f35->AddFrame(fYBinOffsetSld, new TGLayoutHints(kLHintsLeft, 2,0,0,0));
593  fBinYCont1->AddFrame(f35, new TGLayoutHints(kLHintsTop, 3, 7, 3, 3));
595 
596  // Axis ranges
597  TGCompositeFrame *title4 = new TGCompositeFrame(fBin, 145, 10,
600  kFixedWidth |
602  title4->AddFrame(new TGLabel(title4, "Axis Range"),
603  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
604  title4->AddFrame(new TGHorizontal3DLine(title4),
605  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
606  fBin->AddFrame(title4, new TGLayoutHints(kLHintsTop, 0, 0, 5, 0));
607 
609  TGLabel *fSliderXLbl = new TGLabel(f14,"x:");
610  f14->AddFrame(fSliderXLbl,
611  new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4,3, 2, 1));
612  fSliderX = new TGDoubleHSlider(f14, 1, 2);
613  fSliderX->Resize(119,20);
615  fBin->AddFrame(f14, new TGLayoutHints(kLHintsTop, 3, 7, 4, 1));
616 
618  fSldXMin = new TGNumberEntryField(f17, kSLIDERX_MIN, 0.0,
621  ((TGTextEntry*)fSldXMin)->SetToolTipText("Set the minimum value of the x-axis");
622  fSldXMin->Resize(57,20);
623  f17->AddFrame(fSldXMin, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
624  fSldXMax = new TGNumberEntryField(f17, kSLIDERX_MAX, 0.0,
627  ((TGTextEntry*)fSldXMax)->SetToolTipText("Set the maximum value of the x-axis");
628  fSldXMax->Resize(57,20);
629  f17->AddFrame(fSldXMax, new TGLayoutHints(kLHintsLeft, 4, 0, 0, 0));
630  fBin->AddFrame(f17, new TGLayoutHints(kLHintsTop, 20, 3, 5, 0));
631 
633  TGLabel *fSliderYLbl = new TGLabel(f15,"y:");
634  f15->AddFrame(fSliderYLbl,
635  new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4,2, 4, 1));
636  fSliderY = new TGDoubleHSlider(f15, 1, 2);
637  fSliderY->Resize(119,20);
639  fBin->AddFrame(f15, new TGLayoutHints(kLHintsTop, 3, 7, 4, 1));
640 
642  fSldYMin = new TGNumberEntryField(f18, kSLIDERY_MIN, 0.0,
645  ((TGTextEntry*)fSldYMin)->SetToolTipText("Set the minimum value of the y-axis");
646  fSldYMin->Resize(57,20);
647  f18->AddFrame(fSldYMin, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
648  fSldYMax = new TGNumberEntryField(f18, kSLIDERY_MAX, 0.0,
651  ((TGTextEntry*)fSldYMax)->SetToolTipText("Set the maximum value of the y-axis");
652  fSldYMax->Resize(57,20);
653  f18->AddFrame(fSldYMax, new TGLayoutHints(kLHintsLeft, 4, 0, 0, 0));
654  fBin->AddFrame(f18, new TGLayoutHints(kLHintsTop, 20, 3, 5, 0));
655 
657  fDelaydraw = new TGCheckButton(f20, "Delayed drawing", kDELAYED_DRAWING);
658  fDelaydraw ->SetToolTipText("Draw the new axis range when the Slider is released");
659  f20->AddFrame(fDelaydraw, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
660  fBin->AddFrame(f20, new TGLayoutHints(kLHintsTop, 2, 1, 5, 3));
661 
662  fXBinOffsetSld->SetRange(0,100);
665 
666  fYBinOffsetSld->SetRange(0,100);
669 
672 
673 }
674 
675 ////////////////////////////////////////////////////////////////////////////////
676 /// Destructor.
677 
679 {
680  // remove itselef from the list of cleanups
681  gROOT->GetListOfCleanups()->Remove(this);
682 
683  // children of TGButonGroup are not deleted
684  delete fDim;
685  delete fDim0;
686  delete fDimlh;
687  delete fDim0lh;
688 
689  if (fBinHist) delete fBinHist;
690  fBinHist = 0;
691 }
692 
693 ////////////////////////////////////////////////////////////////////////////////
694 /// Connect signals to slots.
695 
697 {
698  fTitle->Connect("TextChanged(const char *)", "TH2Editor", this, "DoTitle(const char *)");
699  fDimGroup->Connect("Clicked(Int_t)","TH2Editor",this,"DoHistView()");
700  fTypeCombo->Connect("Selected(Int_t)", "TH2Editor", this, "DoHistChanges()");
701  fCoordsCombo->Connect("Selected(Int_t)", "TH2Editor", this, "DoHistChanges()");
702  fContCombo->Connect("Selected(Int_t)", "TH2Editor", this, "DoHistChanges()");
703  fAddArr->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddArr(Bool_t)");
704  fAddBox->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddBox(Bool_t)");
705  fAddCol->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddCol(Bool_t)");
706  fAddScat->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddScat(Bool_t)");
707  fAddText->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddText(Bool_t)");
708  fAddError->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddError(Bool_t)");
709  fAddPalette->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddPalette(Bool_t)");
710  fAddPalette1->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddPalette(Bool_t)");
711  fAddFB->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddFB()");
712  fAddBB->Connect("Toggled(Bool_t)", "TH2Editor", this, "DoAddBB()");
713  fContLevels->Connect("ValueSet(Long_t)", "TH2Editor", this, "DoContLevel()");
714  (fContLevels->GetNumberEntry())->Connect("ReturnPressed()", "TH2Editor",
715  this,"DoContLevel()");
716  fContLevels1->Connect("ValueSet(Long_t)", "TH2Editor", this, "DoContLevel1()");
717  (fContLevels1->GetNumberEntry())->Connect("ReturnPressed()", "TH2Editor",
718  this,"DoContLevel1()");
719  fBarWidth->Connect("ValueSet(Long_t)", "TH2Editor", this, "DoBarWidth()");
720  (fBarWidth->GetNumberEntry())->Connect("ReturnPressed()", "TH2Editor",
721  this, "DoBarWidth()");
722  fBarOffset->Connect("ValueSet(Long_t)", "TH2Editor", this, "DoBarOffset()");
723  (fBarOffset->GetNumberEntry())->Connect("ReturnPressed()", "TH2Editor",
724  this, "DoBarOffset()");
725  fBinXSlider->Connect("PositionChanged(Int_t)","TH2Editor",this, "DoBinMoved()");
726  fBinXSlider->Connect("Released()","TH2Editor",this, "DoBinReleased()");
727  fBinXSlider->Connect("Pressed()","TH2Editor",this, "DoBinPressed()");
728  fBinYSlider->Connect("PositionChanged(Int_t)","TH2Editor",this, "DoBinMoved()");
729  fBinYSlider->Connect("Released()","TH2Editor",this, "DoBinReleased()");
730  fBinYSlider->Connect("Pressed()","TH2Editor",this, "DoBinPressed()");
731  fBinXNumberEntry->Connect("ReturnPressed()", "TH2Editor", this, "DoBinLabel()");
732  fBinYNumberEntry->Connect("ReturnPressed()", "TH2Editor", this, "DoBinLabel()");
733  fApply->Connect("Clicked()", "TH2Editor", this, "DoApply()");
734  fCancel->Connect("Pressed()", "TH2Editor", this, "DoCancel()");
735  fBinXSlider1->Connect("Released()","TH2Editor",this, "DoBinReleased1()");
736  fBinXSlider1->Connect("PositionChanged(Int_t)","TH2Editor",this, "DoBinMoved1()");
737  fBinXNumberEntry1->Connect("ReturnPressed()", "TH2Editor", this, "DoBinLabel1()");
738  fXBinOffsetSld->Connect("PositionChanged(Int_t)","TH2Editor",this, "DoOffsetMoved()");
739  fXBinOffsetSld->Connect("Released()","TH2Editor",this, "DoOffsetReleased()");
740  fXBinOffsetSld->Connect("Pressed()","TH2Editor",this, "DoOffsetPressed()");
741  fXOffsetNumberEntry->Connect("ReturnPressed()", "TH2Editor", this, "DoBinOffset()");
742  fBinYSlider1->Connect("Released()","TH2Editor",this, "DoBinReleased1()");
743  fBinYSlider1->Connect("PositionChanged(Int_t)","TH2Editor",this, "DoBinMoved1()");
744  fBinYNumberEntry1->Connect("ReturnPressed()", "TH2Editor", this, "DoBinLabel1()");
745  fYBinOffsetSld->Connect("PositionChanged(Int_t)","TH2Editor",this,"DoOffsetMoved()");
746  fYBinOffsetSld->Connect("Released()","TH2Editor",this, "DoOffsetReleased()");
747  fYBinOffsetSld->Connect("Pressed()","TH2Editor",this, "DoOffsetPressed()");
748  fYOffsetNumberEntry->Connect("ReturnPressed()", "TH2Editor", this,"DoBinOffset()");
749  fSliderX->Connect("PositionChanged()","TH2Editor",this, "DoSliderXMoved()");
750  fSliderX->Connect("Pressed()","TH2Editor",this, "DoSliderXPressed()");
751  fSliderX->Connect("Released()","TH2Editor",this, "DoSliderXReleased()");
752  fSldXMin->Connect("ReturnPressed()", "TH2Editor", this, "DoXAxisRange()");
753  fSldXMax->Connect("ReturnPressed()", "TH2Editor", this, "DoXAxisRange()");
754  fSliderY->Connect("PositionChanged()","TH2Editor",this, "DoSliderYMoved()");
755  fSliderY->Connect("Pressed()","TH2Editor",this, "DoSliderYPressed()");
756  fSliderY->Connect("Released()","TH2Editor",this, "DoSliderYReleased()");
757  fSldYMin->Connect("ReturnPressed()", "TH2Editor", this, "DoYAxisRange()");
758  fSldYMax->Connect("ReturnPressed()", "TH2Editor", this, "DoYAxisRange()");
759  fFrameColor->Connect("ColorSelected(Pixel_t)", "TH2Editor", this, "DoFillColor(Pixel_t)");
760  fFramePattern->Connect("PatternSelected(Style_t)", "TH2Editor", this, "DoFillPattern(Style_t)");
761 
762  fInit = kFALSE;
763 }
764 
765 ////////////////////////////////////////////////////////////////////////////////
766 /// Check if object is able to configure with this editor.
767 
769 {
770  if (obj == 0 || !obj->InheritsFrom(TH2::Class()) ||
771  (!strcmp(((TH2 *)obj)->GetName(),"htemp") &&
772  ((TH2*)obj)->GetEntries() == 0)) { // htemp is an empty histogram
773  return kFALSE;
774  }
775  return kTRUE;
776 }
777 
778 ////////////////////////////////////////////////////////////////////////////////
779 /// Pick up the values of current histogram attributes.
780 
782 {
784  if (fBinHist && (obj != fHist)) {
785  //we have probably moved to a different pad.
786  //let's restore the original histogram
787  if (fHist) {
788  fHist->Reset();
790  fBinHist->GetXaxis()->GetXmin(),
791  fBinHist->GetXaxis()->GetXmax(),
792  fBinHist->GetYaxis()->GetNbins(),
793  fBinHist->GetYaxis()->GetXmin(),
794  fBinHist->GetYaxis()->GetXmax());
795  fHist->Add(fBinHist);
796  }
797  // delete in anycase fBinHist also when fHist is zero (i.e when it has been deleted)
798  delete fBinHist;
799  fBinHist = 0;
800  if (fGedEditor->GetPad()) {
801  fGedEditor->GetPad()->Modified();
802  fGedEditor->GetPad()->Update();
803  }
804  }
805 
806  fHist = (TH2*) obj;
807 
808  const char *text = fHist->GetTitle();
809  fTitle->SetText(text);
810  TString str = GetDrawOption();
812  str.ToUpper();
813 
814  if (str == "") {
815  // default options = Scatter-Plot
816  ShowFrame(f6);
817  HideFrame(f9);
818  HideFrame(f12);
819  HideFrame(f13);
820  HideFrame(f38);
826 
837  } else if (!str.Contains("LEGO") && !str.Contains("SURF")) {
838  ShowFrame(f6);
839  HideFrame(f9);
840  HideFrame(f12);
841  HideFrame(f13);
842  HideFrame(f38);
847  if (str.Contains("CONT")){
848  if (str.Contains("CONT1")) fContCombo->Select(kCONT_1);
849  else if (str.Contains("CONT2")) fContCombo->Select(kCONT_2);
850  else if (str.Contains("CONT3")) fContCombo->Select(kCONT_3);
851  else if (str.Contains("CONT4")) fContCombo->Select(kCONT_4);
852  else if (str.Contains("CONT0") || str.Contains("CONT"))
854  } else fContCombo->Select(kCONT_NONE);
855 
856  if (str.Contains("ARR")) fAddArr->SetState(kButtonDown);
857  else fAddArr->SetState(kButtonUp);
858  if (str.Contains("BOX")) fAddBox->SetState(kButtonDown);
859  else fAddBox->SetState(kButtonUp);
860  if (str.Contains("COL")) fAddCol->SetState(kButtonDown);
861  else fAddCol->SetState(kButtonUp);
862  if (str.Contains("SCAT")) {
863  if (str=="SCAT") fAddScat->SetState(kButtonDisabled);
865  } else fAddScat->SetState(kButtonUp);
866  if (str.Contains("TEXT")) fAddText->SetState(kButtonDown);
867  else fAddText->SetState(kButtonUp);
868 
870  if (str.Contains("COL") || (str.Contains("CONT") &&
871  !str.Contains("CONT2") && !str.Contains("CONT3"))) {
872  if (str.Contains("Z")) fAddPalette->SetState(kButtonDown);
878 
879  } else if (str.Contains("LEGO") || str.Contains("SURF")) {
880  HideFrame(f6);
881  ShowFrame(f9);
882  ShowFrame(f12);
883  ShowFrame(f13);
884  ShowFrame(f38);
887  if (str.Contains("LEGO4")) fTypeCombo->Select(kTYPE_LEGO4);
888  else if (str.Contains("LEGO3")) fTypeCombo->Select(kTYPE_LEGO3);
889  else if (str.Contains("LEGO2")) fTypeCombo->Select(kTYPE_LEGO2);
890  else if (str.Contains("LEGO1")) fTypeCombo->Select(kTYPE_LEGO1);
891  else if (str.Contains("LEGO")) fTypeCombo->Select(kTYPE_LEGO);
892  else if (str.Contains("SURF5")) fTypeCombo->Select(kTYPE_SURF5);
893  else if (str.Contains("SURF4")) fTypeCombo->Select(kTYPE_SURF4);
894  else if (str.Contains("SURF3")) fTypeCombo->Select(kTYPE_SURF3);
895  else if (str.Contains("SURF2")) fTypeCombo->Select(kTYPE_SURF2);
896  else if (str.Contains("SURF1")) fTypeCombo->Select(kTYPE_SURF1);
897  else if (str.Contains("SURF")) fTypeCombo->Select(kTYPE_SURF);
898 
899 
900  if (str.Contains("CYL")) fCoordsCombo->Select(kCOORDS_CYL);
901  else if (str.Contains("POL")) fCoordsCombo->Select(kCOORDS_POL);
902  else if (str.Contains("SPH")) fCoordsCombo->Select(kCOORDS_SPH);
903  else if (str.Contains("PSR")) fCoordsCombo->Select(kCOORDS_PSR);
904  else fCoordsCombo->Select(kCOORDS_CAR); //default
905 
912 
920  } else {
921  if (str.Contains("FB")) fAddFB->SetState(kButtonUp);
922  else fAddFB->SetState(kButtonDown);
923  if (str.Contains("BB")) fAddBB->SetState(kButtonUp);
924  else fAddBB->SetState(kButtonDown);
925  if (str.Contains("E")){
926  TString dum = str;
927  if (str.Contains("LEGO"))
928  dum.Remove(strstr(dum.Data(),"LEGO")-dum.Data(),4);
929  if (str.Contains("TEXT"))
930  dum.Remove(strstr(dum.Data(),"TEXT")-dum.Data(),4);
931  if (dum.Contains("E")) fAddError->SetState(kButtonDown);
933  } else fAddError->SetState(kButtonUp);
934  }
935  if ((fTypeCombo->GetSelected()==kTYPE_LEGO) ||
942  else if (str.Contains("Z")) fAddPalette1->SetState(kButtonDown);
944  }
945 
948 
949  Int_t nx = fHist -> GetXaxis() -> GetNbins();
950  Int_t nxbinmin = fHist -> GetXaxis() -> GetFirst();
951  Int_t nxbinmax = fHist -> GetXaxis() -> GetLast();
952  fSliderX->SetRange(1,nx);
953  fSliderX->SetPosition((Double_t)nxbinmin,(Double_t)nxbinmax);
955  fSldXMax->SetNumber(fHist->GetXaxis()->GetBinUpEdge(nxbinmax));
956 
957  Int_t ny = fHist -> GetYaxis() -> GetNbins();
958  Int_t nybinmin = fHist -> GetYaxis() -> GetFirst();
959  Int_t nybinmax = fHist -> GetYaxis() -> GetLast();
960  fSliderY->SetRange(1,ny);
961  fSliderY->SetPosition((Double_t)nybinmin,(Double_t)nybinmax);
963  fSldYMax->SetNumber(fHist->GetYaxis()->GetBinUpEdge(nybinmax));
964 
966 
967  if (str.Contains("COL") || fContCombo->GetSelected()!= kCONT_NONE)
968  fColContLbl->Enable() ;
969  else fColContLbl->Disable();
970 
971  if (str.Contains("LEGO2") || str.Contains("SURF1") ||
972  str.Contains("SURF2") || str.Contains("SURF3") ||
973  str.Contains("SURF5")) fColContLbl1->Enable();
974  else fColContLbl1->Disable();
975 
978 
981 
983 
984 
985  // Check if histogram is from ntupla/tree or not.
986  // If it is a standard histogram or a ntupla based histogram
987  // show a different frame in case of rebinning (fBinCont) with sliders and bin number entries
988  // connected to different methods.
989  // For example the entry field fBinXNumberEntry is connected to
990  // the method DoBinLabel in case of non-ntupla histograms which just call Th1::Rebin
991  // In csae of a tree based histogram the entry field fBinNumberEntry1 is used which is connected to
992  // TH1Editor::DoBinLabel1 which is re-filling the histograms with the cached values from the TTreePlayer.
993  // Since the actual number of histogram entry can be larger than the cache size of the TTreePlayer
994  // (see JIRA ROOT-5900 or http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=17107 )
995  // the GUI frame based on a non-tupla histogram is used when the number of entries of the histogram is
996  // not the same as the number of filled entries in the TTreePlayer object.
997 
998  if (!player || player->GetHistogram()!=fHist ||
999  fHist->GetEntries() != player->GetNfill()) {
1000  Int_t n1 = 0, n2 =0;
1001  Int_t upx =0, upy =0;
1002  if (fBinHist) n1 = fBinHist->GetXaxis()->GetNbins();
1003  else n1 = nx;
1004  if (fBinHist) n2 = fBinHist->GetYaxis()->GetNbins();
1005  else n2 = ny;
1009  if (n1 < 1) n1 = 1;
1010  if (n2 < 1) n2 = 1;
1011  Int_t* divx = Dividers(n1);
1012  Int_t* divy = Dividers(n2);
1013  if (divx[0]-1 <= 1) upx = 2;
1014  else upx = divx[0]-1;
1015  fBinXSlider->SetRange(1,upx);
1016  if (divy[0]-1 <= 1) upy = 2;
1017  else upy = divy[0]-1;
1018  fBinYSlider->SetRange(1,upy);
1019  Int_t i = 1; Int_t j = 1;
1022  else {
1023  while ( divx[i] != nx) i ++;
1024  fBinXSlider->SetPosition(divx[0] - i + 1);
1025  }
1028  else {
1029  while ( divy [j] != ny) j ++;
1030  fBinYSlider->SetPosition(divy[0] - j + 1);
1031  }
1036  delete [] divx;
1037  delete [] divy;
1038  }
1039  else if (player && fHist==player->GetHistogram() && fHist->GetEntries() == player->GetNfill()) {
1045  fBinXNumberEntry1->SetIntNumber(nxbinmax-nxbinmin+1);
1048  fBinYNumberEntry1->SetIntNumber(nybinmax-nybinmin+1);
1049  }
1050 
1052  fHist->GetXaxis()->GetBinWidth(1));
1054  fHist->GetYaxis()->GetBinWidth(1));
1056 
1057  if (fInit) ConnectSignals2Slots();
1059  fAvoidSignal = kFALSE;
1060 
1061 }
1062 
1063 ////////////////////////////////////////////////////////////////////////////////
1064 /// Slot connected to the histogram title setting.
1065 
1066 void TH2Editor::DoTitle(const char *text)
1067 {
1068  if (fAvoidSignal) return;
1069  fHist->SetTitle(text);
1070  Update();
1071 }
1072 
1073 ////////////////////////////////////////////////////////////////////////////////
1074 /// Slot connected to the 'Plot' button group.
1075 
1077 {
1078  if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kWatch);
1079  gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
1080 
1081  if (fDim->GetState() == kButtonDown)
1082  DoHistSimple();
1083  else
1084  DoHistComplex();
1085 
1086  if (gPad && gPad->GetVirtCanvas()) gPad->GetVirtCanvas()->SetCursor(kPointer);
1087  gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
1088 }
1089 
1090 ////////////////////////////////////////////////////////////////////////////////
1091 /// Slot connected to the 2D-Plot radio button.
1092 
1094 {
1095  if (fAvoidSignal) return;
1096  TString str = "";
1097  ShowFrame(f6);
1098  HideFrame(f9);
1099  HideFrame(f12);
1100  HideFrame(f13);
1101  HideFrame(f38);
1102  if (fContCombo->GetSelected()==-1)
1104  if ((fContCombo->GetSelected()!= kCONT_NONE) &&
1107 
1109  if (str=="" || str=="SCAT" || str==fCutString) {
1112  } else if (fAddScat->GetState()==kButtonDisabled)
1114  if (str.Contains("COL") || fContCombo->GetSelected()!= kCONT_NONE)
1115  fColContLbl->Enable();
1116  else fColContLbl->Disable();
1117 
1118  ((TGMainFrame*)GetMainFrame())->Layout();
1119 
1120  TString ocut = fCutString;
1121  ocut.ToUpper();
1122  if (!str.Contains(fCutString) && !str.Contains(ocut))
1123  str+=fCutString;
1124  SetDrawOption(str);
1125  Update();
1126 }
1127 
1128 ////////////////////////////////////////////////////////////////////////////////
1129 /// Slot connected to the 3D-Plot radio button.
1130 
1132 {
1133  if (fAvoidSignal) return;
1134  TString str = "";
1135  HideFrame(f6);
1136  ShowFrame(f9);
1137  ShowFrame(f38);
1138  if (GetHistTypeLabel().Contains("LEGO")) {
1139  ShowFrame(f12);
1140  ShowFrame(f13);
1141  } else {
1142  HideFrame(f12);
1143  HideFrame(f13);
1144  }
1147 
1149 
1150  if (str.Contains("LEGO2") || str.Contains("SURF1") ||
1151  str.Contains("SURF2") || str.Contains("SURF3") ||
1152  str.Contains("SURF5")) {
1153  fColContLbl1->Enable();
1156  } else {
1157  fColContLbl1->Disable();
1159  }
1160 
1161  ((TGMainFrame*)GetMainFrame())->Layout();
1162 
1163  TString ocut = fCutString;
1164  ocut.ToUpper();
1165  if (!str.Contains(fCutString) && !str.Contains(ocut))
1166  str+=fCutString;
1167  SetDrawOption(str);
1168  Update();
1169 }
1170 
1171 ////////////////////////////////////////////////////////////////////////////////
1172 /// Slot connected to histogram type, coordinate system, contour combo box.
1173 
1175 {
1176  if (fAvoidSignal) return;
1177  TString str = "";
1178  if (fDim->GetState() == kButtonDown) {
1180  if ((fContCombo->GetSelected()!=kCONT_NONE &&
1182  fContCombo->GetSelected()!=kCONT_3) || str.Contains("COL")) {
1183 
1184  if (str.Contains("Z")) fAddPalette->SetState(kButtonDown);
1187  if (str=="" || str=="SCAT" || str==fCutString) {
1190  } else if (fAddScat->GetState()==kButtonDisabled)
1193  if (str.Contains("COL") || fContCombo->GetSelected()!= kCONT_NONE)
1194  fColContLbl->Enable();
1195  else
1196  fColContLbl->Disable();
1197 
1198  } else if (fDim0->GetState() == kButtonDown) {
1206  } else {
1213  }
1214  if ((fTypeCombo->GetSelected()==kTYPE_LEGO) ||
1221  else if (fAddPalette1->GetState()==kButtonDisabled)
1223  if (GetHistTypeLabel().Contains("LEGO")) {
1224  ShowFrame(f12);
1225  ShowFrame(f13);
1226  } else {
1227  HideFrame(f12);
1228  HideFrame(f13);
1229  }
1230  ((TGMainFrame*)GetMainFrame())->Layout();
1232  if (str.Contains("LEGO2") || str.Contains("SURF1") ||
1233  str.Contains("SURF2") || str.Contains("SURF3") ||
1234  str.Contains("SURF5"))
1235  fColContLbl1->Enable();
1236  else
1237  fColContLbl1->Disable() ;
1238  }
1239 
1240  TString ocut = fCutString;
1241  ocut.ToUpper();
1242  if (!str.Contains(fCutString) && !str.Contains(ocut))
1243  str+=fCutString;
1244  SetDrawOption(str);
1245  Update();
1246 }
1247 
1248 ////////////////////////////////////////////////////////////////////////////////
1249 /// Slot connected to the "Arrow draw option" check button.
1250 
1252 {
1253  if (fAvoidSignal) return;
1254  Bool_t make=kFALSE;
1255  TString str = GetDrawOption();
1256  str.ToUpper();
1257 
1258  if (on) {
1259  if (!str.Contains("ARR")) {
1260  str += "ARR";
1263  make=kTRUE;
1264  }
1265  } else if (fAddArr->GetState()==kButtonUp) {
1266  if (str.Contains("ARR")) {
1267  str.Remove(strstr(str.Data(),"ARR")-str.Data(),3);
1268  if (str=="" || str=="SCAT" || str==fCutString) {
1271  }
1272  make=kTRUE;
1273  }
1274  }
1275  if (make) {
1276  DoHistChanges();
1277  }
1278 }
1279 
1280 ////////////////////////////////////////////////////////////////////////////////
1281 /// Slot connected to the "Box draw option" check button.
1282 
1284 {
1285  if (fAvoidSignal) return;
1286  Bool_t make=kFALSE;
1287  TString str = GetDrawOption();
1288  str.ToUpper();
1289 
1290  if (on) {
1291  if (!str.Contains("BOX")) {
1292  str += "BOX";
1295  make=kTRUE;
1296  }
1297  } else if (fAddBox->GetState()==kButtonUp) {
1298  if (str.Contains("BOX")) {
1299  str.Remove(strstr(str.Data(),"BOX")-str.Data(),3);
1300  if (str=="" || str=="SCAT" || str==fCutString) {
1303  }
1304  make=kTRUE;
1305  }
1306  }
1307  if (make) {
1308  DoHistChanges();
1309  }
1310 }
1311 
1312 ////////////////////////////////////////////////////////////////////////////////
1313 /// Slot connected to the "Col draw option" check button.
1314 
1316 {
1317  if (fAvoidSignal) return;
1318  Bool_t make=kFALSE;
1319  TString str = GetDrawOption();
1320  str.ToUpper();
1321 
1322  if (on) {
1323  if (!str.Contains("COL")) {
1324  str += "COL";
1325  fColContLbl->Enable() ;
1330  make=kTRUE;
1331  }
1332  } else if (fAddCol->GetState()==kButtonUp) {
1333  if (str.Contains("COL")) {
1334  str.Remove(strstr(str.Data(),"COL")-str.Data(),3);
1337  if (fContCombo->GetSelected()==kCONT_NONE) {
1339  if (str.Contains("Z"))
1340  str.Remove(strstr(str.Data(),"Z")-str.Data(),1);
1341  }
1342  if (str=="" || str=="SCAT" || str==fCutString)
1345  fColContLbl->Enable() ;
1346  else fColContLbl->Disable();
1347  make=kTRUE;
1348  }
1349  }
1350  if (make) {
1351  DoHistChanges();
1352  }
1353 }
1354 
1355 ////////////////////////////////////////////////////////////////////////////////
1356 /// Slot connected to the "Scat draw option" check button.
1357 
1359 {
1360  if (fAvoidSignal) return;
1361  Bool_t make=kFALSE;
1362  TString str = GetDrawOption();
1363  str.ToUpper();
1364 
1365  if (on) {
1366  if (!str.Contains("SCAT")) {
1367  str += "SCAT";
1368  make=kTRUE;
1369  }
1370  } else if (fAddScat->GetState()==kButtonUp) {
1371  if (str.Contains("SCAT")) {
1372  str.Remove(strstr(str.Data(),"SCAT")-str.Data(),4);
1373  make=kTRUE;
1374  }
1375  }
1376  if (make) {
1377  DoHistChanges();
1378  }
1379 }
1380 
1381 ////////////////////////////////////////////////////////////////////////////////
1382 /// Slot connected to the "Text draw option" check button.
1383 
1385 {
1386  if (fAvoidSignal) return;
1387  Bool_t make=kFALSE;
1388  TString str = GetDrawOption();
1389  str.ToUpper();
1390 
1391  if (on) {
1392  if (!str.Contains("TEXT")) {
1393  str += "TEXT";
1396  make=kTRUE;
1397  }
1398  } else if (fAddText->GetState()==kButtonUp) {
1399  if (str.Contains("TEXT")) {
1400  str.Remove(strstr(str.Data(),"TEXT")-str.Data(),4);
1401  if (str=="" || str=="SCAT" || str==fCutString)
1403  make=kTRUE;
1404  }
1405  }
1406  if (make) {
1407  DoHistChanges();
1408  // next line is needed for marker editor refresh
1410  }
1411 }
1412 
1413 ////////////////////////////////////////////////////////////////////////////////
1414 /// Slot connected to the "Error" check button.
1415 
1417 {
1418  if (fAvoidSignal) return;
1419  Bool_t make=kFALSE;
1420  TString str = GetDrawOption();
1421  str.ToUpper();
1422 
1423  TString dum = str;
1424  if (str.Contains("LEGO"))
1425  dum.Remove(strstr(dum.Data(),"LEGO")-dum.Data(),4);
1426  if (str.Contains("TEXT"))
1427  dum.Remove(strstr(dum.Data(),"TEXT")-dum.Data(),4);
1428  if (on) {
1429  if (!dum.Contains("E")) {
1430  str += "E";
1431  make=kTRUE;
1432  }
1433  } else if (fAddError->GetState() == kButtonUp) {
1434  if (str.Contains("E")) {
1435  if (fDim->GetState() == kButtonDown)
1437  else
1440  make=kTRUE;
1441  }
1442  }
1443  if (make) {
1444  DoHistChanges();
1445  }
1446 }
1447 
1448 ////////////////////////////////////////////////////////////////////////////////
1449 /// Slot connected to the color palette check button.
1450 
1452 {
1453  if (fAvoidSignal) return;
1454  Bool_t make=kFALSE;
1455  TString str = GetDrawOption();
1456  str.ToUpper();
1457 
1458  if (on) {
1459  if (!str.Contains("Z")) {
1460  str += "Z";
1461  make=kTRUE;
1462  }
1463  } else if (fAddPalette->GetState()==kButtonUp ||
1465  if (str.Contains("Z")) {
1466  str.Remove(strstr(str.Data(),"Z")-str.Data(),1);
1467  make=kTRUE;
1468  }
1469  }
1470  if (make) {
1471  DoHistChanges();
1472  }
1473 }
1474 
1475 ////////////////////////////////////////////////////////////////////////////////
1476 /// Slot connected to the "FB front-box draw option" check button.
1477 
1479 {
1480  if (fAvoidSignal) return;
1481  Bool_t make=kFALSE;
1482  TString str = GetDrawOption();
1483  str.ToUpper();
1484 
1485  if (fAddFB->GetState()==kButtonDown) {
1486  if (str.Contains("FB")) {
1487  if (str.Contains("SURF") && !(str.Contains("1") ||
1488  str.Contains("2") || str.Contains("3") ||
1489  str.Contains("4") || str.Contains("5"))) {
1490  TString dum = str;
1491  dum.Remove(strstr(dum.Data(),"SURF")-dum.Data(),4);
1492  if (dum.Contains("FB"))
1493  dum.Remove(strstr(dum.Data(),"FB")-dum.Data(),2);
1494  str = "SURF" + dum;
1495  } else str.Remove(strstr(str.Data(),"FB")-str.Data(),2);
1496  make = kTRUE;
1497  }
1498  } else if (fAddFB->GetState()==kButtonUp){
1499  if (!str.Contains("FB")) {
1500  str += "FB";
1501  make=kTRUE;
1502  }
1503  }
1504  if (make) {
1505  DoHistChanges();
1506  }
1507 }
1508 
1509 ////////////////////////////////////////////////////////////////////////////////
1510 /// Slot connected to the "BB back-box draw option" check button.
1511 
1513 {
1514  if (fAvoidSignal) return;
1515  Bool_t make=kFALSE;
1516  TString str = GetDrawOption();
1517  str.ToUpper();
1518 
1519  if (fAddBB->GetState()==kButtonDown) {
1520  if (str.Contains("BB")) {
1521  if (str.Contains("FB")) {
1522  TString dum = str;
1523  dum.Remove(strstr(dum.Data(),"FB")-dum.Data(),2);
1524  dum.Remove(strstr(dum.Data(),"BB")-dum.Data(),2);
1525  str=dum+"FB";
1526  } else str.Remove(strstr(str.Data(),"BB")-str.Data(),2);
1527  make = kTRUE;
1528  }
1529  } else if (fAddBB->GetState()==kButtonUp){
1530  if (!str.Contains("BB")) {
1531  str += "BB";
1532  make=kTRUE;
1533  }
1534  }
1535  if (make) {
1536  DoHistChanges();
1537  }
1538 }
1539 
1540 ////////////////////////////////////////////////////////////////////////////////
1541 /// Slot connected to the contour level number entry fContLevels.
1542 
1544 {
1545  if (fAvoidSignal) return;
1548  Update();
1549 }
1550 
1551 ////////////////////////////////////////////////////////////////////////////////
1552 /// Slot connected to the contour level number entry fContLevels1.
1553 
1555 {
1556  if (fAvoidSignal) return;
1559  Update();
1560 }
1561 
1562 ////////////////////////////////////////////////////////////////////////////////
1563 /// Slot connected to the bar width of the bar chart.
1564 
1566 {
1567  if (fAvoidSignal) return;
1569  Update();
1570 }
1571 
1572 ////////////////////////////////////////////////////////////////////////////////
1573 /// Slot connected to the bar offset of the bar chart.
1574 
1576 {
1577  if (fAvoidSignal) return;
1579  Update();
1580 }
1581 
1582 ////////////////////////////////////////////////////////////////////////////////
1583 /// Slot connected to the rebin slider in case of no ntuple histogram.
1584 /// It updates some other widgets related to the rebin slider.
1585 
1587 {
1588  // Draw the rebinned histogram in case of the delay draw mode
1589  if (fAvoidSignal) return;
1590  if (fDelaydraw->GetState()==kButtonDown){
1591  if (!fBinHist) {
1592  fBinHist = (TH2*)fHist->Clone("BinHist");
1593  fBinHist->SetDirectory(0); // TH2Editor manages this histogram
1594  }
1595  Int_t nx = fBinHist->GetXaxis()->GetNbins();
1596  Int_t ny = fBinHist->GetYaxis()->GetNbins();
1597  Int_t numx = fBinXSlider->GetPosition();
1598  Int_t numy = fBinYSlider->GetPosition();
1599  Int_t* divx = Dividers(nx);
1600  Int_t* divy = Dividers(ny);
1601  if (divx[0]==2) fBinXSlider->SetPosition(2);
1602  if (divy[0]==2) fBinYSlider->SetPosition(2);
1603  if (divx[0]==2 && divy[0]==2) {
1604  delete [] divx;
1605  delete [] divy;
1606  return;
1607  }
1608  // delete the histogram which is on the screen
1609  fGedEditor->GetPad()->cd();
1610  fHist->Reset();
1612  fBinHist->GetXaxis()->GetXmax(),
1613  ny,fBinHist->GetYaxis()->GetXmin(),
1614  fBinHist->GetYaxis()->GetXmax());
1615  fHist->Add(fBinHist);
1617  fHist->Rebin2D(divx[numx], divy[numy]);
1618 
1619  //fModel=fHist;
1620 
1621  if (divx[0]!=2) {
1622  TAxis* xaxis = fHist->GetXaxis();
1623  Double_t xBinWidth = xaxis->GetBinWidth(1);
1624  xaxis->SetRangeUser(fSldXMin->GetNumber()+xBinWidth/2,
1625  fSldXMax->GetNumber()-xBinWidth/2);
1626  fSliderX->SetRange(1,(Int_t)nx/divx[numx]);
1627  fSliderX->SetPosition(xaxis->FindBin(fSldXMin->GetNumber()+xBinWidth/2),
1628  xaxis->FindBin(fSldXMax->GetNumber()-xBinWidth/2));
1629  // the axis range could be changed a little bit by the Rebin algorithm
1630  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1631  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1632  }
1633  if (divy[0]!=2) {
1634  TAxis* yaxis = fHist->GetYaxis();
1635  Double_t yBinWidth = yaxis->GetBinWidth(1);
1636  yaxis->SetRangeUser(fSldYMin->GetNumber()+yBinWidth/2,
1637  fSldYMax->GetNumber()-yBinWidth/2);
1638  fSliderY->SetRange(1,(Int_t)ny/divy[numy]);
1639  fSliderY->SetPosition(yaxis->FindBin(fSldYMin->GetNumber()+yBinWidth/2),
1640  yaxis->FindBin(fSldYMax->GetNumber()-yBinWidth/2));
1641  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
1642  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
1643  }
1646  Update();
1647  delete [] divx;
1648  delete [] divy;
1649  }
1650 // fGedEditor->GetPad()->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 0);
1651  // fModel = fHist;
1652  Refresh(fHist);
1653 }
1654 
1655 ////////////////////////////////////////////////////////////////////////////////
1656 /// Slot connected to the rebin slider in case of no ntuple histogram.
1657 
1659 {
1660  if (fAvoidSignal) return;
1661  Int_t* divx = Dividers(fHist->GetXaxis()->GetNbins());
1662  Int_t* divy = Dividers(fHist->GetYaxis()->GetNbins());
1663  if (divx[0]==2 && divy[0]==2 && !fBinHist)
1664  new TGMsgBox(fClient->GetDefaultRoot(), this->GetMainFrame(),
1665  "TH2Editor", "It is not possible to rebin the histogram",
1667  // calling the MessageBox again does NOT work!*/
1668  delete [] divx;
1669  delete [] divy;
1670 }
1671 
1672 ////////////////////////////////////////////////////////////////////////////////
1673 /// Slot connected to the rebin sliders in case of no ntuple histogram
1674 /// does the rebinning of the selected histogram.
1675 
1677 {
1678  // create a clone in the background, when the slider is moved for 1st time
1679  if (fAvoidSignal) return;
1680  if (!fBinHist /*&& fDelaydraw->GetState()!=kButtonDown*/) {
1681  Int_t* divx = Dividers(fHist->GetXaxis()->GetNbins());
1682  Int_t* divy = Dividers(fHist->GetYaxis()->GetNbins());
1683  // if there is nothing to rebin:
1684  if (divx[0]==2 && divy[0]==2) {
1685  delete [] divx;
1686  delete [] divy;
1687  return;
1688  }
1689  fBinHist = (TH2*)fHist->Clone("BinHist");
1690  fBinHist->SetDirectory(0); // TH2Editor manages this histogram
1691  delete [] divx;
1692  delete [] divy;
1693  }
1694  // if the slider already has been moved and the clone is saved
1695  Int_t nx = fBinHist->GetXaxis()->GetNbins();
1696  Int_t ny = fBinHist->GetYaxis()->GetNbins();
1697  Int_t numx = fBinXSlider->GetPosition();
1698  Int_t numy = fBinYSlider->GetPosition();
1699  if (nx < 1 || ny < 1) return;
1700  Int_t* divx = Dividers(nx);
1701  Int_t* divy = Dividers(ny);
1702  if (divx[0]==2) {
1704  numx=1;
1705  }
1706  if (divy[0]==2) {
1708  numy=1;
1709  }
1710  Int_t maxx = (Int_t)nx/divx[numx];
1711  Int_t maxy = (Int_t)ny/divy[numy];
1712  if (maxx==1) maxx=2;
1713  if (maxy==1) maxy=2;
1714  if (fDelaydraw->GetState()==kButtonUp){
1715  // delete the histogram which is on the screen
1716  fGedEditor->GetPad()->cd();
1717  fHist->Reset();
1719  fBinHist->GetXaxis()->GetXmax(),
1720  ny,fBinHist->GetYaxis()->GetXmin(),
1721  fBinHist->GetYaxis()->GetXmax());
1722  fHist->Add(fBinHist);
1724  fHist->Rebin2D(divx[numx], divy[numy]);
1725  //fModel=fHist;
1726  if (divx[0]!=2) {
1727  TAxis* xaxis = fHist->GetXaxis();
1728  Double_t xBinWidth = xaxis->GetBinWidth(1);
1729  // if the user has zoomed into a special area the range will be reset:
1730  xaxis->SetRangeUser(fSldXMin->GetNumber()+xBinWidth/2,
1731  fSldXMax->GetNumber()-xBinWidth/2);
1732  fSliderX->SetRange(1,maxx);
1733  fSliderX->SetPosition(xaxis->FindBin(fSldXMin->GetNumber()+xBinWidth/2),
1734  xaxis->FindBin(fSldXMax->GetNumber()-xBinWidth/2));
1735  // the axis range could be changed a little bit by the Rebin algorithm
1736  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1737  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1739  }
1740  if (divy[0]!=2) {
1741  TAxis* yaxis = fHist->GetYaxis();
1742  Double_t yBinWidth = yaxis->GetBinWidth(1);
1743  yaxis->SetRangeUser(fSldYMin->GetNumber()+yBinWidth/2,
1744  fSldYMax->GetNumber()-yBinWidth/2);
1745  fSliderY->SetRange(1,maxy);
1746  fSliderY->SetPosition(yaxis->FindBin(fSldYMin->GetNumber()+yBinWidth/2),
1747  yaxis->FindBin(fSldYMax->GetNumber()-yBinWidth/2));
1748  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
1749  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
1751  }
1752  Update();
1753  }
1754  // set the according NumberEntries
1759  fBinXNumberEntry->SetNumber(maxx);
1760  fBinYNumberEntry->SetNumber(maxy);
1761  delete [] divx;
1762  delete [] divy;
1763 }
1764 
1765 ////////////////////////////////////////////////////////////////////////////////
1766 /// Slot connected to the Bin Number Entry for the Rebin.
1767 
1769 {
1770  if (fAvoidSignal) return;
1771  Int_t i;
1772  Int_t numx = (Int_t)(fBinXNumberEntry->GetNumber());
1773  Int_t numy = (Int_t)(fBinYNumberEntry->GetNumber());
1774  Int_t nx = 0;
1775  if (fBinHist) nx = fBinHist->GetXaxis()->GetNbins();
1776  else nx = fHist->GetXaxis()->GetNbins();
1777  Int_t ny = 0;
1778  if (fBinHist) ny = fBinHist->GetYaxis()->GetNbins();
1779  else ny = fHist->GetYaxis()->GetNbins();
1780  if (nx < 2 || ny < 2) return;
1781  // Get the divider of nx/ny which is closest to numx/numy
1782  Int_t *divx = Dividers(nx);
1783  Int_t *divy = Dividers(ny);
1784  Int_t diff = TMath::Abs(numx - divx[1]);
1785  Int_t c = 1; Int_t d = 1;
1786  for (i = 2; i <= divx[0]; i++) {
1787  if ((TMath::Abs(numx - divx[i])) < diff) {
1788  c = i;
1789  diff = TMath::Abs(numx - divx[i]);
1790  }
1791  }
1792  diff = TMath::Abs(numy - divy[1]);
1793  for (i = 2; i <= divy[0]; i++) {
1794  if ((TMath::Abs(numy - divy[i])) < diff) {
1795  d = i;
1796  diff = TMath::Abs(numy - divy[i]);
1797  }
1798  }
1799  if (divx[c]!= fHist->GetXaxis()->GetNbins() ||
1800  divy[d]!= fHist->GetYaxis()->GetNbins()) {
1801  fBinXNumberEntry->SetNumber(divx[c]);
1802  fBinXSlider->SetPosition(divx[0] - c +1);
1803  fBinYNumberEntry->SetNumber(divy[d]);
1804  fBinYSlider->SetPosition(divy[0] - d +1);
1806  else DoBinReleased();
1807  }
1808 // fGedEditor->GetPad()->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 0);
1809 // fModel = fHist;
1810  Refresh(fHist);
1811  delete [] divx;
1812  delete [] divy;
1813 }
1814 
1815 ////////////////////////////////////////////////////////////////////////////////
1816 /// Slot connected to the Apply Button in the Rebinned histogram Window.
1817 
1819 {
1820  Int_t ret = 0;
1821  new TGMsgBox(fClient->GetDefaultRoot(), this->GetMainFrame(),
1822  "TH2 Editor", "Replace origin histogram with rebinned one?",
1824  if (ret==1) {
1825  if (fBinHist) {
1826  delete fBinHist;
1827  fBinHist = 0;
1828  }
1829  Int_t nx = fHist->GetXaxis()->GetNbins();
1830  Int_t ny = fHist->GetYaxis()->GetNbins();
1831  Int_t *divx = Dividers(nx);
1832  Int_t *divy = Dividers(ny);
1833  Int_t upx = 0, upy = 0;
1834  if (divx[0]-1 <= 1) upx = 2;
1835  else upx = divx[0]-1;
1836  if (divy[0]-1 <= 1) upy = 2;
1837  else upy = divy[0]-1;
1838  fBinXSlider->SetRange(1,upx);
1839  fBinYSlider->SetRange(1,upy);
1840  if (fBinXSlider->GetMaxPosition()==2 && divx[0]==2 )
1842  else fBinXSlider->SetPosition(1);
1843  if (fBinYSlider->GetMaxPosition()==2 && divy[0]==2 )
1845  else fBinYSlider->SetPosition(1);
1848  Update();
1849  delete [] divx;
1850  delete [] divy;
1851  } else if (ret==2) DoCancel();
1852 }
1853 
1854 ////////////////////////////////////////////////////////////////////////////////
1855 /// Slot connected to the Cancel Button in the Rebinned histogram Window.
1856 
1858 {
1859  if (fBinHist) {
1860  fGedEditor->GetPad()->cd();
1861  fHist->Reset();
1863  fBinHist->GetXaxis()->GetXmin(),
1864  fBinHist->GetXaxis()->GetXmax(),
1865  fBinHist->GetYaxis()->GetNbins(),
1866  fBinHist->GetYaxis()->GetXmin(),
1867  fBinHist->GetYaxis()->GetXmax());
1868  fHist->Add(fBinHist);
1870  fBinHist->GetXaxis()->GetLast());
1872  fBinHist->GetYaxis()->GetLast());
1873 
1874  delete fBinHist;
1875  fBinHist = 0;
1876 
1879  Int_t* divx = Dividers(fHist->GetXaxis()->GetNbins());
1880  Int_t* divy = Dividers(fHist->GetYaxis()->GetNbins());
1881  if (divx[0]!=2) fBinXSlider->SetPosition(1);
1882  if (divy[0]!=2) fBinYSlider->SetPosition(1);
1883  // Consigning the new Histogram to all other Editors
1884 // fGedEditor->GetPad()->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 0);
1885  Update();
1886  // fModel = fHist;
1887  Refresh(fHist);
1888  delete [] divx;
1889  delete [] divy;
1890  }
1891 }
1892 
1893 
1894 ////////////////////////////////////////////////////////////////////////////////
1895 /// Slot connected to the BinNumber Slider in case of a 'ntuple histogram'.
1896 /// It does the rebin.
1897 
1899 {
1900  if (fAvoidSignal) return;
1901  Double_t oldXOffset = fXOffsetNumberEntry->GetNumber();
1902  Int_t xnumber = fBinXSlider1->GetPosition();
1903  Double_t oldYOffset = fYOffsetNumberEntry->GetNumber();
1904  Int_t ynumber = fBinYSlider1->GetPosition();
1905  if (xnumber==5 && ynumber==5) return;
1906  Int_t xfact = 0;
1907  Int_t yfact = 0;
1908  Int_t xBinNumber = 0;
1909  Int_t yBinNumber = 0;
1910  TAxis* xaxis = fHist->GetXaxis();
1911  TAxis* yaxis = fHist->GetYaxis();
1912  //"compute" the scaling factor:
1913  if (xnumber >= 5) xfact = xnumber - 4;
1914  else xfact = xnumber - 6;
1915  if (ynumber >= 5) yfact = ynumber - 4;
1916  else yfact = ynumber - 6;
1918  if (!player) return;
1919  Int_t nx = xaxis->GetNbins();
1920  Int_t ny = yaxis->GetNbins();
1921  Int_t firstx = xaxis->GetFirst();
1922  Int_t lastx = xaxis->GetLast();
1923  Int_t firsty = yaxis->GetFirst();
1924  Int_t lasty = yaxis->GetLast();
1925  Double_t minx = xaxis->GetBinLowEdge(1); // overall min in user coords
1926  Double_t maxx = xaxis->GetBinUpEdge(nx); // overall max in user coords
1927  Double_t miny = yaxis->GetBinLowEdge(1); // overall min in user coords
1928  Double_t maxy = yaxis->GetBinUpEdge(ny); // overall max in user coords
1929  Double_t rminx = xaxis->GetBinLowEdge(firstx); // recent min in user coords
1930  Double_t rmaxx = xaxis->GetBinUpEdge(lastx); // recent max in user coords
1931  Double_t rminy = yaxis->GetBinLowEdge(firsty); // recent min in user coords
1932  Double_t rmaxy = yaxis->GetBinUpEdge(lasty); // recent max in user coords
1933 
1934  ((TH2*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
1935  ((TH2*)player->GetHistogram())->Reset();
1936 
1937  // Get new Number of bins
1938  if (xfact > 0) xBinNumber = xfact*nx;
1939  if (xfact < 0) xBinNumber = (Int_t) ((-1)*nx/xfact+0.5);
1940  if (xBinNumber < 1) xBinNumber = 1;
1941  if (xBinNumber > 1000) xBinNumber= 1000;
1942  if (yfact > 0) yBinNumber = yfact*ny;
1943  if (yfact < 0) yBinNumber = (Int_t) ((-1)*ny/yfact+0.5);
1944  if (yBinNumber < 1) yBinNumber = 1;
1945  if (yBinNumber > 1000) yBinNumber= 1000;
1946  Double_t xOffset = 1.*fXBinOffsetSld->GetPosition()/100*((maxx-minx)/xBinNumber);
1947  Double_t yOffset = 1.*fYBinOffsetSld->GetPosition()/100*((maxy-miny)/yBinNumber);
1948  // create new histogram - the main job is done by sel->TakeAction()
1949 
1950  ((TH2*)player->GetHistogram())->SetBins(xBinNumber, minx-oldXOffset+xOffset,
1951  maxx-oldXOffset+xOffset,
1952  yBinNumber, miny-oldYOffset+yOffset,
1953  maxy-oldYOffset+yOffset);
1954  TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
1955  if (!sel) return;
1956  sel->TakeAction();
1957 
1958  // Restore and set all the attributes which were changed by TakeAction()
1959  fHist = (TH2*)((TTreePlayer*)TVirtualTreePlayer::GetCurrentPlayer())->GetHistogram();
1960  fSliderX->SetRange(1,xBinNumber);
1961  fSliderY->SetRange(1,yBinNumber);
1962  Double_t xBinWidth = xaxis->GetBinWidth(1);
1963  Double_t yBinWidth = yaxis->GetBinWidth(1);
1964  fSliderX->SetPosition(xaxis->FindBin(rminx+xBinWidth/2),
1965  xaxis->FindBin(rmaxx-xBinWidth/2));
1966  fSliderY->SetPosition(yaxis->FindBin(rminy+yBinWidth/2),
1967  yaxis->FindBin(rmaxy-yBinWidth/2));
1968  xOffset = 1.*fXBinOffsetSld->GetPosition()/100*xBinWidth; // nessesary ??
1969  yOffset = 1.*fYBinOffsetSld->GetPosition()/100*yBinWidth; // nessesary ??
1970 
1971  // SetRange in BinNumbers along x and y!
1972  xaxis->SetRange(xaxis->FindBin(rminx+xBinWidth/2),
1973  xaxis->FindBin(rmaxx-xBinWidth/2));
1974  yaxis->SetRange(yaxis->FindBin(rminy+yBinWidth/2),
1975  yaxis->FindBin(rmaxy-yBinWidth/2));
1976  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1977  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1978  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
1979  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
1980  fBinXNumberEntry1->SetNumber(xaxis->GetLast() - xaxis->GetFirst()+1);
1981  fBinYNumberEntry1->SetNumber(yaxis->GetLast() - yaxis->GetFirst()+1);
1984  fXOffsetNumberEntry->SetNumber(xOffset);
1985  fYOffsetNumberEntry->SetNumber(yOffset);
1987  xaxis->GetBinWidth(1));
1989  yaxis->GetBinWidth(1));
1991  // when you 2-clicks on a slider, sometimes it gets caught on wrong position! (2 or -2)
1993  // when you 2-clicks on a slider, sometimes it gets caught on wrong position! (2 or -2)
1994  Update();
1995 }
1996 
1997 ////////////////////////////////////////////////////////////////////////////////
1998 /// Slot connected to the rebin slider in case of an ntuple histogram.
1999 /// Updates the BinNumberEntryField during the BinSlider movement.
2000 
2002 {
2003  if (fAvoidSignal) return;
2004  TAxis* xaxis = fHist->GetXaxis();
2005  TAxis* yaxis = fHist->GetYaxis();
2006  Int_t firstx = xaxis->GetFirst();
2007  Int_t lastx = xaxis->GetLast();
2008  Int_t firsty = yaxis->GetFirst();
2009  Int_t lasty = yaxis->GetLast();
2010  Int_t xnumber = fBinXSlider1->GetPosition();
2011  Int_t ynumber = fBinYSlider1->GetPosition();
2012  Int_t numx = lastx-firstx+1;
2013  Int_t numy = lasty-firsty+1;
2014  Int_t xfact = 0;
2015  Int_t yfact = 0;
2016  Int_t xBinNumber = 0;
2017  Int_t yBinNumber = 0;
2018  if (xnumber >= 5) xfact = xnumber - 4;
2019  else xfact = xnumber - 6;
2020  if (xfact > 0) xBinNumber = xfact*numx;
2021  if (xfact < 0) xBinNumber = (Int_t) ((-1)*numx/xfact+0.5);
2022  if (xBinNumber < 1) xBinNumber = 1;
2023  if (xBinNumber > 1000) xBinNumber= 1000;
2024  if (fBinXNumberEntry1->GetNumber()!=xBinNumber)
2025  fBinXNumberEntry1->SetIntNumber(xBinNumber);
2026 
2027  if (ynumber >= 5) yfact = ynumber - 4;
2028  else yfact = ynumber - 6;
2029  if (yfact > 0) yBinNumber = yfact*numy;
2030  if (yfact < 0) yBinNumber = (Int_t) ((-1)*numy/yfact+0.5);
2031  if (yBinNumber < 1) yBinNumber = 1;
2032  if (yBinNumber > 1000) yBinNumber= 1000;
2033  if (fBinYNumberEntry1->GetNumber()!=yBinNumber)
2034  fBinYNumberEntry1->SetIntNumber(yBinNumber);
2035 }
2036 
2037 ////////////////////////////////////////////////////////////////////////////////
2038 /// Slot connected to the Bin Number Entry for the Rebin.
2039 
2041 {
2042  if (fAvoidSignal) return;
2043  Double_t oldXOffset = fXOffsetNumberEntry->GetNumber();
2045  Double_t oldYOffset = fYOffsetNumberEntry->GetNumber();
2047  TAxis* xaxis = fHist->GetXaxis();
2048  TAxis* yaxis = fHist->GetYaxis();
2050  if (!player) return;
2051  Int_t firstx = xaxis->GetFirst();
2052  Int_t lastx = xaxis->GetLast();
2053  Int_t firsty = yaxis->GetFirst();
2054  Int_t lasty = yaxis->GetLast();
2055  Int_t nx = xaxis->GetNbins();
2056  Int_t ny = yaxis->GetNbins();
2057  Double_t minx = xaxis->GetBinLowEdge(1); // overall min in user coords
2058  Double_t maxx = xaxis->GetBinUpEdge(nx); // overall max in user coords
2059  Double_t miny = yaxis->GetBinLowEdge(1); // overall min in user coords
2060  Double_t maxy = yaxis->GetBinUpEdge(ny); // overall max in user coords
2061  Double_t rminx = xaxis->GetBinLowEdge(firstx); // recent min in user coords
2062  Double_t rmaxx = xaxis->GetBinUpEdge(lastx); // recent max in user coords
2063  Double_t rminy = yaxis->GetBinLowEdge(firsty); // recent min in user coords
2064  Double_t rmaxy = yaxis->GetBinUpEdge(lasty); // recent max in user coords
2065 
2066  ((TH2*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2067  ((TH2*)player->GetHistogram())->Reset();
2068 
2069  // Calculate the new number of bins in the complete range
2070  Int_t xBinNumber = (Int_t) ((maxx-minx)/(rmaxx - rminx)*numx + 0.5);
2071  if (xBinNumber < 1) xBinNumber = 1;
2072  if (xBinNumber > 1000) xBinNumber= 1000;
2073  Double_t xOffset = 1.*(fXBinOffsetSld->GetPosition())/100*(maxx-minx)/xBinNumber;
2074  Int_t yBinNumber = (Int_t) ((maxy-miny)/(rmaxy - rminy)*numy + 0.5);
2075  if (yBinNumber < 1) yBinNumber = 1;
2076  if (yBinNumber > 1000) yBinNumber= 1000;
2077  Double_t yOffset = 1.*(fYBinOffsetSld->GetPosition())/100*(maxy-miny)/yBinNumber;
2078  // create new histogram - the main job is done by sel->TakeAction()
2079  ((TH2*)player->GetHistogram())->SetBins(xBinNumber, minx-oldXOffset+xOffset,
2080  maxx-oldXOffset+xOffset,
2081  yBinNumber, miny-oldYOffset+yOffset,
2082  maxy-oldYOffset+yOffset);
2083  TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2084  if (!sel) return;
2085  sel->TakeAction();
2086 
2087  // Restore and set all the attributes which were changed by TakeAction()
2088  fHist = (TH2*)((TTreePlayer*)TVirtualTreePlayer::GetCurrentPlayer())->GetHistogram();
2089  fSliderX->SetRange(1,xBinNumber);
2090  fSliderY->SetRange(1,yBinNumber);
2091  Double_t xBinWidth = xaxis->GetBinWidth(1);
2092  Double_t yBinWidth = yaxis->GetBinWidth(1);
2093  fSliderX->SetPosition(xaxis->FindBin(rminx+xBinWidth/2),
2094  xaxis->FindBin(rmaxx-xBinWidth/2));
2095  fSliderY->SetPosition(yaxis->FindBin(rminy+yBinWidth/2),
2096  yaxis->FindBin(rmaxy-yBinWidth/2));
2097  xOffset = 1.*fXBinOffsetSld->GetPosition()/100*xBinWidth; //nesessary ??
2098  yOffset = 1.*fYBinOffsetSld->GetPosition()/100*yBinWidth; //nesessary ??
2099 
2100  // SetRange in BinNumbers along x and y!
2101  xaxis->SetRange(xaxis->FindBin(rminx+xBinWidth/2),
2102  xaxis->FindBin(rmaxx-xBinWidth/2));
2103  yaxis->SetRange(yaxis->FindBin(rminy+yBinWidth/2),
2104  yaxis->FindBin(rmaxy-yBinWidth/2));
2105  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2106  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2107  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
2108  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
2109  fXOffsetNumberEntry->SetNumber(xOffset);
2111  fYOffsetNumberEntry->SetNumber(yOffset);
2113  Update();
2114 }
2115 
2116 ////////////////////////////////////////////////////////////////////////////////
2117 /// Slot connected to the OffSetSlider. It saves the OldBinOffset
2118 /// (nessesary for delay draw mode).
2119 
2121 {
2122  if (fAvoidSignal) return;
2125 }
2126 
2127 ////////////////////////////////////////////////////////////////////////////////
2128 /// Slot connected to the OffSetSlider that
2129 /// changes the origin of the histogram inbetween a binwidth;
2130 /// rebin the histogram with the new Offset given by the slider.
2131 /// problem: histogram with variable binwidth??
2132 
2134 {
2135  if (fAvoidSignal) return;
2136  if (fDelaydraw->GetState()==kButtonDown){
2139  TAxis* xaxis = fHist->GetXaxis();
2140  TAxis* yaxis = fHist->GetYaxis();
2141  Double_t xBinWidth = xaxis->GetBinWidth(1);
2142  Double_t yBinWidth = yaxis->GetBinWidth(1);
2143  Double_t xOffset = 1.*numx/100*xBinWidth;
2144  Double_t yOffset = 1.*numy/100*yBinWidth;
2145  Double_t oldXOffset = fOldXOffset;
2146  Double_t oldYOffset = fOldYOffset;
2147  Int_t nx = xaxis->GetNbins();
2148  Int_t ny = yaxis->GetNbins();
2149 
2151  if (!player) return;
2152 
2153  Int_t firstx = xaxis->GetFirst();
2154  Int_t lastx = xaxis->GetLast();
2155  Int_t firsty = yaxis->GetFirst();
2156  Int_t lasty = yaxis->GetLast();
2157  Double_t minx = xaxis->GetBinLowEdge(1); // overall min in user coords
2158  Double_t maxx = xaxis->GetBinUpEdge(nx); // overall max in user coords
2159  Double_t miny = yaxis->GetBinLowEdge(1); // overall min in user coords
2160  Double_t maxy = yaxis->GetBinUpEdge(ny); // overall max in user coords
2161  Double_t rminx = xaxis->GetBinLowEdge(firstx); // recent min in user coords
2162  Double_t rmaxx = xaxis->GetBinUpEdge(lastx); // recent max in user coords
2163  Double_t rminy = yaxis->GetBinLowEdge(firsty); // recent min in user coords
2164  Double_t rmaxy = yaxis->GetBinUpEdge(lasty); // recent max in user coords
2165 
2166  ((TH2*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2167  ((TH2*)player->GetHistogram())->Reset();
2168 
2169  ((TH2*)player->GetHistogram())->SetBins(nx, minx-oldXOffset+xOffset,
2170  maxx-oldXOffset+xOffset,
2171  ny, miny-oldYOffset+yOffset,
2172  maxy-oldYOffset+yOffset);
2173  TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2174  if (!sel) return;
2175  sel->TakeAction();
2176 
2177  // Restore all the attributes which were changed by TakeAction()
2178  fHist = (TH2*)((TTreePlayer*)TVirtualTreePlayer::GetCurrentPlayer())->GetHistogram();
2179 
2180  // SetRange in BinNumbers along x and y!
2181  xaxis->SetRange(xaxis->FindBin(rminx+xOffset-oldXOffset+xBinWidth/2),
2182  xaxis->FindBin(rmaxx+xOffset-oldXOffset-xBinWidth/2));
2183  yaxis->SetRange(yaxis->FindBin(rminy+yOffset-oldYOffset+yBinWidth/2),
2184  yaxis->FindBin(rmaxy+yOffset-oldYOffset-yBinWidth/2));
2185  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2186  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2187  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
2188  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
2189  fXOffsetNumberEntry->SetNumber(xOffset);
2190  fYOffsetNumberEntry->SetNumber(yOffset);
2191  Update();
2192  }
2193 }
2194 
2195 ////////////////////////////////////////////////////////////////////////////////
2196 /// Slot connected to the OffSetSlider.
2197 /// It changes the origin of the histogram inbetween a binwidth;
2198 /// rebin the histogram with the new offset given by the slider.
2199 /// problem: histogram with variable binwidth??
2200 
2202 {
2203  if (fAvoidSignal) return;
2206  TAxis* xaxis = fHist->GetXaxis();
2207  TAxis* yaxis = fHist->GetYaxis();
2208  Double_t xBinWidth = xaxis->GetBinWidth(1);
2209  Double_t yBinWidth = yaxis->GetBinWidth(1);
2210  Double_t xOffset = 1.*numx/100*xBinWidth;
2211  Double_t yOffset = 1.*numy/100*yBinWidth;
2212  if (fDelaydraw->GetState()==kButtonUp){
2213  Double_t oldXOffset = fXOffsetNumberEntry->GetNumber();
2214  Double_t oldYOffset = fYOffsetNumberEntry->GetNumber();
2215  Int_t nx = xaxis->GetNbins();
2216  Int_t ny = yaxis->GetNbins();
2217 
2219  if (!player) return;
2220 
2221  Int_t firstx = xaxis->GetFirst();
2222  Int_t lastx = xaxis->GetLast();
2223  Int_t firsty = yaxis->GetFirst();
2224  Int_t lasty = yaxis->GetLast();
2225  Double_t minx = xaxis->GetBinLowEdge(1); // overall min in user coords
2226  Double_t maxx = xaxis->GetBinUpEdge(nx); // overall max in user coords
2227  Double_t miny = yaxis->GetBinLowEdge(1); // overall min in user coords
2228  Double_t maxy = yaxis->GetBinUpEdge(ny); // overall max in user coords
2229  Double_t rminx = xaxis->GetBinLowEdge(firstx); // recent min in user coords
2230  Double_t rmaxx = xaxis->GetBinUpEdge(lastx); // recent max in user coords
2231  Double_t rminy = yaxis->GetBinLowEdge(firsty); // recent min in user coords
2232  Double_t rmaxy = yaxis->GetBinUpEdge(lasty); // recent max in user coords
2233 
2234  ((TH2*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2235  ((TH2*)player->GetHistogram())->Reset();
2236 
2237  ((TH2*)player->GetHistogram())->SetBins(nx,minx-oldXOffset+xOffset,
2238  maxx-oldXOffset+xOffset,
2239  ny, miny-oldYOffset+yOffset,
2240  maxy-oldYOffset+yOffset);
2241  TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2242  if (!sel) return;
2243  sel->TakeAction();
2244 
2245  // Restore all the attributes which were changed by TakeAction()
2246  fHist = (TH2*)((TTreePlayer*)TVirtualTreePlayer::GetCurrentPlayer())->GetHistogram();
2247 
2248  // SetRange in BinNumbers along x and y!
2249  xaxis->SetRange(xaxis->FindBin(rminx+xOffset-oldXOffset+xBinWidth/2),
2250  xaxis->FindBin(rmaxx+xOffset-oldXOffset-xBinWidth/2));
2251  yaxis->SetRange(yaxis->FindBin(rminy+yOffset-oldYOffset+yBinWidth/2),
2252  yaxis->FindBin(rmaxy+yOffset-oldYOffset-yBinWidth/2));
2253  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2254  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2255  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
2256  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
2259  Update();
2260  }
2261  fXOffsetNumberEntry->SetNumber(xOffset);
2262  fYOffsetNumberEntry->SetNumber(yOffset);
2265 }
2266 
2267 ////////////////////////////////////////////////////////////////////////////////
2268 /// Slot connected to the OffSetNumberEntry, related to the OffSetSlider
2269 /// changes the origin of the histogram inbetween a binwidth.
2270 
2272 {
2273  if (fAvoidSignal) return;
2274  TAxis* xaxis = fHist->GetXaxis();
2275  TAxis* yaxis = fHist->GetYaxis();
2276  Double_t xBinWidth = xaxis->GetBinWidth(1);
2277  Double_t yBinWidth = yaxis->GetBinWidth(1);
2278  Double_t xOffset = fXOffsetNumberEntry->GetNumber();
2279  Double_t oldXOffset = 1.*fXBinOffsetSld->GetPosition()/100*xBinWidth;
2280  Double_t yOffset = fYOffsetNumberEntry->GetNumber();
2281  Double_t oldYOffset = 1.*fYBinOffsetSld->GetPosition()/100*yBinWidth;
2282  Int_t nx = xaxis->GetNbins();
2283  Int_t ny = yaxis->GetNbins();
2285  if (!player) return;
2286  Int_t firstx = xaxis->GetFirst();
2287  Int_t lastx = xaxis->GetLast();
2288  Int_t firsty = yaxis->GetFirst();
2289  Int_t lasty = yaxis->GetLast();
2290  Double_t minx = xaxis->GetBinLowEdge(1); // overall min in user coords
2291  Double_t maxx = xaxis->GetBinUpEdge(nx); // overall max in user coords
2292  Double_t miny = yaxis->GetBinLowEdge(1); // overall min in user coords
2293  Double_t maxy = yaxis->GetBinUpEdge(ny); // overall max in user coords
2294  Double_t rminx = xaxis->GetBinLowEdge(firstx); // recent min in user coords
2295  Double_t rmaxx = xaxis->GetBinUpEdge(lastx); // recent max in user coords
2296  Double_t rminy = yaxis->GetBinLowEdge(firsty); // recent min in user coords
2297  Double_t rmaxy = yaxis->GetBinUpEdge(lasty); // recent max in user coords
2298 
2299  ((TH2*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2300  ((TH2*)player->GetHistogram())->Reset();
2301 
2302  ((TH2*)player->GetHistogram())->SetBins(nx,minx+xOffset-oldXOffset,
2303  maxx+xOffset-oldXOffset,
2304  ny,miny+yOffset-oldYOffset,
2305  maxy+yOffset-oldYOffset);
2306  TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2307  if (!sel) return;
2308  sel->TakeAction();
2309 
2310  // Restore all the attributes which were changed by TakeAction()
2311  fHist = (TH2*)((TTreePlayer*)TVirtualTreePlayer::GetCurrentPlayer())->GetHistogram();
2312 
2313  // SetRange in BinNumbers along x and y!
2314  xaxis->SetRange(xaxis->FindBin(rminx+xOffset-oldXOffset+xBinWidth/2),
2315  xaxis->FindBin(rmaxx+xOffset-oldXOffset-xBinWidth/2));
2316  yaxis->SetRange(yaxis->FindBin(rminy+yOffset-oldYOffset+yBinWidth/2),
2317  yaxis->FindBin(rmaxy+yOffset-oldYOffset-yBinWidth/2));
2318  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2319  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2320  fXBinOffsetSld->SetPosition((Int_t)(xOffset/xBinWidth*100));
2321  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
2322  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
2323  fYBinOffsetSld->SetPosition((Int_t)(yOffset/yBinWidth*100));
2324  Update();
2325 }
2326 
2327 ////////////////////////////////////////////////////////////////////////////////
2328 /// Slot connected to the x-Slider that redraws the histogram
2329 /// with the new slider range.
2330 
2332 {
2333  if (fAvoidSignal) return;
2334  TAxis* xaxis = fHist->GetXaxis();
2336  // 2D plot
2337  Int_t px1,py1,px2,py2;
2338  Float_t ymin,ymax,xleft,xright;
2339  xleft = xaxis->GetBinLowEdge((Int_t)((fSliderX->GetMinPosition())+0.5));
2340  xright = xaxis->GetBinUpEdge((Int_t)((fSliderX->GetMaxPosition())+0.5));
2341  ymin = fGedEditor->GetPad()->GetUymin();
2342  ymax = fGedEditor->GetPad()->GetUymax();
2343  px1 = fGedEditor->GetPad()->XtoAbsPixel(xleft);
2344  py1 = fGedEditor->GetPad()->YtoAbsPixel(ymin);
2345  px2 = fGedEditor->GetPad()->XtoAbsPixel(xright);
2346  py2 = fGedEditor->GetPad()->YtoAbsPixel(ymax);
2347  if (fGedEditor->GetPad()->GetCanvas())
2349  fGedEditor->GetPad()->cd();
2350  fGedEditor->GetPad()->SetLineWidth(1);
2351  fGedEditor->GetPad()->SetLineColor(2);
2353  gVirtualX->DrawBox(px1, py1, px2, py2, TVirtualX::kHollow);
2354  fPx1old = px1;
2355  fPy1old = py1;
2356  fPx2old = px2 ;
2357  fPy2old = py2;
2358  gVirtualX->Update(0);
2359  fSldXMin->SetNumber(xleft);
2360  fSldXMax->SetNumber(xright);
2361  } else if (fDelaydraw->GetState()==kButtonDown &&
2362  fDim0->GetState()==kButtonDown &&
2364  // 3D plot
2365  Float_t p1[3], p2[3], p3[3], p4[3], p5[3], p6[3], p7[3], p8[3];
2366  if (fGedEditor->GetPad()->GetCanvas())
2368  fGedEditor->GetPad()->cd();
2369  TView *fView = fGedEditor->GetPad()->GetView();
2370  if (!fView) return;
2371  Double_t *rmin = fView->GetRmin();
2372  if (!rmin) return;
2373  Double_t *rmax = fView->GetRmax();
2374  if (!rmax) return;
2375  p1[0] = p4[0] = p5[0] = p8[0] =
2376  xaxis->GetBinLowEdge((Int_t)((fSliderX->GetMinPosition())+0.5));
2377  p2[0] = p3[0] = p6[0] = p7[0] =
2378  xaxis->GetBinUpEdge((Int_t)((fSliderX->GetMaxPosition())+0.5));
2379  p1[1] = p2[1] = p3[1] = p4[1] = rmin[1];
2380  p5[1] = p6[1] = p7[1] = p8[1] = rmax[1];
2381  p1[2] = p2[2] = p5[2] = p6[2] = rmin[2];
2382  p3[2] = p4[2] = p7[2] = p8[2] = rmax[2];
2383  fGedEditor->GetPad()->SetLineWidth(1);
2384  fGedEditor->GetPad()->SetLineColor(2);
2387  PaintBox3D(p2, p3, p7, p6);
2388  PaintBox3D(p1, p4, p8, p5);
2389  for (Int_t i = 0; i<3; i++){
2390  fP1oldx[i] = p1[i];
2391  fP2oldx[i] = p2[i];
2392  fP3oldx[i] = p3[i];
2393  fP4oldx[i] = p4[i];
2394  fP5oldx[i] = p5[i];
2395  fP6oldx[i] = p6[i];
2396  fP7oldx[i] = p7[i];
2397  fP8oldx[i] = p8[i];
2398  }
2399  fSldXMin->SetNumber(p1[0]);
2400  fSldXMax->SetNumber(p2[0]);
2401  } else if (fDelaydraw->GetState()==kButtonDown &&
2402  fDim0->GetState()==kButtonDown) {
2405  } else {
2407  (Int_t)((fSliderX->GetMaxPosition())+0.5));
2408  fSldXMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2409  fSldXMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2411  Update();
2412  }
2415 }
2416 
2417 ////////////////////////////////////////////////////////////////////////////////
2418 /// Slot connected to the x axis range slider that initialises
2419 /// the "virtual" box which is drawn in delay draw mode.
2420 
2422 {
2423  if (fAvoidSignal) return;
2424  TAxis* xaxis = fHist->GetXaxis();
2425  Float_t ymin,ymax,xleft,xright;
2427  // 2D Plot
2428  if (!fGedEditor->GetPad()) return;
2429  fGedEditor->GetPad()->cd();
2430  if (fGedEditor->GetPad()->GetCanvas())
2432  fGedEditor->GetPad()->SetLineWidth(1);
2433  fGedEditor->GetPad()->SetLineColor(2);
2434  xleft = xaxis->GetBinLowEdge((Int_t)((fSliderX->GetMinPosition())+0.5));
2435  xright = xaxis->GetBinUpEdge((Int_t)((fSliderX->GetMaxPosition())+0.5));
2436  ymin = fGedEditor->GetPad()->GetUymin();
2437  ymax = fGedEditor->GetPad()->GetUymax();
2438  fPx1old = fGedEditor->GetPad()->XtoAbsPixel(xleft);
2440  fPx2old = fGedEditor->GetPad()->XtoAbsPixel(xright);
2443  } else if (fDelaydraw->GetState()==kButtonDown &&
2444  fDim0->GetState()==kButtonDown &&
2446  // 3D plot
2447  if (!fGedEditor->GetPad()) return;
2448  fGedEditor->GetPad()->cd();
2449  TView *fView = fGedEditor->GetPad()->GetView();
2450  if (!fView) return;
2451  Double_t *rmin = fView->GetRmin();
2452  if (!rmin) return;
2453  Double_t *rmax = fView->GetRmax();
2454  if (!rmax) return;
2455  fP1oldx[0] = fP4oldx[0] = fP5oldx[0] = fP8oldx[0] =
2456  xaxis->GetBinLowEdge((Int_t)((fSliderX->GetMinPosition())+0.5));
2457  fP2oldx[0] = fP3oldx[0] = fP6oldx[0] = fP7oldx[0] =
2458  xaxis->GetBinUpEdge((Int_t)((fSliderX->GetMaxPosition())+0.5));
2459  fP1oldx[1] = fP2oldx[1] = fP3oldx[1] = fP4oldx[1] = rmin[1];
2460  fP5oldx[1] = fP6oldx[1] = fP7oldx[1] = fP8oldx[1] = rmax[1];
2461  fP1oldx[2] = fP2oldx[2] = fP5oldx[2] = fP6oldx[2] = rmin[2];
2462  fP3oldx[2] = fP4oldx[2] = fP7oldx[2] = fP8oldx[2] = rmax[2];
2463  if (fGedEditor->GetPad()->GetCanvas())
2465  fGedEditor->GetPad()->SetLineWidth(1);
2466  fGedEditor->GetPad()->SetLineColor(2);
2469  }
2470 }
2471 
2472 ////////////////////////////////////////////////////////////////////////////////
2473 /// Slot connected to the x-axis slider finalizing values after
2474 /// the slider movement.
2475 
2477 {
2478  if (fAvoidSignal) return;
2479  if (fDelaydraw->GetState()==kButtonDown) {
2481  (Int_t)((fSliderX->GetMaxPosition())+0.5));
2484  Update();
2485  }
2487  if (player) if (player->GetHistogram() == fHist) {
2488  Int_t last = fHist->GetXaxis()->GetLast();
2489  Int_t first = fHist->GetXaxis()->GetFirst();
2491  Update();
2492  }
2493 }
2494 
2495 ////////////////////////////////////////////////////////////////////////////////
2496 /// Slot connected to the Max/Min number entry fields showing x-axis range.
2497 
2499 {
2500  TAxis* xaxis = fHist->GetXaxis();
2501  Int_t nx = xaxis->GetNbins();
2502  Double_t width = xaxis->GetBinWidth(1);
2503  if ((fSldXMin->GetNumber()+width/2) < (xaxis->GetBinLowEdge(1)))
2504  fSldXMin->SetNumber(xaxis->GetBinLowEdge(1));
2505  if ((fSldXMax->GetNumber()-width/2) > (xaxis->GetBinUpEdge(nx)))
2506  fSldXMax->SetNumber(xaxis->GetBinUpEdge(nx));
2507  xaxis->SetRangeUser(fSldXMin->GetNumber()+width/2,
2508  fSldXMax->GetNumber()-width/2);
2509  Int_t nxbinmin = xaxis->GetFirst();
2510  Int_t nxbinmax = xaxis->GetLast();
2511  fSliderX->SetPosition((Double_t)(nxbinmin),(Double_t)(nxbinmax));
2512  Update();
2513 }
2514 
2515 ////////////////////////////////////////////////////////////////////////////////
2516 /// Slot connected to the x-slider for redrawing the
2517 /// histogram with the new slider Range (immediately).
2518 
2520 {
2521  if (fAvoidSignal) return;
2522  TAxis* yaxis = fHist->GetYaxis();
2524  Int_t px1,py1,px2,py2;
2525  Float_t xmin,xmax,ybottom,ytop;
2526  ybottom = yaxis->GetBinLowEdge((Int_t)((fSliderY->GetMinPosition())+0.5));
2527  ytop = yaxis->GetBinUpEdge((Int_t)((fSliderY->GetMaxPosition())+0.5));
2528  xmin = fGedEditor->GetPad()->GetUxmin();
2529  xmax = fGedEditor->GetPad()->GetUxmax();
2530  px1 = fGedEditor->GetPad()->XtoAbsPixel(xmin);
2531  py1 = fGedEditor->GetPad()->YtoAbsPixel(ybottom);
2532  px2 = fGedEditor->GetPad()->XtoAbsPixel(xmax);
2533  py2 = fGedEditor->GetPad()->YtoAbsPixel(ytop);
2534  if (fGedEditor->GetPad()->GetCanvas())
2536  fGedEditor->GetPad()->cd();
2537  fGedEditor->GetPad()->SetLineWidth(1);
2538  fGedEditor->GetPad()->SetLineColor(2);
2540  gVirtualX->DrawBox(px1, py1, px2, py2, TVirtualX::kHollow);
2541  fPx1old = px1;
2542  fPy1old = py1;
2543  fPx2old = px2 ;
2544  fPy2old = py2;
2545  gVirtualX->Update(0);
2546  fSldYMin->SetNumber(ybottom);
2547  fSldYMax->SetNumber(ytop);
2548  } else if (fDelaydraw->GetState()==kButtonDown &&
2549  fDim0->GetState()==kButtonDown &&
2551  // 3D plot
2552  Float_t p1[3], p2[3], p3[3], p4[3], p5[3], p6[3], p7[3], p8[3];
2553  if (fGedEditor->GetPad()->GetCanvas())
2555  fGedEditor->GetPad()->cd();
2556  TView *fView = fGedEditor->GetPad()->GetView();
2557  if (!fView) return;
2558  Double_t *rmin = fView->GetRmin();
2559  if (!rmin) return;
2560  Double_t *rmax = fView->GetRmax();
2561  if (!rmax) return;
2562  p1[0] = p2[0] = p3[0] = p4[0] = rmin[0];
2563  p5[0] = p6[0] = p7[0] = p8[0] = rmax[0];
2564  p1[1] = p4[1] = p5[1] = p8[1] =
2565  yaxis->GetBinLowEdge((Int_t)((fSliderY->GetMinPosition())+0.5));
2566  p2[1] = p3[1] = p6[1] = p7[1] =
2567  yaxis->GetBinUpEdge((Int_t)((fSliderY->GetMaxPosition())+0.5));
2568  p1[2] = p2[2] = p5[2] = p6[2] = rmin[2];
2569  p3[2] = p4[2] = p7[2] = p8[2] = rmax[2];
2570  fGedEditor->GetPad()->SetLineWidth(1);
2571  fGedEditor->GetPad()->SetLineColor(2);
2574  PaintBox3D(p2, p3, p7, p6);
2575  PaintBox3D(p1, p4, p8, p5);
2576  for (Int_t i = 0; i<3; i++) {
2577  fP1oldy[i] = p1[i];
2578  fP2oldy[i] = p2[i];
2579  fP3oldy[i] = p3[i];
2580  fP4oldy[i] = p4[i];
2581  fP5oldy[i] = p5[i];
2582  fP6oldy[i] = p6[i];
2583  fP7oldy[i] = p7[i];
2584  fP8oldy[i] = p8[i];
2585  }
2586  fSldYMin->SetNumber(p1[1]);
2587  fSldYMax->SetNumber(p2[1]);
2588  } else if (fDelaydraw->GetState()==kButtonDown &&
2589  fDim0->GetState()==kButtonDown) {
2592  } else {
2593  yaxis->SetRange((Int_t)((fSliderY->GetMinPosition())+0.5),
2594  (Int_t)((fSliderY->GetMaxPosition())+0.5));
2595  fSldYMin->SetNumber(yaxis->GetBinLowEdge(yaxis->GetFirst()));
2596  fSldYMax->SetNumber(yaxis->GetBinUpEdge(yaxis->GetLast()));
2598  Update();
2599  }
2602 }
2603 
2604 ////////////////////////////////////////////////////////////////////////////////
2605 /// Slot connected to y-axis slider which initialises
2606 /// the "virtual" box which is drawn in delay draw mode.
2607 
2609 {
2610  if (fAvoidSignal) return;
2611  TAxis* yaxis = fHist->GetYaxis();
2612  Float_t xmin,xmax,ytop,ybottom;
2614  // 2D plot:
2615  if (!fGedEditor->GetPad()) return;
2616  fGedEditor->GetPad()->cd();
2617  if (fGedEditor->GetPad()->GetCanvas())
2619  fGedEditor->GetPad()->SetLineWidth(1);
2620  fGedEditor->GetPad()->SetLineColor(2);
2621  ybottom = yaxis->GetBinLowEdge((Int_t)((fSliderY->GetMinPosition())+0.5));
2622  ytop = yaxis->GetBinUpEdge((Int_t)((fSliderY->GetMaxPosition())+0.5));
2623  xmin = fGedEditor->GetPad()->GetUxmin();
2624  xmax = fGedEditor->GetPad()->GetUxmax();
2626  fPy1old = fGedEditor->GetPad()->YtoAbsPixel(ybottom);
2628  fPy2old = fGedEditor->GetPad()->YtoAbsPixel(ytop);
2630  } else if (fDelaydraw->GetState()==kButtonDown &&
2631  fDim0->GetState()==kButtonDown &&
2633  // 3D plot
2634  if (!fGedEditor->GetPad()) return;
2635  fGedEditor->GetPad()->cd();
2636  TView *fView = fGedEditor->GetPad()->GetView();
2637  if (!fView) return;
2638  Double_t *rmin = fView->GetRmin();
2639  if (!rmin) return;
2640  Double_t *rmax = fView->GetRmax();
2641  if (!rmax) return;
2642  fP1oldy[0] = fP2oldy[0] = fP3oldy[0] = fP4oldy[0] = rmin[0];
2643  fP5oldy[0] = fP6oldy[0] = fP7oldy[0] = fP8oldy[0] = rmax[0];
2644  fP1oldy[1] = fP4oldy[1] = fP5oldy[1] = fP8oldy[1] =
2645  yaxis->GetBinLowEdge((Int_t)((fSliderY->GetMinPosition())+0.5));
2646  fP2oldy[1] = fP3oldy[1] = fP6oldy[1] = fP7oldy[1] =
2647  yaxis->GetBinUpEdge((Int_t)((fSliderY->GetMaxPosition())+0.5));
2648  fP1oldy[2] = fP2oldy[2] = fP5oldy[2] = fP6oldy[2] = rmin[2];
2649  fP3oldy[2] = fP4oldy[2] = fP7oldy[2] = fP8oldy[2] = rmax[2];
2650  if (fGedEditor->GetPad()->GetCanvas())
2652  fGedEditor->GetPad()->SetLineWidth(1);
2653  fGedEditor->GetPad()->SetLineColor(2);
2656  }
2657 }
2658 
2659 ////////////////////////////////////////////////////////////////////////////////
2660 /// Slot connected to the y-axis slider finalizing values after
2661 /// the slider movement.
2662 
2664 {
2665  if (fAvoidSignal) return;
2666  if (fDelaydraw->GetState()==kButtonDown) {
2668  (Int_t)((fSliderY->GetMaxPosition())+0.5));
2671  Update();
2672  }
2673 
2675  if (player) if (player->GetHistogram() == fHist) {
2676  Int_t last = fHist->GetYaxis()->GetLast();
2677  Int_t first = fHist->GetYaxis()->GetFirst();
2679  Update();
2680  }
2681 }
2682 
2683 ////////////////////////////////////////////////////////////////////////////////
2684 /// Slot connected to the Max/Min number entry fields showing y-axis range.
2685 
2687 {
2688  if (fAvoidSignal) return;
2689  TAxis* yaxis = fHist->GetYaxis();
2690  Int_t ny = yaxis->GetNbins();
2691  Double_t width = yaxis->GetBinWidth(1);
2692 
2693  if ((fSldYMin->GetNumber()+width/2) < (yaxis->GetBinLowEdge(1)))
2694  fSldYMin->SetNumber(yaxis->GetBinLowEdge(1));
2695  if ((fSldYMax->GetNumber()-width/2) > (yaxis->GetBinUpEdge(ny)))
2696  fSldYMax->SetNumber(yaxis->GetBinUpEdge(ny));
2697 
2698  yaxis->SetRangeUser(fSldYMin->GetNumber()+width/2,
2699  fSldYMax->GetNumber()-width/2);
2700  Int_t nybinmin = yaxis -> GetFirst();
2701  Int_t nybinmax = yaxis -> GetLast();
2702  fSliderY->SetPosition((Double_t)(nybinmin),(Double_t)(nybinmax));
2703  Update();
2704 }
2705 
2706 ////////////////////////////////////////////////////////////////////////////////
2707 /// Slot connected to the fill area color.
2708 
2710 {
2711  if (fAvoidSignal || !fGedEditor->GetPad()) return;
2712  fGedEditor->GetPad()->cd();
2714  Update();
2715 }
2716 
2717 ////////////////////////////////////////////////////////////////////////////////
2718 /// Slot connected to the fill area pattern.
2719 
2721 {
2722  if (fAvoidSignal || !fGedEditor->GetPad()) return;
2723  fGedEditor->GetPad()->cd();
2725  Update();
2726 }
2727 
2728 ////////////////////////////////////////////////////////////////////////////////
2729 /// Return the immediate histogram type (HIST, LEGO1-4, SURF1-5).
2730 
2732 {
2733  TString s="";
2734  switch (fTypeCombo->GetSelected()){
2735  case (-1) : {s = ""; break;}
2736  case (kTYPE_LEGO ): {s = "LEGO"; break;}
2737  case (kTYPE_LEGO1): {s = "LEGO1"; break;}
2738  case (kTYPE_LEGO2): {s = "LEGO2"; break;}
2739  case (kTYPE_LEGO3): {s = "LEGO3"; break;}
2740  case (kTYPE_LEGO4): {s = "LEGO4"; break;}
2741  case (kTYPE_SURF ): {s = "SURF"; break;}
2742  case (kTYPE_SURF1): {s = "SURF1"; break;}
2743  case (kTYPE_SURF2): {s = "SURF2"; break;}
2744  case (kTYPE_SURF3): {s = "SURF3"; break;}
2745  case (kTYPE_SURF4): {s = "SURF4"; break;}
2746  case (kTYPE_SURF5): {s = "SURF5"; break;}
2747  default: break;
2748  }
2749  return s;
2750 }
2751 
2752 ////////////////////////////////////////////////////////////////////////////////
2753 /// Return the immediate coordinate system of the histogram.
2754 /// (POL, CYL, SPH,PSR)
2755 
2757 {
2758  TString s="";
2759  switch (fCoordsCombo->GetSelected()){
2760  case (-1) : {s = ""; break;}
2761  case (kCOORDS_CAR): {s = ""; break;}
2762  case (kCOORDS_POL): {s = "POL"; break;}
2763  case (kCOORDS_CYL): {s = "CYL"; break;}
2764  case (kCOORDS_SPH): {s = "SPH"; break;}
2765  case (kCOORDS_PSR): {s = "PSR"; break;}
2766  default: break;
2767  }
2768  return s;
2769 }
2770 
2771 ////////////////////////////////////////////////////////////////////////////////
2772 /// Returns histogram contour option (None,Cont0..5).
2773 
2775 {
2776  TString s="";
2777  switch (fContCombo->GetSelected()){
2778  case (-1) : {s = ""; break;}
2779  case (kCONT_NONE) : {s = ""; break;}
2780  case (kCONT_0) : {s = "CONT0"; break;}
2781  case (kCONT_1) : {s = "CONT1"; break;}
2782  case (kCONT_2) : {s = "CONT2"; break;}
2783  case (kCONT_3) : {s = "CONT3"; break;}
2784  case (kCONT_4) : {s = "CONT4"; break;}
2785  default: break;
2786  }
2787  return s;
2788 }
2789 
2790 ////////////////////////////////////////////////////////////////////////////////
2791 /// Return histogram additive options (Arr,Box,Col,Scat,Col,Text,E,Z,FB,BB).
2792 
2794 {
2795  TString s="";
2796  if (fDim->GetState()==kButtonDown) {
2797  if (fAddArr->GetState()==kButtonDown) s+="ARR";
2798  if (fAddBox->GetState()==kButtonDown) s+="BOX";
2799  if (fAddCol->GetState()==kButtonDown) s+="COL";
2800  if (fAddScat->GetState()==kButtonDown) s+="SCAT";
2801  if (fAddText->GetState()==kButtonDown) s+="TEXT";
2802  if (fAddPalette->GetState()==kButtonDown) s+="Z";
2803  } else if (fDim0->GetState()==kButtonDown){
2804  if (fAddPalette1->GetState()==kButtonDown) s+="Z";
2805  if (fAddError->GetState()==kButtonDown) s+="E";
2806  if (fAddFB->GetState()==kButtonUp) s+="FB";
2807  if (fAddBB->GetState()==kButtonUp) s+="BB";
2808  }
2809  return s;
2810 }
2811 
2812 ////////////////////////////////////////////////////////////////////////////////
2813 /// Return draw option string related to graphical cut in use.
2814 
2816 {
2817  TString cutopt = " ";
2818  TString opt = GetDrawOption();
2819  Int_t scut = opt.First('[');
2820  if (scut != -1) {
2821  Int_t ecut = opt.First(']');
2822  cutopt += opt(scut,ecut);
2823  }
2824  return cutopt;
2825 }
2826 
2827 ////////////////////////////////////////////////////////////////////////////////
2828 /// Create histogram type combo box.
2829 
2831 {
2832  TGComboBox *c = new TGComboBox(parent, id);
2833 
2834  c->AddEntry("Lego" , kTYPE_LEGO);
2835  c->AddEntry("Lego1", kTYPE_LEGO1);
2836  c->AddEntry("Lego2", kTYPE_LEGO2);
2837  c->AddEntry("Lego3", kTYPE_LEGO3);
2838  c->AddEntry("Lego4", kTYPE_LEGO4);
2839  c->AddEntry("Surf" , kTYPE_SURF);
2840  c->AddEntry("Surf1", kTYPE_SURF1);
2841  c->AddEntry("Surf2", kTYPE_SURF2);
2842  c->AddEntry("Surf3", kTYPE_SURF3);
2843  c->AddEntry("Surf4", kTYPE_SURF4);
2844  c->AddEntry("Surf5", kTYPE_SURF5);
2845 
2846  return c;
2847 }
2848 
2849 ////////////////////////////////////////////////////////////////////////////////
2850 /// Create coordinate system combo box.
2851 
2853 {
2854  TGComboBox *c = new TGComboBox(parent, id);
2855 
2856  c->AddEntry("Cartesian", kCOORDS_CAR);
2857  c->AddEntry("Cylindric", kCOORDS_CYL);
2858  c->AddEntry("Polar", kCOORDS_POL);
2859  c->AddEntry("Rapidity", kCOORDS_PSR);
2860  c->AddEntry("Spheric", kCOORDS_SPH);
2861  TGListBox* lb = c->GetListBox();
2862  lb->Resize(lb->GetWidth(), 83);
2863 
2864  return c;
2865 }
2866 
2867 ////////////////////////////////////////////////////////////////////////////////
2868 /// Create contour combo box.
2869 
2871 {
2872  TGComboBox *c = new TGComboBox(parent, id);
2873 
2874  c->AddEntry("None" , kCONT_NONE);
2875  c->AddEntry("Cont0", kCONT_0);
2876  c->AddEntry("Cont1", kCONT_1);
2877  c->AddEntry("Cont2", kCONT_2);
2878  c->AddEntry("Cont3", kCONT_3);
2879  c->AddEntry("Cont4", kCONT_4);
2880 
2881  return c;
2882 }
2883 
2884 ////////////////////////////////////////////////////////////////////////////////
2885 /// Paint a square in 3D.
2886 
2888 {
2889  fGedEditor->GetPad()->PaintLine3D(p1, p2);
2890  fGedEditor->GetPad()->PaintLine3D(p2, p3);
2891  fGedEditor->GetPad()->PaintLine3D(p3, p4);
2892  fGedEditor->GetPad()->PaintLine3D(p4, p1);
2893 }
2894 ////////////////////////////////////////////////////////////////////////////////
2895 /// Give an array of dividers of n (without the trivial divider n))
2896 /// in the first entry the number of dividers is saved.
2897 
2899 {
2900  Int_t* div;
2901  if (n <= 0) {
2902  div = new Int_t[1];
2903  div[0]=0;
2904  } else if (n == 1) {
2905  div = new Int_t[2];
2906  div[0]=div[1]=1;
2907  } else {
2908  div = new Int_t[(Int_t) n/2+2];
2909  div[0]=0;
2910  div[1]=1;
2911 
2912  Int_t num = 1;
2913  for (Int_t i=2; i <= n/2; i++) {
2914  if (n % i == 0) {
2915  num++;
2916  div[num] = i;
2917  }
2918  }
2919  num++;
2920  div[num]=n;
2921  div[0] = num;
2922  }
2923  return div;
2924 }
2925 
2926 ////////////////////////////////////////////////////////////////////////////////
2927 /// Skip TH1Editor in building list of editors.
2928 
2930 {
2931  fGedEditor->ActivateEditors(TH1::Class()->GetListOfBases(), kTRUE);
2932 }
2933 
2934 ////////////////////////////////////////////////////////////////////////////////
2935 /// If the contained histogram obj is deleted we must set its pointer to zero
2936 
2938 {
2939  if (obj == fHist) {
2940  fHist = 0;
2941  }
2942 }
2943 
TGComboBox.h
TGedFrame::GetDrawOption
virtual Option_t * GetDrawOption() const
Get draw options of the selected object.
Definition: TGedFrame.cxx:81
c
#define c(i)
Definition: RSha256.hxx:119
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:398
TH2Editor::DoBinPressed
virtual void DoBinPressed()
Slot connected to the rebin slider in case of no ntuple histogram.
Definition: TH2Editor.cxx:1658
kMBIconQuestion
@ kMBIconQuestion
Definition: TGMsgBox.h:40
TGTab::GetCurrent
Int_t GetCurrent() const
Definition: TGTab.h:105
TH2Editor::fAddError
TGCheckButton * fAddError
Definition: TH2Editor.h:64
kTEXT_ONOFF
@ kTEXT_ONOFF
Definition: TH2Editor.cxx:166
TH2Editor::fTypeCombo
TGComboBox * fTypeCombo
Definition: TH2Editor.h:48
ROOT::Math::rowOffsetsUtils::make
constexpr std::array< decltype(std::declval< F >)(std::declval< int >))), N > make(F f)
Definition: MatrixRepresentationsStatic.h:185
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
TGListBox
Definition: TGListBox.h:288
TGButtonGroup::SetButton
virtual void SetButton(Int_t id, Bool_t down=kTRUE)
Sets the button with id to be on/down, and if this is an exclusive group, all other button in the gro...
Definition: TGButtonGroup.cxx:334
kTYPE_SURF2
@ kTYPE_SURF2
Definition: TH2Editor.cxx:163
TH2Editor::fBinXCont1
TGCompositeFrame * fBinXCont1
Definition: TH2Editor.h:85
n
const Int_t n
Definition: legend1.C:16
kBAR_WIDTH
@ kBAR_WIDTH
Definition: TH2Editor.cxx:168
TAxis
Class to manage histogram axis.
Definition: TAxis.h:30
TVirtualPad::GetCanvas
virtual TCanvas * GetCanvas() const =0
first
Definition: first.py:1
TH1::kNoAxis
@ kNoAxis
NOTE: Must always be 0 !!!
Definition: TH1.h:70
ymax
float ymax
Definition: THbookFile.cxx:95
TH2Editor::fApply
TGTextButton * fApply
Definition: TH2Editor.h:83
TGWindow
Definition: TGWindow.h:31
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1203
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TTreePlayer.h
TGTextEntry::SetText
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Definition: TGTextEntry.cxx:623
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
Style_t
short Style_t
Definition: RtypesCore.h:80
TH2Editor::Dividers
Int_t * Dividers(Int_t n)
Give an array of dividers of n (without the trivial divider n)) in the first entry the number of divi...
Definition: TH2Editor.cxx:2898
TGNumberFormat::kNELLimitMinMax
@ kNELLimitMinMax
Definition: TGNumberEntry.h:65
TAttPad::SetFrameFillStyle
void SetFrameFillStyle(Style_t styl=0)
Definition: TAttPad.h:81
TGMainFrame
Definition: TGFrame.h:444
TH2Editor::fXOffsetNumberEntry
TGNumberEntryField * fXOffsetNumberEntry
Definition: TH2Editor.h:88
TAxis::GetBinLowEdge
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Definition: TAxis.cxx:518
TH2Editor::GetHistCoordsLabel
TString GetHistCoordsLabel()
Return the immediate coordinate system of the histogram.
Definition: TH2Editor.cxx:2756
TH2Editor::fPx2old
Int_t fPx2old
Definition: TH2Editor.h:124
TH2Editor::fBinYNumberEntry1
TGNumberEntryField * fBinYNumberEntry1
Definition: TH2Editor.h:93
kTYPE_LEGO2
@ kTYPE_LEGO2
Definition: TH2Editor.cxx:162
TH1::SetContour
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
Definition: TH1.cxx:7946
TGDoubleSlider.h
TH2Editor::fP8oldy
Float_t fP8oldy[3]
Definition: TH2Editor.h:141
TVirtualX::kHollow
@ kHollow
Definition: TVirtualX.h:50
TGedFrame::CreateEditorTabSubFrame
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
TH2Editor::DoTitle
virtual void DoTitle(const char *text)
Slot connected to the histogram title setting.
Definition: TH2Editor.cxx:1066
TGDoubleSlider::SetRange
virtual void SetRange(Float_t min, Float_t max)
Definition: TGDoubleSlider.h:116
TVirtualPad::Update
virtual void Update()=0
TGSlider::GetPosition
virtual Int_t GetPosition() const
Definition: TGSlider.h:109
TGHorizontal3DLine
Definition: TG3DLine.h:29
TH2Editor::fP6oldy
Float_t fP6oldy[3]
Definition: TH2Editor.h:139
TGedPatternSelect::SetPattern
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
Definition: TGedPatternSelect.cxx:675
TH2Editor::fAddFB
TGCheckButton * fAddFB
Definition: TH2Editor.h:71
TH2Editor::fColContLbl
TGLabel * fColContLbl
Definition: TH2Editor.h:51
TGSlider::GetMaxPosition
virtual Int_t GetMaxPosition() const
Definition: TGSlider.h:111
TH2Editor::fBinHist
TH2 * fBinHist
Definition: TH2Editor.h:142
TH2Editor::fBinXSlider
TGHSlider * fBinXSlider
Definition: TH2Editor.h:79
TH2Editor::fP4oldx
Float_t fP4oldx[3]
Definition: TH2Editor.h:129
TGNumberEntry::SetIntNumber
virtual void SetIntNumber(Long_t val)
Definition: TGNumberEntry.h:189
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
kTH2_TITLE
@ kTH2_TITLE
Definition: TH2Editor.cxx:160
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)
TH2Editor
Definition: TH2Editor.h:41
kButtonDown
@ kButtonDown
Definition: TGButton.h:60
kTYPE_SURF5
@ kTYPE_SURF5
Definition: TH2Editor.cxx:163
TString::Data
const char * Data() const
Definition: TString.h:369
TGSlider.h
kDELAYED_DRAWING
@ kDELAYED_DRAWING
Definition: TH2Editor.cxx:172
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:40
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TCanvas::Selected
virtual void Selected(TVirtualPad *pad, TObject *obj, Int_t event)
Emit Selected() signal.
Definition: TCanvas.cxx:1637
TGTab::SetEnabled
virtual void SetEnabled(Int_t tabIndex, Bool_t on=kTRUE)
Enable or disable tab.
Definition: TGTab.cxx:437
kCOLOR
@ kCOLOR
Definition: TH2Editor.cxx:172
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TAxis::SetRangeUser
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
Definition: TAxis.cxx:946
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGMsgBox
Definition: TGMsgBox.h:63
kBINYSLIDER1
@ kBINYSLIDER1
Definition: TH2Editor.cxx:173
xmax
float xmax
Definition: THbookFile.cxx:95
TH2Editor::fDim0
TGRadioButton * fDim0
Definition: TH2Editor.h:56
TGNumberFormat::kNEAAnyNumber
@ kNEAAnyNumber
Definition: TGNumberEntry.h:56
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:37
kSLIDERY_MAX
@ kSLIDERY_MAX
Definition: TH2Editor.cxx:171
TView.h
TH2Editor::DoAddCol
virtual void DoAddCol(Bool_t on)
Slot connected to the "Col draw option" check button.
Definition: TH2Editor.cxx:1315
TGLabel
Definition: TGLabel.h:32
kCONT_4
@ kCONT_4
Definition: TH2Editor.cxx:169
TH2Editor::fCutString
TString fCutString
Definition: TH2Editor.h:105
TH2Editor::fP1oldx
Float_t fP1oldx[3]
Definition: TH2Editor.h:126
TGedEditor.h
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
kCOORD_TYPE
@ kCOORD_TYPE
Definition: TH2Editor.cxx:164
TGSlider::SetRange
virtual void SetRange(Int_t min, Int_t max)
Definition: TGSlider.h:101
TGHSlider
Definition: TGSlider.h:154
TH1::SetBins
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
Definition: TH1.cxx:8222
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
TAxis::GetFirst
Int_t GetFirst() const
Return first bin on the axis i.e.
Definition: TAxis.cxx:458
Float_t
float Float_t
Definition: RtypesCore.h:57
TH2Editor::fCancel
TGTextButton * fCancel
Definition: TH2Editor.h:84
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGTextButton
Definition: TGButton.h:142
TGNumberFormat::kNEANonNegative
@ kNEANonNegative
Definition: TGNumberEntry.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TH2Editor::f13
TGCompositeFrame * f13
Definition: TH2Editor.h:62
TVirtualPad::cd
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
TH2Editor::DoFillPattern
virtual void DoFillPattern(Style_t)
Slot connected to the fill area pattern.
Definition: TH2Editor.cxx:2720
TH2Editor::TH2Editor
TH2Editor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor of histogram attribute GUI.
Definition: TH2Editor.cxx:174
Int_t
int Int_t
Definition: RtypesCore.h:45
TCanvas::FeedbackMode
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
Definition: TCanvas.cxx:1116
TH1::SetCanExtend
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
Definition: TH1.cxx:6290
TH2Editor::fBinXCont
TGCompositeFrame * fBinXCont
Definition: TH2Editor.h:78
TAxis::GetBinUpEdge
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Definition: TAxis.cxx:528
kPALETTE_ONOFF
@ kPALETTE_ONOFF
Definition: TH2Editor.cxx:165
TH1::GetEntries
virtual Double_t GetEntries() const
Return the current number of entries.
Definition: TH1.cxx:4301
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
kMBYes
@ kMBYes
Definition: TGMsgBox.h:42
TGComboBox::Select
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:451
TH2Editor::fP7oldy
Float_t fP7oldy[3]
Definition: TH2Editor.h:140
TH2Editor::DoHistComplex
virtual void DoHistComplex()
Slot connected to the 3D-Plot radio button.
Definition: TH2Editor.cxx:1131
TH2Editor::fContLevels1
TGNumberEntry * fContLevels1
Definition: TH2Editor.h:75
TColor.h
TH2Editor::DoCancel
virtual void DoCancel()
Slot connected to the Cancel Button in the Rebinned histogram Window.
Definition: TH2Editor.cxx:1857
TGNumberFormat::kNESRealTwo
@ kNESRealTwo
Definition: TGNumberEntry.h:48
TVirtualX.h
TH1::Add
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2),...
Definition: TH1.cxx:777
TColor::Number2Pixel
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition: TColor.cxx:2013
TMath::Abs
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
TH2Editor::fFrameColor
TGColorSelect * fFrameColor
Definition: TH2Editor.h:103
TGNumberEntryField::SetNumber
virtual void SetNumber(Double_t val)
Set the numeric value (floating point representation).
Definition: TGNumberEntry.cxx:1119
TGNumberEntry::GetNumberEntry
TGNumberEntryField * GetNumberEntry() const
Definition: TGNumberEntry.h:268
TH2Editor::f12
TGCompositeFrame * f12
Definition: TH2Editor.h:61
TAttPad::SetFrameFillColor
void SetFrameFillColor(Color_t color=1)
Definition: TAttPad.h:79
TCanvas.h
kSCAT_ONOFF
@ kSCAT_ONOFF
Definition: TH2Editor.cxx:166
TH2Editor::DoSliderXReleased
virtual void DoSliderXReleased()
Slot connected to the x-axis slider finalizing values after the slider movement.
Definition: TH2Editor.cxx:2476
TGedFrame::Update
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
kFRONTBOX_ONOFF
@ kFRONTBOX_ONOFF
Definition: TH2Editor.cxx:167
TH2Editor::DoAddFB
virtual void DoAddFB()
Slot connected to the "FB front-box draw option" check button.
Definition: TH2Editor.cxx:1478
TString
Definition: TString.h:136
kMBNo
@ kMBNo
Definition: TGMsgBox.h:43
TH2Editor::DoBinLabel1
virtual void DoBinLabel1()
Slot connected to the Bin Number Entry for the Rebin.
Definition: TH2Editor.cxx:2040
TGFrame
Definition: TGFrame.h:105
TH2Editor::fBinXSlider1
TGHSlider * fBinXSlider1
Definition: TH2Editor.h:86
TGNumberFormat::kNESRealFour
@ kNESRealFour
Definition: TGNumberEntry.h:50
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
TVirtualPad::PaintLine3D
virtual void PaintLine3D(Float_t *p1, Float_t *p2)=0
TGSlider::SetPosition
virtual void SetPosition(Int_t pos)
Definition: TGSlider.h:105
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
text
TText * text
Definition: entrylist_figure1.C:10
TH2Editor::DoHistChanges
virtual void DoHistChanges()
Slot connected to histogram type, coordinate system, contour combo box.
Definition: TH2Editor.cxx:1174
TH2Editor::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
If the contained histogram obj is deleted we must set its pointer to zero.
Definition: TH2Editor.cxx:2937
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
kBAR_OFFSET
@ kBAR_OFFSET
Definition: TH2Editor.cxx:168
TString.h
TH2::Reset
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH2.cxx:2464
TH2Editor::f38
TGCompositeFrame * f38
Definition: TH2Editor.h:63
TGHButtonGroup
Definition: TGButtonGroup.h:122
bool
kSLIDERX_MAX
@ kSLIDERX_MAX
Definition: TH2Editor.cxx:171
TGTextBuffer
Definition: TGTextBuffer.h:30
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:249
kCONT_NONE
@ kCONT_NONE
Definition: TH2Editor.cxx:169
TGSlider::SetScale
virtual void SetScale(Int_t scale)
Definition: TGSlider.h:100
TH2Editor::fBinXNumberEntry1
TGNumberEntryField * fBinXNumberEntry1
Definition: TH2Editor.h:87
TH2Editor::DoSliderYReleased
virtual void DoSliderYReleased()
Slot connected to the y-axis slider finalizing values after the slider movement.
Definition: TH2Editor.cxx:2663
TH2Editor::DoAddText
virtual void DoAddText(Bool_t on)
Slot connected to the "Text draw option" check button.
Definition: TH2Editor.cxx:1384
TH2Editor::DoOffsetPressed
virtual void DoOffsetPressed()
Slot connected to the OffSetSlider.
Definition: TH2Editor.cxx:2120
kWatch
@ kWatch
Definition: GuiTypes.h:374
MakeTitle
std::string MakeTitle(std::string_view version, std::string_view histname, std::string_view title, std::string_view axis)
Definition: histspeedtest.cxx:123
TH2Editor::DoAddPalette
virtual void DoAddPalette(Bool_t on)
Slot connected to the color palette check button.
Definition: TH2Editor.cxx:1451
TH2Editor::fXBinOffsetSld
TGHSlider * fXBinOffsetSld
Definition: TH2Editor.h:89
TROOT.h
TH2Editor::fContCombo
TGComboBox * fContCombo
Definition: TH2Editor.h:50
TH2Editor::fDim0lh
TGLayoutHints * fDim0lh
Definition: TH2Editor.h:58
TH1::GetContour
virtual Int_t GetContour(Double_t *levels=0)
Return contour values into array levels if pointer levels is non zero.
Definition: TH1.cxx:7874
TH1::SetTitle
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
Definition: TH1.cxx:6344
TH2Editor::fBarWidth
TGNumberEntry * fBarWidth
Definition: TH2Editor.h:76
TH2Editor::DoHistSimple
virtual void DoHistSimple()
Slot connected to the 2D-Plot radio button.
Definition: TH2Editor.cxx:1093
TH1::Clone
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
Definition: TH1.cxx:2664
TString::ToUpper
void ToUpper()
Change string to upper case.
Definition: TString.cxx:1138
TH2Editor.h
TGedFrame::fAvoidSignal
Bool_t fAvoidSignal
Definition: TGedFrame.h:56
TH2Editor::DoFillColor
virtual void DoFillColor(Pixel_t)
Slot connected to the fill area color.
Definition: TH2Editor.cxx:2709
TH2Editor::DoAddBox
virtual void DoAddBox(Bool_t on)
Slot connected to the "Box draw option" check button.
Definition: TH2Editor.cxx:1283
TH2Editor::DoHistView
virtual void DoHistView()
Slot connected to the 'Plot' button group.
Definition: TH2Editor.cxx:1076
TGCheckButton
Definition: TGButton.h:264
TTreePlayer
Definition: TTreePlayer.h:37
TH2::Rebin2D
virtual TH2 * Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="")
Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.
Definition: TH2.cxx:1569
TVirtualPad::GetUymax
virtual Double_t GetUymax() const =0
TGedEditor::GetPad
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:89
TH2Editor::fPx1old
Int_t fPx1old
Definition: TH2Editor.h:122
TH2Editor::fBinYCont1
TGCompositeFrame * fBinYCont1
Definition: TH2Editor.h:91
TH2Editor::fDimGroup
TGHButtonGroup * fDimGroup
Definition: TH2Editor.h:54
kTYPE_LEGO3
@ kTYPE_LEGO3
Definition: TH2Editor.cxx:162
kPALETTE_ONOFF1
@ kPALETTE_ONOFF1
Definition: TH2Editor.cxx:165
TVirtualPad::GetUymin
virtual Double_t GetUymin() const =0
TH2Editor::fYBinOffsetSld
TGHSlider * fYBinOffsetSld
Definition: TH2Editor.h:95
kCOORDS_PSR
@ kCOORDS_PSR
Definition: TH2Editor.cxx:164
TH2Editor::fP2oldy
Float_t fP2oldy[3]
Definition: TH2Editor.h:135
TGedPatternSelect
Definition: TGedPatternSelect.h:147
TG3DLine.h
TAxis::SetRange
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis using bin numbers.
Definition: TAxis.cxx:920
TH2Editor::DoBinReleased1
virtual void DoBinReleased1()
Slot connected to the BinNumber Slider in case of a 'ntuple histogram'.
Definition: TH2Editor.cxx:1898
TTreePlayer::GetHistogram
TH1 * GetHistogram() const
Definition: TTreePlayer.h:75
TGDoubleHSlider
Definition: TGDoubleSlider.h:180
kCONT_LEVELS1
@ kCONT_LEVELS1
Definition: TH2Editor.cxx:170
TH2Editor::fBarOffset
TGNumberEntry * fBarOffset
Definition: TH2Editor.h:77
TH2Editor::fAddPalette1
TGCheckButton * fAddPalette1
Definition: TH2Editor.h:66
TH2Editor::fPy1old
Int_t fPy1old
Definition: TH2Editor.h:123
kDIM_SIMPLE
@ kDIM_SIMPLE
Definition: TH2Editor.cxx:161
kLHintsNormal
@ kLHintsNormal
Definition: TGLayout.h:45
TView
Definition: TView.h:25
TAxis::GetXmin
Double_t GetXmin() const
Definition: TAxis.h:133
kCONT_0
@ kCONT_0
Definition: TH2Editor.cxx:169
TH1::GetYaxis
TAxis * GetYaxis()
Definition: TH1.h:318
TGNumberEntry::SetNumber
virtual void SetNumber(Double_t val)
Definition: TGNumberEntry.h:186
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:41
xmin
float xmin
Definition: THbookFile.cxx:95
TGRadioButton
Definition: TGButton.h:322
kTYPE_SURF1
@ kTYPE_SURF1
Definition: TH2Editor.cxx:163
TTreePlayer::GetSelector
virtual TSelector * GetSelector() const
Definition: TTreePlayer.h:82
TH2Editor::CreateBinTab
void CreateBinTab()
Create the Binning tab.
Definition: TH2Editor.cxx:376
TH2Editor::fP5oldx
Float_t fP5oldx[3]
Definition: TH2Editor.h:130
TH1::GetBarWidth
virtual Float_t GetBarWidth() const
Definition: TH1.h:253
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
kBOX_ONOFF
@ kBOX_ONOFF
Definition: TH2Editor.cxx:166
TH2Editor::DoSliderXPressed
virtual void DoSliderXPressed()
Slot connected to the x axis range slider that initialises the "virtual" box which is drawn in delay ...
Definition: TH2Editor.cxx:2421
TH2Editor::DoAddScat
virtual void DoAddScat(Bool_t on)
Slot connected to the "Scat draw option" check button.
Definition: TH2Editor.cxx:1358
TH2Editor::fP6oldx
Float_t fP6oldx[3]
Definition: TH2Editor.h:131
TH2Editor::fP8oldx
Float_t fP8oldx[3]
Definition: TH2Editor.h:133
TH2Editor::DoAddArr
virtual void DoAddArr(Bool_t on)
Slot connected to the "Arrow draw option" check button.
Definition: TH2Editor.cxx:1251
TVirtualPad::YtoAbsPixel
virtual Int_t YtoAbsPixel(Double_t y) const =0
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
kTYPE_SURF
@ kTYPE_SURF
Definition: TH2Editor.cxx:163
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TH2Editor::fBinYSlider1
TGHSlider * fBinYSlider1
Definition: TH2Editor.h:92
TGTextEntry
Definition: TGTextEntry.h:39
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
kMBIconExclamation
@ kMBIconExclamation
Definition: TGMsgBox.h:41
TVirtualTreePlayer::GetCurrentPlayer
static TVirtualTreePlayer * GetCurrentPlayer()
Static function: return the current player (if any)
Definition: TVirtualTreePlayer.cxx:69
TH2Editor::fP4oldy
Float_t fP4oldy[3]
Definition: TH2Editor.h:137
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TH2Editor::fP1oldy
Float_t fP1oldy[3]
Definition: TH2Editor.h:134
kCONT_LEVELS
@ kCONT_LEVELS
Definition: TH2Editor.cxx:170
TGCompositeFrame::HideFrame
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1175
TGNumberEntryField::GetNumber
virtual Double_t GetNumber() const
Get the numeric value (floating point representation).
Definition: TGNumberEntry.cxx:1249
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:39
TString::First
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition: TString.cxx:499
TGedEditor::GetTab
TGTab * GetTab() const
Definition: TGedEditor.h:84
TH2Editor::DoXAxisRange
virtual void DoXAxisRange()
Slot connected to the Max/Min number entry fields showing x-axis range.
Definition: TH2Editor.cxx:2498
TGLayoutHints
Definition: TGLayout.h:57
TH2Editor::fSliderY
TGDoubleHSlider * fSliderY
Definition: TH2Editor.h:99
TGLabel::Disable
virtual void Disable(Bool_t on=kTRUE)
Definition: TGLabel.h:97
TH2
Definition: TH2.h:30
TAxis::GetLast
Int_t GetLast() const
Return last bin on the axis i.e.
Definition: TAxis.cxx:469
TVirtualPad::GetUxmax
virtual Double_t GetUxmax() const =0
TGButtonGroup.h
TView::GetRmin
virtual Double_t * GetRmin()=0
TH2Editor::GetHistAdditiveLabel
TString GetHistAdditiveLabel()
Return histogram additive options (Arr,Box,Col,Scat,Col,Text,E,Z,FB,BB).
Definition: TH2Editor.cxx:2793
kCOORDS_CAR
@ kCOORDS_CAR
Definition: TH2Editor.cxx:164
TVirtualPad.h
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TGTab.h
TH1::SetDirectory
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
Definition: TH1.cxx:8392
TH2Editor::fAddPalette
TGCheckButton * fAddPalette
Definition: TH2Editor.h:65
TH2Editor::fTitle
TGTextEntry * fTitle
Definition: TH2Editor.h:47
TVirtualPad::GetView
virtual TView * GetView() const =0
TH2Editor::ConnectSignals2Slots
virtual void ConnectSignals2Slots()
Connect signals to slots.
Definition: TH2Editor.cxx:696
TH2Editor::GetHistTypeLabel
TString GetHistTypeLabel()
Return the immediate histogram type (HIST, LEGO1-4, SURF1-5).
Definition: TH2Editor.cxx:2731
TH2Editor::fBinYNumberEntry
TGNumberEntryField * fBinYNumberEntry
Definition: TH2Editor.h:82
TGLabel::Enable
virtual void Enable()
Definition: TGLabel.h:99
TGTab::SetTab
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition: TGTab.cxx:509
TH2Editor::BuildHistCoordsComboBox
static TGComboBox * BuildHistCoordsComboBox(TGFrame *parent, Int_t id)
Create coordinate system combo box.
Definition: TH2Editor.cxx:2852
TColor::GetColor
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition: TColor.cxx:1766
TH2Editor::fOldXOffset
Double_t fOldXOffset
Definition: TH2Editor.h:143
kBACKBOX_ONOFF
@ kBACKBOX_ONOFF
Definition: TH2Editor.cxx:167
TH2Editor::fAddCol
TGCheckButton * fAddCol
Definition: TH2Editor.h:70
TH2Editor::fColContLbl1
TGLabel * fColContLbl1
Definition: TH2Editor.h:52
TGNumberEntryField
Definition: TGNumberEntry.h:74
TH2Editor::BuildHistTypeComboBox
static TGComboBox * BuildHistTypeComboBox(TGFrame *parent, Int_t id)
Create histogram type combo box.
Definition: TH2Editor.cxx:2830
TGedEditor::GetCanvas
virtual TCanvas * GetCanvas() const
Definition: TGedEditor.h:88
TH2Editor::fAddBB
TGCheckButton * fAddBB
Definition: TH2Editor.h:72
TH2.h
kCONT_TYPE
@ kCONT_TYPE
Definition: TH2Editor.cxx:165
kPointer
@ kPointer
Definition: GuiTypes.h:374
TH2Editor::f6
TGCompositeFrame * f6
Definition: TH2Editor.h:59
TGFrame::Contains
Bool_t Contains(Int_t x, Int_t y) const
Definition: TGFrame.h:263
kCOORDS_CYL
@ kCOORDS_CYL
Definition: TH2Editor.cxx:164
TH2Editor::DoAddError
virtual void DoAddError(Bool_t on)
Slot connected to the "Error" check button.
Definition: TH2Editor.cxx:1416
TH2Editor::GetHistContLabel
TString GetHistContLabel()
Returns histogram contour option (None,Cont0..5).
Definition: TH2Editor.cxx:2774
TH2Editor::DoBinMoved
virtual void DoBinMoved()
Slot connected to the rebin sliders in case of no ntuple histogram does the rebinning of the selected...
Definition: TH2Editor.cxx:1676
TH2Editor::DoOffsetReleased
virtual void DoOffsetReleased()
Slot connected to the OffSetSlider that changes the origin of the histogram inbetween a binwidth; reb...
Definition: TH2Editor.cxx:2133
TH2Editor::fBinXNumberEntry
TGNumberEntryField * fBinXNumberEntry
Definition: TH2Editor.h:80
kMBOk
@ kMBOk
Definition: TGMsgBox.h:44
TGComboBox
Definition: TGComboBox.h:67
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:188
ymin
float ymin
Definition: THbookFile.cxx:95
TH2Editor::fDelaydraw
TGCheckButton * fDelaydraw
Definition: TH2Editor.h:102
TSelectorDraw::TakeAction
virtual void TakeAction()
Execute action for object obj fNfill times.
Definition: TSelectorDraw.cxx:1357
ETH2Wid
ETH2Wid
Definition: TH2Editor.cxx:153
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TH2Editor::fSldXMin
TGNumberEntryField * fSldXMin
Definition: TH2Editor.h:97
TTreePlayer::GetNfill
virtual Int_t GetNfill() const
Definition: TTreePlayer.h:78
TGComboBox::GetSelected
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
TGedFrame
Definition: TGedFrame.h:33
TGLabel.h
TVirtualPad::XtoAbsPixel
virtual Int_t XtoAbsPixel(Double_t x) const =0
kBINYSLIDER
@ kBINYSLIDER
Definition: TH2Editor.cxx:173
TH2Editor::fP5oldy
Float_t fP5oldy[3]
Definition: TH2Editor.h:138
kCOL_ONOFF
@ kCOL_ONOFF
Definition: TH2Editor.cxx:166
TGedFrame::Refresh
virtual void Refresh(TObject *model)
Refresh the GUI info about the object attributes.
Definition: TGedFrame.cxx:135
kHIST_TYPE
@ kHIST_TYPE
Definition: TH2Editor.cxx:161
TGedEditor::ActivateEditors
void ActivateEditors(TList *bcl, Bool_t recurse)
Searches GedFrames for classes in the given list.
Definition: TGedEditor.cxx:565
TH2Editor::DoSliderYPressed
virtual void DoSliderYPressed()
Slot connected to y-axis slider which initialises the "virtual" box which is drawn in delay draw mode...
Definition: TH2Editor.cxx:2608
TH2Editor::DoBinMoved1
virtual void DoBinMoved1()
Slot connected to the rebin slider in case of an ntuple histogram.
Definition: TH2Editor.cxx:2001
TH2Editor::ActivateBaseClassEditors
virtual void ActivateBaseClassEditors(TClass *cl)
Skip TH1Editor in building list of editors.
Definition: TH2Editor.cxx:2929
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
kARROW_ONOFF
@ kARROW_ONOFF
Definition: TH2Editor.cxx:166
kBINXSLIDER1
@ kBINXSLIDER1
Definition: TH2Editor.cxx:173
TAttPad::GetFrameFillColor
Color_t GetFrameFillColor() const
Definition: TAttPad.h:59
Double_t
double Double_t
Definition: RtypesCore.h:59
TQObject::Connect
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:864
TH2Editor::fFramePattern
TGedPatternSelect * fFramePattern
Definition: TH2Editor.h:104
TH2Editor::GetCutOptionString
TString GetCutOptionString()
Return draw option string related to graphical cut in use.
Definition: TH2Editor.cxx:2815
TH2Editor::fSldYMax
TGNumberEntryField * fSldYMax
Definition: TH2Editor.h:101
TSelectorDraw.h
TH2Editor::fBin
TGCompositeFrame * fBin
Definition: TH2Editor.h:45
TH2Editor::fAddArr
TGCheckButton * fAddArr
Definition: TH2Editor.h:67
TH2Editor::DoBinReleased
virtual void DoBinReleased()
Slot connected to the rebin slider in case of no ntuple histogram.
Definition: TH2Editor.cxx:1586
kFitWidth
@ kFitWidth
Definition: GuiTypes.h:386
TH2Editor::DoBarOffset
virtual void DoBarOffset()
Slot connected to the bar offset of the bar chart.
Definition: TH2Editor.cxx:1575
TGMsgBox.h
TGedPatternSelect.h
kCOORDS_SPH
@ kCOORDS_SPH
Definition: TH2Editor.cxx:164
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGWindow::GetMainFrame
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:133
TH2Editor::DoSliderXMoved
virtual void DoSliderXMoved()
Slot connected to the x-Slider that redraws the histogram with the new slider range.
Definition: TH2Editor.cxx:2331
TClass
Definition: TClass.h:80
TH2Editor::fBinYSlider
TGHSlider * fBinYSlider
Definition: TH2Editor.h:81
TH2Editor::~TH2Editor
virtual ~TH2Editor()
Destructor.
Definition: TH2Editor.cxx:678
TH2Editor::fSldXMax
TGNumberEntryField * fSldXMax
Definition: TH2Editor.h:98
TH2Editor::SetModel
virtual void SetModel(TObject *obj)
Pick up the values of current histogram attributes.
Definition: TH2Editor.cxx:781
TH2Editor::fContLevels
TGNumberEntry * fContLevels
Definition: TH2Editor.h:74
kBINXSLIDER
@ kBINXSLIDER
Definition: TH2Editor.cxx:173
TH2Editor::DoBarWidth
virtual void DoBarWidth()
Slot connected to the bar width of the bar chart.
Definition: TH2Editor.cxx:1565
TH2Editor::fPy2old
Int_t fPy2old
Definition: TH2Editor.h:125
kYBINOFFSET
@ kYBINOFFSET
Definition: TH2Editor.cxx:174
TGButton::GetState
virtual EButtonState GetState() const
Definition: TGButton.h:112
TObject
Definition: TObject.h:37
TGTextEntry.h
kTYPE_LEGO
@ kTYPE_LEGO
Definition: TH2Editor.cxx:162
TH2Editor::BuildHistContComboBox
static TGComboBox * BuildHistContComboBox(TGFrame *parent, Int_t id)
Create contour combo box.
Definition: TH2Editor.cxx:2870
kCOORDS_POL
@ kCOORDS_POL
Definition: TH2Editor.cxx:164
TGTab::IsEnabled
Bool_t IsEnabled(Int_t tabIndex) const
Returns true if tab is enabled.
Definition: TGTab.cxx:449
kSLIDERY_MIN
@ kSLIDERY_MIN
Definition: TH2Editor.cxx:171
TH2Editor::fP2oldx
Float_t fP2oldx[3]
Definition: TH2Editor.h:127
kERROR_ONOFF
@ kERROR_ONOFF
Definition: TH2Editor.cxx:165
TH2Editor::fSliderX
TGDoubleHSlider * fSliderX
Definition: TH2Editor.h:96
kDIM_COMPLEX
@ kDIM_COMPLEX
Definition: TH2Editor.cxx:161
TAxis::FindBin
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
Definition: TAxis.cxx:293
kTYPE_SURF3
@ kTYPE_SURF3
Definition: TH2Editor.cxx:163
TH2Editor::fAddBox
TGCheckButton * fAddBox
Definition: TH2Editor.h:68
TH2Editor::DoApply
virtual void DoApply()
Slot connected to the Apply Button in the Rebinned histogram Window.
Definition: TH2Editor.cxx:1818
d
#define d(i)
Definition: RSha256.hxx:120
TVirtualPad::Modified
virtual void Modified(Bool_t flag=1)=0
TGedFrame::SetDrawOption
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TGedFrame.cxx:145
TGColorSelect::SetColor
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
Definition: TGColorSelect.cxx:636
TH2Editor::DoContLevel1
virtual void DoContLevel1()
Slot connected to the contour level number entry fContLevels1.
Definition: TH2Editor.cxx:1554
TH2Editor::DoOffsetMoved
virtual void DoOffsetMoved()
Slot connected to the OffSetSlider.
Definition: TH2Editor.cxx:2201
gPad
#define gPad
Definition: TVirtualPad.h:287
TH2Editor::DoSliderYMoved
virtual void DoSliderYMoved()
Slot connected to the x-slider for redrawing the histogram with the new slider Range (immediately).
Definition: TH2Editor.cxx:2519
TGHSlider::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition: TGSlider.h:173
kSlider1
@ kSlider1
Definition: TGSlider.h:56
TGColorSelect
Definition: TGColorSelect.h:127
TGDoubleSlider::GetMinPosition
virtual Float_t GetMinPosition() const
Definition: TGDoubleSlider.h:127
TGNumberEntry.h
kTYPE_LEGO1
@ kTYPE_LEGO1
Definition: TH2Editor.cxx:162
TH2Editor::fCoordsCombo
TGComboBox * fCoordsCombo
Definition: TH2Editor.h:49
kTYPE_SURF4
@ kTYPE_SURF4
Definition: TH2Editor.cxx:163
TGNumberEntry::GetNumber
virtual Double_t GetNumber() const
Definition: TGNumberEntry.h:206
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:43
TH2Editor::fDim
TGRadioButton * fDim
Definition: TH2Editor.h:55
TH1::GetBarOffset
virtual Float_t GetBarOffset() const
Definition: TH1.h:252
TGedFrame::fGedEditor
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
TH2Editor::fAddText
TGCheckButton * fAddText
Definition: TH2Editor.h:73
TGColorSelect.h
TH2Editor::f9
TGCompositeFrame * f9
Definition: TH2Editor.h:60
TH2Editor::PaintBox3D
void PaintBox3D(Float_t *p1, Float_t *p2, Float_t *p3, Float_t *p4)
Paint a square in 3D.
Definition: TH2Editor.cxx:2887
TH2Editor::DoContLevel
virtual void DoContLevel()
Slot connected to the contour level number entry fContLevels.
Definition: TH2Editor.cxx:1543
TH2Editor::fHist
TH2 * fHist
Definition: TH2Editor.h:44
kXBINOFFSET
@ kXBINOFFSET
Definition: TH2Editor.cxx:174
TH2Editor::DoBinLabel
virtual void DoBinLabel()
Slot connected to the Bin Number Entry for the Rebin.
Definition: TH2Editor.cxx:1768
TGNumberEntry
Definition: TGNumberEntry.h:156
TVirtualPad::GetUxmin
virtual Double_t GetUxmin() const =0
TGedFrame::fInit
Bool_t fInit
Definition: TGedFrame.h:53
TAxis::GetXmax
Double_t GetXmax() const
Definition: TAxis.h:134
TH2Editor::DoAddBB
virtual void DoAddBB()
Slot connected to the "BB back-box draw option" check button.
Definition: TH2Editor.cxx:1512
TH2Editor::AcceptModel
virtual Bool_t AcceptModel(TObject *model)
Check if object is able to configure with this editor.
Definition: TH2Editor.cxx:768
TH2Editor::fAddScat
TGCheckButton * fAddScat
Definition: TH2Editor.h:69
Class
void Class()
Definition: Class.C:29
TH2Editor::DoBinOffset
virtual void DoBinOffset()
Slot connected to the OffSetNumberEntry, related to the OffSetSlider changes the origin of the histog...
Definition: TH2Editor.cxx:2271
TH2Editor::fP3oldx
Float_t fP3oldx[3]
Definition: TH2Editor.h:128
TH2Editor::fP7oldx
Float_t fP7oldx[3]
Definition: TH2Editor.h:132
TH1::GetXaxis
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:317
TGNumberEntryField::SetLimits
virtual void SetLimits(ELimit limits=kNELNoLimits, Double_t min=0, Double_t max=1)
Set the numerical limits.
Definition: TGNumberEntry.cxx:1589
TGCompositeFrame
Definition: TGFrame.h:324
kScaleBoth
@ kScaleBoth
Definition: TGSlider.h:62
TH2Editor::fP3oldy
Float_t fP3oldy[3]
Definition: TH2Editor.h:136
kTYPE_LEGO4
@ kTYPE_LEGO4
Definition: TH2Editor.cxx:162
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
kSLIDERX_MIN
@ kSLIDERX_MIN
Definition: TH2Editor.cxx:171
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1242
TH1::SetBarWidth
virtual void SetBarWidth(Float_t width=0.5)
Definition: TH1.h:357
kPATTERN
@ kPATTERN
Definition: TH2Editor.cxx:172
kCONT_1
@ kCONT_1
Definition: TH2Editor.cxx:169
TH2Editor::fYOffsetNumberEntry
TGNumberEntryField * fYOffsetNumberEntry
Definition: TH2Editor.h:94
TGCompositeFrame::ShowFrame
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1189
TGNumberEntryField::SetIntNumber
virtual void SetIntNumber(Long_t val)
Set the numeric value (integer representation).
Definition: TGNumberEntry.cxx:1172
TAxis::GetNbins
Int_t GetNbins() const
Definition: TAxis.h:121
TH1::SetBarOffset
virtual void SetBarOffset(Float_t offset=0.25)
Definition: TH1.h:356
TView::GetRmax
virtual Double_t * GetRmax()=0
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:62
TGNumberFormat::kNESInteger
@ kNESInteger
Definition: TGNumberEntry.h:46
kCONT_3
@ kCONT_3
Definition: TH2Editor.cxx:169
TSelectorDraw
Definition: TSelectorDraw.h:33
TAxis::GetBinWidth
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
Definition: TAxis.cxx:540
ROOT::TMetaUtils::propNames::pattern
static const std::string pattern("pattern")
TH2Editor::fDimlh
TGLayoutHints * fDimlh
Definition: TH2Editor.h:57
kCONT_2
@ kCONT_2
Definition: TH2Editor.cxx:169
TGDoubleSlider::SetPosition
virtual void SetPosition(Float_t min, Float_t max)
Definition: TGDoubleSlider.h:121
TAttPad::GetFrameFillStyle
Style_t GetFrameFillStyle() const
Definition: TAttPad.h:61
gROOT
#define gROOT
Definition: TROOT.h:406
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
TH2Editor::DoYAxisRange
virtual void DoYAxisRange()
Slot connected to the Max/Min number entry fields showing y-axis range.
Definition: TH2Editor.cxx:2686
TH2Editor::fOldYOffset
Double_t fOldYOffset
Definition: TH2Editor.h:144
TGDoubleSlider::GetMaxPosition
virtual Float_t GetMaxPosition() const
Definition: TGDoubleSlider.h:131
TH2Editor::fSldYMin
TGNumberEntryField * fSldYMin
Definition: TH2Editor.h:100