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
29
30////////////////////////////////////////////////////////////////////////////////
31/// Constructor.
32
35 fM (nullptr),
36
37 fMaxR(nullptr), fMaxZ(nullptr), fMaxOrbits(nullptr), fMaxAng(nullptr), fDelta(nullptr),
38
39 fRefsCont(nullptr), fPMFrame(nullptr),
40 fFitDaughters(nullptr), fFitReferences(nullptr),
41 fFitDecay(nullptr),
42 fFitCluster2Ds(nullptr), fFitLineSegments(nullptr),
43 fRnrDaughters(nullptr), fRnrReferences(nullptr),
44 fRnrDecay(nullptr), fRnrCluster2Ds(nullptr),
45 fRnrFV(nullptr),
46 fPMAtt(nullptr), fFVAtt(nullptr),
47 fProjTrackBreaking(nullptr), fRnrPTBMarkers(nullptr), fPTBAtt(nullptr)
48{
49 Int_t labelW = 51;
50
51 // --- Limits
52 fMaxR = new TEveGValuator(this, "Max R:", 90, 0);
55 fMaxR->Build();
57 fMaxR->SetToolTip("Maximum radius to which the tracks will be drawn.");
58 fMaxR->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxR()");
59 AddFrame(fMaxR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
60
61 fMaxZ = new TEveGValuator(this, "Max Z:", 90, 0);
64 fMaxZ->Build();
66 fMaxZ->SetToolTip("Maximum z-coordinate to which the tracks will be drawn.");
67 fMaxZ->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxZ()");
68 AddFrame(fMaxZ, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
69
70 fMaxOrbits = new TEveGValuator(this, "Orbits:", 90, 0);
75 fMaxOrbits->SetToolTip("Maximal angular path of tracks' orbits (1 ~ 2Pi).");
76 fMaxOrbits->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxOrbits()");
78
79 fMaxAng = new TEveGValuator(this, "Angle:", 90, 0);
82 fMaxAng->Build();
84 fMaxAng->SetToolTip("Maximal angular step between two helix points.");
85 fMaxAng->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxAng()");
86 AddFrame(fMaxAng, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
87
88 fDelta = new TEveGValuator(this, "Delta:", 90, 0);
91 fDelta->Build();
93 fDelta->SetToolTip("Maximal error at the mid-point of the line connecting to helix points.");
94 fDelta->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoDelta()");
95 AddFrame(fDelta, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Create a frame containing track-reference controls under parent frame p.
100
102{
105 // Rendering control.
106 {
108 fitPM->SetTitlePos(TGGroupFrame::kLeft);
110
111 TGMatrixLayout *ml = new TGMatrixLayout(fitPM, 0,1,6);
112 fitPM->SetLayoutManager(ml);
113
114 fFitDaughters = new TGCheckButton(fitPM, "Fit Daughters", TEvePathMark::kDaughter);
115 fFitReferences = new TGCheckButton(fitPM, "Fit Refs", TEvePathMark::kReference);
116 fFitDecay = new TGCheckButton(fitPM, "Fit Decay", TEvePathMark::kDecay);
117 fFitCluster2Ds = new TGCheckButton(fitPM, "Fit 2D Clusters", TEvePathMark::kCluster2D);
118 fFitLineSegments = new TGCheckButton(fitPM, "Fit Line Segments", TEvePathMark::kLineSegment);
119
120 fitPM->AddFrame(fFitDaughters);
121 fitPM->AddFrame(fFitReferences);
122 fitPM->AddFrame(fFitDecay);
123 fitPM->AddFrame(fFitCluster2Ds);
124 fitPM->AddFrame(fFitLineSegments);
125
126 fFitDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
127 fFitReferences ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
128 fFitDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
129 fFitCluster2Ds ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
130 fFitLineSegments->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
131 }
132 // Kinematics fitting.
133 {
135 rnrPM->SetTitlePos(TGGroupFrame::kLeft);
137
138 TGMatrixLayout *ml = new TGMatrixLayout(rnrPM, 0, 1, 6);
139 rnrPM->SetLayoutManager(ml);
140
141 fRnrDaughters = new TGCheckButton(rnrPM, "Rnr Daughters", TEvePathMark::kDaughter);
142 fRnrReferences = new TGCheckButton(rnrPM, "Rnr Refs", TEvePathMark::kReference);
143 fRnrDecay = new TGCheckButton(rnrPM, "Rnr Decay", TEvePathMark::kDecay);
144 fRnrCluster2Ds = new TGCheckButton(rnrPM, "Rnr 2D Clusters", TEvePathMark::kCluster2D);
145
146 rnrPM->AddFrame(fRnrDaughters);
147 rnrPM->AddFrame(fRnrReferences);
148 rnrPM->AddFrame(fRnrDecay);
149 rnrPM->AddFrame(fRnrCluster2Ds);
150
151 fRnrDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
152 fRnrReferences->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
153 fRnrDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
154 fRnrCluster2Ds->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
155
157 }
158 // Marker attributes.
159 {
162 TGFrame *f = el->fFrame; fPMAtt->RemoveFrame(f);
163 f->DestroyWindow(); delete f;
165 }
166 // First vertex.
167 {
170 vf->AddFrame(new TGLabel(vf, "FirstVertex"),
171 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
172 vf->AddFrame(new TGHorizontal3DLine(vf),
173 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
174 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
175
176 fRnrFV = new TGCheckButton(fRefsCont, "Rnr");
177 fRnrFV->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrFV()");
179 {
182 TGFrame *f = el->fFrame; fFVAtt->RemoveFrame(f);
183 f->DestroyWindow(); delete f;
185 }
186 }
187 // Break-points of projected tracks
188 {
191 vf->AddFrame(new TGLabel(vf, "BreakPoints"),
192 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
193 vf->AddFrame(new TGHorizontal3DLine(vf),
194 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
195 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
196
197 {
198 UInt_t labelW = 40;
199 UInt_t labelH = 20;
201 // label
203 TGLabel* label = new TGLabel(labfr, "Mode:");
204 labfr->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsBottom));
205 hf->AddFrame(labfr, new TGLayoutHints(kLHintsLeft));
206 // combo
211 fProjTrackBreaking->Connect("Selected(Int_t)", "TEveTrackPropagatorSubEditor", this, "DoModePTB(UChar_t)");
213 hf->AddFrame(fProjTrackBreaking, new TGLayoutHints(kLHintsLeft, 0,0,2,0));
214 fRefsCont->AddFrame(hf, new TGLayoutHints(kLHintsTop, 4, 1, 1, 1));
215 }
216
218 fRnrPTBMarkers->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPTB()");
220 {
223 TGFrame *f = el->fFrame; fPTBAtt->RemoveFrame(f);
224 f->DestroyWindow(); delete f;
226 }
227 }
228
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Set model object.
234
273
274////////////////////////////////////////////////////////////////////////////////
275/// Emit "Changed()" signal.
276
278{
279 Emit("Changed()");
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Slot for MaxR.
284
290
291////////////////////////////////////////////////////////////////////////////////
292/// Slot for MaxZ.
293
299
300////////////////////////////////////////////////////////////////////////////////
301/// Slot for MaxOrbits.
302
308
309////////////////////////////////////////////////////////////////////////////////
310/// Slot for MaxAng.
311
317
318////////////////////////////////////////////////////////////////////////////////
319/// Slot for Delta.
320
326
327////////////////////////////////////////////////////////////////////////////////
328/// Slot for FitPM.
329
331{
333 TEvePathMark::EType_e type = TEvePathMark::EType_e(b->WidgetId());
334 Bool_t on = b->IsOn();
335
336 switch(type)
337 {
338 case TEvePathMark::kDaughter:
340 break;
341 case TEvePathMark::kReference:
343 break;
344 case TEvePathMark::kDecay:
345 fM->SetFitDecay(on);
346 break;
347 case TEvePathMark::kCluster2D:
349 break;
350 case TEvePathMark::kLineSegment:
352 break;
353
354 default:
355 break;
356 }
357 Changed();
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// Slot for RnrPM.
362
364{
366 TEvePathMark::EType_e type = TEvePathMark::EType_e(b->WidgetId());
367 Bool_t on = b->IsOn();
368 switch(type){
369 case TEvePathMark::kDaughter:
371 break;
372 case TEvePathMark::kReference:
374 break;
375 case TEvePathMark::kDecay:
376 fM->SetRnrDecay(on);
377 break;
378 case TEvePathMark::kCluster2D:
380 break;
381 default:
382 break;
383 }
384 Changed();
385}
386
387////////////////////////////////////////////////////////////////////////////////
388/// Slot for RnrFV.
389
395
396////////////////////////////////////////////////////////////////////////////////
397/// Slot for PTBMode.
398
404
405////////////////////////////////////////////////////////////////////////////////
406/// Slot for RnrPTBMarkers.
407
413
414/** \class TEveTrackPropagatorEditor
415\ingroup TEve
416GUI editor for TEveTrackPropagator.
417It's only a wrapper around a TEveTrackPropagatorSubEditor that holds actual
418widgets.
419*/
420
421
422////////////////////////////////////////////////////////////////////////////////
423/// Constructor.
424
427 UInt_t options, Pixel_t back) :
428 TGedFrame(p, width, height, options | kVerticalFrame, back),
429 fM(nullptr),
430 fRSSubEditor(nullptr)
431{
432 MakeTitle("RenderStyle");
433
435 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
437
439 {
442 cf->AddFrame(new TGLabel(cf, "PathMarks"),
443 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
444 cf->AddFrame(new TGHorizontal3DLine(cf),
445 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
446 refsFrame->AddFrame(cf, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
447 }
448
449 // path marks
453
454 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// Set model object.
459
461{
462 fM = dynamic_cast<TEveTrackPropagator*>(obj);
464}
@ 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
Unsigned Character 1 byte (unsigned char)
Definition RtypesCore.h:52
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
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.
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:229
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:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1196
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1141
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1182
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
A composite frame with a border and a title.
Definition TGFrame.h:524
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:387
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:376
TGVerticalFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition TGFrame.h:378
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:94
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:865
TMarker m
Definition textangle.C:8