2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveCosmicRayFitterEditor.h"
11 #include "AliEveCosmicRayFitter.h"
16 //_____________________________________________________________________________
17 // AliEveCosmicRayFitterEditor
20 ClassImp(AliEveCosmicRayFitterEditor)
22 AliEveCosmicRayFitterEditor::AliEveCosmicRayFitterEditor(const TGWindow *p, Int_t width, Int_t height,
23 UInt_t options, Pixel_t back) :
24 TGedFrame(p, width, height, options | kVerticalFrame, back),
34 MakeTitle("AliEveCosmicRayFitter");
36 fStart = new TGTextButton(this, "Start");
37 AddFrame(fStart, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 3, 1));
38 fStart->Connect("Clicked()",
39 "AliEveCosmicRayFitterEditor", this, "DoStart()");
41 fFit = new TGTextButton(this, "Fit");
42 AddFrame(fFit, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 1, 1));
43 fFit->Connect("Clicked()",
44 "AliEveCosmicRayFitterEditor", this, "DoFit()");
46 fReset = new TGTextButton(this, "Reset");
47 AddFrame(fReset, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 1, 1));
48 fReset->Connect("Clicked()",
49 "AliEveCosmicRayFitterEditor", this, "DoReset()");
51 fStop = new TGTextButton(this, "Stop");
52 AddFrame(fStop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 1, 1, 4));
53 fStop->Connect("Clicked()",
54 "AliEveCosmicRayFitterEditor", this, "DoStop()");
56 fGraph = new TGTextButton(this, "DebugGraph");
57 AddFrame(fGraph, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 4, 2, 4, 1));
58 fGraph->Connect("Clicked()",
59 "AliEveCosmicRayFitterEditor", this, "DoGraph()");
62 /******************************************************************************/
64 void AliEveCosmicRayFitterEditor::SetModel(TObject* obj)
68 fM = dynamic_cast<AliEveCosmicRayFitter*>(obj);
70 if(fM->GetConnected())
72 fStart->SetState(kButtonDisabled);
73 fStop->SetState(kButtonUp);
77 fStop->SetState(kButtonDisabled);
78 fStart->SetState(kButtonEngaged);
79 fStart->SetState(kButtonUp);
83 /**************************************************************************/
85 void AliEveCosmicRayFitterEditor::DoFit()
93 void AliEveCosmicRayFitterEditor::DoReset()
101 void AliEveCosmicRayFitterEditor::DoStart()
103 // Start selection slot.
106 fStart->SetState(kButtonDisabled);
107 fStop->SetState(kButtonUp);
110 void AliEveCosmicRayFitterEditor::DoStop()
112 // Stop selection slot.
115 fStop->SetState(kButtonDisabled);
116 fStart->SetState(kButtonUp);
119 void AliEveCosmicRayFitterEditor::DoGraph()
123 fM->DrawDebugGraph();