2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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 **************************************************************************/
10 #include "AliEvePMDModuleEditor.h"
11 #include <EveDet/AliEvePMDModule.h>
13 #include <TVirtualPad.h>
20 //==============================================================================
21 //==============================================================================
22 // AliEvePMDModuleEditor
23 //==============================================================================
25 //______________________________________________________________________________
27 // GUI editor for AliEvePMDModule.
29 ClassImp(AliEvePMDModuleEditor)
31 AliEvePMDModuleEditor::AliEvePMDModuleEditor(const TGWindow *p, Int_t width, Int_t height,
32 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
45 MakeTitle("AliEvePMDModule");
50 void AliEvePMDModuleEditor::CreateInfoFrame()
52 // Create frame holding information.
54 fInfoFrame = CreateEditorTabSubFrame("Info");
56 TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
62 title1->AddFrame(new TGLabel(title1, "AliEvePMDModule Info"),
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));
70 fInfoLabel0 = new TGLabel(fInfoFrame);
71 fInfoLabel0->SetTextJustify(kTextLeft);
72 fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
75 fInfoLabel1 = new TGLabel(fInfoFrame);
76 fInfoLabel1->SetTextJustify(kTextLeft);
77 fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
80 fInfoLabel2 = new TGLabel(fInfoFrame);
81 fInfoLabel2->SetTextJustify(kTextLeft);
82 fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
85 fInfoLabel3 = new TGLabel(fInfoFrame);
86 fInfoLabel3->SetTextJustify(kTextLeft);
87 fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
90 fInfoLabel4 = new TGLabel(fInfoFrame);
91 fInfoLabel4->SetTextJustify(kTextLeft);
92 fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
95 fInfoLabel5 = new TGLabel(fInfoFrame);
96 fInfoLabel5->SetTextJustify(kTextLeft);
97 fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
102 TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth);
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));
111 b = new TGTextButton(f, "Show");
112 f->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
113 b->Connect("Clicked()", "AliEvePMDModuleEditor", this, "DisplayHistos()");
115 fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
119 /******************************************************************************/
121 void AliEvePMDModuleEditor::SetModel(TObject* obj)
125 fM = dynamic_cast<AliEvePMDModule*>(obj);
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 AliEvePMDModuleEditor::DisplayHistos()
137 // Slot for displaying histograms with module data.
139 fM->GetHisto()->Draw();