66c7af58965d88f15a31929c708bee30677ad836
[u/mrichter/AliRoot.git] / HLT / hough / AliL3HoughGlobalMerger.cxx
1 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
2 //*-- Copyright &copy ASV 
3
4 #include <stdlib.h>
5 #include <math.h>
6 #include <iostream.h>
7 #include "AliL3Logging.h"
8 #include "AliL3HoughTrack.h"
9 #include "AliL3HoughGlobalMerger.h"
10 #include "AliL3Track.h"
11 #include "AliL3TrackArray.h"
12 #include "AliL3Transform.h"
13
14 //_____________________________________________________________
15 // Merging Hough tracks across slices
16
17 ClassImp(AliL3HoughGlobalMerger)
18
19 AliL3HoughGlobalMerger::AliL3HoughGlobalMerger()
20 {
21   fTracks = 0;
22 }
23
24 AliL3HoughGlobalMerger::AliL3HoughGlobalMerger(Int_t first,Int_t last)
25 {
26   fNSlices = last-first+1;
27   fTracks = new AliL3TrackArray*[fNSlices];
28   for(Int_t i=0; i<fNSlices; i++)
29     fTracks[i] = new AliL3TrackArray("AliL3HoughTrack");
30   
31   
32 }
33 AliL3HoughGlobalMerger::~AliL3HoughGlobalMerger()
34 {
35   if(fTracks)
36     {
37       for(Int_t i=0; i<fNSlices; i++)
38         {
39           if(!fTracks[i])
40             continue;
41           delete fTracks;
42         }
43       delete [] fTracks;
44     }
45   
46 }
47
48 void AliL3HoughGlobalMerger::FillTracks(AliL3TrackArray *tracks,Int_t slice)
49 {
50   
51   fTracks[slice]->AddTracks(tracks,kTRUE,slice);
52   
53 }
54
55 void AliL3HoughGlobalMerger::Merge()
56 {
57   for(Int_t slice=0; slice<fNSlices; slice++)
58     {
59       if(slice+1 == fNSlices) continue;
60       AliL3TrackArray *t1 = fTracks[slice];
61       AliL3TrackArray *t2 = fTracks[slice+1];
62       Float_t angle = AliL3Transform::Pi()/18;
63       AliL3Transform::Local2GlobalAngle(&angle,slice);
64       
65       for(Int_t i=0; i<t1->GetNTracks(); i++)
66         {
67           
68         }
69     }
70   
71 }