1 /**************************************************************************
2 * Copyright(c) 2004, 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 **************************************************************************/
15 //__________________________________________________________________
25 //__________________________________________________________________
27 // --- ROOT system ---
31 #include <TIterator.h>
36 #include <TPaveText.h>
38 // --- AliRoot header files ---
41 #include "AliQAChecker.h"
42 #include "AliFMDQAChecker.h"
43 #include "AliRecoParam.h"
45 ClassImp(AliFMDQAChecker)
47 ; // This is for Emacs! - do not delete
49 //__________________________________________________________________
50 void AliFMDQAChecker::Check(Double_t* rv,
51 AliQAv1::ALITASK_t what,
53 const AliDetectorRecoParam* /*t*/)
56 // Member function called to do the actual checking
59 // rv Array of return values.
61 // list Array of arrays of histograms. There's one arrat for
63 // t Reconstruction parameters - not used.
66 // Double_t* rv = new Double_t[AliRecoParam::kNSpecies] ;
67 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
71 if (!AliQAv1::Instance()->IsEventSpecieSet(specie) )
74 if(!list[specie]) continue;
77 Int_t nHist = list[specie]->GetEntriesFast();
78 for(Int_t i= 0; i< nHist; i++) {
80 if (!(hist = static_cast<TH1F*>(list[specie]->At(i)))) continue;
82 if(what == AliQAv1::kESD)
83 rv[specie] += (hist->GetMean() > 0 ? 1 : 0);
84 if(what == AliQAv1::kRAW)
85 rv[specie] += (hist->GetMean() > 0 ? 1 : 0);
86 if(what == AliQAv1::kSIM)
87 rv[specie] += (hist->GetMean() > 0 ? 1 : 0);
88 if(what == AliQAv1::kREC)
89 rv[specie] += (hist->GetMean() > 0 ? 1 : 0);
91 if (count != 0) rv[specie] /= count;
97 //____________________________________________________________________________
99 AliFMDQAChecker::MakeImage(TObjArray** list,
100 AliQAv1::TASKINDEX_t task,
101 AliQAv1::MODE_t mode)
103 // makes the QA image for sim and rec
106 // task What to check
107 // list Array of arrays of histograms. There's one array for
109 // t Reconstruction parameters - not used.
113 Double_t min = 10000;
114 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
115 if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue ;
117 if(!list[specie]) continue;
120 Int_t nHist = list[specie]->GetEntriesFast();
121 for(Int_t i= 0; i< nHist; i++) {
122 hist = static_cast<TH1F*>(list[specie]->At(i));
123 if (hist->TestBit(AliQAv1::GetImageBit())) {
125 max = TMath::Max(max, hist->GetMaximum());
126 min = TMath::Min(min, hist->GetMinimum());
131 min = TMath::Max(0.1, min);
132 max = TMath::Min(1.0, max);
135 AliDebug(AliQAv1::GetQADebugLevel(),
136 Form("No histogram will be plotted for %s %s\n", GetName(),
137 AliQAv1::GetTaskName(task).Data()));
141 AliDebug(AliQAv1::GetQADebugLevel(),
142 Form("%d histograms will be plotted for %s %s\n",
143 nImages, GetName(), AliQAv1::GetTaskName(task).Data()));
145 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
146 if (!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue ;
148 if(!list[specie]) continue;
150 const Char_t * title = Form("QA_%s_%s_%s", GetName(),
151 AliQAv1::GetTaskName(task).Data(),
152 AliRecoParam::GetEventSpecieName(specie));
154 fImage[specie] = new TCanvas(title, title) ;
155 fImage[specie]->Clear() ;
156 fImage[specie]->SetTitle(title) ;
157 fImage[specie]->cd() ;
159 TPaveText someText(0.015, 0.015, 0.98, 0.98) ;
160 someText.AddText(title) ;
162 fImage[specie]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(),
163 AliQAv1::GetModeName(mode),
164 AliQAChecker::Instance()->GetRunNumber(),
165 AliQAv1::GetImageFileFormat()), "ps") ;
166 fImage[specie]->Clear();
168 Int_t nx = (nImages + .5) / 2;
170 fImage[specie]->Divide(nx, ny, 0, 0);
174 Int_t nHist = list[specie]->GetEntriesFast();
176 for (Int_t i = 0; i < nHist; i++) {
177 hist = static_cast<TH1F*>(list[specie]->At(i));
178 if (!hist->TestBit(AliQAv1::GetImageBit())) continue;
180 TVirtualPad* pad = fImage[specie]->cd(++j);
182 hist->SetMinimum(min);
183 hist->SetMaximum(max);
187 fImage[specie]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(),
188 AliQAv1::GetModeName(mode),
189 AliQAChecker::Instance()->GetRunNumber(),
190 AliQAv1::GetImageFileFormat()), "ps");
194 //__________________________________________________________________