Using AliGeomManager in the macros (Raffaele)
[u/mrichter/AliRoot.git] / macros / MakeAllDETsZeroMisAlignment.C
index 5f74035..8d42605 100644 (file)
@@ -13,15 +13,14 @@ void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/Zero"){
     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,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
   TObjArray *detArray = dets.Tokenize(',');
   TIter iter(detArray);