]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/MUONChamberEditor.cxx
Runloader is updated when moving to next file (quick fix).
[u/mrichter/AliRoot.git] / EVE / Alieve / MUONChamberEditor.cxx
1 #include "MUONChamberEditor.h"
2
3 #include <Alieve/MUONChamber.h>
4
5 #include <Reve/RGValuators.h>
6
7 #include <TVirtualPad.h>
8 #include <TColor.h>
9
10 #include <TGLabel.h>
11 #include <TGButton.h>
12 #include <TGNumberEntry.h>
13 #include <TGColorSelect.h>
14 #include <TGSlider.h>
15 #include <TGDoubleSlider.h>
16
17 using namespace Reve;
18 using namespace Alieve;
19
20 //______________________________________________________________________
21 // MUONChamberEditor
22 //
23
24 ClassImp(MUONChamberEditor)
25
26 //______________________________________________________________________
27 MUONChamberEditor::MUONChamberEditor(const TGWindow *p,
28                                      Int_t width, Int_t height,
29                                      UInt_t options, Pixel_t back) :
30   TGedFrame(p, width, height, options | kVerticalFrame, back),
31   fM(0),
32   fThreshold(0),
33   fMaxVal(0),
34   fClusterSize(0)
35 {
36   //
37   // constructor
38   //
39
40   MakeTitle("MUONChamber");
41
42   Int_t labelW = 60;
43
44   fThreshold = new RGValuator(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                       "Alieve::MUONChamberEditor", this, "DoThreshold()");
52   AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
53
54   fMaxVal = new RGValuator(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                    "Alieve::MUONChamberEditor", this, "DoMaxVal()");
62   AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
63
64   fClusterSize = new RGValuator(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                       "Alieve::MUONChamberEditor", this, "DoClusterSize()");
73   AddFrame(fClusterSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
74
75   fHitSize = new RGValuator(this,"Hit 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                       "Alieve::MUONChamberEditor", this, "DoHitSize()");
84   AddFrame(fHitSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
85
86 }
87
88 //______________________________________________________________________
89 MUONChamberEditor::~MUONChamberEditor()
90 {
91   //
92   // destructor
93   //
94
95 }
96
97 //______________________________________________________________________
98 void MUONChamberEditor::SetModel(TObject* obj)
99 {
100   //
101   // ...
102   //
103
104   fM = dynamic_cast<MUONChamber*>(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 MUONChamberEditor::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 MUONChamberEditor::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 MUONChamberEditor::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 MUONChamberEditor::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 }