]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFReconstructor.cxx
Adding a possibility to supress error messages in GetDESegmentation()
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.cxx
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
25 #include <TFile.h>
26
27 #include "AliLog.h"
28 #include "AliRun.h"
29 #include "AliRunLoader.h"
30
31 #include "AliTOFtracker.h"
32 #include "AliTOFtrackerMI.h"
33 #include "AliTOFClusterFinder.h"
34 #include "AliTOFReconstructor.h"
35
36
37 ClassImp(AliTOFReconstructor)
38
39
40 //_____________________________________________________________________________
41   void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const
42 {
43 // reconstruct clusters from digits
44
45   AliTOFClusterFinder *tofClus = new AliTOFClusterFinder(runLoader);
46   tofClus->Load();
47   for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
48     {
49       tofClus->Digits2RecPoints(iEvent);
50     }
51   tofClus->UnLoad();
52
53 }
54
55 //_____________________________________________________________________________
56 void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader,
57                                       AliRawReader *rawReader) const
58 {
59 // reconstruct clusters from Raw Data
60
61   AliTOFClusterFinder tofClus(runLoader);
62   tofClus.LoadClusters();
63   Int_t iEvent = 0;
64   while (rawReader->NextEvent()) {
65     tofClus.Digits2RecPoints(iEvent,rawReader);
66     //tofClus.Raw2Digits(iEvent,rawReader); // temporary solution
67     iEvent++;
68   }
69   tofClus.UnLoadClusters();
70
71 }
72
73 //_____________________________________________________________________________
74 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
75                                       TTree *clustersTree) const
76 {
77 // reconstruct clusters from Raw Data
78
79   AliTOFClusterFinder tofClus;
80   tofClus.Digits2RecPoints(rawReader, clustersTree);
81
82 }
83
84 //_____________________________________________________________________________
85 AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
86 {
87 // create a TOF tracker
88
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);
95
96   return new AliTOFtracker(geom, parPID);
97 }
98
99 //_____________________________________________________________________________
100 void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/, 
101                                   AliESD* /*esd*/) const
102 {
103 // nothing to be done
104
105 }
106
107 //_____________________________________________________________________________
108 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
109 {
110 // get the TOF parameters
111
112   runLoader->CdGAFile();
113   AliTOFGeometry* tofGeom = (AliTOFGeometry*) gFile->Get("TOFGeometry"); 
114   if (!tofGeom) {
115     AliError("no TOF geometry available");
116     return NULL;
117   }
118   return tofGeom;
119 }