3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 // Quality Assurance Object
17 class AliQA : public TNamed {
20 enum DETECTORINDEX_t {
21 kNULLDET=-1, kITS, kTPC, kTRD, kTOF, kPHOS, kHMPID, kEMCAL, kMUON, kFMD,
22 kZDC, kPMD, kT0, kVZERO, kACORDE, kHLT, kGLOBAL, kCORR, kNDET
28 kNULLTASK=-1, kRAW, kSIM, kREC, kESD, kANA, kNTASK };
30 kNULLBit=-1, kINFO, kWARNING, kERROR, kFATAL, kNBIT };
32 kNULLTYPE=-1, kUNKOWN, kAUTOTEST, kCALIBRATION, kCALIBRATIONPULSER, kCHANNELDELAYTUNING, kCOSMIC, kCOSMICS, kDAQFOUNIFSCAN,
33 kDAQGENDACSCAN, kDAQMEANTHSCAN, kDAQMINTHSCAN, kDAQNOISYPIXSCAN, kDAQPIXDELAYSCAN, kDAQUNIFORMITYSCAN,
34 kDCSFOUNIFSCAN, kDCSMEANTHSCAN, kDCSMINTHSCAN, kDCSPIXDELAYSCAN, kDCSUNIFORMITYSCAN, kDDLTEST, kGAIN,
35 kPEDESTAL, kINJECTOR, kLASER, kMONTECARLO, kNOISE, kNOISYPIXSCAN, kPHYSICS, kPULSER, kSTANDALONE, kSTANDALONEBC,
36 kSTANDALONECENTRAL, kSTANDALONECOSMIC, kSTANDALONEEMD, kSTANDALONELASER, kSTANDALONEMB, kSTANDALONEPEDESTAL,
37 kSTANDALONESEMICENTRAL, kSTANDALONEPULSER, kNTYPE};
40 kNULLTASKINDEX=-1, kRAWS, kHITS, kSDIGITS, kDIGITS, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS, kNTASKINDEX };
42 // Creators - destructors
43 AliQA(); // beware singleton, not to be used
44 AliQA(const ALITASK_t tsk) ;
45 AliQA(const DETECTORINDEX_t det) ;
46 AliQA(const AliQA& qa) ;
47 AliQA& operator = (const AliQA& qa) ;
50 static AliQA * Instance() ;
51 static AliQA * Instance(const DETECTORINDEX_t det) ;
52 static AliQA * Instance(const ALITASK_t tsk) ;
53 static AliQA * Instance(const TASKINDEX_t tsk) ;
54 Bool_t CheckFatal() const ;
56 static char * GetAliTaskName(ALITASK_t tsk) ;
57 static const TString GetExpert() { return fgkExpert ; }
58 static UInt_t GetExpertBit() { return fgkExpertBit ; }
59 static const TString GetLabLocalFile() { return fgkLabLocalFile ; }
60 static const TString GetLabLocalOCDB() { return fgkLabLocalOCDB ; }
61 static const TString GetLabAliEnOCDB() { return fgkLabAliEnOCDB ; }
62 static DETECTORINDEX_t GetDetIndex(const char * name) ;
63 static const TString GetDetName(DETECTORINDEX_t det) { return fgDetNames[det] ; }
64 static const char * GetDetName(Int_t det) ;
65 static const TString GetGRPPath() { return fgGRPPath ; }
66 static UInt_t GetQABit() { return fgkQABit ; }
67 static TFile * GetQADataFile(const char * name, const Int_t run) ;
68 static TFile * GetQADataFile(const char * fileName) ;
69 static const char * GetQADataFileName(const char * name, const Int_t run)
70 {return Form("%s.%s.%d.root", name, fgQADataFileName.Data(), run) ; }
71 static const char * GetQADataFileName() { return fgQADataFileName.Data() ; }
72 static const char * GetQAName() { return fgkQAName ; }
73 static const char * GetQACorrName() { return fgkQACorrNtName ; }
74 static TFile * GetQAResultFile() ;
75 static const char * GetQAResultFileName() { return (fgQAResultDirName + fgQAResultFileName).Data() ; }
76 static const char * GetQARefDefaultStorage() { return fgkQARefOCDBDefault.Data() ; }
77 static const char * GetQARefFileName() { return fgQARefFileName ; }
78 static const char * GetQARefStorage() { return fgQARefDirName.Data() ; }
79 static const char * GetRefOCDBDirName() { return fgkRefOCDBDirName.Data() ; }
80 static const char * GetRefDataDirName() { return fgkRefDataDirName.Data() ; }
81 static const TString GetRunTypeName(RUNTYPE_t rt = kNULLTYPE) ;
82 static TASKINDEX_t GetTaskIndex(const char * name) ;
83 static const TString GetTaskName(UInt_t tsk) { return fgTaskNames[tsk] ; }
84 Bool_t IsSet(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) const ;
85 Bool_t IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk) const ;
86 Bool_t IsSetAny(DETECTORINDEX_t det) const ;
87 Long64_t Merge(const TCollection * list) ;
88 void Set(QABIT_t bit) ;
89 static void SetQAResultDirName(const char * name) ;
90 static void SetQARefStorage(const char * name) ;
91 static void SetQARefDataDirName(RUNTYPE_t rt) { fgkRefDataDirName = GetRunTypeName(rt) ; }
92 static void SetQARefDataDirName(const char * name) ;
93 void Show() const { ShowStatus(fDet, fTask) ; }
94 void Show(DETECTORINDEX_t det) const { ShowStatus(det) ; }
95 void ShowAll() const ;
96 void UnSet(QABIT_t bit) ;
100 Bool_t CheckRange(DETECTORINDEX_t det) const ;
101 Bool_t CheckRange(ALITASK_t tsk) const ;
102 Bool_t CheckRange(QABIT_t bit) const ;
103 char * GetBitName(QABIT_t bit) const ;
104 ULong_t GetStatus(DETECTORINDEX_t det) const { return fQA[det] ;}
105 void Finish() const ;
106 ULong_t Offset(ALITASK_t tsk) const ;
107 void ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk=kNULLTASK) const ;
108 void ShowASCIIStatus(DETECTORINDEX_t det, ALITASK_t tsk, ULong_t status) const ;
109 void ResetStatus(DETECTORINDEX_t det) { fQA[det] = 0 ; }
110 void Set(DETECTORINDEX_t det) { fDet = det ;}
111 void Set(ALITASK_t tsk) { fTask = tsk ; AliDebug(1, Form("Ready to set QA status in %s", GetAliTaskName(tsk) )) ; }
112 void SetStatus(DETECTORINDEX_t det, UShort_t status) { fQA[det] = status ; }
113 void SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) ;
114 void UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) ;
116 static AliQA * fgQA ; // pointer to the instance of the singleton
117 Int_t fNdet ; // number of detectors
118 ULong_t * fQA ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each
119 DETECTORINDEX_t fDet ; //! the current detector (ITS, TPC, ....)
120 ALITASK_t fTask ; //! the current environment (SIM, REC, ESD, ANA)
121 static TString fgDetNames[] ; //! list of detector names
122 static TString fgGRPPath ; //! path of the GRP object in OCDB
123 static TFile * fgQADataFile ; //! the output file where the quality assurance maker store their results
124 static TString fgQADataFileName ; //! the name of the file where the quality assurance maker store their results
125 static TFile * fgQARefFile ; //! the output file where the quality assurance maker store their results
126 static TString fgQARefDirName ; //! name of directory where to find the reference data file
127 static TString fgQARefFileName ; //! file name where to find the reference data
128 static TFile * fgQAResultFile ; //! File where to find the QA result
129 static TString fgQAResultDirName ; //! the location of the output file where the QA results are stored
130 static TString fgQAResultFileName ; //! the output file where the QA results are stored
131 static TString fgRTNames[] ; //! list of Run Type names
132 static TString fgTaskNames[] ; //! list of tasks names
133 static const TString fgkExpert ; //! name for the expert directory
134 static const UInt_t fgkExpertBit ; //! TObject bit identifing the object as "expert"
135 static const TString fgkLabLocalFile ; //! label to identify a file as local
136 static const TString fgkLabLocalOCDB ; //! label to identify a file as local OCDB
137 static const TString fgkLabAliEnOCDB ; //! label to identify a file as AliEn OCDB
138 static const TString fgkRefFileName ; //! name of Reference File Name
139 static const UInt_t fgkQABit ; //! bit in the QA data object which is set when Checker does not return 0
140 static const TString fgkQAName ; //! name of QA object
141 static const TString fgkQACorrNtName ; //! name of QA Correlation Ntuple
142 static const TString fgkRefOCDBDirName ; //! name of Reference directory name in OCDB
143 static TString fgkRefDataDirName ; //! name of Reference directory name in OCDB for data
144 static const TString fgkQARefOCDBDefault ; //! default storage for QA in OCDB
146 ClassDef(AliQA,1) //ALICE Quality Assurance Object