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
20 // that is the base for AliTPCtracker, AliITStrackerV2 and AliTRDtracker
21 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
22 //-------------------------------------------------------------------------
26 #include "AliTracker.h"
27 #include "AliCluster.h"
28 #include "AliKalmanTrack.h"
30 Bool_t AliTracker::fgUniformField=kTRUE;
31 Double_t AliTracker::fgBz=0.;
32 const AliMagF *AliTracker::fgkFieldMap=0;
36 AliTracker::AliTracker():
44 //--------------------------------------------------------------------
45 // The default constructor.
46 //--------------------------------------------------------------------
47 if (!fgkFieldMap) AliWarning("Field map is not set. Call AliTracker::SetFieldMap before creating a tracker!");
50 void AliTracker::SetFieldMap(const AliMagF* map, Bool_t uni) {
51 //--------------------------------------------------------------------
52 //This passes the field map to the reconstruction.
53 //--------------------------------------------------------------------
54 if (map==0) AliFatalClass("Can't access the field map !");
57 AliWarningClass("The magnetic field map has been already set !");
64 //Float_t r[3]={0.,0.,0.},b[3]; map->Field(r,b);
67 fgBz=map->SolenoidField();
71 //__________________________________________________________________________
72 void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const {
73 //--------------------------------------------------------------------
74 //This function "cooks" a track label. If label<0, this track is fake.
75 //--------------------------------------------------------------------
76 Int_t noc=t->GetNumberOfClusters();
77 Int_t *lb=new Int_t[noc];
78 Int_t *mx=new Int_t[noc];
79 AliCluster **clusters=new AliCluster*[noc];
82 for (i=0; i<noc; i++) {
84 Int_t index=t->GetClusterIndex(i);
85 clusters[i]=GetCluster(index);
89 for (i=0; i<noc; i++) {
90 AliCluster *c=clusters[i];
91 lab=TMath::Abs(c->GetLabel(0));
93 for (j=0; j<noc; j++) if (lb[j]==lab || mx[j]==0) break;
99 for (i=0; i<noc; i++) if (mx[i]>max) {max=mx[i]; lab=lb[i];}
101 for (i=0; i<noc; i++) {
102 AliCluster *c=clusters[i];
103 //if (TMath::Abs(c->GetLabel(1)) == lab ||
104 // TMath::Abs(c->GetLabel(2)) == lab ) max++;
105 if (TMath::Abs(c->GetLabel(0)!=lab))
106 if (TMath::Abs(c->GetLabel(1)) == lab ||
107 TMath::Abs(c->GetLabel(2)) == lab ) max++;
110 if ((1.- Float_t(max)/noc) > wrong) lab=-lab;
111 t->SetFakeRatio((1.- Float_t(max)/noc));
119 //____________________________________________________________________________
120 void AliTracker::UseClusters(const AliKalmanTrack *t, Int_t from) const {
121 //------------------------------------------------------------------
122 //This function marks clusters associated with the track.
123 //------------------------------------------------------------------
124 Int_t noc=t->GetNumberOfClusters();
125 for (Int_t i=from; i<noc; i++) {
126 Int_t index=t->GetClusterIndex(i);
127 AliCluster *c=GetCluster(index);