bug fix in T00 alias names
[u/mrichter/AliRoot.git] / STEER / AliQualAss.h
CommitLineData
421ab0fb 1#ifndef ALIQualAss_H
2#define ALIQualAss_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//
9// Quality Assurance Object
10//
11
a5fa6165 12#include <TNamed.h>
421ab0fb 13class TFile ;
14
7079c8d7 15#include "AliLog.h"
16
421ab0fb 17class AliQualAss : public TNamed {
18public:
19
20 enum DETECTORINDEX {
21 kNULLDET=-1, kITS, kTPC, kTRD, kTOF, kPHOS, kHMPID, kEMCAL, kMUON, kFMD,
22 kZDC, kPMD, kT0, kVZERO, kACORDE, kHLT, kNDET
23 };
24 enum ALITASK {
6c18591a 25 kNULLTASK=-1, kRAW, kSIM, kREC, kESD, kANA, kNTASK
421ab0fb 26 };
27 enum QABIT {
28 kNULLBit=-1, kINFO, kWARNING, kERROR, kFATAL, kNBIT
29 };
30
31 enum TASKINDEX {
6c18591a 32 kRAWS, kHITS, kSDIGITS, kDIGITS, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS
421ab0fb 33 };
34
35 // Creators - destructors
36 AliQualAss(); // beware singleton, not to be used
a5fa6165 37 AliQualAss(const ALITASK tsk) ;
38 AliQualAss(const DETECTORINDEX det) ;
421ab0fb 39 AliQualAss(const AliQualAss& qa) ;
40 AliQualAss& operator = (const AliQualAss& qa) ;
41 virtual ~AliQualAss();
42
43 static AliQualAss * Instance() ;
a5fa6165 44 static AliQualAss * Instance(const DETECTORINDEX det) ;
45 static AliQualAss * Instance(const ALITASK tsk) ;
421ab0fb 46 const Bool_t CheckFatal() const ;
a5fa6165 47 static const char * GetAliTaskName(ALITASK tsk) ;
48 static const char * GetDataName() { return fgDataName.Data() ; }
49 static const TString GetDetName(DETECTORINDEX det) { return fgDetNames[det] ; }
50 static const TString GetTaskName(TASKINDEX tsk) { return fgTaskNames[tsk] ; }
51 static const char * GetDetName(Int_t det) ;
d62f9368 52 static TFile * GetQADMOutFile(const char * name, const Int_t run, const Int_t cycle) ;
421ab0fb 53 void Set(QABIT bit) ;
54 void Show() const { ShowStatus(fDet) ; }
55 void ShowAll() const ;
a4976ef3 56 void print() { printf("%d %x\n", kNDET, fQA) ; }
421ab0fb 57
58private:
59
60 const Bool_t CheckRange(DETECTORINDEX det) const ;
61 const Bool_t CheckRange(ALITASK tsk) const ;
62 const Bool_t CheckRange(QABIT bit) const ;
421ab0fb 63 const char * GetBitName(QABIT bit) const ;
64 const ULong_t GetStatus(DETECTORINDEX det) const { return fQA[det] ;}
65 void Finish() const ;
66 const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
67 const ULong_t Offset(ALITASK tsk) const ;
68 virtual void ShowStatus(DETECTORINDEX det) const ;
69 void ResetStatus(DETECTORINDEX det) { fQA[det] = 0 ; }
70 void Set(DETECTORINDEX det) { fDet = det ;}
a5fa6165 71 void Set(ALITASK tsk) { fTask = tsk ; AliInfo(Form("Ready to set QA status in %s", GetAliTaskName(tsk) )) ; }
421ab0fb 72 void SetStatus(DETECTORINDEX det, UShort_t status) { fQA[det] = status ; }
73 void SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ;
74
75 static AliQualAss *fgQA ; // pointer to the instance of the singleton
a4976ef3 76 ULong_t * fQA ; //[kNDET] the status word 4 bits for SIM, REC, ESD, ANA each
421ab0fb 77 DETECTORINDEX fDet ; //! the current detector (ITS, TPC, ....)
78 ALITASK fTask ; //! the current environment (SIM, REC, ESD, ANA)
a5fa6165 79 static TFile * fgDataFile ; //! the output file where the quality assurance maker store their results
80 static TString fgDataName ; //! the name of the file where the quality assurance maker store their results
81 static TString fgDetNames[] ; //! list of detector names
82 static TString fgTaskNames[]; //! list of tasks names
83 ClassDef(AliQualAss,1) //ALICE Quality Assurance Object
421ab0fb 84};
85#endif