]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - GRP/UpdateCDBIdealGeom.C
a/ AliTRDCalibTask.cxx .h: one histo more to quantify the event selection if any...
[u/mrichter/AliRoot.git] / GRP / UpdateCDBIdealGeom.C
index ac7776d5bad398fa100663edc33c81a65e0671df..962946130b978af21588a863aa0ef6f467616447 100644 (file)
@@ -1,3 +1,18 @@
+#include "ARVersion.h"
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#include "AliCDBId.h"
+#include "AliCDBMetaData.h"
+#include "AliGeomManager.h"
+#include "AliMC.h"
+#include <TROOT.h>
+#include "AliRun.h"
+#include <TGeoManager.h>
+#include <TString.h>
+#include <TInterpreter.h>
+#endif
+
 void UpdateCDBIdealGeom(const char* cdbUri, const char* cfgFile){
   // Produce the ideal geometry and store it in the specified CDB
   // The second argument allows to specify the config file to be used
@@ -8,26 +23,38 @@ 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();
 
   // Get root and AliRoot versions
   const char* rootv = gROOT->GetVersion();
-  gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
-  TString av(GetARversion());
+  TString av(ALIROOT_SVN_BRANCH);
+  Int_t revnum = ALIROOT_SVN_REVISION;
+
+  Printf("root version: %s.  AliRoot %s, revision number %d",rootv,av.Data(),revnum);
 
   md->SetAliRootVersion(av.Data());
-  md->SetComment(Form("Geometry produced with root version %s and AliRoot version %s",rootv,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);