]>
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 | ||
0e46b9ae | 24 | #include "TFile.h" |
d08a92dd | 25 | |
26 | #include "AliLog.h" | |
0e46b9ae | 27 | #include "AliRawReader.h" |
d08a92dd | 28 | |
0e46b9ae | 29 | #include "AliTOFClusterFinder.h" |
d3c7bfac | 30 | #include "AliTOFGeometry.h" |
0f49d1bc | 31 | #include "AliTOFGeometryV5.h" |
a98acac1 | 32 | #include "AliTOFcalib.h" |
d88fbf15 | 33 | #include "AliTOFtrackerMI.h" |
0e46b9ae | 34 | #include "AliTOFtracker.h" |
d08a92dd | 35 | #include "AliTOFReconstructor.h" |
121a60bd | 36 | |
0e46b9ae | 37 | class TTree; |
38 | ||
af885e0f | 39 | class AliESDEvent; |
0e46b9ae | 40 | |
41 | extern TDirectory *gDirectory; | |
42 | extern TFile *gFile; | |
43 | ||
121a60bd | 44 | ClassImp(AliTOFReconstructor) |
45 | ||
a98acac1 | 46 | //____________________________________________________________________ |
47 | AliTOFReconstructor::AliTOFReconstructor() | |
48 | : AliReconstructor(), | |
49 | fTOFGeometry(0), | |
50 | fTOFcalib(0) | |
51 | { | |
52 | // | |
53 | // ctor | |
54 | // | |
55 | //Retrieving the TOF calibration info | |
56 | fTOFGeometry = new AliTOFGeometryV5(); | |
57 | fTOFcalib = new AliTOFcalib(fTOFGeometry); | |
58 | if(!fTOFcalib->ReadParFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
59 | } | |
60 | ||
61 | //------------------------------------------------------------------------ | |
62 | AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source) | |
63 | : AliReconstructor(), | |
64 | fTOFGeometry(0), | |
65 | fTOFcalib(0) | |
66 | { | |
67 | // | |
68 | // copy ctor | |
69 | // | |
70 | this->fTOFGeometry=source.fTOFGeometry; | |
71 | this->fTOFcalib=source.fTOFcalib; | |
72 | } | |
73 | ||
74 | //------------------------------------------------------------------------ | |
75 | AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source) | |
76 | { | |
77 | // | |
78 | // assignment op. | |
79 | // | |
80 | this->fTOFGeometry=source.fTOFGeometry; | |
81 | this->fTOFcalib=source.fTOFcalib; | |
82 | return *this; | |
83 | } | |
84 | //_____________________________________________________________________________ | |
85 | AliTOFReconstructor::~AliTOFReconstructor() | |
86 | { | |
87 | // | |
88 | // dtor | |
89 | // | |
90 | delete fTOFGeometry; | |
91 | delete fTOFcalib; | |
92 | } | |
93 | ||
d08a92dd | 94 | //_____________________________________________________________________________ |
95 | void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, | |
96 | TTree *clustersTree) const | |
97 | { | |
98 | // reconstruct clusters from Raw Data | |
99 | ||
a98acac1 | 100 | AliTOFClusterFinder tofClus(fTOFcalib); |
d08a92dd | 101 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
121a60bd | 102 | |
103 | } | |
104 | ||
a98acac1 | 105 | //_____________________________________________________________________________ |
106 | void AliTOFReconstructor::Reconstruct(TTree *digitsTree, | |
107 | TTree *clustersTree) const | |
108 | { | |
109 | // reconstruct clusters from Raw Data | |
110 | ||
111 | AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); | |
112 | AliTOFClusterFinder tofClus(fTOFcalib); | |
113 | tofClus.Digits2RecPoints(digitsTree, clustersTree); | |
114 | ||
115 | } | |
116 | //_____________________________________________________________________________ | |
117 | void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const | |
118 | { | |
119 | // reconstruct clusters from digits | |
120 | ||
121 | AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); | |
122 | AliTOFClusterFinder tofClus(fTOFcalib); | |
123 | tofClus.Raw2Digits(reader, digitsTree); | |
124 | ||
125 | } | |
126 | ||
121a60bd | 127 | //_____________________________________________________________________________ |
d76c31f4 | 128 | AliTracker* AliTOFReconstructor::CreateTracker() const |
121a60bd | 129 | { |
130 | // create a TOF tracker | |
131 | ||
d88fbf15 | 132 | TString selectedTracker = GetOption(); |
133 | // use MI tracker if selected | |
bc9f08da | 134 | if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(); |
135 | return new AliTOFtracker(); | |
121a60bd | 136 | } |
137 | ||
138 | //_____________________________________________________________________________ | |
d76c31f4 | 139 | AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry() const |
121a60bd | 140 | { |
d76c31f4 | 141 | // get the TOF geometry |
142 | return fTOFGeometry; | |
121a60bd | 143 | } |