]>
Commit | Line | Data |
---|---|---|
121a60bd | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // class for TOF reconstruction // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
b09247a2 | 24 | #include <cstdlib> |
5c7c93fa | 25 | //#include "TFile.h" |
6b025efd | 26 | #include "TObjArray.h" |
27 | #include "TString.h" | |
d08a92dd | 28 | |
29 | #include "AliLog.h" | |
0e46b9ae | 30 | #include "AliRawReader.h" |
d08a92dd | 31 | |
0e46b9ae | 32 | #include "AliTOFClusterFinder.h" |
a98acac1 | 33 | #include "AliTOFcalib.h" |
d88fbf15 | 34 | #include "AliTOFtrackerMI.h" |
0e46b9ae | 35 | #include "AliTOFtracker.h" |
eeef0c5d | 36 | #include "AliTOFtrackerV1.h" |
d08a92dd | 37 | #include "AliTOFReconstructor.h" |
121a60bd | 38 | |
0e46b9ae | 39 | class TTree; |
5c7c93fa | 40 | //class TFile; |
41 | //class TDirectory; | |
0e46b9ae | 42 | |
af885e0f | 43 | class AliESDEvent; |
0e46b9ae | 44 | |
5c7c93fa | 45 | //extern TDirectory *gDirectory; |
46 | //extern TFile *gFile; | |
0e46b9ae | 47 | |
121a60bd | 48 | ClassImp(AliTOFReconstructor) |
49 | ||
a98acac1 | 50 | //____________________________________________________________________ |
51 | AliTOFReconstructor::AliTOFReconstructor() | |
52 | : AliReconstructor(), | |
a98acac1 | 53 | fTOFcalib(0) |
54 | { | |
55 | // | |
56 | // ctor | |
57 | // | |
6b025efd | 58 | |
a98acac1 | 59 | //Retrieving the TOF calibration info |
ba66add8 | 60 | fTOFcalib = new AliTOFcalib(); |
61 | fTOFcalib->CreateCalArrays(); | |
62 | if(!fTOFcalib->ReadParOnlineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
63 | if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
a98acac1 | 64 | } |
65 | ||
66 | //------------------------------------------------------------------------ | |
67 | AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source) | |
68 | : AliReconstructor(), | |
a98acac1 | 69 | fTOFcalib(0) |
70 | { | |
71 | // | |
72 | // copy ctor | |
73 | // | |
a98acac1 | 74 | this->fTOFcalib=source.fTOFcalib; |
75 | } | |
76 | ||
77 | //------------------------------------------------------------------------ | |
78 | AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source) | |
79 | { | |
80 | // | |
81 | // assignment op. | |
82 | // | |
a98acac1 | 83 | this->fTOFcalib=source.fTOFcalib; |
84 | return *this; | |
85 | } | |
86 | //_____________________________________________________________________________ | |
87 | AliTOFReconstructor::~AliTOFReconstructor() | |
88 | { | |
89 | // | |
90 | // dtor | |
91 | // | |
a98acac1 | 92 | delete fTOFcalib; |
93 | } | |
94 | ||
d08a92dd | 95 | //_____________________________________________________________________________ |
96 | void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, | |
97 | TTree *clustersTree) const | |
98 | { | |
99 | // reconstruct clusters from Raw Data | |
100 | ||
b24266ca | 101 | static AliTOFClusterFinder tofClus(fTOFcalib); |
d08a92dd | 102 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
121a60bd | 103 | |
104 | } | |
105 | ||
a98acac1 | 106 | //_____________________________________________________________________________ |
107 | void AliTOFReconstructor::Reconstruct(TTree *digitsTree, | |
108 | TTree *clustersTree) const | |
109 | { | |
110 | // reconstruct clusters from Raw Data | |
111 | ||
112 | AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); | |
b24266ca | 113 | static AliTOFClusterFinder tofClus(fTOFcalib); |
a98acac1 | 114 | tofClus.Digits2RecPoints(digitsTree, clustersTree); |
115 | ||
116 | } | |
117 | //_____________________________________________________________________________ | |
118 | void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const | |
119 | { | |
120 | // reconstruct clusters from digits | |
121 | ||
122 | AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); | |
123 | AliTOFClusterFinder tofClus(fTOFcalib); | |
124 | tofClus.Raw2Digits(reader, digitsTree); | |
125 | ||
126 | } | |
127 | ||
121a60bd | 128 | //_____________________________________________________________________________ |
d76c31f4 | 129 | AliTracker* AliTOFReconstructor::CreateTracker() const |
121a60bd | 130 | { |
131 | // create a TOF tracker | |
132 | ||
d88fbf15 | 133 | TString selectedTracker = GetOption(); |
134 | // use MI tracker if selected | |
bc9f08da | 135 | if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(); |
eeef0c5d | 136 | if (selectedTracker.Contains("V1")) return new AliTOFtrackerV1(); |
bc9f08da | 137 | return new AliTOFtracker(); |
121a60bd | 138 | } |
139 |