]> 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 c2cbff57663648e9efb58c4719cd0e011016fb20..5bc0d80efb8f7a20dfc8599125c5dd9fbc99fb8a 100644 (file)
 #include "AliPDG.h"
 #include "AliRun.h"
 #include "AliStack.h"
+#include "AliAlignObj.h"
+#ifdef __APPLE__
+//#include "AliTPCTrackHitsInterfaces.h"
+#endif
 
 AliRun *gAlice;
 
-
 ClassImp(AliRun)
 
 //_______________________________________________________________________
@@ -87,6 +90,7 @@ AliRun::AliRun():
   fPDGDB(0),  //Particle factory object
   fConfigFunction("\0"),
   fRandom(0),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -115,6 +119,7 @@ AliRun::AliRun(const AliRun& arun):
   fPDGDB(0),  //Particle factory object
   fConfigFunction("\0"),
   fRandom(0),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -142,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)
 {
   //
@@ -171,6 +177,14 @@ AliRun::AliRun(const char *name, const char *title):
   // Add particle list to configuration
   AliConfig::Instance()->Add(fPDGDB); 
 
+#ifdef __APPLE__
+  // Terrible hack to avoid problem with the initialisation of 
+  // static and globals on Mac OS X 
+  //  AliClassAliTrackHitsInfo p1=galiclass____AliClassAliTrackHitsInfo;
+  // AliClassAliTrackHitsParam p2=galiclass____AliTrackHitsParam;
+  //AliClassAliHitInfo p3=galiclass____AliHitInfo;
+#endif
+
 }
 
 
@@ -270,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)
@@ -939,17 +960,35 @@ void AliRun::AddModule(AliModule* mod)
   fNdets++;
 }
 
+// added by Alberto Colla
+//_____________________________________________________________________________
+/*inline*/ Bool_t AliRun::IsFileAccessible(const char* fnam, EAccessMode mode)
+{ return !gSystem->AccessPathName(fnam,mode);}
 
-//_______________________________________________________________________
-Int_t AliRun::GetDebug() const
+//______________________________________________________
+/*inline*/ Bool_t AliRun::IsFileAccessible(Char_t* name,EAccessMode mode)
 {
-  AliWarning("Don't use this method any more, use AliDebug instead");
-  return AliDebugLevel();
+  TString str = name; gSystem->ExpandPathName(str);
+  return !gSystem->AccessPathName(str.Data(),mode);
 }
 
-//_______________________________________________________________________
-void AliRun::SetDebug(Int_t level)
+//_____________________________________________________________________________
+Bool_t AliRun::ApplyDisplacements(TClonesArray* AlObjArray)
 {
-  AliWarning("Don't use this method any more, use AliLog instead");
-  AliLog::SetClassDebugLevel("AliRun", level);
+  // 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;
+
 }
+