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()
60 // Default constructor
63 for (Int_t i = 0; i < 4; i++) {
69 //strncpy(fFileName,"",256);
73 //////////////////////////////////////////////////////////////////////////////////
75 AliTRDqaGuiClustersSM::AliTRDqaGuiClustersSM(TGWindow *parent)
76 : TGCompositeFrame(parent, 720, 500),
94 SetLayoutManager(new TGVerticalLayout(this));
96 fGPanel = new TGHorizontalFrame(this);
98 // fGLabel = new TGLabel(fGPanel, "Current SM: ");
99 fGPrev = new TGTextButton(fGPanel, "Prev SM");
100 fGNext = new TGTextButton(fGPanel, "Next SM");
102 fGSelect = new TGComboBox(fGPanel);
103 for(int i=0; i<18; i++) fGSelect->AddEntry(Form("SM %d", i), i);
104 fGSelect->Resize(100, (Int_t)(1.4*fGPrev->GetHeight()));
105 fGSelect->Select(fIdx);
107 fGPlay = new TGTextButton(fGPanel, "PLAY");
109 TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
111 // fGPanel->AddFrame(fGLabel, hint);
112 fGPanel->AddFrame(fGPrev, hint);
113 fGPanel->AddFrame(fGSelect, hint);
114 fGPanel->AddFrame(fGNext, hint);
115 fGPanel->AddFrame(fGPlay, hint);
120 fGPrev->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "PreviusSM()");
121 fGNext->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "NextSM()");
122 fGSelect->Connect("Selected(Int_t", "AliTRDqaGuiClustersSM", this, "SelectSM(Int_t)");
123 fGPlay->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "Play()");
127 fGCanvas = new TGCompositeFrame(this);
128 fGCanvas->SetLayoutManager(new TGMatrixLayout(fGCanvas,2,2,1,1));
130 fNameList[0] = "sigTimeShape";
131 fNameList[1] = "sigTime";
132 fNameList[2] = "totalCharge";
133 fNameList[3] = "nCls";
135 for(Int_t i=0; i<4; i++) {
136 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], fGCanvas, 480, 300);
137 fGCanvas->AddFrame(fCanvasList[i]);
138 fCanvasList[i]->GetCanvas()->SetRightMargin(0.05);
141 for(Int_t i=0; i<4; i++) {
149 //////////////////////////////////////////////////////////////////////////////////
151 void AliTRDqaGuiClustersSM::SetQAFile(const char *filename) {
153 // Ste file with histograms
156 //strncpy(fFileName,filename,256);
157 fFileName = filename;
159 for(Int_t i=0; i<4; i++) {
160 if (fHistList[i]) delete fHistList[i];
163 TFile *file = new TFile(filename);
164 file->cd("TRD/RecPoints");
166 const char *opt[4] = {"", "colz", "", ""};
168 for(int i=0; i<4; i++) {
169 fHistList[i] = (TH1D*)gDirectory->Get(Form("qaTRD_recPoints_%s_sm%d", fNameList[i], fIdx));
170 fCanvasList[i]->GetCanvas()->cd();
171 gPad->SetLogy(fgkLogList[i]);
172 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
173 fCanvasList[i]->GetCanvas()->Update();
177 //////////////////////////////////////////////////////////////////////////////////
179 void AliTRDqaGuiClustersSM::SetSM(Int_t idx) {
181 // Sets active supermodule
185 fGSelect->Select(fIdx, 0);
186 SetQAFile(fFileName);
189 //////////////////////////////////////////////////////////////////////////////////
191 void AliTRDqaGuiClustersSM::Play() {
193 // Loop throught suermodules
197 for(Int_t i=0; i<18; i++) {
198 gSystem->Sleep(1 * 1000);
203 //////////////////////////////////////////////////////////////////////////////////