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 ///////////////////////////////////////////////////////////////////////////////
29 #include "AliRunLoader.h"
31 #include "AliTOFtracker.h"
32 #include "AliTOFtrackerMI.h"
33 #include "AliTOFClusterFinder.h"
34 #include "AliTOFReconstructor.h"
37 ClassImp(AliTOFReconstructor)
40 //_____________________________________________________________________________
41 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
43 // reconstruct clusters from digits
45 AliTOFClusterFinder *tofClus = new AliTOFClusterFinder(runLoader);
47 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
49 tofClus->Digits2RecPoints(iEvent);
55 //_____________________________________________________________________________
56 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
57 AliRawReader *rawReader) const
59 // reconstruct clusters from Raw Data
61 AliTOFClusterFinder tofClus(runLoader);
62 tofClus.LoadClusters();
64 while (rawReader->NextEvent()) {
65 tofClus.Digits2RecPoints(iEvent,rawReader);
66 //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
69 tofClus.UnLoadClusters();
73 //_____________________________________________________________________________
74 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
75 TTree *clustersTree) const
77 // reconstruct clusters from Raw Data
79 AliTOFClusterFinder tofClus;
80 tofClus.Digits2RecPoints(rawReader, clustersTree);
84 //_____________________________________________________________________________
85 AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
87 // create a TOF tracker
89 AliTOFGeometry* geom = GetTOFGeometry(runLoader);
90 if (!geom) return NULL;
91 Double_t parPID[] = {130., 5.};
92 TString selectedTracker = GetOption();
93 // use MI tracker if selected
94 if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(geom,parPID);
96 return new AliTOFtracker(geom, parPID);
99 //_____________________________________________________________________________
100 void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/,
101 AliESD* /*esd*/) const
103 // nothing to be done
107 //_____________________________________________________________________________
108 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
110 // get the TOF parameters
112 runLoader->CdGAFile();
113 AliTOFGeometry* tofGeom = (AliTOFGeometry*) gFile->Get("TOFGeometry");
115 AliError("no TOF geometry available");