]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveMUONChamberEditor.cxx
Coverity 15169
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveMUONChamberEditor.cxx
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel & Bogdan Vulpescu: 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 "AliEveMUONChamberEditor.h"
11
12 #include <EveDet/AliEveMUONChamber.h>
13
14 #include <TEveGValuators.h>
15 #include <TGSlider.h>
16 #include <TGDoubleSlider.h>
17
18
19 //______________________________________________________________________________
20 // AliEveMUONChamberEditor
21 //
22
23 ClassImp(AliEveMUONChamberEditor)
24
25 //______________________________________________________________________________
26 AliEveMUONChamberEditor::AliEveMUONChamberEditor(const TGWindow *p,
27                                      Int_t width, Int_t height,
28                                      UInt_t options, Pixel_t back) :
29   TGedFrame(p, width, height, options | kVerticalFrame, back),
30   fM(0),
31   fThreshold(0),
32   fMaxVal(0),
33   fClusterSize(0),
34   fHitSize(0)
35 {
36   //
37   // constructor
38   //
39
40   MakeTitle("AliEveMUONChamber");
41
42   Int_t labelW = 60;
43
44   fThreshold = new TEveGValuator(this, "ADC min", 200, 0);
45   fThreshold->SetNELength(4);
46   fThreshold->SetLabelWidth(labelW);
47   fThreshold->Build();
48   fThreshold->GetSlider()->SetWidth(120);
49   fThreshold->SetLimits(0,4096);
50   fThreshold->Connect("ValueSet(Double_t)",
51                       "AliEveMUONChamberEditor", this, "DoThreshold()");
52   AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
53
54   fMaxVal = new TEveGValuator(this,"ADC max", 200, 0);
55   fMaxVal->SetNELength(4);
56   fMaxVal->SetLabelWidth(labelW);
57   fMaxVal->Build();
58   fMaxVal->GetSlider()->SetWidth(120);
59   fMaxVal->SetLimits(0, 4096);
60   fMaxVal->Connect("ValueSet(Double_t)",
61                    "AliEveMUONChamberEditor", this, "DoMaxVal()");
62   AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
63
64   fClusterSize = new TEveGValuator(this,"Cls size", 200, 0);
65   fClusterSize->SetLabelWidth(labelW);
66   fClusterSize->SetShowSlider(kFALSE);
67   fClusterSize->SetNELength(4);
68   fClusterSize->Build();
69   fClusterSize->SetLimits(0, 24);
70   fClusterSize->SetToolTip("Size of displayed clusters");
71   fClusterSize->Connect("ValueSet(Double_t)",
72                       "AliEveMUONChamberEditor", this, "DoClusterSize()");
73   AddFrame(fClusterSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
74
75   fHitSize = new TEveGValuator(this,"TEveHit size", 200, 0);
76   fHitSize->SetLabelWidth(labelW);
77   fHitSize->SetShowSlider(kFALSE);
78   fHitSize->SetNELength(4);
79   fHitSize->Build();
80   fHitSize->SetLimits(0, 24);
81   fHitSize->SetToolTip("Size of displayed clusters");
82   fHitSize->Connect("ValueSet(Double_t)",
83                       "AliEveMUONChamberEditor", this, "DoHitSize()");
84   AddFrame(fHitSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
85
86 }
87
88 //______________________________________________________________________________
89 AliEveMUONChamberEditor::~AliEveMUONChamberEditor()
90 {
91   //
92   // destructor
93   //
94
95 }
96
97 //______________________________________________________________________________
98 void AliEveMUONChamberEditor::SetModel(TObject* obj)
99 {
100   //
101   // ...
102   //
103
104   fM = dynamic_cast<AliEveMUONChamber*>(obj);
105
106   fThreshold->SetValue(fM->fThreshold);
107   fMaxVal->SetValue(fM->fMaxVal);
108   fClusterSize->SetValue(fM->fClusterSize);
109   fHitSize->SetValue(fM->fHitSize);
110
111 }
112
113 //______________________________________________________________________________
114 void AliEveMUONChamberEditor::DoThreshold()
115 {
116   //
117   // set digit minimum amplitude
118   //
119
120   fM->SetThreshold((Short_t) fThreshold->GetValue());
121   fThreshold->SetValue(fM->fThreshold);
122   Update();
123
124 }
125
126 //______________________________________________________________________________
127 void AliEveMUONChamberEditor::DoMaxVal()
128 {
129   //
130   // set digit maximum amplitude
131   //
132
133   fM->SetMaxVal((Int_t) fMaxVal->GetValue());
134   fMaxVal->SetValue(fM->fMaxVal);
135   Update();
136
137 }
138
139 //______________________________________________________________________________
140 void AliEveMUONChamberEditor::DoClusterSize()
141 {
142   //
143   // set the cluster point size
144   //
145
146   fM->SetClusterSize((Int_t) fClusterSize->GetValue());
147   fClusterSize->SetValue(fM->fClusterSize);
148   Update();
149
150 }
151
152 //______________________________________________________________________________
153 void AliEveMUONChamberEditor::DoHitSize()
154 {
155   //
156   // set the hit point size
157   //
158
159   fM->SetHitSize((Int_t) fHitSize->GetValue());
160   fHitSize->SetValue(fM->fHitSize);
161   Update();
162
163 }