]>
Commit | Line | Data |
---|---|---|
ee0e160c | 1 | // $Header$ |
2 | ||
3 | #include "PMDModuleEditor.h" | |
4 | #include <Alieve/PMDModule.h> | |
84aff7a4 | 5 | #include <TEveGedEditor.h> |
ee0e160c | 6 | |
7 | #include <TVirtualPad.h> | |
8 | #include <TColor.h> | |
9 | ||
10 | #include <TGLabel.h> | |
32e219c2 | 11 | #include <TG3DLine.h> |
ee0e160c | 12 | #include <TGButton.h> |
13 | #include <TGNumberEntry.h> | |
14 | #include <TGColorSelect.h> | |
15 | #include <TGDoubleSlider.h> | |
16 | ||
f0314e4e | 17 | #include <TCanvas.h> |
18 | #include <TGLViewer.h> | |
84aff7a4 | 19 | #include <TEveManager.h> |
f0314e4e | 20 | |
21 | ||
22 | #include <TH1F.h> | |
ee0e160c | 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), | |
32e219c2 | 35 | fInfoFrame(0), |
f0314e4e | 36 | fInfoLabel0(0), |
37 | fInfoLabel1(0), | |
38 | fInfoLabel2(0), | |
39 | fInfoLabel3(0), | |
40 | fInfoLabel4(0), | |
41 | fInfoLabel5(0) | |
ee0e160c | 42 | // Initialize widget pointers to 0 |
43 | { | |
44 | MakeTitle("PMDModule"); | |
45 | ||
32e219c2 | 46 | CreateInfoFrame(); |
47 | } | |
48 | ||
49 | void PMDModuleEditor::CreateInfoFrame() | |
50 | { | |
51 | fInfoFrame = CreateEditorTabSubFrame("Info"); | |
f0314e4e | 52 | |
32e219c2 | 53 | TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10, |
54 | kHorizontalFrame | | |
55 | kLHintsExpandX | | |
56 | kFixedWidth | | |
57 | kOwnBackground); | |
ee0e160c | 58 | |
32e219c2 | 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); | |
f0314e4e | 68 | fInfoLabel0->SetTextJustify(kTextLeft); |
32e219c2 | 69 | fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 70 | 8, 0, 2, 0)); |
71 | ||
32e219c2 | 72 | fInfoLabel1 = new TGLabel(fInfoFrame); |
f0314e4e | 73 | fInfoLabel1->SetTextJustify(kTextLeft); |
32e219c2 | 74 | fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 75 | 8, 0, 2, 0)); |
76 | ||
32e219c2 | 77 | fInfoLabel2 = new TGLabel(fInfoFrame); |
f0314e4e | 78 | fInfoLabel2->SetTextJustify(kTextLeft); |
32e219c2 | 79 | fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
ee0e160c | 80 | 8, 0, 2, 0)); |
f0314e4e | 81 | |
32e219c2 | 82 | fInfoLabel3 = new TGLabel(fInfoFrame); |
f0314e4e | 83 | fInfoLabel3->SetTextJustify(kTextLeft); |
32e219c2 | 84 | fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 85 | 8, 0, 2, 0)); |
86 | ||
32e219c2 | 87 | fInfoLabel4 = new TGLabel(fInfoFrame); |
f0314e4e | 88 | fInfoLabel4->SetTextJustify(kTextLeft); |
32e219c2 | 89 | fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 90 | 8, 0, 2, 0)); |
91 | ||
32e219c2 | 92 | fInfoLabel5 = new TGLabel(fInfoFrame); |
f0314e4e | 93 | fInfoLabel5->SetTextJustify(kTextLeft); |
32e219c2 | 94 | fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 95 | 8, 0, 2, 0)); |
96 | ||
97 | ||
98 | { | |
32e219c2 | 99 | TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth); |
f0314e4e | 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 | ||
32e219c2 | 112 | fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0)); |
f0314e4e | 113 | } |
ee0e160c | 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 | |
f0314e4e | 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(); | |
ee0e160c | 140 | } |