Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveTrackPropagatorEditor.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
13#include "TEveTrackPropagator.h"
14
15#include "TEveGValuators.h"
16#include "TEveManager.h"
17
18#include "TGLabel.h"
19#include "TG3DLine.h"
20#include "TGButton.h"
21#include "TGComboBox.h"
22#include "TAttMarkerEditor.h"
23
24/** \class TEveTrackPropagatorSubEditor
25\ingroup TEve
26Sub-editor for TEveTrackPropagator class.
27*/
28
30
31////////////////////////////////////////////////////////////////////////////////
32/// Constructor.
33
36 fM (nullptr),
37
38 fMaxR(nullptr), fMaxZ(nullptr), fMaxOrbits(nullptr), fMaxAng(nullptr), fDelta(nullptr),
39
40 fRefsCont(nullptr), fPMFrame(nullptr),
41 fFitDaughters(nullptr), fFitReferences(nullptr),
42 fFitDecay(nullptr),
43 fFitCluster2Ds(nullptr), fFitLineSegments(nullptr),
44 fRnrDaughters(nullptr), fRnrReferences(nullptr),
45 fRnrDecay(nullptr), fRnrCluster2Ds(nullptr),
46 fRnrFV(nullptr),
47 fPMAtt(nullptr), fFVAtt(nullptr),
48 fProjTrackBreaking(nullptr), fRnrPTBMarkers(nullptr), fPTBAtt(nullptr)
49{
50 Int_t labelW = 51;
51
52 // --- Limits
53 fMaxR = new TEveGValuator(this, "Max R:", 90, 0);
54 fMaxR->SetLabelWidth(labelW);
56 fMaxR->Build();
58 fMaxR->SetToolTip("Maximum radius to which the tracks will be drawn.");
59 fMaxR->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxR()");
60 AddFrame(fMaxR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
61
62 fMaxZ = new TEveGValuator(this, "Max Z:", 90, 0);
63 fMaxZ->SetLabelWidth(labelW);
65 fMaxZ->Build();
67 fMaxZ->SetToolTip("Maximum z-coordinate to which the tracks will be drawn.");
68 fMaxZ->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxZ()");
69 AddFrame(fMaxZ, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
70
71 fMaxOrbits = new TEveGValuator(this, "Orbits:", 90, 0);
76 fMaxOrbits->SetToolTip("Maximal angular path of tracks' orbits (1 ~ 2Pi).");
77 fMaxOrbits->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxOrbits()");
79
80 fMaxAng = new TEveGValuator(this, "Angle:", 90, 0);
81 fMaxAng->SetLabelWidth(labelW);
83 fMaxAng->Build();
85 fMaxAng->SetToolTip("Maximal angular step between two helix points.");
86 fMaxAng->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxAng()");
87 AddFrame(fMaxAng, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
88
89 fDelta = new TEveGValuator(this, "Delta:", 90, 0);
90 fDelta->SetLabelWidth(labelW);
92 fDelta->Build();
94 fDelta->SetToolTip("Maximal error at the mid-point of the line connecting to helix points.");
95 fDelta->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoDelta()");
96 AddFrame(fDelta, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Create a frame containing track-reference controls under parent frame p.
101
103{
106 // Rendering control.
107 {
108 TGGroupFrame* fitPM = new TGGroupFrame(fPMFrame, "PathMarks:", kLHintsTop | kLHintsCenterX);
111
112 TGMatrixLayout *ml = new TGMatrixLayout(fitPM, 0,1,6);
113 fitPM->SetLayoutManager(ml);
114
115 fFitDaughters = new TGCheckButton(fitPM, "Fit Daughters", TEvePathMark::kDaughter);
116 fFitReferences = new TGCheckButton(fitPM, "Fit Refs", TEvePathMark::kReference);
117 fFitDecay = new TGCheckButton(fitPM, "Fit Decay", TEvePathMark::kDecay);
118 fFitCluster2Ds = new TGCheckButton(fitPM, "Fit 2D Clusters", TEvePathMark::kCluster2D);
119 fFitLineSegments = new TGCheckButton(fitPM, "Fit Line Segments", TEvePathMark::kLineSegment);
120
121 fitPM->AddFrame(fFitDaughters);
122 fitPM->AddFrame(fFitReferences);
123 fitPM->AddFrame(fFitDecay);
124 fitPM->AddFrame(fFitCluster2Ds);
126
127 fFitDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
128 fFitReferences ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
129 fFitDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
130 fFitCluster2Ds ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
131 fFitLineSegments->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
132 }
133 // Kinematics fitting.
134 {
135 TGGroupFrame* rnrPM = new TGGroupFrame(fPMFrame, "PathMarks:", kLHintsTop | kLHintsCenterX);
138
139 TGMatrixLayout *ml = new TGMatrixLayout(rnrPM, 0, 1, 6);
140 rnrPM->SetLayoutManager(ml);
141
142 fRnrDaughters = new TGCheckButton(rnrPM, "Rnr Daughters", TEvePathMark::kDaughter);
143 fRnrReferences = new TGCheckButton(rnrPM, "Rnr Refs", TEvePathMark::kReference);
144 fRnrDecay = new TGCheckButton(rnrPM, "Rnr Decay", TEvePathMark::kDecay);
145 fRnrCluster2Ds = new TGCheckButton(rnrPM, "Rnr 2D Clusters", TEvePathMark::kCluster2D);
146
147 rnrPM->AddFrame(fRnrDaughters);
148 rnrPM->AddFrame(fRnrReferences);
149 rnrPM->AddFrame(fRnrDecay);
150 rnrPM->AddFrame(fRnrCluster2Ds);
151
152 fRnrDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
153 fRnrReferences->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
154 fRnrDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
155 fRnrCluster2Ds->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
156
158 }
159 // Marker attributes.
160 {
164 f->DestroyWindow(); delete f;
166 }
167 // First vertex.
168 {
171 vf->AddFrame(new TGLabel(vf, "FirstVertex"),
172 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
173 vf->AddFrame(new TGHorizontal3DLine(vf),
174 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
175 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
176
177 fRnrFV = new TGCheckButton(fRefsCont, "Rnr");
178 fRnrFV->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrFV()");
180 {
184 f->DestroyWindow(); delete f;
186 }
187 }
188 // Break-points of projected tracks
189 {
192 vf->AddFrame(new TGLabel(vf, "BreakPoints"),
193 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
194 vf->AddFrame(new TGHorizontal3DLine(vf),
195 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
196 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
197
198 {
199 UInt_t labelW = 40;
200 UInt_t labelH = 20;
202 // label
203 TGCompositeFrame *labfr = new TGHorizontalFrame(hf, labelW, labelH, kFixedSize);
204 TGLabel* label = new TGLabel(labfr, "Mode:");
205 labfr->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsBottom));
206 hf->AddFrame(labfr, new TGLayoutHints(kLHintsLeft));
207 // combo
212 fProjTrackBreaking->Connect("Selected(Int_t)", "TEveTrackPropagatorSubEditor", this, "DoModePTB(UChar_t)");
213 fProjTrackBreaking->Resize(140, labelH);
215 fRefsCont->AddFrame(hf, new TGLayoutHints(kLHintsTop, 4, 1, 1, 1));
216 }
217
219 fRnrPTBMarkers->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPTB()");
221 {
225 f->DestroyWindow(); delete f;
227 }
228 }
229
231}
232
233////////////////////////////////////////////////////////////////////////////////
234/// Set model object.
235
237{
238 fM = m;
239
245
246 if(fM->fEditPathMarks)
247 {
253
259
261 }
262 else
263 {
265 }
266
269
273}
274
275////////////////////////////////////////////////////////////////////////////////
276/// Emit "Changed()" signal.
277
279{
280 Emit("Changed()");
281}
282
283////////////////////////////////////////////////////////////////////////////////
284/// Slot for MaxR.
285
287{
289 Changed();
290}
291
292////////////////////////////////////////////////////////////////////////////////
293/// Slot for MaxZ.
294
296{
298 Changed();
299}
300
301////////////////////////////////////////////////////////////////////////////////
302/// Slot for MaxOrbits.
303
305{
307 Changed();
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Slot for MaxAng.
312
314{
316 Changed();
317}
318
319////////////////////////////////////////////////////////////////////////////////
320/// Slot for Delta.
321
323{
325 Changed();
326}
327
328////////////////////////////////////////////////////////////////////////////////
329/// Slot for FitPM.
330
332{
335 Bool_t on = b->IsOn();
336
337 switch(type)
338 {
341 break;
344 break;
346 fM->SetFitDecay(on);
347 break;
350 break;
353 break;
354
355 default:
356 break;
357 }
358 Changed();
359}
360
361////////////////////////////////////////////////////////////////////////////////
362/// Slot for RnrPM.
363
365{
368 Bool_t on = b->IsOn();
369 switch(type){
372 break;
375 break;
377 fM->SetRnrDecay(on);
378 break;
381 break;
382 default:
383 break;
384 }
385 Changed();
386}
387
388////////////////////////////////////////////////////////////////////////////////
389/// Slot for RnrFV.
390
392{
393 fM->SetRnrFV(fRnrFV->IsOn());
394 Changed();
395}
396
397////////////////////////////////////////////////////////////////////////////////
398/// Slot for PTBMode.
399
401{
403 Changed();
404}
405
406////////////////////////////////////////////////////////////////////////////////
407/// Slot for RnrPTBMarkers.
408
410{
412 Changed();
413}
414
415/** \class TEveTrackPropagatorEditor
416\ingroup TEve
417GUI editor for TEveTrackPropagator.
418It's only a wrapper around a TEveTrackPropagatorSubEditor that holds actual
419widgets.
420*/
421
423
424////////////////////////////////////////////////////////////////////////////////
425/// Constructor.
426
429 UInt_t options, Pixel_t back) :
430 TGedFrame(p, width, height, options | kVerticalFrame, back),
431 fM(nullptr),
432 fRSSubEditor(nullptr)
433{
434 MakeTitle("RenderStyle");
435
437 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
439
440 TGVerticalFrame* refsFrame = CreateEditorTabSubFrame("Refs");
441 {
443 (refsFrame, 145, 10, kHorizontalFrame | kFitWidth | kFixedWidth | kOwnBackground);
444 cf->AddFrame(new TGLabel(cf, "PathMarks"),
445 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
446 cf->AddFrame(new TGHorizontal3DLine(cf),
447 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
448 refsFrame->AddFrame(cf, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
449 }
450
451 // path marks
455
456 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
457}
458
459////////////////////////////////////////////////////////////////////////////////
460/// Set model object.
461
463{
464 fM = dynamic_cast<TEveTrackPropagator*>(obj);
466}
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kFitWidth
Definition GuiTypes.h:386
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedSize
Definition GuiTypes.h:390
@ kOwnBackground
Definition GuiTypes.h:391
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
unsigned char UChar_t
Definition RtypesCore.h:38
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassImp(name)
Definition Rtypes.h:377
R__EXTERN TEveManager * gEve
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char mode
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 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 Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
R__EXTERN void * gTQSender
Definition TQObject.h:46
Implements GUI for editing marker attributes.
void SetModel(TObject *obj) override
Pick up the values of used marker attributes.
void SetLabelWidth(Int_t w)
void SetNELength(Int_t l)
Composite GUI element for single value selection (supports label, number-entry and slider).
void Build(Bool_t connect=kTRUE) override
Create sub-components (label, number entry, slider).
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
Float_t GetValue() const
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
TEveGedEditor * GetEditor() const
Returns main object editor.
GUI editor for TEveTrackPropagator.
TEveTrackPropagatorEditor(const TEveTrackPropagatorEditor &)
TEveTrackPropagatorSubEditor * fRSSubEditor
void SetModel(TObject *obj) override
Set model object.
Sub-editor for TEveTrackPropagator class.
void SetModel(TEveTrackPropagator *m)
Set model object.
void CreateRefsContainer(TGVerticalFrame *p)
Create a frame containing track-reference controls under parent frame p.
void DoModePTB(UChar_t mode)
Slot for PTBMode.
void DoRnrPTB()
Slot for RnrPTBMarkers.
void Changed()
Emit "Changed()" signal.
TEveTrackPropagatorSubEditor(const TEveTrackPropagatorSubEditor &)
Holding structure for a number of track rendering parameters.
Double_t GetMaxAng() const
void SetFitReferences(Bool_t x)
Set track-reference fitting and rebuild tracks.
void SetRnrDecay(Bool_t x)
Set decay rendering and rebuild tracks.
void SetRnrDaughters(Bool_t x)
Set daughter rendering and rebuild tracks.
void SetFitLineSegments(Bool_t x)
Set line segment fitting and rebuild tracks.
Double_t GetDelta() const
void SetDelta(Double_t x)
Set maximum error and rebuild tracks.
void SetMaxR(Double_t x)
Set maximum radius and rebuild tracks.
void SetFitDaughters(Bool_t x)
Set daughter creation point fitting and rebuild tracks.
static Double_t fgEditorMaxZ
void SetRnrFV(Bool_t x)
Set first-vertex rendering and rebuild tracks.
void SetProjTrackBreaking(UChar_t x)
Set projection break-point mode and rebuild tracks.
void SetRnrCluster2Ds(Bool_t x)
Set rendering of 2D-clusters and rebuild tracks.
void SetRnrReferences(Bool_t x)
Set track-reference rendering and rebuild tracks.
static Double_t fgEditorMaxR
void SetMaxAng(Double_t x)
Set maximum step angle and rebuild tracks.
void SetFitCluster2Ds(Bool_t x)
Set 2D-cluster fitting and rebuild tracks.
void SetRnrPTBMarkers(Bool_t x)
Set projection break-point rendering and rebuild tracks.
void SetMaxZ(Double_t x)
Set maximum z and rebuild tracks.
void SetFitDecay(Bool_t x)
Set decay fitting and rebuild tracks.
void SetMaxOrbs(Double_t x)
Set maximum number of orbits and rebuild tracks.
A button abstract base class.
Definition TGButton.h:68
virtual Bool_t IsOn() const
Definition TGButton.h:119
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:235
Selects different options.
Definition TGButton.h:264
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 void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
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:287
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:1000
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1204
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1149
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
TGFrame * fFrame
Definition TGLayout.h:112
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:605
A composite frame with a border and a title.
Definition TGFrame.h:522
virtual void SetTitlePos(ETitlePos pos=kLeft)
Definition TGFrame.h:564
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
This layout managers does not make use of TGLayoutHints.
Definition TGLayout.h:269
@ kNESRealOne
Fixed fraction real, one digit.
@ kNESRealThree
Fixed fraction real, three digit.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
virtual void SetGedEditor(TGedEditor *ed)
Definition TGedFrame.h:80
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
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:657
Mother of all ROOT objects.
Definition TObject.h:41
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
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
TMarker m
Definition textangle.C:8