#include <TRandom3.h>
#include <TSystem.h>
#include <TVirtualMC.h>
+#include <TGeoManager.h>
//
#include "AliLog.h"
#include "AliDetector.h"
#include "AliPDG.h"
#include "AliRun.h"
#include "AliStack.h"
-#ifdef __APPLE__
-#include "AliTPCTrackHitsInterfaces.h"
-#endif
+#include "AliAlignObj.h"
AliRun *gAlice;
fMCApp(0),
fDisplay(0),
fField(0),
- fMC(0),
fNdets(0),
fInitDone(kFALSE),
fLego(0),
fPDGDB(0), //Particle factory object
fConfigFunction("\0"),
fRandom(0),
- fBaseFileName(),
+ fIsRootGeometry(kFALSE),
fRunLoader(0x0)
{
//
fMCApp(0),
fDisplay(0),
fField(0),
- fMC(0),
fNdets(0),
fInitDone(kFALSE),
fLego(0),
fPDGDB(0), //Particle factory object
fConfigFunction("\0"),
fRandom(0),
- fBaseFileName(),
+ fIsRootGeometry(kFALSE),
fRunLoader(0x0)
{
//
fMCApp(0),
fDisplay(0),
fField(0),
- fMC(gMC),
fNdets(0),
fInitDone(kFALSE),
fLego(0),
fPDGDB(TDatabasePDG::Instance()), //Particle factory object!
fConfigFunction("Config();"),
fRandom(new TRandom3()),
- fBaseFileName(),
+ fIsRootGeometry(kFALSE),
fRunLoader(0x0)
{
//
// 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
-
}
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)
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::ApplyAlignObjsToGeom(TObjArray* 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;
+ }
+
+ gGeoManager->CheckOverlaps(50);
+ TObjArray* ovexlist = gGeoManager->GetListOfOverlaps();
+ if(ovexlist->GetEntriesFast()){
+ AliErrorClass("The application of alignment objects to the geometry caused huge overlaps/extrusions!");
+ }
+
+ return kTRUE;
+
}
+