]>
Commit | Line | Data |
---|---|---|
be9c5115 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
acd84897 | 16 | /* $Id$ */ |
fb17acd4 | 17 | |
be9c5115 | 18 | //------------------------------------------------------------------------- |
19 | // Implementation of the AliTracker class | |
9b83b8cc | 20 | // that is the base for AliTPCtracker, AliITStrackerV2 and AliTRDtracker |
21 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
be9c5115 | 22 | //------------------------------------------------------------------------- |
116cbefd | 23 | |
be9c5115 | 24 | #include <TMath.h> |
25 | ||
26 | #include "AliTracker.h" | |
27 | #include "AliCluster.h" | |
28 | #include "AliKalmanTrack.h" | |
41377c29 | 29 | #include "AliRun.h" |
30 | #include "AliMagF.h" | |
31 | ||
41377c29 | 32 | extern AliRun* gAlice; |
be9c5115 | 33 | |
3b242889 | 34 | const AliMagF *AliTracker::fgkFieldMap=0; |
35 | ||
be9c5115 | 36 | ClassImp(AliTracker) |
37 | ||
3b242889 | 38 | AliTracker::AliTracker(): |
39 | fEventN(0), | |
40 | fStoreBarrel(1), | |
41 | fX(0), | |
42 | fY(0), | |
43 | fZ(0), | |
44 | fSigmaX(0.005), | |
45 | fSigmaY(0.005), | |
46 | fSigmaZ(0.010) | |
47 | { | |
48 | //-------------------------------------------------------------------- | |
49 | // The default constructor. | |
50 | //-------------------------------------------------------------------- | |
51 | AliMagF *field=gAlice->Field(); | |
52 | if (field==0) Fatal("AliTracker()","Can't access the field map !"); | |
53 | SetFieldMap(field); | |
54 | } | |
55 | ||
56 | void AliTracker::SetFieldMap(const AliMagF* map) { | |
57 | //-------------------------------------------------------------------- | |
58 | //This passes the field map to the reconstruction. | |
59 | //-------------------------------------------------------------------- | |
60 | if (map==0) ::Fatal("SetFieldMap","Can't access the field map !"); | |
61 | AliKalmanTrack::SetConvConst(1000/0.299792458/map->SolenoidField()); | |
62 | fgkFieldMap=map; | |
63 | } | |
64 | ||
be9c5115 | 65 | //__________________________________________________________________________ |
66 | void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const { | |
67 | //-------------------------------------------------------------------- | |
68 | //This function "cooks" a track label. If label<0, this track is fake. | |
69 | //-------------------------------------------------------------------- | |
70 | Int_t noc=t->GetNumberOfClusters(); | |
71 | Int_t *lb=new Int_t[noc]; | |
72 | Int_t *mx=new Int_t[noc]; | |
73 | AliCluster **clusters=new AliCluster*[noc]; | |
74 | ||
75 | Int_t i; | |
76 | for (i=0; i<noc; i++) { | |
77 | lb[i]=mx[i]=0; | |
78 | Int_t index=t->GetClusterIndex(i); | |
79 | clusters[i]=GetCluster(index); | |
80 | } | |
81 | ||
82 | Int_t lab=123456789; | |
83 | for (i=0; i<noc; i++) { | |
84 | AliCluster *c=clusters[i]; | |
85 | lab=TMath::Abs(c->GetLabel(0)); | |
86 | Int_t j; | |
87 | for (j=0; j<noc; j++) if (lb[j]==lab || mx[j]==0) break; | |
88 | lb[j]=lab; | |
89 | (mx[j])++; | |
90 | } | |
91 | ||
92 | Int_t max=0; | |
93 | for (i=0; i<noc; i++) if (mx[i]>max) {max=mx[i]; lab=lb[i];} | |
94 | ||
95 | for (i=0; i<noc; i++) { | |
96 | AliCluster *c=clusters[i]; | |
88cb7938 | 97 | if (TMath::Abs(c->GetLabel(1)) == lab || |
be9c5115 | 98 | TMath::Abs(c->GetLabel(2)) == lab ) max++; |
99 | } | |
100 | ||
101 | if ((1.- Float_t(max)/noc) > wrong) lab=-lab; | |
102 | t->SetLabel(lab); | |
103 | ||
104 | delete[] lb; | |
105 | delete[] mx; | |
106 | delete[] clusters; | |
107 | } | |
108 | ||
109 | //____________________________________________________________________________ | |
110 | void AliTracker::UseClusters(const AliKalmanTrack *t, Int_t from) const { | |
111 | //------------------------------------------------------------------ | |
112 | //This function marks clusters associated with the track. | |
113 | //------------------------------------------------------------------ | |
114 | Int_t noc=t->GetNumberOfClusters(); | |
115 | for (Int_t i=from; i<noc; i++) { | |
116 | Int_t index=t->GetClusterIndex(i); | |
117 | AliCluster *c=GetCluster(index); | |
118 | c->Use(); | |
119 | } | |
120 | } |