]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/hough/AliL3HoughGlobalMerger.cxx
Added AliL3Stopwatch.
[u/mrichter/AliRoot.git] / HLT / hough / AliL3HoughGlobalMerger.cxx
CommitLineData
f0f02577 1// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
2//*-- Copyright &copy ASV
3
95a00d93 4#include <stdlib.h>
f0f02577 5#include <math.h>
6#include <iostream.h>
7#include "AliL3Logging.h"
8#include "AliL3HoughTrack.h"
9#include "AliL3HoughGlobalMerger.h"
10#include "AliL3Track.h"
f0f02577 11#include "AliL3TrackArray.h"
4ab9f8f0 12#include "AliL3Transform.h"
f0f02577 13
14//_____________________________________________________________
15// Merging Hough tracks across slices
16
17ClassImp(AliL3HoughGlobalMerger)
18
0309a5ee 19AliL3HoughGlobalMerger::AliL3HoughGlobalMerger()
f0f02577 20{
0309a5ee 21 fTracks = 0;
f0f02577 22}
23
0309a5ee 24AliL3HoughGlobalMerger::AliL3HoughGlobalMerger(Int_t first,Int_t last)
f0f02577 25{
0309a5ee 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
f0f02577 31
f0f02577 32}
0309a5ee 33AliL3HoughGlobalMerger::~AliL3HoughGlobalMerger()
f0f02577 34{
0309a5ee 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 }
f0f02577 45
f0f02577 46}
47
0309a5ee 48void AliL3HoughGlobalMerger::FillTracks(AliL3TrackArray *tracks,Int_t slice)
f0f02577 49{
f0f02577 50
0309a5ee 51 fTracks[slice]->AddTracks(tracks,kTRUE,slice);
f0f02577 52
f0f02577 53}
54
55void AliL3HoughGlobalMerger::Merge()
56{
0309a5ee 57 for(Int_t slice=0; slice<fNSlices; slice++)
f0f02577 58 {
0309a5ee 59 if(slice+1 == fNSlices) continue;
60 AliL3TrackArray *t1 = fTracks[slice];
61 AliL3TrackArray *t2 = fTracks[slice+1];
62 Float_t angle = AliL3Transform::Pi()/18;
4ab9f8f0 63 AliL3Transform::Local2GlobalAngle(&angle,slice);
0309a5ee 64
65 for(Int_t i=0; i<t1->GetNTracks(); i++)
f0f02577 66 {
0309a5ee 67
f0f02577 68 }
f0f02577 69 }
0309a5ee 70
f0f02577 71}