]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/qaGui/AliTRDqaGuiBlackError.cxx
Added reading of ESDFriends for QA TPC task
[u/mrichter/AliRoot.git] / TRD / qaGui / AliTRDqaGuiBlackError.cxx
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: AliTRDqaGuiBlackError.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 "AliTRDqaGuiBlackError.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
44 ClassImp(AliTRDqaGuiBlackError)
45
46 //////////////////////////////////////////////////////////////////////////////////
47
48 AliTRDqaGuiBlackError::AliTRDqaGuiBlackError() 
49 {
50   //
51   // Default constructor
52   //
53
54 }
55
56 //////////////////////////////////////////////////////////////////////////////////
57
58 AliTRDqaGuiBlackError::AliTRDqaGuiBlackError(TGWindow *parent) 
59   : TGCompositeFrame(parent, 720, 500)
60 {
61   //
62   // Main constructor
63   //
64     
65   SetLayoutManager(new TGMatrixLayout(this,3,3,0,0));
66
67   for(Int_t i=0; i<9; i++) {
68     fCanvasList[i] = new TRootEmbeddedCanvas(Form("pos_%d", i), this, 333, 245);
69     AddFrame(fCanvasList[i]);
70   }
71   
72   for(Int_t i=0; i<3; i++) {
73     fHistList[i] = 0;
74     fGraphList[i] = 0;
75     fHistListSM[i] = 0;
76   }
77
78   //AddFrame(fGCanvas);
79   /**/
80 }
81
82 //////////////////////////////////////////////////////////////////////////////////
83
84 void AliTRDqaGuiBlackError::SetQAFile(const char *filename) {
85   //
86   // Set the file with histograms
87   //
88
89   TGaxis::SetMaxDigits(3);
90   
91   const char *names[9] = {
92     "errorHC", "errorMCM", "errorADC",
93     "trendErrorHC", "trendErrorMCM", "trendErrorADC",
94     "errorSM_HC", "errorSM_MCM", "errorSM_ADC"
95   };  
96
97   const char *title[9] = {
98     "half-chamber;HC error ID", "MCM;MCM error ID", "ADC;ADC error ID",
99     "fraction with HC error (%);event number",
100     "fraction with MCM error (%);event number",
101     "fraction with ADC error (%);event number",    
102     ";sm id;number of errors",
103     ";sm id;number of errors",
104     ";sm id;number of errors"
105   };
106
107
108   strcpy(fFileName,filename);
109  
110   for(int i=0; i<3; i++) {
111
112     if (fHistList[i]) delete fHistList[i];
113     if (fGraphList[i]) delete fGraphList[i];
114     if (fHistListSM[i]) delete fHistListSM[i];
115
116     fHistList[i] = 0;
117     fGraphList[i] = 0;
118     fHistListSM[i] = 0;
119   }
120   
121   TFile *file = new TFile(filename);
122   
123   for(Int_t i=0; i<3; i++) {
124
125     fHistList[i] = (TH1D*)file->Get(names[i]);
126     if (fHistList[i]) {
127       fCanvasList[i]->GetCanvas()->cd();
128       fCanvasList[i]->GetCanvas()->SetLogy(1);
129       
130       fHistList[i]->Draw();
131       fHistList[i]->SetTitle(title[i]);
132     }
133     
134     fGraphList[i] = (TGraph*)file->Get(names[i+3]);
135     if (fGraphList[i]) {
136       fCanvasList[i+3]->GetCanvas()->cd();
137       fGraphList[i]->Draw("apl");
138       fGraphList[i]->SetMarkerStyle(7);
139       fGraphList[i]->GetHistogram()->SetTitle(title[i+3]);
140     }
141
142     fHistListSM[i] = (TH1D*)file->Get(names[i+6]);
143     if (fHistListSM[i]) {
144       fCanvasList[i+6]->GetCanvas()->cd();
145       //fCanvasList[i]->GetCanvas()->SetLogy(1);
146       
147       fHistListSM[i]->Draw();
148       fHistListSM[i]->SetTitle(title[i+6]);
149     }
150   }
151
152   
153   /*
154
155
156       fHistList[i]->SetMinimum(fRangePed[0]);
157       fHistList[i]->SetMaximum(fRangePed[1]);
158     }
159     
160     if ( fHistList[i] && (fIdxType == 1) && fSetRangeNoise) {
161       fHistList[i]->SetMinimum(fRangeNoise[0]);
162       fHistList[i]->SetMaximum(fRangeNoise[1]);
163     }
164
165     fCanvasList[pos]->GetCanvas()->Update();
166   }
167   */
168 }
169
170 //////////////////////////////////////////////////////////////////////////////////