// --- AliRoot header files ---
#include "AliLog.h"
#include "AliQA.h"
+#include "AliQAChecker.h"
ClassImp(AliQA)
//____________________________________________________________________________
AliQA::AliQA() :
TNamed("", ""),
- fQA(0x0),
+ fNdet(kNDET),
+ fQA(new ULong_t[fNdet]),
fDet(kNULLDET),
fTask(kNULLTASK)
{
// default constructor
// beware singleton: not to be used
+ for (Int_t index = 0 ; index < fNdet ; index++)
+ fQA[index] = 0 ;
}
//____________________________________________________________________________
AliQA::AliQA(const AliQA& qa) :
TNamed(qa),
+ fNdet(qa.fNdet),
fQA(qa.fQA),
fDet(qa.fDet),
fTask(qa.fTask)
//_______________________________________________________________
AliQA::AliQA(const DETECTORINDEX det) :
- TNamed("QA", "Quality Assurance status"),
- fQA(new ULong_t[kNDET]),
+ TNamed("QA", "Quality Assurance status"),
+ fNdet(kNDET),
+ fQA(new ULong_t[fNdet]),
fDet(det),
fTask(kNULLTASK)
{
return ;
}
Int_t index ;
- for (index = 0; index < kNDET; index++)
+ for (index = 0; index < fNdet; index++)
fQA[index] = 0 ;
}
//_______________________________________________________________
AliQA::AliQA(const ALITASK tsk) :
TNamed("QA", "Quality Assurance status"),
- fQA(new ULong_t[kNDET]),
+ fNdet(kNDET),
+ fQA(new ULong_t[fNdet]),
fDet(kNULLDET),
fTask(tsk)
{
return ;
}
Int_t index ;
- for (index = 0; index < kNDET; index++)
+ for (index = 0; index < fNdet; index++)
fQA[index] = 0 ;
}
{
// Get an instance of the singleton. The only authorized way to call the ctor
- if ( ! fgQA)
- fgQA = new AliQA(det) ;
+ if ( ! fgQA) {
+ TFile * f = AliQAChecker::GetQAResultFile() ;
+ fgQA = dynamic_cast<AliQA *>(f->Get("QA")) ;
+ if ( ! fgQA )
+ fgQA = new AliQA(det) ;
+ }
fgQA->Set(det) ;
return fgQA ;
}
static const TString GetTaskName(TASKINDEX tsk) { return fgTaskNames[tsk] ; }
static const char * GetDetName(Int_t det) ;
static TFile * GetQADMOutFile(const char * name, const Int_t run, const Int_t cycle) ;
+ const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
void Set(QABIT bit) ;
void Show() const { ShowStatus(fDet) ; }
void ShowAll() const ;
- void print() { printf("%d %x\n", kNDET, fQA) ; }
private:
const char * GetBitName(QABIT bit) const ;
const ULong_t GetStatus(DETECTORINDEX det) const { return fQA[det] ;}
void Finish() const ;
- const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
const ULong_t Offset(ALITASK tsk) const ;
virtual void ShowStatus(DETECTORINDEX det) const ;
void ResetStatus(DETECTORINDEX det) { fQA[det] = 0 ; }
void SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ;
static AliQA *fgQA ; // pointer to the instance of the singleton
- ULong_t * fQA ; //[kNDET] the status word 4 bits for SIM, REC, ESD, ANA each
+ Int_t fNdet ; // number of detectors
+ ULong_t * fQA ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each
DETECTORINDEX fDet ; //! the current detector (ITS, TPC, ....)
ALITASK fTask ; //! the current environment (SIM, REC, ESD, ANA)
static TFile * fgDataFile ; //! the output file where the quality assurance maker store their results