]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/qaGui/AliTRDqaGuiBlackGTU.cxx
SVN keyword Id is set
[u/mrichter/AliRoot.git] / TRD / qaGui / AliTRDqaGuiBlackGTU.cxx
CommitLineData
6a9add6f 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id: AliTRDqaGuiBlackGTU.cxx 23387 2008-01-17 17:25:16Z cblume $ */
17
18//////////////////////////////////////////////////////////////////////////////////
19//
20// This class is a Graphical User Interface for the Quality Monitorig
21// of black (non zero zuppresed) events from TRD.
22// It lets display and browse throu histograms created by the class
23// AliTRDqaBlackEvents.
24// The class works in cooperation with AliTRDqaGuiMainBlack.
25//
26// S. Radomski
27// Uni-Heidelberg
28// June 2008
29//
30//////////////////////////////////////////////////////////////////////////////////
31
32#include "AliTRDqaGuiBlackGTU.h"
33
34#include "TH1D.h"
35#include "TGraph.h"
36#include "TFile.h"
37#include "TCanvas.h"
38#include "TString.h"
39#include "TSystem.h"
40#include "TGaxis.h"
41
42#include "TRootEmbeddedCanvas.h"
43
44ClassImp(AliTRDqaGuiBlackGTU)
45
46//////////////////////////////////////////////////////////////////////////////////
47
48AliTRDqaGuiBlackGTU::AliTRDqaGuiBlackGTU()
49{
50 //
51 // Default constructor
52 //
53
54}
55
56//////////////////////////////////////////////////////////////////////////////////
57
58AliTRDqaGuiBlackGTU::AliTRDqaGuiBlackGTU(TGWindow *parent)
59 : TGCompositeFrame(parent, 720, 500)
60{
61 //
62 // Main constructor
63 //
64
65 SetLayoutManager(new TGMatrixLayout(this,2,3,0,0));
66
67 for(Int_t i=0; i<6; i++) {
68 fCanvasList[i] = new TRootEmbeddedCanvas(Form("pos_%d", i), this, 330, 350);
69 AddFrame(fCanvasList[i]);
70 }
71
72 for(Int_t i=0; i<3; i++) {
73 fHistList[i] = 0;
74 fGraphList[i] = 0;
75 }
76}
77
78//////////////////////////////////////////////////////////////////////////////////
79
80void AliTRDqaGuiBlackGTU::SetQAFile(const char *filename) {
81 //
82 // Set the file with histograms
83 //
84
85 // printf("GTU status \n");
86
87 TGaxis::SetMaxDigits(3);
88
89 const char *names[6] = {
90 "smLink", "smBeaf", "smData",
91 "grSmLink", "grSmBeaf", "grSmData"
92 };
93
94 const char *title[6] = {
95 "connected half-chambers;super-module;half chamber",
96 "beaf-beaf half-chambers;super-module;half chamber",
97 "half-chambers with data;super-module;half chamber",
98
99 "connected half-chambers;event number",
100 "beaf-beaf half-chambers;event number",
101 "half-chambers with data;event number",
102 };
103
104
105 strcpy(fFileName,filename);
106
107 for(int i=0; i<3; i++) {
108
109 if (fHistList[i]) delete fHistList[i];
110 if (fGraphList[i]) delete fGraphList[i];
111
112 fHistList[i] = 0;
113 fGraphList[i] = 0;
114 }
115
116 TFile *file = new TFile(filename);
117
118 for(Int_t i=0; i<3; i++) {
119
120 //printf("name = %s\n", names[i]);
121 fHistList[i] = (TH1D*)file->Get(names[i]);
122 // if (fHistList[i]) fHistList[i]->Print();
123
124 if (fHistList[i]) {
125
126 fCanvasList[i]->GetCanvas()->cd();
127 fHistList[i]->SetTitle(title[i]);
128 fHistList[i]->Draw("colz");
129
130 // draw lines
131 for(Int_t stx=1; stx < 5; stx++) {
132 TLine *line = new TLine(-0.5, stx*12-0.5, 17.5, stx*12-0.5);
133 line->Draw();
134 }
135 }
136
137 fGraphList[i] = (TGraph*)file->Get(names[i+3]);
138 if (fGraphList[i]) {
139 fCanvasList[i+3]->GetCanvas()->cd();
140 fGraphList[i]->Draw("apl");
141 fGraphList[i]->GetHistogram()->SetTitle(title[i+3]);
142 fGraphList[i]->SetMinimum(0);
143 fGraphList[i]->SetMaximum(250);
144 fGraphList[i]->SetMarkerStyle(7);
145 }
146 }
147
148 // file->Close();
149}
150
151//////////////////////////////////////////////////////////////////////////////////