]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveTOFStripEditor.cxx
Added more functionalities on TOF data visualization via strips
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTOFStripEditor.cxx
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
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  **************************************************************************/
9
10 #include "AliEveTOFStripEditor.h"
11 #include <EveDet/AliEveTOFStrip.h>
12
13 #include <TVirtualPad.h>
14 #include <TColor.h>
15 #include <TEveGValuators.h>
16
17 #include <TGLabel.h>
18 #include <TGButton.h>
19 #include <TGNumberEntry.h>
20 #include <TGColorSelect.h>
21 #include <TGSlider.h>
22 #include <TGDoubleSlider.h>
23
24 //______________________________________________________________________________
25 // AliEveTOFStripEditor
26 //
27
28 ClassImp(AliEveTOFStripEditor)
29
30 AliEveTOFStripEditor::AliEveTOFStripEditor(const TGWindow *p, Int_t width, Int_t height,
31              UInt_t options, Pixel_t back) :
32   TGedFrame(p, width, height, options | kVerticalFrame, back),
33   fM(0)
34   // Initialize widget pointers to 0
35 {
36   MakeTitle("AliEveTOFStrip");
37
38   // Create widgets
39   // fXYZZ = new TGSomeWidget(this, ...);
40   // AddFrame(fXYZZ, new TGLayoutHints(...));
41   // fXYZZ->Connect("SignalName()", "AliEveTOFStripEditor", this, "DoXYZZ()");
42
43   fThreshold = new TEveGValuator(this, "Threshold", 200, 0);
44   fThreshold->SetNELength(4);
45   fThreshold->SetLabelWidth(60);
46   fThreshold->Build();
47   fThreshold->GetSlider()->SetWidth(120);
48   fThreshold->SetLimits(0,250);
49   fThreshold->Connect("ValueSet(Double_t)",
50                       "AliEveTOFSectorEditor", this, "DoThreshold()");
51   AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
52
53   fMaxVal = new TEveGValuator(this,"MaxVal", 200, 0);
54   fMaxVal->SetNELength(4);
55   fMaxVal->SetLabelWidth(60);
56   fMaxVal->Build();
57   fMaxVal->GetSlider()->SetWidth(60);
58   fMaxVal->SetLimits(0, 500);
59   fMaxVal->Connect("ValueSet(Double_t)",
60                    "AliEveTOFSectorEditor", this, "DoMaxVal()");
61   AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
62
63 }
64
65 AliEveTOFStripEditor::~AliEveTOFStripEditor()
66 {}
67
68 /******************************************************************************/
69
70 void AliEveTOFStripEditor::SetModel(TObject* obj)
71 {
72   fM = dynamic_cast<AliEveTOFStrip*>(obj);
73
74   // Set values of widgets
75   // fXYZZ->SetValue(fM->GetXYZZ());
76 }
77
78 /******************************************************************************/
79 void AliEveTOFStripEditor::DoThreshold()
80 {
81   fM->SetThreshold((Short_t) fThreshold->GetValue());
82   fThreshold->SetValue(fM->GetThreshold());
83   Update();
84 }
85
86 void AliEveTOFStripEditor::DoMaxVal()
87 {
88   fM->SetMaxVal((Int_t) fMaxVal->GetValue());
89   fMaxVal->SetValue(fM->GetMaxVal());
90   Update();
91 }
92
93 // Implements callback/slot methods
94
95 // void AliEveTOFStripEditor::DoXYZZ()
96 // {
97 //   fM->SetXYZZ(fXYZZ->GetValue());
98 //   Update();
99 // }