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