]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDtest.C
TOF PID based on the new geometrical interface (Yu.Belikov)
[u/mrichter/AliRoot.git] / STEER / AliESDtest.C
index d4c60c3926114253a8b49349b51492f6a32fb066..b75c34e5d2133b7713233c06bc032fc9ff0e499d 100644 (file)
@@ -20,7 +20,6 @@
   #include "TFile.h"
   #include "TSystem.h"
   #include "TStopwatch.h"
-  #include "TGeant3.h"
   #include "TArrayF.h"
 
   #include "AliMagF.h"
   #include "AliTRDPartID.h"
 
   #include "AliTOFpidESD.h"
+  #include "AliTOF.h"
+  #include "AliTOFGeometry.h"
 #endif
 
-extern TSystem *gSystem;
 extern AliRun *gAlice;
 extern TFile *gFile;
 
@@ -66,9 +66,6 @@ Int_t AliESDtest(Int_t nev=1,Int_t run=0) {
       gAlice=0;
    }
 
-   gSystem->Load("libgeant321");     // needed for the PID in TOF 
-   new TGeant3("");                  // must be re-done !
-
    AliRunLoader *rl = AliRunLoader::Open("galice.root");
    if (rl == 0x0) {
       cerr<<"Can not open session"<<endl;
@@ -192,6 +189,16 @@ Int_t AliESDtest(Int_t nev=1,Int_t run=0) {
 
 
 /**** The TOF corner ********************/
+   AliTOF *dTOF = (AliTOF*)gAlice->GetDetector("TOF");
+   if (!dTOF) {
+      cerr<<"AliESDtest.C : Can not find the TOF detector !"<<endl;
+      return 4;
+   }
+   AliTOFGeometry *tofGeo = dTOF->GetGeometry();
+   if (!tofGeo) {
+      cerr<<"AliESDtest.C : Can not find the TOF geometry !"<<endl;
+      return 4;
+   }
 
    AliLoader* tofl = rl->GetLoader("TOFLoader");
    if (tofl == 0x0) {
@@ -281,7 +288,7 @@ Int_t AliESDtest(Int_t nev=1,Int_t run=0) {
         cerr<<"Can't get the TOF cluster tree !\n";
         return 4;
      } 
-     tofPID.LoadClusters(tofTree);
+     tofPID.LoadClusters(tofTree,tofGeo);
      tofPID.MakePID(event);
      tofPID.UnloadClusters();