]>
Commit | Line | Data |
---|---|---|
421ab0fb | 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 | ||
17 | /* $Id$ */ | |
18 | ||
202374b1 | 19 | // |
20 | // Base class for detectors quality assurance checkers | |
21 | // Compares Data made by QADataMakers with reference data | |
22 | // Y. Schutz CERN August 2007 | |
23 | // | |
421ab0fb | 24 | |
25 | // --- ROOT system --- | |
634696f5 | 26 | #include <TCanvas.h> |
421ab0fb | 27 | #include <TClass.h> |
28 | #include <TH1F.h> | |
29 | #include <TH1I.h> | |
30 | #include <TIterator.h> | |
31 | #include <TKey.h> | |
32 | #include <TFile.h> | |
a4976ef3 | 33 | #include <TList.h> |
a2b64fbd | 34 | #include <TNtupleD.h> |
11a18a03 | 35 | #include <TParameter.h> |
634696f5 | 36 | #include <TPaveText.h> |
421ab0fb | 37 | |
38 | // --- Standard library --- | |
39 | ||
40 | // --- AliRoot header files --- | |
78decf65 | 41 | #include "AliCDBEntry.h" |
421ab0fb | 42 | #include "AliLog.h" |
4e25ac79 | 43 | #include "AliQAv1.h" |
2e42b4d4 | 44 | #include "AliQAChecker.h" |
45 | #include "AliQACheckerBase.h" | |
46 | #include "AliQADataMaker.h" | |
78decf65 | 47 | #include "AliQAManager.h" |
c26cb20d | 48 | #include "AliDetectorRecoParam.h" |
421ab0fb | 49 | |
2e42b4d4 | 50 | ClassImp(AliQACheckerBase) |
421ab0fb | 51 | |
52 | ||
53 | //____________________________________________________________________________ | |
2e42b4d4 | 54 | AliQACheckerBase::AliQACheckerBase(const char * name, const char * title) : |
421ab0fb | 55 | TNamed(name, title), |
a5fa6165 | 56 | fDataSubDir(0x0), |
4edbc5bc | 57 | fRefSubDir(0x0), |
aa2beccb | 58 | fRefOCDBSubDir(new TObjArray*[AliRecoParam::kNSpecies]), |
a04582a1 | 59 | fLowTestValue(new Float_t[AliQAv1::kNBIT]), |
60 | fUpTestValue(new Float_t[AliQAv1::kNBIT]), | |
634696f5 | 61 | fImage(new TCanvas*[AliRecoParam::kNSpecies]), |
11a18a03 | 62 | fPrintImage(kTRUE), |
a80d46d0 | 63 | fExternParamList(new TList()) |
421ab0fb | 64 | { |
65 | // ctor | |
4e25ac79 | 66 | fLowTestValue[AliQAv1::kINFO] = 0.5 ; |
67 | fUpTestValue[AliQAv1::kINFO] = 1.0 ; | |
68 | fLowTestValue[AliQAv1::kWARNING] = 0.002 ; | |
69 | fUpTestValue[AliQAv1::kWARNING] = 0.5 ; | |
70 | fLowTestValue[AliQAv1::kERROR] = 0.0 ; | |
71 | fUpTestValue[AliQAv1::kERROR] = 0.002 ; | |
72 | fLowTestValue[AliQAv1::kFATAL] = -1.0 ; | |
73 | fUpTestValue[AliQAv1::kFATAL] = 0.0 ; | |
57acd2d2 | 74 | |
5379c4a3 | 75 | AliDebug(AliQAv1::GetQADebugLevel(), "Default setting is:") ; |
76 | if ( AliDebugLevel() == AliQAv1::GetQADebugLevel() ) { | |
eca4fa66 | 77 | const Char_t * text= Form(" INFO -> %1.5f < value < %1.5f WARNING -> %1.5f < value <= %1.5f \n ERROR -> %1.5f < value <= %1.5f \n FATAL -> %1.5f <= value < %1.5f \n", |
78 | fLowTestValue[AliQAv1::kINFO], fUpTestValue[AliQAv1::kINFO], | |
79 | fLowTestValue[AliQAv1::kWARNING], fUpTestValue[AliQAv1::kWARNING], | |
80 | fLowTestValue[AliQAv1::kERROR], fUpTestValue[AliQAv1::kERROR], | |
81 | fLowTestValue[AliQAv1::kFATAL], fUpTestValue[AliQAv1::kFATAL]) ; | |
82 | AliInfo(Form("%s", text)) ; | |
5379c4a3 | 83 | } |
634696f5 | 84 | |
aa2beccb | 85 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
634696f5 | 86 | fImage[specie] = NULL ; |
aa2beccb | 87 | fRefOCDBSubDir[specie] = NULL ; |
88 | } | |
421ab0fb | 89 | } |
90 | ||
57acd2d2 | 91 | //____________________________________________________________________________ |
92 | AliQACheckerBase::~AliQACheckerBase() | |
93 | { | |
94 | delete [] fLowTestValue ; | |
95 | delete [] fUpTestValue ; | |
a4e305ee | 96 | DeleteImages(); |
6b5405c1 | 97 | delete[] fImage ; |
aa2beccb | 98 | delete[] fRefOCDBSubDir ; |
5d1a2a7d | 99 | AliQAv1::GetQAResultFile()->Close() ; |
11a18a03 | 100 | if (fExternParamList) { |
101 | fExternParamList->Clear() ; | |
102 | delete fExternParamList ; | |
103 | } | |
57acd2d2 | 104 | } |
105 | ||
a5fa6165 | 106 | //____________________________________________________________________________ |
75a8b78a | 107 | void AliQACheckerBase::PrivateCheck(Double_t * test, AliQAv1::ALITASK_t index, const AliDetectorRecoParam * recoParam) |
a5fa6165 | 108 | { |
109 | // Performs a basic checking | |
110 | // Compares all the histograms stored in the directory | |
4edbc5bc | 111 | // With reference histograms either in a file of in OCDB |
a5fa6165 | 112 | |
ed448a70 | 113 | TObjArray ** list = new TObjArray *[AliRecoParam::kNSpecies] ; |
c39ee44c | 114 | Int_t specie ; |
115 | for (specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
ed448a70 | 116 | list[specie] = new TObjArray(AliQAv1::GetMaxQAObj()) ; |
4e25ac79 | 117 | if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) |
57acd2d2 | 118 | continue ; |
c39ee44c | 119 | if (fDataSubDir) { |
ed448a70 | 120 | TList * keyList = fDataSubDir->GetListOfKeys() ; |
121 | TIter next(keyList) ; | |
122 | TKey * key ; | |
123 | while ( (key = static_cast<TKey *>(next())) ) { | |
124 | TDirectory * specieDir = fDataSubDir->GetDirectory(key->GetName()) ; | |
125 | TList * keykeyList = specieDir->GetListOfKeys() ; | |
126 | TIter next2(keykeyList) ; | |
127 | TKey * keykey ; | |
128 | while ( (keykey = static_cast<TKey *>(next2())) ) { | |
129 | TObject * odata = specieDir->Get(keykey->GetName()) ; | |
130 | if ( odata->IsA()->InheritsFrom("TH1") ) { | |
131 | TH1 * hdata = static_cast<TH1*>(odata) ; | |
132 | list[specie]->Add(hdata) ; | |
133 | } else if (!odata->IsA()->InheritsFrom("TDirectory")) // skip the expert directory | |
134 | AliError(Form("%s Is a Classname that cannot be processed", key->GetClassName())) ; | |
c39ee44c | 135 | } |
57acd2d2 | 136 | } |
57acd2d2 | 137 | } |
138 | } | |
ed448a70 | 139 | |
86017bd8 | 140 | Check(test, index, list, recoParam) ; |
ed448a70 | 141 | |
142 | delete[] list ; | |
143 | ||
a5fa6165 | 144 | } |
145 | ||
a4976ef3 | 146 | //____________________________________________________________________________ |
389410ea | 147 | void AliQACheckerBase::Check(Double_t * test, AliQAv1::ALITASK_t task, TObjArray ** list, const AliDetectorRecoParam * /* recoParam */) |
a4976ef3 | 148 | { |
149 | // Performs a basic checking | |
150 | // Compares all the histograms in the list | |
151 | ||
92664bc8 | 152 | Int_t count[AliRecoParam::kNSpecies] = { 0 }; |
57acd2d2 | 153 | |
78decf65 | 154 | GetRefSubDir(GetName(), AliQAv1::GetTaskName(task), fRefSubDir, fRefOCDBSubDir) ; |
155 | // SetRefandData(refDir, refOCDBDir) ; | |
156 | ||
57acd2d2 | 157 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
158 | test[specie] = 1.0 ; | |
92664bc8 | 159 | if ( !AliQAv1::Instance()->IsEventSpecieSet(specie)) continue ; |
57acd2d2 | 160 | if (list[specie]->GetEntries() == 0) |
161 | test[specie] = 0. ; // nothing to check | |
162 | else { | |
163 | if (!fRefSubDir && !fRefOCDBSubDir) | |
164 | test[specie] = -1 ; // no reference data | |
165 | else { | |
166 | TIter next(list[specie]) ; | |
167 | TH1 * hdata ; | |
168 | count[specie] = 0 ; | |
eca4fa66 | 169 | while ( (hdata = static_cast<TH1 *>(next())) ) { |
ab1bb842 | 170 | if ( hdata->IsA()->InheritsFrom("TH1") ) { |
7775195b | 171 | if ( hdata->TestBit(AliQAv1::GetExpertBit()) ) // does not perform the test for expert data |
172 | continue ; | |
92664bc8 | 173 | // |
174 | // First try to find the ref histo with exact name (with possible trigger clon ending) | |
175 | TString hname = hdata->GetName(); | |
176 | TH1 * href = NULL ; | |
177 | if (fRefSubDir) href = static_cast<TH1*>(fRefSubDir->Get(hname.Data())) ; | |
178 | else if (fRefOCDBSubDir[specie]) href = static_cast<TH1*>(fRefOCDBSubDir[specie]->FindObject(hname.Data())); | |
179 | // | |
180 | if (!href && hdata->TestBit(AliQAv1::GetClonedBit())) { // try to find the histo for the base name (w/o trigger ending | |
181 | int ind = hname.Index(AliQADataMaker::GetTriggerPrefix()); | |
182 | if (ind>0) { | |
183 | hname.Resize(ind); | |
184 | if (fRefSubDir) href = static_cast<TH1*>(fRefSubDir->Get(hname.Data())) ; | |
185 | else if (fRefOCDBSubDir[specie]) href = static_cast<TH1*>(fRefOCDBSubDir[specie]->FindObject(hname.Data())); | |
186 | } | |
187 | } | |
188 | // | |
7775195b | 189 | if (!href) |
190 | test[specie] = -1 ; // no reference data ; | |
191 | else { | |
192 | Double_t rv = DiffK(hdata, href) ; | |
193 | AliDebug(AliQAv1::GetQADebugLevel(), Form("%s ->Test = %f", hdata->GetName(), rv)) ; | |
194 | test[specie] += rv ; | |
195 | count[specie]++ ; | |
57acd2d2 | 196 | } |
c39ee44c | 197 | } else |
57acd2d2 | 198 | AliError("Data type cannot be processed") ; |
c39ee44c | 199 | if (count[specie] != 0) |
200 | test[specie] /= count[specie] ; | |
57acd2d2 | 201 | } |
57acd2d2 | 202 | } |
203 | } | |
204 | } | |
a4976ef3 | 205 | } |
206 | ||
57acd2d2 | 207 | |
a4e305ee | 208 | //____________________________________________________________________________ |
209 | void AliQACheckerBase::DeleteImages() | |
210 | { | |
6b5405c1 | 211 | // clean images |
212 | for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) { | |
213 | if ( fImage[esIndex] ) {delete fImage[esIndex]; fImage[esIndex] = 0;} | |
214 | if ( fRefOCDBSubDir[esIndex] ) {delete fRefOCDBSubDir[esIndex]; fRefOCDBSubDir[esIndex] = 0;} | |
215 | } | |
a4e305ee | 216 | } |
217 | ||
421ab0fb | 218 | //____________________________________________________________________________ |
f12d42ce | 219 | Double_t AliQACheckerBase::DiffC(const TH1 * href, const TH1 * hin) const |
421ab0fb | 220 | { |
221 | // compares two histograms using the Chi2 test | |
222 | if ( hin->Integral() == 0 ) { | |
5379c4a3 | 223 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Spectrum %s is empty", hin->GetName())) ; |
421ab0fb | 224 | return 0. ; |
225 | } | |
226 | ||
227 | return hin->Chi2Test(href) ; | |
228 | } | |
229 | ||
230 | //____________________________________________________________________________ | |
f12d42ce | 231 | Double_t AliQACheckerBase::DiffK(const TH1 * href, const TH1 * hin) const |
421ab0fb | 232 | { |
233 | // compares two histograms using the Kolmogorov test | |
6252ceeb | 234 | if ( hin->Integral() == 0 || href->Integral() == 0) { |
235 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Spectrum %s or its reference is empty", hin->GetName())) ; | |
421ab0fb | 236 | return 0. ; |
237 | } | |
238 | ||
239 | return hin->KolmogorovTest(href) ; | |
240 | } | |
241 | ||
78decf65 | 242 | //_____________________________________________________________________________ |
243 | void AliQACheckerBase::GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray **& dirOCDB) | |
244 | { | |
245 | // Opens and returns the file with the reference data | |
246 | dirFile = NULL ; | |
247 | TString refStorage(AliQAv1::GetQARefStorage()) ; | |
248 | if (!refStorage.Contains(AliQAv1::GetLabLocalOCDB()) && !refStorage.Contains(AliQAv1::GetLabAliEnOCDB())) { | |
249 | AliError(Form("%s is not a valid location for reference data", refStorage.Data())) ; | |
250 | return ; | |
251 | } else { | |
252 | AliQAManager* manQA = AliQAManager::QAManager(AliQAv1::GetTaskIndex(task)) ; | |
a04582a1 | 253 | // dirOCDB = new TObjArray*[AliRecoParam::kNSpecies] ; |
78decf65 | 254 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
255 | dirOCDB[specie] = NULL ; | |
256 | if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) | |
257 | continue ; | |
258 | AliQAv1::SetQARefDataDirName(specie) ; | |
259 | if ( ! manQA->GetLock() ) { | |
260 | manQA->SetDefaultStorage(AliQAv1::GetQARefStorage()) ; | |
261 | manQA->SetSpecificStorage("*", AliQAv1::GetQARefStorage()) ; | |
262 | manQA->SetRun(AliCDBManager::Instance()->GetRun()) ; | |
263 | manQA->SetLock() ; | |
264 | } | |
265 | char * detOCDBDir = Form("%s/%s/%s", det, AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ; | |
266 | AliCDBEntry * entry = manQA->Get(detOCDBDir, manQA->GetRun()) ; | |
267 | if (entry) { | |
268 | TList * listDetQAD =static_cast<TList *>(entry->GetObject()) ; | |
1c871ee3 | 269 | if ( listDetQAD && strcmp(listDetQAD->ClassName(), "TList") != 0 ) { |
78decf65 | 270 | AliError(Form("Expected a Tlist and found a %s for detector %s", listDetQAD->ClassName(), det)) ; |
271 | listDetQAD = NULL ; | |
272 | continue ; | |
273 | } | |
274 | if ( listDetQAD ) { | |
275 | TIter next(listDetQAD) ; | |
d90c4827 | 276 | while ( (TObjArray*)next() ) |
78decf65 | 277 | dirOCDB[specie] = static_cast<TObjArray *>(listDetQAD->FindObject(Form("%s/%s", task, AliRecoParam::GetEventSpecieName(specie)))) ; |
278 | } | |
279 | } | |
280 | } | |
281 | } | |
282 | } | |
283 | ||
c39ee44c | 284 | //____________________________________________________________________________ |
11a18a03 | 285 | void AliQACheckerBase::PrintExternParam() |
286 | { | |
287 | // Print the list of external parameter list | |
288 | TIter next(fExternParamList) ; | |
289 | TParameter<double> *pp ; | |
290 | TString printit("\n") ; | |
291 | while( (pp = (TParameter<double>*)next()) ) | |
292 | printit += Form("%s = %f\n", pp->GetName(), pp->GetVal()); | |
293 | AliInfo(Form("%s", printit.Data())) ; | |
294 | } | |
295 | ||
296 | //____________________________________________________________________________ | |
9025307b | 297 | void AliQACheckerBase::Run(AliQAv1::ALITASK_t index, const AliDetectorRecoParam * recoParam) |
c39ee44c | 298 | { |
9025307b | 299 | //Run the checker for all kind of species |
92664bc8 | 300 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Processing %s", AliQAv1::GetAliTaskName(index))) ; |
c39ee44c | 301 | |
92664bc8 | 302 | Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; |
255c1c92 | 303 | for (int i=AliRecoParam::kNSpecies;i--;) rv[i] = 0.0; |
75a8b78a | 304 | PrivateCheck(rv, index, recoParam) ; |
92664bc8 | 305 | SetQA(index, rv) ; |
306 | ||
c39ee44c | 307 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Test result of %s", AliQAv1::GetAliTaskName(index))) ; |
92664bc8 | 308 | |
d9e8b603 | 309 | delete [] rv ; |
c39ee44c | 310 | Finish() ; |
311 | } | |
312 | ||
421ab0fb | 313 | //____________________________________________________________________________ |
9025307b | 314 | void AliQACheckerBase::Run(AliQAv1::ALITASK_t index, TObjArray ** list, const AliDetectorRecoParam * recoParam) |
421ab0fb | 315 | { |
92664bc8 | 316 | // RS: perform check for all trigger classes in loop |
317 | Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; | |
318 | // | |
319 | TObjArray ** listTrig = new TObjArray *[AliRecoParam::kNSpecies]; | |
320 | // | |
321 | for (int itc=-1;itc<AliQADataMaker::GetNTrigClasses();itc++) { | |
322 | // | |
323 | // RS: fetch the histograms for each specie and for given trigger | |
324 | //AliInfo(Form("Processing %s for trigger: %s", AliQAv1::GetAliTaskName(index),AliQADataMaker::GetTrigClassName(itc))); | |
325 | ||
326 | for (int specie=0;specie<AliRecoParam::kNSpecies;specie++) { | |
327 | listTrig[specie] = 0; | |
328 | if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) || !list[specie]) continue; | |
329 | listTrig[specie] = new TObjArray( list[specie]->GetSize() ); // destination for clones of this trigger | |
330 | AliQADataMaker::GetDataOfTrigClass(list[specie],itc, listTrig[specie]); | |
331 | } | |
332 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Processing %s for trigger: %s", AliQAv1::GetAliTaskName(index),AliQADataMaker::GetTrigClassName(itc))); | |
333 | Check(rv, index, listTrig, recoParam) ; | |
334 | SetQA(index, rv) ; | |
335 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Test result of %s for trigger: %s", AliQAv1::GetAliTaskName(index),AliQADataMaker::GetTrigClassName(itc))); | |
336 | // | |
337 | for (int specie=0;specie<AliRecoParam::kNSpecies;specie++) if (listTrig[specie]) delete listTrig[specie]; // clean temporary container | |
338 | } | |
86017bd8 | 339 | delete [] rv ; |
385b26a8 | 340 | delete [] listTrig; |
a2b64fbd | 341 | Finish() ; |
421ab0fb | 342 | } |
343 | ||
344 | //____________________________________________________________________________ | |
2e42b4d4 | 345 | void AliQACheckerBase::Finish() const |
421ab0fb | 346 | { |
92664bc8 | 347 | // wrap up and save QA in proper file |
348 | AliQAv1::GetQAResultFile() ; | |
349 | AliQAv1 * qa = AliQAv1::Instance() ; | |
350 | qa->Write(AliQAv1::GetQAName(), kWriteDelete) ; | |
421ab0fb | 351 | } |
46b8a84d | 352 | |
634696f5 | 353 | //____________________________________________________________________________ |
354 | void AliQACheckerBase::MakeImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, AliQAv1::MODE_t mode) | |
355 | { | |
356 | // makes the QA image for sim and rec | |
92664bc8 | 357 | TObjArray tmpArr; // array to store flat version of original array (which may contain clones) |
358 | // | |
359 | for (Int_t esIndex = 0; esIndex < AliRecoParam::kNSpecies; esIndex++) { | |
360 | if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) || list[esIndex]->GetEntries() == 0) continue; | |
361 | Int_t nImages = 0; | |
362 | TIter next(list[esIndex]); | |
363 | TObject* hdata = NULL; | |
364 | tmpArr.Clear(); | |
365 | while ( (hdata=(next())) ) { // count histos and transfere to flat array | |
366 | if (hdata->InheritsFrom(TH1::Class()) && hdata->TestBit(AliQAv1::GetImageBit()) ) { // histo, not cloned | |
367 | nImages++; | |
368 | tmpArr.AddLast(hdata); | |
369 | continue; | |
94b94b5f | 370 | } |
92664bc8 | 371 | if (!hdata->TestBit(AliQAv1::GetClonedBit())) continue; // not an array of clones, unknown object |
372 | TIter nextCl((TObjArray*)hdata); // array of histo clones | |
373 | TObject* hcl = 0; | |
374 | while ((hcl=nextCl())) if (hcl->InheritsFrom(TH1::Class()) && hcl->TestBit(AliQAv1::GetImageBit())) {tmpArr.AddLast(hcl); nImages++;} | |
375 | } | |
376 | // | |
377 | if ( nImages == 0 ) { | |
378 | AliDebug(AliQAv1::GetQADebugLevel(), Form("No histogram will be plotted for %s %s %s\n", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex))); | |
379 | continue; | |
634696f5 | 380 | } |
92664bc8 | 381 | AliDebug(AliQAv1::GetQADebugLevel(), Form("%d histograms will be plotted for %s %s %s\n", nImages, GetName(), AliQAv1::GetTaskName(task).Data(),AliRecoParam::GetEventSpecieName(esIndex))); |
382 | // | |
383 | const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)); | |
384 | // | |
385 | if ( !fImage[esIndex] ) fImage[esIndex] = new TCanvas(title, title); | |
386 | // | |
387 | fImage[esIndex]->Clear(); | |
388 | fImage[esIndex]->SetTitle(title); | |
389 | fImage[esIndex]->cd(); | |
390 | TPaveText someText(0.015, 0.015, 0.98, 0.98); | |
391 | someText.AddText(title); | |
392 | someText.Draw(); | |
8386cd34 | 393 | fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat())); |
92664bc8 | 394 | fImage[esIndex]->Clear(); |
395 | Int_t nx = TMath::Nint(TMath::Sqrt(nImages)); | |
396 | Int_t ny = nx; | |
397 | if (nx < TMath::Sqrt(nImages)) ny++; | |
398 | // | |
399 | fImage[esIndex]->Divide(nx, ny); | |
400 | TIter nexthist(&tmpArr); | |
401 | Int_t npad = 1; | |
402 | fImage[esIndex]->cd(npad); | |
403 | TH1* histo = 0; | |
404 | while ( (histo=(TH1*)nexthist()) ) { // tmpArr is guaranteed to contain only plottable histos, no checks needed | |
405 | TString opts = histo->GetDrawOption(); | |
406 | if (opts.Contains("logy",TString::kIgnoreCase)) gPad->SetLogy(); | |
407 | if (opts.Contains("logx",TString::kIgnoreCase)) gPad->SetLogx(); | |
408 | histo->DrawCopy(); | |
409 | fImage[esIndex]->cd(++npad); | |
410 | } | |
411 | fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps"); | |
412 | } | |
634696f5 | 413 | } |
414 | ||
46b8a84d | 415 | //____________________________________________________________________________ |
57acd2d2 | 416 | void AliQACheckerBase::SetHiLo(Float_t * hiValue, Float_t * lowValue) |
46b8a84d | 417 | { |
5379c4a3 | 418 | AliDebug(AliQAv1::GetQADebugLevel(), "Previous setting was:") ; |
419 | if ( AliDebugLevel() == AliQAv1::GetQADebugLevel() ) { | |
eca4fa66 | 420 | const Char_t * text= Form(" INFO -> %1.5f < value < %1.5f WARNING -> %1.5f < value <= %1.5f \n ERROR -> %1.5f < value <= %1.5f \n FATAL -> %1.5f <= value < %1.5f \n", |
421 | fLowTestValue[AliQAv1::kINFO], fUpTestValue[AliQAv1::kINFO], | |
422 | fLowTestValue[AliQAv1::kWARNING], fUpTestValue[AliQAv1::kWARNING], | |
423 | fLowTestValue[AliQAv1::kERROR], fUpTestValue[AliQAv1::kERROR], | |
424 | fLowTestValue[AliQAv1::kFATAL], fUpTestValue[AliQAv1::kFATAL]) ; | |
425 | AliInfo(Form("%s", text)) ; | |
5379c4a3 | 426 | } |
57acd2d2 | 427 | |
4e25ac79 | 428 | for (Int_t index = 0 ; index < AliQAv1::kNBIT ; index++) { |
57acd2d2 | 429 | fLowTestValue[index] = lowValue[index] ; |
eca4fa66 | 430 | fUpTestValue[index] = hiValue[index] ; |
57acd2d2 | 431 | } |
5379c4a3 | 432 | AliDebug(AliQAv1::GetQADebugLevel(), "Current setting is:") ; |
433 | if ( AliDebugLevel() == AliQAv1::GetQADebugLevel() ) { | |
eca4fa66 | 434 | const Char_t * text= Form(" INFO -> %1.5f < value < %1.5f WARNING -> %1.5f < value <= %1.5f \n ERROR -> %1.5f < value <= %1.5f \n FATAL -> %1.5f <= value < %1.5f \n", |
435 | fLowTestValue[AliQAv1::kINFO], fUpTestValue[AliQAv1::kINFO], | |
436 | fLowTestValue[AliQAv1::kWARNING], fUpTestValue[AliQAv1::kWARNING], | |
437 | fLowTestValue[AliQAv1::kERROR], fUpTestValue[AliQAv1::kERROR], | |
438 | fLowTestValue[AliQAv1::kFATAL], fUpTestValue[AliQAv1::kFATAL]) ; AliInfo(Form("%s", text)) ; | |
5379c4a3 | 439 | } |
57acd2d2 | 440 | } |
46b8a84d | 441 | |
57acd2d2 | 442 | //____________________________________________________________________________ |
4e25ac79 | 443 | void AliQACheckerBase::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const |
57acd2d2 | 444 | { |
445 | // sets the QA according the return value of the Check | |
46b8a84d | 446 | |
4e25ac79 | 447 | AliQAv1 * qa = AliQAv1::Instance(index) ; |
d5b176f5 | 448 | |
57acd2d2 | 449 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
d5b176f5 | 450 | if (! qa->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie))) |
451 | continue ; | |
57acd2d2 | 452 | if ( value == NULL ) { // No checker is implemented, set all QA to Fatal |
4e25ac79 | 453 | qa->Set(AliQAv1::kFATAL, specie) ; |
57acd2d2 | 454 | } else { |
4e25ac79 | 455 | if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] && value[specie] < fUpTestValue[AliQAv1::kFATAL] ) |
b872fee3 | 456 | qa->Set(AliQAv1::kFATAL, AliRecoParam::ConvertIndex(specie)) ; |
4e25ac79 | 457 | else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] && value[specie] <= fUpTestValue[AliQAv1::kERROR] ) |
b872fee3 | 458 | qa->Set(AliQAv1::kERROR, AliRecoParam::ConvertIndex(specie)) ; |
4e25ac79 | 459 | else if ( value[specie] > fLowTestValue[AliQAv1::kWARNING] && value[specie] <= fUpTestValue[AliQAv1::kWARNING] ) |
b872fee3 | 460 | qa->Set(AliQAv1::kWARNING, AliRecoParam::ConvertIndex(specie)) ; |
4e25ac79 | 461 | else if ( value[specie] > fLowTestValue[AliQAv1::kINFO] && value[specie] <= fUpTestValue[AliQAv1::kINFO] ) |
b872fee3 | 462 | qa->Set(AliQAv1::kINFO, AliRecoParam::ConvertIndex(specie)) ; |
57acd2d2 | 463 | } |
464 | } | |
46b8a84d | 465 | } |