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