// --- ROOT system ---
#include <TClass.h>
#include <TFile.h>
+#include <TH1.h>
#include <TSystem.h>
#include <TROOT.h>
"ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT", "Global", "CORR"} ;
TString AliQAv1::fgGRPPath = "GRP/GRP/Data" ;
TString AliQAv1::fgTaskNames[] = {"Raws", "Hits", "SDigits", "Digits", "DigitsR", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;
-TString AliQAv1::fgModeNames[] = {"", "Sim", "Rec"} ;
+TString AliQAv1::fgModeNames[] = {"", "Sim", "Rec", "QA"} ;
const TString AliQAv1::fgkLabLocalFile = "file://" ;
const TString AliQAv1::fgkLabLocalOCDB = "local://" ;
const TString AliQAv1::fgkLabAliEnOCDB = "alien://" ;
TString AliQAv1::fgRefDataDirName = "" ;
const TString AliQAv1::fgkQARefOCDBDefault = "alien://folder=/alice/QA/20" ;
const TString AliQAv1::fgkExpert = "Expert" ;
-const UInt_t AliQAv1::fgkExpertBit = 0x40000 ;
-const UInt_t AliQAv1::fgkQABit = 0x80000 ;
-const UInt_t AliQAv1::fgkImageBit = 0x100000 ;
+const UInt_t AliQAv1::fgkExpertBit = BIT(19);
+const UInt_t AliQAv1::fgkQABit = BIT(20) ;
+const UInt_t AliQAv1::fgkImageBit = BIT(21) ;
const Int_t AliQAv1::fgkQADebugLevel = 99 ;
const TString AliQAv1::fImageFileName = "QAImage" ;
const TString AliQAv1::fImageFileFormat = "ps" ;
TString bitName ;
switch (bit) {
case kNULLBit:
+ bitName = "NONE" ;
break ;
case kINFO:
bitName = "INFO" ;
return bitName.Data() ;
}
+//_______________________________________________________________
+TH1 * AliQAv1::GetData(TObjArray** list, Int_t index, AliRecoParam::EventSpecie_t eventSpecie)
+{
+ // retrieve QA data from the list at a given index and for a given event specie
+ TH1 * rv = NULL ;
+ Int_t esindex = AliRecoParam::AConvert(eventSpecie) ;
+ TObjArray * arr = list[esindex] ;
+ if (arr) {
+ if ( index > AliQAv1::GetMaxQAObj() ) {
+ AliErrorClass(Form("Max number of authorized QA objects is %d", AliQAv1::GetMaxQAObj())) ;
+ } else {
+ if ( arr->At(index) ) {
+ rv = static_cast<TH1*>(arr->At(index)) ;
+ }
+ }
+ }
+ return rv ;
+}
+
//_______________________________________________________________
AliQAv1::DETECTORINDEX_t AliQAv1::GetDetIndex(const char * name)
{
//_______________________________________________________________
TFile * AliQAv1::GetQAResultFile()
{
- // opens the file to store the Quality Assurance Data Checker results
- if (fgQAResultFile)
- fgQAResultFile->Close() ;
- fgQAResultFile = 0x0 ;
-// if (!fgQAResultFile) {
- TString dirName(fgQAResultDirName) ;
- if ( dirName.Contains(fgkLabLocalFile))
- dirName.ReplaceAll(fgkLabLocalFile, "") ;
- TString fileName(dirName + fgQAResultFileName) ;
- TString opt("") ;
- if ( !gSystem->AccessPathName(fileName) )
- opt = "UPDATE" ;
- else {
- if ( gSystem->AccessPathName(dirName) )
- gSystem->mkdir(dirName) ;
- opt = "NEW" ;
- }
- fgQAResultFile = TFile::Open(fileName, opt) ;
-// }
+ // opens the file to store the Quality Assurance Data Checker results
+ if (fgQAResultFile && fgQAResultFile->IsOpen())
+ {
+ fgQAResultFile->Close();
+ }
+ delete fgQAResultFile;
+ fgQAResultFile=0x0;
+
+ TString dirName(fgQAResultDirName) ;
+ if ( dirName.Contains(fgkLabLocalFile))
+ dirName.ReplaceAll(fgkLabLocalFile, "") ;
+ TString fileName(dirName + fgQAResultFileName) ;
+ TString opt("") ;
+ if ( !gSystem->AccessPathName(fileName) )
+ opt = "UPDATE" ;
+ else {
+ if ( gSystem->AccessPathName(dirName) )
+ gSystem->mkdir(dirName) ;
+ opt = "NEW" ;
+ }
+ fgQAResultFile = TFile::Open(fileName, opt) ;
return fgQAResultFile ;
}
+//_______________________________________________________________
+AliQAv1::QABIT_t AliQAv1::GetQAStatusBit(AliRecoParam::EventSpecie_t es, DETECTORINDEX_t det, ALITASK_t tsk) const
+{
+ // returns the QA bit set
+ QABIT_t rv = kNULLBit ;
+ if ( es == AliRecoParam::kDefault)
+ es = fEventSpecie ;
+ if ( det == kNULLDET )
+ det = fDet ;
+ if ( tsk == kNULLTASK )
+ tsk = fTask ;
+ for (Int_t bit = kINFO ; bit < kNBIT ; bit++) {
+ if (IsSet(det, tsk, es, QABIT_t(bit)))
+ rv = QABIT_t(bit) ;
+ }
+ return rv ;
+}
+
//_______________________________________________________________
AliQAv1::TASKINDEX_t AliQAv1::GetTaskIndex(const char * name)
{
if ( ! fgQA) {
TFile * f = GetQAResultFile() ;
fgQA = static_cast<AliQAv1 *>(f->Get("QA")) ;
+ f->Close() ;
if ( ! fgQA )
fgQA = new AliQAv1() ;
}
if ( ! fgQA) {
TFile * f = GetQAResultFile() ;
- fgQA = static_cast<AliQAv1 *>(f->Get("QA")) ;
+ fgQA = static_cast<AliQAv1 *>(f->Get(GetQAName())) ;
if ( ! fgQA )
fgQA = new AliQAv1(det) ;
}
return offset ;
}
+//_______________________________________________________________
+void AliQAv1::Reset(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es)
+{
+ // resets all the bits for a given tsk and event specie
+ CheckRange(det) ;
+ CheckRange(tsk) ;
+ CheckRange(es) ;
+
+ ULong_t offset = Offset(tsk) ;
+ ULong_t status = GetStatus(det, es) ;
+ for ( Int_t bit = 0 ; bit < kNBIT ; bit++) {
+ offset+= bit ;
+ status = status & ~1 << offset ;
+ }
+ SetStatus(det, es, status) ;
+}
+
//_______________________________________________________________
void AliQAv1::ResetStatus(DETECTORINDEX_t det)
{
CheckRange(tsk) ;
CheckRange(bit) ;
CheckRange(es) ;
-
+
+ Reset(det, tsk, es) ;
+
ULong_t offset = Offset(tsk) ;
ULong_t status = GetStatus(det, es) ;
offset+= bit ;
{
// print the QA status in human readable format
TString text;
- for (Int_t bit = kINFO ; bit < kNBIT ; bit++) {
- if (IsSet(det, tsk, es, QABIT_t(bit))) {
- text = GetBitName(QABIT_t(bit)) ;
- text += " " ;
- }
- }
- if (! text.IsNull())
- AliInfoClass(Form(" %8s %8s %4s 0x%4lx, Problem signalled: %8s \n", AliRecoParam::GetEventSpecieName(es), GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data())) ;
+ QABIT_t bit = GetQAStatusBit(es, det, tsk) ;
+ if ( bit != kNULLBit ) {
+ text = GetBitName(bit) ;
+ text += " " ;
+ AliInfoClass(Form(" %8s %8s %4s 0x%4lx, Problem signalled: %8s \n", AliRecoParam::GetEventSpecieName(es), GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data())) ;
+ }
}
//_______________________________________________________________