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 "AliTRDqaGuiJPsi.h"
35 #include "TGComboBox.h"
37 #include "TRootEmbeddedCanvas.h"
39 ClassImp(AliTRDqaGuiJPsi)
41 //////////////////////////////////////////////////////////////////////////////////
43 AliTRDqaGuiJPsi::AliTRDqaGuiJPsi()
53 // Default constructor
56 for (Int_t i = 0; i < 6; i++) {
62 //strncpy(fFileName,"",256);
66 //////////////////////////////////////////////////////////////////////////////////
68 AliTRDqaGuiJPsi::AliTRDqaGuiJPsi(TGWindow *parent)
69 : TGCompositeFrame(parent, 720, 500),
86 SetLayoutManager(new TGVerticalLayout(this));
88 fGPanel = new TGHorizontalFrame(this);
90 // fGLabel = new TGLabel(fGPanel, "Current Step: ");
91 fGPrev = new TGTextButton(fGPanel, "Prev Step");
92 fGNext = new TGTextButton(fGPanel, "Next Step");
94 fGSelect = new TGComboBox(fGPanel);
95 for(int i=0; i<5; i++) fGSelect->AddEntry(Form("Step %d", i), i);
96 fGSelect->Resize(100, fGPrev->GetHeight());
97 fGSelect->Select(fIdx);
99 TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
101 // fGPanel->AddFrame(fGLabel, hint);
102 fGPanel->AddFrame(fGPrev, hint);
103 fGPanel->AddFrame(fGSelect, hint);
104 fGPanel->AddFrame(fGNext, hint);
109 fGPrev->Connect("Clicked()", "AliTRDqaGuiJPsi", this, "PreviusStep()");
110 fGNext->Connect("Clicked()", "AliTRDqaGuiJPsi", this, "NextStep()");
111 fGSelect->Connect("Selected(Int_t", "AliTRDqaGuiJPsi", this, "SelectStep(Int_t)");
115 fGCanvas = new TGCompositeFrame(this);
116 fGCanvas->SetLayoutManager(new TGMatrixLayout(fGCanvas,2,3,1,1));
118 fNameList[0] = "mass";
119 fNameList[1] = "nTracksNeg";
120 fNameList[2] = "ptNeg";
121 fNameList[3] = "pidNeg";
122 //fNameList[3] = "ptAngle";
123 fNameList[4] = "nTracksPos";
124 fNameList[5] = "ptPos";
126 for(Int_t i=0; i<6; i++) {
127 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], fGCanvas, 320, 300);
128 fGCanvas->AddFrame(fCanvasList[i]);
129 fCanvasList[i]->GetCanvas()->SetRightMargin(0.05);
132 for(Int_t i=0; i<4; i++) {
140 //////////////////////////////////////////////////////////////////////////////////
142 void AliTRDqaGuiJPsi::SetQAFile(const char *filename) {
144 // Ste file with histograms
147 //strncpy(fFileName,filename,256);
148 fFileName = filename;
150 for(Int_t i=0; i<6; i++) {
151 if (fHistList[i]) delete fHistList[i];
154 const Int_t logy[6] = {0, 1, 1, 1, 1, 1};
155 const Int_t logz[6] = {0, 0, 0, 1, 0, 0};
156 const char *opt[6] = {"", "", "", "", "", ""};
158 TFile *file = new TFile(filename);
160 for(Int_t i=0; i<6; i++) {
161 fHistList[i] = (TH1D*)gDirectory->Get(Form("%s_%d", fNameList[i], fIdx));
162 if (fHistList[i]) fHistList[i]->SetDirectory(0);
163 fCanvasList[i]->GetCanvas()->cd();
164 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
165 gPad->SetLogy(logy[i]);
166 gPad->SetLogz(logz[i]);
167 fCanvasList[i]->GetCanvas()->Update();
174 //////////////////////////////////////////////////////////////////////////////////
176 void AliTRDqaGuiJPsi::SetStep(Int_t idx) {
178 // Sets active supermodule
182 fGSelect->Select(fIdx, 0);
183 SetQAFile(fFileName);
186 //////////////////////////////////////////////////////////////////////////////////