]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQAChecker.cxx
datamember added in AliGeomManager with number of alignable volumes per subdetector...
[u/mrichter/AliRoot.git] / STEER / AliQAChecker.cxx
index 833929b57b60240bc196ffd4e75a64ea5ae2a916..21035a801d535d92277872ddd634b584bed1c7a8 100644 (file)
@@ -24,7 +24,7 @@
 #include "AliCDBEntry.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
-#include "AliRunInfo.h"
+#include "AliRunInfo.h" 
 #include "AliLog.h"
 #include "AliModule.h" 
 #include "AliQA.h"
@@ -32,6 +32,7 @@
 #include "AliQACheckerBase.h"
 #include "AliCorrQAChecker.h"
 #include "AliGlobalQAChecker.h"
+#include "AliGRPObject.h"
 
 #include <TKey.h>
 #include <TObjArray.h>
@@ -206,41 +207,63 @@ void AliQAChecker::LoadRunInfoFromGRP()
 {
   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;
+  }
+
+  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 ? lhcState->GetString().Data() : "UNKNOWN",
-                           beamType ? beamType->GetString().Data() : "UNKNOWN",
-                           beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0,
-                           runType  ? runType->GetString().Data()  : "UNKNOWN",
-                           activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399);
+
+  fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors);
+
   fRunInfoOwner = kTRUE ; 
 }
 
@@ -374,4 +397,4 @@ Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TO
     return kFALSE ; 
   }
        return kTRUE ; 
-}
\ No newline at end of file
+}