]>
Commit | Line | Data |
---|---|---|
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 TRD reconstruction // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include <TFile.h> | |
25 | ||
26 | #include "AliRunLoader.h" | |
27 | #include "AliRawReader.h" | |
28 | #include "AliLog.h" | |
29 | #include "AliESDTrdTrack.h" | |
30 | #include "AliESDEvent.h" | |
31 | ||
32 | #include "AliTRDReconstructor.h" | |
33 | #include "AliTRDclusterizerV1.h" | |
34 | #include "AliTRDtracker.h" | |
35 | #include "AliTRDpidESD.h" | |
36 | #include "AliTRDgtuTrack.h" | |
37 | #include "AliTRDrawData.h" | |
38 | #include "AliTRDdigitsManager.h" | |
39 | ||
40 | ClassImp(AliTRDReconstructor) | |
41 | ||
42 | Bool_t AliTRDReconstructor::fgkSeedingOn = kFALSE; | |
43 | Int_t AliTRDReconstructor::fgStreamLevel = 0; // Stream (debug) level | |
44 | ||
45 | //_____________________________________________________________________________ | |
46 | void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader | |
47 | , TTree *digitsTree) const | |
48 | { | |
49 | // | |
50 | // Convert raw data digits into digit objects in a root tree | |
51 | // | |
52 | ||
53 | AliTRDrawData rawData; | |
54 | rawReader->Reset(); | |
55 | rawReader->Select("TRD"); | |
56 | AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader); | |
57 | manager->MakeBranch(digitsTree); | |
58 | manager->WriteDigits(); | |
59 | ||
60 | } | |
61 | ||
62 | //_____________________________________________________________________________ | |
63 | void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader | |
64 | , AliRawReader *rawReader) const | |
65 | { | |
66 | // | |
67 | // Reconstruct clusters | |
68 | // | |
69 | ||
70 | AliInfo("Reconstruct TRD clusters from RAW data"); | |
71 | ||
72 | AliLoader *loader = runLoader->GetLoader("TRDLoader"); | |
73 | loader->LoadRecPoints("recreate"); | |
74 | ||
75 | runLoader->CdGAFile(); | |
76 | Int_t nEvents = runLoader->GetNumberOfEvents(); | |
77 | ||
78 | rawReader->Reset(); | |
79 | rawReader->Select("TRD"); | |
80 | ||
81 | for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { | |
82 | if (!rawReader->NextEvent()) break; | |
83 | AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer"); | |
84 | clusterer.Open(runLoader->GetFileName(),iEvent); | |
85 | clusterer.ReadDigits(rawReader); | |
86 | clusterer.MakeClusters(); | |
87 | clusterer.WriteClusters(-1); | |
88 | } | |
89 | ||
90 | loader->UnloadRecPoints(); | |
91 | ||
92 | } | |
93 | ||
94 | //_____________________________________________________________________________ | |
95 | void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader | |
96 | , TTree *clusterTree) const | |
97 | { | |
98 | // | |
99 | // Reconstruct clusters | |
100 | // | |
101 | ||
102 | AliInfo("Reconstruct TRD clusters from RAW data"); | |
103 | ||
104 | rawReader->Reset(); | |
105 | rawReader->Select("TRD"); | |
106 | ||
107 | AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer"); | |
108 | clusterer.OpenOutput(clusterTree); | |
109 | clusterer.ReadDigits(rawReader); | |
110 | clusterer.MakeClusters(); | |
111 | ||
112 | } | |
113 | ||
114 | //_____________________________________________________________________________ | |
115 | void AliTRDReconstructor::Reconstruct(TTree *digitsTree | |
116 | , TTree *clusterTree) const | |
117 | { | |
118 | // | |
119 | // Reconstruct clusters | |
120 | // | |
121 | ||
122 | AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer"); | |
123 | clusterer.OpenOutput(clusterTree); | |
124 | clusterer.ReadDigits(digitsTree); | |
125 | clusterer.MakeClusters(); | |
126 | ||
127 | } | |
128 | ||
129 | //_____________________________________________________________________________ | |
130 | void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const | |
131 | { | |
132 | // | |
133 | // Reconstruct clusters | |
134 | // | |
135 | ||
136 | AliLoader *loader = runLoader->GetLoader("TRDLoader"); | |
137 | loader->LoadRecPoints("recreate"); | |
138 | ||
139 | runLoader->CdGAFile(); | |
140 | Int_t nEvents = runLoader->GetNumberOfEvents(); | |
141 | ||
142 | for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { | |
143 | AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer"); | |
144 | clusterer.Open(runLoader->GetFileName(),iEvent); | |
145 | clusterer.ReadDigits(); | |
146 | clusterer.MakeClusters(); | |
147 | clusterer.WriteClusters(-1); | |
148 | } | |
149 | ||
150 | loader->UnloadRecPoints(); | |
151 | ||
152 | } | |
153 | ||
154 | //_____________________________________________________________________________ | |
155 | AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const | |
156 | { | |
157 | // | |
158 | // Create a TRD tracker | |
159 | // | |
160 | ||
161 | runLoader->CdGAFile(); | |
162 | ||
163 | return new AliTRDtracker(gFile); | |
164 | ||
165 | } | |
166 | ||
167 | //_____________________________________________________________________________ | |
168 | void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/ | |
169 | , AliRawReader* /*rawReader*/ | |
170 | , AliESDEvent* /*esd*/) const | |
171 | { | |
172 | // | |
173 | // Make PID | |
174 | // | |
175 | ||
176 | //AliTRDpidESD trdPID; | |
177 | //trdPID.MakePID(esd); | |
178 | ||
179 | } | |
180 | ||
181 | //_____________________________________________________________________________ | |
182 | void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/ | |
183 | , TTree* /*clusterTree*/ | |
184 | , AliESDEvent* /*esd*/) const | |
185 | { | |
186 | // | |
187 | // Make PID | |
188 | // | |
189 | ||
190 | //AliTRDpidESD trdPID; | |
191 | //trdPID.MakePID(esd); | |
192 | ||
193 | } | |
194 | ||
195 | //_____________________________________________________________________________ | |
196 | void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/ | |
197 | , TTree* /*clusterTree*/ | |
198 | , AliESDEvent* /*esd*/) const | |
199 | { | |
200 | // | |
201 | // Make PID | |
202 | // | |
203 | ||
204 | //AliTRDpidESD trdPID; | |
205 | //trdPID.MakePID(esd); | |
206 | ||
207 | } | |
208 | ||
209 | //_____________________________________________________________________________ | |
210 | void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/ | |
211 | , AliESDEvent* /*esd*/) const | |
212 | { | |
213 | // | |
214 | // Make PID | |
215 | // | |
216 | ||
217 | //AliTRDpidESD trdPID; | |
218 | //trdPID.MakePID(esd); | |
219 | ||
220 | } |