Logo ROOT  
Reference Guide
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 (0),
40 fPalette (0),
41
42 fHistoButtFrame(0),
43 fInfoFrame(0)
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,
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
75 TGTextButton* b = 0;
76 b = new TGTextButton(fHistoButtFrame, "Histo");
77 b->SetToolTipText("Show histogram over full range.");
79 b->Connect("Clicked()", "TEveDigitSetEditor", this, "DoHisto()");
80
81 b = new TGTextButton(fHistoButtFrame, "Range Histo");
82 b->SetToolTipText("Show histogram over selected range.");
84 b->Connect("Clicked()", "TEveDigitSetEditor", this, "DoRangeHisto()");
86}
87
88////////////////////////////////////////////////////////////////////////////////
89/// Set model object.
90
92{
93 fM = dynamic_cast<TEveDigitSet*>(obj);
94
95 if (fM->fValueIsColor || fM->fPalette == 0) {
97 } else {
100 }
101
102 if (fM->fHistoButtons)
104 else
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Show histogram slot.
110
112{
113 Int_t min, max;
114 if (fM->fPalette) {
115 min = fM->fPalette->GetLowLimit();
116 max = fM->fPalette->GetHighLimit();
117 } else {
118 fM->ScanMinMaxValues(min, max);
119 }
120 PlotHisto(min, max);
121}
122
123////////////////////////////////////////////////////////////////////////////////
124/// Show ranged histogram slot.
125
127{
128 Int_t min, max;
129 if (fM->fPalette) {
130 min = fM->fPalette->GetMinVal();
131 max = fM->fPalette->GetMaxVal();
132 } else {
133 fM->ScanMinMaxValues(min, max);
134 }
135 PlotHisto(min, max);
136}
137
138////////////////////////////////////////////////////////////////////////////////
139/// Plots a histogram from digit vales with given range.
140
142{
143 Int_t nbins = max-min+1;
144 while (nbins > 200)
145 nbins /= 2;
146
147 TH1F* h = new TH1F(fM->GetName(), fM->GetTitle(), nbins, min-0.5, max+0.5);
148 h->SetDirectory(0);
149 h->SetBit(kCanDelete);
151 while (qi.next())
152 h->Fill(((TEveDigitSet::DigitBase_t*)qi())->fValue);
153
154 gStyle->SetOptStat(1111111);
155 h->Draw();
156 gPad->Modified();
157 gPad->Update();
158}
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedWidth
Definition: GuiTypes.h:387
@ 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
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
#define ClassImp(name)
Definition: Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kLHintsLeft
Definition: TGLayout.h:24
@ kLHintsTop
Definition: TGLayout.h:27
@ kLHintsExpandX
Definition: TGLayout.h:30
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
#define gPad
Definition: TVirtualPad.h:287
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.
TEveDigitSetEditor(const TEveDigitSetEditor &)
virtual void SetModel(TObject *obj)
Set model object.
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),...
Definition: TEveDigitSet.h:34
void ScanMinMaxValues(Int_t &min, Int_t &max)
Iterate over the digits and determine min and max signal values.
TEveRGBAPalette * fPalette
Definition: TEveDigitSet.h:71
Bool_t fHistoButtons
Definition: TEveDigitSet.h:76
TEveChunkManager fPlex
Definition: TEveDigitSet.h:65
Bool_t fValueIsColor
Definition: TEveDigitSet.h:61
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=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual void MapWindow()
map window
Definition: TGFrame.h:204
virtual void UnmapWindow()
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:386
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'.
Definition: TGedFrame.cxx:122
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:575
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
@ kCanDelete
if object in a list can be deleted
Definition: TObject.h:58
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:1589
Bool_t next()
Go to next atom.