37 ClassImp(TEveTrackPropagatorSubEditor);
42 TEveTrackPropagatorSubEditor::TEveTrackPropagatorSubEditor(
const TGWindow *p):
46 fMaxR(0), fMaxZ(0), fMaxOrbits(0), fMaxAng(0), fDelta(0),
48 fRefsCont(0), fPMFrame(0),
49 fFitDaughters(0), fFitReferences(0),
51 fFitCluster2Ds(0), fFitLineSegments(0),
52 fRnrDaughters(0), fRnrReferences(0),
53 fRnrDecay(0), fRnrCluster2Ds(0),
56 fProjTrackBreaking(0), fRnrPTBMarkers(0), fPTBAtt(0)
61 fMaxR =
new TEveGValuator(
this,
"Max R:", 90, 0);
62 fMaxR->SetLabelWidth(labelW);
63 fMaxR->SetNELength(6);
65 fMaxR->SetLimits(0.1, TEveTrackPropagator::fgEditorMaxR, 101, TGNumberFormat::kNESRealOne);
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));
70 fMaxZ =
new TEveGValuator(
this,
"Max Z:", 90, 0);
71 fMaxZ->SetLabelWidth(labelW);
72 fMaxZ->SetNELength(6);
74 fMaxZ->SetLimits(0.1, TEveTrackPropagator::fgEditorMaxZ, 101, TGNumberFormat::kNESRealOne);
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));
79 fMaxOrbits =
new TEveGValuator(
this,
"Orbits:", 90, 0);
80 fMaxOrbits->SetLabelWidth(labelW);
81 fMaxOrbits->SetNELength(6);
83 fMaxOrbits->SetLimits(0.1, 10, 101, TGNumberFormat::kNESRealOne);
84 fMaxOrbits->SetToolTip(
"Maximal angular path of tracks' orbits (1 ~ 2Pi).");
85 fMaxOrbits->Connect(
"ValueSet(Double_t)",
"TEveTrackPropagatorSubEditor",
this,
"DoMaxOrbits()");
86 AddFrame(fMaxOrbits,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
88 fMaxAng =
new TEveGValuator(
this,
"Angle:", 90, 0);
89 fMaxAng->SetLabelWidth(labelW);
90 fMaxAng->SetNELength(6);
92 fMaxAng->SetLimits(1, 160, 81, TGNumberFormat::kNESRealOne);
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));
97 fDelta =
new TEveGValuator(
this,
"Delta:", 90, 0);
98 fDelta->SetLabelWidth(labelW);
99 fDelta->SetNELength(6);
101 fDelta->SetLimits(0.001, 10, 101, TGNumberFormat::kNESRealThree);
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));
110 void TEveTrackPropagatorSubEditor::CreateRefsContainer(TGVerticalFrame* p)
112 fRefsCont =
new TGCompositeFrame(p, 80, 20, kVerticalFrame);
113 fPMFrame =
new TGVerticalFrame(fRefsCont);
116 TGGroupFrame* fitPM =
new TGGroupFrame(fPMFrame,
"PathMarks:", kLHintsTop | kLHintsCenterX);
117 fitPM->SetTitlePos(TGGroupFrame::kLeft);
118 fPMFrame->AddFrame( fitPM,
new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 3, 3, 3, 3));
120 TGMatrixLayout *ml =
new TGMatrixLayout(fitPM, 0,1,6);
121 fitPM->SetLayoutManager(ml);
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);
129 fitPM->AddFrame(fFitDaughters);
130 fitPM->AddFrame(fFitReferences);
131 fitPM->AddFrame(fFitDecay);
132 fitPM->AddFrame(fFitCluster2Ds);
133 fitPM->AddFrame(fFitLineSegments);
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()");
143 TGGroupFrame* rnrPM =
new TGGroupFrame(fPMFrame,
"PathMarks:", kLHintsTop | kLHintsCenterX);
144 rnrPM->SetTitlePos(TGGroupFrame::kLeft);
145 fPMFrame->AddFrame( rnrPM,
new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 3, 3, 3, 3));
147 TGMatrixLayout *ml =
new TGMatrixLayout(rnrPM, 0, 1, 6);
148 rnrPM->SetLayoutManager(ml);
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);
155 rnrPM->AddFrame(fRnrDaughters);
156 rnrPM->AddFrame(fRnrReferences);
157 rnrPM->AddFrame(fRnrDecay);
158 rnrPM->AddFrame(fRnrCluster2Ds);
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()");
165 fRefsCont->AddFrame(fPMFrame,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
169 fPMAtt =
new TAttMarkerEditor(fRefsCont);
170 TGFrameElement *el = (TGFrameElement*) fPMAtt->GetList()->First();
171 TGFrame *f = el->fFrame; fPMAtt->RemoveFrame(f);
172 f->DestroyWindow();
delete f;
173 fRefsCont->AddFrame(fPMAtt,
new TGLayoutHints(kLHintsTop, 1, 1, 3, 1));
177 TGCompositeFrame *vf =
new TGCompositeFrame
178 (fRefsCont, 145, 10, kHorizontalFrame | kLHintsExpandX | kFixedWidth | kOwnBackground);
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));
185 fRnrFV =
new TGCheckButton(fRefsCont,
"Rnr");
186 fRnrFV->Connect(
"Clicked()",
"TEveTrackPropagatorSubEditor",
this,
"DoRnrFV()");
187 fRefsCont->AddFrame(fRnrFV,
new TGLayoutHints(kLHintsTop, 5, 1, 2, 0));
189 fFVAtt =
new TAttMarkerEditor(fRefsCont);
190 TGFrameElement *el = (TGFrameElement*) fFVAtt->GetList()->First();
191 TGFrame *f = el->fFrame; fFVAtt->RemoveFrame(f);
192 f->DestroyWindow();
delete f;
193 fRefsCont->AddFrame(fFVAtt,
new TGLayoutHints(kLHintsTop, 1, 1, 3, 1));
198 TGCompositeFrame *vf =
new TGCompositeFrame
199 (fRefsCont, 145, 10, kHorizontalFrame | kLHintsExpandX | kFixedWidth | kOwnBackground);
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));
209 TGHorizontalFrame* hf =
new TGHorizontalFrame(fRefsCont);
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));
216 fProjTrackBreaking =
new TGComboBox(hf);
217 fProjTrackBreaking->AddEntry(
"Break tracks", TEveTrackPropagator::kPTB_Break);
218 fProjTrackBreaking->AddEntry(
"First point position", TEveTrackPropagator::kPTB_UseFirstPointPos);
219 fProjTrackBreaking->AddEntry(
"Last point position", TEveTrackPropagator::kPTB_UseLastPointPos);
220 fProjTrackBreaking->Connect(
"Selected(Int_t)",
"TEveTrackPropagatorSubEditor",
this,
"DoModePTB(UChar_t)");
221 fProjTrackBreaking->Resize(140, labelH);
222 hf->AddFrame(fProjTrackBreaking,
new TGLayoutHints(kLHintsLeft, 0,0,2,0));
223 fRefsCont->AddFrame(hf,
new TGLayoutHints(kLHintsTop, 4, 1, 1, 1));
226 fRnrPTBMarkers =
new TGCheckButton(fRefsCont,
"Rnr");
227 fRnrPTBMarkers->Connect(
"Clicked()",
"TEveTrackPropagatorSubEditor",
this,
"DoRnrPTB()");
228 fRefsCont->AddFrame(fRnrPTBMarkers,
new TGLayoutHints(kLHintsTop, 5, 1, 2, 0));
230 fPTBAtt =
new TAttMarkerEditor(fRefsCont);
231 TGFrameElement *el = (TGFrameElement*) fPTBAtt->GetList()->First();
232 TGFrame *f = el->fFrame; fPTBAtt->RemoveFrame(f);
233 f->DestroyWindow();
delete f;
234 fRefsCont->AddFrame(fPTBAtt,
new TGLayoutHints(kLHintsTop, 1, 1, 3, 1));
238 p->AddFrame(fRefsCont,
new TGLayoutHints(kLHintsTop| kLHintsExpandX));
244 void TEveTrackPropagatorSubEditor::SetModel(TEveTrackPropagator* m)
248 fMaxR->SetValue(fM->fMaxR);
249 fMaxZ->SetValue(fM->fMaxZ);
250 fMaxOrbits->SetValue(fM->fMaxOrbs);
251 fMaxAng->SetValue(fM->GetMaxAng());
252 fDelta->SetValue(fM->GetDelta());
254 if(fM->fEditPathMarks)
257 fRnrDaughters->SetState(fM->fRnrDaughters ? kButtonDown : kButtonUp);
258 fRnrReferences->SetState(fM->fRnrReferences ? kButtonDown : kButtonUp);
259 fRnrDecay->SetState(fM->fRnrDecay ? kButtonDown : kButtonUp);
260 fRnrCluster2Ds->SetState(fM->fRnrCluster2Ds ? kButtonDown : kButtonUp);
262 fFitDaughters->SetState(fM->fFitDaughters ? kButtonDown : kButtonUp);
263 fFitReferences->SetState(fM->fFitReferences ? kButtonDown : kButtonUp);
264 fFitDecay->SetState(fM->fFitDecay ? kButtonDown : kButtonUp);
265 fFitCluster2Ds->SetState(fM->fFitCluster2Ds ? kButtonDown : kButtonUp);
266 fFitLineSegments->SetState(fM->fFitLineSegments ? kButtonDown : kButtonUp);
268 fPMAtt->SetModel(&fM->fPMAtt);
272 fRefsCont->HideFrame(fPMFrame);
275 fRnrFV->SetState(fM->fRnrFV ? kButtonDown : kButtonUp);
276 fFVAtt->SetModel(&fM->fFVAtt);
278 fProjTrackBreaking->Select(fM->fProjTrackBreaking, kFALSE);
279 fRnrPTBMarkers->SetState(fM->fRnrPTBMarkers ? kButtonDown : kButtonUp);
280 fPTBAtt->SetModel(&fM->fPTBAtt);
286 void TEveTrackPropagatorSubEditor::Changed()
294 void TEveTrackPropagatorSubEditor::DoMaxR()
296 fM->SetMaxR(fMaxR->GetValue());
303 void TEveTrackPropagatorSubEditor::DoMaxZ()
305 fM->SetMaxZ(fMaxZ->GetValue());
312 void TEveTrackPropagatorSubEditor::DoMaxOrbits()
314 fM->SetMaxOrbs(fMaxOrbits->GetValue());
321 void TEveTrackPropagatorSubEditor::DoMaxAng()
323 fM->SetMaxAng(fMaxAng->GetValue());
330 void TEveTrackPropagatorSubEditor::DoDelta()
332 fM->SetDelta(fDelta->GetValue());
339 void TEveTrackPropagatorSubEditor::DoFitPM()
341 TGButton* b = (TGButton *) gTQSender;
342 TEvePathMark::EType_e type = TEvePathMark::EType_e(b->WidgetId());
343 Bool_t on = b->IsOn();
347 case TEvePathMark::kDaughter:
348 fM->SetFitDaughters(on);
350 case TEvePathMark::kReference:
351 fM->SetFitReferences(on);
353 case TEvePathMark::kDecay:
356 case TEvePathMark::kCluster2D:
357 fM->SetFitCluster2Ds(on);
359 case TEvePathMark::kLineSegment:
360 fM->SetFitLineSegments(on);
372 void TEveTrackPropagatorSubEditor::DoRnrPM()
374 TGButton * b = (TGButton *) gTQSender;
375 TEvePathMark::EType_e type = TEvePathMark::EType_e(b->WidgetId());
376 Bool_t on = b->IsOn();
378 case TEvePathMark::kDaughter:
379 fM->SetRnrDaughters(on);
381 case TEvePathMark::kReference:
382 fM->SetRnrReferences(on);
384 case TEvePathMark::kDecay:
387 case TEvePathMark::kCluster2D:
388 fM->SetRnrCluster2Ds(on);
399 void TEveTrackPropagatorSubEditor::DoRnrFV()
401 fM->SetRnrFV(fRnrFV->IsOn());
408 void TEveTrackPropagatorSubEditor::DoModePTB(UChar_t mode)
410 fM->SetProjTrackBreaking(mode);
417 void TEveTrackPropagatorSubEditor::DoRnrPTB()
419 fM->SetRnrPTBMarkers(fRnrPTBMarkers->IsOn());
430 ClassImp(TEveTrackPropagatorEditor);
435 TEveTrackPropagatorEditor::TEveTrackPropagatorEditor(
const TGWindow *p,
436 Int_t width, Int_t height,
437 UInt_t options, Pixel_t back) :
438 TGedFrame(p, width, height, options | kVerticalFrame, back),
442 MakeTitle(
"RenderStyle");
444 fRSSubEditor =
new TEveTrackPropagatorSubEditor(
this);
445 fRSSubEditor->Connect(
"Changed()",
"TEveTrackPropagatorEditor",
this,
"Update()");
446 AddFrame(fRSSubEditor,
new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0,0,0));
448 TGVerticalFrame* refsFrame = CreateEditorTabSubFrame(
"Refs");
450 TGCompositeFrame *cf =
new TGCompositeFrame
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));
460 fRSSubEditor->CreateRefsContainer(refsFrame);
461 fRSSubEditor->fPMAtt->SetGedEditor((TGedEditor*)gEve->GetEditor());
462 fRSSubEditor->fFVAtt->SetGedEditor((TGedEditor*)gEve->GetEditor());
464 fRSSubEditor->Connect(
"Changed()",
"TEveTrackPropagatorEditor",
this,
"Update()");
470 void TEveTrackPropagatorEditor::SetModel(TObject* obj)
472 fM =
dynamic_cast<TEveTrackPropagator*
>(obj);
473 fRSSubEditor->SetModel(fM);