1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //////////////////////////////////////////////////////////////////////////////////
18 // This class is a Graphical User Interface for the Quality Monitorig
24 //////////////////////////////////////////////////////////////////////////////////
26 #include "AliTRDqaGuiEnergyDeposit.h"
35 #include "TGComboBox.h"
37 #include "TRootEmbeddedCanvas.h"
39 ClassImp(AliTRDqaGuiEnergyDeposit)
41 //////////////////////////////////////////////////////////////////////////////////
43 AliTRDqaGuiEnergyDeposit::AliTRDqaGuiEnergyDeposit()
54 //////////////////////////////////////////////////////////////////////////////////
56 AliTRDqaGuiEnergyDeposit::AliTRDqaGuiEnergyDeposit(TGWindow *parent)
57 : TGCompositeFrame(parent, 720, 500),
73 SetLayoutManager(new TGVerticalLayout(this));
75 fGPanel = new TGHorizontalFrame(this);
77 // fGLabel = new TGLabel(fGPanel, "Current Type: ");
78 fGPrev = new TGTextButton(fGPanel, "Prev Type");
79 fGNext = new TGTextButton(fGPanel, "Next Type");
81 const char *types[5] = {"electron", "muon", "pion", "kaon", "proton"};
82 fGSelect = new TGComboBox(fGPanel);
83 for(int i=0; i<5; i++) fGSelect->AddEntry(types[i], i); //Form("Type %d", i), i);
84 fGSelect->Resize(100, fGPrev->GetHeight());
85 fGSelect->Select(fIdx);
87 TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
89 // fGPanel->AddFrame(fGLabel, hint);
90 fGPanel->AddFrame(fGPrev, hint);
91 fGPanel->AddFrame(fGSelect, hint);
92 fGPanel->AddFrame(fGNext, hint);
97 fGPrev->Connect("Clicked()", "AliTRDqaGuiEnergyDeposit", this, "PreviusType()");
98 fGNext->Connect("Clicked()", "AliTRDqaGuiEnergyDeposit", this, "NextType()");
99 fGSelect->Connect("Selected(Int_t", "AliTRDqaGuiEnergyDeposit", this, "SelectType(Int_t)");
103 fGCanvas = new TGCompositeFrame(this);
104 fGCanvas->SetLayoutManager(new TGMatrixLayout(fGCanvas,2,3,1,1));
106 fNameList[0] = "probNeg";
107 fNameList[1] = "ptSigNeg";
108 fNameList[2] = "ptSigPureNeg";
109 fNameList[3] = "probPos";
110 fNameList[4] = "ptSigPos";
111 fNameList[5] = "ptSigPurePos";
113 for(Int_t i=0; i<6; i++) {
114 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], fGCanvas, 320, 300);
115 fGCanvas->AddFrame(fCanvasList[i]);
116 fCanvasList[i]->GetCanvas()->SetRightMargin(0.05);
119 for(Int_t i=0; i<4; i++) {
127 //////////////////////////////////////////////////////////////////////////////////
129 void AliTRDqaGuiEnergyDeposit::SetQAFile(const char *filename) {
131 // Ste file with histograms
134 strcpy(fFileName, filename);
136 for(Int_t i=0; i<6; i++) {
137 if (fHistList[i]) delete fHistList[i];
140 const Int_t logy[] = {1, 0, 0, 1, 0, 0};
141 const Int_t logx[] = {0, 1, 1, 0, 1, 1};
142 const char *opt[] = {"", "colz", "colz", "", "colz", "cloz"};
144 TFile *file = new TFile(filename);
146 for(Int_t i=0; i<6; i++) {
147 fHistList[i] = (TH1D*)gDirectory->Get(Form("%s%d", fNameList[i], fIdx));
148 if (fHistList[i]) fHistList[i]->SetDirectory(0);
149 fCanvasList[i]->GetCanvas()->cd();
150 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
151 gPad->SetLogy(logy[i]);
152 gPad->SetLogx(logx[i]);
153 fCanvasList[i]->GetCanvas()->Update();
161 //////////////////////////////////////////////////////////////////////////////////
163 void AliTRDqaGuiEnergyDeposit::SetType(Int_t idx) {
165 // Sets active supermodule
169 fGSelect->Select(fIdx, 0);
170 SetQAFile(fFileName);
173 //////////////////////////////////////////////////////////////////////////////////