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 |
13 | class TFile ; |
14 | |
7079c8d7 |
15 | #include "AliLog.h" |
16 | |
2e42b4d4 |
17 | class AliQA : public TNamed { |
421ab0fb |
18 | public: |
19 | |
4edbc5bc |
20 | enum DETECTORINDEX { |
421ab0fb |
21 | kNULLDET=-1, kITS, kTPC, kTRD, kTOF, kPHOS, kHMPID, kEMCAL, kMUON, kFMD, |
4edbc5bc |
22 | kZDC, kPMD, kT0, kVZERO, kACORDE, kHLT, kNDET }; |
23 | enum ALITASK { |
24 | kNULLTASK=-1, kRAW, kSIM, kREC, kESD, kANA, kNTASK }; |
25 | enum QABIT { |
26 | kNULLBit=-1, kINFO, kWARNING, kERROR, kFATAL, kNBIT }; |
421ab0fb |
27 | |
4edbc5bc |
28 | enum TASKINDEX { |
29 | kRAWS, kHITS, kSDIGITS, kDIGITS, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS, kNTASKINDEX }; |
421ab0fb |
30 | |
4edbc5bc |
31 | // Creators - destructors |
32 | AliQA(); // beware singleton, not to be used |
33 | AliQA(const ALITASK tsk) ; |
34 | AliQA(const DETECTORINDEX det) ; |
35 | AliQA(const AliQA& qa) ; |
36 | AliQA& operator = (const AliQA& qa) ; |
37 | virtual ~AliQA(); |
421ab0fb |
38 | |
4edbc5bc |
39 | static AliQA * Instance() ; |
40 | static AliQA * Instance(const DETECTORINDEX det) ; |
41 | static AliQA * Instance(const ALITASK tsk) ; |
4edbc5bc |
42 | const Bool_t CheckFatal() const ; |
43 | static void Close() ; |
44 | static const char * GetAliTaskName(ALITASK tsk) ; |
45 | static const TString GetLabLocalFile() { return fkgLabLocalFile ; } |
46 | static const TString GetLabLocalOCDB() { return fkgLabLocalOCDB ; } |
47 | static const TString GetLabAliEnOCDB() { return fkgLabAliEnOCDB ; } |
48 | static const TString GetDetName(DETECTORINDEX det) { return fgDetNames[det] ; } |
49 | static const TString GetTaskName(TASKINDEX tsk) { return fgTaskNames[tsk] ; } |
50 | static const char * GetDetName(Int_t det) ; |
51 | static const char * GetQADataFileName() { return fgQADataFileName.Data() ; } |
52 | static TFile * GetQADataFile(const char * name, const Int_t run, const Int_t cycle) ; |
53 | static TFile * GetQADataFile(const char * fileName) ; |
54 | static TFile * GetQAResultFile() ; |
55 | static const char * GetQAResultFileName() { return (fgQAResultDirName + fgQAResultFileName).Data() ; } |
f73f556a |
56 | static const char * GetQARefDefaultStorage() { return fkgQARefOCDBDefault.Data() ; } |
4edbc5bc |
57 | static const char * GetQARefFileName() { return fgQARefFileName ; } |
58 | static const char * GetQARefStorage() { return fgQARefDirName.Data() ; } |
f73f556a |
59 | static const char * GetQAOCDBDirName() { return fkgQAOCDBDirName.Data() ; } |
60 | static const char * GetRefOCDBDirName() { return fkgRefOCDBDirName.Data() ; } |
107bb232 |
61 | static const char * GetRefDataDirName() { return fkgRefDataDirName.Data() ; } |
4edbc5bc |
62 | const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ; |
63 | void Set(QABIT bit) ; |
64 | static void SetQAResultDirName(const char * name) ; |
65 | static void SetQARefStorage(const char * name) ; |
66 | void Show() const { ShowStatus(fDet) ; } |
67 | void ShowAll() const ; |
421ab0fb |
68 | |
69 | private: |
70 | |
4edbc5bc |
71 | const Bool_t CheckRange(DETECTORINDEX det) const ; |
72 | const Bool_t CheckRange(ALITASK tsk) const ; |
73 | const Bool_t CheckRange(QABIT bit) const ; |
74 | const char * GetBitName(QABIT bit) const ; |
75 | const ULong_t GetStatus(DETECTORINDEX det) const { return fQA[det] ;} |
76 | void Finish() const ; |
77 | const ULong_t Offset(ALITASK tsk) const ; |
78 | virtual void ShowStatus(DETECTORINDEX det) const ; |
79 | void ResetStatus(DETECTORINDEX det) { fQA[det] = 0 ; } |
80 | void Set(DETECTORINDEX det) { fDet = det ;} |
2ba0b5f5 |
81 | void Set(ALITASK tsk) { fTask = tsk ; AliDebug(1, Form("Ready to set QA status in %s", GetAliTaskName(tsk) )) ; } |
4edbc5bc |
82 | void SetStatus(DETECTORINDEX det, UShort_t status) { fQA[det] = status ; } |
83 | void SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ; |
421ab0fb |
84 | |
4edbc5bc |
85 | static AliQA *fgQA ; // pointer to the instance of the singleton |
86 | Int_t fNdet ; // number of detectors |
87 | ULong_t * fQA ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each |
88 | DETECTORINDEX fDet ; //! the current detector (ITS, TPC, ....) |
89 | ALITASK fTask ; //! the current environment (SIM, REC, ESD, ANA) |
90 | static TString fgDetNames[] ; //! list of detector names |
91 | static TFile * fgQADataFile ; //! the output file where the quality assurance maker store their results |
92 | static TString fgQADataFileName ; //! the name of the file where the quality assurance maker store their results |
93 | static TFile * fgQARefFile ; //! the output file where the quality assurance maker store their results |
94 | static TString fgQARefDirName ; //! name of directory where to find the reference data file |
95 | static TString fgQARefFileName ; //! file name where to find the reference data |
96 | static TFile * fgQAResultFile ; //! File where to find the QA result |
97 | static TString fgQAResultDirName ; //! the location of the output file where the QA results are stored |
98 | static TString fgQAResultFileName ; //! the output file where the QA results are stored |
99 | static TString fgTaskNames[] ; //! list of tasks names |
100 | static const TString fkgLabLocalFile ; //! label to identify a file as local |
101 | static const TString fkgLabLocalOCDB ; //! label to identify a file as local OCDB |
102 | static const TString fkgLabAliEnOCDB ; //! label to identify a file as AliEn OCDB |
103 | static const TString fkgRefFileName ; //! name of Reference File Name |
f73f556a |
104 | static const TString fkgQAOCDBDirName ; //! name of Reference directory name in OCDB |
4edbc5bc |
105 | static const TString fkgRefOCDBDirName ; //! name of Reference directory name in OCDB |
107bb232 |
106 | static const TString fkgRefDataDirName ; //! name of Reference directory name in OCDB for data |
f73f556a |
107 | static const TString fkgQARefOCDBDefault; //! default storage for QA in OCDB |
2e42b4d4 |
108 | |
109 | ClassDef(AliQA,1) //ALICE Quality Assurance Object |
421ab0fb |
110 | }; |
111 | #endif |