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++){
43 fDy[nlay]=0; fDz[nlay]=0; fSigmaY[nlay]=0; fSigmaZ[nlay]=0; fSigmaYZ[nlay]=0;
45 fNy[nlay]=0; fNz[nlay]=0; fNormQ[nlay]=0; fNormChi2[nlay]=1000;
46 SetNumberOfMarked(nlay,0);
50 //_____________________________________
51 AliITStrackU:: AliITStrackU(Int_t nlay) :
58 SetNumberOfClusters(0);
59 SetNumberOfClustersU(0);
61 for(Int_t nl=0;nl<fgMaxNLayer;nl++){
62 fDy[nl]=0; fDz[nl]=0; fSigmaY[nl]=0; fSigmaZ[nl]=0; fSigmaYZ[nl]=0;
64 fNy[nl]=0; fNz[nl]=0; fNormQ[nl]=0; fNormChi2[nl]=1000;
65 SetNumberOfMarked(nl,0);
70 //_____________________________________________________
71 AliITStrackU::AliITStrackU(AliESDtrack& t,Bool_t c):
77 //------------------------------------------------------------------
78 // Copy a V2 track into a U track
80 //------------------------------------------------------------------
82 for(Int_t nlay=0;nlay<fgMaxNLayer;nlay++){
83 fDy[nlay]=0; fDz[nlay]=0; fSigmaY[nlay]=0; fSigmaZ[nlay]=0; fSigmaYZ[nlay]=0;
84 fClIndex[nlay]=-1; fNy[nlay]=0; fNz[nlay]=0; fNormQ[nlay]=0; fNormChi2[nlay]=1000;
87 //___________________________________________________
89 AliITStrackU::AliITStrackU(const AliITStrackU& t, Bool_t trackMI) :
99 Int_t number = t.GetNumberOfClustersU();
100 SetNumberOfClustersU(number);
101 for(Int_t lay=0;lay<fgMaxNLayer;lay++){
102 SetNumberOfMarked(lay,t.GetNumberOfMarked(lay));
104 for(Int_t i=0;i<number;i++){
107 for(Int_t nlay=0;nlay<fNLayers;nlay++){
108 for(Int_t i=0;i<t.GetNumberOfMarked(nlay);i++){
109 fCluMark[nlay][i]=t.fCluMark[nlay][i];
112 for(Int_t nlay=0;nlay<fgMaxNLayer;nlay++){
113 fDy[nlay]=t.fDy[nlay]; fDz[nlay]=t.fDz[nlay];
114 fSigmaY[nlay]=t.fSigmaY[nlay]; fSigmaZ[nlay]=t.fSigmaZ[nlay]; fSigmaYZ[nlay]=t.fSigmaYZ[nlay];
115 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];
120 fFakeRatio = t.fFakeRatio;
122 // for(Int_t i=0; i<fgMaxNLayer; i++) {fDy[i]=t.fDy[i]; fDz[i]=t.fDz[i];
123 // fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i]; fSigmaYZ[i]=t.fSigmaYZ[i];
126 //____________________________________________________
127 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 ):
133 for(Int_t i=0; i<fgMaxNLayer; i++) { fClIndex[i]=-1; fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000; }
134 // standard constructor. Used for ITSUpgrade standalone tracking
136 // get the azimuthal angle of the detector containing the innermost
137 // cluster of this track (data member fAlpha)
138 for(Int_t i=0; i<fgMaxNLayer; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0;}
140 if (alpha<0) alpha+=TMath::TwoPi();
141 else if (alpha>=TMath::TwoPi()) alpha-=TMath::TwoPi();
142 Init(alpha,radius,Ycoor,Zcoor,phi,tanlambda,curv,lab/*,nlay*/);
144 //____________________________________________________
145 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*/){
146 // initialize parameters
148 Double_t conv=GetBz()*kB2C;
149 Double_t sC[] = {0.000009, // 0.000009
163 0.000001/(conv*conv)}; //0.0000001
165 Double_t sP[] = {Ycoor,
167 TMath::Sin(phi-alpha),
172 // dealing with the case B=0 (taken from AliTPCtrack.cxx)
173 Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
174 Double_t p0=TMath::Sign(1/mostProbablePt,sP[4]);
175 Double_t w0=sC[14]/(sC[14] + p0*p0), w1=p0*p0/(sC[14] + p0*p0);
176 sP[4] = w0*p0 + w1*sP[4];
179 Set(radius,alpha,sP,sC);
181 for(Int_t i=0; i<fNLayers; i++) fIndex[i] = 0; // to be set explicitely
183 for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0;
185 SetNumberOfClusters(0);
186 SetNumberOfClustersU(0);
187 for(Int_t nl=0;nl<fNLayers;nl++) SetNumberOfMarked(nl,0);
191 SetMass(0.139); // pion mass
196 //____________________________________________________________
197 void AliITStrackU::AddClusterU(Int_t layer, Int_t clnumb) {
198 // add one clusters to the list (maximum number=kMaxNumberOfClusters)
199 Int_t presnum = GetNumberOfClustersU();
200 if(presnum>=kMaxNumberOfClusters){
201 Warning("AddClusterU","Maximum number of clusters already reached. Nothing is done\n");
205 fSain[presnum] = (layer<<28)+clnumb;
207 SetNumberOfClustersU(presnum);
210 //____________________________________________________________
211 void AliITStrackU::AddClusterMark(Int_t layer, Int_t clnumb) {
212 // add one clusters to the list (maximum number=kMaxNumberOfClusters)
213 Int_t presnum = GetNumberOfMarked(layer);
214 //printf("presnum=%d\n",presnum);
215 if(presnum>=kMaxNumberOfClustersL){
216 Warning("AddClusterMark","Maximum number of clusters already reached. Nothing is done\n");
220 fCluMark[layer][presnum] = clnumb;
222 SetNumberOfMarked(layer,presnum);
225 //____________________________________________________________
226 void AliITStrackU::AddClusterV2(Int_t layer,Int_t clnumb) {
227 // add one clusters to the list (maximum number=6)
228 Int_t presnum = GetNumberOfClusters();
229 if(presnum>=fNLayers){
230 Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
234 fIndex[presnum] = (layer<<28)+clnumb;
236 SetNumberOfClusters(presnum);
239 //_____________________________________________________________
240 void AliITStrackU::ResetMarked(){
242 //Reset array of marked clusters
243 for(Int_t nlay=0;nlay<fNLayers;nlay++){
244 for(Int_t k=0; k<kMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
247 //_____________________________________________________________
248 Double_t AliITStrackU::GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t covyz) const
250 //-----------------------------------------------------------------
251 // This function calculates a predicted chi2 increment.
252 //-----------------------------------------------------------------
253 Double_t p[2]={cy, cz};
254 Double_t cov[3]={cerry*cerry, covyz, cerrz*cerrz};
255 return AliExternalTrackParam::GetPredictedChi2(p,cov);
258 //____________________________________________________________________________
259 Bool_t AliITStrackU::UpdateMI(const AliCluster *c, Double_t chi2, Int_t index) {
260 //------------------------------------------------------------------
261 //This function updates track parameters
262 //------------------------------------------------------------------
263 Double_t dy=c->GetY() - GetY(), dz=c->GetZ() - GetZ();
264 Int_t layer = (index & 0xf0000000) >> 28;
267 fSigmaY[layer] = TMath::Sqrt(c->GetSigmaY2()+GetSigmaY2());
268 fSigmaZ[layer] = TMath::Sqrt(c->GetSigmaZ2()+GetSigmaZ2());
269 fSigmaYZ[layer] = c->GetSigmaYZ()+GetSigmaZY();
272 return Update(c,chi2,index);