]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFReconstructor.cxx
Removing the fake copy constructors and assignment operator, moving their declaration...
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.cxx
index e04aff9118b590f058941da915c058f83e94d6c6..e1a9c7d182f77d23d514a03a0ea32f5068d31ead 100644 (file)
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-
-#include <TFile.h>
+#include "TFile.h"
 
 #include "AliLog.h"
-#include "AliRun.h"
+#include "AliRawReader.h"
 #include "AliRunLoader.h"
 
-#include "AliTOFtracker.h"
 #include "AliTOFClusterFinder.h"
+#include "AliTOFGeometry.h"
+#include "AliTOFGeometryV5.h"
+#include "AliTOFtrackerMI.h"
+#include "AliTOFtracker.h"
 #include "AliTOFReconstructor.h"
 
+class TTree;
 
-ClassImp(AliTOFReconstructor)
+class AliESD;
 
+extern TDirectory *gDirectory;
+extern TFile *gFile;
+
+ClassImp(AliTOFReconstructor)
 
 //_____________________________________________________________________________
-  void AliTOFReconstructor::Reconstruct(AliRunLoader* /*runLoader*/) const
+  void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
 {
 // reconstruct clusters from digits
-/*
-  AliTOFClusterFinder *tofClus = new AliTOFClusterFinder(runLoader);
-  tofClus->Load();
+
+  AliTOFClusterFinder tofClus(runLoader);
+  tofClus.Load();
   for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
     {
-      tofClus->Digits2RecPoints(iEvent);
+      tofClus.Digits2RecPoints(iEvent);
     }
-  tofClus->UnLoad();
-*/
+  tofClus.UnLoad();
+
 }
 
 //_____________________________________________________________________________
@@ -61,8 +68,8 @@ void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
   tofClus.LoadClusters();
   Int_t iEvent = 0;
   while (rawReader->NextEvent()) {
-    //tofClus.Digits2RecPoints(iEvent,rawReader);
-    tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
+    tofClus.Digits2RecPoints(iEvent,rawReader);
+    //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
     iEvent++;
   }
   tofClus.UnLoadClusters();
@@ -85,9 +92,15 @@ AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
 {
 // create a TOF tracker
 
-  AliTOFGeometry* geom = GetTOFGeometry(runLoader);
+//  AliTOFGeometry* geom = GetTOFGeometry(runLoader);
+  AliTOFGeometry* geom = new AliTOFGeometryV5();
   if (!geom) return NULL;
-  Double_t parPID[] = {130., 5.};
+  //  Double_t parPID[] = {130., 5.};
+  Double_t parPID[] = {80., 5.};
+  TString selectedTracker = GetOption();
+  // use MI tracker if selected
+  if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(geom,parPID);
+
   return new AliTOFtracker(geom, parPID);
 }
 
@@ -104,8 +117,22 @@ AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) con
 {
 // get the TOF parameters
 
+  AliTOFGeometry *tofGeom;
+
   runLoader->CdGAFile();
-  AliTOFGeometry* tofGeom = (AliTOFGeometry*) gFile->Get("TOFGeometry"); 
+  TDirectory *savedir=gDirectory; 
+  TFile *in=(TFile*)gFile;  
+  if (!in->IsOpen()) {
+    AliWarning("Geometry file is not open default  TOF geometry will be used");
+    tofGeom = new AliTOFGeometryV5();
+  }
+  else {
+    in->cd();  
+    tofGeom = (AliTOFGeometry*) in->Get("TOFgeometry");
+  }
+
+  savedir->cd();  
+
   if (!tofGeom) {
     AliError("no TOF geometry available");
     return NULL;