]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackSA.cxx
compilation warnings
[u/mrichter/AliRoot.git] / ITS / AliITStrackSA.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2003, 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
16 /* $Id$ */
17
18 ////////////////////////////////////////////////////
19 //  Stand alone track class                       //
20 //  Origin:  Elisabetta Crescio                   //
21 //  e-mail:  crescio@to.infn.it                   //
22 //  it is a V2 track with a possible number       //
23 //  of cluster equal to fgkMaxNumberOfClusters    //
24 ////////////////////////////////////////////////////
25
26 #include "AliITSgeomTGeo.h"
27 #include "AliITStrackSA.h"
28
29
30 ClassImp(AliITStrackSA)
31
32 //_____________________________________
33 AliITStrackSA:: AliITStrackSA() : AliITStrackMI(),
34 fNSA(0)
35 {
36 // Default constructor  
37   SetNumberOfClusters(0);
38   SetNumberOfClustersSA(0);
39   ResetIndexSA();
40   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){ 
41     SetNumberOfMarked(nlay,0);
42   }
43   ResetMarked();
44 }
45
46
47 //___________________________________________________
48 AliITStrackSA::AliITStrackSA(const AliITStrackMI& t) : 
49 AliITStrackMI(t),
50 fNSA(0){
51 // Copy a V2 track into a SA track
52   SetNumberOfClustersSA(0);
53   ResetIndexSA();
54   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){ 
55     SetNumberOfMarked(nlay,0);
56   }
57   ResetMarked();
58
59 }
60 //___________________________________________________
61 AliITStrackSA::AliITStrackSA(const AliITStrackSA& t) : 
62 AliITStrackMI(t),
63 fNSA(t.fNSA){
64 // Copy constructor
65
66
67   ResetIndexSA();
68   ResetMarked();
69   Int_t number = t.GetNumberOfClustersSA();
70   SetNumberOfClustersSA(number);
71   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){
72     SetNumberOfMarked(nlay,t.GetNumberOfMarked(nlay));
73   }
74   for(Int_t i=0;i<number;i++){
75     fSain[i]=t.fSain[i];
76   }
77   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){
78     for(Int_t i=0;i<t.GetNumberOfMarked(nlay);i++){
79       fCluMark[nlay][i]=t.fCluMark[nlay][i];
80     }
81   }
82 }
83 //____________________________________________________
84 AliITStrackSA::AliITStrackSA(Int_t layer, Int_t ladder, Int_t detector, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ):
85 fNSA(0) 
86 {
87   // standard constructor. Used for ITS standalone tracking
88
89   // get the azimuthal angle of the detector containing the innermost
90   // cluster of this track (data member fAlpha)
91
92   TGeoHMatrix m; AliITSgeomTGeo::GetOrigMatrix(layer,ladder,detector,m);
93   const TGeoHMatrix *tm=AliITSgeomTGeo::GetTracking2LocalMatrix(layer,ladder,detector);
94   m.Multiply(tm);
95   Double_t txyz[3]={0.}, xyz[3]={0.};
96   m.LocalToMaster(txyz,xyz);
97   Double_t sAlpha=TMath::ATan2(xyz[1],xyz[0]);
98
99   if (sAlpha<0) sAlpha+=TMath::TwoPi();
100   else if (sAlpha>=TMath::TwoPi()) sAlpha-=TMath::TwoPi();
101
102   Double_t sX=TMath::Sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
103
104   fdEdx = 0;
105
106   Double_t conv=GetBz()*kB2C;
107   Double_t sC[] = {0.000009, // 0.000009
108                    0.,
109                    0.000003, //0.000030
110                    0.,
111                    0.,
112                    0.000001, //0.000001
113                    0.,
114                    0.,
115                    0.,
116                    0.000002, //0.000002
117                    0.,
118                    0.,
119                    0.,
120                    0.,
121                    0.000001/(conv*conv)}; //0.0000001
122
123   Double_t sP[] = {Ycoor,
124                    Zcoor,
125                    TMath::Sin(phi-sAlpha),
126                    tanlambda,
127                    curv/conv};
128
129
130   // dealing with the case B=0 (taken from AliTPCtrack.cxx)
131   Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
132   Double_t p0=TMath::Sign(1/mostProbablePt,sP[4]);
133   Double_t w0=sC[14]/(sC[14] + p0*p0), w1=p0*p0/(sC[14] + p0*p0);
134   sP[4] = w0*p0 + w1*sP[4];
135   sC[14]*=w1;
136                                                                               
137   Set(sX,sAlpha,sP,sC);
138
139   for(Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fIndex[i] = 0;  // to be set explicitely
140
141   for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0; 
142
143   SetNumberOfClusters(0);
144   SetNumberOfClustersSA(0);
145   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++) SetNumberOfMarked(nlay,0);
146   ResetIndexSA();
147   ResetMarked();
148   SetChi2(0);
149   SetMass(0.139);    // pion mass
150   SetLabel(lab); 
151   
152 }
153
154 //____________________________________________________________
155 void AliITStrackSA::AddClusterSA(Int_t layer, Int_t clnumb) {
156   // add one clusters to the list (maximum number=fgkMaxNumberOfClusters)
157   Int_t presnum = GetNumberOfClustersSA();
158   if(presnum>=fgkMaxNumberOfClusters){
159     Warning("AddClusterSA","Maximum number of clusters already reached. Nothing is done\n");
160     return;
161   }
162
163   fSain[presnum] = (layer<<28)+clnumb;  
164   presnum++;
165   SetNumberOfClustersSA(presnum);
166 }
167
168 //____________________________________________________________
169 void AliITStrackSA::AddClusterMark(Int_t layer, Int_t clnumb) {
170   // add one clusters to the list (maximum number=fgkMaxNumberOfClusters)
171   Int_t presnum = GetNumberOfMarked(layer);
172   //  printf("presnum=%d\n",presnum);
173   if(presnum>=fgkMaxNumberOfClustersL){
174     Warning("AddClusterMark","Maximum number of clusters already reached. Nothing is done\n");
175     return;
176   }
177
178   fCluMark[layer][presnum] = clnumb;  
179   presnum++;
180   SetNumberOfMarked(layer,presnum);
181 }
182
183 //____________________________________________________________
184 void AliITStrackSA::AddClusterV2(Int_t layer,Int_t clnumb) {
185   // add one clusters to the list (maximum number=6)
186   Int_t presnum = GetNumberOfClusters();
187   if(presnum>=AliITSgeomTGeo::GetNLayers()){
188     Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
189     return;
190    }    
191
192   fIndex[presnum] = (layer<<28)+clnumb;  
193   presnum++;
194   SetNumberOfClusters(presnum);
195 }
196
197 //_____________________________________________________________
198 void AliITStrackSA::ResetMarked(){
199
200   //Reset array of marked clusters
201   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){
202     for(Int_t k=0; k<fgkMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
203   }
204 }
205