Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TH1Editor.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Carsten Hof 16/08/04
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13/** \class TH1Editor
14 \ingroup ged
15
16Editor for changing TH1 histogram attributes, rebinning & fitting.
17For all possible draw options (there are a few which are not implementable
18in graphical user interface) see THistPainter::Paint
19
20 These changes can be made via the TH1Editor:
21 Style Tab:
22 'Line' : change Line attributes (color, thickness)
23 see TAttLineEditor
24 'Fill' : change Fill attributes (color, pattern)
25 see TAttFillEditor
26 'Title' : TextEntry: set the title of the histogram
27 'Histogram': change the draw options of the histogram
28 'Plot' : Radiobutton: draw a 2D or 3D plot of the histogram
29 according to the Plot dimension there will be
30 different drawing possibilities (ComboBoxes/
31 CheckBoxes)
32 2d Plot:
33 'Error' : ComboBox: add different error bars to the histogram
34 (no errors, simple, ..., see THistPainter::Paint
35 'Add' : ComboBox: further things which can be added to the
36 histogram (None, simple/smooth line, fill area
37 'Simple Drawing': CheckBox: draw a simple histogram without
38 errors (= "HIST" drawoption). In combination with
39 some other draw options an outer line is drawn on
40 top of the histogram
41 'Show markers': CheckBox: draw a marker on to of each bin (="P"
42 drawoption)
43 'Draw bar chart': CheckBox: draw a bar chart (="B" drawoption)
44 change the Fill Color with Fill in the Style Tab
45 => will show Bar menue in the Style Tab
46 'Bar option': CheckBox: draw a bar chart (="BAR" drawoption)
47 => will show Bar menue in the Style Tab
48 3d Plot:
49 'Type' : ComboBox: set histogram type Lego-Plot or Surface
50 draw(Lego, Lego1.2, Surf, Surf1..5)
51 see THistPainter::Paint
52 'Coords' : ComboBox: set the coordinate system (Cartesian, ..
53 Spheric) see THistPainter::Paint
54 'Error' : see 2D plot
55 'Bar' : change the bar attributes
56 'W' : change Bar Width
57 'O' : change Bar Offset
58 'Percentage': specifies the percentage of the bar which is drawn
59 brighter and darker (10% == BAR1 drawoption)
60 'Horizontal Bar': draw a horizontal bar chart
61
62 'Marker' : change the Marker attributes (color, appearance,
63 thickness) see TAttMarkerEditor
64
65 This Tab has two different layouts. One is for a histogram which
66 is not drawn from an ntuple. The other one is available for a
67 histogram which is drawn from an ntuple. In this case the rebin
68 algorithm can create a rebinned histogram from the original data
69 i.e. the ntuple.
70 To see te differences do:
71 TFile f("hsimple.root");
72 hpx->Draw("BAR1"); // non ntuple histogram
73 ntuple->Draw("px"); // ntuple histogram
74 Non ntuple histogram:
75 'Rebin': with the Slider the number of bins (shown in the field
76 below the Slider) can be changed to any number which
77 divides the number of bins of the original histogram.
78 Pushing 'Apply' will delete the origin histogram and
79 replace it by the rebinned one on the screen
80 Pushing 'Ignore' the origin histogram will be restored
81 Histogram drawn from an ntuple:
82 'Rebin' with the slider the number of bins can be enlarged by
83 a factor of 2,3,4,5 (moving to the right) or reduced
84 by a factor of 1/2, 1/3, 1/4, 1/5
85 'BinOffset': with the BinOffset slider the origin of the
86 histogram can be changed within one binwidth
87 Using this slider the effect of binning the data into
88 bins can be made visible => statistical fluctuations
89 'Axis Range': with the DoubleSlider it is possible to zoom into
90 the specified axis range. It is also possible to set
91 the upper and lower limit in fields below the slider
92 'Delayed drawing': all the Binning sliders can set to delay
93 draw mode. Then the changes on the histogram are only
94 updated, when the Slider is released. This should be
95 activated if the redrawing of the histogram is too
96 time consuming. //
97
98*/
99
100
101
102#include "TH1Editor.h"
103#include "TH1.h"
104#include "TGedEditor.h"
105#include "TGComboBox.h"
106#include "TGTextEntry.h"
107#include "TGLabel.h"
108#include "TVirtualPad.h"
109#include "TString.h"
110#include "TGButtonGroup.h"
111#include "TGNumberEntry.h"
112#include "TG3DLine.h"
113#include "TGDoubleSlider.h"
114#include "TGSlider.h"
115#include "TView.h"
116#include "TCanvas.h"
117#include "TTreePlayer.h"
118#include "TSelectorDraw.h"
119#include "TGMsgBox.h"
120#include "TGTab.h"
121#include "TROOT.h"
122#include "TVirtualX.h"
123
124#include <cstdlib>
125
126
144
145
146////////////////////////////////////////////////////////////////////////////////
147/// Constructor of histogram attribute GUI.
148
150 Int_t height, UInt_t options, Pixel_t back)
151 : TGedFrame(p, width, height, options | kVerticalFrame, back),
152 fHist(0),
153 fSameOpt(kFALSE),
154 fBin(0),
155 fBinHist(0)
156{
157 // TextEntry for changing the title of the histogram
158 MakeTitle("Title");
159 fTitlePrec = 2;
160 fTitle = new TGTextEntry(this, new TGTextBuffer(50), kTH1_TITLE);
162 fTitle->SetToolTipText("Enter the histogram title string");
163 AddFrame(fTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
164
165 // Histogram draw options
166 TGCompositeFrame *fHistLbl = new TGCompositeFrame(this, 145, 10,
168 kFitWidth |
171 fHistLbl->AddFrame(new TGLabel(fHistLbl,"Histogram"),
172 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
173 fHistLbl->AddFrame(new TGHorizontal3DLine(fHistLbl),
174 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 0));
176
177 // TGButtonGroup to change: 2D plot <-> 3D plot
178 TGCompositeFrame *f2 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
179 fDimGroup = new TGHButtonGroup(f2,"Plot");
182 fDim->SetToolTipText("A 2-d plot of the histogram is dawn");
184 fDim0->SetToolTipText("A 3-d plot of the histogram is dawn");
187 fDimGroup->Show();
189 f2->AddFrame(fDimGroup, new TGLayoutHints(kLHintsTop, 4, 1, 0, 0));
190 AddFrame(f2, new TGLayoutHints(kLHintsTop, 1, 1, 2, 8));
191
192 // Set the type of histogram (Lego0..2, Surf0..5) for 3D plot
193 f3 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
194 AddFrame(f3, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
195
196 TGCompositeFrame *f3a = new TGCompositeFrame(f3, 40, 20);
197 f3->AddFrame(f3a, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
198 TGLabel *fType = new TGLabel(f3a, "Add: ");
199 f3a->AddFrame(fType, new TGLayoutHints(kLHintsLeft, 6, 1, 4, 4));
200 TGLabel *fCoords = new TGLabel(f3a, "Coords:");
201 f3a->AddFrame(fCoords, new TGLayoutHints(kLHintsLeft, 6, 1, 4, 1));
202
203 TGCompositeFrame *f3b = new TGCompositeFrame(f3, 40, 20);
204 f3->AddFrame(f3b, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
206 f3b->AddFrame(fTypeCombo, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 1));
207 fTypeCombo->Resize(80, 20);
208 fTypeCombo->Associate(this);
209 //Set the coordinate system (Cartesian, Spheric, ...)
211 f3b->AddFrame(fCoordsCombo, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 1));
212 fCoordsCombo->Resize(80, 20);
213 fCoordsCombo->Associate(this);
214
215 // Set the Error (No error, error1..5)
216 TGCompositeFrame *f5 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
217 AddFrame(f5, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
218
219 TGCompositeFrame *f5a = new TGCompositeFrame(f5, 40, 20);
220 f5->AddFrame(f5a, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
221 TGLabel *fError = new TGLabel(f5a, "Error:");
222 f5a->AddFrame(fError, new TGLayoutHints(kLHintsLeft, 6, 2, 4, 1));
223
224 TGCompositeFrame *f5b = new TGCompositeFrame(f5, 40, 20);
225 f5->AddFrame(f5b, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
227 f5b->AddFrame(fErrorCombo, new TGLayoutHints(kLHintsLeft, 15, 1, 2, 1));
228 fErrorCombo->Resize(80, 20);
229 fErrorCombo->Associate(this);
230
231 // Further draw options: Smooth/Simple Line, Fill Area for 2D plot
232 f6 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
233 AddFrame(f6, new TGLayoutHints(kLHintsTop, 1, 1, 0, 3));
234
235 TGCompositeFrame *f6a = new TGCompositeFrame(f6, 40, 20);
236 f6->AddFrame(f6a, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
237 TGLabel *fAddLabel = new TGLabel(f6a, "Style:");
238 f6a->AddFrame(fAddLabel, new TGLayoutHints(kLHintsLeft, 6, 2, 4, 1));
239
240 TGCompositeFrame *f6b = new TGCompositeFrame(f6, 40, 20);
241 f6->AddFrame(f6b, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
243 f6b->AddFrame(fAddCombo, new TGLayoutHints(kLHintsLeft, 15, 1, 2, 1));
244 fAddCombo->Resize(80, 20);
245 fAddCombo->Associate(this);
246
247 // option related to HIST: some changes needed here!
248 // because of inconsistencies
249 f15 = new TGCompositeFrame(this, 80, 20, kVerticalFrame);
250 fAddSimple = new TGCheckButton(f15, "Simple Drawing", kADD_LINE);
251 fAddSimple ->SetToolTipText("A simple histogram without errors is drawn (draw option: Hist)");
252 f15->AddFrame(fAddSimple, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
253 AddFrame(f15, new TGLayoutHints(kLHintsTop, 1, 1, 0, -1));
254
255 // Show Marker Checkbox: draw marker (or not)
256 f7 = new TGCompositeFrame(this, 80, 20, kVerticalFrame);
257 fAddMarker = new TGCheckButton(f7, "Show markers", kMARKER_ONOFF);
258 fAddMarker ->SetToolTipText("Make marker visible/invisible");
259 f7->AddFrame(fAddMarker, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
260 AddFrame(f7, new TGLayoutHints(kLHintsTop, 1, 1, 2, 0));
261
262 // Bar Chart Checkbox: draw with option B
263 f8 = new TGCompositeFrame(this, 80, 20, kVerticalFrame);
264 fAddB = new TGCheckButton(f8, "Draw bar chart", kB_ONOFF);
265 fAddB ->SetToolTipText("Draw a bar chart");
266 f8->AddFrame(fAddB, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
267 AddFrame(f8, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
268
269 // Bar CheckBox: draw with option BAR +option selected by
270 // fPercentCombo (0..4) e.g. BAR2
271 f9 = new TGCompositeFrame(this, 80, 20, kVerticalFrame);
272 fAddBar = new TGCheckButton(f9, "Bar option", kBAR_ONOFF);
273 fAddBar ->SetToolTipText("Draw bar chart with bar-option");
274 f9->AddFrame(fAddBar, new TGLayoutHints(kLHintsLeft, 6, 1, 1, 0));
275 AddFrame(f9, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
276
277 // Bar Menu => appears when the BAR checkbox is set
278 f10 = new TGCompositeFrame(this, 145, 10, kHorizontalFrame |
279 kFitWidth |
282 f10->AddFrame(new TGLabel(f10,"Bar"),
283 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
285 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
286 AddFrame(f10, new TGLayoutHints(kLHintsTop,0,0,6,4));
287
288 // NumberEntry to change the Bar Width
289 f11 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
290 TGLabel *fWidthLbl = new TGLabel(f11, "W:");
291 f11->AddFrame(fWidthLbl, new TGLayoutHints(kLHintsLeft, 1, 3, 4, 1));
292 fBarWidth = new TGNumberEntry(f11, 1.00, 6, kBAR_WIDTH,
296 fBarWidth->GetNumberEntry()->SetToolTipText("Set bin bar width");
297 fBarWidth->Resize(45,20);
298 f11->AddFrame(fBarWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 1));
299
300 // NumberEntry to change the Bar OFfset
301 TGLabel *foffsetLbl = new TGLabel(f11, "O:");
303 fBarOffset = new TGNumberEntry(f11, 0.00, 5, kBAR_OFFSET,
307 fBarOffset->GetNumberEntry()->SetToolTipText("Set bin bar offset");
308 fBarOffset->Resize(50,20);
309 f11->AddFrame(fBarOffset, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 1));
310 AddFrame(f11, new TGLayoutHints(kLHintsTop, 1, 1, 0, 4));
311
312 // ComboBox which specifies the width of the Bar which should be drawn
313 // in another color i.e. specifies the number in BAR option e.g. BAR2
314 f12 = new TGCompositeFrame(this, 80, 20, kVerticalFrame);
316 TGLabel *percentLabel = new TGLabel(f13, "Percentage:");
317 f13->AddFrame(percentLabel, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
319 fPercentCombo->Resize(51, 20);
321 f13->AddFrame(fPercentCombo, new TGLayoutHints(kLHintsLeft, 14, 1, 2, 1));
322 f12->AddFrame(f13,new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
323
324 // CHeckBox for horizontal drawing of the Histogram
325 fMakeHBar = new TGCheckButton(f12, "Horizontal Bar", kBAR_H);
326 fMakeHBar ->SetToolTipText("Draw a horizontal bar chart with hBar-Option");
327 f12->AddFrame(fMakeHBar, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 0));
328 AddFrame(f12, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
329
330 CreateBinTab();
331
332 // add itself in the least of cleanups to be notified when attached histogram is deleted
333 gROOT->GetListOfCleanups()->Add(this);
334}
335
336////////////////////////////////////////////////////////////////////////////////
337/// Create binning tab.
338
340{
341 fBin = CreateEditorTabSubFrame("Binning");
342
345 kFitWidth |
348 title1->AddFrame(new TGLabel(title1, "Rebin"),
349 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
350 title1->AddFrame(new TGHorizontal3DLine(title1),
351 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
352 fBin->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
353
354 // Widgets for rebinning a histogram which does NOT derive from a ntuple
359 fBinSlider->Resize(107,20);
360 f18->AddFrame(fBinSlider, new TGLayoutHints(kLHintsLeft, 3,0,0,3));
361 fBinCont->AddFrame(f18, new TGLayoutHints(kLHintsTop, 15, 7, 3, 5));
362
365 TGLabel *binLabel1 = new TGLabel(f20, "# of Bins:");
366 f20->AddFrame(binLabel1, new TGLayoutHints(kLHintsLeft, 7, 1, 2, 1));
369 ((TGTextEntry*)fBinNumberEntry)->SetToolTipText("Set the number of bins in the rebinned histogram");
370 fBinNumberEntry->Resize(57,20);
371 f20->AddFrame(fBinNumberEntry, new TGLayoutHints(kLHintsRight, 21, 0, 0, 0));
372 fBinCont->AddFrame(f20, new TGLayoutHints(kLHintsTop, 0, 7, 3, 4));
373
374 // Text buttons to Apply or Delete the rebinned histogram
375 TGCompositeFrame *f23 = new TGCompositeFrame(fBinCont, 118, 20,
378 fApply = new TGTextButton(f23, " &Apply ");
379 f23->AddFrame(fApply,
380 new TGLayoutHints(kLHintsExpandX | kLHintsLeft , 0, 3, 4, 4));
381 fCancel = new TGTextButton(f23, " &Ignore ");
382 f23->AddFrame(fCancel,
383 new TGLayoutHints(kLHintsExpandX | kLHintsLeft, 3, 0, 4, 4));
384 fBinCont->AddFrame(f23, new TGLayoutHints(kLHintsTop, 20, 3, 3, 4));
386
387 // Widgets for rebinning a histogram which derives from a ntuple
392 fBinSlider1->Resize(107,20);
393 fBinSlider1->SetRange(1,9);
396 f21->AddFrame(fBinSlider1, new TGLayoutHints(kLHintsLeft, 3,0,0,3));
397 fBinCont1->AddFrame(f21, new TGLayoutHints(kLHintsTop, 15, 7, 5, 0));
398
399 // Lettering of the Rebin Slider
402 TGLabel *l1 = new TGLabel(f24, "-5");
403 f24->AddFrame(l1, new TGLayoutHints(kLHintsLeft, 18, 1, -1, 0));
404 TGLabel *l2 = new TGLabel(f24, "-2");
405 f24->AddFrame(l2, new TGLayoutHints(kLHintsLeft, 26, 2, -1, 0));
406 TGLabel *l3 = new TGLabel(f24, "2");
407 f24->AddFrame(l3, new TGLayoutHints(kLHintsLeft, 17, 2, -1, 0));
408 TGLabel *l4 = new TGLabel(f24, "5");
409 f24->AddFrame(l4, new TGLayoutHints(kLHintsLeft, 32, 3, -1, 0));
410 fBinCont1->AddFrame(f24, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
411
414 TGLabel *binLabel2 = new TGLabel(f22, "# of Bins:");
415 f22->AddFrame(binLabel2, new TGLayoutHints(kLHintsLeft, 7, 1, 4, 1));
416
419 ((TGTextEntry*)fBinNumberEntry1)->SetToolTipText("Set the number of bins in the rebinned histogram");
420 fBinNumberEntry1->Resize(57,20);
421 f22->AddFrame(fBinNumberEntry1, new TGLayoutHints(kLHintsLeft, 21, 0, 2, 0));
422 fBinCont1->AddFrame(f22, new TGLayoutHints(kLHintsTop, 0, 7, 2, 4));
423
426 TGLabel *offsetLbl = new TGLabel(f26, "BinOffset:");
427 f26->AddFrame(offsetLbl, new TGLayoutHints(kLHintsLeft, 6, 1, 2, 1));
432 0., 1.);
433 ((TGTextEntry*)fOffsetNumberEntry)->SetToolTipText("Add an offset to the origin of the histogram");
435 f26->AddFrame(fOffsetNumberEntry,
436 new TGLayoutHints(kLHintsRight, 21, 0, 0, 0));
437 fBinCont1->AddFrame(f26, new TGLayoutHints(kLHintsTop, 0, 7, 3, 1));
438
442 fBinOffsetSld->Resize(107,20);
443 f25->AddFrame(fBinOffsetSld, new TGLayoutHints(kLHintsLeft, 15,0,0,2));
444 fBinCont1->AddFrame(f25, new TGLayoutHints(kLHintsTop, 3, 7, 3, 3));
446
447 // Sliders for axis range
452 kFitWidth |
455 title2->AddFrame(new TGLabel(title2, "Axis Range"),
456 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
457 title2->AddFrame(new TGHorizontal3DLine(title2),
458 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
459 sldCont->AddFrame(title2, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
460
463 TGLabel *fSliderLbl = new TGLabel(f14,"x:");
464 f14->AddFrame(fSliderLbl,
465 new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4,4, 4, 1));
466 fSlider = new TGDoubleHSlider(f14, 1, 2);
467 fSlider->Resize(118,20);
468 f14->AddFrame(fSlider, new TGLayoutHints(kLHintsLeft));
469 sldCont->AddFrame(f14, new TGLayoutHints(kLHintsTop, 3, 7, 4, 1));
470
476 ((TGTextEntry*)fSldMin)->SetToolTipText("Set the minimum value of the x-axis");
477 fSldMin->Resize(57,20);
478 f16->AddFrame(fSldMin, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
482 ((TGTextEntry*)fSldMax)->SetToolTipText("Set the maximum value of the x-axis");
483 fSldMax->Resize(57,20);
484 f16->AddFrame(fSldMax, new TGLayoutHints(kLHintsLeft, 4, 0, 0, 0));
485 sldCont->AddFrame(f16, new TGLayoutHints(kLHintsTop, 20, 3, 5, 0));
486
488 fDelaydraw = new TGCheckButton(f17, "Delayed drawing", kDELAYED_DRAWING);
489 fDelaydraw ->SetToolTipText("Draw the new histogram only when any Slider is released");
490 f17->AddFrame(fDelaydraw, new TGLayoutHints(kLHintsLeft, 6, 1, 2, 0));
491 sldCont->AddFrame(f17, new TGLayoutHints(kLHintsTop, 1, 1, 5, 0));
493
494 // to avoid jumping from DoAddBar to DoAddB and vice versa
496 // to avoid calling SetDrawoption after every change
497 fMake=kTRUE;
498
499 fBinHist = 0; // used to save a copy of the histogram
500
501 // (when not drawn from an ntuple)
502 fBinOffsetSld->SetRange(0,100);
507
508} // end bin tab
509
510////////////////////////////////////////////////////////////////////////////////
511/// Destructor of TH1 editor.
512
514{
515 // remove itselef from the list of cleanups
516 gROOT->GetListOfCleanups()->Remove(this);
517
518 // children of TGButonGroup are not deleted
519 delete fDim;
520 delete fDim0;
521 delete fDimlh;
522 delete fDim0lh;
523
524 if (fBinHist) delete fBinHist;
525 fBinHist = 0;
526}
527
528////////////////////////////////////////////////////////////////////////////////
529/// Connect signals to slots.
530
532{
533 //widgets for draw options
534 fAddB->Connect("Toggled(Bool_t)", "TH1Editor", this, "DoAddB(Bool_t)");
535 fAddBar->Connect("Toggled(Bool_t)", "TH1Editor", this, "DoAddBar(Bool_t)");
536 fTitle->Connect("TextChanged(const char *)", "TH1Editor", this, "DoTitle(const char *)");
537 fTypeCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoHistChanges()");
538 fCoordsCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoHistChanges()");
539 fErrorCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoHistChanges()");
540 fAddCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoHistChanges()");
541 fAddMarker->Connect("Toggled(Bool_t)", "TH1Editor", this, "DoAddMarker(Bool_t)");
542 fAddSimple->Connect("Toggled(Bool_t)", "TH1Editor", this, "DoAddSimple(Bool_t)");
543
544 //change 2D <-> 3D plot
545 fDimGroup->Connect("Clicked(Int_t)","TH1Editor",this,"DoHistView()");
546
547 // change Bar Width/Offset, the second connection is needed to have the ability to confirm the value also with enter
548 fBarWidth->Connect("ValueSet(Long_t)", "TH1Editor", this, "DoBarWidth()");
549 (fBarWidth->GetNumberEntry())->Connect("ReturnPressed()", "TH1Editor", this, "DoBarWidth()");
550 fBarOffset->Connect("ValueSet(Long_t)", "TH1Editor", this, "DoBarOffset()");
551 (fBarOffset->GetNumberEntry())->Connect("ReturnPressed()", "TH1Editor", this, "DoBarOffset()");
552 fPercentCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoPercent()");
553 fMakeHBar-> Connect("Toggled(Bool_t)","TH1Editor",this,"DoHBar(Bool_t))");
554
555 // Connections for rebinning are created - i.e. slider is
556 // connected to the slots that perform the rebinning in the
557 // case of a histogram not derived from an ntuple.
558 fBinSlider->Connect("PositionChanged(Int_t)","TH1Editor",this, "DoBinMoved(Int_t)");
559 fBinSlider->Connect("Released()","TH1Editor",this, "DoBinReleased()");
560 fBinSlider->Connect("Pressed()","TH1Editor",this, "DoBinPressed()");
561 // numberEntry which shows/sets the actual number of bins
562 fBinNumberEntry->Connect("ReturnPressed()", "TH1Editor", this, "DoBinLabel()");
563 // Buttons to accept/reject the rebinned histogram
564 fApply->Connect("Clicked()", "TH1Editor", this, "DoApply()");
565 fCancel->Connect("Pressed()", "TH1Editor", this, "DoCancel()");
566 // in case of a histogram which is derived from an ntuple these slots are used
567 fBinSlider1->Connect("Released()","TH1Editor",this, "DoBinReleased1()");
568 fBinSlider1->Connect("PositionChanged(Int_t)","TH1Editor",this, "DoBinMoved1()");
569 fBinNumberEntry1->Connect("ReturnPressed()", "TH1Editor", this, "DoBinLabel1()");
570 // slider/slots to change the offset of the histogram
571 fBinOffsetSld->Connect("PositionChanged(Int_t)", "TH1Editor", this,"DoOffsetMoved(Int_t)");
572 fBinOffsetSld->Connect("Released()", "TH1Editor", this, "DoOffsetReleased()");
573 fBinOffsetSld->Connect("Pressed()", "TH1Editor", this, "DoOffsetPressed()");
574 fOffsetNumberEntry->Connect("ReturnPressed()", "TH1Editor", this, "DoBinOffset()");
575 // slider/slots to set the visible axisrange
576 fSlider->Connect("PositionChanged()","TH1Editor", this,"DoSliderMoved()");
577 fSlider->Connect("Pressed()","TH1Editor", this, "DoSliderPressed()");
578 fSlider->Connect("Released()","TH1Editor", this, "DoSliderReleased()");
579 fSldMin->Connect("ReturnPressed()", "TH1Editor", this, "DoAxisRange()");
580 fSldMax->Connect("ReturnPressed()", "TH1Editor", this, "DoAxisRange()");
581 fInit = kFALSE;
582}
583
584////////////////////////////////////////////////////////////////////////////////
585/// Check if object is able to configure with this editor.
586
588{
589 if (obj == 0 || !obj->InheritsFrom(TH1::Class()) ||
590 ((TH1*)obj)->GetDimension()!=1 ||
591 ((TH1*)obj)->GetEntries() == 0
592 /*|| obj->InheritsFrom("TH2") || obj->InheritsFrom("TProfile")*/) {
593 return kFALSE;
594 }
595 return kTRUE;
596}
597
598////////////////////////////////////////////////////////////////////////////////
599/// Pick up current values of histogram attributes.
600
602{
603
604 if (fBinHist && (obj != fHist)) {
605 //we have probably moved to a different pad.
606 //let's restore the original histogram
607 if (fHist) {
608 fHist->Reset();
613 }
614 // delete in anycase fBinHist also when fHist is zero (i.e when it has been deleted)
615 delete fBinHist; fBinHist = 0;
616 }
617
618 fHist = (TH1*)obj;
620
621 const char *text = fHist->GetTitle();
623
625 TString str = GetDrawOption();
626 str.ToUpper();
627 if (str.Contains("SAME"))
628 fSameOpt = kTRUE;
629 else
632 // if no draw option is specified: (default options)
633 if (str.IsNull() || str=="" ) {
636 HideFrame(f3); // Hiding the histogram type combo box
637 ShowFrame(f6);
638 ShowFrame(f7);
639 ShowFrame(f8);
640 ShowFrame(f9);
641 HideFrame(f10);
642 HideFrame(f11);
643 HideFrame(f12);
644 ShowFrame(f15);
654 // in case of a 2D plot:
655 } else if (!str.Contains("LEGO") && !str.Contains("SURF")){
658 HideFrame(f3); // Hiding the histogram type combo box
659 ShowFrame(f7);
660 ShowFrame(f8);
661 ShowFrame(f9);
662 ShowFrame(f15);
664 // initialising fAddCombo
665 if (str.Contains("C")) {
666 if (str.Contains("CYL")) {
667 TString dum = str;
668 dum.Remove(strstr(dum.Data(),"CYL")-dum.Data(),3);
669 if (dum.Contains("C")) fAddCombo->Select(kADD_SMOOTH);
671 }
672 else if (str.Contains("LF2")) fAddCombo->Select(kADD_FILL);
673 else if (str.Contains("L")){
674 TString dum = str;
675 if (str.Contains("CYL")) {
676 dum.Remove(strstr(dum.Data(),"CYL")-dum.Data(),3);
677 if (dum.Contains("L")) fAddCombo->Select(kADD_SIMPLE);
678 }
679 if (str.Contains("POL")) {
680 dum.Remove(strstr(dum.Data(),"POL")-dum.Data(),3);
681 if (dum.Contains("L")) fAddCombo->Select(kADD_SIMPLE);
683 } else fAddCombo->Select(kADD_NONE);
684
687 else if (str.Contains("HIST")) {
688 if (str=="HIST") fAddSimple->SetState(kButtonDisabled);
691
692 if (str.Contains("B")) {
693 TString dum = str;
694 if (str.Contains("BAR")) {
697 ShowFrame(f10);
698 ShowFrame(f11);
699 ShowFrame(f12);
700 } else {
704 ShowFrame(f10);
705 ShowFrame(f11);
706 HideFrame(f12);
707 }
708 } else {
711 HideFrame(f10);
712 HideFrame(f11);
713 HideFrame(f12);
714 }
715 if (str.Contains("P") ) {
718 } else if (!str.Contains("BAR")) fAddMarker->SetState(kButtonUp);
720
721 // in case of a 3D plot
722 } else if (str.Contains("LEGO") || str.Contains("SURF")){
725 TGListBox* lb;
727 // set Coordinate ComboBox
728 if (str.Contains("SURF")){
729 // surf cannot be combined with spheric and cartesian coordinates
730 // i.e. remove them from the combobox
734 lb->Resize(lb->GetWidth(), 49);
735 } else {
736 // surf cannot be combined with spheric and cartesian coordinates
737 // if surf was selected before here the removed items were added the combobox again
738 if (((TGLBContainer*)((TGListBox*)fCoordsCombo->GetListBox())->GetContainer())->GetPos(kCOORDS_SPH)==-1)
739 fCoordsCombo->AddEntry("Spheric", kCOORDS_SPH);
740 if (((TGLBContainer*)((TGListBox*)fCoordsCombo->GetListBox())->GetContainer())->GetPos(kCOORDS_CAR)==-1) {
741 fCoordsCombo->AddEntry("Cartesian", kCOORDS_CAR);
743 lb->Resize(lb->GetWidth(), 83);
744 }
745 }
746 // initialising the Type Combobox
747 if (str.Contains("LEGO2")) fTypeCombo->Select(kTYPE_LEGO2);
748 else if (str.Contains("LEGO1")) fTypeCombo->Select(kTYPE_LEGO1);
749 else if (str.Contains("LEGO")) fTypeCombo->Select(kTYPE_LEGO);
750 else if (str.Contains("SURF5")) fTypeCombo->Select(kTYPE_SURF5);
751 else if (str.Contains("SURF4")) fTypeCombo->Select(kTYPE_SURF4);
752 else if (str.Contains("SURF3")) fTypeCombo->Select(kTYPE_SURF3);
753 else if (str.Contains("SURF2")) fTypeCombo->Select(kTYPE_SURF2);
754 else if (str.Contains("SURF1")) fTypeCombo->Select(kTYPE_SURF1);
755 else if (str.Contains("SURF")) fTypeCombo->Select(kTYPE_SURF);
756
757 if (str.Contains("CYL")) fCoordsCombo->Select(kCOORDS_CYL);
758 else if (str.Contains("POL")) fCoordsCombo->Select(kCOORDS_POL);
759 else if (str.Contains("SPH")) fCoordsCombo->Select(kCOORDS_SPH);
760 else if (str.Contains("PSR")) fCoordsCombo->Select(kCOORDS_PSR);
761 else fCoordsCombo->Select(kCOORDS_CAR); //default
762
763 HideFrame(f6);
764 HideFrame(f7);
765 HideFrame(f8);
766 HideFrame(f9);
767 HideFrame(f15);
768 if (str.Contains("LEGO")) {
769 ShowFrame(f10);
770 ShowFrame(f11);
771 HideFrame(f12);
772 } else {
773 HideFrame(f10);
774 HideFrame(f11);
775 HideFrame(f12);
776 }
779 }
780
781 if (!errorset) {
782 if (str.Contains("E1")) fErrorCombo->Select(kERRORS_EDGES);
783 else if (str.Contains("E2")) fErrorCombo->Select(kERRORS_REC);
784 else if (str.Contains("E3")) fErrorCombo->Select(kERRORS_FILL);
785 else if (str.Contains("E4")) fErrorCombo->Select(kERRORS_CONTOUR);
786 else if (str.Contains("E")) {
787 if (str.Contains("LEGO")) {
788 TString dum=str;
789 dum.Remove(strstr(dum.Data(),"LEGO")-dum.Data(),4);
790 if (dum.Contains("E")) fErrorCombo->Select(kERRORS_SIMPLE);
792 } else fErrorCombo->Select(kERRORS_NO); //default
793 }
794
796 HideFrame(f7);
797 HideFrame(f8);
798 }
799 if (str.Contains("BAR") || ((fAddBar->GetState()==kButtonDown) &&
800 (fDim->GetState()==kButtonDown))) {
801 ShowFrame(f10);
802 ShowFrame(f11);
803 ShowFrame(f12);
806 if (str.Contains("HBAR")) fMakeHBar->SetState(kButtonDown);
808
809 if (str.Contains("BAR4")) fPercentCombo->Select(kPER_40);
810 else if (str.Contains("BAR3")) fPercentCombo->Select(kPER_30);
811 else if (str.Contains("BAR2")) fPercentCombo->Select(kPER_20);
812 else if (str.Contains("BAR1")) fPercentCombo->Select(kPER_10);
814 }
815
816 Int_t nx = fHist -> GetXaxis() -> GetNbins();
817 Int_t nxbinmin = fHist -> GetXaxis() -> GetFirst();
818 Int_t nxbinmax = fHist -> GetXaxis() -> GetLast();
819
821
823
824 // Check if histogram is from ntupla/tree or not.
825 // If it is a standard histogram or a ntupla based histogram
826 // show a different frame in case of rebinning (fBinCont) with sliders and bin number entries
827 // connected to different methods.
828 // For example the entry field fBinNumberEntry is connected to
829 // the method DoBinLabel in case of non-ntupla histograms which just call Th1::Rebin
830 // In csae of a tree based histogram the entry field fBinNumberEntry1 is used which is connected to
831 // TH1Editor::DoBinLabel1 which is re-filling the histograms with the cached values from the TTreePlayer.
832 // Since the actual number of histogram entry can be larger than the cache size of the TTreePlayer
833 // (see JIRA ROOT-5900 or http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=17107 )
834 // the GUI frame based on a non-tupla histogram is used when the number of entries of the histogram is
835 // not the same as the number of filled entries in the TTreePlayer object.
836
837 if (!player || player->GetHistogram()!=fHist ||
838 fHist->GetEntries() != player->GetNfill()) {
839
840 Int_t n = 0;
841 if (fBinHist) n = fBinHist->GetXaxis()->GetNbins();
842 else n = nx;
843 if (n < 1) n = 1;
846 Int_t* div = Dividers(n);
847 Int_t up = 0;
848 if (div[0]-1 <= 1) up = 2;
849 else up = div[0]-1;
851 Int_t i = 1;
854 else {
855 while ( div[i] != nx) i ++;
856 fBinSlider->SetPosition(div[0] - i + 1);
857 }
860 delete [] div;
861 }
862 else if (player && fHist==player->GetHistogram() && fHist->GetEntries() == player->GetNfill()) {
863 // in case of a ntupla/tree based histogram with number of entries not exceeding the TTreePlayer cache
866 fBinSlider->SetRange(0,1);
871 }
872
873 fSlider->SetRange(1,nx);
875
878
880 fHist->GetXaxis()->GetBinWidth(1));
881
883 fMake=kTRUE;
886}
887
888////////////////////////////////////////////////////////////////////////////////
889/// Slot connected to the histogram title setting.
890
891void TH1Editor::DoTitle(const char *text)
892{
893 if (fAvoidSignal) return;
895 Update();
896}
897
898////////////////////////////////////////////////////////////////////////////////
899/// Slot connected to the show markers check box.
900
902{
903 if (fAvoidSignal) return;
904 TString str = GetDrawOption();
905 str.ToUpper();
906 if (str.Contains("SAME"))
907 fSameOpt = kTRUE;
908 else
910 TString dum = str;
911
912 if (dum.Contains("POL")) dum.Remove(strstr(dum.Data(),"POL")-dum.Data(),3);
913 if (dum.Contains("SPH")) dum.Remove(strstr(dum.Data(),"SPH")-dum.Data(),3);
914 if (dum.Contains("PSR")) dum.Remove(strstr(dum.Data(),"PSR")-dum.Data(),3);
915 if (on) {
916 if (!dum.Contains("P")) str += "P";
918 if (str.Contains("HIST"))
919 str.Remove(strstr(str.Data(),"HIST")-str.Data(),4);
920 } else if (fAddMarker->GetState()==kButtonUp) {
921 if (str.Contains("POL") || str.Contains("SPH")) {
922 while (dum.Contains("P"))
923 dum.Remove(strstr(dum.Data(),"P")-dum.Data(),1);
924 if (str.Contains("POL")) str = dum + "POL";
925 if (str.Contains("SPH")) str = dum + "SPH";
926 if (str.Contains("PSR")) str = dum + "PSR";
927 } else if (str.Contains("P")) str.Remove(str.First("P"),1);
928 if ((str=="HIST") || (str=="") ||
929 (fAddB->GetState()==kButtonDown) ||
932 else if (str.Contains("HIST"))
934 else
936 }
937 if (fMake) {
938 if (fSameOpt) str += "SAME";
939 SetDrawOption(str);
940 Update();
941 }
942}
943
944////////////////////////////////////////////////////////////////////////////////
945/// Slot connected to the bar Add check box.
946
948{
949 if (fAvoidSignal) return;
950 TString str = GetDrawOption();
951 str.ToUpper();
952 if (str.Contains("SAME"))
953 fSameOpt = kTRUE;
954 else
956 if (fMakeB) {
958 if (on) {
959 if (!str.Contains("B")) str += "B";
960 ShowFrame(f10);
961 ShowFrame(f11);
962 HideFrame(f12);
967 } else if (fAddB->GetState()==kButtonUp) {
968 while (str.Contains("B"))
969 str.Remove(str.First("B"),1);
970 HideFrame(f10);
971 HideFrame(f11);
972 HideFrame(f12);
975 !(str=="" || str=="HIST" ||
978 }
979 if (fSameOpt) str += "SAME";
980 if (fMake) SetDrawOption(str);
981 Update();
982
984 }
985}
986
987////////////////////////////////////////////////////////////////////////////////
988/// Slot connected to the bar Add check box.
989
991{
992 if (fAvoidSignal) return;
994 TString str = GetDrawOption();
995 str.ToUpper();
996 if (str.Contains("SAME"))
997 fSameOpt = kTRUE;
998 else
1000 if (fMakeB) {
1001 fMakeB=kFALSE;
1002 Int_t o = 0;
1003 if (str.Contains("HBAR")) o=1;
1004 if (str.Contains("BAR4"))
1005 str.Remove(strstr(str.Data(),"BAR4")-str.Data()-o,4+o);
1006 else if (str.Contains("BAR3"))
1007 str.Remove(strstr(str.Data(),"BAR3")-str.Data()-o,4+o);
1008 else if (str.Contains("BAR2"))
1009 str.Remove(strstr(str.Data(),"BAR2")-str.Data()-o,4+o);
1010 else if (str.Contains("BAR1"))
1011 str.Remove(strstr(str.Data(),"BAR1")-str.Data()-o,4+o);
1012 else if (str.Contains("BAR0"))
1013 str.Remove(strstr(str.Data(),"BAR0")-str.Data()-o,4+o);
1014 else if (str.Contains("BAR"))
1015 str.Remove(strstr(str.Data(),"BAR")-str.Data()-o,3+o);
1016 if (on) {
1017 if ((fAddMarker->GetState()==kButtonDown) &&
1021 else if ((fAddMarker->GetState()!=kButtonDown) &&
1023 if (str.Contains("HIST"))
1025 else if (fAddCombo->GetSelected()!=kADD_NONE)
1027 else
1029 }
1030 switch (fPercentCombo->GetSelected()){
1031 case(-1): {
1032 str += "BAR";
1034 break;
1035 }
1036 case(kPER_0): {
1037 str += "BAR";
1038 break;
1039 }
1040 case(kPER_10): {
1041 str += "BAR1";
1042 break;
1043 }
1044 case(kPER_20): {
1045 str += "BAR2";
1046 break;
1047 }
1048 case(kPER_30): {
1049 str += "BAR3";
1050 break;
1051 }
1052 case(kPER_40): {
1053 str += "BAR4";
1054 break;
1055 }
1056 }
1057 ShowFrame(f10);
1058 ShowFrame(f11);
1059 ShowFrame(f12);
1061 str.Insert(strstr(str.Data(),"BAR")-str.Data(),"H");
1065 } else if (fAddBar->GetState()==kButtonUp) {
1066 HideFrame(f10);
1067 HideFrame(f11);
1068 HideFrame(f12);
1072 if (str=="" || str=="HIST" || fAddCombo->GetSelected() != kADD_NONE ||
1073 ((fAddMarker->GetState() == kButtonDown) &&
1076 }
1077 if (fSameOpt) str += "SAME";
1078 if (fMake) SetDrawOption(str);
1079 Update();
1081 fMakeB=kTRUE;
1082 }
1083 fAddMarker->Connect("Toggled(Bool_t)", "TH1Editor", this, "DoAddMarker(Bool_t)");
1084}
1085
1086////////////////////////////////////////////////////////////////////////////////
1087/// Slot connected to fAddSimple check box for drawing a simple histogram
1088/// without errors (== HIST draw option) in combination with some other
1089/// draw options. It draws an additional line on the top of the bins.
1090
1092{
1093 if (fAvoidSignal) return;
1095 // Bool_t make=kFALSE;
1096 fMake = kFALSE;
1097 TString str = GetDrawOption();
1098 str.ToUpper();
1099 if (str.Contains("SAME"))
1100 fSameOpt = kTRUE;
1101 else
1102 fSameOpt = kFALSE;
1103 if (on) {
1104 if (!str.Contains("HIST")) {
1105 str += "HIST";
1107 fMake=kTRUE;
1108 }
1109 } else if (fAddSimple->GetState()==kButtonUp) {
1110 if (str.Contains("HIST")) {
1111 str.Remove(strstr(str.Data(),"HIST")-str.Data(),4);
1113 fMake=kTRUE;
1114 }
1115 }
1116 if (fSameOpt) str += "SAME";
1117 if (fMake) SetDrawOption(str);
1118 fAddMarker->Connect("Toggled(Bool_t)", "TH1Editor", this, "DoAddMarker(Bool_t)");
1119 Update();
1120}
1121
1122////////////////////////////////////////////////////////////////////////////////
1123/// Slot connected to the 'Plot' button group.
1124
1126{
1127 if (gPad && gPad->GetVirtCanvas())
1128 gPad->GetVirtCanvas()->SetCursor(kWatch);
1129 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
1130
1131 if (fDim->GetState() == kButtonDown)
1132 DoHistSimple();
1133 else
1134 DoHistComplex();
1135
1136 if (gPad && gPad->GetVirtCanvas())
1137 gPad->GetVirtCanvas()->SetCursor(kPointer);
1138 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kPointer));
1139}
1140
1141////////////////////////////////////////////////////////////////////////////////
1142/// Slot connected to the 2D radio button.
1143
1145{
1146 if (fAvoidSignal) return;
1147 if (fDim->GetState()==kButtonDown){
1148 TString str ="";
1149 fMake=kFALSE;
1150 TGListBox* lb;
1151 HideFrame(f3);
1152 ShowFrame(f6);
1153 ShowFrame(f9);
1154 ShowFrame(f15);
1156 if ((fAddBar->GetState() != kButtonDown ||
1160 else if ((fAddSimple->GetState()==kButtonDisabled) &&
1163 else if (fAddSimple->GetState()!=kButtonUp)
1168
1170 ShowFrame(f7);
1171 ShowFrame(f8);
1172 } else {
1173 HideFrame(f7);
1174 HideFrame(f8);
1177 }
1178
1179 if ((fAddB->GetState() == kButtonDisabled)) {
1180 if (fAddBar->GetState()==kButtonDown) {
1181 ShowFrame(f10);
1182 ShowFrame(f11);
1183 ShowFrame(f12);
1184 } else {
1185 HideFrame(f10);
1186 HideFrame(f11);
1187 HideFrame(f12);
1188 }
1189 }
1190 if (fAddBar->GetState() == kButtonDisabled){
1191 ShowFrame(f10);
1192 ShowFrame(f11);
1193 HideFrame(f12);
1194 }
1195 if ((fAddBar->GetState() == kButtonUp) &&
1196 (fAddB->GetState() == kButtonUp)) {
1197 HideFrame(f10);
1198 HideFrame(f11);
1199 HideFrame(f12);
1200 }
1204 lb = fAddCombo->GetListBox();
1205 lb->Resize(lb->GetWidth(),19);
1208 fAddCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoHistChanges()");
1209 } else {
1210 if (((TGLBContainer*)((TGListBox*)fAddCombo->GetListBox())->GetContainer())->GetPos(kADD_SIMPLE)==-1)
1211 ((TGListBox*)fAddCombo->GetListBox())->AddEntry("Simple Line", kADD_SIMPLE);
1212 if (((TGLBContainer*)((TGListBox*)fAddCombo->GetListBox())->GetContainer())->GetPos(kADD_SMOOTH)==-1)
1213 ((TGListBox*)fAddCombo->GetListBox())->AddEntry("Smooth Line", kADD_SMOOTH);
1214 if (((TGLBContainer*)((TGListBox*)fAddCombo->GetListBox())->GetContainer())->GetPos(kADD_FILL)==-1) {
1215 ((TGListBox*)fAddCombo->GetListBox())->AddEntry("Fill Area",kADD_FILL);
1216 lb = fAddCombo->GetListBox();
1217 lb->Resize(lb->GetWidth(),76);
1218 }
1219 }
1220 if (fAddSimple->GetState()==kButtonDown) str+="HIST";
1222 if (fSameOpt) str += "SAME";
1223 SetDrawOption(str);
1224 Update();
1225 //fGedEditor->GetTab()->Layout();
1227 fMake=kTRUE;
1228 }
1229}
1230
1231////////////////////////////////////////////////////////////////////////////////
1232/// Slot connected to the 3D radio button.
1233
1235{
1236 if (fAvoidSignal) return;
1237 if (fDim0->GetState()==kButtonDown) {
1238 TString str ="";
1239 fMake=kFALSE;
1240 ShowFrame(f3);
1241 HideFrame(f6);
1242 HideFrame(f7);
1243 HideFrame(f8);
1244 HideFrame(f9);
1245 HideFrame(f15);
1247 if (fTypeCombo->GetSelected()==-1 && fCoordsCombo->GetSelected()==-1) {
1248 str = "LEGO"+GetHistErrorLabel();
1251 } else if (fTypeCombo->GetSelected()==-1){
1252 str = "LEGO"+GetHistErrorLabel();
1254 } else if (fCoordsCombo->GetSelected()==-1) {
1257 } else {
1259 }
1260 if (str.Contains("LEGO")) {
1261 ShowFrame(f10);
1262 ShowFrame(f11);
1263 HideFrame(f12);
1264 } else {
1265 HideFrame(f10);
1266 HideFrame(f11);
1267 HideFrame(f12);
1268 }
1269 if (fSameOpt) str += "SAME";
1270 SetDrawOption(str);
1271 Update();
1273 fGedEditor->GetTab()->Layout();
1274 fMake=kTRUE;
1275 }
1276}
1277
1278////////////////////////////////////////////////////////////////////////////////
1279/// Slot connected to the histogram type, the coordinate type, the error type
1280/// and the Add combo box.
1281
1283{
1284 if (fAvoidSignal) return;
1285 fMakeB= kFALSE;
1286 TGListBox* lb;
1287 if (GetHistTypeLabel().Contains("SURF")) {
1294 lb->Resize(lb->GetWidth(), 49);
1295 } else {
1296 if (((TGLBContainer*)((TGListBox*)fCoordsCombo->GetListBox())->GetContainer())->GetPos(kCOORDS_SPH)==-1)
1297 ((TGListBox*)fCoordsCombo->GetListBox())->AddEntrySort("Spheric", kCOORDS_SPH);
1298 if (((TGLBContainer*)((TGListBox*)fCoordsCombo->GetListBox())->GetContainer())->GetPos(kCOORDS_CAR)==-1) {
1299 ((TGListBox*)fCoordsCombo->GetListBox())->AddEntrySort("Cartesian", kCOORDS_CAR);
1301 lb->Resize(lb->GetWidth(), 83);
1302 }
1303 }
1304 if (fDim->GetState()!=kButtonUp){
1306 HideFrame(f7);
1307 HideFrame(f8);
1308 ShowFrame(f9);
1316 lb = fAddCombo->GetListBox();
1317 lb->Resize(lb->GetWidth(),19);
1320 fAddCombo->Connect("Selected(Int_t)", "TH1Editor", this, "DoHistChanges()");
1321 if (fAddBar->GetState()==kButtonDown) {
1322 ShowFrame(f10);
1323 ShowFrame(f11);
1324 ShowFrame(f12);
1325 } else {
1326 HideFrame(f10);
1327 HideFrame(f11);
1328 HideFrame(f12);
1329 }
1330 } else {
1331 Bool_t on = fMake;
1332 fMake=kFALSE;
1333 ShowFrame(f7);
1334 ShowFrame(f8);
1335 ShowFrame(f9);
1338 if (fAddBar->GetState() != kButtonDown &&
1341 if (((TGLBContainer*)((TGListBox*)fAddCombo->GetListBox())->GetContainer())->GetPos(kADD_SIMPLE)==-1)
1342 ((TGListBox*)fAddCombo->GetListBox())->AddEntry("Simple Line", kADD_SIMPLE);
1343 if (((TGLBContainer*)((TGListBox*)fAddCombo->GetListBox())->GetContainer())->GetPos(kADD_SMOOTH)==-1)
1344 ((TGListBox*)fAddCombo->GetListBox())->AddEntry("Smooth Line", kADD_SMOOTH);
1345 if (((TGLBContainer*)((TGListBox*)fAddCombo->GetListBox())->GetContainer())->GetPos(kADD_FILL)==-1) {
1346 ((TGListBox*)fAddCombo->GetListBox())->AddEntry("Fill Area",kADD_FILL);
1347 lb = fAddCombo->GetListBox();
1348 lb->Resize(lb->GetWidth(),76);
1349 }
1350 fMake=on;
1351 }
1354 } else {
1357 else if (fAddSimple->GetState()==kButtonDisabled)
1359 }
1360 } else if (fDim0->GetState()==kButtonDown) {
1361 if (GetHistTypeLabel().Contains("LEGO")) {
1362 ShowFrame(f10);
1363 ShowFrame(f11);
1364 HideFrame(f12);
1365 } else {
1366 HideFrame(f10);
1367 HideFrame(f11);
1368 HideFrame(f12);
1369 }
1370 }
1371 if (fMake) {
1372 TString str = "";
1373 if (fDim->GetState()==kButtonDown)
1375 else if (fDim0->GetState()==kButtonDown)
1378 str += "HIST";
1379 if (fSameOpt)
1380 str += "SAME";
1381 SetDrawOption(str);
1382 if (str=="" || str=="HIST") fAddSimple->SetState(kButtonDisabled);
1383 Update();
1384 }
1386 // fGedEditor->GetTab()->Layout();
1387 fMakeB=kTRUE;
1388}
1389
1390////////////////////////////////////////////////////////////////////////////////
1391/// Slot connected to the Bar Width of the Bar Charts.
1392
1394{
1395 if (fAvoidSignal) return;
1397 Update();
1398}
1399
1400////////////////////////////////////////////////////////////////////////////////
1401/// Slot connected to the Bar Offset of the Bar Charts.
1402
1404{
1405 if (fAvoidSignal) return;
1408 Update();
1409}
1410
1411////////////////////////////////////////////////////////////////////////////////
1412/// Slot connected to the bar percentage settings.
1413
1415{
1416 if (fAvoidSignal) return;
1417 TString str = GetDrawOption();
1418 str.ToUpper();
1419 if (str.Contains("SAME"))
1420 fSameOpt = kTRUE;
1421 else
1422 fSameOpt = kFALSE;
1423 Int_t o = 0;
1424 if (str.Contains("HBAR")) o=1;
1425 if (str.Contains("BAR4"))
1426 str.Remove(strstr(str.Data(),"BAR4")-str.Data()-1,4+o);
1427 else if (str.Contains("BAR3"))
1428 str.Remove(strstr(str.Data(),"BAR3")-str.Data()-o,4+o);
1429 else if (str.Contains("BAR2"))
1430 str.Remove(strstr(str.Data(),"BAR2")-str.Data()-o,4+o);
1431 else if (str.Contains("BAR1"))
1432 str.Remove(strstr(str.Data(),"BAR1")-str.Data()-o,4+o);
1433 else if (str.Contains("BAR0"))
1434 str.Remove(strstr(str.Data(),"BAR0")-str.Data()-o,4+o);
1435 else if (str.Contains("BAR"))
1436 str.Remove(strstr(str.Data(),"BAR")-str.Data()-o,3+o);
1437
1438 if (fMakeHBar->GetState()==kButtonDown) str+="H";
1439 switch (fPercentCombo->GetSelected()){
1440 case (kPER_0) :{ str += "BAR"; break;}
1441 case (kPER_10):{ str += "BAR1"; break;}
1442 case (kPER_20):{ str += "BAR2"; break;}
1443 case (kPER_30):{ str += "BAR3"; break;}
1444 case (kPER_40):{ str += "BAR4"; break;}
1445 }
1446 if (fSameOpt) str += "SAME";
1447 if (fMake) SetDrawOption(str);
1448 Update();
1449}
1450
1451////////////////////////////////////////////////////////////////////////////////
1452/// Slot connected to the Horizontal Bar check button.
1453
1455{
1456 if (fAvoidSignal) return;
1457 TString str = GetDrawOption();
1458 str.ToUpper();
1459 if (str.Contains("SAME"))
1460 fSameOpt = kTRUE;
1461 else
1462 fSameOpt = kFALSE;
1463 if (on) {
1464 if (!str.Contains("HBAR"))
1465 str.Insert(strstr(str.Data(),"BAR")-str.Data(),"H");
1466 }
1467 else if (fMakeHBar->GetState()==kButtonUp) {
1468 if (str.Contains("HBAR"))
1469 str.Remove(strstr(str.Data(),"BAR")-str.Data()-1,1);
1470 }
1471 if (fSameOpt) str += "SAME";
1472 if (fMake) SetDrawOption(str);
1473 Update();
1474}
1475
1476////////////////////////////////////////////////////////////////////////////////
1477/// Slot connected to the x-Slider for redrawing of the histogram
1478/// according to the new Slider range.
1479
1481{
1482 if (fAvoidSignal) return;
1483 if (fGedEditor->GetPad()->GetCanvas())
1484 fGedEditor->GetPad()->GetCanvas()->FeedbackMode(kTRUE);
1485 fGedEditor->GetPad()->cd();
1487 static Int_t px1,py1,px2,py2;
1488 static Float_t ymin,ymax,xleft,xright;
1491 ymin = fGedEditor->GetPad()->GetUymin();
1492 ymax = fGedEditor->GetPad()->GetUymax();
1493 px1 = fGedEditor->GetPad()->XtoAbsPixel(xleft);
1494 py1 = fGedEditor->GetPad()->YtoAbsPixel(ymin);
1495 px2 = fGedEditor->GetPad()->XtoAbsPixel(xright);
1496 py2 = fGedEditor->GetPad()->YtoAbsPixel(ymax);
1497 if (fGedEditor->GetPad()->GetCanvas())
1498 fGedEditor->GetPad()->GetCanvas()->FeedbackMode(kTRUE);
1499 fGedEditor->GetPad()->SetLineWidth(1);
1500 fGedEditor->GetPad()->SetLineColor(2);
1501 fGedEditor->GetPad()->SetLineWidth(1);
1502 fGedEditor->GetPad()->SetLineColor(2);
1503 fGedEditor->GetPad()->cd();
1505 gVirtualX->DrawBox(px1, py1, px2, py2, TVirtualX::kHollow);
1506 fPx1old = px1;
1507 fPy1old = py1;
1508 fPx2old = px2 ;
1509 fPy2old = py2;
1510 gVirtualX->Update(0);
1513 } else if (fDelaydraw->GetState() == kButtonDown &&
1514 fDim0->GetState() == kButtonDown &&
1516 static Float_t p1[3], p2[3], p3[3], p4[3], p5[3], p6[3], p7[3], p8[3];
1517 TView *fView = fGedEditor->GetPad()->GetView();
1518 if (!fView) return;
1519 Double_t *rmin = fView->GetRmin();
1520 if (!rmin) return;
1521 Double_t *rmax = fView->GetRmax();
1522 if (!rmax) return;
1523 p1[0] = p4[0] = p5[0] = p8[0] =
1525 p2[0] = p3[0] = p6[0] = p7[0] =
1527 p1[1] = p2[1] = p3[1] = p4[1] = rmin[1];
1528 p5[1] = p6[1] = p7[1] = p8[1] = rmax[1];
1529 p1[2] = p2[2] = p5[2] = p6[2] = rmin[2];
1530 p3[2] = p4[2] = p7[2] = p8[2] = rmax[2];
1531 fGedEditor->GetPad()->SetLineWidth(1);
1532 fGedEditor->GetPad()->SetLineColor(2);
1535 PaintBox3D(p2, p3, p7, p6);
1536 PaintBox3D(p1, p4, p8, p5);
1537 for (Int_t i = 0; i<3; i++){
1538 fP1old[i] = p1[i];
1539 fP2old[i] = p2[i];
1540 fP3old[i] = p3[i];
1541 fP4old[i] = p4[i];
1542 fP5old[i] = p5[i];
1543 fP6old[i] = p6[i];
1544 fP7old[i] = p7[i];
1545 fP8old[i] = p8[i];
1546 }
1547 fSldMin->SetNumber(p1[0]);
1548 fSldMax->SetNumber(p2[0]);
1549 } else if (fDelaydraw->GetState() == kButtonDown &&
1550 fDim0->GetState() == kButtonDown) {
1553 } else {
1555 (Int_t)((fSlider->GetMaxPosition())+0.5));
1559 Update();
1560 }
1562 if (player && player->GetHistogram() == fHist) {
1563 Int_t last = fHist->GetXaxis()->GetLast();
1564 Int_t first = fHist->GetXaxis()->GetFirst();
1565 fBinNumberEntry1->SetIntNumber(last-first+1);
1566 // How to redraw the NumberEntry without calling Update??
1567 // Update kills the "virtual" painted box in Delayed draw mode
1569 // fGedEditor->GetTab()->Layout();
1570 }
1573}
1574
1575////////////////////////////////////////////////////////////////////////////////
1576/// Slot connected to the x-axis Range slider for initialising the
1577/// values of the slider movement.
1578
1580{
1581 if (fAvoidSignal) return;
1582 if (fGedEditor->GetPad()->GetCanvas())
1583 fGedEditor->GetPad()->GetCanvas()->FeedbackMode(kTRUE);
1584 fGedEditor->GetPad()->cd();
1585 static Float_t ymin,ymax,xleft,xright;
1586 Int_t sldmin = (Int_t)((fSlider->GetMinPosition())+0.5);
1587 Int_t sldmax = (Int_t)((fSlider->GetMaxPosition())+0.5);
1588 if (fDelaydraw->GetState() == kButtonDown &&
1590 if (fGedEditor->GetPad()->GetCanvas())
1591 fGedEditor->GetPad()->GetCanvas()->FeedbackMode(kTRUE);
1592 fGedEditor->GetPad()->SetLineWidth(1);
1593 fGedEditor->GetPad()->SetLineColor(2);
1596 ymin = fGedEditor->GetPad()->GetUymin();
1597 ymax = fGedEditor->GetPad()->GetUymax();
1598 fPx1old = fGedEditor->GetPad()->XtoAbsPixel(xleft);
1599 fPy1old = fGedEditor->GetPad()->YtoAbsPixel(ymin);
1600 fPx2old = fGedEditor->GetPad()->XtoAbsPixel(xright);
1601 fPy2old = fGedEditor->GetPad()->YtoAbsPixel(ymax);
1603 } else if (fDelaydraw->GetState() == kButtonDown &&
1604 fDim0->GetState() == kButtonDown &&
1606 TView *fView = fGedEditor->GetPad()->GetView();
1607 if (!fView) return;
1608 Double_t *rmin = fView->GetRmin();
1609 if (!rmin) return;
1610 Double_t *rmax = fView->GetRmax();
1611 if (!rmax) return;
1612 fP1old[0] = fP4old[0] = fP5old[0] = fP8old[0] =
1614 fP2old[0] = fP3old[0] = fP6old[0] = fP7old[0] =
1616 fP1old[1] = fP2old[1] = fP3old[1] = fP4old[1] = rmin[1];
1617 fP5old[1] = fP6old[1] = fP7old[1] = fP8old[1] = rmax[1];
1618 fP1old[2] = fP2old[2] = fP5old[2] = fP6old[2] = rmin[2];
1619 fP3old[2] = fP4old[2] = fP7old[2] = fP8old[2] = rmax[2];
1620 if (fGedEditor->GetPad()->GetCanvas())
1621 fGedEditor->GetPad()->GetCanvas()->FeedbackMode(kTRUE);
1622 fGedEditor->GetPad()->SetLineWidth(1);
1623 fGedEditor->GetPad()->SetLineColor(2);
1626 }
1627 Update();
1628}
1629
1630////////////////////////////////////////////////////////////////////////////////
1631/// Slot connected to the x-axis Range slider for finalizing the
1632/// values of the slider movement.
1633
1635{
1636 if (fAvoidSignal) return;
1639 (Int_t)((fSlider->GetMaxPosition())+0.5));
1642 Update();
1643 }
1645 if (player) if (player->GetHistogram() == fHist) {
1646 Int_t last = fHist->GetXaxis()->GetLast();
1647 Int_t first = fHist->GetXaxis()->GetFirst();
1648 fBinNumberEntry1->SetIntNumber(last-first+1);
1649 Update();
1650 }
1651}
1652
1653////////////////////////////////////////////////////////////////////////////////
1654/// Slot connected to the number entry fields containing the Max/Min
1655/// value of the x-axis.
1656
1658{
1659 if (fAvoidSignal) return;
1660 Int_t nx = fHist->GetXaxis()->GetNbins();
1664 if ((fSldMin->GetNumber()+width/2) < (lowLimit))
1666 if ((fSldMax->GetNumber()-width/2) > (upLimit))
1668// Set the histogram range and the axis range slider
1670 fSldMax->GetNumber()-width/2);
1674 Update();
1675}
1676
1677////////////////////////////////////////////////////////////////////////////////
1678/// Slot connected to the rebin slider in case of a not ntuple histogram
1679/// Updates some other widgets which are related to the rebin slider.
1680
1682{
1683 // draw the rebinned histogram in case of delay draw mode
1684 if (fAvoidSignal) return;
1686 if (!fBinHist) {
1687 fBinHist = (TH1*)fHist->Clone("BinHist");
1688 // we will manage this histogram
1690 }
1693 Int_t* divx = Dividers(nx);
1694 if (divx[0]==2) fBinSlider->SetPosition(2);
1695 if (divx[0]==2) {
1696 delete [] divx;
1697 return;
1698 }
1699 // delete the histogram which is on the screen
1700 fGedEditor->GetPad()->cd();
1701 fHist->Reset();
1703 fBinHist->GetXaxis()->GetXmax());
1704 fHist->Add(fBinHist);
1706 fHist->Rebin(divx[numx]);
1707 // fModel=fHist;
1708 if (divx[0]!=2) {
1709 TAxis* xaxis = fHist->GetXaxis();
1710 Double_t xBinWidth = xaxis->GetBinWidth(1);
1711 xaxis->SetRangeUser(fSldMin->GetNumber()+xBinWidth/2,
1715 xaxis->FindBin(fSldMax->GetNumber()-xBinWidth/2));
1716 // the x-axis range could be changed a little bit by Rebin algorithm
1717 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1718 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1719 }
1724 Update();
1725 delete [] divx;
1726 }
1727// fGedEditor->GetPad()->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 0);
1728 // fModel = fHist;
1729 Refresh(fHist);
1730}
1731
1732////////////////////////////////////////////////////////////////////////////////
1733/// Slot connected to the rebin slider in case of a not ntuple histogram
1734/// (does the Rebinning of the histogram).
1735
1737{
1738 // create a clone in the background, when the slider is moved for
1739 // the first time
1740 if (fAvoidSignal) return;
1741 if (!fBinHist /*&& fDelaydraw->GetState()!=kButtonDown*/) {
1743 if (divx[0]==2) {
1744 delete [] divx;
1745 return;
1746 }
1747 fBinHist = (TH1*)fHist->Clone("BinHist");
1748 // the TH1Editor class manage this histogram
1750 delete [] divx;
1751 }
1752 // if the slider already has been moved and the clone is saved
1754 Int_t* divx = Dividers(nx);
1755 if (divx[0]==2) {
1757 delete [] divx;
1758 return;
1759 }
1760 Int_t maxx = (Int_t)nx/divx[numx];
1761 if (maxx==1) maxx=2;
1762 if (fDelaydraw->GetState() == kButtonUp) {
1763 fGedEditor->GetPad()->cd();
1764 fHist->Reset();
1766 fBinHist->GetXaxis()->GetXmax());
1767 fHist->Add(fBinHist);
1769 fHist->Rebin(divx[numx]);
1770 //fModel=fHist;
1771 TAxis* xaxis = fHist->GetXaxis();
1772 Double_t xBinWidth = xaxis->GetBinWidth(1);
1773 xaxis->SetRangeUser(fSldMin->GetNumber()+xBinWidth/2,
1775 fSlider->SetRange(1,maxx);
1777 xaxis->FindBin(fSldMax->GetNumber()-xBinWidth/2));
1778 // the axis range could be changed a little bit by the Rebin algorithm
1779 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1780 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1782 Update();
1783 }
1790 delete [] divx;
1791}
1792
1793////////////////////////////////////////////////////////////////////////////////
1794/// Slot connected to the rebin slider in case of a not ntuple histogram.
1795
1797{
1798 if (fAvoidSignal) return;
1800 if (d[0]==2 && !fBinHist) {
1801 new TGMsgBox(fClient->GetDefaultRoot(), this->GetMainFrame(),
1802 "TH1 Editor", "It is not possible to rebin the histogram",
1804 gVirtualX->GrabPointer(fBinSlider->GetId(),0,0,0);
1805 }
1806 delete [] d;
1807 // calling the MessageBox again does NOT work!*/
1808}
1809
1810////////////////////////////////////////////////////////////////////////////////
1811/// Slot connected to the BinNumber Slider in case of a ntuple histogram
1812/// (does the Rebinning of the histogram).
1813
1815{
1816 if (fAvoidSignal) return;
1818 Int_t number = fBinSlider1->GetPosition();
1819 if (number==5) return;
1820 Int_t fact = 0;
1821 Int_t binNumber = 0;
1822 TAxis* xaxis = fHist->GetXaxis();
1823 // "compute" the scaling factor:
1824 if (number > 5) fact = number - 4;
1825 else fact = number - 6;
1827 if (!player) return;
1828 Int_t first = xaxis->GetFirst();
1829 Int_t last = xaxis->GetLast();
1830 Int_t nx = xaxis->GetNbins();
1831 Double_t min = xaxis->GetBinLowEdge(1); // overall min in user coords
1832 Double_t max = xaxis->GetBinUpEdge(nx); // overall max in user coords
1833 Double_t rmin = xaxis->GetBinLowEdge(first); // recent min in user coords
1834 Double_t rmax = xaxis->GetBinUpEdge(last); // recent max in user coords
1835
1836 ((TH1*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
1837 ((TH1*)player->GetHistogram())->Reset();
1838
1839 // get new Number of bins
1840 if (fact > 0) binNumber = fact*nx;
1841 if (fact < 0) binNumber = (Int_t) ((-1)*nx/fact+0.5);
1842 if (binNumber < 1) binNumber = 1;
1843 if (binNumber > 10000) binNumber= 10000;
1844 Double_t newOffset = 1.*fBinOffsetSld->GetPosition()/100*((max-min)/binNumber);
1845 // create new histogram - the main job is done by sel->TakeAction()
1846 ((TH1*)player->GetHistogram())->SetBins(binNumber,
1847 min-oldOffset+newOffset,
1848 max-oldOffset+newOffset);
1849 TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
1850 if (!sel) return;
1851 sel->TakeAction();
1852
1853 // restore and set all the attributes which were changed by TakeAction()
1855 fSlider->SetRange(1,binNumber);
1856 Double_t binWidth = fHist->GetXaxis()->GetBinWidth(1);
1857 fSlider->SetPosition(xaxis->FindBin(rmin), xaxis->FindBin(rmax));
1858 Double_t offset = 1.*fBinOffsetSld->GetPosition()/100*binWidth;
1859 xaxis->SetRange(xaxis->FindBin(rmin+binWidth/2),
1860 xaxis->FindBin(rmax-binWidth/2)); // SetRange in binNumbers!
1861 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1862 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1863 fBinNumberEntry1->SetNumber(xaxis->GetLast() - xaxis->GetFirst() + 1);
1867 xaxis->GetBinWidth(1));
1869 Update();
1870}
1871
1872////////////////////////////////////////////////////////////////////////////////
1873/// Slot connected to the rebin slider in case of an ntuple histogram.
1874/// It updates the BinNumberEntryField during the BinSlider movement.
1875
1877{
1878 if (fAvoidSignal) return;
1879 TAxis* xaxis = fHist->GetXaxis();
1880 Int_t first = xaxis->GetFirst();
1881 Int_t last = xaxis->GetLast();
1882 Int_t number = fBinSlider1->GetPosition();
1883 Int_t n = last -first+1;
1884 Int_t fact = 0;
1885 Int_t binNumber = 0;
1886 if (number >= 5) fact = number - 4;
1887 else fact = number - 6;
1888 if (fact > 0) binNumber = fact*n;
1889 if (fact < 0) binNumber = (Int_t) ((-1)*n/fact+0.5);
1890 if (binNumber < 1) binNumber = 1;
1891 if (binNumber > 10000) binNumber= 10000;
1892 fBinNumberEntry1->SetIntNumber(binNumber);
1893// Update();
1894}
1895
1896////////////////////////////////////////////////////////////////////////////////
1897/// Slot connected to the Bin number entry of the Rebinning tab.
1898
1900{
1901 if (fAvoidSignal) return;
1903 Int_t nx = 0;
1904 if (fBinHist) nx = fBinHist->GetXaxis()->GetNbins();
1905 else nx = fHist->GetXaxis()->GetNbins();
1906 if (nx < 2) return;
1907 Int_t *div = Dividers(nx);
1908 Int_t diff = std::abs(num - div[1]);
1909 Int_t c = 1;
1910 for (Int_t i = 2; i <= div[0]; i++) {
1911 if ((std::abs(num - div[i])) < diff) {
1912 c = i;
1913 diff = std::abs(num - div[i]);
1914 }
1915 }
1917 fBinSlider->SetPosition(div[0] - c +1);
1918 if (fDelaydraw->GetState()==kButtonUp) DoBinMoved(div[0] - c +1);
1919 else DoBinReleased();
1920// fGedEditor->GetPad()->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 0);
1921 // fModel = fHist;
1922 Refresh(fHist);
1923 delete [] div;
1924}
1925
1926////////////////////////////////////////////////////////////////////////////////
1927/// Slot connected to the Bin number entry of the Rebinning tab.
1928
1930{
1931 if (fAvoidSignal) return;
1934 TAxis* xaxis = fHist->GetXaxis();
1936 if (!player) return;
1937 Int_t first = xaxis->GetFirst();
1938 Int_t last = xaxis->GetLast();
1939 Int_t nx = xaxis->GetNbins();
1940 Double_t min = xaxis->GetBinLowEdge(1); // overall min in user coords
1941 Double_t max = xaxis->GetBinUpEdge(nx); // overall max in user coords
1942 Double_t rmin = xaxis->GetBinLowEdge(first); // recent min in user coords
1943 Double_t rmax = xaxis->GetBinUpEdge(last); // recent max in user coords
1944
1945 ((TH1*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
1946 ((TH1*)player->GetHistogram())->Reset();
1947
1948// Calculate the new number of bins in the complete range
1949 Int_t binNumber = (Int_t) ((max-min)/(rmax - rmin)*num + 0.5);
1950 if (binNumber < 1) binNumber = 1;
1951 if (binNumber > 10000) binNumber = 10000;
1952 Double_t offset = 1.*(fBinOffsetSld->GetPosition())/100*(max-min)/binNumber;
1953// create new histogram - the main job is done by sel->TakeAction()
1954 ((TH1*)player->GetHistogram())->SetBins(binNumber,
1955 min-oldOffset+offset,
1956 max-oldOffset+offset);
1957 TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
1958 if (!sel) return;
1959 sel->TakeAction();
1960
1961// Restore and set all the attributes which were changed by TakeAction()
1963 fSlider->SetRange(1,binNumber);
1964 Double_t binWidth = xaxis->GetBinWidth(1);
1965 fSlider->SetPosition(xaxis->FindBin(rmin), xaxis->FindBin(rmax));
1966 offset = 1.*fBinOffsetSld->GetPosition()/100*binWidth;
1967 xaxis->SetRange(xaxis->FindBin(rmin+binWidth/2),
1968 xaxis->FindBin(rmax-binWidth/2)); // SetRange in binNumbers!
1969 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
1970 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
1973 Update();
1974}
1975
1976////////////////////////////////////////////////////////////////////////////////
1977/// Slot connected to the OffSetSlider that saves the OldBinOffset
1978/// (nessesary for delay draw mode).
1979
1985
1986////////////////////////////////////////////////////////////////////////////////
1987/// Slot connected to the OffSetSlider.
1988/// It changes the origin of the histogram inbetween a binwidth and
1989/// rebin the histogram with the new Offset given by the Slider.
1990
1992{
1993 // !!problem: histogram with variable binwidth??
1994 // computes the new histogram in "delay draw" mode
1995
1996 if (fAvoidSignal) return;
1999 TAxis* xaxis = fHist->GetXaxis();
2000 Double_t binWidth = xaxis->GetBinWidth(1);
2001 Double_t offset = 1.*num/100*binWidth;
2003 Int_t nx = xaxis->GetNbins();
2005 if (!player) return;
2006 Int_t first = xaxis->GetFirst();
2007 Int_t last = xaxis->GetLast();
2008 Double_t min = xaxis->GetBinLowEdge(1); // overall min in user coords
2009 Double_t max = xaxis->GetBinUpEdge(nx); // overall max in user coords
2010 Double_t rmin = xaxis->GetBinLowEdge(first); // recent min in user coords
2011 Double_t rmax = xaxis->GetBinUpEdge(last); // recent max in user coords
2012
2013 ((TH1*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2014 ((TH1*)player->GetHistogram())->Reset();
2015
2016 ((TH1*)player->GetHistogram())->SetBins(nx,
2017 min+offset-oldOffset,
2018 max+offset-oldOffset);
2019 TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2020 if (!sel) return;
2021 sel->TakeAction();
2022
2023 // Restore all the attributes which were changed by TakeAction()
2025 xaxis->SetRange(xaxis->FindBin(rmin+offset-oldOffset+binWidth/2),
2026 xaxis->FindBin(rmax+offset-oldOffset-binWidth/2)); // in binNumbers!
2027 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2028 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2030 Update();
2031 }
2032}
2033
2034////////////////////////////////////////////////////////////////////////////////
2035/// Slot connected to the OffSetSlider.
2036/// It changes the origin of the histogram inbetween a binwidth and
2037/// rebin the histogram with the new offset given by the Slider.
2038
2040{
2041 // !!histogram with variable binwidth??
2042 // !!only works for histograms with fixed binwidth
2043
2044 if (fAvoidSignal) return;
2045 TAxis* xaxis = fHist->GetXaxis();
2046 Double_t binWidth = xaxis->GetBinWidth(1);
2047 Double_t offset = 1.*num/100*binWidth;
2048 if (fDelaydraw->GetState()==kButtonUp) {
2050 Int_t nx = xaxis->GetNbins();
2052 if (!player) return;
2053 Int_t first = xaxis->GetFirst();
2054 Int_t last = xaxis->GetLast();
2055 Double_t min = xaxis->GetBinLowEdge(1); // overall min in user coords
2056 Double_t max = xaxis->GetBinUpEdge(nx); // overall max in user coords
2057 Double_t rmin = xaxis->GetBinLowEdge(first); // recent min in user coords
2058 Double_t rmax = xaxis->GetBinUpEdge(last); // recent max in user coords
2059
2060 ((TH1*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2061 ((TH1*)player->GetHistogram())->Reset();
2062
2063 ((TH1*)player->GetHistogram())->SetBins(nx,
2064 min+offset-oldOffset,
2065 max+offset-oldOffset);
2066 TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2067 if (!sel) return;
2068 sel->TakeAction();
2069
2070 // Restore all the attributes which were changed by TakeAction()
2072 xaxis->SetRange(xaxis->FindBin(rmin+offset-oldOffset+binWidth/2),
2073 xaxis->FindBin(rmax+offset-oldOffset-binWidth/2)); // in binNumbers!
2074 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2075 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2077 }
2080 Update();
2081}
2082
2083////////////////////////////////////////////////////////////////////////////////
2084/// Slot connected to the OffSetNumberEntry which is related to the
2085/// OffSetSlider changes the origin of the histogram inbetween a binwidth.
2086
2088{
2089 if (fAvoidSignal) return;
2090 TAxis* xaxis = fHist->GetXaxis();
2091 Double_t binWidth = xaxis->GetBinWidth(1);
2093 Double_t oldOffset = 1.*fBinOffsetSld->GetPosition()/100*binWidth;
2094 Int_t nx = xaxis->GetNbins();
2096 if (!player) return;
2097 Int_t first = xaxis->GetFirst();
2098 Int_t last = xaxis->GetLast();
2099 Double_t min = xaxis->GetBinLowEdge(1); // overall min in user coords
2100 Double_t max = xaxis->GetBinUpEdge(nx); // overall max in user coords
2101 Double_t rmin = xaxis->GetBinLowEdge(first); // recent min in user coords
2102 Double_t rmax = xaxis->GetBinUpEdge(last); // recent max in user coords
2103
2104 ((TH1*)player->GetHistogram())->SetCanExtend(TH1::kNoAxis);
2105 ((TH1*)player->GetHistogram())->Reset();
2106
2107 ((TH1*)player->GetHistogram())->SetBins(nx,
2108 min+offset-oldOffset,
2109 max+offset-oldOffset);
2110 TSelectorDraw *sel = (TSelectorDraw*)player->GetSelector();
2111 if (!sel) return;
2112 sel->TakeAction();
2113
2114 // Restore all the attributes which were changed by TakeAction()
2116 xaxis->SetRange(xaxis->FindBin(rmin+offset-oldOffset+binWidth/2),
2117 xaxis->FindBin(rmax+offset-oldOffset-binWidth/2)); // in binNumbers!
2118 fSldMin->SetNumber(xaxis->GetBinLowEdge(xaxis->GetFirst()));
2119 fSldMax->SetNumber(xaxis->GetBinUpEdge(xaxis->GetLast()));
2120 fBinOffsetSld->SetPosition((Int_t)(offset/binWidth*100));
2121 Update();
2122}
2123
2124////////////////////////////////////////////////////////////////////////////////
2125/// Slot connected to the Apply button of the Binning tab.
2126
2128{
2129 Int_t ret = 0;
2130 new TGMsgBox(fClient->GetDefaultRoot(), this->GetMainFrame(),
2131 "TH1 Editor", "Replace origin histogram with rebinned one?",
2133 if (ret==1) {
2134 if (fBinHist) {
2135 delete fBinHist;
2136 fBinHist = 0;
2137 }
2138 Int_t nx = fHist->GetXaxis()->GetNbins();
2139 Int_t *div = Dividers(nx);
2140 Int_t up = 0;
2141 if (div[0]-1 <= 1) up = 2;
2142 else up = div[0]-1;
2144 if (fBinSlider->GetMaxPosition()==2 && div[0]==2 )
2146 else
2150 Update();
2151 delete [] div;
2152 } else if (ret==2) DoCancel();
2153}
2154
2155////////////////////////////////////////////////////////////////////////////////
2156/// Slot connected to the Cancel button of the Binning tab.
2157
2159{
2160 if (fBinHist) {
2161 fGedEditor->GetPad()->cd();
2162 fHist->Reset();
2165 fBinHist->GetXaxis()->GetXmax());
2166 fHist->Add(fBinHist);
2168 fBinHist->GetXaxis()->GetLast());
2169 delete fBinHist;
2170 fBinHist = 0;
2174 if (divx[0]!=2) fBinSlider->SetPosition(1);
2175 // Consigning the new Histogram to all other Editors
2176// fGedEditor->GetPad()->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 0);
2177 Update();
2178 //fModel = fHist;
2179 Refresh(fHist);
2180 delete [] divx;
2181 }
2182}
2183
2184////////////////////////////////////////////////////////////////////////////////
2185/// Returns the selected histogram type (HIST, LEGO1-2, SURF1-5).
2186
2188{
2189 TString s="";
2190 switch (fTypeCombo->GetSelected()){
2191 case (-1) : {s = "LEGO"; break;}
2192 case (kTYPE_LEGO ): {s = "LEGO"; break;}
2193 case (kTYPE_LEGO1): {s = "LEGO1"; break;}
2194 case (kTYPE_LEGO2): {s = "LEGO2"; break;}
2195 case (kTYPE_SURF ): {s = "SURF"; break;}
2196 case (kTYPE_SURF1): {s = "SURF1"; break;}
2197 case (kTYPE_SURF2): {s = "SURF2"; break;}
2198 case (kTYPE_SURF3): {s = "SURF3"; break;}
2199 case (kTYPE_SURF4): {s = "SURF4"; break;}
2200 case (kTYPE_SURF5): {s = "SURF5"; break;}
2201 default: break;
2202 }
2203
2204 return s;
2205}
2206
2207////////////////////////////////////////////////////////////////////////////////
2208/// Return the selected coordinate system of the histogram (POL,CYL,SPH,PSR).
2209
2211{
2212 TString s="";
2213 if (fDim->GetState()!=kButtonDown) {
2214 switch (fCoordsCombo->GetSelected()){
2215 case (-1) : {s = "POL"; break;}
2216 case (kCOORDS_CAR): {s = ""; break;}
2217 case (kCOORDS_POL): {s = "POL"; break;}
2218 case (kCOORDS_CYL): {s = "CYL"; break;}
2219 case (kCOORDS_SPH): {s = "SPH"; break;}
2220 case (kCOORDS_PSR): {s = "PSR"; break;}
2221 default: break;
2222 }
2223 }
2224
2225 return s;
2226}
2227
2228////////////////////////////////////////////////////////////////////////////////
2229/// Return the selected error type (E,E1-5).
2230
2232{
2233 TString s="";
2234 switch (fErrorCombo->GetSelected()){
2235 case (-1) : {s = ""; break;}
2236 case (kERRORS_NO) : {s = ""; break;}
2237 case (kERRORS_SIMPLE) : {s = "E"; break;}
2238 case (kERRORS_EDGES) : {s = "E1"; break;}
2239 case (kERRORS_REC) : {s = "E2"; break;}
2240 case (kERRORS_FILL) : {s = "E3"; break;}
2241 case (kERRORS_CONTOUR): {s = "E4"; break;}
2242 default: break;
2243 }
2244
2245 return s;
2246}
2247
2248////////////////////////////////////////////////////////////////////////////////
2249/// Return the selected shape of the histogram (C, L, LF2).
2250
2252{
2253 TString s="";
2254 switch (fAddCombo->GetSelected()){
2255 case (-1) : {s = "" ; break;}
2256 case (kADD_NONE) : {s = "" ; break;}
2257 case (kADD_SMOOTH): {s = "C"; break;}
2258 case (kADD_SIMPLE): {s = "L"; break;}
2259 case (kADD_FILL) : {s = "LF2"; break;}
2260 default : break;
2261 }
2262 if (fAddMarker->GetState()==kButtonDown) s += "P";
2263 if (fAddB->GetState()==kButtonDown) s += "B";
2264 if (fAddBar->GetState()==kButtonDown){
2265 if (fMakeHBar->GetState()==kButtonDown) s+="H";
2266 switch (fPercentCombo->GetSelected()){
2267 case (kPER_0) : { s += "BAR" ; break;}
2268 case (kPER_10): { s += "BAR1"; break;}
2269 case (kPER_20): { s += "BAR2"; break;}
2270 case (kPER_30): { s += "BAR3"; break;}
2271 case (kPER_40): { s += "BAR4"; break;}
2272 }
2273 }
2274
2275 return s;
2276}
2277
2278////////////////////////////////////////////////////////////////////////////////
2279/// Create histogram type combo box.
2280
2282{
2283 TGComboBox *c = new TGComboBox(parent, id);
2284
2285 c->AddEntry("Lego" , kTYPE_LEGO);
2286 c->AddEntry("Lego1", kTYPE_LEGO1);
2287 c->AddEntry("Lego2", kTYPE_LEGO2);
2288 c->AddEntry("Surf" , kTYPE_SURF);
2289 c->AddEntry("Surf1", kTYPE_SURF1);
2290 c->AddEntry("Surf2", kTYPE_SURF2);
2291 c->AddEntry("Surf3", kTYPE_SURF3);
2292 c->AddEntry("Surf4", kTYPE_SURF4);
2293 c->AddEntry("Surf5", kTYPE_SURF5);
2294
2295 return c;
2296}
2297
2298////////////////////////////////////////////////////////////////////////////////
2299/// Create coordinate system type combo box.
2300
2302{
2303 TGComboBox *c = new TGComboBox(parent, id);
2304
2305 c->AddEntry("Cartesian", kCOORDS_CAR);
2306 c->AddEntry("Cylindric", kCOORDS_CYL);
2307 c->AddEntry("Polar", kCOORDS_POL);
2308 c->AddEntry("Rapidity", kCOORDS_PSR);
2309 c->AddEntry("Spheric", kCOORDS_SPH);
2310 TGListBox* lb = c->GetListBox();
2311 lb->Resize(lb->GetWidth(), 83);
2312
2313 return c;
2314}
2315
2316////////////////////////////////////////////////////////////////////////////////
2317/// Create error type combo box.
2318
2320{
2321 TGComboBox *c = new TGComboBox(parent, id);
2322
2323 c->AddEntry("No Errors", kERRORS_NO);
2324 c->AddEntry("Simple", kERRORS_SIMPLE);
2325 c->AddEntry("Edges", kERRORS_EDGES);
2326 c->AddEntry("Rectangles",kERRORS_REC);
2327 c->AddEntry("Fill", kERRORS_FILL);
2328 c->AddEntry("Contour", kERRORS_CONTOUR);
2329
2330 return c;
2331}
2332
2333////////////////////////////////////////////////////////////////////////////////
2334/// Create Line/Bar combo box.
2335
2337{
2338 TGComboBox *c = new TGComboBox(parent, id);
2339
2340 c->AddEntry("No Line", kADD_NONE);
2341 c->AddEntry("Simple Line", kADD_SIMPLE);
2342 c->AddEntry("Smooth Line", kADD_SMOOTH);
2343 c->AddEntry("Fill Area",kADD_FILL);
2344 TGListBox* lb = c->GetListBox();
2345 lb->Resize(lb->GetWidth(), 76);
2346 return c;
2347}
2348
2349////////////////////////////////////////////////////////////////////////////////
2350/// Create Percentage combo box for bar option.
2351
2353{
2354 TGComboBox *c = new TGComboBox(parent, id);
2355
2356 c->AddEntry(" 0 %", kPER_0);
2357 c->AddEntry("10 %", kPER_10);
2358 c->AddEntry("20 %", kPER_20);
2359 c->AddEntry("30 %", kPER_30);
2360 c->AddEntry("40 %", kPER_40);
2361 TGListBox* lb = c->GetListBox();
2362 lb->Resize(lb->GetWidth(), 83);
2363
2364 return c;
2365}
2366
2367////////////////////////////////////////////////////////////////////////////////
2368/// Change the error combo box entry.
2369
2371{
2372 switch (i){
2373 case 0: {
2374 if (((TGLBContainer*)((TGListBox*)fErrorCombo->GetListBox())->GetContainer())->GetPos(kERRORS_EDGES)!=-1)
2379 lb->Resize(lb->GetWidth(),36);
2380 break;
2381 }
2382 case 1: {
2383 if (((TGLBContainer*)((TGListBox*)fErrorCombo->GetListBox())->GetContainer())->GetPos(kERRORS_EDGES)==-1) {
2385 fErrorCombo->AddEntry("Rectangles",kERRORS_REC);
2389 lb->Resize(lb->GetWidth(),100);
2390 }
2391 break;
2392 }
2393 }
2394}
2395
2396 ///////////////////////////////////////////////////////////////////////////////
2397 /// Paint a 3D box.
2398
2400{
2401 if (fGedEditor->GetPad()->GetCanvas())
2402 fGedEditor->GetPad()->GetCanvas()->FeedbackMode(kTRUE);
2403 fGedEditor->GetPad()->SetLineWidth(1);
2404 fGedEditor->GetPad()->SetLineColor(2);
2405 fGedEditor->GetPad()->cd();
2406 fGedEditor->GetPad()->PaintLine3D(p1, p2);
2407 fGedEditor->GetPad()->PaintLine3D(p2, p3);
2408 fGedEditor->GetPad()->PaintLine3D(p3, p4);
2409 fGedEditor->GetPad()->PaintLine3D(p4, p1);
2410}
2411
2412////////////////////////////////////////////////////////////////////////////////
2413/// Return an array of dividers of n (without the trivial divider n).
2414/// The number of dividers is saved in the first entry.
2415
2417{
2418 Int_t* div;
2419 if (n <= 0) {
2420 div = new Int_t[1];
2421 div[0]=0;
2422 } else if (n == 1) {
2423 div = new Int_t[2];
2424 div[0]=div[1]=1;
2425 } else {
2426 div = new Int_t[(Int_t) n/2+2];
2427 div[0]=0;
2428 div[1]=1;
2429
2430 Int_t num = 1;
2431 for (Int_t i=2; i <= n/2; i++) {
2432 if (n % i == 0) {
2433 num++;
2434 div[num] = i;
2435 }
2436 }
2437 num++;
2438 div[num]=n;
2439 div[0] = num;
2440// for (Int_t a=0; a <= div[0]; a++) printf("div[%d] = %d\n", a , div[a]);
2441 }
2442 return div;
2443}
2444
2445////////////////////////////////////////////////////////////////////////////////
2446/// If the contained histogram obj is deleted we must set its pointer to zero
2447
2449{
2450 if (obj == fHist) {
2451 fHist = 0;
2452 }
2453}
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
@ kChildFrame
Definition GuiTypes.h:379
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kFitWidth
Definition GuiTypes.h:386
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kOwnBackground
Definition GuiTypes.h:391
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define d(i)
Definition RSha256.hxx:102
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kMBNo
Definition TGMsgBox.h:32
@ kMBYes
Definition TGMsgBox.h:31
@ kMBOk
Definition TGMsgBox.h:33
@ kMBIconExclamation
Definition TGMsgBox.h:24
@ kMBIconQuestion
Definition TGMsgBox.h:23
@ kScaleBoth
Definition TGSlider.h:36
@ kSlider1
Definition TGSlider.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char text
@ kMARKER_ONOFF
ETH1Wid
@ kTYPE_SURF2
@ kADD_TYPE
@ kTH1_TITLE
@ kPER_40
@ kPER_10
@ kADD_NONE
@ kERROR_TYPE
@ kTYPE_HIST
@ kERRORS_EDGES
@ kTYPE_SURF5
@ kADD_FILL
@ kSLIDER_MIN
@ kCOORDS_PSR
@ kTYPE_SURF
@ kTYPE_LEGO
@ kERRORS_REC
@ kTYPE_SURF3
@ kMARKER_ONOFF
@ kTYPE_LEGO2
@ kBAR_H
@ kBAR_ONOFF
@ kTYPE_SURF1
@ kCOORDS_CAR
@ kERRORS_NO
@ kADD_SMOOTH
@ kDIM_COMPLEX
@ kBINSLIDER1
@ kCOORDS_POL
@ kTYPE_SURF4
@ kPER_30
@ kCOORD_TYPE
@ kBAR_OFFSET
@ kCOORDS_SPH
@ kCOORDS_CYL
@ kB_ONOFF
@ kSLIDER_MAX
@ kDELAYED_DRAWING
@ kADD_SIMPLE
@ kADD_LINE
@ kBINSLIDER
@ kPERCENT_TYPE
@ kADD_BAR
@ kTYPE_LEGO1
@ kERRORS_CONTOUR
@ kHIST_TYPE
@ kDIM_SIMPLE
@ kPER_0
@ kBINOFFSET
@ kERRORS_FILL
@ kERRORS_SIMPLE
@ kBAR_WIDTH
@ kPER_20
void Reset(Option_t *option="") override
float ymin
float ymax
#define gROOT
Definition TROOT.h:411
#define gPad
#define gVirtualX
Definition TVirtualX.h:337
Class to manage histogram axis.
Definition TAxis.h:32
Double_t GetXmax() const
Definition TAxis.h:142
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Definition TAxis.cxx:521
Int_t GetLast() const
Return last bin on the axis i.e.
Definition TAxis.cxx:472
Double_t GetXmin() const
Definition TAxis.h:141
Int_t GetNbins() const
Definition TAxis.h:127
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:1074
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis using bin numbers.
Definition TAxis.cxx:1045
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
Definition TAxis.cxx:545
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Definition TAxis.cxx:531
Int_t GetFirst() const
Return first bin on the axis i.e.
Definition TAxis.cxx:461
virtual void SetLayoutHints(TGLayoutHints *l, TGButton *button=nullptr)
Set layout hints for the specified button or if button=0 for all buttons.
virtual void SetRadioButtonExclusive(Bool_t flag=kTRUE)
If enable is kTRUE, this button group will treat radio buttons as mutually exclusive,...
virtual void Show()
Show group of buttons.
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...
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:439
virtual EButtonState GetState() const
Definition TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:229
Selects different options.
Definition TGButton.h:264
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual Int_t GetSelected() const
Definition TGComboBox.h:114
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Definition TGComboBox.h:105
virtual void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
virtual TGListBox * GetListBox() const
Definition TGComboBox.h:110
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...
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
TGCompositeFrame(const TGCompositeFrame &)=delete
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1196
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1035
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1182
Dragging the slider will generate the event:
virtual Float_t GetMaxPosition() const
virtual Float_t GetMinPosition() const
virtual void SetRange(Float_t min, Float_t max)
virtual void SetPosition(Float_t min, Float_t max)
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
Bool_t Contains(Int_t x, Int_t y) const
Definition TGFrame.h:240
Organizes TGButton widgets in a group with one horizontal row.
Concrete class for horizontal slider.
Definition TGSlider.h:119
void Resize(UInt_t w, UInt_t h) override
Resize the frame.
Definition TGSlider.h:138
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
A Composite frame that contains a list of TGLBEnties.
Definition TGListBox.h:163
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
A listbox is a box, possibly with scrollbar, containing entries.
Definition TGListBox.h:221
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
Set the numeric value (floating point representation).
virtual Double_t GetNumber() const
Get the numeric value (floating point representation).
virtual void SetIntNumber(Long_t val, Bool_t emit=kTRUE)
Set the numeric value (integer representation).
virtual void SetLimits(ELimit limits=kNELNoLimits, Double_t min=0, Double_t max=1)
Set the numerical limits.
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEANonNegative
Non-negative number.
@ kNEAAnyNumber
Attributes of number entry field.
@ kNESInteger
Style of number entry field.
@ kNESRealFour
Fixed fraction real, four digit.
@ kNESRealTwo
Fixed fraction real, two digit.
@ kNELLimitMinMax
Both lower and upper limits.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
Selects different options.
Definition TGButton.h:321
virtual Int_t GetMaxPosition() const
Definition TGSlider.h:79
virtual Int_t GetPosition() const
Definition TGSlider.h:77
virtual void SetPosition(Int_t pos)
Set slider position.
Definition TGSlider.cxx:107
virtual void SetRange(Int_t min, Int_t max)
Set slider range.
Definition TGSlider.cxx:96
virtual void SetScale(Int_t scale)
Definition TGSlider.h:74
virtual void SetEnabled(Int_t tabIndex, Bool_t on=kTRUE)
Enable or disable tab.
Definition TGTab.cxx:467
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
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.
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition TGWindow.cxx:150
TGTab * GetTab() const
Definition TGedEditor.h:73
virtual TVirtualPad * GetPad() const
Definition TGedEditor.h:78
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
TGedEditor * fGedEditor
manager of this frame
Definition TGedFrame.h:48
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:94
void SetDrawOption(Option_t *option="") override
Set drawing option for object.
virtual void Refresh(TObject *model)
Refresh the GUI info about the object attributes.
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:71
Option_t * GetDrawOption() const override
Get draw options of the selected object.
Definition TGedFrame.cxx:79
Bool_t fAvoidSignal
flag for executing slots
Definition TGedFrame.h:50
Float_t fP6old[3]
Definition TH1Editor.h:110
static TGComboBox * BuildHistAddComboBox(TGFrame *parent, Int_t id)
Create Line/Bar combo box.
TGNumberEntryField * fSldMin
Contains the minimum value of the x-Axis.
Definition TH1Editor.h:78
virtual void DoHistChanges()
Slot connected to the histogram type, the coordinate type, the error type and the Add combo box.
virtual void DoBinReleased1()
Slot connected to the BinNumber Slider in case of a ntuple histogram (does the Rebinning of the histo...
TGTextButton * fApply
Apply-Button to accept the rebinned histogram.
Definition TH1Editor.h:81
TGHSlider * fBinOffsetSld
Add an offset to the origin of the histogram.
Definition TH1Editor.h:75
~TH1Editor() override
Destructor of TH1 editor.
TGNumberEntryField * fBinNumberEntry
Label which shows the rebinned bin number.
Definition TH1Editor.h:73
TGCompositeFrame * fBinCont
Contains the Rebin Widgets for case 1.
Definition TH1Editor.h:69
TGCheckButton * fAddSimple
Draw a simple histogram (==HIST draw option)
Definition TH1Editor.h:55
TH1 * fHist
histogram object
Definition TH1Editor.h:36
TGCheckButton * fAddMarker
Draw a Marker on top of each bin.
Definition TH1Editor.h:50
Bool_t fMakeB
Definition TH1Editor.h:96
TString GetHistTypeLabel()
Returns the selected histogram type (HIST, LEGO1-2, SURF1-5).
Int_t fPy1old
Definition TH1Editor.h:98
virtual void DoOffsetMoved(Int_t num)
Slot connected to the OffSetSlider.
void ChangeErrorCombo(Int_t i)
Change the error combo box entry.
TGNumberEntry * fBarWidth
Change the Bar Width.
Definition TH1Editor.h:56
Float_t fP3old[3]
Definition TH1Editor.h:107
TGHSlider * fBinSlider1
Slider to set rebinning integer value for ntuple histogram.
Definition TH1Editor.h:72
TGNumberEntryField * fSldMax
Contains the maximum value of the x-Axis.
Definition TH1Editor.h:79
Float_t fP5old[3]
Definition TH1Editor.h:109
TGDoubleHSlider * fSlider
Slider to set x-axis range.
Definition TH1Editor.h:77
TGCompositeFrame * f11
Contains the Bar Width/Offset NumberEntries.
Definition TH1Editor.h:66
virtual void DoHBar(Bool_t on)
Slot connected to the Horizontal Bar check button.
virtual void DoBinMoved(Int_t number)
Slot connected to the rebin slider in case of a not ntuple histogram (does the Rebinning of the histo...
static TGComboBox * BuildPercentComboBox(TGFrame *parent, Int_t id)
Create Percentage combo box for bar option.
TGHButtonGroup * fDimGroup
Radiobuttongroup to change 2D <-> 3D-Plot.
Definition TH1Editor.h:41
TGCheckButton * fAddB
Draw a Bar Chart.
Definition TH1Editor.h:51
virtual void DoAddMarker(Bool_t on)
Slot connected to the show markers check box.
Int_t fPx1old
Definition TH1Editor.h:97
static TGComboBox * BuildHistErrorComboBox(TGFrame *parent, Int_t id)
Create error type combo box.
Bool_t fMake
Definition TH1Editor.h:95
TH1Editor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor of histogram attribute GUI.
TGComboBox * fErrorCombo
Error combo box.
Definition TH1Editor.h:48
Double_t fOldOffset
Definition TH1Editor.h:114
TGCheckButton * fDelaydraw
Delayed drawing of the new axis range.
Definition TH1Editor.h:80
virtual void DoAxisRange()
Slot connected to the number entry fields containing the Max/Min value of the x-axis.
virtual void DoHistView()
Slot connected to the 'Plot' button group.
TGCheckButton * fMakeHBar
Draw Horizontal Bar Chart.
Definition TH1Editor.h:54
virtual void ConnectSignals2Slots()
Connect signals to slots.
TGCompositeFrame * f6
Contains the Add-ComboBox (Style)
Definition TH1Editor.h:61
TGNumberEntryField * fOffsetNumberEntry
Shows the offset to the origin of the histogram.
Definition TH1Editor.h:76
Float_t fP8old[3]
Definition TH1Editor.h:112
TGCompositeFrame * fBinCont1
Contains the Rebin Widgets for case 2.
Definition TH1Editor.h:70
TGRadioButton * fDim0
3D-Plot RadioButton
Definition TH1Editor.h:43
TGCompositeFrame * f12
Contains fPercentCombo, fMakeHBar.
Definition TH1Editor.h:67
virtual void DoApply()
Slot connected to the Apply button of the Binning tab.
Int_t * Dividers(Int_t n)
Return an array of dividers of n (without the trivial divider n).
TGComboBox * fPercentCombo
Percentage of the Bar which is drawn in a different color.
Definition TH1Editor.h:59
TGTextButton * fCancel
Cancel-Button to reprobate the rebinned histogram.
Definition TH1Editor.h:82
virtual void DoCancel()
Slot connected to the Cancel button of the Binning tab.
TGHSlider * fBinSlider
Slider to set rebinning integer value.
Definition TH1Editor.h:71
Float_t fP1old[3]
Definition TH1Editor.h:105
TGRadioButton * fDim
2D-Plot RadioButton
Definition TH1Editor.h:42
Int_t fTitlePrec
font precision level
Definition TH1Editor.h:39
TGCheckButton * fAddBar
Bar Option.
Definition TH1Editor.h:52
virtual void DoHistComplex()
Slot connected to the 3D radio button.
virtual void DoSliderReleased()
Slot connected to the x-axis Range slider for finalizing the values of the slider movement.
Bool_t fSameOpt
flag for option "same"
Definition TH1Editor.h:37
virtual void DoAddB(Bool_t)
Slot connected to the bar Add check box.
TGCompositeFrame * f3
Contains Histogram Type.
Definition TH1Editor.h:60
virtual void DoHistSimple()
Slot connected to the 2D radio button.
virtual void DoBinReleased()
Slot connected to the rebin slider in case of a not ntuple histogram Updates some other widgets which...
TGComboBox * fTypeCombo
histogram type combo box
Definition TH1Editor.h:46
TGComboBox * fCoordsCombo
Coordinate System combo box.
Definition TH1Editor.h:47
Int_t fPx2old
Definition TH1Editor.h:99
TGTextEntry * fTitle
histogram title input field
Definition TH1Editor.h:40
TString GetHistAddLabel()
Return the selected shape of the histogram (C, L, LF2).
TGLayoutHints * fDim0lh
layout hints for 3D-Plot RadioButton
Definition TH1Editor.h:45
Float_t fP2old[3]
Definition TH1Editor.h:106
virtual void DoBinPressed()
Slot connected to the rebin slider in case of a not ntuple histogram.
virtual void DoAddSimple(Bool_t on)
Slot connected to fAddSimple check box for drawing a simple histogram without errors (== HIST draw op...
virtual void DoPercent()
Slot connected to the bar percentage settings.
TH1 * fBinHist
Definition TH1Editor.h:113
virtual void DoBarOffset()
Slot connected to the Bar Offset of the Bar Charts.
void CreateBinTab()
Create binning tab.
virtual void DoBarWidth()
Slot connected to the Bar Width of the Bar Charts.
void SetModel(TObject *obj) override
Pick up current values of histogram attributes.
virtual void DoAddBar(Bool_t)
Slot connected to the bar Add check box.
TGNumberEntryField * fBinNumberEntry1
Label which shows the rebinned bin number for ntuple histogram.
Definition TH1Editor.h:74
virtual void PaintBox3D(Float_t *p1, Float_t *p2, Float_t *p3, Float_t *p4)
Paint a 3D box.
TString GetHistErrorLabel()
Return the selected error type (E,E1-5).
virtual void DoBinLabel()
Slot connected to the Bin number entry of the Rebinning tab.
TGLayoutHints * fDimlh
layout hints for 2D-Plot RadioButton
Definition TH1Editor.h:44
TGCompositeFrame * f15
Contains outer line CheckBox.
Definition TH1Editor.h:68
static TGComboBox * BuildHistCoordsComboBox(TGFrame *parent, Int_t id)
Create coordinate system type combo box.
TGNumberEntry * fBarOffset
Change the Bar Offset.
Definition TH1Editor.h:57
TGCompositeFrame * f9
Contains the Bar Option CheckBox.
Definition TH1Editor.h:64
virtual void DoOffsetReleased()
Slot connected to the OffSetSlider.
Float_t fP7old[3]
Definition TH1Editor.h:111
Int_t fPy2old
Definition TH1Editor.h:100
static TGComboBox * BuildHistTypeComboBox(TGFrame *parent, Int_t id)
Create histogram type combo box.
TGCompositeFrame * f7
Contains the Marker OnOff CheckBox.
Definition TH1Editor.h:62
TGCompositeFrame * f8
Contains the Bar Chart CheckBox.
Definition TH1Editor.h:63
Bool_t AcceptModel(TObject *model) override
Check if object is able to configure with this editor.
TGCompositeFrame * fBin
Contains the Binning Widgets.
Definition TH1Editor.h:38
virtual void DoBinLabel1()
Slot connected to the Bin number entry of the Rebinning tab.
TGComboBox * fAddCombo
Add Lines, Bars, Fill.
Definition TH1Editor.h:58
TGCompositeFrame * f10
Contains the Bar Option Title.
Definition TH1Editor.h:65
virtual void DoSliderMoved()
Slot connected to the x-Slider for redrawing of the histogram according to the new Slider range.
virtual void DoBinOffset()
Slot connected to the OffSetNumberEntry which is related to the OffSetSlider changes the origin of th...
virtual void DoOffsetPressed()
Slot connected to the OffSetSlider that saves the OldBinOffset (nessesary for delay draw mode).
virtual void DoTitle(const char *text)
Slot connected to the histogram title setting.
TString GetHistCoordsLabel()
Return the selected coordinate system of the histogram (POL,CYL,SPH,PSR).
void RecursiveRemove(TObject *obj) override
If the contained histogram obj is deleted we must set its pointer to zero.
virtual void DoBinMoved1()
Slot connected to the rebin slider in case of an ntuple histogram.
Float_t fP4old[3]
Definition TH1Editor.h:108
virtual void DoSliderPressed()
Slot connected to the x-axis Range slider for initialising the values of the slider movement.
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:109
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:8978
virtual void SetBarOffset(Float_t offset=0.25)
Set the bar offset as fraction of the bin width for drawing mode "B".
Definition TH1.h:613
@ kNoAxis
NOTE: Must always be 0 !!!
Definition TH1.h:122
void SetTitle(const char *title) override
Change/set the title.
Definition TH1.cxx:6766
virtual Float_t GetBarWidth() const
Definition TH1.h:502
virtual Float_t GetBarOffset() const
Definition TH1.h:501
static TClass * Class()
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition TH1.cxx:7151
TAxis * GetXaxis()
Definition TH1.h:572
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:813
virtual Double_t GetEntries() const
Return the current number of entries.
Definition TH1.cxx:4411
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
Rebin this histogram.
Definition TH1.cxx:6323
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:6697
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2734
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
Definition TH1.cxx:8808
virtual void SetBarWidth(Float_t width=0.5)
Set the width of bars as fraction of the bin width for drawing mode "B".
Definition TH1.h:614
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
Mother of all ROOT objects.
Definition TObject.h:41
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:543
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:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
A specialized TSelector for TTree::Draw.
Basic string class.
Definition TString.h:138
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition TTreePlayer.h:37
See TView3D.
Definition TView.h:25
virtual Double_t * GetRmax()=0
virtual Double_t * GetRmin()=0
static TVirtualTreePlayer * GetCurrentPlayer()
Static function: return the current player (if any)
leg AddEntry(h1,"Histogram filled with random numbers","f")
const Int_t n
Definition legend1.C:16