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);}
67 if(!fTOFcalib->ReadRunParamsFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}
70 //_____________________________________________________________________________
71 AliTOFReconstructor::~AliTOFReconstructor()
79 //_____________________________________________________________________________
80 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
81 TTree *clustersTree) const
84 // reconstruct clusters from Raw Data
87 TString optionString = GetOption();
88 // use V1 cluster finder if selected
89 if (optionString.Contains("ClusterizerV1")) {
90 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
92 // decoder version option
93 if (optionString.Contains("DecoderV0"))
94 tofClus.SetDecoderVersion(0);
96 tofClus.SetDecoderVersion(1);
98 tofClus.Digits2RecPoints(rawReader, clustersTree);
101 static AliTOFClusterFinder tofClus(fTOFcalib);
103 // decoder version option
104 if (optionString.Contains("DecoderV0"))
105 tofClus.SetDecoderVersion(0);
107 tofClus.SetDecoderVersion(1);
109 tofClus.Digits2RecPoints(rawReader, clustersTree);
114 //_____________________________________________________________________________
115 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
116 TTree *clustersTree) const
119 // reconstruct clusters from digits
122 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
124 TString optionString = GetOption();
125 // use V1 cluster finder if selected
126 if (optionString.Contains("ClusterizerV1")) {
127 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
129 // decoder version option
130 if (optionString.Contains("DecoderV0"))
131 tofClus.SetDecoderVersion(0);
133 tofClus.SetDecoderVersion(1);
135 tofClus.Digits2RecPoints(digitsTree, clustersTree);
138 static AliTOFClusterFinder tofClus(fTOFcalib);
140 // decoder version option
141 if (optionString.Contains("DecoderV0"))
142 tofClus.SetDecoderVersion(0);
144 tofClus.SetDecoderVersion(1);
146 tofClus.Digits2RecPoints(digitsTree, clustersTree);
150 //_____________________________________________________________________________
151 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
153 // reconstruct clusters from digits
155 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
157 TString optionString = GetOption();
158 // use V1 cluster finder if selected
159 if (optionString.Contains("ClusterizerV1")) {
160 static AliTOFClusterFinderV1 tofClus(fTOFcalib);
162 // decoder version option
163 if (optionString.Contains("DecoderV0"))
164 tofClus.SetDecoderVersion(0);
166 tofClus.SetDecoderVersion(1);
168 tofClus.Raw2Digits(reader, digitsTree);
171 static AliTOFClusterFinder tofClus(fTOFcalib);
173 // decoder version option
174 if (optionString.Contains("DecoderV0"))
175 tofClus.SetDecoderVersion(0);
177 tofClus.SetDecoderVersion(1);
179 tofClus.Raw2Digits(reader, digitsTree);
184 //_____________________________________________________________________________
185 AliTracker* AliTOFReconstructor::CreateTracker() const
189 // create a TOF tracker using
190 // TOF Reco Param collected by STEER
193 TString selectedTracker = GetOption();
196 // use MI tracker if selected
197 if (selectedTracker.Contains("TrackerMI")) {
198 tracker = new AliTOFtrackerMI();
200 // use V1 tracker if selected
201 else if (selectedTracker.Contains("TrackerV1")) {
202 tracker = new AliTOFtrackerV1();
205 tracker = new AliTOFtracker();