]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEvePMDModuleEditor.cxx
Changes in order to modify also ITSonly tracks
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEvePMDModuleEditor.cxx
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
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 <EveDet/AliEvePMDModule.h>
12
13 #include <TVirtualPad.h>
14 #include <TH1F.h>
15
16 #include <TGLabel.h>
17 #include <TG3DLine.h>
18 #include <TGButton.h>
19
20 //==============================================================================
21 //==============================================================================
22 // AliEvePMDModuleEditor
23 //==============================================================================
24
25 //______________________________________________________________________________
26 //
27 // GUI editor for AliEvePMDModule.
28
29 ClassImp(AliEvePMDModuleEditor)
30
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),
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 {
43   // Constructor.
44
45   MakeTitle("AliEvePMDModule");
46
47   CreateInfoFrame();
48 }
49
50 void AliEvePMDModuleEditor::CreateInfoFrame()
51 {
52   // Create frame holding information.
53
54   fInfoFrame = CreateEditorTabSubFrame("Info");
55
56   TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
57                                                   kHorizontalFrame |
58                                                   kLHintsExpandX   |
59                                                   kFixedWidth      |
60                                                   kOwnBackground);
61
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));
67
68   Int_t labelW = 67;
69
70   fInfoLabel0 = new TGLabel(fInfoFrame);
71   fInfoLabel0->SetTextJustify(kTextLeft);
72   fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
73                                          8, 0, 2, 0));
74
75   fInfoLabel1 = new TGLabel(fInfoFrame);
76   fInfoLabel1->SetTextJustify(kTextLeft);
77   fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
78                                          8, 0, 2, 0));
79
80   fInfoLabel2 = new TGLabel(fInfoFrame);
81   fInfoLabel2->SetTextJustify(kTextLeft);
82   fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
83                                          8, 0, 2, 0));
84
85   fInfoLabel3 = new TGLabel(fInfoFrame);
86   fInfoLabel3->SetTextJustify(kTextLeft);
87   fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
88                                          8, 0, 2, 0));
89
90   fInfoLabel4 = new TGLabel(fInfoFrame);
91   fInfoLabel4->SetTextJustify(kTextLeft);
92   fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
93                                          8, 0, 2, 0));
94
95   fInfoLabel5 = new TGLabel(fInfoFrame);
96   fInfoLabel5->SetTextJustify(kTextLeft);
97   fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
98                                          8, 0, 2, 0));
99
100
101   {
102     TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth);
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));
113     b->Connect("Clicked()", "AliEvePMDModuleEditor", this, "DisplayHistos()");
114
115     fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
116   }
117 }
118
119 /******************************************************************************/
120
121 void AliEvePMDModuleEditor::SetModel(TObject* obj)
122 {
123   // Set model object.
124
125   fM = dynamic_cast<AliEvePMDModule*>(obj);
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 AliEvePMDModuleEditor::DisplayHistos()
136 {
137   // Slot for displaying histograms with module data.
138
139   fM->GetHisto()->Draw();
140   gPad->Modified();
141   gPad->Update();
142 }