Fixed effc++ warnings.
[u/mrichter/AliRoot.git] / GRP / UpdateCDBIdealGeom.C
CommitLineData
a24be56b 1void 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
5 // a partial geometry.
6 //
9b8b014f 7
a24be56b 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);
13 cdb->SetRun(0);
9b8b014f 14 AliCDBId id("GRP/Geometry/Data",0,AliCDBRunRange::Infinity());
15 AliCDBMetaData *md= new AliCDBMetaData();
16
a24be56b 17 // Get root and AliRoot versions
9b8b014f 18 const char* rootv = gROOT->GetVersion();
a24be56b 19 gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
20 TString av(GetARversion());
9b8b014f 21
a24be56b 22 md->SetAliRootVersion(av.Data());
23 md->SetComment(Form("Geometry produced with root version %s and AliRoot version %s",rootv,av.Data()));
9b8b014f 24
a24be56b 25 gAlice->Init(cfgFile);
9b8b014f 26
27 if(!gGeoManager){
28 Printf("Unable to produce a valid geometry to be put in the CDB!");
29 return;
30 }
31
a24be56b 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());
9b8b014f 37
38}
a24be56b 39
40