]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFReconstructor.cxx
20-oct-2005 NvE Directory /macros introduced and ROOT macro makedocs.cc added in...
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.cxx
CommitLineData
121a60bd 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// class for TOF reconstruction //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24
d08a92dd 25#include <TFile.h>
26
27#include "AliLog.h"
121a60bd 28#include "AliRun.h"
d08a92dd 29#include "AliRunLoader.h"
30
121a60bd 31#include "AliTOFtracker.h"
d08a92dd 32#include "AliTOFClusterFinder.h"
33#include "AliTOFReconstructor.h"
121a60bd 34
35
36ClassImp(AliTOFReconstructor)
37
38
39//_____________________________________________________________________________
7b61cd9c 40 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
121a60bd 41{
d08a92dd 42// reconstruct clusters from digits
7b61cd9c 43
d08a92dd 44 AliTOFClusterFinder *tofClus = new AliTOFClusterFinder(runLoader);
45 tofClus->Load();
46 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
47 {
48 tofClus->Digits2RecPoints(iEvent);
49 }
50 tofClus->UnLoad();
7b61cd9c 51
d08a92dd 52}
53
54//_____________________________________________________________________________
55void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
56 AliRawReader *rawReader) const
57{
58// reconstruct clusters from Raw Data
59
60 AliTOFClusterFinder tofClus(runLoader);
61 tofClus.LoadClusters();
62 Int_t iEvent = 0;
63 while (rawReader->NextEvent()) {
7b61cd9c 64 tofClus.Digits2RecPoints(iEvent,rawReader);
65 //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
d08a92dd 66 iEvent++;
67 }
68 tofClus.UnLoadClusters();
69
70}
71
72//_____________________________________________________________________________
73void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
74 TTree *clustersTree) const
75{
76// reconstruct clusters from Raw Data
77
78 AliTOFClusterFinder tofClus;
79 tofClus.Digits2RecPoints(rawReader, clustersTree);
121a60bd 80
81}
82
83//_____________________________________________________________________________
84AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
85{
86// create a TOF tracker
87
88 AliTOFGeometry* geom = GetTOFGeometry(runLoader);
89 if (!geom) return NULL;
90 Double_t parPID[] = {130., 5.};
91 return new AliTOFtracker(geom, parPID);
92}
93
94//_____________________________________________________________________________
95void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/,
96 AliESD* /*esd*/) const
97{
98// nothing to be done
99
100}
101
121a60bd 102//_____________________________________________________________________________
103AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
104{
105// get the TOF parameters
106
d076c8d5 107 runLoader->CdGAFile();
108 AliTOFGeometry* tofGeom = (AliTOFGeometry*) gFile->Get("TOFGeometry");
109 if (!tofGeom) {
110 AliError("no TOF geometry available");
121a60bd 111 return NULL;
112 }
d076c8d5 113 return tofGeom;
121a60bd 114}