]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/PMDModuleEditor.cxx
Put black-listed classes out of Alieve namespace.
[u/mrichter/AliRoot.git] / EVE / Alieve / PMDModuleEditor.cxx
1 // $Header$
2
3 #include "PMDModuleEditor.h"
4 #include <Alieve/PMDModule.h>
5 #include <TEveGedEditor.h>
6
7 #include <TVirtualPad.h>
8 #include <TColor.h>
9
10 #include <TGLabel.h>
11 #include <TG3DLine.h>
12 #include <TGButton.h>
13 #include <TGNumberEntry.h>
14 #include <TGColorSelect.h>
15 #include <TGDoubleSlider.h>
16
17 #include <TCanvas.h>
18 #include <TGLViewer.h>
19 #include <TEveManager.h>
20
21
22 #include <TH1F.h>
23 using namespace Alieve;
24
25 //______________________________________________________________________
26 // PMDModuleEditor
27 //
28
29 ClassImp(PMDModuleEditor)
30
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),
34   fM(0),
35   fInfoFrame(0),
36   fInfoLabel0(0),
37   fInfoLabel1(0),
38   fInfoLabel2(0),
39   fInfoLabel3(0),
40   fInfoLabel4(0),
41   fInfoLabel5(0)
42   // Initialize widget pointers to 0
43 {
44   MakeTitle("PMDModule");
45
46   CreateInfoFrame();
47 }
48
49 void PMDModuleEditor::CreateInfoFrame()
50 {
51   fInfoFrame = CreateEditorTabSubFrame("Info");
52
53   TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10, 
54                                                   kHorizontalFrame | 
55                                                   kLHintsExpandX   | 
56                                                   kFixedWidth      | 
57                                                   kOwnBackground);
58
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));
64
65   Int_t labelW = 67;
66
67   fInfoLabel0 = new TGLabel(fInfoFrame);
68   fInfoLabel0->SetTextJustify(kTextLeft);
69   fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
70                                          8, 0, 2, 0));
71
72   fInfoLabel1 = new TGLabel(fInfoFrame);
73   fInfoLabel1->SetTextJustify(kTextLeft);
74   fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
75                                          8, 0, 2, 0));
76
77   fInfoLabel2 = new TGLabel(fInfoFrame);
78   fInfoLabel2->SetTextJustify(kTextLeft);
79   fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
80                                          8, 0, 2, 0));
81
82   fInfoLabel3 = new TGLabel(fInfoFrame);
83   fInfoLabel3->SetTextJustify(kTextLeft);
84   fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
85                                          8, 0, 2, 0));
86
87   fInfoLabel4 = new TGLabel(fInfoFrame);
88   fInfoLabel4->SetTextJustify(kTextLeft);
89   fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
90                                          8, 0, 2, 0));
91
92   fInfoLabel5 = new TGLabel(fInfoFrame);
93   fInfoLabel5->SetTextJustify(kTextLeft);
94   fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
95                                          8, 0, 2, 0));
96
97
98   {
99     TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth);
100
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));
104     f->AddFrame(g);
105
106     TGTextButton* b;
107
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()");
111
112     fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
113   }
114 }
115
116 PMDModuleEditor::~PMDModuleEditor()
117 {}
118
119 /**************************************************************************/
120
121 void PMDModuleEditor::SetModel(TObject* obj)
122 {
123   fM = dynamic_cast<PMDModule*>(obj);
124
125   // Set values of widgets
126
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()));
133 }
134
135 void PMDModuleEditor::DisplayHistos()
136 {
137   fM->GetHisto()->Draw();
138   gPad->Modified();
139   gPad->Update();
140 }