1 void UpdateCDBIdealGeom(const char* cdbUri, const char* cfgFile){
2 // Produce the ideal geometry and store it in the specified CDB
3 // The second argument allows to specify the config file to be used
4 // in particular for giving the choice to generate either a full or
8 AliCDBManager* cdb = AliCDBManager::Instance();
9 // we set the default storage to the repository because some dets require
10 // already at the time of geometry creation to find calibration objects in the cdb
11 if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
12 AliCDBStorage* storage = cdb->GetStorage(cdbUri);
14 AliCDBId id("GRP/Geometry/Data",0,AliCDBRunRange::Infinity());
15 AliCDBMetaData *md= new AliCDBMetaData();
17 // Get root and AliRoot versions
18 const char* rootv = gROOT->GetVersion();
19 gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
20 TString av(GetARversion());
22 md->SetAliRootVersion(av.Data());
23 md->SetComment(Form("Geometry produced with root version %s and AliRoot version %s",rootv,av.Data()));
25 gAlice->Init(cfgFile);
28 Printf("Unable to produce a valid geometry to be put in the CDB!");
32 Printf("Storing in CDB geometry produced with root version %s and AliRoot version %s",rootv,av.Data());
33 storage->Put(gGeoManager,id,md);
34 // This is to allow macros lauched after this one in the same session to find the
35 // newly produced geometry.
36 storage->QueryCDB(cdb->GetRun());