#include "AliCDBEntry.h"
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
-#include "AliRunInfo.h"
+#include "AliRunInfo.h"
#include "AliLog.h"
#include "AliModule.h"
#include "AliQA.h"
#include "AliQAChecker.h"
#include "AliQACheckerBase.h"
+#include "AliCorrQAChecker.h"
#include "AliGlobalQAChecker.h"
+#include "AliGRPObject.h"
#include <TKey.h>
#include <TObjArray.h>
#include <TString.h>
#include <TSystem.h>
#include <TList.h>
+#include <TNtupleD.h>
ClassImp(AliQAChecker)
AliQAChecker * AliQAChecker::fgQAChecker = 0x0 ;
if (det == AliQA::kGLOBAL) {
qac = new AliGlobalQAChecker() ;
+ } else if (det == AliQA::kCORR) {
+ qac = new AliCorrQAChecker() ;
} else {
AliDebug(1, Form("Retrieving QA checker for %s", detName.Data())) ;
TPluginManager* pluginManager = gROOT->GetPluginManager() ;
{
AliCDBManager* man = AliCDBManager::Instance() ;
AliCDBEntry* entry = man->Get(AliQA::GetGRPPath().Data());
- TMap * data = 0x0 ;
- if (entry)
- data = dynamic_cast<TMap*>(entry->GetObject());
- if (!data) {
- AliFatal("No GRP entry found in OCDB!");
+ AliGRPObject* grpObject = 0x0;
+ if (entry) {
+
+ TMap* m = dynamic_cast<TMap*>(entry->GetObject()); // old GRP entry
+
+ if (m) {
+ AliInfo("It is a map");
+ //m->Print();
+ grpObject = new AliGRPObject();
+ grpObject->ReadValuesFromMap(m);
+ }
+
+ else {
+ AliInfo("It is a new GRP object");
+ grpObject = dynamic_cast<AliGRPObject*>(entry->GetObject()); // new GRP entry
+ }
+
+ entry->SetOwner(0);
+ AliCDBManager::Instance()->UnloadFromCache("GRP/GRP/Data");
}
- TObjString *lhcState=
- dynamic_cast<TObjString*>(data->GetValue("fLHCState"));
- if (!lhcState) {
- AliWarning(Form("%s entry: missing value for the LHC state ! Using UNKNOWN", AliQA::GetGRPPath().Data()));
+
+ if (!grpObject) {
+ AliFatal("No GRP entry found in OCDB!");
}
- TObjString *beamType=
- dynamic_cast<TObjString*>(data->GetValue("fAliceBeamType"));
- if (!beamType) {
- AliWarning(Form("%s entry: missing value for the LHC state ! Using UNKNOWN", AliQA::GetGRPPath().Data()));
+
+ TString lhcState = grpObject->GetLHCState();
+ if (lhcState==AliGRPObject::GetInvalidString()) {
+ AliError("GRP/GRP/Data entry: missing value for the LHC state ! Using UNKNOWN");
+ lhcState = "UNKNOWN";
}
- TObjString *beamEnergyStr=
- dynamic_cast<TObjString*>(data->GetValue("fAliceBeamEnergy"));
- if (!beamEnergyStr) {
- AliWarning(Form("%s entry: missing value for the beam energy ! Using 0", AliQA::GetGRPPath().Data()));
+
+ TString beamType = grpObject->GetBeamType();
+ if (beamType==AliGRPObject::GetInvalidString()) {
+ AliError("GRP/GRP/Data entry: missing value for the beam type ! Using UNKNOWN");
+ beamType = "UNKNOWN";
}
- TObjString *runType=
- dynamic_cast<TObjString*>(data->GetValue("fRunType"));
- if (!runType) {
- AliWarning(Form("%s entry: missing value for the run type ! Using UNKNOWN", AliQA::GetGRPPath().Data())); }
- TObjString *activeDetectors=
- dynamic_cast<TObjString*>(data->GetValue("fDetectorMask"));
- if (!activeDetectors) {
- AliWarning(Form("%s entry: missing value for the detector mask ! Using 1074790399", AliQA::GetGRPPath().Data()));
+
+ Float_t beamEnergy = grpObject->GetBeamEnergy();
+ if (beamEnergy==AliGRPObject::GetInvalidFloat()) {
+ AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0");
+ beamEnergy = 0;
}
- fRunInfo = new AliRunInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN",
- beamType ? beamType->GetString().Data() : "UNKNOWN",
- beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0,
- runType ? runType->GetString().Data() : "UNKNOWN",
- activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399);
+
+ TString runType = grpObject->GetRunType();
+ if (runType==AliGRPObject::GetInvalidString()) {
+ AliError("GRP/GRP/Data entry: missing value for the run type ! Using UNKNOWN");
+ runType = "UNKNOWN";
+ }
+
+ Int_t activeDetectors = grpObject->GetDetectorMask();
+ if (activeDetectors==AliGRPObject::GetInvalidInt()) {
+ AliError("GRP/GRP/Data entry: missing value for the detector mask ! Using 1074790399");
+ activeDetectors = 1074790399;
+ }
+
+ fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors);
+
fRunInfoOwner = kTRUE ;
}
}
//_____________________________________________________________________________
-Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObjArray * list)
+Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObject * obj)
{
// run the Quality Assurance Checker for detector det, for task task starting from data in list
GetRefSubDir(AliQA::GetDetName(det), AliQA::GetTaskName(task), refDir, refOCDBDir) ;
if ( refDir || refOCDBDir) // references found
qac->SetRefandData(refDir, refOCDBDir) ;
- qac->Run(index, list) ;
+
+ TString className(obj->ClassName()) ;
+ if (className.Contains(TObjArray::Class()->GetName())) {
+ qac->Run(index, static_cast<TObjArray *>(obj)) ;
+ } else if (className.Contains(TNtupleD::Class()->GetName())) {
+ qac->Run(index, static_cast<TNtupleD *>(obj)) ;
+ } else {
+ AliError(Form("%s class not implemented", className.Data())) ;
+ return kFALSE ;
+ }
return kTRUE ;
}
-
-
-