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()
52 // Default constructor
55 for (Int_t i = 0; i < 6; i++) {
61 strncpy(fFileName,"",256);
65 //////////////////////////////////////////////////////////////////////////////////
67 AliTRDqaGuiEnergyDeposit::AliTRDqaGuiEnergyDeposit(TGWindow *parent)
68 : TGCompositeFrame(parent, 720, 500),
84 SetLayoutManager(new TGVerticalLayout(this));
86 fGPanel = new TGHorizontalFrame(this);
88 // fGLabel = new TGLabel(fGPanel, "Current Type: ");
89 fGPrev = new TGTextButton(fGPanel, "Prev Type");
90 fGNext = new TGTextButton(fGPanel, "Next Type");
92 const char *types[5] = {"electron", "muon", "pion", "kaon", "proton"};
93 fGSelect = new TGComboBox(fGPanel);
94 for(int i=0; i<5; i++) fGSelect->AddEntry(types[i], i); //Form("Type %d", i), i);
95 fGSelect->Resize(100, fGPrev->GetHeight());
96 fGSelect->Select(fIdx);
98 TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
100 // fGPanel->AddFrame(fGLabel, hint);
101 fGPanel->AddFrame(fGPrev, hint);
102 fGPanel->AddFrame(fGSelect, hint);
103 fGPanel->AddFrame(fGNext, hint);
108 fGPrev->Connect("Clicked()", "AliTRDqaGuiEnergyDeposit", this, "PreviusType()");
109 fGNext->Connect("Clicked()", "AliTRDqaGuiEnergyDeposit", this, "NextType()");
110 fGSelect->Connect("Selected(Int_t", "AliTRDqaGuiEnergyDeposit", this, "SelectType(Int_t)");
114 fGCanvas = new TGCompositeFrame(this);
115 fGCanvas->SetLayoutManager(new TGMatrixLayout(fGCanvas,2,3,1,1));
117 fNameList[0] = "probNeg";
118 fNameList[1] = "ptSigNeg";
119 fNameList[2] = "ptSigPureNeg";
120 fNameList[3] = "probPos";
121 fNameList[4] = "ptSigPos";
122 fNameList[5] = "ptSigPurePos";
124 for(Int_t i=0; i<6; i++) {
125 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], fGCanvas, 320, 300);
126 fGCanvas->AddFrame(fCanvasList[i]);
127 fCanvasList[i]->GetCanvas()->SetRightMargin(0.05);
130 for(Int_t i=0; i<4; i++) {
138 //////////////////////////////////////////////////////////////////////////////////
140 void AliTRDqaGuiEnergyDeposit::SetQAFile(const char *filename) {
142 // Ste file with histograms
145 strncpy(fFileName,filename,256);
147 for(Int_t i=0; i<6; i++) {
148 if (fHistList[i]) delete fHistList[i];
151 const Int_t logy[] = {1, 0, 0, 1, 0, 0};
152 const Int_t logx[] = {0, 1, 1, 0, 1, 1};
153 const char *opt[] = {"", "colz", "colz", "", "colz", "cloz"};
155 TFile *file = new TFile(filename);
157 for(Int_t i=0; i<6; i++) {
158 fHistList[i] = (TH1D*)gDirectory->Get(Form("%s%d", fNameList[i], fIdx));
159 if (fHistList[i]) fHistList[i]->SetDirectory(0);
160 fCanvasList[i]->GetCanvas()->cd();
161 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
162 gPad->SetLogy(logy[i]);
163 gPad->SetLogx(logx[i]);
164 fCanvasList[i]->GetCanvas()->Update();
172 //////////////////////////////////////////////////////////////////////////////////
174 void AliTRDqaGuiEnergyDeposit::SetType(Int_t idx) {
176 // Sets active supermodule
180 fGSelect->Select(fIdx, 0);
181 SetQAFile(fFileName);
184 //////////////////////////////////////////////////////////////////////////////////