new ALIRECO.par target for creating the reconstruction par file. Uses loadlibsrec...
[u/mrichter/AliRoot.git] / STEER / AliQA.cxx
CommitLineData
8661738e 1
421ab0fb 2/**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16/* $Id$ */
17
18//////////////////////////////////////////////////////////////////////////////
19//
20// Quality Assurance Object//_________________________________________________________________________
21// Quality Assurance object. The QA status is held in one word per detector,
22// each bit corresponds to a different status.
12581b04 23// bit 0-3 : QA raised during simulation (RAW)
24// bit 4-7 : QA raised during simulation (SIM)
25// bit 8-11 : QA raised during reconstruction (REC)
26// bit 12-15 : QA raised during ESD checking (ESD)
27// bit 16-19 : QA raised during analysis (ANA)
421ab0fb 28// Each of the 4 bits corresponds to a severity level of increasing importance
29// from lower to higher bit (INFO, WARNING, ERROR, FATAL)
30//
31//*-- Yves Schutz CERN, July 2007
32//////////////////////////////////////////////////////////////////////////////
33
34
b09247a2 35#include <cstdlib>
421ab0fb 36// --- ROOT system ---
37#include <TFile.h>
38#include <TSystem.h>
0d13dd63 39#include <TROOT.h>
421ab0fb 40
41// --- Standard library ---
42
43// --- AliRoot header files ---
44#include "AliLog.h"
2e42b4d4 45#include "AliQA.h"
421ab0fb 46
47
2e42b4d4 48ClassImp(AliQA)
f73f556a 49AliQA * AliQA::fgQA = 0x0 ;
50TFile * AliQA::fgQADataFile = 0x0 ;
51TString AliQA::fgQADataFileName = "QA" ; // will transform into Det.QA.run.cycle.root
52TFile * AliQA::fgQARefFile = 0x0 ;
53TString AliQA::fgQARefDirName = "" ;
54TString AliQA::fgQARefFileName = "QA.root" ;
55TFile * AliQA::fgQAResultFile = 0x0 ;
56TString AliQA::fgQAResultDirName = "" ;
57TString AliQA::fgQAResultFileName = "QA.root" ;
58TString AliQA::fgDetNames[] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD",
4fb24ca4 59 "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT", "Global"} ;
60TString AliQA::fgGRPPath = "GRP/GRP/Data" ;
61TString AliQA::fgRTNames[] = {"UNKNOWN", "AUTO_TEST", "CALIBRATION", "CALIBRATION_PULSER", "CHANNEL_DELAY_TUNING", "COSMIC",
7ce961eb 62 "COSMICS", "DAQ_FO_UNIF_SCAN", "DAQ_GEN_DAC_SCAN", "DAQ_MEAN_TH_SCAN", "DAQ_MIN_TH_SCAN",
63 "DAQ_NOISY_PIX_SCAN", "DAQ_PIX_DELAY_SCAN", "DAQ_UNIFORMITY_SCAN", "DCS_FO_UNIF_SCAN",
64 "DCS_MEAN_TH_SCAN", "DCS_MIN_TH_SCAN", "DCS_PIX_DELAY_SCAN", "DCS_UNIFORMITY_SCAN",
65 "DDL_TEST", "GAIN", "PEDESTAL", "INJECTOR", "LASER", "MONTECARLO", "NOISE", "NOISY_PIX_SCAN",
66 "PHYSICS", "PULSER", "STANDALONE", "STANDALONE_BC", "STANDALONE_CENTRAL", "STANDALONE_COSMIC",
67 "STANDALONE_EMD", "STANDALONE_LASER", "STANDALONE_MB", "STANDALONE_PEDESTAL",
68 "STANDALONE_SEMICENTRAL", "STANDALONE_PULSER" } ;
f73f556a 69TString AliQA::fgTaskNames[] = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;
70const TString AliQA::fkgLabLocalFile = "file://" ;
71const TString AliQA::fkgLabLocalOCDB = "local://" ;
72const TString AliQA::fkgLabAliEnOCDB = "alien://" ;
73const TString AliQA::fkgRefFileName = "QA.root" ;
96d67a8d 74const TString AliQA::fkgQAName = "QA" ;
f73f556a 75const TString AliQA::fkgRefOCDBDirName = "Ref" ;
4fb24ca4 76TString AliQA::fkgRefDataDirName = "" ;
13c8b505 77const TString AliQA::fkgQARefOCDBDefault = "alien://folder=/alice/QA/20" ;
421ab0fb 78//____________________________________________________________________________
2e42b4d4 79AliQA::AliQA() :
421ab0fb 80 TNamed("", ""),
9a223722 81 fNdet(kNDET),
82 fQA(new ULong_t[fNdet]),
421ab0fb 83 fDet(kNULLDET),
84 fTask(kNULLTASK)
4edbc5bc 85
421ab0fb 86{
87 // default constructor
88 // beware singleton: not to be used
4ecde5fc 89
9a223722 90 for (Int_t index = 0 ; index < fNdet ; index++)
91 fQA[index] = 0 ;
421ab0fb 92}
93
94//____________________________________________________________________________
2e42b4d4 95AliQA::AliQA(const AliQA& qa) :
421ab0fb 96 TNamed(qa),
9a223722 97 fNdet(qa.fNdet),
421ab0fb 98 fQA(qa.fQA),
99 fDet(qa.fDet),
100 fTask(qa.fTask)
101{
102 // cpy ctor
103}
104
105//_____________________________________________________________________________
2e42b4d4 106AliQA& AliQA::operator = (const AliQA& qa)
421ab0fb 107{
108// assignment operator
109
2e42b4d4 110 this->~AliQA();
111 new(this) AliQA(qa);
421ab0fb 112 return *this;
113}
114
115//_______________________________________________________________
96d67a8d 116AliQA::AliQA(const DETECTORINDEX_t det) :
9a223722 117 TNamed("QA", "Quality Assurance status"),
118 fNdet(kNDET),
119 fQA(new ULong_t[fNdet]),
a5fa6165 120 fDet(det),
4edbc5bc 121 fTask(kNULLTASK)
a5fa6165 122{
123 // constructor to be used
124 if (! CheckRange(det) ) {
125 fDet = kNULLDET ;
126 return ;
a4976ef3 127 }
a5fa6165 128 Int_t index ;
9a223722 129 for (index = 0; index < fNdet; index++)
a5fa6165 130 fQA[index] = 0 ;
131}
132
133//_______________________________________________________________
96d67a8d 134AliQA::AliQA(const ALITASK_t tsk) :
421ab0fb 135 TNamed("QA", "Quality Assurance status"),
9a223722 136 fNdet(kNDET),
137 fQA(new ULong_t[fNdet]),
421ab0fb 138 fDet(kNULLDET),
139 fTask(tsk)
140{
141 // constructor to be used in the AliRoot module (SIM, REC, ESD or ANA)
142 if (! CheckRange(tsk) ) {
143 fTask = kNULLTASK ;
144 return ;
a4976ef3 145 }
a5fa6165 146 Int_t index ;
9a223722 147 for (index = 0; index < fNdet; index++)
a5fa6165 148 fQA[index] = 0 ;
421ab0fb 149}
150
151//____________________________________________________________________________
2e42b4d4 152AliQA::~AliQA()
421ab0fb 153{
154 // dtor
155 delete[] fQA ;
156}
157
46ca5304 158//_______________________________________________________________
159void AliQA::Close()
160{
161 // close the open files
162 if (fgQADataFile)
163 if (fgQADataFile->IsOpen())
164 fgQADataFile->Close() ;
165 if (fgQAResultFile)
166 if (fgQAResultFile->IsOpen())
167 fgQAResultFile->Close() ;
168 if (fgQARefFile)
169 if (fgQARefFile->IsOpen())
170 fgQARefFile->Close() ;
171}
172
4ecde5fc 173//_______________________________________________________________
174const Bool_t AliQA::CheckFatal() const
175{
176 // check if any FATAL status is set
177 Bool_t rv = kFALSE ;
178 Int_t index ;
179 for (index = 0; index < kNDET ; index++)
96d67a8d 180 rv = rv || IsSet(DETECTORINDEX_t(index), fTask, kFATAL) ;
4ecde5fc 181 return rv ;
182}
183
421ab0fb 184//_______________________________________________________________
96d67a8d 185const Bool_t AliQA::CheckRange(DETECTORINDEX_t det) const
421ab0fb 186{
a4976ef3 187 // check if detector is in given detector range: 0-kNDET
421ab0fb 188
a5fa6165 189 Bool_t rv = ( det < 0 || det > kNDET ) ? kFALSE : kTRUE ;
421ab0fb 190 if (!rv)
191 AliFatal(Form("Detector index %d is out of range: 0 <= index <= %d", det, kNDET)) ;
192 return rv ;
193}
194
195//_______________________________________________________________
96d67a8d 196const Bool_t AliQA::CheckRange(ALITASK_t task) const
421ab0fb 197{
198 // check if task is given taskk range: 0:kNTASK
6c18591a 199 Bool_t rv = ( task < kRAW || task > kNTASK ) ? kFALSE : kTRUE ;
421ab0fb 200 if (!rv)
201 AliFatal(Form("Module index %d is out of range: 0 <= index <= %d", task, kNTASK)) ;
202 return rv ;
203}
204
205//_______________________________________________________________
96d67a8d 206const Bool_t AliQA::CheckRange(QABIT_t bit) const
421ab0fb 207{
208 // check if bit is in given bit range: 0-kNBit
209
210 Bool_t rv = ( bit < 0 || bit > kNBIT ) ? kFALSE : kTRUE ;
211 if (!rv)
212 AliFatal(Form("Status bit %d is out of range: 0 <= bit <= %d", bit, kNBIT)) ;
213 return rv ;
214}
215
421ab0fb 216
4ecde5fc 217
a5fa6165 218//_______________________________________________________________
96d67a8d 219const char * AliQA::GetAliTaskName(ALITASK_t tsk)
421ab0fb 220{
0b96c27c 221 // returns the char name corresponding to module index
222 TString tskName ;
223 switch (tsk) {
224 case kNULLTASK:
225 break ;
226 case kRAW:
227 tskName = "RAW" ;
228 break ;
229 case kSIM:
230 tskName = "SIM" ;
231 break ;
232 case kREC:
233 tskName = "REC" ;
234 break ;
235 case kESD:
236 tskName = "ESD" ;
237 break ;
238 case kANA:
239 tskName = "ANA" ;
240 break ;
241 default:
242 tsk = kNULLTASK ;
243 break ;
244 }
245 return tskName.Data() ;
246}
247//_______________________________________________________________
248const char * AliQA::GetBitName(QABIT_t bit) const
249{
250 // returns the char name corresponding to bit
251 TString bitName ;
252 switch (bit) {
253 case kNULLBit:
254 break ;
255 case kINFO:
256 bitName = "INFO" ;
257 break ;
258 case kWARNING:
259 bitName = "WARNING" ;
260 break ;
261 case kERROR:
262 bitName = "ERROR" ;
263 break ;
264 case kFATAL:
265 bitName = "FATAL" ;
266 break ;
267 default:
268 bit = kNULLBit ;
269 break ;
270 }
271 return bitName.Data() ;
421ab0fb 272}
273
46ca5304 274//_______________________________________________________________
7c002d48 275const AliQA::DETECTORINDEX_t AliQA::GetDetIndex(const char * name)
96d67a8d 276{
277 // returns the detector index corresponding to a given name
278 TString sname(name) ;
279 DETECTORINDEX_t rv = kNULLDET ;
280 for (Int_t det = 0; det < kNDET ; det++) {
281 if ( GetDetName(det) == sname ) {
282 rv = DETECTORINDEX_t(det) ;
283 break ;
284 }
285 }
286 return rv ;
287}
288
7c002d48 289//_______________________________________________________________
290const char * AliQA::GetDetName(Int_t det)
291{
292 // returns the detector name corresponding to a given index (needed in a loop)
293
294 if ( det >= 0 && det < kNDET)
295 return (fgDetNames[det]).Data() ;
296 else
297 return NULL ;
298}
299
46ca5304 300//_______________________________________________________________
301TFile * AliQA::GetQADataFile(const char * name, const Int_t run, const Int_t cycle)
302{
303 // opens the file to store the detectors Quality Assurance Data Maker results
96d67a8d 304 const char * temp = Form("%s.%s.%d.%d.root", name, fgQADataFileName.Data(), run, cycle) ;
305 TString opt ;
306 if (! fgQADataFile ) {
307 if (gSystem->AccessPathName(temp))
308 opt = "NEW" ;
309 else
310 opt = "UPDATE" ;
311 fgQADataFile = TFile::Open(temp, opt.Data()) ;
312 } else {
313 if ( strcmp(temp, fgQADataFile->GetName()) != 0 ) {
314 fgQADataFile = dynamic_cast<TFile *>(gROOT->FindObject(temp)) ;
315 if ( !fgQADataFile ) {
316 if (gSystem->AccessPathName(temp))
317 opt = "NEW" ;
318 else
319 opt = "UPDATE" ;
320 fgQADataFile = TFile::Open(temp, opt.Data()) ;
321 }
322 }
46ca5304 323 }
96d67a8d 324 return fgQADataFile ;
46ca5304 325}
326
327//_____________________________________________________________________________
328TFile * AliQA::GetQADataFile(const char * fileName)
329{
330 // Open if necessary the Data file and return its pointer
331
332 if (!fgQADataFile)
333 if (!fileName)
334 fileName = AliQA::GetQADataFileName() ;
335 if (!gSystem->AccessPathName(fileName)) {
336 fgQADataFile = TFile::Open(fileName) ;
337 } else {
338 printf("File %s not found", fileName) ;
339 exit(1) ;
340 }
341 return fgQADataFile ;
342}
343
4ecde5fc 344//_______________________________________________________________
345TFile * AliQA::GetQAResultFile()
346{
347 // opens the file to store the Quality Assurance Data Checker results
2ba0b5f5 348 if (fgQAResultFile)
349 fgQAResultFile->Close() ;
350 fgQAResultFile = 0x0 ;
351// if (!fgQAResultFile) {
1c0190ec 352 TString dirName(fgQAResultDirName) ;
4edbc5bc 353 if ( dirName.Contains(fkgLabLocalFile))
354 dirName.ReplaceAll(fkgLabLocalFile, "") ;
1c0190ec 355 TString fileName(dirName + fgQAResultFileName) ;
46ca5304 356 TString opt("") ;
357 if ( !gSystem->AccessPathName(fileName) )
358 opt = "UPDATE" ;
5bd22145 359 else {
1c0190ec 360 if ( gSystem->AccessPathName(dirName) )
361 gSystem->mkdir(dirName) ;
46ca5304 362 opt = "NEW" ;
5bd22145 363 }
46ca5304 364 fgQAResultFile = TFile::Open(fileName, opt) ;
2ba0b5f5 365// }
46ca5304 366
367 return fgQAResultFile ;
421ab0fb 368}
369
51757634 370//_______________________________________________________________
371const TString AliQA::GetRunTypeName(RUNTYPE_t rt)
372{
373 TString rv("Invalid Run Type") ;
374 if ( rt == kNULLTYPE ) {
375 rv = "Known RUN_TYPE are: \n" ;
376 for (Int_t index = 0 ; index < kNTYPE; index++) {
377 rv += Form("%2d -- %s\n", index, fgRTNames[index].Data()) ;
378 }
379 printf("%s", rv.Data()) ;
380 return "" ;
381 }
382 else {
383 if ( rt > kNULLTYPE && rt < kNTYPE )
384 rv = fgRTNames[rt] ;
385 }
386 return rv ;
387}
388
940d8e5f 389//_______________________________________________________________
390const AliQA::TASKINDEX_t AliQA::GetTaskIndex(const char * name)
391{
392 // returns the detector index corresponding to a given name
393 TString sname(name) ;
394 TASKINDEX_t rv ;
75f6ebf0 395 for (Int_t tsk = 0; tsk < kNTASKINDEX ; tsk++) {
940d8e5f 396 if ( GetTaskName(tsk) == sname ) {
397 rv = TASKINDEX_t(tsk) ;
398 break ;
399 }
400 }
401 return rv ;
402}
403
421ab0fb 404//_______________________________________________________________
96d67a8d 405const Bool_t AliQA::IsSet(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) const
421ab0fb 406{
407 // Checks is the requested bit is set
384c0618 408
421ab0fb 409 CheckRange(det) ;
410 CheckRange(tsk) ;
411 CheckRange(bit) ;
384c0618 412
421ab0fb 413 ULong_t offset = Offset(tsk) ;
414 ULong_t status = GetStatus(det) ;
415 offset+= bit ;
416 status = (status & 1 << offset) != 0 ;
417 return status ;
418}
419
384c0618 420//_______________________________________________________________
421const Bool_t AliQA::IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk) const
422{
423 // Checks is the requested bit is set
424
425 CheckRange(det) ;
426 CheckRange(tsk) ;
427
428 ULong_t offset = Offset(tsk) ;
429 ULong_t status = GetStatus(det) ;
430 UShort_t st = 0 ;
431 for ( Int_t bit = 0 ; bit < kNBIT ; bit++) {
432 offset+= bit ;
433 st += (status & 1 << offset) != 0 ;
434 }
435 if ( st == 0 )
436 return kFALSE ;
437 else
438 return kTRUE ;
439}
440//_______________________________________________________________
441const Bool_t AliQA::IsSetAny(DETECTORINDEX_t det) const
442{
443 // Checks is the requested bit is set
444
445 CheckRange(det) ;
446
447 ULong_t status = GetStatus(det) ;
448 UShort_t st = 0 ;
449 for ( Int_t tsk = 0 ; tsk < kNTASK ; tsk++) {
450 ULong_t offset = Offset(ALITASK_t(tsk)) ;
451 for ( Int_t bit = 0 ; bit < kNBIT ; bit++) {
452 offset+= bit ;
453 st += (status & 1 << offset) != 0 ;
454 }
455 }
456 if ( st == 0 )
457 return kFALSE ;
458 else
459 return kTRUE ;
460}
461
421ab0fb 462//_______________________________________________________________
2e42b4d4 463AliQA * AliQA::Instance()
421ab0fb 464{
465 // Get an instance of the singleton.
466 // Object must have been instantiated with Instance(ALITASK) first
467
468 return fgQA ;
469}
470
471//_______________________________________________________________
96d67a8d 472AliQA * AliQA::Instance(const DETECTORINDEX_t det)
421ab0fb 473{
474 // Get an instance of the singleton. The only authorized way to call the ctor
475
9a223722 476 if ( ! fgQA) {
46ca5304 477 TFile * f = GetQAResultFile() ;
9a223722 478 fgQA = dynamic_cast<AliQA *>(f->Get("QA")) ;
479 if ( ! fgQA )
480 fgQA = new AliQA(det) ;
481 }
421ab0fb 482 fgQA->Set(det) ;
483 return fgQA ;
484}
485
486//_______________________________________________________________
96d67a8d 487AliQA * AliQA::Instance(const ALITASK_t tsk)
421ab0fb 488{
489 // get an instance of the singleton.
490
491 if ( ! fgQA)
492 switch (tsk) {
493 case kNULLTASK:
494 break ;
6c18591a 495 case kRAW:
2e42b4d4 496 fgQA = new AliQA(tsk) ;
6c18591a 497 break ;
498 case kSIM:
2e42b4d4 499 fgQA = new AliQA(tsk) ;
421ab0fb 500 break ;
501 case kREC:
502 printf("fgQA = gAlice->GetQA()") ;
503 break ;
504 case kESD:
505 printf("fgQA = dynamic_cast<AliQA *> (esdFile->Get(\"QA\")") ;
506 break ;
507 case kANA:
508 printf("fgQA = dynamic_cast<AliQA *> (esdFile->Get(\"QA\")") ;
509 break ;
510 case kNTASK:
511 break ;
512 }
513 if (fgQA)
514 fgQA->Set(tsk) ;
515 return fgQA ;
516}
517
518//_______________________________________________________________
96d67a8d 519AliQA * AliQA::Instance(const TASKINDEX_t tsk)
520{
521 // get an instance of the singleton.
522
523 ALITASK_t index = kNULLTASK ;
524
525 if ( tsk == kRAWS )
526 index = kRAW ;
527 else if (tsk < kDIGITS)
528 index = kSIM ;
529 else if (tsk < kRECPARTICLES)
530 index = kREC ;
531 else if (tsk == kESDS)
532 index = kESD ;
533
534 return Instance(index) ;
535}
536
537//_______________________________________________________________
538const ULong_t AliQA::Offset(ALITASK_t tsk) const
421ab0fb 539{
540 // Calculates the bit offset for a given module (SIM, REC, ESD, ANA)
541
542 CheckRange(tsk) ;
543
544 ULong_t offset = 0 ;
545 switch (tsk) {
546 case kNULLTASK:
547 break ;
6c18591a 548 case kRAW:
421ab0fb 549 offset+= 0 ;
550 break ;
6c18591a 551 case kSIM:
421ab0fb 552 offset+= 4 ;
553 break ;
6c18591a 554 case kREC:
421ab0fb 555 offset+= 8 ;
556 break ;
6c18591a 557 case kESD:
421ab0fb 558 offset+= 12 ;
559 break ;
6c18591a 560 case kANA:
561 offset+= 16 ;
562 break ;
421ab0fb 563 case kNTASK:
564 break ;
565 }
566
567 return offset ;
568}
569
570//_______________________________________________________________
96d67a8d 571void AliQA::Set(QABIT_t bit)
421ab0fb 572{
573 // Set the status bit of the current detector in the current module
574
575 SetStatusBit(fDet, fTask, bit) ;
576}
577
4ecde5fc 578//_____________________________________________________________________________
4edbc5bc 579void AliQA::SetQARefStorage(const char * name)
4ecde5fc 580{
72c25501 581 // Set the root directory where the QA reference data are stored
582
583 fgQARefDirName = name ;
584 if ( fgQARefDirName.Contains(fkgLabLocalFile) )
585 fgQARefFileName = fkgRefFileName ;
586 else if ( fgQARefDirName.Contains(fkgLabLocalOCDB) )
96d67a8d 587 fgQARefFileName = fkgQAName ;
72c25501 588 else if ( fgQARefDirName.Contains(fkgLabAliEnOCDB) )
96d67a8d 589 fgQARefFileName = fkgQAName ;
4ecde5fc 590
4edbc5bc 591 else {
592 printf("ERROR: %s is an invalid storage definition\n", name) ;
593 fgQARefDirName = "" ;
594 fgQARefFileName = "" ;
595 }
72c25501 596 TString tmp(fgQARefDirName) ; // + fgQARefFileName) ;
4edbc5bc 597 printf("AliQA::SetQARefDir: QA references are in %s\n", tmp.Data() ) ;
4ecde5fc 598}
599
4fb24ca4 600//_____________________________________________________________________________
601void AliQA::SetQARefDataDirName(const char * name)
602{
603 // Set the lower level directory name where reference data are found
604 TString test(name) ;
7ce961eb 605 RUNTYPE_t rt = kNULLTYPE ;
606 for (Int_t index = 0; index < kNTYPE; index++) {
607 if (test.CompareTo(fgRTNames[index]) == 0) {
4fb24ca4 608 rt = (RUNTYPE_t) index ;
609 break ;
7ce961eb 610 }
611 }
612
613 if (rt == kNULLTYPE) {
4fb24ca4 614 printf("AliQA::SetQARefDataDirName: %s is an unknown RUN TYPE name\n", name) ;
615 return ;
7ce961eb 616 }
617
618 SetQARefDataDirName(rt) ;
4fb24ca4 619}
620
4ecde5fc 621//_____________________________________________________________________________
622void AliQA::SetQAResultDirName(const char * name)
623{
624 // Set the root directory where to store the QA status object
625
626 fgQAResultDirName.Prepend(name) ;
627 printf("AliQA::SetQAResultDirName: QA results are in %s\n", fgQAResultDirName.Data()) ;
4edbc5bc 628 if ( fgQAResultDirName.Contains(fkgLabLocalFile))
629 fgQAResultDirName.ReplaceAll(fkgLabLocalFile, "") ;
4ecde5fc 630 fgQAResultFileName.Prepend(fgQAResultDirName) ;
631}
632
421ab0fb 633//_______________________________________________________________
96d67a8d 634void AliQA::SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit)
421ab0fb 635{
636 // Set the status bit for a given detector and a given task
637
638 CheckRange(det) ;
639 CheckRange(tsk) ;
640 CheckRange(bit) ;
641
642 ULong_t offset = Offset(tsk) ;
643 ULong_t status = GetStatus(det) ;
644 offset+= bit ;
645 status = status | 1 << offset ;
646 SetStatus(det, status) ;
647}
648
649//_______________________________________________________________
2e42b4d4 650void AliQA::ShowAll() const
421ab0fb 651{
652 // dispplay the QA status word
653 Int_t index ;
15df7cc8 654 for (index = 0 ; index < kNDET ; index++) {
655 for (Int_t tsk = kRAW ; tsk < kNTASK ; tsk++) {
656 ShowStatus(DETECTORINDEX_t(index), ALITASK_t(tsk)) ;
657 }
658 }
421ab0fb 659}
660
661//_______________________________________________________________
15df7cc8 662void AliQA::ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk) const
421ab0fb 663{
0b96c27c 664 // Prints the full QA status of a given detector
665 CheckRange(det) ;
666 ULong_t status = GetStatus(det) ;
667 ULong_t tskStatus[kNTASK] ;
668 tskStatus[kRAW] = status & 0x0000f ;
669 tskStatus[kSIM] = status & 0x000f0 ;
670 tskStatus[kREC] = status & 0x00f00 ;
671 tskStatus[kESD] = status & 0x0f000 ;
672 tskStatus[kANA] = status & 0xf0000 ;
673
674 AliInfo(Form("====> QA Status for %8s raw =0x%x, sim=0x%x, rec=0x%x, esd=0x%x, ana=0x%x", GetDetName(det).Data(),
675 tskStatus[kRAW], tskStatus[kSIM], tskStatus[kREC], tskStatus[kESD], tskStatus[kANA] )) ;
15df7cc8 676 if (tsk == kNULLTASK) {
677 for (Int_t itsk = kRAW ; itsk < kNTASK ; itsk++) {
678 ShowASCIIStatus(det, ALITASK_t(itsk), tskStatus[itsk]) ;
679 }
680 } else {
681 ShowASCIIStatus(det, tsk, tskStatus[tsk]) ;
0b96c27c 682 }
683}
421ab0fb 684
0b96c27c 685//_______________________________________________________________
686void AliQA::ShowASCIIStatus(DETECTORINDEX_t det, ALITASK_t tsk, const ULong_t status) const
687{
688 // print the QA status in human readable format
689 TString text;
690 for (Int_t bit = kINFO ; bit < kNBIT ; bit++) {
691 if (IsSet(det, tsk, QABIT_t(bit))) {
692 text = GetBitName(QABIT_t(bit)) ;
693 text += " " ;
694 }
695 }
696 if (! text.IsNull())
697 printf(" %8s %4s 0x%4x, Problem signalled: %8s \n", GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data()) ;
421ab0fb 698}
699
96d67a8d 700//_______________________________________________________________
701void AliQA::UnSet(QABIT_t bit)
702{
703 // UnSet the status bit of the current detector in the current module
704
705 UnSetStatusBit(fDet, fTask, bit) ;
706}
707
708//_______________________________________________________________
709void AliQA::UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit)
710{
711 // UnSet the status bit for a given detector and a given task
712
713 CheckRange(det) ;
714 CheckRange(tsk) ;
715 CheckRange(bit) ;
716
717 ULong_t offset = Offset(tsk) ;
718 ULong_t status = GetStatus(det) ;
719 offset+= bit ;
720 status = status & 0 << offset ;
721 SetStatus(det, status) ;
92a357bf 722}