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 /* $Id: AliTRDqaGuiClustersSM.cxx 23871 2008-02-12 11:48:20Z hristov $ */
18 //////////////////////////////////////////////////////////////////////////////////
20 // This class is a Graphical User Interface for the Quality Monitorig
21 // of clusters. It lets display and browse throu histograms created by
22 // the AliTRDQADataMakerRec run during the reconstruction
28 //////////////////////////////////////////////////////////////////////////////////
30 #include "AliTRDqaGuiClustersSM.h"
39 #include "TGComboBox.h"
41 #include "TRootEmbeddedCanvas.h"
43 ClassImp(AliTRDqaGuiClustersSM)
45 const Int_t AliTRDqaGuiClustersSM::fgkLogList[4] = {0,0,0,0};
47 //////////////////////////////////////////////////////////////////////////////////
49 AliTRDqaGuiClustersSM::AliTRDqaGuiClustersSM()
59 // Default constructor
62 for (Int_t i = 0; i < 4; i++) {
68 strncpy(fFileName,"",256);
72 //////////////////////////////////////////////////////////////////////////////////
74 AliTRDqaGuiClustersSM::AliTRDqaGuiClustersSM(TGWindow *parent)
75 : TGCompositeFrame(parent, 720, 500),
92 SetLayoutManager(new TGVerticalLayout(this));
94 fGPanel = new TGHorizontalFrame(this);
96 // fGLabel = new TGLabel(fGPanel, "Current SM: ");
97 fGPrev = new TGTextButton(fGPanel, "Prev SM");
98 fGNext = new TGTextButton(fGPanel, "Next SM");
100 fGSelect = new TGComboBox(fGPanel);
101 for(int i=0; i<18; i++) fGSelect->AddEntry(Form("SM %d", i), i);
102 fGSelect->Resize(100, (Int_t)(1.4*fGPrev->GetHeight()));
103 fGSelect->Select(fIdx);
105 fGPlay = new TGTextButton(fGPanel, "PLAY");
107 TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
109 // fGPanel->AddFrame(fGLabel, hint);
110 fGPanel->AddFrame(fGPrev, hint);
111 fGPanel->AddFrame(fGSelect, hint);
112 fGPanel->AddFrame(fGNext, hint);
113 fGPanel->AddFrame(fGPlay, hint);
118 fGPrev->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "PreviusSM()");
119 fGNext->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "NextSM()");
120 fGSelect->Connect("Selected(Int_t", "AliTRDqaGuiClustersSM", this, "SelectSM(Int_t)");
121 fGPlay->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "Play()");
125 fGCanvas = new TGCompositeFrame(this);
126 fGCanvas->SetLayoutManager(new TGMatrixLayout(fGCanvas,2,2,1,1));
128 fNameList[0] = "sigTimeShape";
129 fNameList[1] = "sigTime";
130 fNameList[2] = "totalCharge";
131 fNameList[3] = "nCls";
133 for(Int_t i=0; i<4; i++) {
134 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], fGCanvas, 480, 300);
135 fGCanvas->AddFrame(fCanvasList[i]);
136 fCanvasList[i]->GetCanvas()->SetRightMargin(0.05);
139 for(Int_t i=0; i<4; i++) {
147 //////////////////////////////////////////////////////////////////////////////////
149 void AliTRDqaGuiClustersSM::SetQAFile(const char *filename) {
151 // Ste file with histograms
154 strncpy(fFileName,filename,256);
156 for(Int_t i=0; i<4; i++) {
157 if (fHistList[i]) delete fHistList[i];
160 TFile *file = new TFile(filename);
161 file->cd("TRD/RecPoints");
163 const char *opt[4] = {"", "colz", "", ""};
165 for(int i=0; i<4; i++) {
166 fHistList[i] = (TH1D*)gDirectory->Get(Form("qaTRD_recPoints_%s_sm%d", fNameList[i], fIdx));
167 fCanvasList[i]->GetCanvas()->cd();
168 gPad->SetLogy(fgkLogList[i]);
169 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
170 fCanvasList[i]->GetCanvas()->Update();
174 //////////////////////////////////////////////////////////////////////////////////
176 void AliTRDqaGuiClustersSM::SetSM(Int_t idx) {
178 // Sets active supermodule
182 fGSelect->Select(fIdx, 0);
183 SetQAFile(fFileName);
186 //////////////////////////////////////////////////////////////////////////////////
188 void AliTRDqaGuiClustersSM::Play() {
190 // Loop throught suermodules
194 for(Int_t i=0; i<18; i++) {
195 gSystem->Sleep(1 * 1000);
200 //////////////////////////////////////////////////////////////////////////////////