Using AliGeomManager in the macros (Raffaele)
[u/mrichter/AliRoot.git] / macros / MakeAllDETsResMisAlignment.C
index 59c71f1..fb9a284 100644 (file)
@@ -16,13 +16,11 @@ void MakeAllDETsResMisAlignment(Char_t* CDBstorage = "local://$HOME/Residual"){
     gSystem->Setenv("ARVERSION","v4-05-08");
   }
 
-  // if not already present, create geometry file needed by those detectors
-  // producing their objects in the local RS
-  if(gSystem->AccessPathName("./geometry.root")){
-    gAlice->Init();
-    gGeoManager->Export("geometry.root");
-  }else{
-    TGeoManager::Import("geometry.root");
+  if(!AliGeomManager::GetGeometry()){
+    if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+      AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+      AliCDBManager::Instance()->SetRun(0);
+    AliGeomManager::LoadGeometry();
   }
 
   TString dets="EMCAL,FMD,HMPID,ITS,MUON,PHOS,PMD,T0,TOF,TPC,TRD,VZERO,ZDC";