Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveDigitSetEditor.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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#include "TEveDigitSetEditor.h"
13#include "TEveDigitSet.h"
14
15#include "TEveGValuators.h"
17#include "TEveGedEditor.h"
18
19#include "TVirtualPad.h"
20#include "TH1F.h"
21#include "TStyle.h"
22
23#include "TGLabel.h"
24#include "TG3DLine.h"
25
26/** \class TEveDigitSetEditor
27\ingroup TEve
28Editor for TEveDigitSet class.
29*/
30
32
33////////////////////////////////////////////////////////////////////////////////
34/// Constructor.
35
37 UInt_t options, Pixel_t back) :
38 TGedFrame(p, width, height, options | kVerticalFrame, back),
39 fM (nullptr),
40 fPalette (nullptr),
41
42 fHistoButtFrame(nullptr),
43 fInfoFrame(nullptr)
44{
45 MakeTitle("Palette controls");
46
49 fPalette->Connect("Changed()", "TEveDigitSetEditor", this, "Update()");
50
52}
53
54////////////////////////////////////////////////////////////////////////////////
55/// Create information tab.
56
58{
60
61 TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 180, 10,
63 kFitWidth |
66
67 title1->AddFrame(new TGLabel(title1, "TEveDigitSet Info"),
68 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
69 title1->AddFrame(new TGHorizontal3DLine(title1),
70 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
71 fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
72
73
76 b->SetToolTipText("Show histogram over full range.");
78 b->Connect("Clicked()", "TEveDigitSetEditor", this, "DoHisto()");
79
80 b = new TGTextButton(fHistoButtFrame, "Range Histo");
81 b->SetToolTipText("Show histogram over selected range.");
83 b->Connect("Clicked()", "TEveDigitSetEditor", this, "DoRangeHisto()");
85}
86
87////////////////////////////////////////////////////////////////////////////////
88/// Set model object.
89
91{
92 fM = dynamic_cast<TEveDigitSet*>(obj);
93
94 if (fM->fValueIsColor || fM->fPalette == nullptr) {
96 } else {
99 }
100
101 if (fM->fHistoButtons)
103 else
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Show histogram slot.
109
111{
112 Int_t min, max;
113 if (fM->fPalette) {
114 min = fM->fPalette->GetLowLimit();
115 max = fM->fPalette->GetHighLimit();
116 } else {
117 fM->ScanMinMaxValues(min, max);
118 }
119 PlotHisto(min, max);
120}
121
122////////////////////////////////////////////////////////////////////////////////
123/// Show ranged histogram slot.
124
126{
127 Int_t min, max;
128 if (fM->fPalette) {
129 min = fM->fPalette->GetMinVal();
130 max = fM->fPalette->GetMaxVal();
131 } else {
132 fM->ScanMinMaxValues(min, max);
133 }
134 PlotHisto(min, max);
135}
136
137////////////////////////////////////////////////////////////////////////////////
138/// Plots a histogram from digit vales with given range.
139
141{
142 Int_t nbins = max-min+1;
143 while (nbins > 200)
144 nbins /= 2;
145
146 TH1F* h = new TH1F(fM->GetName(), fM->GetTitle(), nbins, min-0.5, max+0.5);
147 h->SetDirectory(nullptr);
148 h->SetBit(kCanDelete);
150 while (qi.next())
151 h->Fill(((TEveDigitSet::DigitBase_t*)qi())->fValue);
152
153 gStyle->SetOptStat(1111111);
154 h->Draw();
155 gPad->Modified();
156 gPad->Update();
157}
@ 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 b(i)
Definition RSha256.hxx:100
#define h(i)
Definition RSha256.hxx:106
#define ClassImp(name)
Definition Rtypes.h:382
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
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
@ kCanDelete
Definition TObject.h:367
R__EXTERN TStyle * gStyle
Definition TStyle.h:436
#define gPad
Editor for TEveDigitSet class.
void PlotHisto(Int_t min, Int_t max)
Plots a histogram from digit vales with given range.
void DoHisto()
Show histogram slot.
void SetModel(TObject *obj) override
Set model object.
TEveDigitSetEditor(const TEveDigitSetEditor &)
TEveRGBAPaletteSubEditor * fPalette
TGHorizontalFrame * fHistoButtFrame
void CreateInfoTab()
Create information tab.
TGVerticalFrame * fInfoFrame
void DoRangeHisto()
Show ranged histogram slot.
Base-class for storage of digit collections; provides transformation matrix (TEveTrans),...
void ScanMinMaxValues(Int_t &min, Int_t &max)
Iterate over the digits and determine min and max signal values.
TEveRGBAPalette * fPalette
Bool_t fHistoButtons
TEveChunkManager fPlex
Bool_t fValueIsColor
Sub-editor for TEveRGBAPalette class.
void SetModel(TEveRGBAPalette *p)
Set model object.
Int_t GetMinVal() const
Int_t GetHighLimit() const
Int_t GetMaxVal() const
Int_t GetLowLimit() const
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void MapWindow() override
map window
Definition TGFrame.h:204
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Yield an action as soon as it is clicked.
Definition TGButton.h:142
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:95
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:623
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
Mother of all ROOT objects.
Definition TObject.h:41
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:869
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Definition TStyle.cxx:1640
Bool_t next()
Go to next atom.