]>
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 | ||
a98acac1 | 64 | //_____________________________________________________________________________ |
65 | AliTOFReconstructor::~AliTOFReconstructor() | |
66 | { | |
67 | // | |
68 | // dtor | |
69 | // | |
a98acac1 | 70 | delete fTOFcalib; |
71 | } | |
72 | ||
d08a92dd | 73 | //_____________________________________________________________________________ |
74 | void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, | |
75 | TTree *clustersTree) const | |
76 | { | |
e3bd5504 | 77 | // |
78 | // reconstruct clusters from Raw Data | |
79 | // | |
80 | ||
17bb1d52 | 81 | TString optionString = GetOption(); |
e3bd5504 | 82 | // use V1 cluster finder if selected |
17bb1d52 | 83 | if (optionString.Contains("ClusterizerV1")) { |
e3bd5504 | 84 | static AliTOFClusterFinderV1 tofClus(fTOFcalib); |
17bb1d52 | 85 | |
86 | // decoder version option | |
87 | if (optionString.Contains("DecoderV1")) | |
88 | tofClus.SetDecoderVersion(1); | |
89 | else | |
90 | tofClus.SetDecoderVersion(0); | |
91 | ||
e3bd5504 | 92 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
93 | } | |
94 | else { | |
95 | static AliTOFClusterFinder tofClus(fTOFcalib); | |
17bb1d52 | 96 | |
97 | // decoder version option | |
98 | if (optionString.Contains("DecoderV1")) | |
99 | tofClus.SetDecoderVersion(1); | |
100 | else | |
101 | tofClus.SetDecoderVersion(0); | |
102 | ||
e3bd5504 | 103 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
104 | } | |
121a60bd | 105 | |
106 | } | |
107 | ||
a98acac1 | 108 | //_____________________________________________________________________________ |
109 | void AliTOFReconstructor::Reconstruct(TTree *digitsTree, | |
110 | TTree *clustersTree) const | |
111 | { | |
e3bd5504 | 112 | // |
113 | // reconstruct clusters from digits | |
114 | // | |
a98acac1 | 115 | |
116 | AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); | |
e3bd5504 | 117 | |
17bb1d52 | 118 | TString optionString = GetOption(); |
e3bd5504 | 119 | // use V1 cluster finder if selected |
17bb1d52 | 120 | if (optionString.Contains("ClusterizerV1")) { |
e3bd5504 | 121 | static AliTOFClusterFinderV1 tofClus(fTOFcalib); |
17bb1d52 | 122 | |
123 | // decoder version option | |
124 | if (optionString.Contains("DecoderV1")) | |
125 | tofClus.SetDecoderVersion(1); | |
126 | else | |
127 | tofClus.SetDecoderVersion(0); | |
128 | ||
e3bd5504 | 129 | tofClus.Digits2RecPoints(digitsTree, clustersTree); |
130 | } | |
131 | else { | |
132 | static AliTOFClusterFinder tofClus(fTOFcalib); | |
17bb1d52 | 133 | |
134 | // decoder version option | |
135 | if (optionString.Contains("DecoderV1")) | |
136 | tofClus.SetDecoderVersion(1); | |
137 | else | |
138 | tofClus.SetDecoderVersion(0); | |
139 | ||
e3bd5504 | 140 | tofClus.Digits2RecPoints(digitsTree, clustersTree); |
141 | } | |
a98acac1 | 142 | |
143 | } | |
144 | //_____________________________________________________________________________ | |
145 | void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const | |
146 | { | |
147 | // reconstruct clusters from digits | |
148 | ||
149 | AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); | |
e3bd5504 | 150 | |
17bb1d52 | 151 | TString optionString = GetOption(); |
e3bd5504 | 152 | // use V1 cluster finder if selected |
17bb1d52 | 153 | if (optionString.Contains("ClusterizerV1")) { |
e3bd5504 | 154 | static AliTOFClusterFinderV1 tofClus(fTOFcalib); |
17bb1d52 | 155 | |
156 | // decoder version option | |
157 | if (optionString.Contains("DecoderV1")) | |
158 | tofClus.SetDecoderVersion(1); | |
159 | else | |
160 | tofClus.SetDecoderVersion(0); | |
161 | ||
e3bd5504 | 162 | tofClus.Raw2Digits(reader, digitsTree); |
163 | } | |
164 | else { | |
165 | static AliTOFClusterFinder tofClus(fTOFcalib); | |
17bb1d52 | 166 | |
167 | // decoder version option | |
168 | if (optionString.Contains("DecoderV1")) | |
169 | tofClus.SetDecoderVersion(1); | |
170 | else | |
171 | tofClus.SetDecoderVersion(0); | |
172 | ||
e3bd5504 | 173 | tofClus.Raw2Digits(reader, digitsTree); |
174 | } | |
a98acac1 | 175 | |
176 | } | |
177 | ||
121a60bd | 178 | //_____________________________________________________________________________ |
d76c31f4 | 179 | AliTracker* AliTOFReconstructor::CreateTracker() const |
121a60bd | 180 | { |
3a646035 | 181 | |
182 | // | |
183 | // create a TOF tracker using | |
184 | // TOF Reco Param collected by STEER | |
185 | // | |
121a60bd | 186 | |
d88fbf15 | 187 | TString selectedTracker = GetOption(); |
3a646035 | 188 | |
189 | AliTracker *tracker; | |
d88fbf15 | 190 | // use MI tracker if selected |
17bb1d52 | 191 | if (selectedTracker.Contains("TrackerMI")) { |
3a646035 | 192 | tracker = new AliTOFtrackerMI(); |
193 | } | |
194 | // use V1 tracker if selected | |
a572506f | 195 | else if (selectedTracker.Contains("TrackerV1")) { |
3a646035 | 196 | tracker = new AliTOFtrackerV1(); |
197 | } | |
198 | else { | |
199 | tracker = new AliTOFtracker(); | |
200 | } | |
201 | return tracker; | |
121a60bd | 202 | |
e3bd5504 | 203 | } |