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