1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // Implementation of the AliTracker class
21 // Iouri Belikov, CERN, Jouri.Belikov@cern.ch
22 //-------------------------------------------------------------------------
26 #include "AliTracker.h"
27 #include "AliCluster.h"
28 #include "AliKalmanTrack.h"
32 //__________________________________________________________________________
33 void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const {
34 //--------------------------------------------------------------------
35 //This function "cooks" a track label. If label<0, this track is fake.
36 //--------------------------------------------------------------------
37 Int_t noc=t->GetNumberOfClusters();
38 Int_t *lb=new Int_t[noc];
39 Int_t *mx=new Int_t[noc];
40 AliCluster **clusters=new AliCluster*[noc];
43 for (i=0; i<noc; i++) {
45 Int_t index=t->GetClusterIndex(i);
46 clusters[i]=GetCluster(index);
50 for (i=0; i<noc; i++) {
51 AliCluster *c=clusters[i];
52 lab=TMath::Abs(c->GetLabel(0));
54 for (j=0; j<noc; j++) if (lb[j]==lab || mx[j]==0) break;
60 for (i=0; i<noc; i++) if (mx[i]>max) {max=mx[i]; lab=lb[i];}
62 for (i=0; i<noc; i++) {
63 AliCluster *c=clusters[i];
64 if (TMath::Abs(c->GetLabel(1)) == lab ||
65 TMath::Abs(c->GetLabel(2)) == lab ) max++;
68 if ((1.- Float_t(max)/noc) > wrong) lab=-lab;
76 //____________________________________________________________________________
77 void AliTracker::UseClusters(const AliKalmanTrack *t, Int_t from) const {
78 //------------------------------------------------------------------
79 //This function marks clusters associated with the track.
80 //------------------------------------------------------------------
81 Int_t noc=t->GetNumberOfClusters();
82 for (Int_t i=from; i<noc; i++) {
83 Int_t index=t->GetClusterIndex(i);
84 AliCluster *c=GetCluster(index);