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: AliTRDqaGuiClusters.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 on the full detector level.
22 // It displays histograms created by the AliTRDQADataMakerRec
23 // run during the reconstruction
29 //////////////////////////////////////////////////////////////////////////////////
31 #include "AliTRDqaGuiClusters.h"
37 #include "TRootEmbeddedCanvas.h"
39 ClassImp(AliTRDqaGuiClusters)
41 const Int_t AliTRDqaGuiClusters::fgkLogList[4] = {0,1,0,1};
43 //////////////////////////////////////////////////////////////////////////////////
44 AliTRDqaGuiClusters::AliTRDqaGuiClusters(TGWindow *parent)
45 : TGCompositeFrame(parent, 720, 400) {
50 SetLayoutManager(new TGMatrixLayout(this,2,2,1,1));
52 fNameList[0] = "detMap";
53 fNameList[1] = "nCls";
54 fNameList[2] = "signal";
55 fNameList[3] = "ampMPV";
57 for(Int_t i=0; i<4; i++) {
58 fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], this, 480, 320);
59 AddFrame(fCanvasList[i]);
62 for(Int_t i=0; i<4; i++) {
68 //////////////////////////////////////////////////////////////////////////////////
70 void AliTRDqaGuiClusters::SetQAFile(const char *filename) {
72 // sets the file with histograms
75 for(Int_t i=0; i<4; i++) {
76 if (fHistList[i]) delete fHistList[i];
77 for(Int_t j=0; j<3; j++)
78 if (fHistRefs[i][j]) delete fHistRefs[i][j];
81 const char *opt[4] = {"colz", "", "", ""};
83 TFile *file = new TFile(filename);
84 file->cd("TRD/RecPoints");
86 for(int i=0; i<4; i++) {
88 fCanvasList[i]->GetCanvas()->cd();
89 gPad->SetLogy(fgkLogList[i]);
91 fHistList[i] = (TH1D*)gDirectory->Get(Form("qaTRD_recPoints_%s", fNameList[i]));
92 if (fHistList[i]) fHistList[i]->Draw(opt[i]);
93 // if (fgkLogList[i]) fHistList[i]->SetMinimum(0.1);
95 TH1D *refHist = (TH1D*)gDirectory->Get(Form("qaTRD_recPoints_%s_%s", fNameList[i], "ref"));
98 BuildColor(i, refHist);
99 for(Int_t j=0; j<3; j++) fHistRefs[i][j]->Draw("SAME");
103 fCanvasList[i]->GetCanvas()->Update();
107 //////////////////////////////////////////////////////////////////////////////////
109 TH2D *AliTRDqaGuiClusters::BuildHisto(TH1D *ref, TH1D *data) {
111 Int_t nbinsx = ref->GetNbinsX();
112 Double_t minx = ref->GetXaxis()->GetXmin();
113 Double_t maxx = ref->GetXaxis()->GetXmax();
114 Double_t min = data->GetMinimum();
115 Double_t max = data->GetMaximum();
117 TH2D *pad = new TH2D("pad", "", nbinsx, minx, maxx, 1, 0.7, 0.9);
120 for(Int_t i=0; i<nbinsx; i++) {
121 Double_t x = ref->GetBinCenter(i+1);
122 pad->Fill(x, 0.8, ref->GetBinContent(i+1));
130 //////////////////////////////////////////////////////////////////////////////////
132 void AliTRDqaGuiClusters::BuildColor(Int_t i, TH1D *ref) {
134 const Int_t nHist = 3;
135 const Int_t clr[nHist] = {3, 5, 2};
137 for(Int_t j=0; j<nHist; j++) {
138 fHistRefs[i][j] = (TH1D*)fHistList[i]->Clone(Form("%s_%d", fHistList[i]->GetName(), j));
139 fHistRefs[i][j]->SetFillColor(clr[j]);
140 fHistRefs[i][j]->SetLineColor(clr[j]);
143 for(Int_t k=0; k<ref->GetNbinsX(); k++) {
144 Double_t v = ref->GetBinContent(k+1);
145 if (v < 0.3) fHistRefs[i][1]->SetBinContent(k+1, 0);
146 if (v < 0.7) fHistRefs[i][2]->SetBinContent(k+1, 0);
151 //////////////////////////////////////////////////////////////////////////////////