1 #include "MUONChamberEditor.h"
3 #include <Alieve/MUONChamber.h>
5 #include <Reve/RGValuators.h>
7 #include <TVirtualPad.h>
12 #include <TGNumberEntry.h>
13 #include <TGColorSelect.h>
15 #include <TGDoubleSlider.h>
18 using namespace Alieve;
20 //______________________________________________________________________
24 ClassImp(MUONChamberEditor)
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),
40 MakeTitle("MUONChamber");
44 fThreshold = new RGValuator(this, "ADC min", 200, 0);
45 fThreshold->SetNELength(4);
46 fThreshold->SetLabelWidth(labelW);
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));
54 fMaxVal = new RGValuator(this,"ADC max", 200, 0);
55 fMaxVal->SetNELength(4);
56 fMaxVal->SetLabelWidth(labelW);
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));
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));
75 fHitSize = new RGValuator(this,"Hit size", 200, 0);
76 fHitSize->SetLabelWidth(labelW);
77 fHitSize->SetShowSlider(kFALSE);
78 fHitSize->SetNELength(4);
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));
88 //______________________________________________________________________
89 MUONChamberEditor::~MUONChamberEditor()
97 //______________________________________________________________________
98 void MUONChamberEditor::SetModel(TObject* obj)
104 fM = dynamic_cast<MUONChamber*>(obj);
106 fThreshold->SetValue(fM->fThreshold);
107 fMaxVal->SetValue(fM->fMaxVal);
108 fClusterSize->SetValue(fM->fClusterSize);
109 fHitSize->SetValue(fM->fHitSize);
113 //______________________________________________________________________
114 void MUONChamberEditor::DoThreshold()
117 // set digit minimum amplitude
120 fM->SetThreshold((Short_t) fThreshold->GetValue());
121 fThreshold->SetValue(fM->fThreshold);
126 //______________________________________________________________________
127 void MUONChamberEditor::DoMaxVal()
130 // set digit maximum amplitude
133 fM->SetMaxVal((Int_t) fMaxVal->GetValue());
134 fMaxVal->SetValue(fM->fMaxVal);
139 //______________________________________________________________________
140 void MUONChamberEditor::DoClusterSize()
143 // set the cluster point size
146 fM->SetClusterSize((Int_t) fClusterSize->GetValue());
147 fClusterSize->SetValue(fM->fClusterSize);
152 //______________________________________________________________________
153 void MUONChamberEditor::DoHitSize()
156 // set the hit point size
159 fM->SetHitSize((Int_t) fHitSize->GetValue());
160 fHitSize->SetValue(fM->fHitSize);