]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
ee0e160c | 3 | |
d810d0de | 4 | /************************************************************************** |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
7 | * full copyright notice. * | |
8 | **************************************************************************/ | |
9 | ||
10 | #include "AliEvePMDModuleEditor.h" | |
11 | #include <Alieve/AliEvePMDModule.h> | |
84aff7a4 | 12 | #include <TEveGedEditor.h> |
ee0e160c | 13 | |
14 | #include <TVirtualPad.h> | |
15 | #include <TColor.h> | |
16 | ||
17 | #include <TGLabel.h> | |
32e219c2 | 18 | #include <TG3DLine.h> |
ee0e160c | 19 | #include <TGButton.h> |
20 | #include <TGNumberEntry.h> | |
21 | #include <TGColorSelect.h> | |
22 | #include <TGDoubleSlider.h> | |
23 | ||
f0314e4e | 24 | #include <TCanvas.h> |
25 | #include <TGLViewer.h> | |
84aff7a4 | 26 | #include <TEveManager.h> |
f0314e4e | 27 | |
28 | ||
29 | #include <TH1F.h> | |
d810d0de | 30 | |
ee0e160c | 31 | |
32 | //______________________________________________________________________ | |
d810d0de | 33 | // AliEvePMDModuleEditor |
ee0e160c | 34 | // |
35 | ||
d810d0de | 36 | ClassImp(AliEvePMDModuleEditor) |
ee0e160c | 37 | |
d810d0de | 38 | AliEvePMDModuleEditor::AliEvePMDModuleEditor(const TGWindow *p, Int_t width, Int_t height, |
ee0e160c | 39 | UInt_t options, Pixel_t back) : |
40 | TGedFrame(p, width, height, options | kVerticalFrame, back), | |
41 | fM(0), | |
32e219c2 | 42 | fInfoFrame(0), |
f0314e4e | 43 | fInfoLabel0(0), |
44 | fInfoLabel1(0), | |
45 | fInfoLabel2(0), | |
46 | fInfoLabel3(0), | |
47 | fInfoLabel4(0), | |
48 | fInfoLabel5(0) | |
ee0e160c | 49 | // Initialize widget pointers to 0 |
50 | { | |
d810d0de | 51 | MakeTitle("AliEvePMDModule"); |
ee0e160c | 52 | |
32e219c2 | 53 | CreateInfoFrame(); |
54 | } | |
55 | ||
d810d0de | 56 | void AliEvePMDModuleEditor::CreateInfoFrame() |
32e219c2 | 57 | { |
58 | fInfoFrame = CreateEditorTabSubFrame("Info"); | |
f0314e4e | 59 | |
32e219c2 | 60 | TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10, |
61 | kHorizontalFrame | | |
62 | kLHintsExpandX | | |
63 | kFixedWidth | | |
64 | kOwnBackground); | |
ee0e160c | 65 | |
d810d0de | 66 | title1->AddFrame(new TGLabel(title1, "AliEvePMDModule Info"), |
32e219c2 | 67 | new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0)); |
68 | title1->AddFrame(new TGHorizontal3DLine(title1), | |
69 | new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7)); | |
70 | fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0)); | |
71 | ||
72 | Int_t labelW = 67; | |
73 | ||
74 | fInfoLabel0 = new TGLabel(fInfoFrame); | |
f0314e4e | 75 | fInfoLabel0->SetTextJustify(kTextLeft); |
32e219c2 | 76 | fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 77 | 8, 0, 2, 0)); |
78 | ||
32e219c2 | 79 | fInfoLabel1 = new TGLabel(fInfoFrame); |
f0314e4e | 80 | fInfoLabel1->SetTextJustify(kTextLeft); |
32e219c2 | 81 | fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 82 | 8, 0, 2, 0)); |
83 | ||
32e219c2 | 84 | fInfoLabel2 = new TGLabel(fInfoFrame); |
f0314e4e | 85 | fInfoLabel2->SetTextJustify(kTextLeft); |
32e219c2 | 86 | fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
ee0e160c | 87 | 8, 0, 2, 0)); |
f0314e4e | 88 | |
32e219c2 | 89 | fInfoLabel3 = new TGLabel(fInfoFrame); |
f0314e4e | 90 | fInfoLabel3->SetTextJustify(kTextLeft); |
32e219c2 | 91 | fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 92 | 8, 0, 2, 0)); |
93 | ||
32e219c2 | 94 | fInfoLabel4 = new TGLabel(fInfoFrame); |
f0314e4e | 95 | fInfoLabel4->SetTextJustify(kTextLeft); |
32e219c2 | 96 | fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 97 | 8, 0, 2, 0)); |
98 | ||
32e219c2 | 99 | fInfoLabel5 = new TGLabel(fInfoFrame); |
f0314e4e | 100 | fInfoLabel5->SetTextJustify(kTextLeft); |
32e219c2 | 101 | fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 102 | 8, 0, 2, 0)); |
103 | ||
104 | ||
105 | { | |
32e219c2 | 106 | TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth); |
f0314e4e | 107 | |
108 | TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth); | |
109 | TGLabel* l = new TGLabel(g, "Histos:"); | |
110 | g->AddFrame(l, new TGLayoutHints(kLHintsLeft, 0,0,4,0)); | |
111 | f->AddFrame(g); | |
112 | ||
113 | TGTextButton* b; | |
114 | ||
115 | b = new TGTextButton(f, "Show"); | |
116 | f->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0)); | |
d810d0de | 117 | b->Connect("Clicked()", "AliEvePMDModuleEditor", this, "DisplayHistos()"); |
f0314e4e | 118 | |
32e219c2 | 119 | fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0)); |
f0314e4e | 120 | } |
ee0e160c | 121 | } |
122 | ||
d810d0de | 123 | AliEvePMDModuleEditor::~AliEvePMDModuleEditor() |
ee0e160c | 124 | {} |
125 | ||
126 | /**************************************************************************/ | |
127 | ||
d810d0de | 128 | void AliEvePMDModuleEditor::SetModel(TObject* obj) |
ee0e160c | 129 | { |
d810d0de | 130 | fM = dynamic_cast<AliEvePMDModule*>(obj); |
ee0e160c | 131 | |
132 | // Set values of widgets | |
f0314e4e | 133 | |
134 | fInfoLabel0->SetText(Form("Cells hit per Module : %d", fM->GetNPads())); | |
135 | fInfoLabel1->SetText(Form("ADC per Module : %d", fM->GetAdc())); | |
136 | fInfoLabel2->SetText(Form("Tot Cells for PRE : %d", fM->GetPRETotPads())); | |
137 | fInfoLabel3->SetText(Form("Tot ADC for PRE : %d", fM->GetPRETotAdc())); | |
138 | fInfoLabel4->SetText(Form("Tot Cells for CPV : %d", fM->GetCPVTotPads())); | |
139 | fInfoLabel5->SetText(Form("Tot ADC for CPV : %d", fM->GetCPVTotAdc())); | |
140 | } | |
141 | ||
d810d0de | 142 | void AliEvePMDModuleEditor::DisplayHistos() |
f0314e4e | 143 | { |
144 | fM->GetHisto()->Draw(); | |
145 | gPad->Modified(); | |
146 | gPad->Update(); | |
ee0e160c | 147 | } |