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