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()
73 //_____________________________________________________________________________
74 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
75 TTree *clustersTree) const
78 // reconstruct clusters from Raw Data
81 TString optionString = GetOption();
82 // use V1 cluster finder if selected
83 if (optionString.Contains("ClusterizerV1")) {
84 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
86 // decoder version option
87 if (optionString.Contains("DecoderV0"))
88 tofClus.SetDecoderVersion(0);
90 tofClus.SetDecoderVersion(1);
92 tofClus.Digits2RecPoints(rawReader, clustersTree);
95 static AliTOFClusterFinder tofClus(fTOFcalib);
97 // decoder version option
98 if (optionString.Contains("DecoderV0"))
99 tofClus.SetDecoderVersion(0);
101 tofClus.SetDecoderVersion(1);
103 tofClus.Digits2RecPoints(rawReader, clustersTree);
108 //_____________________________________________________________________________
109 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
110 TTree *clustersTree) const
113 // reconstruct clusters from digits
116 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
118 TString optionString = GetOption();
119 // use V1 cluster finder if selected
120 if (optionString.Contains("ClusterizerV1")) {
121 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
123 // decoder version option
124 if (optionString.Contains("DecoderV0"))
125 tofClus.SetDecoderVersion(0);
127 tofClus.SetDecoderVersion(1);
129 tofClus.Digits2RecPoints(digitsTree, clustersTree);
132 static AliTOFClusterFinder tofClus(fTOFcalib);
134 // decoder version option
135 if (optionString.Contains("DecoderV0"))
136 tofClus.SetDecoderVersion(0);
138 tofClus.SetDecoderVersion(1);
140 tofClus.Digits2RecPoints(digitsTree, clustersTree);
144 //_____________________________________________________________________________
145 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
147 // reconstruct clusters from digits
149 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
151 TString optionString = GetOption();
152 // use V1 cluster finder if selected
153 if (optionString.Contains("ClusterizerV1")) {
154 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
156 // decoder version option
157 if (optionString.Contains("DecoderV0"))
158 tofClus.SetDecoderVersion(0);
160 tofClus.SetDecoderVersion(1);
162 tofClus.Raw2Digits(reader, digitsTree);
165 static AliTOFClusterFinder tofClus(fTOFcalib);
167 // decoder version option
168 if (optionString.Contains("DecoderV0"))
169 tofClus.SetDecoderVersion(0);
171 tofClus.SetDecoderVersion(1);
173 tofClus.Raw2Digits(reader, digitsTree);
178 //_____________________________________________________________________________
179 AliTracker* AliTOFReconstructor::CreateTracker() const
183 // create a TOF tracker using
184 // TOF Reco Param collected by STEER
187 TString selectedTracker = GetOption();
190 // use MI tracker if selected
191 if (selectedTracker.Contains("TrackerMI")) {
192 tracker = new AliTOFtrackerMI();
194 // use V1 tracker if selected
195 else if (selectedTracker.Contains("TrackerV1")) {
196 tracker = new AliTOFtrackerV1();
199 tracker = new AliTOFtracker();