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()
61 //////////////////////////////////////////////////////////////////////////////////
63 AliTRDqaGuiClustersSM::AliTRDqaGuiClustersSM(TGWindow *parent)
64 : TGCompositeFrame(parent, 720, 500),
81 SetLayoutManager(new TGVerticalLayout(this));
83 fGPanel = new TGHorizontalFrame(this);
85 // fGLabel = new TGLabel(fGPanel, "Current SM: ");
86 fGPrev = new TGTextButton(fGPanel, "Prev SM");
87 fGNext = new TGTextButton(fGPanel, "Next SM");
89 fGSelect = new TGComboBox(fGPanel);
90 for(int i=0; i<18; i++) fGSelect->AddEntry(Form("SM %d", i), i);
91 fGSelect->Resize(100, fGPrev->GetHeight());
92 fGSelect->Select(fIdx);
94 fGPlay = new TGTextButton(fGPanel, "PLAY");
96 TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
98 // fGPanel->AddFrame(fGLabel, hint);
99 fGPanel->AddFrame(fGPrev, hint);
100 fGPanel->AddFrame(fGSelect, hint);
101 fGPanel->AddFrame(fGNext, hint);
102 fGPanel->AddFrame(fGPlay, hint);
107 fGPrev->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "PreviusSM()");
108 fGNext->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "NextSM()");
109 fGSelect->Connect("Selected(Int_t", "AliTRDqaGuiClustersSM", this, "SelectSM(Int_t)");
110 fGPlay->Connect("Clicked()", "AliTRDqaGuiClustersSM", this, "Play()");
114 fGCanvas = new TGCompositeFrame(this);
115 fGCanvas->SetLayoutManager(new TGMatrixLayout(fGCanvas,2,2,1,1));
117 fNameList[0] = "sigTimeShape";
118 fNameList[1] = "sigTime";
119 fNameList[2] = "nCls";
120 fNameList[3] = "totalCharge";
122 for(Int_t i=0; i<4; i++) {
123 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], fGCanvas, 480, 300);
124 fGCanvas->AddFrame(fCanvasList[i]);
125 fCanvasList[i]->GetCanvas()->SetRightMargin(0.05);
128 for(Int_t i=0; i<4; i++) {
136 //////////////////////////////////////////////////////////////////////////////////
138 void AliTRDqaGuiClustersSM::SetQAFile(const char *filename) {
140 // Ste file with histograms
143 strcpy(fFileName, filename);
145 for(Int_t i=0; i<4; i++) {
146 if (fHistList[i]) delete fHistList[i];
149 TFile *file = new TFile(filename);
150 file->cd("TRD/RecPoints");
152 const char *opt[4] = {"", "colz", "", ""};
154 for(int i=0; i<4; i++) {
155 fHistList[i] = (TH1D*)gDirectory->Get(Form("qaTRD_recPoints_%s_sm%d", fNameList[i], fIdx));
156 fCanvasList[i]->GetCanvas()->cd();
157 gPad->SetLogy(fgkLogList[i]);
158 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
159 fCanvasList[i]->GetCanvas()->Update();
163 //////////////////////////////////////////////////////////////////////////////////
165 void AliTRDqaGuiClustersSM::SetSM(Int_t idx) {
167 // Sets active supermodule
171 fGSelect->Select(fIdx, 0);
172 SetQAFile(fFileName);
175 //////////////////////////////////////////////////////////////////////////////////
177 void AliTRDqaGuiClustersSM::Play() {
179 // Loop throught suermodules
183 for(Int_t i=0; i<18; i++) {
184 gSystem->Sleep(1 * 1000);
189 //////////////////////////////////////////////////////////////////////////////////