1 /**************************************************************************
2 * Copyright(c) 1998-2003, 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 **************************************************************************/
17 ////////////////////////////////////////////////////////
18 // Stand alone track class UPGRADE //
19 // Authors: A.Mastroserio //
21 // annalisa.mastroserio@cern.ch //
22 // cristina.terrevoli@ba.infn.it //
23 ////////////////////////////////////////////////////////
25 #include "AliESDtrack.h"
26 #include "AliITStrackU.h"
27 #include "AliITSsegmentationUpgrade.cxx"
29 ClassImp(AliITStrackU)
31 //_____________________________________
32 AliITStrackU:: AliITStrackU() :
38 // Default constructor fgMaxNLayer
39 SetNumberOfClusters(0);
40 SetNumberOfClustersU(0);
42 for(Int_t nlay=0;nlay<fgMaxNLayer;nlay++){
44 fDy[nlay]=0; fDz[nlay]=0; fSigmaY[nlay]=0; fSigmaZ[nlay]=0; fSigmaYZ[nlay]=0;
46 fNy[nlay]=0; fNz[nlay]=0; fNormQ[nlay]=0; fNormChi2[nlay]=1000;
47 SetNumberOfMarked(nlay,0);
51 //_____________________________________
52 AliITStrackU:: AliITStrackU(Int_t nlay) :
59 SetNumberOfClusters(0);
60 SetNumberOfClustersU(0);
62 for(Int_t nl=0;nl<fgMaxNLayer;nl++){
64 fDy[nl]=0; fDz[nl]=0; fSigmaY[nl]=0; fSigmaZ[nl]=0; fSigmaYZ[nl]=0;
66 fNy[nl]=0; fNz[nl]=0; fNormQ[nl]=0; fNormChi2[nl]=1000;
67 SetNumberOfMarked(nl,0);
72 //_____________________________________________________
73 AliITStrackU::AliITStrackU(AliESDtrack& t,Bool_t c):
79 //------------------------------------------------------------------
80 // Copy a V2 track into a U track
82 //------------------------------------------------------------------
85 for(Int_t nlay=0;nlay<fgMaxNLayer;nlay++){
87 fDy[nlay]=0; fDz[nlay]=0; fSigmaY[nlay]=0; fSigmaZ[nlay]=0; fSigmaYZ[nlay]=0;
88 fClIndex[nlay]=-1; fNy[nlay]=0; fNz[nlay]=0; fNormQ[nlay]=0; fNormChi2[nlay]=1000;
91 //___________________________________________________
93 AliITStrackU::AliITStrackU(const AliITStrackU& t, Bool_t trackMI) :
103 Int_t number = t.GetNumberOfClustersU();
104 SetNumberOfClustersU(number);
105 for(Int_t lay=0;lay<fgMaxNLayer;lay++){
106 SetNumberOfMarked(lay,t.GetNumberOfMarked(lay));
108 for(Int_t i=0;i<number;i++){
111 for(Int_t nlay=0;nlay<fNLayers;nlay++){
112 for(Int_t i=0;i<t.GetNumberOfMarked(nlay);i++){
113 fCluMark[nlay][i]=t.fCluMark[nlay][i];
116 for(Int_t nlay=0;nlay<fgMaxNLayer;nlay++){
117 fNM[nlay]=t.fNM[nlay];
118 fDy[nlay]=t.fDy[nlay]; fDz[nlay]=t.fDz[nlay];
119 fSigmaY[nlay]=t.fSigmaY[nlay]; fSigmaZ[nlay]=t.fSigmaZ[nlay]; fSigmaYZ[nlay]=t.fSigmaYZ[nlay];
120 fClIndex[nlay]= t.fClIndex[nlay]; fNy[nlay]=t.fNy[nlay]; fNz[nlay]=t.fNz[nlay]; fNormQ[nlay]=t.fNormQ[nlay]; fNormChi2[nlay] = t.fNormChi2[nlay];
125 fFakeRatio = t.fFakeRatio;
127 // for(Int_t i=0; i<fgMaxNLayer; i++) {fDy[i]=t.fDy[i]; fDz[i]=t.fDz[i];
128 // fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i]; fSigmaYZ[i]=t.fSigmaYZ[i];
132 //____________________________________________________
133 AliITStrackU::AliITStrackU(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab, Int_t nlay ):
139 for(Int_t i=0; i<fgMaxNLayer; i++) { fClIndex[i]=-1; fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000; }
140 // standard constructor. Used for ITSUpgrade standalone tracking
142 // get the azimuthal angle of the detector containing the innermost
143 // cluster of this track (data member fAlpha)
144 for(Int_t i=0; i<fgMaxNLayer; i++) {fNM[i]=0;fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0;}
146 if (alpha<0) alpha+=TMath::TwoPi();
147 else if (alpha>=TMath::TwoPi()) alpha-=TMath::TwoPi();
148 Init(alpha,radius,Ycoor,Zcoor,phi,tanlambda,curv,lab/*,nlay*/);
150 //____________________________________________________
151 void AliITStrackU::Init(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab/*, Int_t nlay*/){
152 // initialize parameters
154 Double_t conv=GetBz()*kB2C;
155 Double_t sC[] = {0.000009, // 0.000009
169 0.000001/(conv*conv)}; //0.0000001
171 Double_t sP[] = {Ycoor,
173 TMath::Sin(phi-alpha),
178 // dealing with the case B=0 (taken from AliTPCtrack.cxx)
179 Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
180 Double_t p0=TMath::Sign(1/mostProbablePt,sP[4]);
181 Double_t w0=sC[14]/(sC[14] + p0*p0), w1=p0*p0/(sC[14] + p0*p0);
182 sP[4] = w0*p0 + w1*sP[4];
185 Set(radius,alpha,sP,sC);
187 for(Int_t i=0; i<fNLayers; i++) fIndex[i] = 0; // to be set explicitely
189 for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0;
191 SetNumberOfClusters(0);
192 SetNumberOfClustersU(0);
193 for(Int_t nl=0;nl<fNLayers;nl++) SetNumberOfMarked(nl,0);
197 SetMass(0.139); // pion mass
202 //____________________________________________________________
203 void AliITStrackU::AddClusterU(Int_t layer, Int_t clnumb) {
204 // add one clusters to the list (maximum number=kMaxNumberOfClusters)
205 Int_t presnum = GetNumberOfClustersU();
206 if(presnum>=kMaxNumberOfClusters){
207 Warning("AddClusterU","Maximum number of clusters already reached. Nothing is done\n");
211 fSain[presnum] = (layer<<28)+clnumb;
213 SetNumberOfClustersU(presnum);
216 //____________________________________________________________
217 void AliITStrackU::AddClusterMark(Int_t layer, Int_t clnumb) {
218 // add one clusters to the list (maximum number=kMaxNumberOfClusters)
219 Int_t presnum = GetNumberOfMarked(layer);
220 //printf("presnum=%d\n",presnum);
221 if(presnum>=kMaxNumberOfClustersL){
222 Warning("AddClusterMark","Maximum number of clusters already reached. Nothing is done\n");
226 fCluMark[layer][presnum] = clnumb;
228 SetNumberOfMarked(layer,presnum);
231 //____________________________________________________________
232 void AliITStrackU::AddClusterV2(Int_t layer,Int_t clnumb) {
233 // add one clusters to the list (maximum number=6)
234 Int_t presnum = GetNumberOfClusters();
235 if(presnum>=fNLayers){
236 Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
240 fIndex[presnum] = (layer<<28)+clnumb;
242 SetNumberOfClusters(presnum);
245 //_____________________________________________________________
246 void AliITStrackU::ResetMarked(){
248 //Reset array of marked clusters
249 for(Int_t nlay=0;nlay<fNLayers;nlay++){
250 for(Int_t k=0; k<kMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
253 //_____________________________________________________________
254 Double_t AliITStrackU::GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t covyz) const
256 //-----------------------------------------------------------------
257 // This function calculates a predicted chi2 increment.
258 //-----------------------------------------------------------------
259 Double_t p[2]={cy, cz};
260 Double_t cov[3]={cerry*cerry, covyz, cerrz*cerrz};
261 return AliExternalTrackParam::GetPredictedChi2(p,cov);
264 //____________________________________________________________________________
265 Bool_t AliITStrackU::UpdateMI(const AliCluster *c, Double_t chi2, Int_t index) {
266 //------------------------------------------------------------------
267 //This function updates track parameters
268 //------------------------------------------------------------------
269 Double_t dy=c->GetY() - GetY(), dz=c->GetZ() - GetZ();
270 Int_t layer = (index & 0xf0000000) >> 28;
273 fSigmaY[layer] = TMath::Sqrt(c->GetSigmaY2()+GetSigmaY2());
274 fSigmaZ[layer] = TMath::Sqrt(c->GetSigmaZ2()+GetSigmaZ2());
275 fSigmaYZ[layer] = c->GetSigmaYZ()+GetSigmaZY();
278 return Update(c,chi2,index);