1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for TOF reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
27 #include "AliRawReader.h"
28 #include "AliRunLoader.h"
30 #include "AliTOFClusterFinder.h"
31 #include "AliTOFGeometry.h"
32 #include "AliTOFtrackerMI.h"
33 #include "AliTOFtracker.h"
34 #include "AliTOFReconstructor.h"
40 extern TDirectory *gDirectory;
43 ClassImp(AliTOFReconstructor)
45 //_____________________________________________________________________________
46 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
48 // reconstruct clusters from digits
50 AliTOFClusterFinder tofClus(runLoader);
52 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
54 tofClus.Digits2RecPoints(iEvent);
60 //_____________________________________________________________________________
61 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
62 AliRawReader *rawReader) const
64 // reconstruct clusters from Raw Data
66 AliTOFClusterFinder tofClus(runLoader);
67 tofClus.LoadClusters();
69 while (rawReader->NextEvent()) {
70 tofClus.Digits2RecPoints(iEvent,rawReader);
71 //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
74 tofClus.UnLoadClusters();
78 //_____________________________________________________________________________
79 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
80 TTree *clustersTree) const
82 // reconstruct clusters from Raw Data
84 AliTOFClusterFinder tofClus;
85 tofClus.Digits2RecPoints(rawReader, clustersTree);
89 //_____________________________________________________________________________
90 AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
92 // create a TOF tracker
94 AliTOFGeometry* geom = GetTOFGeometry(runLoader);
95 if (!geom) return NULL;
96 // Double_t parPID[] = {130., 5.};
97 Double_t parPID[] = {80., 5.};
98 TString selectedTracker = GetOption();
99 // use MI tracker if selected
100 if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(geom,parPID);
102 return new AliTOFtracker(geom, parPID);
105 //_____________________________________________________________________________
106 void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/,
107 AliESD* /*esd*/) const
109 // nothing to be done
113 //_____________________________________________________________________________
114 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
116 // get the TOF parameters
118 AliTOFGeometry *tofGeom;
120 runLoader->CdGAFile();
121 TDirectory *savedir=gDirectory;
122 TFile *in=(TFile*)gFile;
124 AliWarning("Geometry file is not open default TOF geometry will be used");
125 tofGeom = new AliTOFGeometry();
129 tofGeom = (AliTOFGeometry*) in->Get("TOFgeometry");
135 AliError("no TOF geometry available");