3 #include "PMDModuleEditor.h"
4 #include <Alieve/PMDModule.h>
5 #include <Reve/RGEditor.h>
7 #include <TVirtualPad.h>
13 #include <TGNumberEntry.h>
14 #include <TGColorSelect.h>
15 #include <TGDoubleSlider.h>
18 #include <TGLViewer.h>
19 #include <Reve/ReveManager.h>
25 using namespace Alieve;
27 //______________________________________________________________________
31 ClassImp(PMDModuleEditor)
33 PMDModuleEditor::PMDModuleEditor(const TGWindow *p, Int_t width, Int_t height,
34 UInt_t options, Pixel_t back) :
35 TGedFrame(p, width, height, options | kVerticalFrame, back),
44 // Initialize widget pointers to 0
46 MakeTitle("PMDModule");
51 void PMDModuleEditor::CreateInfoFrame()
53 fInfoFrame = CreateEditorTabSubFrame("Info");
55 TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
61 title1->AddFrame(new TGLabel(title1, "PMDModule Info"),
62 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
63 title1->AddFrame(new TGHorizontal3DLine(title1),
64 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
65 fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
69 fInfoLabel0 = new TGLabel(fInfoFrame);
70 fInfoLabel0->SetTextJustify(kTextLeft);
71 fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
74 fInfoLabel1 = new TGLabel(fInfoFrame);
75 fInfoLabel1->SetTextJustify(kTextLeft);
76 fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
79 fInfoLabel2 = new TGLabel(fInfoFrame);
80 fInfoLabel2->SetTextJustify(kTextLeft);
81 fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
84 fInfoLabel3 = new TGLabel(fInfoFrame);
85 fInfoLabel3->SetTextJustify(kTextLeft);
86 fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
89 fInfoLabel4 = new TGLabel(fInfoFrame);
90 fInfoLabel4->SetTextJustify(kTextLeft);
91 fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
94 fInfoLabel5 = new TGLabel(fInfoFrame);
95 fInfoLabel5->SetTextJustify(kTextLeft);
96 fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
101 TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth);
103 TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth);
104 TGLabel* l = new TGLabel(g, "Histos:");
105 g->AddFrame(l, new TGLayoutHints(kLHintsLeft, 0,0,4,0));
110 b = new TGTextButton(f, "Show");
111 f->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
112 b->Connect("Clicked()", "Alieve::PMDModuleEditor", this, "DisplayHistos()");
114 fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
118 PMDModuleEditor::~PMDModuleEditor()
121 /**************************************************************************/
123 void PMDModuleEditor::SetModel(TObject* obj)
125 fM = dynamic_cast<PMDModule*>(obj);
127 // Set values of widgets
129 fInfoLabel0->SetText(Form("Cells hit per Module : %d", fM->GetNPads()));
130 fInfoLabel1->SetText(Form("ADC per Module : %d", fM->GetAdc()));
131 fInfoLabel2->SetText(Form("Tot Cells for PRE : %d", fM->GetPRETotPads()));
132 fInfoLabel3->SetText(Form("Tot ADC for PRE : %d", fM->GetPRETotAdc()));
133 fInfoLabel4->SetText(Form("Tot Cells for CPV : %d", fM->GetCPVTotPads()));
134 fInfoLabel5->SetText(Form("Tot ADC for CPV : %d", fM->GetCPVTotAdc()));
137 void PMDModuleEditor::DisplayHistos()
139 fM->GetHisto()->Draw();