Logo ROOT   6.16/01
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"
16//#include "TEveTransEditor.h"
18#include "TEveGedEditor.h"
19
20#include "TVirtualPad.h"
21#include "TColor.h"
22#include "TH1F.h"
23#include "TStyle.h"
24
25#include "TGLabel.h"
26#include "TG3DLine.h"
27#include "TGButton.h"
28#include "TGNumberEntry.h"
29#include "TGColorSelect.h"
30#include "TGDoubleSlider.h"
31
32/** \class TEveDigitSetEditor
33\ingroup TEve
34Editor for TEveDigitSet class.
35*/
36
38
39////////////////////////////////////////////////////////////////////////////////
40/// Constructor.
41
43 UInt_t options, Pixel_t back) :
44 TGedFrame(p, width, height, options | kVerticalFrame, back),
45 fM (0),
46 fPalette (0),
47
48 fHistoButtFrame(0),
49 fInfoFrame(0)
50{
51 MakeTitle("Palette controls");
52
55 fPalette->Connect("Changed()", "TEveDigitSetEditor", this, "Update()");
56
58}
59
60////////////////////////////////////////////////////////////////////////////////
61/// Create information tab.
62
64{
66
67 TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 180, 10,
72
73 title1->AddFrame(new TGLabel(title1, "TEveDigitSet Info"),
74 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
75 title1->AddFrame(new TGHorizontal3DLine(title1),
76 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
77 fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
78
79
81 TGTextButton* b = 0;
82 b = new TGTextButton(fHistoButtFrame, "Histo");
83 b->SetToolTipText("Show histogram over full range.");
85 b->Connect("Clicked()", "TEveDigitSetEditor", this, "DoHisto()");
86
87 b = new TGTextButton(fHistoButtFrame, "Range Histo");
88 b->SetToolTipText("Show histogram over selected range.");
90 b->Connect("Clicked()", "TEveDigitSetEditor", this, "DoRangeHisto()");
92}
93
94////////////////////////////////////////////////////////////////////////////////
95/// Set model object.
96
98{
99 fM = dynamic_cast<TEveDigitSet*>(obj);
100
101 if (fM->fValueIsColor || fM->fPalette == 0) {
103 } else {
106 }
107
108 if (fM->fHistoButtons)
110 else
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Show histogram slot.
116
118{
119 Int_t min, max;
120 if (fM->fPalette) {
121 min = fM->fPalette->GetLowLimit();
122 max = fM->fPalette->GetHighLimit();
123 } else {
124 fM->ScanMinMaxValues(min, max);
125 }
126 PlotHisto(min, max);
127}
128
129////////////////////////////////////////////////////////////////////////////////
130/// Show ranged histogram slot.
131
133{
134 Int_t min, max;
135 if (fM->fPalette) {
136 min = fM->fPalette->GetMinVal();
137 max = fM->fPalette->GetMaxVal();
138 } else {
139 fM->ScanMinMaxValues(min, max);
140 }
141 PlotHisto(min, max);
142}
143
144////////////////////////////////////////////////////////////////////////////////
145/// Plots a histogram from digit vales with given range.
146
148{
149 Int_t nbins = max-min+1;
150 while (nbins > 200)
151 nbins /= 2;
152
153 TH1F* h = new TH1F(fM->GetName(), fM->GetTitle(), nbins, min-0.5, max+0.5);
154 h->SetDirectory(0);
155 h->SetBit(kCanDelete);
157 while (qi.next())
158 h->Fill(((TEveDigitSet::DigitBase_t*)qi())->fValue);
159
160 gStyle->SetOptStat(1111111);
161 h->Draw();
162 gPad->Modified();
163 gPad->Update();
164}
ULong_t Pixel_t
Definition: GuiTypes.h:39
PyObject * fValue
#define b(i)
Definition: RSha256.hxx:100
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
#define ClassImp(name)
Definition: Rtypes.h:363
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kVerticalFrame
Definition: TGFrame.h:59
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kOwnBackground
Definition: TGFrame.h:69
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
R__EXTERN TStyle * gStyle
Definition: TStyle.h:406
#define gPad
Definition: TVirtualPad.h:286
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
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void MapWindow()
Definition: TGFrame.h:251
virtual void UnmapWindow()
Definition: TGFrame.h:253
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:571
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:867
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:1444
Bool_t next()
Go to next atom.