]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFReconstructor.cxx
AliTOFRecoParam instantiation: moved in the TOF tracker(s) (Chiara)
[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);}
a98acac1 62}
63
64//------------------------------------------------------------------------
65AliTOFReconstructor::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//------------------------------------------------------------------------
76AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
77{
78//
79// assignment op.
80//
a98acac1 81 this->fTOFcalib=source.fTOFcalib;
82 return *this;
83}
84//_____________________________________________________________________________
85AliTOFReconstructor::~AliTOFReconstructor()
86{
87//
88// dtor
89//
a98acac1 90 delete fTOFcalib;
91}
92
d08a92dd 93//_____________________________________________________________________________
94void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
95 TTree *clustersTree) const
96{
e3bd5504 97 //
98 // reconstruct clusters from Raw Data
99 //
100
101 TString selectedClusterFinder = GetOption();
102 // use V1 cluster finder if selected
103 if (selectedClusterFinder.Contains("NCF")) {
104 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
105 tofClus.Digits2RecPoints(rawReader, clustersTree);
106 }
107 else {
108 static AliTOFClusterFinder tofClus(fTOFcalib);
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
124 TString selectedClusterFinder = GetOption();
125 // use V1 cluster finder if selected
126 if (selectedClusterFinder.Contains("NCF")) {
127 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
128 tofClus.Digits2RecPoints(digitsTree, clustersTree);
129 }
130 else {
131 static AliTOFClusterFinder tofClus(fTOFcalib);
132 tofClus.Digits2RecPoints(digitsTree, clustersTree);
133 }
a98acac1 134
135}
136//_____________________________________________________________________________
137 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
138{
139// reconstruct clusters from digits
140
141 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
e3bd5504 142
143 TString selectedClusterFinder = GetOption();
144 // use V1 cluster finder if selected
145 if (selectedClusterFinder.Contains("NCF")) {
146 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
147 tofClus.Raw2Digits(reader, digitsTree);
148 }
149 else {
150 static AliTOFClusterFinder tofClus(fTOFcalib);
151 tofClus.Raw2Digits(reader, digitsTree);
152 }
a98acac1 153
154}
155
121a60bd 156//_____________________________________________________________________________
d76c31f4 157AliTracker* AliTOFReconstructor::CreateTracker() const
121a60bd 158{
3a646035 159
160 //
161 // create a TOF tracker using
162 // TOF Reco Param collected by STEER
163 //
121a60bd 164
d88fbf15 165 TString selectedTracker = GetOption();
3a646035 166
167 AliTracker *tracker;
d88fbf15 168 // use MI tracker if selected
3a646035 169 if (selectedTracker.Contains("MI")) {
170 tracker = new AliTOFtrackerMI();
171 }
172 // use V1 tracker if selected
173 if (selectedTracker.Contains("V1")) {
174 tracker = new AliTOFtrackerV1();
175 }
176 else {
177 tracker = new AliTOFtracker();
178 }
179 return tracker;
121a60bd 180
e3bd5504 181}