]>
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 * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
9 | ||
10 | #include "AliEvePMDModuleEditor.h" | |
cb4245bb | 11 | #include <EveDet/AliEvePMDModule.h> |
ee0e160c | 12 | |
13 | #include <TVirtualPad.h> | |
a15e6d7d | 14 | #include <TH1F.h> |
ee0e160c | 15 | |
16 | #include <TGLabel.h> | |
32e219c2 | 17 | #include <TG3DLine.h> |
ee0e160c | 18 | #include <TGButton.h> |
d810d0de | 19 | |
a15e6d7d | 20 | //============================================================================== |
21 | //============================================================================== | |
22 | // AliEvePMDModuleEditor | |
23 | //============================================================================== | |
ee0e160c | 24 | |
57ffa5fb | 25 | //______________________________________________________________________________ |
ee0e160c | 26 | // |
a15e6d7d | 27 | // GUI editor for AliEvePMDModule. |
ee0e160c | 28 | |
d810d0de | 29 | ClassImp(AliEvePMDModuleEditor) |
ee0e160c | 30 | |
d810d0de | 31 | AliEvePMDModuleEditor::AliEvePMDModuleEditor(const TGWindow *p, Int_t width, Int_t height, |
a15e6d7d | 32 | UInt_t options, Pixel_t back) : |
ee0e160c | 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 | { |
a15e6d7d | 43 | // Constructor. |
44 | ||
d810d0de | 45 | MakeTitle("AliEvePMDModule"); |
ee0e160c | 46 | |
32e219c2 | 47 | CreateInfoFrame(); |
48 | } | |
49 | ||
d810d0de | 50 | void AliEvePMDModuleEditor::CreateInfoFrame() |
32e219c2 | 51 | { |
a15e6d7d | 52 | // Create frame holding information. |
53 | ||
32e219c2 | 54 | fInfoFrame = CreateEditorTabSubFrame("Info"); |
f0314e4e | 55 | |
51346b82 | 56 | TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10, |
57 | kHorizontalFrame | | |
58 | kLHintsExpandX | | |
59 | kFixedWidth | | |
32e219c2 | 60 | kOwnBackground); |
ee0e160c | 61 | |
51346b82 | 62 | title1->AddFrame(new TGLabel(title1, "AliEvePMDModule Info"), |
32e219c2 | 63 | new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0)); |
64 | title1->AddFrame(new TGHorizontal3DLine(title1), | |
65 | new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7)); | |
66 | fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0)); | |
67 | ||
68 | Int_t labelW = 67; | |
69 | ||
70 | fInfoLabel0 = new TGLabel(fInfoFrame); | |
f0314e4e | 71 | fInfoLabel0->SetTextJustify(kTextLeft); |
32e219c2 | 72 | fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 73 | 8, 0, 2, 0)); |
74 | ||
32e219c2 | 75 | fInfoLabel1 = new TGLabel(fInfoFrame); |
f0314e4e | 76 | fInfoLabel1->SetTextJustify(kTextLeft); |
32e219c2 | 77 | fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 78 | 8, 0, 2, 0)); |
79 | ||
32e219c2 | 80 | fInfoLabel2 = new TGLabel(fInfoFrame); |
f0314e4e | 81 | fInfoLabel2->SetTextJustify(kTextLeft); |
32e219c2 | 82 | fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
ee0e160c | 83 | 8, 0, 2, 0)); |
f0314e4e | 84 | |
32e219c2 | 85 | fInfoLabel3 = new TGLabel(fInfoFrame); |
f0314e4e | 86 | fInfoLabel3->SetTextJustify(kTextLeft); |
32e219c2 | 87 | fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 88 | 8, 0, 2, 0)); |
89 | ||
32e219c2 | 90 | fInfoLabel4 = new TGLabel(fInfoFrame); |
f0314e4e | 91 | fInfoLabel4->SetTextJustify(kTextLeft); |
32e219c2 | 92 | fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 93 | 8, 0, 2, 0)); |
94 | ||
32e219c2 | 95 | fInfoLabel5 = new TGLabel(fInfoFrame); |
f0314e4e | 96 | fInfoLabel5->SetTextJustify(kTextLeft); |
32e219c2 | 97 | fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, |
f0314e4e | 98 | 8, 0, 2, 0)); |
99 | ||
100 | ||
101 | { | |
32e219c2 | 102 | TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth); |
f0314e4e | 103 | |
104 | TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth); | |
105 | TGLabel* l = new TGLabel(g, "Histos:"); | |
106 | g->AddFrame(l, new TGLayoutHints(kLHintsLeft, 0,0,4,0)); | |
107 | f->AddFrame(g); | |
108 | ||
109 | TGTextButton* b; | |
110 | ||
111 | b = new TGTextButton(f, "Show"); | |
112 | f->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0)); | |
d810d0de | 113 | b->Connect("Clicked()", "AliEvePMDModuleEditor", this, "DisplayHistos()"); |
f0314e4e | 114 | |
32e219c2 | 115 | fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0)); |
f0314e4e | 116 | } |
ee0e160c | 117 | } |
118 | ||
57ffa5fb | 119 | /******************************************************************************/ |
ee0e160c | 120 | |
d810d0de | 121 | void AliEvePMDModuleEditor::SetModel(TObject* obj) |
ee0e160c | 122 | { |
a15e6d7d | 123 | // Set model object. |
ee0e160c | 124 | |
55096923 | 125 | fM = static_cast<AliEvePMDModule*>(obj); |
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 | ||
d810d0de | 135 | void AliEvePMDModuleEditor::DisplayHistos() |
f0314e4e | 136 | { |
a15e6d7d | 137 | // Slot for displaying histograms with module data. |
138 | ||
f0314e4e | 139 | fM->GetHisto()->Draw(); |
140 | gPad->Modified(); | |
141 | gPad->Update(); | |
ee0e160c | 142 | } |