add ConnectionStatus and ConnectionError to virtual interface
[u/mrichter/AliRoot.git] / STEER / AliQA.h
CommitLineData
2e42b4d4 1#ifndef ALIQA_H
2#define ALIQA_H
421ab0fb 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
2e42b4d4 17class AliQA : public TNamed {
421ab0fb 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
2e42b4d4 36 AliQA(); // beware singleton, not to be used
37 AliQA(const ALITASK tsk) ;
38 AliQA(const DETECTORINDEX det) ;
39 AliQA(const AliQA& qa) ;
40 AliQA& operator = (const AliQA& qa) ;
41 virtual ~AliQA();
421ab0fb 42
2e42b4d4 43 static AliQA * Instance() ;
44 static AliQA * Instance(const DETECTORINDEX det) ;
45 static AliQA * Instance(const ALITASK tsk) ;
4ecde5fc 46 const Bool_t AddQAData2CDB(const char * defSto) const ;
421ab0fb 47 const Bool_t CheckFatal() const ;
46ca5304 48 static void Close() ;
a5fa6165 49 static const char * GetAliTaskName(ALITASK tsk) ;
a5fa6165 50 static const TString GetDetName(DETECTORINDEX det) { return fgDetNames[det] ; }
51 static const TString GetTaskName(TASKINDEX tsk) { return fgTaskNames[tsk] ; }
52 static const char * GetDetName(Int_t det) ;
46ca5304 53 static const char * GetQADataFileName() { return fgQADataFileName.Data() ; }
54 static TFile * GetQADataFile(const char * name, const Int_t run, const Int_t cycle) ;
55 static TFile * GetQADataFile(const char * fileName) ;
4ecde5fc 56 static TFile * GetQAResultFile() ;
57 static TFile * GetQARefFile() ;
58 static const char * GetQAResultFileName() { return (fgQAResultDirName + fgQAResultFileName).Data() ; }
59 static const char * GetQARefFileName() { return (fgQARefDirName + fgQARefFileName).Data() ; }
9a223722 60 const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
421ab0fb 61 void Set(QABIT bit) ;
4ecde5fc 62 static void SetQAResultDirName(const char * name) ;
63 static void SetQARefDir(const char * name) ;
421ab0fb 64 void Show() const { ShowStatus(fDet) ; }
65 void ShowAll() const ;
66
67private:
68
69 const Bool_t CheckRange(DETECTORINDEX det) const ;
70 const Bool_t CheckRange(ALITASK tsk) const ;
71 const Bool_t CheckRange(QABIT bit) const ;
421ab0fb 72 const char * GetBitName(QABIT bit) const ;
73 const ULong_t GetStatus(DETECTORINDEX det) const { return fQA[det] ;}
74 void Finish() const ;
421ab0fb 75 const ULong_t Offset(ALITASK tsk) const ;
76 virtual void ShowStatus(DETECTORINDEX det) const ;
77 void ResetStatus(DETECTORINDEX det) { fQA[det] = 0 ; }
78 void Set(DETECTORINDEX det) { fDet = det ;}
a5fa6165 79 void Set(ALITASK tsk) { fTask = tsk ; AliInfo(Form("Ready to set QA status in %s", GetAliTaskName(tsk) )) ; }
421ab0fb 80 void SetStatus(DETECTORINDEX det, UShort_t status) { fQA[det] = status ; }
81 void SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ;
82
4ecde5fc 83 static AliQA *fgQA ; // pointer to the instance of the singleton
84 Int_t fNdet ; // number of detectors
85 ULong_t * fQA ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each
86 DETECTORINDEX fDet ; //! the current detector (ITS, TPC, ....)
87 ALITASK fTask ; //! the current environment (SIM, REC, ESD, ANA)
4ecde5fc 88 static TString fgDetNames[] ; //! list of detector names
46ca5304 89 static TFile * fgQADataFile ; //! the output file where the quality assurance maker store their results
90 static TString fgQADataFileName ; //! the name of the file where the quality assurance maker store their results
91 static TFile * fgQARefFile ; //! the output file where the quality assurance maker store their results
4ecde5fc 92 static TString fgQARefDirName ; //! name of directory where to find the reference data file
93 static TString fgQARefFileName ; //! file name where to find the reference data
46ca5304 94 static TFile * fgQAResultFile ; //! File where to find the QA result
95 static TString fgQAResultDirName ; //! the location of the output file where the QA results are stored
96 static TString fgQAResultFileName ; //! the output file where the QA results are stored
4ecde5fc 97 static TString fgTaskNames[] ; //! list of tasks names
2e42b4d4 98
99 ClassDef(AliQA,1) //ALICE Quality Assurance Object
421ab0fb 100};
101#endif