]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Exit with AliFatal if a default OCDB has not been set. In the past a local CDB was...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 May 2007 15:22:14 +0000 (15:22 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 May 2007 15:22:14 +0000 (15:22 +0000)
ITS/AliITSDetTypeRec.cxx
ITS/AliITSDetTypeSim.cxx
ITS/AliITSGeoPlot.C
ITS/AliITSsimulationSPD.cxx

index cb44aa3358e975f4b5f11d888e4988bbb21b2727..acee3095959c2878b613af2afa7127dd4c684948 100644 (file)
@@ -442,23 +442,10 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", run);
 
   if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
-       AliWarning("Calibration object retrieval failed! Dummy calibration will be used.");
-       AliCDBStorage *localStor = 
-               AliCDBManager::Instance()->GetStorage("local://$ALICE_ROOT");
-       
-       entrySPD = localStor->Get("ITS/Calib/CalibSPD", run);
-       entrySDD = localStor->Get("ITS/Calib/CalibSDD", run);
-       entrySSD = localStor->Get("ITS/Calib/CalibSSD", run);
-       entry2SPD = localStor->Get("ITS/Calib/RespSPD", run);
-       entry2SDD = localStor->Get("ITS/Calib/RespSDD", run);
-       entry2SSD = localStor->Get("ITS/Calib/RespSSD", run);
-  }
-
-  if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
-    AliError("Calibration data was not found in $ALICE_ROOT!");
+    AliFatal("Calibration object retrieval failed! ");
     return kFALSE;
-  }
+  }    
+
   TObjArray *calSPD = (TObjArray *)entrySPD->GetObject();
   if(!isCacheActive)entrySPD->SetObject(NULL);
   entrySPD->SetOwner(kTRUE);
index 600bf7eb8da3c8cc3ec331d15f211f1c370e5695..e2e76d0e15f9fd6b1d64e887f86097d64d73379b 100644 (file)
@@ -454,16 +454,8 @@ Bool_t AliITSDetTypeSim::GetCalibration() {
   AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", run);
 
   if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
-       AliWarning("Calibration object retrieval failed! Dummy calibration will be used.");
-       AliCDBStorage *localStor = 
-               AliCDBManager::Instance()->GetStorage("local://$ALICE_ROOT");
-       
-       entrySPD = localStor->Get("ITS/Calib/CalibSPD", run);
-       entrySDD = localStor->Get("ITS/Calib/CalibSDD", run);
-       entrySSD = localStor->Get("ITS/Calib/CalibSSD", run);
-       entry2SPD = localStor->Get("ITS/Calib/RespSPD", run);
-       entry2SDD = localStor->Get("ITS/Calib/RespSDD", run);
-       entry2SSD = localStor->Get("ITS/Calib/RespSSD", run);
+       AliFatal("Calibration object retrieval failed!");
+       return kFALSE;
   }
 
   if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
index 058a24c0e6b2bdf148801673072ea123a8384daa..1c6c48441bf5a0923306e40c49c45249a5878491 100644 (file)
@@ -31,6 +31,8 @@
 #include "AliRunLoader.h"
 #include "AliITSLoader.h"
 #include "AliHeader.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
 #endif
 void GetHitsCoor(TObject *its, Int_t mod, TObjArray & histos, Int_t subd,Bool_t verb);
 Int_t GetRecCoor(TObject *ge, TClonesArray *ITSrec, Int_t mod, TH2F *h2, TH1F *h1, Bool_t verb);
@@ -94,7 +96,6 @@ Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+ClustersV2", TString filenam
   Bool_t userec=choice.Contains("Rec");
   Bool_t useclustersv2=choice.Contains("ClustersV2");
   Int_t retcode=1; //return code
   if (gClassTable->GetID("AliRun") < 0) {
     gInterpreter->ExecuteMacro("loadlibs.C");
   }
@@ -105,6 +106,15 @@ Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+ClustersV2", TString filenam
       gAlice=0;
     }
   }
+  // Set OCDB if needed
+  AliCDBManager* man = AliCDBManager::Instance();
+  if (!man->IsDefaultStorageSet()) {
+    printf("Setting a local default storage\n");
+    man->SetDefaultStorage("local://$ALICE_ROOT");
+  }
+  else {
+    printf("Using deafult storage \n");
+  }
   // retrives geometry 
   TString geof(gSystem->DirName(filename));
   geof += "/geometry.root";
index 98a1d6a07bb0227b7fea65ae3ca4d18611299dc8..07688a5e34e13f2356aa66d6130b43df307d0400 100644 (file)
@@ -206,14 +206,8 @@ void AliITSsimulationSPD::GetCalibrationObjects(Int_t RunNr) {
   entrySPD = man->Get("ITS/Calib/CalibSPD", RunNr);
 
   if(!entrySPD){
-    AliWarning("Cannot find SPD calibration entry in default storage! Using local storage $ALICE_ROOT");
-    AliCDBStorage *localStor = 
-               AliCDBManager::Instance()->GetStorage("local://$ALICE_ROOT");
-    entrySPD = localStor->Get("ITS/Calib/CalibSPD", RunNr);
-    if(!entrySPD){
-      AliFatal("Cannot find SPD calibration entry!");
-      return;
-    }
+    AliFatal("Cannot find SPD calibration entry in default storage!");
+    return;
   }
   
   TObjArray *respSPD = (TObjArray *)entrySPD->GetObject();