]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFReconstructor.cxx
adding tracking-to-local matrices for new AliTOFcluster
[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 #include "TFile.h"
25
26 #include "AliLog.h"
27 #include "AliRawReader.h"
28
29 #include "AliTOFClusterFinder.h"
30 #include "AliTOFGeometry.h"
31 #include "AliTOFGeometryV5.h"
32 #include "AliTOFcalib.h"
33 #include "AliTOFtrackerMI.h"
34 #include "AliTOFtracker.h"
35 #include "AliTOFReconstructor.h"
36
37 class TTree;
38
39 class AliESDEvent;
40
41 extern TDirectory *gDirectory;
42 extern TFile *gFile;
43
44 ClassImp(AliTOFReconstructor)
45
46  //____________________________________________________________________
47 AliTOFReconstructor::AliTOFReconstructor() 
48   : AliReconstructor(),
49     fTOFGeometry(0),
50     fTOFcalib(0)
51 {
52 //
53 // ctor
54 //
55   //Retrieving the TOF calibration info  
56   fTOFGeometry = new AliTOFGeometryV5();
57   fTOFcalib    = new AliTOFcalib(fTOFGeometry);
58   if(!fTOFcalib->ReadParFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
59 }
60
61 //------------------------------------------------------------------------
62 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
63   : AliReconstructor(),
64     fTOFGeometry(0),
65     fTOFcalib(0)
66 {
67 //
68 // copy ctor
69 //
70   this->fTOFGeometry=source.fTOFGeometry;
71   this->fTOFcalib=source.fTOFcalib;
72 }
73
74 //------------------------------------------------------------------------
75 AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
76 {
77 //
78 // assignment op.
79 //
80   this->fTOFGeometry=source.fTOFGeometry;
81   this->fTOFcalib=source.fTOFcalib;
82   return *this;
83 }
84 //_____________________________________________________________________________
85 AliTOFReconstructor::~AliTOFReconstructor() 
86 {
87 //
88 // dtor
89 //
90   delete fTOFGeometry;
91   delete fTOFcalib;
92 }
93
94 //_____________________________________________________________________________
95 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
96                                       TTree *clustersTree) const
97 {
98 // reconstruct clusters from Raw Data
99
100   AliTOFClusterFinder tofClus(fTOFcalib);
101   tofClus.Digits2RecPoints(rawReader, clustersTree);
102
103 }
104
105 //_____________________________________________________________________________
106 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
107                                       TTree *clustersTree) const
108 {
109 // reconstruct clusters from Raw Data
110
111   AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); 
112   AliTOFClusterFinder tofClus(fTOFcalib);
113   tofClus.Digits2RecPoints(digitsTree, clustersTree);
114
115 }
116 //_____________________________________________________________________________
117   void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
118 {
119 // reconstruct clusters from digits
120
121   AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); 
122   AliTOFClusterFinder tofClus(fTOFcalib);
123   tofClus.Raw2Digits(reader, digitsTree);
124
125 }
126
127 //_____________________________________________________________________________
128 AliTracker* AliTOFReconstructor::CreateTracker() const
129 {
130 // create a TOF tracker
131
132   TString selectedTracker = GetOption();
133   // use MI tracker if selected
134   if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI();
135   return new AliTOFtracker();
136 }
137
138 //_____________________________________________________________________________
139 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry() const
140 {
141   // get the TOF geometry
142   return fTOFGeometry;
143 }