3 #include "PMDModuleEditor.h"
4 #include <Alieve/PMDModule.h>
5 #include <TEveGedEditor.h>
7 #include <TVirtualPad.h>
13 #include <TGNumberEntry.h>
14 #include <TGColorSelect.h>
15 #include <TGDoubleSlider.h>
18 #include <TGLViewer.h>
19 #include <TEveManager.h>
23 using namespace Alieve;
25 //______________________________________________________________________
29 ClassImp(PMDModuleEditor)
31 PMDModuleEditor::PMDModuleEditor(const TGWindow *p, Int_t width, Int_t height,
32 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
42 // Initialize widget pointers to 0
44 MakeTitle("PMDModule");
49 void PMDModuleEditor::CreateInfoFrame()
51 fInfoFrame = CreateEditorTabSubFrame("Info");
53 TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
59 title1->AddFrame(new TGLabel(title1, "PMDModule Info"),
60 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
61 title1->AddFrame(new TGHorizontal3DLine(title1),
62 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
63 fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
67 fInfoLabel0 = new TGLabel(fInfoFrame);
68 fInfoLabel0->SetTextJustify(kTextLeft);
69 fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
72 fInfoLabel1 = new TGLabel(fInfoFrame);
73 fInfoLabel1->SetTextJustify(kTextLeft);
74 fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
77 fInfoLabel2 = new TGLabel(fInfoFrame);
78 fInfoLabel2->SetTextJustify(kTextLeft);
79 fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
82 fInfoLabel3 = new TGLabel(fInfoFrame);
83 fInfoLabel3->SetTextJustify(kTextLeft);
84 fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
87 fInfoLabel4 = new TGLabel(fInfoFrame);
88 fInfoLabel4->SetTextJustify(kTextLeft);
89 fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
92 fInfoLabel5 = new TGLabel(fInfoFrame);
93 fInfoLabel5->SetTextJustify(kTextLeft);
94 fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
99 TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth);
101 TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth);
102 TGLabel* l = new TGLabel(g, "Histos:");
103 g->AddFrame(l, new TGLayoutHints(kLHintsLeft, 0,0,4,0));
108 b = new TGTextButton(f, "Show");
109 f->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
110 b->Connect("Clicked()", "Alieve::PMDModuleEditor", this, "DisplayHistos()");
112 fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
116 PMDModuleEditor::~PMDModuleEditor()
119 /**************************************************************************/
121 void PMDModuleEditor::SetModel(TObject* obj)
123 fM = dynamic_cast<PMDModule*>(obj);
125 // Set values of widgets
127 fInfoLabel0->SetText(Form("Cells hit per Module : %d", fM->GetNPads()));
128 fInfoLabel1->SetText(Form("ADC per Module : %d", fM->GetAdc()));
129 fInfoLabel2->SetText(Form("Tot Cells for PRE : %d", fM->GetPRETotPads()));
130 fInfoLabel3->SetText(Form("Tot ADC for PRE : %d", fM->GetPRETotAdc()));
131 fInfoLabel4->SetText(Form("Tot Cells for CPV : %d", fM->GetCPVTotPads()));
132 fInfoLabel5->SetText(Form("Tot ADC for CPV : %d", fM->GetCPVTotAdc()));
135 void PMDModuleEditor::DisplayHistos()
137 fM->GetHisto()->Draw();