]>
Commit | Line | Data |
---|---|---|
108615fc | 1 | //Author: Uli Frankenfeld |
2 | //Author: Anders Strand Vestbo | |
3 | //Last Modified: 13.12.2000 | |
4 | ||
108615fc | 5 | #include <TFile.h> |
6 | #include <TDirectory.h> | |
7 | #include <TClonesArray.h> | |
8 | #include <TStopwatch.h> | |
9 | #include <iostream.h> | |
10 | ||
2e1fe9ef | 11 | #include "AliL3Logging.h" |
108615fc | 12 | #include "AliLevel3.h" |
13 | #include "AliL3ConfMapper.h" | |
14 | #include "AliL3Vertex.h" | |
15 | #include "AliL3VertexFinder.h" | |
16 | #include "AliL3TrackMerger.h" | |
17 | #include "AliL3GlobalMerger.h" | |
18 | #include "AliL3InterMerger.h" | |
19 | #include "AliL3ConfMapPoint.h" | |
20 | #include "AliL3ConfMapTrack.h" | |
21 | #include "AliL3Transform.h" | |
22 | #include "AliL3ClustFinder.h" | |
23 | #include "AliL3DigitData.h" | |
24 | #include "AliL3TrackArray.h" | |
25 | #include "AliL3MemHandler.h" | |
2e1fe9ef | 26 | #ifdef use_aliroot |
108615fc | 27 | #include "AliL3FileHandler.h" |
2e1fe9ef | 28 | #endif |
108615fc | 29 | #include "AliL3Benchmark.h" |
30 | ||
31 | #include "AliL3DigitData.h" | |
32 | #include "AliL3TrackSegmentData.h" | |
33 | #include "AliL3SpacePointData.h" | |
34 | #include "AliL3VertexData.h" | |
35 | ||
36 | //_______________________________________ | |
37 | // | |
38 | // AliLevel3 | |
39 | // | |
40 | // Interface class for Level3 tracker. | |
41 | // Tracking is done by calling constructor with input,output | |
42 | // given as argument. | |
43 | // You must always remember to set the tracking parameters. E.g.: | |
44 | // | |
45 | // AliLevel3 *level3 = new AliLevel3(inputfile,outputfile); | |
46 | // level3->SetTrackerParam(); //Sets default tracking parameters | |
47 | // level3->ProcessSector(2,2); //Does tracking on sector 2 (actually 2+38) | |
48 | ||
49 | ClassImp(AliLevel3) | |
50 | ||
51 | AliLevel3::AliLevel3(){ | |
52 | fInputFile=0; | |
53 | fOutputFile=0; | |
54 | Init(); | |
55 | } | |
56 | ||
57 | AliLevel3::AliLevel3(Char_t *infile,Char_t *outfile){ | |
58 | //Constructor. Calls constructor of the tracker, vertexfinder and merger classes. | |
59 | ||
60 | fOutputFile = new TFile(outfile,"NEW"); | |
61 | ||
62 | if(!fOutputFile->IsOpen()) | |
63 | { | |
64 | LOG(AliL3Log::kWarning, "AliLevel3::AliLevel3","File Open") | |
65 | <<"Delete your old "<<outfile<<" file!"<<ENDLOG; | |
66 | } | |
67 | fInputFile = new TFile(infile,"READ"); | |
68 | ||
69 | if(!fInputFile->IsOpen()) | |
70 | { | |
71 | LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open") | |
72 | <<"Inputfile "<<infile<<" does not exist"<<ENDLOG; | |
73 | return; | |
74 | } | |
75 | ||
76 | Init(); | |
77 | } | |
78 | ||
79 | AliLevel3::AliLevel3(TFile *in, TFile *out){ | |
80 | fOutputFile = out; | |
81 | fInputFile = in; | |
82 | if(!in){ | |
83 | LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open") | |
84 | <<"Pointer to InFile 0x0!"<<ENDLOG; | |
85 | return; | |
86 | } | |
87 | if(!out){ | |
88 | LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open") | |
89 | <<"Pointer to OutFile 0x0!"<<ENDLOG; | |
90 | return; | |
91 | } | |
92 | ||
93 | if(!fOutputFile->IsOpen()) | |
94 | { | |
95 | LOG(AliL3Log::kWarning,"AliLevel3::AliLevel3","File Open") | |
96 | <<"no output file!"<<ENDLOG; | |
97 | return; | |
98 | } | |
99 | if(!fInputFile->IsOpen()) | |
100 | { | |
101 | LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open") | |
102 | <<"Inputfile does not exist"<<ENDLOG; | |
103 | return; | |
104 | } | |
105 | Init(); | |
106 | } | |
107 | ||
108 | void AliLevel3::Init(){ | |
109 | fWriteOut = kFALSE; | |
110 | fGlobalMerger=0; | |
111 | fTransformer = new AliL3Transform(); | |
112 | fDoRoi = kFALSE; | |
113 | fUseBinary =kFALSE; | |
114 | SetPath(""); | |
115 | fFindVertex =kTRUE; | |
116 | fNPatch = 5; //number of patches change row in process | |
e0ea9951 | 117 | fRow[0][0] = 0; // first row |
118 | // fRow[0][1] = 173; // last row | |
119 | fRow[0][1] = 45; | |
120 | fRow[1][0] = 46; | |
121 | fRow[1][1] = 77; | |
122 | fRow[2][0] = 78; | |
123 | fRow[2][1] = 109; | |
124 | fRow[3][0] = 110; | |
125 | fRow[3][1] = 141; | |
126 | fRow[4][0] = 142; | |
127 | fRow[4][1] = 173; // last row | |
108615fc | 128 | fVertexFinder = new AliL3VertexFinder(); |
129 | fVertex = new AliL3Vertex(); | |
130 | fTracker = new AliL3ConfMapper(); | |
131 | fTrackMerger = new AliL3TrackMerger(fNPatch); | |
132 | fInterMerger = new AliL3InterMerger(); | |
2e1fe9ef | 133 | #ifdef use_aliroot |
108615fc | 134 | fFileHandler = new AliL3FileHandler(); |
135 | fFileHandler->SetAliInput(fInputFile); | |
2e1fe9ef | 136 | #else |
137 | fFileHandler = new AliL3MemHandler(); | |
138 | #endif | |
108615fc | 139 | fBenchmark = new AliL3Benchmark(); |
140 | } | |
141 | ||
142 | void AliLevel3::DoBench(char* name){ | |
143 | fBenchmark->Analyze(name); | |
144 | } | |
145 | ||
146 | void AliLevel3::DoMc(char* file){ | |
2e1fe9ef | 147 | #ifdef use_aliroot |
108615fc | 148 | if(!fFileHandler->IsDigit()) |
149 | fFileHandler->SetMCOutput(file); | |
2e1fe9ef | 150 | #endif |
108615fc | 151 | } |
152 | ||
153 | AliLevel3::~AliLevel3(){ | |
154 | //Destructor | |
155 | if(fVertexFinder) delete fVertexFinder; | |
156 | if(fVertex) delete fVertex; | |
157 | if(fTracker) delete fTracker; | |
158 | if(fTransformer) delete fTransformer; | |
159 | if(fTrackMerger) delete fTrackMerger; | |
160 | if(fInterMerger) delete fInterMerger; | |
161 | if(fFileHandler) delete fFileHandler; | |
162 | } | |
163 | ||
164 | void AliLevel3::SetTrackerParam(Int_t phi_segments, Int_t eta_segments, | |
165 | Int_t trackletlength, Int_t tracklength, | |
166 | Int_t rowscopetracklet, Int_t rowscopetrack, | |
167 | Double_t min_pt_fit, Double_t maxangle, | |
168 | Double_t goodDist, Double_t hitChi2Cut, | |
169 | Double_t goodHitChi2, Double_t trackChi2Cut, | |
170 | Int_t maxdist) | |
171 | { | |
172 | //Set parameters input to the tracker | |
173 | //If no arguments are given, default parameters will be used | |
174 | ||
175 | fTracker->SetNSegments(phi_segments,eta_segments); | |
176 | fTracker->MainVertexSettings(trackletlength,tracklength,rowscopetracklet,rowscopetrack); | |
177 | fTracker->SetMaxDca(min_pt_fit); | |
178 | fTracker->SetTrackletCuts(maxangle,goodDist,true); | |
179 | fTracker->SetTrackCuts(hitChi2Cut,goodHitChi2,trackChi2Cut,maxdist); | |
180 | ||
181 | fTracker->SetParamDone(true); | |
182 | } | |
183 | ||
184 | void AliLevel3::ProcessEvent(Int_t first,Int_t last){ | |
185 | //Do tracking on all slices in region [first,last] | |
186 | //Slices numbering in TPC goes from 0-35, which means that 1 slice | |
187 | //corresponds to inner+outer sector.E.g. slice 2 corresponds to | |
188 | //inner=2 + outer=38. | |
189 | fGlobalMerger= new AliL3GlobalMerger(first,last); | |
190 | for(Int_t i=first; i<=last; i++){ | |
191 | ProcessSlice(i); | |
192 | fGlobalMerger->SetVertex(fVertex); | |
193 | fGlobalMerger->SetTransformer(fTransformer); | |
194 | fGlobalMerger->InitSlice(i); | |
108615fc | 195 | fGlobalMerger->FillTracks(fNTrackData,fTrackData); |
108615fc | 196 | fFileHandler->Free(); //free the memory |
197 | fNTrackData=0; | |
198 | fTrackData=0; | |
199 | } | |
200 | fBenchmark->Start("Global Merger"); | |
201 | fGlobalMerger->Merge(); | |
202 | // fGlobalMerger->SlowMerge(); | |
203 | fBenchmark->Stop("Global Merger"); | |
204 | ||
205 | if(fWriteOut) WriteResults(); | |
206 | delete fGlobalMerger; fGlobalMerger = 0; | |
207 | } | |
208 | ||
209 | void AliLevel3::ProcessSlice(Int_t slice){ | |
210 | char name[256]; | |
e0ea9951 | 211 | Bool_t UseCF = kTRUE; |
212 | #ifdef use_aliroot | |
213 | UseCF = fFileHandler->IsDigit(); | |
214 | #endif | |
108615fc | 215 | // Int_t row[5][2] = {{ 0,173}}; |
e0ea9951 | 216 | // Int_t row[5][2] = {{ 0, 45},{46,77},{78,109},{110,141},{142,173}}; |
108615fc | 217 | const Int_t maxpoints=100000; |
218 | const Int_t pointsize = maxpoints * sizeof(AliL3SpacePointData); | |
219 | AliL3MemHandler *memory = new AliL3MemHandler(); | |
220 | ||
221 | fTrackMerger->Reset(); | |
222 | fTrackMerger->SetTransformer(fTransformer); | |
e0ea9951 | 223 | fTrackMerger->SetRows(fRow[0]); |
108615fc | 224 | for(Int_t patch=fNPatch-1;patch>=0;patch--){ |
e0ea9951 | 225 | fFileHandler->Init(slice,patch,fRow[patch]); |
108615fc | 226 | fFileHandler->Init(fTransformer); |
227 | UInt_t npoints=0; | |
228 | AliL3SpacePointData *points =0; | |
229 | UInt_t ndigits=0; | |
230 | AliL3DigitRowData *digits =0; | |
231 | if(fUseBinary){ | |
108615fc | 232 | if(!fDoRoi){ |
233 | if(0){ //Binary to Memory | |
234 | fFileHandler->Free(); | |
235 | sprintf(name,"%sdigits_%d_%d.raw",fPath,slice,patch); | |
236 | fFileHandler->SetBinaryInput(name); | |
237 | digits= (AliL3DigitRowData *)fFileHandler->CompBinary2Memory(ndigits); | |
238 | fFileHandler->CloseBinaryInput(); | |
239 | } | |
240 | ||
241 | if(1){ //Binary to Memory with Benchmark | |
242 | fFileHandler->Free(); | |
243 | sprintf(name,"%sdigits_%d_%d.raw",fPath,slice,patch); | |
244 | memory->SetBinaryInput(name); | |
245 | UInt_t compsize=memory->GetFileSize(); | |
246 | UInt_t *comp=(UInt_t *)memory->Allocate(compsize); | |
247 | memory->CompBinary2CompMemory(ndigits,comp); | |
248 | memory->CloseBinaryInput(); | |
249 | UInt_t datasize=memory->GetMemorySize(ndigits,comp); | |
250 | digits=(AliL3DigitRowData *)fFileHandler->Allocate(datasize); | |
251 | fBenchmark->Start("Unpacker"); | |
252 | fFileHandler->CompMemory2Memory(ndigits,digits,comp); | |
253 | fBenchmark->Stop("Unpacker"); | |
254 | memory->Free(); | |
255 | } | |
256 | ||
257 | if(0){ //Binary to Memory with Random | |
258 | fFileHandler->Free(); | |
259 | fFileHandler->ResetRandom(); | |
260 | fFileHandler->SetRandomCluster(100); | |
261 | fFileHandler->SetNGenerate(100); | |
262 | sprintf(name,"%sdigits_%d_%d.raw",fPath,slice,patch); | |
263 | memory->SetBinaryInput(name); | |
264 | UInt_t compsize=memory->GetFileSize(); | |
265 | UInt_t *comp=(UInt_t *)memory->Allocate(compsize); | |
266 | memory->CompBinary2CompMemory(ndigits,comp); | |
267 | memory->CloseBinaryInput(); | |
268 | UInt_t dsize=memory->GetMemorySize(ndigits,comp); | |
269 | UInt_t rsize=fFileHandler->GetRandomSize(); | |
270 | digits=(AliL3DigitRowData*)fFileHandler->Allocate(dsize+rsize); | |
271 | fBenchmark->Start("Unpacker"); | |
272 | fFileHandler->CompMemory2Memory(ndigits,digits,comp); | |
273 | fBenchmark->Stop("Unpacker"); | |
274 | memory->Free(); | |
108615fc | 275 | } |
276 | } | |
277 | ||
278 | else{ //Binary to Memory with Roi | |
279 | fFileHandler->Free(); | |
280 | Int_t sli[2]={0,0}; | |
281 | fFileHandler->SetROI(fEta,sli); | |
282 | sprintf(name,"%sdigits_%d_%d.raw",fPath,slice,patch); | |
283 | memory->SetBinaryInput(name); | |
284 | UInt_t compsize=memory->GetFileSize(); | |
285 | UInt_t *comp=(UInt_t *)memory->Allocate(compsize); | |
286 | memory->CompBinary2CompMemory(ndigits,comp); | |
287 | memory->CloseBinaryInput(); | |
288 | UInt_t datasize=memory->GetMemorySize(ndigits,comp); | |
289 | digits=(AliL3DigitRowData *)fFileHandler->Allocate(datasize); | |
290 | fBenchmark->Start("Unpacker"); | |
291 | datasize = fFileHandler->CompMemory2Memory(ndigits,digits,comp); | |
292 | fBenchmark->Stop("Unpacker"); | |
293 | memory->Free(); | |
108615fc | 294 | } |
295 | ||
e0ea9951 | 296 | /* |
108615fc | 297 | points = (AliL3SpacePointData *) memory->Allocate(pointsize); |
298 | ||
299 | fClusterFinder = new AliL3ClustFinder(fTransformer); | |
e0ea9951 | 300 | fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1] |
108615fc | 301 | ,maxpoints); |
302 | fClusterFinder->SetXYError(0.1); | |
303 | fClusterFinder->SetZError(0.2); | |
304 | fClusterFinder->SetOutputArray(points); | |
108615fc | 305 | fClusterFinder->Read(ndigits,digits); |
108615fc | 306 | fBenchmark->Start("Cluster Finder"); |
307 | fClusterFinder->ProcessDigits(); | |
308 | fBenchmark->Stop("Cluster Finder"); | |
309 | npoints = fClusterFinder->GetNumberOfClusters(); | |
310 | delete fClusterFinder; | |
311 | fClusterFinder =0; | |
312 | fFileHandler->Free(); | |
313 | ||
314 | LOG(AliL3Log::kInformational,"AliLevel3::ProcessSlice","Cluster Finder") | |
315 | <<AliL3Log::kDec<<"Found "<<npoints<<" Points"<<ENDLOG; | |
e0ea9951 | 316 | */ |
108615fc | 317 | } |
318 | ||
319 | else{ | |
2e1fe9ef | 320 | #ifdef use_aliroot |
e0ea9951 | 321 | if(UseCF){ |
108615fc | 322 | sprintf(name,"digits_%d_%d.raw",slice,patch); |
2e1fe9ef | 323 | |
108615fc | 324 | if(0){ //Ali to Binary |
325 | fFileHandler->SetBinaryOutput(name); | |
326 | fFileHandler->AliDigits2CompBinary(); | |
327 | fFileHandler->CloseBinaryOutput(); | |
328 | } | |
329 | ||
330 | if(1){ //Ali to Memory | |
331 | digits=(AliL3DigitRowData *)fFileHandler->AliDigits2Memory(ndigits); | |
332 | if(fWriteOut){ //Memory to Binary | |
333 | fFileHandler->SetBinaryOutput(name); | |
334 | fFileHandler->Memory2CompBinary(ndigits,digits); | |
335 | fFileHandler->CloseBinaryOutput(); | |
336 | } | |
337 | } | |
338 | } | |
2e1fe9ef | 339 | #endif |
108615fc | 340 | } |
341 | ||
e0ea9951 | 342 | if(UseCF){ |
343 | points = (AliL3SpacePointData *) memory->Allocate(pointsize); | |
344 | ||
345 | fClusterFinder = new AliL3ClustFinder(fTransformer); | |
346 | fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1] | |
347 | ,maxpoints); | |
348 | fClusterFinder->SetXYError(0.1); | |
349 | fClusterFinder->SetZError(0.2); | |
350 | fClusterFinder->SetOutputArray(points); | |
351 | fClusterFinder->Read(ndigits,digits); | |
352 | fBenchmark->Start("Cluster Finder"); | |
353 | fClusterFinder->ProcessDigits(); | |
354 | fBenchmark->Stop("Cluster Finder"); | |
355 | npoints = fClusterFinder->GetNumberOfClusters(); | |
356 | delete fClusterFinder; | |
357 | fClusterFinder =0; | |
358 | fFileHandler->Free(); | |
359 | LOG(AliL3Log::kInformational,"AliLevel3::ProcessSlice","Cluster Finder") | |
360 | <<AliL3Log::kDec<<"Found "<<npoints<<" Points"<<ENDLOG; | |
361 | } | |
362 | ||
363 | #ifdef use_aliroot | |
364 | // if not use Clusterfinder | |
365 | if(!UseCF) points = fFileHandler->AliPoints2Memory(npoints); | |
366 | #endif | |
367 | ||
108615fc | 368 | if(patch == fNPatch-1){ |
369 | // Vertex | |
370 | if(fFindVertex){ | |
371 | // Vertex Finder | |
372 | ||
373 | fBenchmark->Start("Vertex Finder Read"); | |
374 | fVertexFinder->Reset(); | |
375 | fVertexFinder->Read(npoints,points); | |
376 | fBenchmark->Stop("Vertex Finder Read"); | |
377 | fBenchmark->Start("Vertex Finder"); | |
378 | fVertexFinder->Analyze(); | |
379 | AliL3VertexData vertex[1]; | |
380 | fVertexFinder->Write(vertex); | |
381 | fVertex->Read(vertex); | |
382 | fBenchmark->Stop("Vertex Finder"); | |
383 | } | |
384 | else{ | |
385 | //use 0,0,0 for vertex | |
386 | fVertex->SetZero(); | |
387 | } | |
388 | fTrackMerger->SetVertex(fVertex); | |
389 | } | |
e0ea9951 | 390 | fTracker->InitSector(slice,fRow[patch]); |
108615fc | 391 | fTracker->SetVertex(fVertex); |
392 | fBenchmark->Start("Tracker Read Hits"); | |
393 | fTracker->ReadHits(npoints,points); | |
394 | fBenchmark->Stop("Tracker Read Hits"); | |
395 | fBenchmark->Start("MainVertexTracking A"); | |
396 | fTracker->MainVertexTracking_a(); | |
397 | fBenchmark->Stop("MainVertexTracking A"); | |
398 | fBenchmark->Start("MainVertexTracking B"); | |
399 | fTracker->MainVertexTracking_b(); | |
400 | fBenchmark->Stop("MainVertexTracking B"); | |
401 | fBenchmark->Start("Tracking fit"); | |
402 | fTracker->FillTracks(); | |
403 | fBenchmark->Stop("Tracking fit"); | |
404 | ||
405 | if(fWriteOut) | |
406 | WriteSpacePoints(npoints, points, slice, patch); //do after Tracking | |
e0ea9951 | 407 | |
408 | //free memory | |
409 | if(UseCF) | |
410 | memory->Free(); | |
411 | else | |
412 | fFileHandler->Free(); | |
108615fc | 413 | |
414 | UInt_t ntracks0 =0; | |
415 | AliL3TrackSegmentData *trackdata0 = | |
416 | (AliL3TrackSegmentData *) memory->Allocate(fTracker->GetTracks()); | |
417 | memory->TrackArray2Memory(ntracks0,trackdata0,fTracker->GetTracks()); | |
418 | ||
419 | //write tracks | |
420 | if(fWriteOut){ | |
421 | sprintf(name,"tracks_tr_%d_%d.raw",slice,patch); | |
422 | memory->SetBinaryOutput(name); | |
423 | memory->Memory2Binary(ntracks0,trackdata0); | |
424 | memory->CloseBinaryOutput(); | |
425 | } | |
426 | ||
427 | fInterMerger->Reset(); | |
428 | fInterMerger->SetTransformer(fTransformer); | |
e0ea9951 | 429 | fInterMerger->Init(fRow[patch],patch); |
108615fc | 430 | |
108615fc | 431 | fInterMerger->FillTracks(ntracks0,trackdata0); |
108615fc | 432 | fBenchmark->Start("Inter Merger"); |
433 | fInterMerger->Merge(); | |
434 | // fInterMerger->SlowMerge(); | |
435 | ||
436 | fBenchmark->Stop("Inter Merger"); | |
437 | ||
438 | //write inter merged tracks | |
439 | if(fWriteOut){ | |
440 | sprintf(name,"tracks_im_%d_%d.raw",slice,patch); | |
441 | WriteTracks(name,fInterMerger,'i'); //write output of intermerger | |
442 | } | |
443 | memory->Free(); | |
444 | ||
445 | UInt_t ntracks1 =0; | |
446 | AliL3TrackSegmentData *trackdata1 = | |
447 | (AliL3TrackSegmentData *) memory->Allocate(fInterMerger->GetInTracks(0)); | |
448 | memory->TrackArray2Memory(ntracks1,trackdata1,fInterMerger->GetInTracks(0)); | |
449 | ||
450 | fTrackMerger->InitSector(slice,patch); | |
108615fc | 451 | fTrackMerger->FillTracks(ntracks1,trackdata1); |
108615fc | 452 | |
453 | memory->Free(); | |
454 | } | |
455 | fBenchmark->Start("Patch Merger"); | |
456 | // fTrackMerger->SlowMerge(); | |
457 | fTrackMerger->Merge(); | |
458 | fBenchmark->Stop("Patch Merger"); | |
459 | //write merged tracks | |
460 | if(fWriteOut){ | |
461 | sprintf(name,"tracks_tm_%d.raw",slice); | |
462 | WriteTracks(name,fTrackMerger,'o'); //write output of trackmerger | |
463 | } | |
464 | ||
465 | fTrackData = (AliL3TrackSegmentData *) | |
466 | fFileHandler->Allocate(fTrackMerger->GetOutTracks()); | |
467 | ||
468 | fFileHandler->TrackArray2Memory(fNTrackData,fTrackData, | |
469 | fTrackMerger->GetOutTracks()); | |
470 | ||
471 | delete memory; | |
472 | } | |
473 | ||
474 | void AliLevel3::WriteSpacePoints(UInt_t npoints,AliL3SpacePointData *points, | |
475 | Int_t slice,Int_t patch){ | |
476 | char name[256]; | |
477 | sprintf(name,"points_%d_%d.raw",slice,patch); | |
478 | AliL3MemHandler * memory = new AliL3MemHandler(); | |
479 | memory->SetBinaryOutput(name); | |
480 | memory->Transform(npoints,points,slice,fTransformer); | |
481 | memory->Memory2Binary(npoints,points); | |
482 | memory->CloseBinaryOutput(); | |
483 | delete memory; | |
484 | } | |
485 | ||
486 | ||
487 | Int_t AliLevel3::WriteTracks(char *filename,AliL3Merger *merger,char opt){ | |
2e1fe9ef | 488 | AliL3MemHandler *memory = new AliL3MemHandler(); |
108615fc | 489 | memory->SetBinaryOutput(filename); |
490 | if(opt=='a'||opt=='i'){ //add intracks | |
491 | for(Int_t i=0;i<merger->GetNIn();i++){ | |
492 | AliL3TrackArray *tr=merger->GetInTracks(i); | |
493 | memory->TrackArray2Binary(tr); | |
494 | } | |
495 | } | |
496 | ||
497 | if(opt=='o'||opt=='a'){ | |
498 | AliL3TrackArray *tr=merger->GetOutTracks(); | |
499 | memory->TrackArray2Binary(tr); | |
500 | } | |
501 | ||
502 | memory->CloseBinaryOutput(); | |
503 | ||
504 | return 1; | |
505 | } | |
506 | ||
507 | void AliLevel3::WriteResults() | |
508 | { | |
509 | //Write the resulting tracks to outputfile | |
510 | WriteTracks("tracks.raw",fGlobalMerger,'a'); | |
511 | } |