Logo ROOT   6.16/01
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 "TGComboBox.h"
30#include "TAttMarkerEditor.h"
31
32/** \class TEveTrackPropagatorSubEditor
33\ingroup TEve
34Sub-editor for TEveTrackPropagator class.
35*/
36
38
39////////////////////////////////////////////////////////////////////////////////
40/// Constructor.
41
44 fM (0),
45
46 fMaxR(0), fMaxZ(0), fMaxOrbits(0), fMaxAng(0), fDelta(0),
47
48 fRefsCont(0), fPMFrame(0),
49 fFitDaughters(0), fFitReferences(0),
50 fFitDecay(0),
51 fFitCluster2Ds(0), fFitLineSegments(0),
52 fRnrDaughters(0), fRnrReferences(0),
53 fRnrDecay(0), fRnrCluster2Ds(0),
54 fRnrFV(0),
55 fPMAtt(0), fFVAtt(0),
56 fProjTrackBreaking(0), fRnrPTBMarkers(0), fPTBAtt(0)
57{
58 Int_t labelW = 51;
59
60 // --- Limits
61 fMaxR = new TEveGValuator(this, "Max R:", 90, 0);
62 fMaxR->SetLabelWidth(labelW);
64 fMaxR->Build();
66 fMaxR->SetToolTip("Maximum radius to which the tracks will be drawn.");
67 fMaxR->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxR()");
68 AddFrame(fMaxR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
69
70 fMaxZ = new TEveGValuator(this, "Max Z:", 90, 0);
71 fMaxZ->SetLabelWidth(labelW);
73 fMaxZ->Build();
75 fMaxZ->SetToolTip("Maximum z-coordinate to which the tracks will be drawn.");
76 fMaxZ->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxZ()");
77 AddFrame(fMaxZ, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
78
79 fMaxOrbits = new TEveGValuator(this, "Orbits:", 90, 0);
84 fMaxOrbits->SetToolTip("Maximal angular path of tracks' orbits (1 ~ 2Pi).");
85 fMaxOrbits->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxOrbits()");
87
88 fMaxAng = new TEveGValuator(this, "Angle:", 90, 0);
89 fMaxAng->SetLabelWidth(labelW);
91 fMaxAng->Build();
93 fMaxAng->SetToolTip("Maximal angular step between two helix points.");
94 fMaxAng->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoMaxAng()");
95 AddFrame(fMaxAng, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
96
97 fDelta = new TEveGValuator(this, "Delta:", 90, 0);
98 fDelta->SetLabelWidth(labelW);
100 fDelta->Build();
102 fDelta->SetToolTip("Maximal error at the mid-point of the line connecting to helix points.");
103 fDelta->Connect("ValueSet(Double_t)", "TEveTrackPropagatorSubEditor", this, "DoDelta()");
104 AddFrame(fDelta, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Create a frame containing track-reference controls under parent frame p.
109
111{
112 fRefsCont = new TGCompositeFrame(p, 80, 20, kVerticalFrame);
114 // Rendering control.
115 {
116 TGGroupFrame* fitPM = new TGGroupFrame(fPMFrame, "PathMarks:", kLHintsTop | kLHintsCenterX);
119
120 TGMatrixLayout *ml = new TGMatrixLayout(fitPM, 0,1,6);
121 fitPM->SetLayoutManager(ml);
122
123 fFitDaughters = new TGCheckButton(fitPM, "Fit Daughters", TEvePathMark::kDaughter);
124 fFitReferences = new TGCheckButton(fitPM, "Fit Refs", TEvePathMark::kReference);
125 fFitDecay = new TGCheckButton(fitPM, "Fit Decay", TEvePathMark::kDecay);
126 fFitCluster2Ds = new TGCheckButton(fitPM, "Fit 2D Clusters", TEvePathMark::kCluster2D);
127 fFitLineSegments = new TGCheckButton(fitPM, "Fit Line Segments", TEvePathMark::kLineSegment);
128
129 fitPM->AddFrame(fFitDaughters);
130 fitPM->AddFrame(fFitReferences);
131 fitPM->AddFrame(fFitDecay);
132 fitPM->AddFrame(fFitCluster2Ds);
134
135 fFitDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
136 fFitReferences ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
137 fFitDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
138 fFitCluster2Ds ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
139 fFitLineSegments->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoFitPM()");
140 }
141 // Kinematics fitting.
142 {
143 TGGroupFrame* rnrPM = new TGGroupFrame(fPMFrame, "PathMarks:", kLHintsTop | kLHintsCenterX);
146
147 TGMatrixLayout *ml = new TGMatrixLayout(rnrPM, 0, 1, 6);
148 rnrPM->SetLayoutManager(ml);
149
150 fRnrDaughters = new TGCheckButton(rnrPM, "Rnr Daughters", TEvePathMark::kDaughter);
151 fRnrReferences = new TGCheckButton(rnrPM, "Rnr Refs", TEvePathMark::kReference);
152 fRnrDecay = new TGCheckButton(rnrPM, "Rnr Decay", TEvePathMark::kDecay);
153 fRnrCluster2Ds = new TGCheckButton(rnrPM, "Rnr 2D Clusters", TEvePathMark::kCluster2D);
154
155 rnrPM->AddFrame(fRnrDaughters);
156 rnrPM->AddFrame(fRnrReferences);
157 rnrPM->AddFrame(fRnrDecay);
158 rnrPM->AddFrame(fRnrCluster2Ds);
159
160 fRnrDecay ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
161 fRnrReferences->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
162 fRnrDaughters ->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
163 fRnrCluster2Ds->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPM()");
164
166 }
167 // Marker attributes.
168 {
172 f->DestroyWindow(); delete f;
174 }
175 // First vertex.
176 {
179 vf->AddFrame(new TGLabel(vf, "FirstVertex"),
180 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
181 vf->AddFrame(new TGHorizontal3DLine(vf),
182 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
183 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
184
185 fRnrFV = new TGCheckButton(fRefsCont, "Rnr");
186 fRnrFV->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrFV()");
188 {
192 f->DestroyWindow(); delete f;
194 }
195 }
196 // Break-points of projected tracks
197 {
200 vf->AddFrame(new TGLabel(vf, "BreakPoints"),
201 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
202 vf->AddFrame(new TGHorizontal3DLine(vf),
203 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
204 fRefsCont->AddFrame(vf, new TGLayoutHints(kLHintsTop, 0, 0, 4, 0));
205
206 {
207 UInt_t labelW = 40;
208 UInt_t labelH = 20;
210 // label
211 TGCompositeFrame *labfr = new TGHorizontalFrame(hf, labelW, labelH, kFixedSize);
212 TGLabel* label = new TGLabel(labfr, "Mode:");
213 labfr->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsBottom));
214 hf->AddFrame(labfr, new TGLayoutHints(kLHintsLeft));
215 // combo
220 fProjTrackBreaking->Connect("Selected(Int_t)", "TEveTrackPropagatorSubEditor", this, "DoModePTB(UChar_t)");
221 fProjTrackBreaking->Resize(140, labelH);
223 fRefsCont->AddFrame(hf, new TGLayoutHints(kLHintsTop, 4, 1, 1, 1));
224 }
225
227 fRnrPTBMarkers->Connect("Clicked()","TEveTrackPropagatorSubEditor", this, "DoRnrPTB()");
229 {
233 f->DestroyWindow(); delete f;
235 }
236 }
237
239}
240
241////////////////////////////////////////////////////////////////////////////////
242/// Set model object.
243
245{
246 fM = m;
247
253
254 if(fM->fEditPathMarks)
255 {
261
267
269 }
270 else
271 {
273 }
274
277
281}
282
283////////////////////////////////////////////////////////////////////////////////
284/// Emit "Changed()" signal.
285
287{
288 Emit("Changed()");
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// Slot for MaxR.
293
295{
297 Changed();
298}
299
300////////////////////////////////////////////////////////////////////////////////
301/// Slot for MaxZ.
302
304{
306 Changed();
307}
308
309////////////////////////////////////////////////////////////////////////////////
310/// Slot for MaxOrbits.
311
313{
315 Changed();
316}
317
318////////////////////////////////////////////////////////////////////////////////
319/// Slot for MaxAng.
320
322{
324 Changed();
325}
326
327////////////////////////////////////////////////////////////////////////////////
328/// Slot for Delta.
329
331{
333 Changed();
334}
335
336////////////////////////////////////////////////////////////////////////////////
337/// Slot for FitPM.
338
340{
343 Bool_t on = b->IsOn();
344
345 switch(type)
346 {
348 fM->SetFitDaughters(on);
349 break;
351 fM->SetFitReferences(on);
352 break;
354 fM->SetFitDecay(on);
355 break;
357 fM->SetFitCluster2Ds(on);
358 break;
361 break;
362
363 default:
364 break;
365 }
366 Changed();
367}
368
369////////////////////////////////////////////////////////////////////////////////
370/// Slot for RnrPM.
371
373{
376 Bool_t on = b->IsOn();
377 switch(type){
379 fM->SetRnrDaughters(on);
380 break;
382 fM->SetRnrReferences(on);
383 break;
385 fM->SetRnrDecay(on);
386 break;
388 fM->SetRnrCluster2Ds(on);
389 break;
390 default:
391 break;
392 }
393 Changed();
394}
395
396////////////////////////////////////////////////////////////////////////////////
397/// Slot for RnrFV.
398
400{
401 fM->SetRnrFV(fRnrFV->IsOn());
402 Changed();
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Slot for PTBMode.
407
409{
411 Changed();
412}
413
414////////////////////////////////////////////////////////////////////////////////
415/// Slot for RnrPTBMarkers.
416
418{
420 Changed();
421}
422
423/** \class TEveTrackPropagatorEditor
424\ingroup TEve
425GUI editor for TEveTrackPropagator.
426It's only a wrapper around a TEveTrackPropagatorSubEditor that holds actual
427widgets.
428*/
429
431
432////////////////////////////////////////////////////////////////////////////////
433/// Constructor.
434
436 Int_t width, Int_t height,
437 UInt_t options, Pixel_t back) :
438 TGedFrame(p, width, height, options | kVerticalFrame, back),
439 fM(0),
440 fRSSubEditor(0)
441{
442 MakeTitle("RenderStyle");
443
445 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
447
448 TGVerticalFrame* refsFrame = CreateEditorTabSubFrame("Refs");
449 {
451 (refsFrame, 145, 10, kHorizontalFrame | kLHintsExpandX | kFixedWidth | kOwnBackground);
452 cf->AddFrame(new TGLabel(cf, "PathMarks"),
453 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
454 cf->AddFrame(new TGHorizontal3DLine(cf),
455 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
456 refsFrame->AddFrame(cf, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
457 }
458
459 // path marks
463
464 fRSSubEditor->Connect("Changed()", "TEveTrackPropagatorEditor", this, "Update()");
465}
466
467////////////////////////////////////////////////////////////////////////////////
468/// Set model object.
469
471{
472 fM = dynamic_cast<TEveTrackPropagator*>(obj);
474}
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
unsigned char UChar_t
Definition: RtypesCore.h:34
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
#define ClassImp(name)
Definition: Rtypes.h:363
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
@ kVerticalFrame
Definition: TGFrame.h:59
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kFixedSize
Definition: TGFrame.h:68
@ kOwnBackground
Definition: TGFrame.h:69
@ 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:45
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:185
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:443
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:982
virtual TList * GetList() const
Definition: TGFrame.h:369
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 ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1131
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
TGFrame * fFrame
Definition: TGLayout.h:119
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual void SetTitlePos(ETitlePos pos=kLeft)
Definition: TGFrame.h:651
TGVerticalFrame(const TGWindow *p=0, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition: TGFrame.h:436
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:655
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:165
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
auto * m
Definition: textangle.C:8