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();
59 fTOFcalib->CreateCalObjects();
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);}
64 if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}
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);}
70 if(!fTOFcalib->ReadRunParamsFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}
75 //_____________________________________________________________________________
76 AliTOFReconstructor::~AliTOFReconstructor()
84 //_____________________________________________________________________________
85 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
86 TTree *clustersTree) const
89 // reconstruct clusters from Raw Data
92 TString optionString = GetOption();
94 // use V1 cluster finder if selected
95 if (optionString.Contains("ClusterizerV1")) {
96 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
98 // decoder version option
99 if (optionString.Contains("DecoderV0")) {
100 tofClus.SetDecoderVersion(0);
102 else if (optionString.Contains("DecoderV1")) {
103 tofClus.SetDecoderVersion(1);
106 tofClus.SetDecoderVersion(2);
109 tofClus.Digits2RecPoints(rawReader, clustersTree);
112 static AliTOFClusterFinder tofClus(fTOFcalib);
114 // decoder version option
115 if (optionString.Contains("DecoderV0")) {
116 tofClus.SetDecoderVersion(0);
118 else if (optionString.Contains("DecoderV1")) {
119 tofClus.SetDecoderVersion(1);
122 tofClus.SetDecoderVersion(2);
125 tofClus.Digits2RecPoints(rawReader, clustersTree);
130 //_____________________________________________________________________________
131 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
132 TTree *clustersTree) const
135 // reconstruct clusters from digits
138 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
140 TString optionString = GetOption();
141 // use V1 cluster finder if selected
142 if (optionString.Contains("ClusterizerV1")) {
143 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
145 // decoder version option
146 if (optionString.Contains("DecoderV0")) {
147 tofClus.SetDecoderVersion(0);
149 else if (optionString.Contains("DecoderV1")) {
150 tofClus.SetDecoderVersion(1);
153 tofClus.SetDecoderVersion(2);
156 tofClus.Digits2RecPoints(digitsTree, clustersTree);
159 static AliTOFClusterFinder tofClus(fTOFcalib);
161 // decoder version option
162 if (optionString.Contains("DecoderV0")) {
163 tofClus.SetDecoderVersion(0);
165 else if (optionString.Contains("DecoderV1")) {
166 tofClus.SetDecoderVersion(1);
169 tofClus.SetDecoderVersion(2);
172 tofClus.Digits2RecPoints(digitsTree, clustersTree);
176 //_____________________________________________________________________________
177 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
179 // reconstruct clusters from digits
181 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
183 TString optionString = GetOption();
184 // use V1 cluster finder if selected
185 if (optionString.Contains("ClusterizerV1")) {
186 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
188 // decoder version option
189 if (optionString.Contains("DecoderV0")) {
190 tofClus.SetDecoderVersion(0);
192 else if (optionString.Contains("DecoderV1")) {
193 tofClus.SetDecoderVersion(1);
196 tofClus.SetDecoderVersion(2);
199 tofClus.Raw2Digits(reader, digitsTree);
202 static AliTOFClusterFinder tofClus(fTOFcalib);
204 // decoder version option
205 if (optionString.Contains("DecoderV0")) {
206 tofClus.SetDecoderVersion(0);
208 else if (optionString.Contains("DecoderV1")) {
209 tofClus.SetDecoderVersion(1);
212 tofClus.SetDecoderVersion(2);
215 tofClus.Raw2Digits(reader, digitsTree);
220 //_____________________________________________________________________________
221 AliTracker* AliTOFReconstructor::CreateTracker() const
225 // create a TOF tracker using
226 // TOF Reco Param collected by STEER
229 TString selectedTracker = GetOption();
232 // use MI tracker if selected
233 if (selectedTracker.Contains("TrackerMI")) {
234 tracker = new AliTOFtrackerMI();
236 // use V1 tracker if selected
237 else if (selectedTracker.Contains("TrackerV1")) {
238 tracker = new AliTOFtrackerV1();
241 tracker = new AliTOFtracker();