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;
75 AliTPCseed::AliTPCseed(const AliTPCseed &s, Bool_t clusterOwner):
78 fClusterOwner(clusterOwner),
84 fCurrentSigmaY2(1e10),
85 fCurrentSigmaZ2(1e10),
89 fCurrentClusterIndex1(-1),
100 fClusterMap(s.fClusterMap),
101 fSharedMap(s.fSharedMap)
103 //---------------------
104 // dummy copy constructor
105 //-------------------------
106 for (Int_t i=0;i<160;i++) {
107 fClusterPointer[i]=0;
109 if (s.fClusterPointer[i])
110 fClusterPointer[i] = new AliTPCclusterMI(*(s.fClusterPointer[i]));
112 fClusterPointer[i] = s.fClusterPointer[i];
114 fTrackPoints[i] = s.fTrackPoints[i];
116 for (Int_t i=0;i<160;i++) fIndex[i] = s.fIndex[i];
117 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=s.fTPCr[i];
118 for (Int_t i=0;i<4;i++) {
119 fDEDX[i] = s.fDEDX[i];
120 fSDEDX[i] = s.fSDEDX[i];
121 fNCDEDX[i] = s.fNCDEDX[i];
123 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = s.fOverlapLabels[i];
128 AliTPCseed::AliTPCseed(const AliTPCtrack &t):
131 fClusterOwner(kFALSE),
137 fCurrentSigmaY2(1e10),
138 fCurrentSigmaZ2(1e10),
141 fCurrentCluster(0x0),
142 fCurrentClusterIndex1(-1),
157 // Constructor from AliTPCtrack
160 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
161 for (Int_t i=0;i<160;i++) {
162 fClusterPointer[i] = 0;
163 Int_t index = t.GetClusterIndex(i);
165 SetClusterIndex2(i,index);
168 SetClusterIndex2(i,-3);
171 for (Int_t i=0;i<4;i++) {
176 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
177 for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
178 for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
181 AliTPCseed::AliTPCseed(Double_t xr, Double_t alpha, const Double_t xx[5],
182 const Double_t cc[15], Int_t index):
183 AliTPCtrack(xr, alpha, xx, cc, index),
185 fClusterOwner(kFALSE),
191 fCurrentSigmaY2(1e10),
192 fCurrentSigmaZ2(1e10),
195 fCurrentCluster(0x0),
196 fCurrentClusterIndex1(-1),
214 for (Int_t i=0;i<160;i++) SetClusterIndex2(i,-3);
215 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
216 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
217 for (Int_t i=0;i<4;i++) {
222 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
225 AliTPCseed::~AliTPCseed(){
228 if (fPoints) delete fPoints;
230 if (fEPoints) delete fEPoints;
234 for (Int_t icluster=0; icluster<160; icluster++){
235 delete fClusterPointer[icluster];
238 for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
239 for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
241 //_________________________________________________
242 AliTPCseed & AliTPCseed::operator=(const AliTPCseed ¶m)
245 // assignment operator
248 AliTPCtrack::operator=(param);
250 for(Int_t i = 0;i<160;++i)fClusterPointer[i] = param.fClusterPointer[i]; // this is not allocated by AliTPCSeed
251 fClusterOwner = param.fClusterOwner;
252 // leave out fPoint, they are also not copied in the copy ctor...
253 // but deleted in the dtor... strange...
257 fSector = param.fSector;
258 fRelativeSector = param.fRelativeSector;
259 fCurrentSigmaY2 = param.fCurrentSigmaY2;
260 fCurrentSigmaZ2 = param.fCurrentSigmaZ2;
261 fErrorY2 = param.fErrorY2;
262 fErrorZ2 = param.fErrorZ2;
263 fCurrentCluster = param.fCurrentCluster; // this is not allocated by AliTPCSeed
264 fCurrentClusterIndex1 = param.fCurrentClusterIndex1;
265 fInDead = param.fInDead;
266 fIsSeeding = param.fIsSeeding;
267 fNoCluster = param.fNoCluster;
269 fBSigned = param.fBSigned;
270 for(Int_t i = 0;i<4;++i){
271 fDEDX[i] = param.fDEDX[i];
272 fSDEDX[i] = param.fSDEDX[i];
273 fNCDEDX[i] = param.fNCDEDX[i];
275 for(Int_t i = 0;i<AliPID::kSPECIES;++i)fTPCr[i] = param.fTPCr[i];
277 fSeedType = param.fSeedType;
278 fSeed1 = param.fSeed1;
279 fSeed2 = param.fSeed2;
280 for(Int_t i = 0;i<12;++i)fOverlapLabels[i] = param.fOverlapLabels[i];
281 fMAngular = param.fMAngular;
282 fCircular = param.fCircular;
283 for(int i = 0;i<160;++i)fTrackPoints[i] = param.fTrackPoints[i];
284 fClusterMap = param.fClusterMap;
285 fSharedMap = param.fSharedMap;
289 //____________________________________________________
290 AliTPCTrackerPoint * AliTPCseed::GetTrackPoint(Int_t i)
294 return &fTrackPoints[i];
297 void AliTPCseed::RebuildSeed()
300 // rebuild seed to be ready for storing
301 AliTPCclusterMI cldummy;
303 AliTPCTrackPoint pdummy;
304 pdummy.GetTPoint().SetShared(10);
305 for (Int_t i=0;i<160;i++){
306 AliTPCclusterMI * cl0 = fClusterPointer[i];
307 AliTPCTrackPoint *trpoint = (AliTPCTrackPoint*)fPoints->UncheckedAt(i);
309 trpoint->GetTPoint() = *(GetTrackPoint(i));
310 trpoint->GetCPoint() = *cl0;
311 trpoint->GetCPoint().SetQ(TMath::Abs(cl0->GetQ()));
315 trpoint->GetCPoint()= cldummy;
323 Double_t AliTPCseed::GetDensityFirst(Int_t n)
327 // return cluster for n rows bellow first point
328 Int_t nfoundable = 1;
330 for (Int_t i=fLastPoint-1;i>0&&nfoundable<n; i--){
331 Int_t index = GetClusterIndex2(i);
332 if (index!=-1) nfoundable++;
333 if (index>0) nfound++;
335 if (nfoundable<n) return 0;
336 return Double_t(nfound)/Double_t(nfoundable);
341 void AliTPCseed::GetClusterStatistic(Int_t first, Int_t last, Int_t &found, Int_t &foundable, Int_t &shared, Bool_t plus2)
343 // get cluster stat. on given region
348 for (Int_t i=first;i<last; i++){
349 Int_t index = GetClusterIndex2(i);
350 if (index!=-1) foundable++;
351 if (fClusterPointer[i]) {
357 if (fClusterPointer[i]->IsUsed(10)) {
361 if (!plus2) continue; //take also neighborhoud
363 if ( (i>0) && fClusterPointer[i-1]){
364 if (fClusterPointer[i-1]->IsUsed(10)) {
369 if ( fClusterPointer[i+1]){
370 if (fClusterPointer[i+1]->IsUsed(10)) {
378 //Error("AliTPCseed::GetClusterStatistic","problem\n");
386 void AliTPCseed::Reset(Bool_t all)
390 SetNumberOfClusters(0);
393 ResetCovariance(10.);
396 for (Int_t i=0;i<8;i++){
397 delete [] fTrackPoints[i];
405 for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
406 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
412 void AliTPCseed::Modify(Double_t factor)
415 //------------------------------------------------------------------
416 //This function makes a track forget its history :)
417 //------------------------------------------------------------------
419 ResetCovariance(10.);
422 ResetCovariance(factor);
424 SetNumberOfClusters(0);
428 fCurrentSigmaY2 = 0.000005;
429 fCurrentSigmaZ2 = 0.000005;
438 Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const
440 //-----------------------------------------------------------------
441 // This function find proloncation of a track to a reference plane x=xk.
442 // doesn't change internal state of the track
443 //-----------------------------------------------------------------
445 Double_t x1=GetX(), x2=x1+(xk-x1), dx=x2-x1;
447 if (TMath::Abs(GetSnp()+GetC()*dx) >= AliTPCReconstructor::GetMaxSnpTrack()) {
451 // Double_t y1=fP0, z1=fP1;
452 Double_t c1=GetSnp(), r1=sqrt(1.- c1*c1);
453 Double_t c2=c1 + GetC()*dx, r2=sqrt(1.- c2*c2);
457 //y += dx*(c1+c2)/(r1+r2);
458 //z += dx*(c1+c2)/(c1*r2 + c2*r1)*fP3;
460 Double_t dy = dx*(c1+c2)/(r1+r2);
463 Double_t delta = GetC()*dx*(c1+c2)/(c1*r2 + c2*r1);
465 if (TMath::Abs(delta)>0.0001){
466 dz = fP3*TMath::ASin(delta)/fP4;
468 dz = dx*fP3*(c1+c2)/(c1*r2 + c2*r1);
471 // dz = fP3*AliTPCFastMath::FastAsin(delta)/fP4;
472 dz = GetTgl()*TMath::ASin(delta)/GetC();
482 //_____________________________________________________________________________
483 Double_t AliTPCseed::GetPredictedChi2(const AliCluster *c) const
485 //-----------------------------------------------------------------
486 // This function calculates a predicted chi2 increment.
487 //-----------------------------------------------------------------
488 Double_t p[2]={c->GetY(), c->GetZ()};
489 Double_t cov[3]={fErrorY2, 0., fErrorZ2};
490 return AliExternalTrackParam::GetPredictedChi2(p,cov);
493 //_________________________________________________________________________________________
496 Int_t AliTPCseed::Compare(const TObject *o) const {
497 //-----------------------------------------------------------------
498 // This function compares tracks according to the sector - for given sector according z
499 //-----------------------------------------------------------------
500 AliTPCseed *t=(AliTPCseed*)o;
503 if (t->fRelativeSector>fRelativeSector) return -1;
504 if (t->fRelativeSector<fRelativeSector) return 1;
505 Double_t z2 = t->GetZ();
506 Double_t z1 = GetZ();
508 if (z2<z1) return -1;
513 f2 = 1-20*TMath::Sqrt(t->GetSigma1Pt2())/(t->OneOverPt()+0.0066);
514 if (t->fBConstrain) f2=1.2;
517 f1 = 1-20*TMath::Sqrt(GetSigma1Pt2())/(OneOverPt()+0.0066);
519 if (fBConstrain) f1=1.2;
521 if (t->GetNumberOfClusters()*f2 <GetNumberOfClusters()*f1) return -1;
529 //_____________________________________________________________________________
530 Bool_t AliTPCseed::Update(const AliCluster *c, Double_t chisq, Int_t /*index*/)
532 //-----------------------------------------------------------------
533 // This function associates a cluster with this track.
534 //-----------------------------------------------------------------
535 Double_t p[2]={c->GetY(), c->GetZ()};
536 Double_t cov[3]={fErrorY2, 0., fErrorZ2};
538 if (!AliExternalTrackParam::Update(p,cov)) return kFALSE;
540 Int_t n=GetNumberOfClusters();
542 SetNumberOfClusters(n+1);
543 SetChi2(GetChi2()+chisq);
550 //_____________________________________________________________________________
551 Float_t AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t onlyused) {
552 //-----------------------------------------------------------------
553 // This funtion calculates dE/dX within the "low" and "up" cuts.
554 //-----------------------------------------------------------------
557 Float_t angular[200];
561 // TClonesArray & arr = *fPoints;
562 Float_t meanlog = 100.;
564 Float_t mean[4] = {0,0,0,0};
565 Float_t sigma[4] = {1000,1000,1000,1000};
566 Int_t nc[4] = {0,0,0,0};
567 Float_t norm[4] = {1000,1000,1000,1000};
572 for (Int_t of =0; of<4; of++){
573 for (Int_t i=of+i1;i<i2;i+=4)
575 Int_t index = fIndex[i];
576 if (index<0||index&0x8000) continue;
578 //AliTPCTrackPoint * point = (AliTPCTrackPoint *) arr.At(i);
579 AliTPCTrackerPoint * point = GetTrackPoint(i);
580 //AliTPCTrackerPoint * pointm = GetTrackPoint(i-1);
581 //AliTPCTrackerPoint * pointp = 0;
582 //if (i<159) pointp = GetTrackPoint(i+1);
584 if (point==0) continue;
585 AliTPCclusterMI * cl = fClusterPointer[i];
587 if (onlyused && (!cl->IsUsed(10))) continue;
588 if (cl->IsUsed(11)) {
592 Int_t type = cl->GetType();
593 //if (point->fIsShared){
598 // if (pointm->fIsShared) continue;
600 // if (pointp->fIsShared) continue;
602 if (type<0) continue;
603 //if (type>10) continue;
604 //if (point->GetErrY()==0) continue;
605 //if (point->GetErrZ()==0) continue;
607 //Float_t ddy = (point->GetY()-cl->GetY())/point->GetErrY();
608 //Float_t ddz = (point->GetZ()-cl->GetZ())/point->GetErrZ();
609 //if ((ddy*ddy+ddz*ddz)>10) continue;
612 // if (point->GetCPoint().GetMax()<5) continue;
613 if (cl->GetMax()<5) continue;
614 Float_t angley = point->GetAngleY();
615 Float_t anglez = point->GetAngleZ();
617 Float_t rsigmay2 = point->GetSigmaY();
618 Float_t rsigmaz2 = point->GetSigmaZ();
622 rsigmay += pointm->GetTPoint().GetSigmaY();
623 rsigmaz += pointm->GetTPoint().GetSigmaZ();
627 rsigmay += pointp->GetTPoint().GetSigmaY();
628 rsigmaz += pointp->GetTPoint().GetSigmaZ();
635 Float_t rsigma = TMath::Sqrt(rsigmay2*rsigmaz2);
637 Float_t ampc = 0; // normalization to the number of electrons
639 // ampc = 1.*point->GetCPoint().GetMax();
640 ampc = 1.*cl->GetMax();
641 //ampc = 1.*point->GetCPoint().GetQ();
642 // AliTPCClusterPoint & p = point->GetCPoint();
643 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.6)) - TMath::Abs(p.GetY()/0.6)+0.5);
644 // Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
646 // TMath::Abs( Int_t(iz) - iz + 0.5);
647 //ampc *= 1.15*(1-0.3*dy);
648 //ampc *= 1.15*(1-0.3*dz);
649 // Float_t zfactor = (AliTPCReconstructor::GetCtgRange()-0.0004*TMath::Abs(point->GetCPoint().GetZ()));
653 //ampc = 1.0*point->GetCPoint().GetMax();
654 ampc = 1.0*cl->GetMax();
655 //ampc = 1.0*point->GetCPoint().GetQ();
656 //AliTPCClusterPoint & p = point->GetCPoint();
657 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.4)) - TMath::Abs(p.GetY()/0.4)+0.5);
658 //Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
660 // TMath::Abs( Int_t(iz) - iz + 0.5);
662 //ampc *= 1.15*(1-0.3*dy);
663 //ampc *= 1.15*(1-0.3*dz);
664 // Float_t zfactor = (1.02-0.000*TMath::Abs(point->GetCPoint().GetZ()));
668 ampc *= 2.0; // put mean value to channel 50
669 //ampc *= 0.58; // put mean value to channel 50
671 // if (type>0) w = 1./(type/2.-0.5);
672 // Float_t z = TMath::Abs(cl->GetZ());
675 //ampc /= (1+0.0008*z);
679 //ampc /= (1+0.0008*z);
681 //ampc /= (1+0.0008*z);
684 if (type<0) { //amp at the border - lower weight
689 if (rsigma>1.5) ampc/=1.3; // if big backround
691 angular[nc[of]] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
696 TMath::Sort(nc[of],amp,index,kFALSE);
700 //meanlog = amp[index[Int_t(nc[of]*0.33)]];
702 for (Int_t i=int(nc[of]*low+0.5);i<int(nc[of]*up+0.5);i++){
703 Float_t ampl = amp[index[i]]/angular[index[i]];
704 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
706 sumw += weight[index[i]];
707 sumamp += weight[index[i]]*ampl;
708 sumamp2 += weight[index[i]]*ampl*ampl;
709 norm[of] += angular[index[i]]*weight[index[i]];
716 mean[of] = sumamp/sumw;
717 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
719 sigma[of] = TMath::Sqrt(sigma[of]);
723 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
724 //mean *=(1-0.02*(sigma/(mean*0.17)-1.));
725 //mean *=(1-0.1*(norm-1.));
732 // mean[0]*= (1-0.05*(sigma[0]/(0.01+mean[1]*0.18)-1));
733 // mean[1]*= (1-0.05*(sigma[1]/(0.01+mean[0]*0.18)-1));
736 // dedx = (mean[0]* TMath::Sqrt((1.+nc[0]))+ mean[1]* TMath::Sqrt((1.+nc[1])) )/
737 // ( TMath::Sqrt((1.+nc[0]))+TMath::Sqrt((1.+nc[1])));
741 for (Int_t i =0;i<4;i++){
742 if (nc[i]>2&&nc[i]<1000){
743 dedx += mean[i] *nc[i];
744 fSdEdx += sigma[i]*(nc[i]-2);
745 fMAngular += norm[i] *nc[i];
750 fSDEDX[i] = sigma[i];
763 // Float_t dedx1 =dedx;
766 for (Int_t i =0;i<4;i++){
767 if (nc[i]>2&&nc[i]<1000){
768 mean[i] = mean[i]*(1-0.12*(sigma[i]/(fSdEdx)-1.));
769 dedx += mean[i] *nc[i];
780 Double_t AliTPCseed::Bethe(Double_t bg){
782 // This is the Bethe-Bloch function normalised to 1 at the minimum
787 bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
788 else // Density effect ( approximately :)
789 bethe=1.15*(1.+ bg2)/bg2*(log(3.5*5940*bg) - bg2/(1.+ bg2));
793 void AliTPCseed::CookPID()
796 // cook PID information according dEdx
798 Double_t fRange = 10.;
802 Int_t ns=AliPID::kSPECIES;
804 for (Int_t j=0; j<ns; j++) {
805 Double_t mass=AliPID::ParticleMass(j);
807 Double_t dedx=fdEdx/fMIP;
808 Double_t bethe=Bethe(mom/mass);
809 Double_t sigma=fRes*bethe;
811 if (TMath::Abs(dedx-bethe) > fRange*sigma) {
812 fTPCr[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
816 fTPCr[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
824 for (Int_t j=0; j<ns; j++) {
825 fTPCr[j]/=sumr; //normalize
830 void AliTPCseed::CookdEdx2(Double_t low, Double_t up) {
831 //-----------------------------------------------------------------
832 // This funtion calculates dE/dX within the "low" and "up" cuts.
833 //-----------------------------------------------------------------
836 Float_t angular[200];
840 for (Int_t i=0;i<200;i++) inlimit[i]=kFALSE;
841 for (Int_t i=0;i<200;i++) amp[i]=10000;
842 for (Int_t i=0;i<200;i++) angular[i]= 1;;
846 Float_t meanlog = 100.;
847 Int_t indexde[4]={0,64,128,160};
854 Float_t mean[4] = {0,0,0,0};
855 Float_t sigma[4] = {1000,1000,1000,1000};
856 Int_t nc[4] = {0,0,0,0};
857 Float_t norm[4] = {1000,1000,1000,1000};
862 // for (Int_t of =0; of<3; of++){
863 // for (Int_t i=indexde[of];i<indexde[of+1];i++)
864 for (Int_t i =0; i<160;i++)
866 AliTPCTrackPoint * point = GetTrackPoint(i);
867 if (point==0) continue;
868 if (point->fIsShared){
872 Int_t type = point->GetCPoint().GetType();
873 if (type<0) continue;
874 if (point->GetCPoint().GetMax()<5) continue;
875 Float_t angley = point->GetTPoint().GetAngleY();
876 Float_t anglez = point->GetTPoint().GetAngleZ();
877 Float_t rsigmay = point->GetCPoint().GetSigmaY();
878 Float_t rsigmaz = point->GetCPoint().GetSigmaZ();
879 Float_t rsigma = TMath::Sqrt(rsigmay*rsigmaz);
881 Float_t ampc = 0; // normalization to the number of electrons
883 ampc = point->GetCPoint().GetMax();
886 ampc = point->GetCPoint().GetMax();
888 ampc *= 2.0; // put mean value to channel 50
889 // ampc *= 0.565; // put mean value to channel 50
892 Float_t z = TMath::Abs(point->GetCPoint().GetZ());
899 if (type<0) { //amp at the border - lower weight
902 if (rsigma>1.5) ampc/=1.3; // if big backround
903 angular[i] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
904 amp[i] = ampc/angular[i];
909 TMath::Sort(159,amp,index,kFALSE);
910 for (Int_t i=int(anc*low+0.5);i<int(anc*up+0.5);i++){
911 inlimit[index[i]] = kTRUE; // take all clusters
914 // meanlog = amp[index[Int_t(anc*0.3)]];
916 for (Int_t of =0; of<3; of++){
920 for (Int_t i=indexde[of];i<indexde[of+1];i++)
922 if (inlimit[i]==kFALSE) continue;
923 Float_t ampl = amp[i];
925 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
928 sumamp += weight[i]*ampl;
929 sumamp2 += weight[i]*ampl*ampl;
930 norm[of] += angular[i]*weight[i];
938 mean[of] = sumamp/sumw;
939 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
941 sigma[of] = TMath::Sqrt(sigma[of]);
944 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
954 Float_t www[3] = {12.,14.,17.};
955 //Float_t www[3] = {1.,1.,1.};
957 for (Int_t i =0;i<3;i++){
958 if (nc[i]>2&&nc[i]<1000){
959 dedx += mean[i] *nc[i]*www[i]/sigma[i];
960 fSdEdx += sigma[i]*(nc[i]-2)*www[i]/sigma[i];
961 fMAngular += norm[i] *nc[i];
962 norm2 += nc[i]*www[i]/sigma[i];
963 norm3 += (nc[i]-2)*www[i]/sigma[i];
966 fSDEDX[i] = sigma[i];
979 // Float_t dedx1 =dedx;
983 for (Int_t i =0;i<3;i++){
984 if (nc[i]>2&&nc[i]<1000&&sigma[i]>3){
985 //mean[i] = mean[i]*(1+0.08*(sigma[i]/(fSdEdx)-1.));
986 dedx += mean[i] *(nc[i])/(sigma[i]);
987 norm4 += (nc[i])/(sigma[i]);
991 if (norm4>0) dedx /= norm4;
1001 Double_t AliTPCseed::GetYat(Double_t xk) const {
1002 //-----------------------------------------------------------------
1003 // This function calculates the Y-coordinate of a track at the plane x=xk.
1004 //-----------------------------------------------------------------
1005 if (TMath::Abs(GetSnp())>AliTPCReconstructor::GetMaxSnpTrack()) return 0.; //patch 01 jan 06
1006 Double_t c1=GetSnp(), r1=TMath::Sqrt(1.- c1*c1);
1007 Double_t c2=c1+GetC()*(xk-GetX());
1008 if (TMath::Abs(c2)>AliTPCReconstructor::GetMaxSnpTrack()) return 0;
1009 Double_t r2=TMath::Sqrt(1.- c2*c2);
1010 return GetY() + (xk-GetX())*(c1+c2)/(r1+r2);
1013 void AliTPCseed::SetClusterMapBit(int ibit, Bool_t state)
1015 fClusterMap[ibit] = state;
1017 Bool_t AliTPCseed::GetClusterMapBit(int ibit)
1019 return fClusterMap[ibit];
1021 void AliTPCseed::SetSharedMapBit(int ibit, Bool_t state)
1023 fSharedMap[ibit] = state;
1025 Bool_t AliTPCseed::GetSharedMapBit(int ibit)
1027 return fSharedMap[ibit];