Add class and function docs.
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveTrackFitterEditor.cxx
CommitLineData
d810d0de 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
5a1436d6 3
d810d0de 4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
9
10#include "AliEveTrackFitterEditor.h"
707b281a 11#include "AliEveTrackFitter.h"
5a1436d6 12
13#include <TGButton.h>
d810d0de 14
5a1436d6 15
57ffa5fb 16//______________________________________________________________________________
d810d0de 17// AliEveTrackFitterEditor
5a1436d6 18//
19
d810d0de 20ClassImp(AliEveTrackFitterEditor)
5a1436d6 21
d810d0de 22AliEveTrackFitterEditor::AliEveTrackFitterEditor(const TGWindow *p, Int_t width, Int_t height,
40790e5b 23 UInt_t options, Pixel_t back) :
5a1436d6 24 TGedFrame(p, width, height, options | kVerticalFrame, back),
25 fM(0),
26 fFit(0),
27 fReset(0),
28 fStart(0),
29 fStop(0),
30 fGraph(0)
31{
32 // Constructor.
33
d810d0de 34 MakeTitle("AliEveTrackFitter");
5a1436d6 35
36 fStart = new TGTextButton(this, "Start");
40790e5b 37 AddFrame(fStart, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 3, 1));
5a1436d6 38 fStart->Connect("Clicked()",
d810d0de 39 "AliEveTrackFitterEditor", this, "DoStart()");
5a1436d6 40
41 fFit = new TGTextButton(this, "Fit");
42 AddFrame(fFit, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 1, 1));
43 fFit->Connect("Clicked()",
d810d0de 44 "AliEveTrackFitterEditor", this, "DoFit()");
5a1436d6 45
46 fReset = new TGTextButton(this, "Reset");
47 AddFrame(fReset, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 1, 1));
48 fReset->Connect("Clicked()",
d810d0de 49 "AliEveTrackFitterEditor", this, "DoReset()");
5a1436d6 50
51 fStop = new TGTextButton(this, "Stop");
40790e5b 52 AddFrame(fStop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 1, 4));
5a1436d6 53 fStop->Connect("Clicked()",
d810d0de 54 "AliEveTrackFitterEditor", this, "DoStop()");
5a1436d6 55
40790e5b 56 fGraph = new TGTextButton(this, "DebugGraph");
57 AddFrame(fGraph, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 2, 4, 1));
5a1436d6 58 fGraph->Connect("Clicked()",
d810d0de 59 "AliEveTrackFitterEditor", this, "DoGraph()");
5a1436d6 60 }
61
57ffa5fb 62/******************************************************************************/
5a1436d6 63
d810d0de 64void AliEveTrackFitterEditor::SetModel(TObject* obj)
51346b82 65{
5a1436d6 66 // Set model object.
67
d810d0de 68 fM = dynamic_cast<AliEveTrackFitter*>(obj);
5a1436d6 69
70 if(fM->GetConnected())
71 {
72 fStart->SetState(kButtonDisabled);
73 fStop->SetState(kButtonUp);
74 }
75 else
51346b82 76 {
5a1436d6 77 fStop->SetState(kButtonDisabled);
78 fStart->SetState(kButtonEngaged);
79 fStart->SetState(kButtonUp);
80 }
81}
82
40790e5b 83/**************************************************************************/
84
d810d0de 85void AliEveTrackFitterEditor::DoFit()
5a1436d6 86{
87 // Fit slot.
88
89 fM->FitTrack();
90 Update();
91}
92
d810d0de 93void AliEveTrackFitterEditor::DoReset()
5a1436d6 94{
95 // Reset slot.
96
97 fM->Reset();
98 Update();
99}
100
d810d0de 101void AliEveTrackFitterEditor::DoStart()
5a1436d6 102{
103 // Start selection slot.
104
105 fM->Start();
106 fStart->SetState(kButtonDisabled);
107 fStop->SetState(kButtonUp);
108}
109
d810d0de 110void AliEveTrackFitterEditor::DoStop()
5a1436d6 111{
112 // Stop selection slot.
113
114 fM->Stop();
115 fStop->SetState(kButtonDisabled);
116 fStart->SetState(kButtonUp);
117}
118
d810d0de 119void AliEveTrackFitterEditor::DoGraph()
5a1436d6 120{
121 // Draw graph slot.
122
40790e5b 123 fM->DrawDebugGraph();
5a1436d6 124 Update();
125}