From 566f73ca17499a8b17053fd082682ee2a7aaf4a1 Mon Sep 17 00:00:00 2001 From: masera Date: Tue, 29 May 2007 15:22:14 +0000 Subject: [PATCH] Exit with AliFatal if a default OCDB has not been set. In the past a local CDB was accessed by default in this case --- ITS/AliITSDetTypeRec.cxx | 19 +++---------------- ITS/AliITSDetTypeSim.cxx | 12 ++---------- ITS/AliITSGeoPlot.C | 12 +++++++++++- ITS/AliITSsimulationSPD.cxx | 10 ++-------- 4 files changed, 18 insertions(+), 35 deletions(-) diff --git a/ITS/AliITSDetTypeRec.cxx b/ITS/AliITSDetTypeRec.cxx index cb44aa3358e..acee3095959 100644 --- a/ITS/AliITSDetTypeRec.cxx +++ b/ITS/AliITSDetTypeRec.cxx @@ -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); diff --git a/ITS/AliITSDetTypeSim.cxx b/ITS/AliITSDetTypeSim.cxx index 600bf7eb8da..e2e76d0e15f 100644 --- a/ITS/AliITSDetTypeSim.cxx +++ b/ITS/AliITSDetTypeSim.cxx @@ -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){ diff --git a/ITS/AliITSGeoPlot.C b/ITS/AliITSGeoPlot.C index 058a24c0e6b..1c6c48441bf 100644 --- a/ITS/AliITSGeoPlot.C +++ b/ITS/AliITSGeoPlot.C @@ -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"; diff --git a/ITS/AliITSsimulationSPD.cxx b/ITS/AliITSsimulationSPD.cxx index 98a1d6a07bb..07688a5e34e 100644 --- a/ITS/AliITSsimulationSPD.cxx +++ b/ITS/AliITSsimulationSPD.cxx @@ -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(); -- 2.39.3