1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for TOF reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "TObjArray.h"
29 #include "AliRawReader.h"
31 #include "AliTOFClusterFinder.h"
32 #include "AliTOFClusterFinderV1.h"
33 #include "AliTOFcalib.h"
34 #include "AliTOFtrackerMI.h"
35 #include "AliTOFtracker.h"
36 #include "AliTOFtrackerV1.h"
37 #include "AliTOFReconstructor.h"
43 ClassImp(AliTOFReconstructor)
45 //____________________________________________________________________
46 AliTOFReconstructor::AliTOFReconstructor()
54 //Retrieving the TOF calibration info
55 fTOFcalib = new AliTOFcalib();
56 fTOFcalib->CreateCalObjects();
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);}
61 if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}
64 //------------------------------------------------------------------------
65 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
72 this->fTOFcalib=source.fTOFcalib;
75 //------------------------------------------------------------------------
76 AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
81 this->fTOFcalib=source.fTOFcalib;
84 //_____________________________________________________________________________
85 AliTOFReconstructor::~AliTOFReconstructor()
93 //_____________________________________________________________________________
94 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
95 TTree *clustersTree) const
98 // reconstruct clusters from Raw Data
101 TString optionString = GetOption();
102 // use V1 cluster finder if selected
103 if (optionString.Contains("ClusterizerV1")) {
104 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
106 // decoder version option
107 if (optionString.Contains("DecoderV1"))
108 tofClus.SetDecoderVersion(1);
110 tofClus.SetDecoderVersion(0);
112 tofClus.Digits2RecPoints(rawReader, clustersTree);
115 static AliTOFClusterFinder tofClus(fTOFcalib);
117 // decoder version option
118 if (optionString.Contains("DecoderV1"))
119 tofClus.SetDecoderVersion(1);
121 tofClus.SetDecoderVersion(0);
123 tofClus.Digits2RecPoints(rawReader, clustersTree);
128 //_____________________________________________________________________________
129 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
130 TTree *clustersTree) const
133 // reconstruct clusters from digits
136 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
138 TString optionString = GetOption();
139 // use V1 cluster finder if selected
140 if (optionString.Contains("ClusterizerV1")) {
141 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
143 // decoder version option
144 if (optionString.Contains("DecoderV1"))
145 tofClus.SetDecoderVersion(1);
147 tofClus.SetDecoderVersion(0);
149 tofClus.Digits2RecPoints(digitsTree, clustersTree);
152 static AliTOFClusterFinder tofClus(fTOFcalib);
154 // decoder version option
155 if (optionString.Contains("DecoderV1"))
156 tofClus.SetDecoderVersion(1);
158 tofClus.SetDecoderVersion(0);
160 tofClus.Digits2RecPoints(digitsTree, clustersTree);
164 //_____________________________________________________________________________
165 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
167 // reconstruct clusters from digits
169 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
171 TString optionString = GetOption();
172 // use V1 cluster finder if selected
173 if (optionString.Contains("ClusterizerV1")) {
174 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
176 // decoder version option
177 if (optionString.Contains("DecoderV1"))
178 tofClus.SetDecoderVersion(1);
180 tofClus.SetDecoderVersion(0);
182 tofClus.Raw2Digits(reader, digitsTree);
185 static AliTOFClusterFinder tofClus(fTOFcalib);
187 // decoder version option
188 if (optionString.Contains("DecoderV1"))
189 tofClus.SetDecoderVersion(1);
191 tofClus.SetDecoderVersion(0);
193 tofClus.Raw2Digits(reader, digitsTree);
198 //_____________________________________________________________________________
199 AliTracker* AliTOFReconstructor::CreateTracker() const
203 // create a TOF tracker using
204 // TOF Reco Param collected by STEER
207 TString selectedTracker = GetOption();
210 // use MI tracker if selected
211 if (selectedTracker.Contains("TrackerMI")) {
212 tracker = new AliTOFtrackerMI();
214 // use V1 tracker if selected
215 if (selectedTracker.Contains("TrackerV1")) {
216 tracker = new AliTOFtrackerV1();
219 tracker = new AliTOFtracker();