// --- Standard library ---
// --- AliRoot header files ---
+#include "AliCDBManager.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBEntry.h"
#include "AliLog.h"
#include "AliQA.h"
#include "AliQAChecker.h"
ClassImp(AliQA)
- AliQA * AliQA::fgQA = 0x0 ;
- TFile * AliQA::fgDataFile = 0x0 ;
- TString AliQA::fgDataName = "QA" ;
- TString AliQA::fgDetNames[] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD",
+ AliQA * AliQA::fgQA = 0x0 ;
+ TFile * AliQA::fgDataFile = 0x0 ;
+ TString AliQA::fgDataName = "QA" ; // will transform into Det.QA.run.cycle.root
+ TString AliQA::fgQARefDirName = "local://Ref/" ;
+ TString AliQA::fgQARefFileName = "QA.root" ;
+ TString AliQA::fgQAResultDirName = "local://RUN/" ;
+ TString AliQA::fgQAResultFileName = "QA.root" ;
+ TString AliQA::fgDetNames[] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD",
"ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"} ;
- TString AliQA::fgTaskNames[] = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;
+ TString AliQA::fgTaskNames[] = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;
//____________________________________________________________________________
AliQA::AliQA() :
{
// default constructor
// beware singleton: not to be used
+
for (Int_t index = 0 ; index < fNdet ; index++)
fQA[index] = 0 ;
}
delete[] fQA ;
}
+//_______________________________________________________________
+const Bool_t AliQA::AddQAData2CDB(const char * defSto) const
+{
+ // loads the QA data into the OCDB
+ Bool_t rv = kTRUE ;
+ AliCDBManager* man = AliCDBManager::Instance() ;
+ man->SetDefaultStorage(defSto) ;
+ AliCDBMetaData md ;
+ // loop over detectors
+ AliCDBId id("QA/Ref/PHOS",0,999999999) ;
+
+
+ return rv ;
+}
+
+//_______________________________________________________________
+const Bool_t AliQA::CheckFatal() const
+{
+ // check if any FATAL status is set
+ Bool_t rv = kFALSE ;
+ Int_t index ;
+ for (index = 0; index < kNDET ; index++)
+ rv = rv || IsSet(DETECTORINDEX(index), fTask, kFATAL) ;
+ return rv ;
+}
+
//_______________________________________________________________
const Bool_t AliQA::CheckRange(DETECTORINDEX det) const
{
return rv ;
}
-
//_______________________________________________________________
TFile * AliQA::GetQADMOutFile(const char * name, const Int_t run, const Int_t cycle)
{
return fgDataFile ;
}
+
//_______________________________________________________________
const char * AliQA::GetDetName(Int_t det)
{
}
//_______________________________________________________________
-const Bool_t AliQA::CheckFatal() const
+TFile * AliQA::GetQARefFile()
{
- // check if any FATAL status is set
- Bool_t rv = kFALSE ;
- Int_t index ;
- for (index = 0; index < kNDET ; index++)
- rv = rv || IsSet(DETECTORINDEX(index), fTask, kFATAL) ;
- return rv ;
+ // opens the file whwre Quality Assurance Reference Data are stored
+
+ TString fileName(fgQARefDirName + fgQARefFileName) ;
+
+ if ( fileName.Contains("local://"))
+ fileName.ReplaceAll("local://", "") ;
+
+ return TFile::Open(fileName.Data(), "READ") ;
+}
+
+//_______________________________________________________________
+TFile * AliQA::GetQAResultFile()
+{
+ // opens the file to store the Quality Assurance Data Checker results
+
+ TString fileName(fgQAResultDirName + fgQAResultFileName) ;
+ if ( fileName.Contains("local://"))
+ fileName.ReplaceAll("local://", "") ;
+ TString opt("") ;
+ if ( !gSystem->AccessPathName(fileName) )
+ opt = "UPDATE" ;
+ else
+ opt = "NEW" ;
+
+ return TFile::Open(fileName, opt) ;
}
//_______________________________________________________________
SetStatusBit(fDet, fTask, bit) ;
}
+//_____________________________________________________________________________
+void AliQA::SetQARefDir(const char * name)
+{
+ // Set the root directory where the QA reference data are stored
+
+ fgQARefDirName.Prepend(name) ;
+ printf("AliQA::SetQARefDir: QA references are in %s\n", fgQARefDirName.Data()) ;
+ if ( fgQARefDirName.Contains("local://"))
+ fgQARefDirName.ReplaceAll("local:/", "") ;
+ fgQARefFileName.Prepend(fgQARefDirName) ;
+}
+
+//_____________________________________________________________________________
+void AliQA::SetQAResultDirName(const char * name)
+{
+ // Set the root directory where to store the QA status object
+
+ fgQAResultDirName.Prepend(name) ;
+ printf("AliQA::SetQAResultDirName: QA results are in %s\n", fgQAResultDirName.Data()) ;
+ if ( fgQAResultDirName.Contains("local://"))
+ fgQAResultDirName.ReplaceAll("local:/", "") ;
+ fgQAResultFileName.Prepend(fgQAResultDirName) ;
+}
+
//_______________________________________________________________
void AliQA::SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit)
{
static AliQA * Instance() ;
static AliQA * Instance(const DETECTORINDEX det) ;
static AliQA * Instance(const ALITASK tsk) ;
+ const Bool_t AddQAData2CDB(const char * defSto) const ;
const Bool_t CheckFatal() const ;
static const char * GetAliTaskName(ALITASK tsk) ;
static const char * GetDataName() { return fgDataName.Data() ; }
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) ;
+ static TFile * GetQAResultFile() ;
+ static TFile * GetQARefFile() ;
+ static const char * GetQAResultFileName() { return (fgQAResultDirName + fgQAResultFileName).Data() ; }
+ static const char * GetQARefFileName() { return (fgQARefDirName + fgQARefFileName).Data() ; }
const Bool_t IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
void Set(QABIT bit) ;
+ static void SetQAResultDirName(const char * name) ;
+ static void SetQARefDir(const char * name) ;
void Show() const { ShowStatus(fDet) ; }
void ShowAll() const ;
void SetStatus(DETECTORINDEX det, UShort_t status) { fQA[det] = status ; }
void SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ;
- static AliQA *fgQA ; // pointer to the instance of the singleton
- 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
- static TString fgDataName ; //! the name of the file where the quality assurance maker store their results
- static TString fgDetNames[] ; //! list of detector names
- static TString fgTaskNames[]; //! list of tasks names
+ static AliQA *fgQA ; // pointer to the instance of the singleton
+ 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
+ static TString fgDataName ; //! the name of the file where the quality assurance maker store their results
+ static TString fgDetNames[] ; //! list of detector names
+ static TString fgQAResultDirName ; //! the location of the output file where the QA results are stored
+ static TString fgQAResultFileName ; //! the output file where the QA results are stored
+ static TString fgQARefDirName ; //! name of directory where to find the reference data file
+ static TString fgQARefFileName ; //! file name where to find the reference data
+ static TString fgTaskNames[] ; //! list of tasks names
ClassDef(AliQA,1) //ALICE Quality Assurance Object
};
ClassImp(AliQAChecker)
AliQAChecker * AliQAChecker::fgQAChecker = 0x0 ;
TFile * AliQAChecker::fgQAResultFile = 0x0 ;
- TString AliQAChecker::fgQAResultDirName = "local://RUN/";
- TString AliQAChecker::fgQAResultFileName = "QA.root" ;
+// TString AliQAChecker::fgQAResultDirName = "local://RUN/";
+// TString AliQAChecker::fgQAResultFileName = "QA.root" ;
//_____________________________________________________________________________
AliQAChecker::AliQAChecker(const char* name, const char* title) :
TNamed(name, title),
fDataFile(0x0),
- fRefDirName("./Ref/"),
- fRefName("QA.root"),
+// fRefDirName("./Ref/"),
+// fRefName("QA.root"),
fFoundDetectors(".")
{
// ctor: initialise checkers and open the data file
for (Int_t det = 0 ; det < AliQA::kNDET ; det++)
fCheckers[det] = NULL ;
- //GetDataFile() ;
- fRefDirName.Append(fRefName) ;
+// fRefDirName.Append(fRefName) ;
}
//_____________________________________________________________________________
AliQAChecker::AliQAChecker(const AliQAChecker& qac) :
TNamed(qac),
fDataFile(qac.fDataFile),
- fRefDirName(qac.fRefDirName),
- fRefName(qac.fRefName),
+// fRefDirName(qac.fRefDirName),
+// fRefName(qac.fRefName),
fFoundDetectors(qac.fFoundDetectors)
{
// copy constructor
fgQAResultFile = 0x0 ;
}
}
- if ( fgQAResultFileName.Contains("local://"))
- fgQAResultFileName.ReplaceAll("local:/", "") ;
-
- TString opt("") ;
- if ( !gSystem->AccessPathName(fgQAResultFileName) )
- opt = "UPDATE" ;
- else
- opt = "NEW" ;
- fgQAResultFile = TFile::Open(fgQAResultFileName, opt) ;
-
+// if ( fgQAResultFileName.Contains("local://"))
+// fgQAResultFileName.ReplaceAll("local:/", "") ;
+//
+// TString opt("") ;
+// if ( !gSystem->AccessPathName(fgQAResultFileName) )
+// opt = "UPDATE" ;
+// else
+// opt = "NEW" ;
+// fgQAResultFile = TFile::Open(fgQAResultFileName, opt) ;
+//
+ fgQAResultFile = AliQA::GetQAResultFile() ;
return fgQAResultFile ;
}
TDirectory * AliQAChecker::GetRefSubDir(const char * det, const char * task)
{
// Opens and returns the file with the reference data
- TFile * f = TFile::Open(fRefDirName, "READ") ;
+ TFile * f = AliQA::GetQARefFile() ; //TFile::Open(fRefDirName, "READ") ;
TDirectory * rv = NULL ;
if (!f) {
- AliError(Form("Cannot find reference file %s", fRefDirName.Data())) ;
+ AliError(Form("Cannot find reference file %s", (AliQA::GetQARefFileName()))) ;
return rv ;
}
rv = f->GetDirectory(det) ;
if (!rv) {
- AliWarning(Form("Directory %s not found in %d", det, fRefDirName.Data())) ;
+ AliWarning(Form("Directory %s not found in %d", det, (AliQA::GetQARefFileName()))) ;
} else {
rv = rv->GetDirectory(task) ;
if (!rv)
- AliWarning(Form("Directory %s/%s not found in %s", det, task, fRefDirName.Data())) ;
+ AliWarning(Form("Directory %s/%s not found in %s", det, task, (AliQA::GetQARefFileName()))) ;
}
return rv ;
}
}
//_____________________________________________________________________________
-void AliQAChecker::SetQAResultDirName(const char * name)
-{
- // Set the root directory where to store the QA status object
-
- fgQAResultDirName.Prepend(name) ;
- AliInfo(Form("QA results are in %s", fgQAResultDirName.Data())) ;
- if ( fgQAResultDirName.Contains("local://"))
- fgQAResultDirName.ReplaceAll("local:/", "") ;
- fgQAResultFileName.Prepend(fgQAResultDirName) ;
-}
+//void AliQAChecker::SetQAResultDirName(const char * name)
+//{
+// // Set the root directory where to store the QA status object
+//
+// fgQAResultDirName.Prepend(name) ;
+// AliInfo(Form("QA results are in %s", fgQAResultDirName.Data())) ;
+// if ( fgQAResultDirName.Contains("local://"))
+// fgQAResultDirName.ReplaceAll("local:/", "") ;
+// fgQAResultFileName.Prepend(fgQAResultDirName) ;
+//}
//_____________________________________________________________________________
-void AliQAChecker::SetRefDirName(const char * name)
-{
- // Set the root directory of reference data
-
- fRefDirName.Prepend(name) ;
- fRefDirName.Append(fRefName) ;
- AliInfo(Form("Reference data are taken from %s", fRefDirName.Data())) ;
- if ( fRefDirName.Contains("local://"))
- fRefDirName.ReplaceAll("local:/", "") ;
-}
-
+//void AliQAChecker::SetRefDirName(const char * name)
+//{
+// // Set the root directory of reference data
+//
+// fRefDirName.Prepend(name) ;
+// fRefDirName.Append(fRefName) ;
+// AliInfo(Form("Reference data are taken from %s", fRefDirName.Data())) ;
+// if ( fRefDirName.Contains("local://"))
+// fRefDirName.ReplaceAll("local:/", "") ;
+//}
+//
AliQACheckerBase * GetDetQAChecker(Int_t det) ;
TDirectory * GetRefSubDir(const char * det, const char * task) ;
static TFile * GetQAResultFile() ;
- static const char * GetQAResultFileName() { return fgQAResultFileName.Data() ; }
- void SetQAResultDirName(const char * name) ;
+// static const char * GetQAResultFileName() { return fgQAResultFileName.Data() ; }
+// void SetQAResultDirName(const char * name) ;
void SetRefDirName(const char * name) ;
virtual Bool_t Run(const char * fileName = NULL) ;
static AliQAChecker *fgQAChecker ; // pointer to the instance of the singleton
TFile * fDataFile ; //! Data file to check
static TFile * fgQAResultFile ; //! File where to find the QA result
- static TString fgQAResultDirName ; //! directory where to find the QA result
- static TString fgQAResultFileName ; //! file name where to find the QA result
- TString fRefDirName ; //! name of directory where to find the reference data file
- TString fRefName ; //! file name where to find the reference data
+// static TString fgQAResultDirName ; //! directory where to find the QA result
+// static TString fgQAResultFileName ; //! file name where to find the QA result
+// TString fRefDirName ; //! name of directory where to find the reference data file
+// TString fRefName ; //! file name where to find the reference data
TString fFoundDetectors ; //! detectors for which the Quality assurance could be done
AliQACheckerBase * fCheckers[AliQA::kNDET] ; //! list of detectors checkers
ClassDef(AliQAChecker, 1) // class for running generation, simulation and digitization
fDigitsQAList(qadm.fDigitsQAList),
fESDsQAList(qadm.fESDsQAList),
fHitsQAList(qadm.fHitsQAList),
- fRawsQAList(qadm.fRecPointsQAList),
+ fRawsQAList(qadm.fRawsQAList),
fRecPointsQAList(qadm.fRecPointsQAList),
fSDigitsQAList(qadm.fSDigitsQAList),
fCurrentCycle(qadm.fCurrentCycle),
#include "AliQA.h"
#include "AliQADataMaker.h"
#include "AliQADataMakerSteer.h"
+#include "AliRawReaderDate.h"
+#include "AliRawReaderFile.h"
#include "AliRawReaderRoot.h"
#include "AliRun.h"
#include "AliRunLoader.h"
}
//_____________________________________________________________________________
-Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const char * fileName )
+Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const char * input )
{
// Initialize the event source and QA data makers
if (taskIndex == AliQA::kRAWS) {
- fRawReader = new AliRawReaderRoot(fileName) ;
+ TString fileName(input);
+ if (fileName.EndsWith("/")) {
+ fRawReader = new AliRawReaderFile(fileName);
+ } else if (fileName.EndsWith(".root")) {
+ fRawReader = new AliRawReaderRoot(fileName);
+ } else if (!fileName.IsNull()) {
+ fRawReader = new AliRawReaderDate(fileName);
+ fRawReader->SelectEvents(7);
+ }
if ( ! fRawReader )
return kFALSE ;
fRawReader->NextEvent() ;
#include "AliLoader.h"
class AliQADataMaker ;
-class AliRawReaderRoot ;
+class AliRawReader ;
class AliRunLoader ;
class AliESDEvent ;
TString fGAliceFileName ; //! name of the galice file
UInt_t fRunNumber ; //! current run number
Long64_t fNumberOfEvents ; //! number of events in the run
- AliRawReaderRoot * fRawReader ; //! current raw reader object
+ AliRawReader * fRawReader ; //! current raw reader object
AliRunLoader * fRunLoader ; //! current run loader object
static const UInt_t fgkNDetectors = AliQA::kNDET ; //! number of detectors
AliLoader * fLoader[fgkNDetectors]; //! array of detectors loader