]>
Commit | Line | Data |
---|---|---|
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 | ||
b09247a2 | 24 | #include <cstdlib> |
6b025efd | 25 | #include "TObjArray.h" |
26 | #include "TString.h" | |
d08a92dd | 27 | |
28 | #include "AliLog.h" | |
0e46b9ae | 29 | #include "AliRawReader.h" |
d08a92dd | 30 | |
0e46b9ae | 31 | #include "AliTOFClusterFinder.h" |
e3bd5504 | 32 | #include "AliTOFClusterFinderV1.h" |
a98acac1 | 33 | #include "AliTOFcalib.h" |
d88fbf15 | 34 | #include "AliTOFtrackerMI.h" |
0e46b9ae | 35 | #include "AliTOFtracker.h" |
eeef0c5d | 36 | #include "AliTOFtrackerV1.h" |
d08a92dd | 37 | #include "AliTOFReconstructor.h" |
121a60bd | 38 | |
0e46b9ae | 39 | class TTree; |
40 | ||
af885e0f | 41 | class AliESDEvent; |
0e46b9ae | 42 | |
121a60bd | 43 | ClassImp(AliTOFReconstructor) |
44 | ||
a98acac1 | 45 | //____________________________________________________________________ |
46 | AliTOFReconstructor::AliTOFReconstructor() | |
47 | : AliReconstructor(), | |
a98acac1 | 48 | fTOFcalib(0) |
49 | { | |
50 | // | |
51 | // ctor | |
52 | // | |
6b025efd | 53 | |
a98acac1 | 54 | //Retrieving the TOF calibration info |
ba66add8 | 55 | fTOFcalib = new AliTOFcalib(); |
24d1e16e | 56 | fTOFcalib->CreateCalObjects(); |
17149e6b | 57 | |
58 | if(!fTOFcalib->ReadParOnlineDelayFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
59 | if(!fTOFcalib->ReadParOnlineStatusFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
60 | ||
ba66add8 | 61 | if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} |
a98acac1 | 62 | } |
63 | ||
64 | //------------------------------------------------------------------------ | |
65 | AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source) | |
66 | : AliReconstructor(), | |
a98acac1 | 67 | fTOFcalib(0) |
68 | { | |
69 | // | |
70 | // copy ctor | |
71 | // | |
a98acac1 | 72 | this->fTOFcalib=source.fTOFcalib; |
73 | } | |
74 | ||
75 | //------------------------------------------------------------------------ | |
76 | AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source) | |
77 | { | |
78 | // | |
79 | // assignment op. | |
80 | // | |
a98acac1 | 81 | this->fTOFcalib=source.fTOFcalib; |
82 | return *this; | |
83 | } | |
84 | //_____________________________________________________________________________ | |
85 | AliTOFReconstructor::~AliTOFReconstructor() | |
86 | { | |
87 | // | |
88 | // dtor | |
89 | // | |
a98acac1 | 90 | delete fTOFcalib; |
91 | } | |
92 | ||
d08a92dd | 93 | //_____________________________________________________________________________ |
94 | void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, | |
95 | TTree *clustersTree) const | |
96 | { | |
e3bd5504 | 97 | // |
98 | // reconstruct clusters from Raw Data | |
99 | // | |
100 | ||
17bb1d52 | 101 | TString optionString = GetOption(); |
e3bd5504 | 102 | // use V1 cluster finder if selected |
17bb1d52 | 103 | if (optionString.Contains("ClusterizerV1")) { |
e3bd5504 | 104 | static AliTOFClusterFinderV1 tofClus(fTOFcalib); |
17bb1d52 | 105 | |
106 | // decoder version option | |
107 | if (optionString.Contains("DecoderV1")) | |
108 | tofClus.SetDecoderVersion(1); | |
109 | else | |
110 | tofClus.SetDecoderVersion(0); | |
111 | ||
e3bd5504 | 112 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
113 | } | |
114 | else { | |
115 | static AliTOFClusterFinder tofClus(fTOFcalib); | |
17bb1d52 | 116 | |
117 | // decoder version option | |
118 | if (optionString.Contains("DecoderV1")) | |
119 | tofClus.SetDecoderVersion(1); | |
120 | else | |
121 | tofClus.SetDecoderVersion(0); | |
122 | ||
e3bd5504 | 123 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
124 | } | |
121a60bd | 125 | |
126 | } | |
127 | ||
a98acac1 | 128 | //_____________________________________________________________________________ |
129 | void AliTOFReconstructor::Reconstruct(TTree *digitsTree, | |
130 | TTree *clustersTree) const | |
131 | { | |
e3bd5504 | 132 | // |
133 | // reconstruct clusters from digits | |
134 | // | |
a98acac1 | 135 | |
136 | AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); | |
e3bd5504 | 137 | |
17bb1d52 | 138 | TString optionString = GetOption(); |
e3bd5504 | 139 | // use V1 cluster finder if selected |
17bb1d52 | 140 | if (optionString.Contains("ClusterizerV1")) { |
e3bd5504 | 141 | static AliTOFClusterFinderV1 tofClus(fTOFcalib); |
17bb1d52 | 142 | |
143 | // decoder version option | |
144 | if (optionString.Contains("DecoderV1")) | |
145 | tofClus.SetDecoderVersion(1); | |
146 | else | |
147 | tofClus.SetDecoderVersion(0); | |
148 | ||
e3bd5504 | 149 | tofClus.Digits2RecPoints(digitsTree, clustersTree); |
150 | } | |
151 | else { | |
152 | static AliTOFClusterFinder tofClus(fTOFcalib); | |
17bb1d52 | 153 | |
154 | // decoder version option | |
155 | if (optionString.Contains("DecoderV1")) | |
156 | tofClus.SetDecoderVersion(1); | |
157 | else | |
158 | tofClus.SetDecoderVersion(0); | |
159 | ||
e3bd5504 | 160 | tofClus.Digits2RecPoints(digitsTree, clustersTree); |
161 | } | |
a98acac1 | 162 | |
163 | } | |
164 | //_____________________________________________________________________________ | |
165 | void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const | |
166 | { | |
167 | // reconstruct clusters from digits | |
168 | ||
169 | AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); | |
e3bd5504 | 170 | |
17bb1d52 | 171 | TString optionString = GetOption(); |
e3bd5504 | 172 | // use V1 cluster finder if selected |
17bb1d52 | 173 | if (optionString.Contains("ClusterizerV1")) { |
e3bd5504 | 174 | static AliTOFClusterFinderV1 tofClus(fTOFcalib); |
17bb1d52 | 175 | |
176 | // decoder version option | |
177 | if (optionString.Contains("DecoderV1")) | |
178 | tofClus.SetDecoderVersion(1); | |
179 | else | |
180 | tofClus.SetDecoderVersion(0); | |
181 | ||
e3bd5504 | 182 | tofClus.Raw2Digits(reader, digitsTree); |
183 | } | |
184 | else { | |
185 | static AliTOFClusterFinder tofClus(fTOFcalib); | |
17bb1d52 | 186 | |
187 | // decoder version option | |
188 | if (optionString.Contains("DecoderV1")) | |
189 | tofClus.SetDecoderVersion(1); | |
190 | else | |
191 | tofClus.SetDecoderVersion(0); | |
192 | ||
e3bd5504 | 193 | tofClus.Raw2Digits(reader, digitsTree); |
194 | } | |
a98acac1 | 195 | |
196 | } | |
197 | ||
121a60bd | 198 | //_____________________________________________________________________________ |
d76c31f4 | 199 | AliTracker* AliTOFReconstructor::CreateTracker() const |
121a60bd | 200 | { |
3a646035 | 201 | |
202 | // | |
203 | // create a TOF tracker using | |
204 | // TOF Reco Param collected by STEER | |
205 | // | |
121a60bd | 206 | |
d88fbf15 | 207 | TString selectedTracker = GetOption(); |
3a646035 | 208 | |
209 | AliTracker *tracker; | |
d88fbf15 | 210 | // use MI tracker if selected |
17bb1d52 | 211 | if (selectedTracker.Contains("TrackerMI")) { |
3a646035 | 212 | tracker = new AliTOFtrackerMI(); |
213 | } | |
214 | // use V1 tracker if selected | |
17bb1d52 | 215 | if (selectedTracker.Contains("TrackerV1")) { |
3a646035 | 216 | tracker = new AliTOFtrackerV1(); |
217 | } | |
218 | else { | |
219 | tracker = new AliTOFtracker(); | |
220 | } | |
221 | return tracker; | |
121a60bd | 222 | |
e3bd5504 | 223 | } |