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 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);}
69 //_____________________________________________________________________________
70 AliTOFReconstructor::~AliTOFReconstructor()
78 //_____________________________________________________________________________
79 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
80 TTree *clustersTree) const
83 // reconstruct clusters from Raw Data
86 TString optionString = GetOption();
87 // use V1 cluster finder if selected
88 if (optionString.Contains("ClusterizerV1")) {
89 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
91 // decoder version option
92 if (optionString.Contains("DecoderV0"))
93 tofClus.SetDecoderVersion(0);
95 tofClus.SetDecoderVersion(1);
97 tofClus.Digits2RecPoints(rawReader, clustersTree);
100 static AliTOFClusterFinder tofClus(fTOFcalib);
102 // decoder version option
103 if (optionString.Contains("DecoderV0"))
104 tofClus.SetDecoderVersion(0);
106 tofClus.SetDecoderVersion(1);
108 tofClus.Digits2RecPoints(rawReader, clustersTree);
113 //_____________________________________________________________________________
114 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
115 TTree *clustersTree) const
118 // reconstruct clusters from digits
121 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
123 TString optionString = GetOption();
124 // use V1 cluster finder if selected
125 if (optionString.Contains("ClusterizerV1")) {
126 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
128 // decoder version option
129 if (optionString.Contains("DecoderV0"))
130 tofClus.SetDecoderVersion(0);
132 tofClus.SetDecoderVersion(1);
134 tofClus.Digits2RecPoints(digitsTree, clustersTree);
137 static AliTOFClusterFinder tofClus(fTOFcalib);
139 // decoder version option
140 if (optionString.Contains("DecoderV0"))
141 tofClus.SetDecoderVersion(0);
143 tofClus.SetDecoderVersion(1);
145 tofClus.Digits2RecPoints(digitsTree, clustersTree);
149 //_____________________________________________________________________________
150 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
152 // reconstruct clusters from digits
154 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
156 TString optionString = GetOption();
157 // use V1 cluster finder if selected
158 if (optionString.Contains("ClusterizerV1")) {
159 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
161 // decoder version option
162 if (optionString.Contains("DecoderV0"))
163 tofClus.SetDecoderVersion(0);
165 tofClus.SetDecoderVersion(1);
167 tofClus.Raw2Digits(reader, digitsTree);
170 static AliTOFClusterFinder tofClus(fTOFcalib);
172 // decoder version option
173 if (optionString.Contains("DecoderV0"))
174 tofClus.SetDecoderVersion(0);
176 tofClus.SetDecoderVersion(1);
178 tofClus.Raw2Digits(reader, digitsTree);
183 //_____________________________________________________________________________
184 AliTracker* AliTOFReconstructor::CreateTracker() const
188 // create a TOF tracker using
189 // TOF Reco Param collected by STEER
192 TString selectedTracker = GetOption();
195 // use MI tracker if selected
196 if (selectedTracker.Contains("TrackerMI")) {
197 tracker = new AliTOFtrackerMI();
199 // use V1 tracker if selected
200 else if (selectedTracker.Contains("TrackerV1")) {
201 tracker = new AliTOFtrackerV1();
204 tracker = new AliTOFtracker();