]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRun.cxx
- AliStack::FinishEvent() not called for lego run
[u/mrichter/AliRoot.git] / STEER / AliRun.cxx
index ba1f90e3630cb3f64a9a58dcf088615106bf6a07..5bc0d80efb8f7a20dfc8599125c5dd9fbc99fb8a 100644 (file)
@@ -63,6 +63,7 @@
 #include "AliPDG.h"
 #include "AliRun.h"
 #include "AliStack.h"
+#include "AliAlignObj.h"
 #ifdef __APPLE__
 //#include "AliTPCTrackHitsInterfaces.h"
 #endif
@@ -89,6 +90,7 @@ AliRun::AliRun():
   fPDGDB(0),  //Particle factory object
   fConfigFunction("\0"),
   fRandom(0),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -117,6 +119,7 @@ AliRun::AliRun(const AliRun& arun):
   fPDGDB(0),  //Particle factory object
   fConfigFunction("\0"),
   fRandom(0),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -144,6 +147,7 @@ AliRun::AliRun(const char *name, const char *title):
   fPDGDB(TDatabasePDG::Instance()),        //Particle factory object!
   fConfigFunction("Config();"),
   fRandom(new TRandom3()),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -280,6 +284,13 @@ void  AliRun::SetField(AliMagF* magField)
   fField->ReadField();
 }
 
+//_______________________________________________________________________
+void AliRun::SetRootGeometry(Bool_t flag)
+{
+// Instruct application that the geometry is to be retreived from a root file.
+   fIsRootGeometry = flag;
+   if (flag) gMC->SetRootGeometry();
+}
 //_______________________________________________________________________
 void AliRun::SetField(Int_t type, Int_t version, Float_t scale,
                      Float_t maxField, const char* filename)
@@ -949,22 +960,6 @@ void AliRun::AddModule(AliModule* mod)
   fNdets++;
 }
 
-
-//_______________________________________________________________________
-Int_t AliRun::GetDebug() const
-{
-  AliFatal("Don't use this method any more, use AliDebug instead");
-  return AliDebugLevel();
-}
-
-//_______________________________________________________________________
-void AliRun::SetDebug(Int_t level)
-{
-  AliFatal("Don't use this method any more, use AliLog instead");
-  AliLog::SetClassDebugLevel("AliRun", level);
-}
-
-
 // added by Alberto Colla
 //_____________________________________________________________________________
 /*inline*/ Bool_t AliRun::IsFileAccessible(const char* fnam, EAccessMode mode)
@@ -977,4 +972,23 @@ void AliRun::SetDebug(Int_t level)
   return !gSystem->AccessPathName(str.Data(),mode);
 }
 
+//_____________________________________________________________________________
+Bool_t AliRun::ApplyDisplacements(TClonesArray* AlObjArray)
+{
+  // Read collection of alignment objects (AliAlignObj derived) saved
+  // in the TClonesArray ClArrayName and apply them to the geometry
+  // manager singleton.
+  //
+  Int_t nvols = AlObjArray->GetEntriesFast();
+
+  for(Int_t j=0; j<nvols; j++)
+    {
+      AliAlignObj* alobj = (AliAlignObj*) AlObjArray->UncheckedAt(j);
+      if (alobj->ApplyToGeometry() == kFALSE)
+       return kFALSE;
+    }
+
+  return kTRUE;
+
+}