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 "AliTOFGeometryV5.h"
33 #include "AliTOFtrackerMI.h"
34 #include "AliTOFtracker.h"
35 #include "AliTOFReconstructor.h"
41 extern TDirectory *gDirectory;
44 ClassImp(AliTOFReconstructor)
46 //_____________________________________________________________________________
47 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
49 // reconstruct clusters from digits
51 AliTOFClusterFinder tofClus(runLoader);
53 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
55 tofClus.Digits2RecPoints(iEvent);
61 //_____________________________________________________________________________
62 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
63 AliRawReader *rawReader) const
65 // reconstruct clusters from Raw Data
67 AliTOFClusterFinder tofClus(runLoader);
68 tofClus.LoadClusters();
70 while (rawReader->NextEvent()) {
71 tofClus.Digits2RecPoints(iEvent,rawReader);
72 //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
75 tofClus.UnLoadClusters();
79 //_____________________________________________________________________________
80 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
81 TTree *clustersTree) const
83 // reconstruct clusters from Raw Data
85 AliTOFClusterFinder tofClus;
86 tofClus.Digits2RecPoints(rawReader, clustersTree);
90 //_____________________________________________________________________________
91 AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* /*runLoader*/) const
93 // create a TOF tracker
95 TString selectedTracker = GetOption();
96 // use MI tracker if selected
97 if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI();
98 return new AliTOFtracker();
101 //_____________________________________________________________________________
102 void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/,
103 AliESD* /*esd*/) const
105 // nothing to be done
109 //_____________________________________________________________________________
110 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
112 // get the TOF parameters
114 AliTOFGeometry *tofGeom;
116 runLoader->CdGAFile();
117 TDirectory *savedir=gDirectory;
118 TFile *in=(TFile*)gFile;
120 AliWarning("Geometry file is not open default TOF geometry will be used");
121 tofGeom = new AliTOFGeometryV5();
125 tofGeom = (AliTOFGeometry*) in->Get("TOFgeometry");
131 AliError("no TOF geometry available");