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};
24 kNULLTASK=-1, kRAW, kSIM, kREC, kESD, kANA, kNTASK };
26 kNULLBit=-1, kINFO, kWARNING, kERROR, kFATAL, kNBIT };
28 kNULLTYPE=-1, kUNKOWN, kAUTO_TEST, kCALIBRATION, kCALIBRATION_PULSER, kCHANNEL_DELAY_TUNING, kCOSMIC, kCOSMICS, kDAQ_FO_UNIF_SCAN,
29 kDAQ_GEN_DAC_SCAN, kDAQ_MEAN_TH_SCAN, kDAQ_MIN_TH_SCAN, kDAQ_NOISY_PIX_SCAN, kDAQ_PIX_DELAY_SCAN, kDAQ_UNIFORMITY_SCAN,
30 kDCS_FO_UNIF_SCAN, kDCS_MEAN_TH_SCAN, kDCS_MIN_TH_SCAN, kDCS_PIX_DELAY_SCAN, kDCS_UNIFORMITY_SCAN, kDDL_TEST, kGAIN,
31 kPEDESTAL, kINJECTOR, kLASER, kMONTECARLO, kNOISE, kNOISY_PIX_SCAN, kPHYSICS, kPULSER, kSTANDALONE, kSTANDALONE_BC,
32 kSTANDALONE_CENTRAL, kSTANDALONE_COSMIC, kSTANDALONE_EMD, kSTANDALONE_LASER, kSTANDALONE_MB, kSTANDALONE_PEDESTAL,
33 kSTANDALONE_SEMICENTRAL, kSTANDALONE_PULSER, kNTYPE};
36 kNULLTASKINDEX=-1, kRAWS, kHITS, kSDIGITS, kDIGITS, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS, kNTASKINDEX };
38 // Creators - destructors
39 AliQA(); // beware singleton, not to be used
40 AliQA(const ALITASK_t tsk) ;
41 AliQA(const DETECTORINDEX_t det) ;
42 AliQA(const AliQA& qa) ;
43 AliQA& operator = (const AliQA& qa) ;
46 static AliQA * Instance() ;
47 static AliQA * Instance(const DETECTORINDEX_t det) ;
48 static AliQA * Instance(const ALITASK_t tsk) ;
49 static AliQA * Instance(const TASKINDEX_t tsk) ;
50 const Bool_t CheckFatal() const ;
52 static const char * GetAliTaskName(ALITASK_t tsk) ;
53 static const TString GetExpert() { return fkgExpert ; }
54 static const UInt_t GetExpertBit() { return fkgExpertBit ; }
55 static const TString GetLabLocalFile() { return fkgLabLocalFile ; }
56 static const TString GetLabLocalOCDB() { return fkgLabLocalOCDB ; }
57 static const TString GetLabAliEnOCDB() { return fkgLabAliEnOCDB ; }
58 static const DETECTORINDEX_t GetDetIndex(const char * name) ;
59 static const TString GetDetName(DETECTORINDEX_t det) { return fgDetNames[det] ; }
60 static const char * GetDetName(Int_t det) ;
61 static const TString GetGRPPath() { return fgGRPPath ; }
62 static TFile * GetQADataFile(const char * name, const Int_t run) ;
63 static TFile * GetQADataFile(const char * fileName) ;
64 static const char * GetQADataFileName(const char * name, const Int_t run)
65 {return Form("%s.%s.%d.root", name, fgQADataFileName.Data(), run) ; }
66 static const char * GetQADataFileName() { return fgQADataFileName.Data() ; }
67 static const char * GetQAName() { return fkgQAName ; }
68 static const char * GetQACorrName() { return fkgQACorrNtName ; }
69 static TFile * GetQAResultFile() ;
70 static const char * GetQAResultFileName() { return (fgQAResultDirName + fgQAResultFileName).Data() ; }
71 static const char * GetQARefDefaultStorage() { return fkgQARefOCDBDefault.Data() ; }
72 static const char * GetQARefFileName() { return fgQARefFileName ; }
73 static const char * GetQARefStorage() { return fgQARefDirName.Data() ; }
74 static const char * GetRefOCDBDirName() { return fkgRefOCDBDirName.Data() ; }
75 static const char * GetRefDataDirName() { return fkgRefDataDirName.Data() ; }
76 static const TString GetRunTypeName(RUNTYPE_t rt = kNULLTYPE) ;
77 static const TASKINDEX_t GetTaskIndex(const char * name) ;
78 static const TString GetTaskName(UInt_t tsk) { return fgTaskNames[tsk] ; }
79 const Bool_t IsSet(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) const ;
80 const Bool_t IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk) const ;
81 const Bool_t IsSetAny(DETECTORINDEX_t det) const ;
82 void Merge(TCollection * list) ;
83 void Set(QABIT_t bit) ;
84 static void SetQAResultDirName(const char * name) ;
85 static void SetQARefStorage(const char * name) ;
86 static void SetQARefDataDirName(RUNTYPE_t rt) { fkgRefDataDirName = GetRunTypeName(rt) ; }
87 static void SetQARefDataDirName(const char * name) ;
88 void Show() const { ShowStatus(fDet, fTask) ; }
89 void Show(DETECTORINDEX_t det) const { ShowStatus(det) ; }
90 void ShowAll() const ;
91 void UnSet(QABIT_t bit) ;
95 const Bool_t CheckRange(DETECTORINDEX_t det) const ;
96 const Bool_t CheckRange(ALITASK_t tsk) const ;
97 const Bool_t CheckRange(QABIT_t bit) const ;
98 const char * GetBitName(QABIT_t bit) const ;
99 const ULong_t GetStatus(DETECTORINDEX_t det) const { return fQA[det] ;}
100 void Finish() const ;
101 const ULong_t Offset(ALITASK_t tsk) const ;
102 void ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk=kNULLTASK) const ;
103 void ShowASCIIStatus(DETECTORINDEX_t det, ALITASK_t tsk, ULong_t status) const ;
104 void ResetStatus(DETECTORINDEX_t det) { fQA[det] = 0 ; }
105 void Set(DETECTORINDEX_t det) { fDet = det ;}
106 void Set(ALITASK_t tsk) { fTask = tsk ; AliDebug(1, Form("Ready to set QA status in %s", GetAliTaskName(tsk) )) ; }
107 void SetStatus(DETECTORINDEX_t det, UShort_t status) { fQA[det] = status ; }
108 void SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) ;
109 void UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) ;
111 static AliQA * fgQA ; // pointer to the instance of the singleton
112 Int_t fNdet ; // number of detectors
113 ULong_t * fQA ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each
114 DETECTORINDEX_t fDet ; //! the current detector (ITS, TPC, ....)
115 ALITASK_t fTask ; //! the current environment (SIM, REC, ESD, ANA)
116 static TString fgDetNames[] ; //! list of detector names
117 static TString fgGRPPath ; //! path of the GRP object in OCDB
118 static TFile * fgQADataFile ; //! the output file where the quality assurance maker store their results
119 static TString fgQADataFileName ; //! the name of the file where the quality assurance maker store their results
120 static TFile * fgQARefFile ; //! the output file where the quality assurance maker store their results
121 static TString fgQARefDirName ; //! name of directory where to find the reference data file
122 static TString fgQARefFileName ; //! file name where to find the reference data
123 static TFile * fgQAResultFile ; //! File where to find the QA result
124 static TString fgQAResultDirName ; //! the location of the output file where the QA results are stored
125 static TString fgQAResultFileName ; //! the output file where the QA results are stored
126 static TString fgRTNames[] ; //! list of Run Type names
127 static TString fgTaskNames[] ; //! list of tasks names
128 static const TString fkgExpert ; //! name for the expert directory
129 static const UInt_t fkgExpertBit ; //! TObject bit identifing the object as "expert"
130 static const TString fkgLabLocalFile ; //! label to identify a file as local
131 static const TString fkgLabLocalOCDB ; //! label to identify a file as local OCDB
132 static const TString fkgLabAliEnOCDB ; //! label to identify a file as AliEn OCDB
133 static const TString fkgRefFileName ; //! name of Reference File Name
134 static const TString fkgQAName ; //! name of QA object
135 static const TString fkgQACorrNtName ; //! name of QA Correlation Ntuple
136 static const TString fkgRefOCDBDirName ; //! name of Reference directory name in OCDB
137 static TString fkgRefDataDirName ; //! name of Reference directory name in OCDB for data
138 static const TString fkgQARefOCDBDefault ; //! default storage for QA in OCDB
140 ClassDef(AliQA,1) //ALICE Quality Assurance Object