1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
19 //-----------------------------------------------------------------
20 // Implementation of the TPC seed class
21 // This class is used by the AliTPCtrackerMI class
22 // Origin: Marian Ivanov, CERN, Marian.Ivanov@cern.ch
23 //-----------------------------------------------------------------
24 #include "TClonesArray.h"
25 #include "AliTPCseed.h"
26 #include "AliTPCReconstructor.h"
32 AliTPCseed::AliTPCseed():
35 fClusterOwner(kFALSE),
41 fCurrentSigmaY2(1e10),
42 fCurrentSigmaZ2(1e10),
46 fCurrentClusterIndex1(-1),
61 for (Int_t i=0;i<160;i++) SetClusterIndex2(i,-3);
62 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
63 for (Int_t i=0;i<3;i++) fKinkIndexes[i]=0;
64 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0.2;
65 for (Int_t i=0;i<4;i++) {
70 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
71 // for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
72 //for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
73 fClusterMap.ResetAllBits(kFALSE);
74 fSharedMap.ResetAllBits(kFALSE);
78 AliTPCseed::AliTPCseed(const AliTPCseed &s, Bool_t clusterOwner):
81 fClusterOwner(clusterOwner),
87 fCurrentSigmaY2(1e10),
88 fCurrentSigmaZ2(1e10),
92 fCurrentClusterIndex1(-1),
103 fClusterMap(s.fClusterMap),
104 fSharedMap(s.fSharedMap)
106 //---------------------
107 // dummy copy constructor
108 //-------------------------
109 for (Int_t i=0;i<160;i++) {
110 fClusterPointer[i]=0;
112 if (s.fClusterPointer[i])
113 fClusterPointer[i] = new AliTPCclusterMI(*(s.fClusterPointer[i]));
115 fClusterPointer[i] = s.fClusterPointer[i];
117 fTrackPoints[i] = s.fTrackPoints[i];
119 for (Int_t i=0;i<160;i++) fIndex[i] = s.fIndex[i];
120 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=s.fTPCr[i];
121 for (Int_t i=0;i<4;i++) {
122 fDEDX[i] = s.fDEDX[i];
123 fSDEDX[i] = s.fSDEDX[i];
124 fNCDEDX[i] = s.fNCDEDX[i];
126 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = s.fOverlapLabels[i];
131 AliTPCseed::AliTPCseed(const AliTPCtrack &t):
134 fClusterOwner(kFALSE),
140 fCurrentSigmaY2(1e10),
141 fCurrentSigmaZ2(1e10),
144 fCurrentCluster(0x0),
145 fCurrentClusterIndex1(-1),
160 // Constructor from AliTPCtrack
163 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
164 for (Int_t i=0;i<160;i++) {
165 fClusterPointer[i] = 0;
166 Int_t index = t.GetClusterIndex(i);
168 SetClusterIndex2(i,index);
171 SetClusterIndex2(i,-3);
174 for (Int_t i=0;i<4;i++) {
179 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
181 //for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
182 //for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
183 fClusterMap.ResetAllBits(kFALSE);
184 fSharedMap.ResetAllBits(kFALSE);
188 AliTPCseed::AliTPCseed(Double_t xr, Double_t alpha, const Double_t xx[5],
189 const Double_t cc[15], Int_t index):
190 AliTPCtrack(xr, alpha, xx, cc, index),
192 fClusterOwner(kFALSE),
198 fCurrentSigmaY2(1e10),
199 fCurrentSigmaZ2(1e10),
202 fCurrentCluster(0x0),
203 fCurrentClusterIndex1(-1),
221 for (Int_t i=0;i<160;i++) SetClusterIndex2(i,-3);
222 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
223 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
224 for (Int_t i=0;i<4;i++) {
229 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
232 AliTPCseed::~AliTPCseed(){
235 if (fPoints) delete fPoints;
237 if (fEPoints) delete fEPoints;
241 for (Int_t icluster=0; icluster<160; icluster++){
242 delete fClusterPointer[icluster];
247 //_________________________________________________
248 AliTPCseed & AliTPCseed::operator=(const AliTPCseed ¶m)
251 // assignment operator
254 AliTPCtrack::operator=(param);
256 for(Int_t i = 0;i<160;++i)fClusterPointer[i] = param.fClusterPointer[i]; // this is not allocated by AliTPCSeed
257 fClusterOwner = param.fClusterOwner;
258 // leave out fPoint, they are also not copied in the copy ctor...
259 // but deleted in the dtor... strange...
263 fSector = param.fSector;
264 fRelativeSector = param.fRelativeSector;
265 fCurrentSigmaY2 = param.fCurrentSigmaY2;
266 fCurrentSigmaZ2 = param.fCurrentSigmaZ2;
267 fErrorY2 = param.fErrorY2;
268 fErrorZ2 = param.fErrorZ2;
269 fCurrentCluster = param.fCurrentCluster; // this is not allocated by AliTPCSeed
270 fCurrentClusterIndex1 = param.fCurrentClusterIndex1;
271 fInDead = param.fInDead;
272 fIsSeeding = param.fIsSeeding;
273 fNoCluster = param.fNoCluster;
275 fBSigned = param.fBSigned;
276 for(Int_t i = 0;i<4;++i){
277 fDEDX[i] = param.fDEDX[i];
278 fSDEDX[i] = param.fSDEDX[i];
279 fNCDEDX[i] = param.fNCDEDX[i];
281 for(Int_t i = 0;i<AliPID::kSPECIES;++i)fTPCr[i] = param.fTPCr[i];
283 fSeedType = param.fSeedType;
284 fSeed1 = param.fSeed1;
285 fSeed2 = param.fSeed2;
286 for(Int_t i = 0;i<12;++i)fOverlapLabels[i] = param.fOverlapLabels[i];
287 fMAngular = param.fMAngular;
288 fCircular = param.fCircular;
289 for(int i = 0;i<160;++i)fTrackPoints[i] = param.fTrackPoints[i];
290 fClusterMap = param.fClusterMap;
291 fSharedMap = param.fSharedMap;
295 //____________________________________________________
296 AliTPCTrackerPoint * AliTPCseed::GetTrackPoint(Int_t i)
300 return &fTrackPoints[i];
303 void AliTPCseed::RebuildSeed()
306 // rebuild seed to be ready for storing
307 AliTPCclusterMI cldummy;
309 AliTPCTrackPoint pdummy;
310 pdummy.GetTPoint().SetShared(10);
311 for (Int_t i=0;i<160;i++){
312 AliTPCclusterMI * cl0 = fClusterPointer[i];
313 AliTPCTrackPoint *trpoint = (AliTPCTrackPoint*)fPoints->UncheckedAt(i);
315 trpoint->GetTPoint() = *(GetTrackPoint(i));
316 trpoint->GetCPoint() = *cl0;
317 trpoint->GetCPoint().SetQ(TMath::Abs(cl0->GetQ()));
321 trpoint->GetCPoint()= cldummy;
329 Double_t AliTPCseed::GetDensityFirst(Int_t n)
333 // return cluster for n rows bellow first point
334 Int_t nfoundable = 1;
336 for (Int_t i=fLastPoint-1;i>0&&nfoundable<n; i--){
337 Int_t index = GetClusterIndex2(i);
338 if (index!=-1) nfoundable++;
339 if (index>0) nfound++;
341 if (nfoundable<n) return 0;
342 return Double_t(nfound)/Double_t(nfoundable);
347 void AliTPCseed::GetClusterStatistic(Int_t first, Int_t last, Int_t &found, Int_t &foundable, Int_t &shared, Bool_t plus2)
349 // get cluster stat. on given region
354 for (Int_t i=first;i<last; i++){
355 Int_t index = GetClusterIndex2(i);
356 if (index!=-1) foundable++;
357 if (index&0x8000) continue;
358 if (fClusterPointer[i]) {
364 if (fClusterPointer[i]->IsUsed(10)) {
368 if (!plus2) continue; //take also neighborhoud
370 if ( (i>0) && fClusterPointer[i-1]){
371 if (fClusterPointer[i-1]->IsUsed(10)) {
376 if ( fClusterPointer[i+1]){
377 if (fClusterPointer[i+1]->IsUsed(10)) {
385 //Error("AliTPCseed::GetClusterStatistic","problem\n");
393 void AliTPCseed::Reset(Bool_t all)
397 SetNumberOfClusters(0);
400 ResetCovariance(10.);
403 for (Int_t i=0;i<8;i++){
404 delete [] fTrackPoints[i];
412 for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
413 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
419 void AliTPCseed::Modify(Double_t factor)
422 //------------------------------------------------------------------
423 //This function makes a track forget its history :)
424 //------------------------------------------------------------------
426 ResetCovariance(10.);
429 ResetCovariance(factor);
431 SetNumberOfClusters(0);
435 fCurrentSigmaY2 = 0.000005;
436 fCurrentSigmaZ2 = 0.000005;
445 Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const
447 //-----------------------------------------------------------------
448 // This function find proloncation of a track to a reference plane x=xk.
449 // doesn't change internal state of the track
450 //-----------------------------------------------------------------
452 Double_t x1=GetX(), x2=x1+(xk-x1), dx=x2-x1;
454 if (TMath::Abs(GetSnp()+GetC()*dx) >= AliTPCReconstructor::GetMaxSnpTrack()) {
458 // Double_t y1=fP0, z1=fP1;
459 Double_t c1=GetSnp(), r1=sqrt(1.- c1*c1);
460 Double_t c2=c1 + GetC()*dx, r2=sqrt(1.- c2*c2);
464 //y += dx*(c1+c2)/(r1+r2);
465 //z += dx*(c1+c2)/(c1*r2 + c2*r1)*fP3;
467 Double_t dy = dx*(c1+c2)/(r1+r2);
470 Double_t delta = GetC()*dx*(c1+c2)/(c1*r2 + c2*r1);
472 if (TMath::Abs(delta)>0.0001){
473 dz = fP3*TMath::ASin(delta)/fP4;
475 dz = dx*fP3*(c1+c2)/(c1*r2 + c2*r1);
478 // dz = fP3*AliTPCFastMath::FastAsin(delta)/fP4;
479 dz = GetTgl()*TMath::ASin(delta)/GetC();
489 //_____________________________________________________________________________
490 Double_t AliTPCseed::GetPredictedChi2(const AliCluster *c) const
492 //-----------------------------------------------------------------
493 // This function calculates a predicted chi2 increment.
494 //-----------------------------------------------------------------
495 Double_t p[2]={c->GetY(), c->GetZ()};
496 Double_t cov[3]={fErrorY2, 0., fErrorZ2};
497 return AliExternalTrackParam::GetPredictedChi2(p,cov);
500 //_________________________________________________________________________________________
503 Int_t AliTPCseed::Compare(const TObject *o) const {
504 //-----------------------------------------------------------------
505 // This function compares tracks according to the sector - for given sector according z
506 //-----------------------------------------------------------------
507 AliTPCseed *t=(AliTPCseed*)o;
510 if (t->fRelativeSector>fRelativeSector) return -1;
511 if (t->fRelativeSector<fRelativeSector) return 1;
512 Double_t z2 = t->GetZ();
513 Double_t z1 = GetZ();
515 if (z2<z1) return -1;
520 f2 = 1-20*TMath::Sqrt(t->GetSigma1Pt2())/(t->OneOverPt()+0.0066);
521 if (t->fBConstrain) f2=1.2;
524 f1 = 1-20*TMath::Sqrt(GetSigma1Pt2())/(OneOverPt()+0.0066);
526 if (fBConstrain) f1=1.2;
528 if (t->GetNumberOfClusters()*f2 <GetNumberOfClusters()*f1) return -1;
536 //_____________________________________________________________________________
537 Bool_t AliTPCseed::Update(const AliCluster *c, Double_t chisq, Int_t /*index*/)
539 //-----------------------------------------------------------------
540 // This function associates a cluster with this track.
541 //-----------------------------------------------------------------
542 Double_t p[2]={c->GetY(), c->GetZ()};
543 Double_t cov[3]={fErrorY2, 0., fErrorZ2};
545 if (!AliExternalTrackParam::Update(p,cov)) return kFALSE;
547 Int_t n=GetNumberOfClusters();
549 SetNumberOfClusters(n+1);
550 SetChi2(GetChi2()+chisq);
557 //_____________________________________________________________________________
558 Float_t AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t onlyused) {
559 //-----------------------------------------------------------------
560 // This funtion calculates dE/dX within the "low" and "up" cuts.
561 //-----------------------------------------------------------------
564 Float_t angular[200];
568 // TClonesArray & arr = *fPoints;
569 Float_t meanlog = 100.;
571 Float_t mean[4] = {0,0,0,0};
572 Float_t sigma[4] = {1000,1000,1000,1000};
573 Int_t nc[4] = {0,0,0,0};
574 Float_t norm[4] = {1000,1000,1000,1000};
579 for (Int_t of =0; of<4; of++){
580 for (Int_t i=of+i1;i<i2;i+=4)
582 Int_t index = fIndex[i];
583 if (index<0||index&0x8000) continue;
585 //AliTPCTrackPoint * point = (AliTPCTrackPoint *) arr.At(i);
586 AliTPCTrackerPoint * point = GetTrackPoint(i);
587 //AliTPCTrackerPoint * pointm = GetTrackPoint(i-1);
588 //AliTPCTrackerPoint * pointp = 0;
589 //if (i<159) pointp = GetTrackPoint(i+1);
591 if (point==0) continue;
592 AliTPCclusterMI * cl = fClusterPointer[i];
594 if (onlyused && (!cl->IsUsed(10))) continue;
595 if (cl->IsUsed(11)) {
599 Int_t type = cl->GetType();
600 //if (point->fIsShared){
605 // if (pointm->fIsShared) continue;
607 // if (pointp->fIsShared) continue;
609 if (type<0) continue;
610 //if (type>10) continue;
611 //if (point->GetErrY()==0) continue;
612 //if (point->GetErrZ()==0) continue;
614 //Float_t ddy = (point->GetY()-cl->GetY())/point->GetErrY();
615 //Float_t ddz = (point->GetZ()-cl->GetZ())/point->GetErrZ();
616 //if ((ddy*ddy+ddz*ddz)>10) continue;
619 // if (point->GetCPoint().GetMax()<5) continue;
620 if (cl->GetMax()<5) continue;
621 Float_t angley = point->GetAngleY();
622 Float_t anglez = point->GetAngleZ();
624 Float_t rsigmay2 = point->GetSigmaY();
625 Float_t rsigmaz2 = point->GetSigmaZ();
629 rsigmay += pointm->GetTPoint().GetSigmaY();
630 rsigmaz += pointm->GetTPoint().GetSigmaZ();
634 rsigmay += pointp->GetTPoint().GetSigmaY();
635 rsigmaz += pointp->GetTPoint().GetSigmaZ();
642 Float_t rsigma = TMath::Sqrt(rsigmay2*rsigmaz2);
644 Float_t ampc = 0; // normalization to the number of electrons
646 // ampc = 1.*point->GetCPoint().GetMax();
647 ampc = 1.*cl->GetMax();
648 //ampc = 1.*point->GetCPoint().GetQ();
649 // AliTPCClusterPoint & p = point->GetCPoint();
650 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.6)) - TMath::Abs(p.GetY()/0.6)+0.5);
651 // Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
653 // TMath::Abs( Int_t(iz) - iz + 0.5);
654 //ampc *= 1.15*(1-0.3*dy);
655 //ampc *= 1.15*(1-0.3*dz);
656 // Float_t zfactor = (AliTPCReconstructor::GetCtgRange()-0.0004*TMath::Abs(point->GetCPoint().GetZ()));
660 //ampc = 1.0*point->GetCPoint().GetMax();
661 ampc = 1.0*cl->GetMax();
662 //ampc = 1.0*point->GetCPoint().GetQ();
663 //AliTPCClusterPoint & p = point->GetCPoint();
664 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.4)) - TMath::Abs(p.GetY()/0.4)+0.5);
665 //Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
667 // TMath::Abs( Int_t(iz) - iz + 0.5);
669 //ampc *= 1.15*(1-0.3*dy);
670 //ampc *= 1.15*(1-0.3*dz);
671 // Float_t zfactor = (1.02-0.000*TMath::Abs(point->GetCPoint().GetZ()));
675 ampc *= 2.0; // put mean value to channel 50
676 //ampc *= 0.58; // put mean value to channel 50
678 // if (type>0) w = 1./(type/2.-0.5);
679 // Float_t z = TMath::Abs(cl->GetZ());
682 //ampc /= (1+0.0008*z);
686 //ampc /= (1+0.0008*z);
688 //ampc /= (1+0.0008*z);
691 if (type<0) { //amp at the border - lower weight
696 if (rsigma>1.5) ampc/=1.3; // if big backround
698 angular[nc[of]] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
703 TMath::Sort(nc[of],amp,index,kFALSE);
707 //meanlog = amp[index[Int_t(nc[of]*0.33)]];
709 for (Int_t i=int(nc[of]*low+0.5);i<int(nc[of]*up+0.5);i++){
710 Float_t ampl = amp[index[i]]/angular[index[i]];
711 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
713 sumw += weight[index[i]];
714 sumamp += weight[index[i]]*ampl;
715 sumamp2 += weight[index[i]]*ampl*ampl;
716 norm[of] += angular[index[i]]*weight[index[i]];
723 mean[of] = sumamp/sumw;
724 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
726 sigma[of] = TMath::Sqrt(sigma[of]);
730 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
731 //mean *=(1-0.02*(sigma/(mean*0.17)-1.));
732 //mean *=(1-0.1*(norm-1.));
739 // mean[0]*= (1-0.05*(sigma[0]/(0.01+mean[1]*0.18)-1));
740 // mean[1]*= (1-0.05*(sigma[1]/(0.01+mean[0]*0.18)-1));
743 // dedx = (mean[0]* TMath::Sqrt((1.+nc[0]))+ mean[1]* TMath::Sqrt((1.+nc[1])) )/
744 // ( TMath::Sqrt((1.+nc[0]))+TMath::Sqrt((1.+nc[1])));
748 for (Int_t i =0;i<4;i++){
749 if (nc[i]>2&&nc[i]<1000){
750 dedx += mean[i] *nc[i];
751 fSdEdx += sigma[i]*(nc[i]-2);
752 fMAngular += norm[i] *nc[i];
757 fSDEDX[i] = sigma[i];
770 // Float_t dedx1 =dedx;
773 for (Int_t i =0;i<4;i++){
774 if (nc[i]>2&&nc[i]<1000){
775 mean[i] = mean[i]*(1-0.12*(sigma[i]/(fSdEdx)-1.));
776 dedx += mean[i] *nc[i];
787 Double_t AliTPCseed::Bethe(Double_t bg){
789 // This is the Bethe-Bloch function normalised to 1 at the minimum
794 bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
795 else // Density effect ( approximately :)
796 bethe=1.15*(1.+ bg2)/bg2*(log(3.5*5940*bg) - bg2/(1.+ bg2));
800 void AliTPCseed::CookPID()
803 // cook PID information according dEdx
805 Double_t fRange = 10.;
809 Int_t ns=AliPID::kSPECIES;
811 for (Int_t j=0; j<ns; j++) {
812 Double_t mass=AliPID::ParticleMass(j);
814 Double_t dedx=fdEdx/fMIP;
815 Double_t bethe=Bethe(mom/mass);
816 Double_t sigma=fRes*bethe;
818 if (TMath::Abs(dedx-bethe) > fRange*sigma) {
819 fTPCr[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
823 fTPCr[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
831 for (Int_t j=0; j<ns; j++) {
832 fTPCr[j]/=sumr; //normalize
837 void AliTPCseed::CookdEdx2(Double_t low, Double_t up) {
838 //-----------------------------------------------------------------
839 // This funtion calculates dE/dX within the "low" and "up" cuts.
840 //-----------------------------------------------------------------
843 Float_t angular[200];
847 for (Int_t i=0;i<200;i++) inlimit[i]=kFALSE;
848 for (Int_t i=0;i<200;i++) amp[i]=10000;
849 for (Int_t i=0;i<200;i++) angular[i]= 1;;
853 Float_t meanlog = 100.;
854 Int_t indexde[4]={0,64,128,160};
861 Float_t mean[4] = {0,0,0,0};
862 Float_t sigma[4] = {1000,1000,1000,1000};
863 Int_t nc[4] = {0,0,0,0};
864 Float_t norm[4] = {1000,1000,1000,1000};
869 // for (Int_t of =0; of<3; of++){
870 // for (Int_t i=indexde[of];i<indexde[of+1];i++)
871 for (Int_t i =0; i<160;i++)
873 AliTPCTrackPoint * point = GetTrackPoint(i);
874 if (point==0) continue;
875 if (point->fIsShared){
879 Int_t type = point->GetCPoint().GetType();
880 if (type<0) continue;
881 if (point->GetCPoint().GetMax()<5) continue;
882 Float_t angley = point->GetTPoint().GetAngleY();
883 Float_t anglez = point->GetTPoint().GetAngleZ();
884 Float_t rsigmay = point->GetCPoint().GetSigmaY();
885 Float_t rsigmaz = point->GetCPoint().GetSigmaZ();
886 Float_t rsigma = TMath::Sqrt(rsigmay*rsigmaz);
888 Float_t ampc = 0; // normalization to the number of electrons
890 ampc = point->GetCPoint().GetMax();
893 ampc = point->GetCPoint().GetMax();
895 ampc *= 2.0; // put mean value to channel 50
896 // ampc *= 0.565; // put mean value to channel 50
899 Float_t z = TMath::Abs(point->GetCPoint().GetZ());
906 if (type<0) { //amp at the border - lower weight
909 if (rsigma>1.5) ampc/=1.3; // if big backround
910 angular[i] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
911 amp[i] = ampc/angular[i];
916 TMath::Sort(159,amp,index,kFALSE);
917 for (Int_t i=int(anc*low+0.5);i<int(anc*up+0.5);i++){
918 inlimit[index[i]] = kTRUE; // take all clusters
921 // meanlog = amp[index[Int_t(anc*0.3)]];
923 for (Int_t of =0; of<3; of++){
927 for (Int_t i=indexde[of];i<indexde[of+1];i++)
929 if (inlimit[i]==kFALSE) continue;
930 Float_t ampl = amp[i];
932 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
935 sumamp += weight[i]*ampl;
936 sumamp2 += weight[i]*ampl*ampl;
937 norm[of] += angular[i]*weight[i];
945 mean[of] = sumamp/sumw;
946 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
948 sigma[of] = TMath::Sqrt(sigma[of]);
951 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
961 Float_t www[3] = {12.,14.,17.};
962 //Float_t www[3] = {1.,1.,1.};
964 for (Int_t i =0;i<3;i++){
965 if (nc[i]>2&&nc[i]<1000){
966 dedx += mean[i] *nc[i]*www[i]/sigma[i];
967 fSdEdx += sigma[i]*(nc[i]-2)*www[i]/sigma[i];
968 fMAngular += norm[i] *nc[i];
969 norm2 += nc[i]*www[i]/sigma[i];
970 norm3 += (nc[i]-2)*www[i]/sigma[i];
973 fSDEDX[i] = sigma[i];
986 // Float_t dedx1 =dedx;
990 for (Int_t i =0;i<3;i++){
991 if (nc[i]>2&&nc[i]<1000&&sigma[i]>3){
992 //mean[i] = mean[i]*(1+0.08*(sigma[i]/(fSdEdx)-1.));
993 dedx += mean[i] *(nc[i])/(sigma[i]);
994 norm4 += (nc[i])/(sigma[i]);
998 if (norm4>0) dedx /= norm4;
1008 Double_t AliTPCseed::GetYat(Double_t xk) const {
1009 //-----------------------------------------------------------------
1010 // This function calculates the Y-coordinate of a track at the plane x=xk.
1011 //-----------------------------------------------------------------
1012 if (TMath::Abs(GetSnp())>AliTPCReconstructor::GetMaxSnpTrack()) return 0.; //patch 01 jan 06
1013 Double_t c1=GetSnp(), r1=TMath::Sqrt(1.- c1*c1);
1014 Double_t c2=c1+GetC()*(xk-GetX());
1015 if (TMath::Abs(c2)>AliTPCReconstructor::GetMaxSnpTrack()) return 0;
1016 Double_t r2=TMath::Sqrt(1.- c2*c2);
1017 return GetY() + (xk-GetX())*(c1+c2)/(r1+r2);
1020 void AliTPCseed::SetClusterMapBit(int ibit, Bool_t state)
1022 fClusterMap[ibit] = state;
1024 Bool_t AliTPCseed::GetClusterMapBit(int ibit)
1026 return fClusterMap[ibit];
1028 void AliTPCseed::SetSharedMapBit(int ibit, Bool_t state)
1030 fSharedMap[ibit] = state;
1032 Bool_t AliTPCseed::GetSharedMapBit(int ibit)
1034 return fSharedMap[ibit];
1038 Float_t AliTPCseed::CookShape(Int_t type){
1042 //-----------------------------------------------------------------
1043 // This funtion calculates dE/dX within the "low" and "up" cuts.
1044 //-----------------------------------------------------------------
1047 for (Int_t i =0; i<160;i++) {
1048 AliTPCTrackerPoint * point = GetTrackPoint(i);
1049 if (point==0) continue;
1051 AliTPCclusterMI * cl = fClusterPointer[i];
1052 if (cl==0) continue;
1054 Float_t rsigmay = TMath::Sqrt(point->GetSigmaY());
1055 Float_t rsigmaz = TMath::Sqrt(point->GetSigmaZ());
1056 Float_t rsigma = (rsigmay+rsigmaz)*0.5;
1057 if (type==0) means+=rsigma;
1058 if (type==1) means+=rsigmay;
1059 if (type==2) means+=rsigmaz;
1062 Float_t mean = (meanc>0)? means/meanc:0;