X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=GRP%2FUpdateCDBIdealGeom.C;h=962946130b978af21588a863aa0ef6f467616447;hb=6746e1e1c977330c0ea11714eeb43d05542c5abf;hp=d31bae3a28c4954dcae52854036f9c7140a86cc0;hpb=a63b8f0273e63a1f267b69835206387abb92f73a;p=u%2Fmrichter%2FAliRoot.git diff --git a/GRP/UpdateCDBIdealGeom.C b/GRP/UpdateCDBIdealGeom.C index d31bae3a28c..962946130b9 100644 --- a/GRP/UpdateCDBIdealGeom.C +++ b/GRP/UpdateCDBIdealGeom.C @@ -5,10 +5,12 @@ #include "AliCDBId.h" #include "AliCDBMetaData.h" #include "AliGeomManager.h" +#include "AliMC.h" #include #include "AliRun.h" #include #include +#include #endif void UpdateCDBIdealGeom(const char* cdbUri, const char* cfgFile){ @@ -21,8 +23,14 @@ void UpdateCDBIdealGeom(const char* cdbUri, const char* cfgFile){ AliCDBManager* cdb = AliCDBManager::Instance(); // we set the default storage to the repository because some dets require // already at the time of geometry creation to find calibration objects in the cdb - if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT"); - AliCDBStorage* storage = cdb->GetStorage(cdbUri); + AliCDBStorage* storage = 0; + if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + storage = cdb->GetStorage(cdbUri); + if(!storage) + { + Printf("unable to create valid storage from: %s", cdbUri); + return; + } cdb->SetRun(0); AliCDBId id("GRP/Geometry/Data",0,AliCDBRunRange::Infinity()); AliCDBMetaData *md= new AliCDBMetaData(); @@ -37,12 +45,16 @@ void UpdateCDBIdealGeom(const char* cdbUri, const char* cfgFile){ md->SetAliRootVersion(av.Data()); md->SetComment(Form("Geometry produced with root version %s and AliRoot %s, revision number %d",rootv,av.Data(),revnum)); - gAlice->Init(cfgFile); + gROOT->LoadMacro(cfgFile); + gInterpreter->ProcessLine(gAlice->GetConfigFunction()); + gAlice->GetMCApp()->Init(); if(!gGeoManager){ Printf("Unable to produce a valid geometry to be put in the CDB!"); return; } + gGeoManager->DefaultColors(); // assign default colors according to Z of material + // (many colors turned into dark gray nuances some time ago, when the root palette was changed) Printf("Storing in CDB geometry produced with root version %s and AliRoot version %s",rootv,av.Data()); storage->Put(gGeoManager,id,md);