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 "AliTOFClusterFinder.h"
33 #include "AliTOFReconstructor.h"
36 ClassImp(AliTOFReconstructor)
39 //_____________________________________________________________________________
40 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
42 // reconstruct clusters from digits
44 AliTOFClusterFinder *tofClus = new AliTOFClusterFinder(runLoader);
46 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
48 tofClus->Digits2RecPoints(iEvent);
54 //_____________________________________________________________________________
55 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
56 AliRawReader *rawReader) const
58 // reconstruct clusters from Raw Data
60 AliTOFClusterFinder tofClus(runLoader);
61 tofClus.LoadClusters();
63 while (rawReader->NextEvent()) {
64 tofClus.Digits2RecPoints(iEvent,rawReader);
65 //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
68 tofClus.UnLoadClusters();
72 //_____________________________________________________________________________
73 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
74 TTree *clustersTree) const
76 // reconstruct clusters from Raw Data
78 AliTOFClusterFinder tofClus;
79 tofClus.Digits2RecPoints(rawReader, clustersTree);
83 //_____________________________________________________________________________
84 AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
86 // create a TOF tracker
88 AliTOFGeometry* geom = GetTOFGeometry(runLoader);
89 if (!geom) return NULL;
90 Double_t parPID[] = {130., 5.};
91 return new AliTOFtracker(geom, parPID);
94 //_____________________________________________________________________________
95 void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/,
96 AliESD* /*esd*/) const
102 //_____________________________________________________________________________
103 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
105 // get the TOF parameters
107 runLoader->CdGAFile();
108 AliTOFGeometry* tofGeom = (AliTOFGeometry*) gFile->Get("TOFGeometry");
110 AliError("no TOF geometry available");