]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliGeomManager.cxx
move from Bz to BxByBz in track propagation
[u/mrichter/AliRoot.git] / STEER / AliGeomManager.cxx
index 21c4095729c80114627bc24697ba333c041cc062..94d504c636c5f52386e59d187c38a06c0022a972 100644 (file)
@@ -111,6 +111,12 @@ void AliGeomManager::LoadGeometry(const char *geomFileName)
   // Load geometry either from a file
   // or from the corresponding CDB entry
 
+  if(fgGeometry->IsLocked()){
+      AliErrorClass("Cannot load a new geometry, the current one being locked. Setting internal geometry to null!!");
+      fgGeometry = NULL;
+      return;
+  }
+
   fgGeometry = NULL;
   if (geomFileName && (!gSystem->AccessPathName(geomFileName))) {
     fgGeometry = TGeoManager::Import(geomFileName);
@@ -1574,7 +1580,7 @@ Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* AlignDetsList)
   
   while((str = (TObjString*) iter.Next())){
     TString det(str->String());
-    AliInfoClass(Form("Loading alignment objs for %s",det.Data()));
+    AliDebugClass(5,Form("Loading alignment objs for %s",det.Data()));
     if(!LoadAlignObjsFromCDBSingleDet(det.Data(),alignObjArray)){
       alObjsNotLoaded += det.Data();
       alObjsNotLoaded += " ";
@@ -1588,7 +1594,8 @@ Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* AlignDetsList)
 
   if(!alObjsLoaded.IsNull()) AliInfoClass(Form("Alignment objects loaded for: %s",
                                               alObjsLoaded.Data()));
-  if(!alObjsNotLoaded.IsNull()) AliInfoClass(Form("Didn't/couldn't load alignment objects for: %s",
+  if(!alObjsNotLoaded.IsNull())
+      AliFatalClass(Form("Could not load alignment objects from OCDB for: %s",
                                                  alObjsNotLoaded.Data()));
  
   return ApplyAlignObjsToGeom(alignObjArray);
@@ -1639,40 +1646,40 @@ Bool_t AliGeomManager::LoadAlignObjsFromCDBSingleDet(const char* detName, TObjAr
 //_____________________________________________________________________________
 Bool_t AliGeomManager::ApplyAlignObjsToGeom(TObjArray& alignObjArray, Bool_t ovlpcheck)
 {
-  // Read collection of alignment objects (AliAlignObj derived) saved
-  // in the TClonesArray alObjArray and apply them to gGeoManager
-  //
-  alignObjArray.Sort();
-  Int_t nvols = alignObjArray.GetEntriesFast();
+    // Read collection of alignment objects (AliAlignObj derived) saved
+    // in the TClonesArray alObjArray and apply them to gGeoManager
+    //
+    alignObjArray.Sort();
+    Int_t nvols = alignObjArray.GetEntriesFast();
 
-  Bool_t flag = kTRUE;
+    Bool_t flag = kTRUE;
 
-  for(Int_t j=0; j<nvols; j++)
-  {
-    AliAlignObj* alobj = (AliAlignObj*) alignObjArray.UncheckedAt(j);
-    flag = alobj->ApplyToGeometry(ovlpcheck);
-    if(!flag)
+    for(Int_t j=0; j<nvols; j++)
     {
-      AliDebugClass(5,Form("Error applying alignment object for volume %s !",alobj->GetSymName()));
-    }else{
-      AliDebugClass(5,Form("Alignment object for volume %s applied successfully",alobj->GetSymName()));
-    }
+       AliAlignObj* alobj = (AliAlignObj*) alignObjArray.UncheckedAt(j);
+       if(!alobj->ApplyToGeometry(ovlpcheck))
+       {
+           flag = kFALSE;
+           AliDebugClass(5,Form("Error applying alignment object for volume %s !",alobj->GetSymName()));
+       }else{
+           AliDebugClass(5,Form("Alignment object for volume %s applied successfully",alobj->GetSymName()));
+       }
 
-  }
+    }
 
-  if (AliDebugLevelClass() > 5) {
-    fgGeometry->CheckOverlaps(0.001);
-    TObjArray* ovexlist = fgGeometry->GetListOfOverlaps();
-    if(ovexlist->GetEntriesFast()){  
-      AliErrorClass("The application of alignment objects to the geometry caused huge overlaps/extrusions!");
-      fgGeometry->PrintOverlaps();
-   }
-  }
+    if (AliDebugLevelClass() > 5) {
+       fgGeometry->CheckOverlaps(0.001);
+       TObjArray* ovexlist = fgGeometry->GetListOfOverlaps();
+       if(ovexlist->GetEntriesFast()){  
+           AliErrorClass("The application of alignment objects to the geometry caused huge overlaps/extrusions!");
+           fgGeometry->PrintOverlaps();
+       }
+    }
 
-  // Update the TGeoPhysicalNodes
-  fgGeometry->RefreshPhysicalNodes();
+    // Update the TGeoPhysicalNodes
+    fgGeometry->RefreshPhysicalNodes();
 
-  return flag;
+    return flag;
 
 }