New QA classes (Yves)
[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
12#include <TNamed.h>
13class TFile ;
14
15class AliQualAss : public TNamed {
16public:
17
18 enum DETECTORINDEX {
19 kNULLDET=-1, kITS, kTPC, kTRD, kTOF, kPHOS, kHMPID, kEMCAL, kMUON, kFMD,
20 kZDC, kPMD, kT0, kVZERO, kACORDE, kHLT, kNDET
21 };
22 enum ALITASK {
23 kNULLTASK=-1, kSIM, kREC, kESD, kANA, kNTASK
24 };
25 enum QABIT {
26 kNULLBit=-1, kINFO, kWARNING, kERROR, kFATAL, kNBIT
27 };
28
29 enum TASKINDEX {
30 kHITS, kSDIGITS, kDIGITS, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS
31 };
32
33 // Creators - destructors
34 AliQualAss(); // beware singleton, not to be used
35 AliQualAss(ALITASK tsk) ;
36 AliQualAss(const AliQualAss& qa) ;
37 AliQualAss& operator = (const AliQualAss& qa) ;
38 virtual ~AliQualAss();
39
40 static AliQualAss * Instance() ;
41 static AliQualAss * Instance(DETECTORINDEX det) ;
42 static AliQualAss * Instance(ALITASK tsk) ;
43 const Bool_t CheckFatal() const ;
44 static const char * GetOutputName() { return fgOutputName.Data() ; }
45 static TFile * GetQADMOutFile() ;
46 void Set(QABIT bit) ;
47 void Show() const { ShowStatus(fDet) ; }
48 void ShowAll() const ;
49
50private:
51
52 const Bool_t CheckRange(DETECTORINDEX det) const ;
53 const Bool_t CheckRange(ALITASK tsk) const ;
54 const Bool_t CheckRange(QABIT bit) const ;
55 const char * GetDetectorName(DETECTORINDEX det) const ;
56 const char * GetTaskName(ALITASK tsk) const ;
57 const char * GetBitName(QABIT bit) const ;
58 const ULong_t GetStatus(DETECTORINDEX det) const { return fQA[det] ;}
59 void Finish() const ;
60 const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
61 const ULong_t Offset(ALITASK tsk) const ;
62 virtual void ShowStatus(DETECTORINDEX det) const ;
63 void ResetStatus(DETECTORINDEX det) { fQA[det] = 0 ; }
64 void Set(DETECTORINDEX det) { fDet = det ;}
65 void Set(ALITASK tsk) { fTask = tsk ; AliInfo(Form("Ready to set QA status in %s\n", GetTaskName(tsk) )) ; }
66 void SetStatus(DETECTORINDEX det, UShort_t status) { fQA[det] = status ; }
67 void SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ;
68
69 static AliQualAss *fgQA ; // pointer to the instance of the singleton
70 Int_t fNdet ; // # of detectors
71 ULong_t * fQA ; //[kNDET] the status word 4 bits for SIM, REC, ESD, ANA each
72 DETECTORINDEX fDet ; //! the current detector (ITS, TPC, ....)
73 ALITASK fTask ; //! the current environment (SIM, REC, ESD, ANA)
74 static TFile * fgOutput ; //! the output file where the quality assurance maker store their results
75 static TString fgOutputName ; //! the output name file where the quality assurance maker store their results
76
77 ClassDef(AliQualAss,1) //ALICE Quality Assurance Obbject
78};
79#endif