]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackSA.cxx
No effective C++ option for compilation of C files
[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 "AliITSgeom.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<fgkLayers;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<fgkLayers;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<fgkLayers;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<fgkLayers;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(AliITSgeom* geom,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   if(!geom){
90     Fatal("AliITStrackSA","ITS geometry not found - Abort\n");
91     return;
92   }
93   // get the azimuthal angle of the detector containing the innermost
94   // cluster of this track (data member fAlpha)
95   Float_t rotmatr[9];
96   geom->GetRotMatrix(layer,ladder,detector,rotmatr);
97   Double_t sAlpha=TMath::ATan2(rotmatr[1],rotmatr[0])+TMath::Pi();
98   sAlpha+=TMath::Pi()/2.;
99   if(layer==1) sAlpha+=TMath::Pi();
100
101
102   // get the radius of this detector. Procedure taken from the 
103   // AliITStrackerV2 constructor
104   Float_t x=0,y=0,z=0;
105   geom->GetTrans(layer,ladder,detector,x,y,z);
106
107   Double_t fi=TMath::ATan2(rotmatr[1],rotmatr[0])+TMath::Pi();
108   fi+=TMath::Pi()/2;
109   if (layer==1) fi+=TMath::Pi();
110   Double_t cp=TMath::Cos(fi), sp=TMath::Sin(fi);
111   Double_t sX=x*cp+y*sp;
112
113
114   fdEdx = 0;
115
116   Double_t conv=GetBz()*kB2C;
117   Double_t sC[] = {0.000009, // 0.000009
118                    0.,
119                    0.000003, //0.000030
120                    0.,
121                    0.,
122                    0.000001, //0.000001
123                    0.,
124                    0.,
125                    0.,
126                    0.000002, //0.000002
127                    0.,
128                    0.,
129                    0.,
130                    0.,
131                    0.000001/(conv*conv)}; //0.0000001
132
133   Double_t sP[] = {Ycoor,
134                    Zcoor,
135                    TMath::Sin(phi-sAlpha),
136                    tanlambda,
137                    curv/conv};
138
139   Set(sX,sAlpha,sP,sC);
140
141   for(Int_t i=0; i<kMaxLayer; i++) fIndex[i] = 0;  // to be set explicitely
142
143   for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0; 
144
145   SetNumberOfClusters(0);
146   SetNumberOfClustersSA(0);
147   for(Int_t nlay=0;nlay<fgkLayers;nlay++) SetNumberOfMarked(nlay,0);
148   ResetIndexSA();
149   ResetMarked();
150   SetChi2(0);
151   SetMass(0.139);    // pion mass
152   SetLabel(lab); 
153   
154 }
155
156 //____________________________________________________________
157 void AliITStrackSA::AddClusterSA(Int_t layer, Int_t clnumb) {
158   // add one clusters to the list (maximum number=fgkMaxNumberOfClusters)
159   Int_t presnum = GetNumberOfClustersSA();
160   if(presnum>=fgkMaxNumberOfClusters){
161     Warning("AddClusterSA","Maximum number of clusters already reached. Nothing is done\n");
162     return;
163   }
164
165   fSain[presnum] = (layer<<28)+clnumb;  
166   presnum++;
167   SetNumberOfClustersSA(presnum);
168 }
169
170 //____________________________________________________________
171 void AliITStrackSA::AddClusterMark(Int_t layer, Int_t clnumb) {
172   // add one clusters to the list (maximum number=fgkMaxNumberOfClusters)
173   Int_t presnum = GetNumberOfMarked(layer);
174   //  printf("presnum=%d\n",presnum);
175   if(presnum>=fgkMaxNumberOfClustersL){
176     Warning("AddClusterMark","Maximum number of clusters already reached. Nothing is done\n");
177     return;
178   }
179
180   fCluMark[layer][presnum] = clnumb;  
181   presnum++;
182   SetNumberOfMarked(layer,presnum);
183 }
184
185 //____________________________________________________________
186 void AliITStrackSA::AddClusterV2(Int_t layer,Int_t clnumb) {
187   // add one clusters to the list (maximum number=6)
188   Int_t presnum = GetNumberOfClusters();
189   if(presnum>=kMaxLayer){
190     Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
191     return;
192    }    
193
194   fIndex[presnum] = (layer<<28)+clnumb;  
195   presnum++;
196   SetNumberOfClusters(presnum);
197 }
198
199 //_____________________________________________________________
200 void AliITStrackSA::ResetMarked(){
201
202   //Reset array of marked clusters
203   for(Int_t nlay=0;nlay<fgkLayers;nlay++){
204     for(Int_t k=0; k<fgkMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
205   }
206 }
207
208
209
210
211
212
213
214
215
216
217
218
219
220