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