Logo ROOT  
Reference Guide
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// #include <TEveTrack.h>
15
16#include "TEveGValuators.h"
17#include "TEveManager.h"
18
19#include "TVirtualPad.h"
20#include "TColor.h"
21
22#include "TGLabel.h"
23#include "TG3DLine.h"
24#include "TGButton.h"
25#include "TGNumberEntry.h"
26#include "TGColorSelect.h"
27#include "TGComboBox.h"
28#include "TGDoubleSlider.h"
29#include "TAttMarkerEditor.h"
30
31/** \class TEveTrackPropagatorSubEditor
32\ingroup TEve
33Sub-editor for TEveTrackPropagator class.
34*/
35
37
38////////////////////////////////////////////////////////////////////////////////
39/// Constructor.
40
43 fM (0),
44
45 fMaxR(0), fMaxZ(0), fMaxOrbits(0), fMaxAng(0), fDelta(0),
46
47 fRefsCont(0), fPMFrame(0),
48 fFitDaughters(0), fFitReferences(0),
49 fFitDecay(0),
50 fFitCluster2Ds(0), fFitLineSegments(0),
51 fRnrDaughters(0), fRnrReferences(0),
52 fRnrDecay(0), fRnrCluster2Ds(0),
53 fRnrFV(0),
54 fPMAtt(0), fFVAtt(0),
55 fProjTrackBreaking(0), fRnrPTBMarkers(0), fPTBAtt(0)
56{
57 Int_t labelW = 51;
58
59 // --- Limits
60 fMaxR = new TEveGValuator(this, "Max R:", 90, 0);
61 fMaxR->SetLabelWidth(labelW);
63 fMaxR->Build();
65 fMaxR->SetToolTip("Maximum radius to which the tracks will be drawn.");
66 fMaxR->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxR()");
67 AddFrame(fMaxR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
68
69 fMaxZ = new TEveGValuator(this, "Max Z:", 90, 0);
70 fMaxZ->SetLabelWidth(labelW);
72 fMaxZ->Build();
74 fMaxZ->SetToolTip("Maximum z-coordinate to which the tracks will be drawn.");
75 fMaxZ->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxZ()");
76 AddFrame(fMaxZ, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
77
78 fMaxOrbits = new TEveGValuator(this, "Orbits:", 90, 0);
83 fMaxOrbits->SetToolTip("Maximal angular path of tracks' orbits (1 ~ 2Pi).");
84 fMaxOrbits->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxOrbits()");
86
87 fMaxAng = new TEveGValuator(this, "Angle:", 90, 0);
88 fMaxAng->SetLabelWidth(labelW);
90 fMaxAng->Build();
92 fMaxAng->SetToolTip("Maximal angular step between two helix points.");
93 fMaxAng->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxAng()");
94 AddFrame(fMaxAng, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
95
96 fDelta = new TEveGValuator(this, "Delta:", 90, 0);
97 fDelta->SetLabelWidth(labelW);
99 fDelta->Build();
101 fDelta->SetToolTip("Maximal error at the mid-point of the line connecting to helix points.");
102 fDelta->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoDelta()");
103 AddFrame(fDelta, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Create a frame containing track-reference controls under parent frame p.
108
110{
111 fRefsCont = new TGCompositeFrame(p, 80, 20, kVerticalFrame);
113 // Rendering control.
114 {
115 TGGroupFrame* fitPM = new TGGroupFrame(fPMFrame, "PathMarks:", kLHintsTop | kLHintsCenterX);
118
119 TGMatrixLayout *ml = new TGMatrixLayout(fitPM, 0,1,6);
120 fitPM->SetLayoutManager(ml);
121
122 fFitDaughters = new TGCheckButton(fitPM, "Fit Daughters", TEvePathMark::kDaughter);
123 fFitReferences = new TGCheckButton(fitPM, "Fit Refs", TEvePathMark::kReference);
124 fFitDecay = new TGCheckButton(fitPM, "Fit Decay", TEvePathMark::kDecay);
125 fFitCluster2Ds = new TGCheckButton(fitPM, "Fit 2D Clusters", TEvePathMark::kCluster2D);
126 fFitLineSegments = new TGCheckButton(fitPM, "Fit Line Segments", TEvePathMark::kLineSegment);
127
128 fitPM->AddFrame(fFitDaughters);
129 fitPM->AddFrame(fFitReferences);
130 fitPM->AddFrame(fFitDecay);
131 fitPM->AddFrame(fFitCluster2Ds);
133
134 fFitDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
135 fFitReferences ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
136 fFitDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
137 fFitCluster2Ds ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
138 fFitLineSegments->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
139 }
140 // Kinematics fitting.
141 {
142 TGGroupFrame* rnrPM = new TGGroupFrame(fPMFrame, "PathMarks:", kLHintsTop | kLHintsCenterX);
145
146 TGMatrixLayout *ml = new TGMatrixLayout(rnrPM, 0, 1, 6);
147 rnrPM->SetLayoutManager(ml);
148
149 fRnrDaughters = new TGCheckButton(rnrPM, "Rnr Daughters", TEvePathMark::kDaughter);
150 fRnrReferences = new TGCheckButton(rnrPM, "Rnr Refs", TEvePathMark::kReference);
151 fRnrDecay = new TGCheckButton(rnrPM, "Rnr Decay", TEvePathMark::kDecay);
152 fRnrCluster2Ds = new TGCheckButton(rnrPM, "Rnr 2D Clusters", TEvePathMark::kCluster2D);
153
154 rnrPM->AddFrame(fRnrDaughters);
155 rnrPM->AddFrame(fRnrReferences);
156 rnrPM->AddFrame(fRnrDecay);
157 rnrPM->AddFrame(fRnrCluster2Ds);
158
159 fRnrDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
160 fRnrReferences->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
161 fRnrDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
162 fRnrCluster2Ds->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
163
165 }
166 // Marker attributes.
167 {
171 f->DestroyWindow(); delete f;
173 }
174 // First vertex.
175 {
178 vf->AddFrame(new TGLabel(vf, "FirstVertex"),
179 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
180 vf->AddFrame(new TGHorizontal3DLine(vf),
181 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
182 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
183
184 fRnrFV = new TGCheckButton(fRefsCont, "Rnr");
185 fRnrFV->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrFV()");
187 {
191 f->DestroyWindow(); delete f;
193 }
194 }
195 // Break-points of projected tracks
196 {
199 vf->AddFrame(new TGLabel(vf, "BreakPoints"),
200 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
201 vf->AddFrame(new TGHorizontal3DLine(vf),
202 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
203 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
204
205 {
206 UInt_t labelW = 40;
207 UInt_t labelH = 20;
209 // label
210 TGCompositeFrame *labfr = new TGHorizontalFrame(hf, labelW, labelH, kFixedSize);
211 TGLabel* label = new TGLabel(labfr, "Mode:");
212 labfr->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsBottom));
213 hf->AddFrame(labfr, new TGLayoutHints(kLHintsLeft));
214 // combo
219 fProjTrackBreaking->Connect("Selected(Int_t)", "TEveTrackPropagatorSubEditor", this, "DoModePTB(UChar_t)");
220 fProjTrackBreaking->Resize(140, labelH);
222 fRefsCont->AddFrame(hf, new TGLayoutHints(kLHintsTop, 4, 1, 1, 1));
223 }
224
226 fRnrPTBMarkers->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPTB()");
228 {
232 f->DestroyWindow(); delete f;
234 }
235 }
236
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Set model object.
242
244{
245 fM = m;
246
252
253 if(fM->fEditPathMarks)
254 {
260
266
268 }
269 else
270 {
272 }
273
276
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Emit "Changed()" signal.
284
286{
287 Emit("Changed()");
288}
289
290////////////////////////////////////////////////////////////////////////////////
291/// Slot for MaxR.
292
294{
296 Changed();
297}
298
299////////////////////////////////////////////////////////////////////////////////
300/// Slot for MaxZ.
301
303{
305 Changed();
306}
307
308////////////////////////////////////////////////////////////////////////////////
309/// Slot for MaxOrbits.
310
312{
314 Changed();
315}
316
317////////////////////////////////////////////////////////////////////////////////
318/// Slot for MaxAng.
319
321{
323 Changed();
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Slot for Delta.
328
330{
332 Changed();
333}
334
335////////////////////////////////////////////////////////////////////////////////
336/// Slot for FitPM.
337
339{
342 Bool_t on = b->IsOn();
343
344 switch(type)
345 {
347 fM->SetFitDaughters(on);
348 break;
350 fM->SetFitReferences(on);
351 break;
353 fM->SetFitDecay(on);
354 break;
356 fM->SetFitCluster2Ds(on);
357 break;
360 break;
361
362 default:
363 break;
364 }
365 Changed();
366}
367
368////////////////////////////////////////////////////////////////////////////////
369/// Slot for RnrPM.
370
372{
375 Bool_t on = b->IsOn();
376 switch(type){
378 fM->SetRnrDaughters(on);
379 break;
381 fM->SetRnrReferences(on);
382 break;
384 fM->SetRnrDecay(on);
385 break;
387 fM->SetRnrCluster2Ds(on);
388 break;
389 default:
390 break;
391 }
392 Changed();
393}
394
395////////////////////////////////////////////////////////////////////////////////
396/// Slot for RnrFV.
397
399{
400 fM->SetRnrFV(fRnrFV->IsOn());
401 Changed();
402}
403
404////////////////////////////////////////////////////////////////////////////////
405/// Slot for PTBMode.
406
408{
410 Changed();
411}
412
413////////////////////////////////////////////////////////////////////////////////
414/// Slot for RnrPTBMarkers.
415
417{
419 Changed();
420}
421
422/** \class TEveTrackPropagatorEditor
423\ingroup TEve
424GUI editor for TEveTrackPropagator.
425It's only a wrapper around a TEveTrackPropagatorSubEditor that holds actual
426widgets.
427*/
428
430
431////////////////////////////////////////////////////////////////////////////////
432/// Constructor.
433
435 Int_t width, Int_t height,
436 UInt_t options, Pixel_t back) :
437 TGedFrame(p, width, height, options | kVerticalFrame, back),
438 fM(0),
439 fRSSubEditor(0)
440{
441 MakeTitle("RenderStyle");
442
444 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
446
447 TGVerticalFrame* refsFrame = CreateEditorTabSubFrame("Refs");
448 {
450 (refsFrame, 145, 10, kHorizontalFrame | kLHintsExpandX | kFixedWidth | kOwnBackground);
451 cf->AddFrame(new TGLabel(cf, "PathMarks"),
452 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
453 cf->AddFrame(new TGHorizontal3DLine(cf),
454 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
455 refsFrame->AddFrame(cf, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
456 }
457
458 // path marks
462
463 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
464}
465
466////////////////////////////////////////////////////////////////////////////////
467/// Set model object.
468
470{
471 fM = dynamic_cast<TEveTrackPropagator*>(obj);
473}
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedSize
Definition: GuiTypes.h:390
@ kOwnBackground
Definition: GuiTypes.h:391
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
unsigned char UChar_t
Definition: RtypesCore.h:36
const Bool_t kFALSE
Definition: RtypesCore.h:90
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
@ kButtonDown
Definition: TGButton.h:54
@ kButtonUp
Definition: TGButton.h:53
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsCenterX
Definition: TGLayout.h:32
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
int type
Definition: TGX11.cxx:120
R__EXTERN void * gTQSender
Definition: TQObject.h:44
virtual void SetModel(TObject *obj)
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 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.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
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
virtual void SetModel(TObject *obj)
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.
virtual Bool_t IsOn() const
Definition: TGButton.h:119
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:187
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
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...
Definition: TGComboBox.cxx:451
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:984
virtual TList * GetList() const
Definition: TGFrame.h:347
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:1101
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
TGFrame * fFrame
Definition: TGLayout.h:119
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void SetTitlePos(ETitlePos pos=kLeft)
Definition: TGFrame.h:629
TGVerticalFrame(const TGWindow *p=0, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition: TGFrame.h:414
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:86
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
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
Mother of all ROOT objects.
Definition: TObject.h:37
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:866
auto * m
Definition: textangle.C:8