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),
59 for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
60 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
61 for (Int_t i=0;i<3;i++) fKinkIndexes[i]=0;
62 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0.2;
63 for (Int_t i=0;i<4;i++) {
68 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
71 AliTPCseed::AliTPCseed(const AliTPCseed &s, Bool_t clusterOwner):
74 fClusterOwner(clusterOwner),
80 fCurrentSigmaY2(1e10),
81 fCurrentSigmaZ2(1e10),
85 fCurrentClusterIndex1(-1),
97 //---------------------
98 // dummy copy constructor
99 //-------------------------
100 for (Int_t i=0;i<160;i++) {
101 fClusterPointer[i]=0;
103 if (s.fClusterPointer[i])
104 fClusterPointer[i] = new AliTPCclusterMI(*(s.fClusterPointer[i]));
106 fClusterPointer[i] = s.fClusterPointer[i];
108 fTrackPoints[i] = s.fTrackPoints[i];
110 for (Int_t i=0;i<160;i++) fIndex[i] = s.fIndex[i];
112 AliTPCseed::AliTPCseed(const AliTPCtrack &t):
115 fClusterOwner(kFALSE),
121 fCurrentSigmaY2(1e10),
122 fCurrentSigmaZ2(1e10),
125 fCurrentCluster(0x0),
126 fCurrentClusterIndex1(-1),
139 // Constructor from AliTPCtrack
142 for (Int_t i=0;i<3;i++) fKinkIndexes[i]=t.GetKinkIndex(i);
143 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
144 for (Int_t i=0;i<160;i++) {
145 fClusterPointer[i] = 0;
146 Int_t index = t.GetClusterIndex(i);
148 SetClusterIndex2(i,index);
151 SetClusterIndex2(i,-3);
154 for (Int_t i=0;i<4;i++) {
159 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
162 AliTPCseed::AliTPCseed(UInt_t index, const Double_t xx[5],
163 const Double_t cc[15],
164 Double_t xr, Double_t alpha):
165 AliTPCtrack(index, xx, cc, xr, alpha),
167 fClusterOwner(kFALSE),
173 fCurrentSigmaY2(1e10),
174 fCurrentSigmaZ2(1e10),
177 fCurrentCluster(0x0),
178 fCurrentClusterIndex1(-1),
194 for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
195 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
196 for (Int_t i=0;i<3;i++) fKinkIndexes[i]=0;
197 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
198 for (Int_t i=0;i<4;i++) {
203 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
206 AliTPCseed::~AliTPCseed(){
209 if (fPoints) delete fPoints;
211 if (fEPoints) delete fEPoints;
215 for (Int_t icluster=0; icluster<160; icluster++){
216 delete fClusterPointer[icluster];
221 AliTPCTrackerPoint * AliTPCseed::GetTrackPoint(Int_t i)
225 return &fTrackPoints[i];
228 void AliTPCseed::RebuildSeed()
231 // rebuild seed to be ready for storing
232 AliTPCclusterMI cldummy;
234 AliTPCTrackPoint pdummy;
235 pdummy.GetTPoint().fIsShared = 10;
236 for (Int_t i=0;i<160;i++){
237 AliTPCclusterMI * cl0 = fClusterPointer[i];
238 AliTPCTrackPoint *trpoint = (AliTPCTrackPoint*)fPoints->UncheckedAt(i);
240 trpoint->GetTPoint() = *(GetTrackPoint(i));
241 trpoint->GetCPoint() = *cl0;
242 trpoint->GetCPoint().SetQ(TMath::Abs(cl0->GetQ()));
246 trpoint->GetCPoint()= cldummy;
254 Double_t AliTPCseed::GetDensityFirst(Int_t n)
258 // return cluster for n rows bellow first point
259 Int_t nfoundable = 1;
261 for (Int_t i=fLastPoint-1;i>0&&nfoundable<n; i--){
262 Int_t index = GetClusterIndex2(i);
263 if (index!=-1) nfoundable++;
264 if (index>0) nfound++;
266 if (nfoundable<n) return 0;
267 return Double_t(nfound)/Double_t(nfoundable);
272 void AliTPCseed::GetClusterStatistic(Int_t first, Int_t last, Int_t &found, Int_t &foundable, Int_t &shared, Bool_t plus2)
274 // get cluster stat. on given region
279 for (Int_t i=first;i<last; i++){
280 Int_t index = GetClusterIndex2(i);
281 if (index!=-1) foundable++;
282 if (fClusterPointer[i]) {
288 if (fClusterPointer[i]->IsUsed(10)) {
292 if (!plus2) continue; //take also neighborhoud
294 if ( (i>0) && fClusterPointer[i-1]){
295 if (fClusterPointer[i-1]->IsUsed(10)) {
300 if ( fClusterPointer[i+1]){
301 if (fClusterPointer[i+1]->IsUsed(10)) {
309 //Error("AliTPCseed::GetClusterStatistic","problem\n");
317 void AliTPCseed::Reset(Bool_t all)
321 SetNumberOfClusters(0);
327 for (Int_t i=0;i<8;i++){
328 delete [] fTrackPoints[i];
336 for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
337 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
343 void AliTPCseed::Modify(Double_t factor)
346 //------------------------------------------------------------------
347 //This function makes a track forget its history :)
348 //------------------------------------------------------------------
354 fC10*=0; fC11*=factor;
355 fC20*=0; fC21*=0; fC22*=factor;
356 fC30*=0; fC31*=0; fC32*=0; fC33*=factor;
357 fC40*=0; fC41*=0; fC42*=0; fC43*=0; fC44*=factor;
358 SetNumberOfClusters(0);
362 fCurrentSigmaY2 = 0.000005;
363 fCurrentSigmaZ2 = 0.000005;
372 Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const
374 //-----------------------------------------------------------------
375 // This function find proloncation of a track to a reference plane x=xk.
376 // doesn't change internal state of the track
377 //-----------------------------------------------------------------
379 Double_t x1=fX, x2=x1+(xk-x1), dx=x2-x1;
381 if (TMath::Abs(fP4*xk - fP2) >= AliTPCReconstructor::GetMaxSnpTrack()) {
385 // Double_t y1=fP0, z1=fP1;
386 Double_t c1=fP4*x1 - fP2, r1=sqrt(1.- c1*c1);
387 Double_t c2=fP4*x2 - fP2, r2=sqrt(1.- c2*c2);
391 //y += dx*(c1+c2)/(r1+r2);
392 //z += dx*(c1+c2)/(c1*r2 + c2*r1)*fP3;
394 Double_t dy = dx*(c1+c2)/(r1+r2);
397 Double_t delta = fP4*dx*(c1+c2)/(c1*r2 + c2*r1);
399 if (TMath::Abs(delta)>0.0001){
400 dz = fP3*TMath::ASin(delta)/fP4;
402 dz = dx*fP3*(c1+c2)/(c1*r2 + c2*r1);
405 // dz = fP3*AliTPCFastMath::FastAsin(delta)/fP4;
406 dz = fP3*TMath::ASin(delta)/fP4;
416 //_____________________________________________________________________________
417 Double_t AliTPCseed::GetPredictedChi2(const AliCluster *c) const
419 //-----------------------------------------------------------------
420 // This function calculates a predicted chi2 increment.
421 //-----------------------------------------------------------------
422 //Double_t r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2();
423 Double_t r00=fErrorY2, r01=0., r11=fErrorZ2;
424 r00+=fC00; r01+=fC10; r11+=fC11;
426 Double_t det=r00*r11 - r01*r01;
427 if (TMath::Abs(det) < 1.e-10) {
428 //Int_t n=GetNumberOfClusters();
429 //if (n>4) cerr<<n<<" AliKalmanTrack warning: Singular matrix !\n";
432 Double_t tmp=r00; r00=r11; r11=tmp; r01=-r01;
434 Double_t dy=c->GetY() - fP0, dz=c->GetZ() - fP1;
436 return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det;
440 //_________________________________________________________________________________________
443 Int_t AliTPCseed::Compare(const TObject *o) const {
444 //-----------------------------------------------------------------
445 // This function compares tracks according to the sector - for given sector according z
446 //-----------------------------------------------------------------
447 AliTPCseed *t=(AliTPCseed*)o;
450 if (t->fRelativeSector>fRelativeSector) return -1;
451 if (t->fRelativeSector<fRelativeSector) return 1;
452 Double_t z2 = t->GetZ();
453 Double_t z1 = GetZ();
455 if (z2<z1) return -1;
460 f2 = 1-20*TMath::Sqrt(t->fC44)/(TMath::Abs(t->GetC())+0.0066);
461 if (t->fBConstrain) f2=1.2;
464 f1 = 1-20*TMath::Sqrt(fC44)/(TMath::Abs(GetC())+0.0066);
466 if (fBConstrain) f1=1.2;
468 if (t->GetNumberOfClusters()*f2 <GetNumberOfClusters()*f1) return -1;
476 //_____________________________________________________________________________
477 Int_t AliTPCseed::Update(const AliCluster *c, Double_t chisq, UInt_t /*index*/) {
478 //-----------------------------------------------------------------
479 // This function associates a cluster with this track.
480 //-----------------------------------------------------------------
481 Double_t r00=fErrorY2, r01=0., r11=fErrorZ2;
483 r00+=fC00; r01+=fC10; r11+=fC11;
484 Double_t det=r00*r11 - r01*r01;
485 Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det;
487 Double_t k00=fC00*r00+fC10*r01, k01=fC00*r01+fC10*r11;
488 Double_t k10=fC10*r00+fC11*r01, k11=fC10*r01+fC11*r11;
489 Double_t k20=fC20*r00+fC21*r01, k21=fC20*r01+fC21*r11;
490 Double_t k30=fC30*r00+fC31*r01, k31=fC30*r01+fC31*r11;
491 Double_t k40=fC40*r00+fC41*r01, k41=fC40*r01+fC41*r11;
493 Double_t dy=c->GetY() - fP0, dz=c->GetZ() - fP1;
494 Double_t cur=fP4 + k40*dy + k41*dz, eta=fP2 + k20*dy + k21*dz;
495 if (TMath::Abs(cur*fX-eta) >= AliTPCReconstructor::GetMaxSnpTrack()) {
499 fP0 += k00*dy + k01*dz;
500 fP1 += k10*dy + k11*dz;
502 fP3 += k30*dy + k31*dz;
505 Double_t c01=fC10, c02=fC20, c03=fC30, c04=fC40;
506 Double_t c12=fC21, c13=fC31, c14=fC41;
508 fC00-=k00*fC00+k01*fC10; fC10-=k00*c01+k01*fC11;
509 fC20-=k00*c02+k01*c12; fC30-=k00*c03+k01*c13;
510 fC40-=k00*c04+k01*c14;
512 fC11-=k10*c01+k11*fC11;
513 fC21-=k10*c02+k11*c12; fC31-=k10*c03+k11*c13;
514 fC41-=k10*c04+k11*c14;
516 fC22-=k20*c02+k21*c12; fC32-=k20*c03+k21*c13;
517 fC42-=k20*c04+k21*c14;
519 fC33-=k30*c03+k31*c13;
520 fC43-=k40*c03+k41*c13;
522 fC44-=k40*c04+k41*c14;
524 Int_t n=GetNumberOfClusters();
526 SetNumberOfClusters(n+1);
527 SetChi2(GetChi2()+chisq);
534 //_____________________________________________________________________________
535 Float_t AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t onlyused) {
536 //-----------------------------------------------------------------
537 // This funtion calculates dE/dX within the "low" and "up" cuts.
538 //-----------------------------------------------------------------
541 Float_t angular[200];
545 // TClonesArray & arr = *fPoints;
546 Float_t meanlog = 100.;
548 Float_t mean[4] = {0,0,0,0};
549 Float_t sigma[4] = {1000,1000,1000,1000};
550 Int_t nc[4] = {0,0,0,0};
551 Float_t norm[4] = {1000,1000,1000,1000};
556 for (Int_t of =0; of<4; of++){
557 for (Int_t i=of+i1;i<i2;i+=4)
559 Int_t index = fIndex[i];
560 if (index<0||index&0x8000) continue;
562 //AliTPCTrackPoint * point = (AliTPCTrackPoint *) arr.At(i);
563 AliTPCTrackerPoint * point = GetTrackPoint(i);
564 //AliTPCTrackerPoint * pointm = GetTrackPoint(i-1);
565 //AliTPCTrackerPoint * pointp = 0;
566 //if (i<159) pointp = GetTrackPoint(i+1);
568 if (point==0) continue;
569 AliTPCclusterMI * cl = fClusterPointer[i];
571 if (onlyused && (!cl->IsUsed(10))) continue;
572 if (cl->IsUsed(11)) {
576 Int_t type = cl->GetType();
577 //if (point->fIsShared){
582 // if (pointm->fIsShared) continue;
584 // if (pointp->fIsShared) continue;
586 if (type<0) continue;
587 //if (type>10) continue;
588 //if (point->GetErrY()==0) continue;
589 //if (point->GetErrZ()==0) continue;
591 //Float_t ddy = (point->GetY()-cl->GetY())/point->GetErrY();
592 //Float_t ddz = (point->GetZ()-cl->GetZ())/point->GetErrZ();
593 //if ((ddy*ddy+ddz*ddz)>10) continue;
596 // if (point->GetCPoint().GetMax()<5) continue;
597 if (cl->GetMax()<5) continue;
598 Float_t angley = point->GetAngleY();
599 Float_t anglez = point->GetAngleZ();
601 Float_t rsigmay2 = point->GetSigmaY();
602 Float_t rsigmaz2 = point->GetSigmaZ();
606 rsigmay += pointm->GetTPoint().GetSigmaY();
607 rsigmaz += pointm->GetTPoint().GetSigmaZ();
611 rsigmay += pointp->GetTPoint().GetSigmaY();
612 rsigmaz += pointp->GetTPoint().GetSigmaZ();
619 Float_t rsigma = TMath::Sqrt(rsigmay2*rsigmaz2);
621 Float_t ampc = 0; // normalization to the number of electrons
623 // ampc = 1.*point->GetCPoint().GetMax();
624 ampc = 1.*cl->GetMax();
625 //ampc = 1.*point->GetCPoint().GetQ();
626 // AliTPCClusterPoint & p = point->GetCPoint();
627 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.6)) - TMath::Abs(p.GetY()/0.6)+0.5);
628 // Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
630 // TMath::Abs( Int_t(iz) - iz + 0.5);
631 //ampc *= 1.15*(1-0.3*dy);
632 //ampc *= 1.15*(1-0.3*dz);
633 // Float_t zfactor = (AliTPCReconstructor::GetCtgRange()-0.0004*TMath::Abs(point->GetCPoint().GetZ()));
637 //ampc = 1.0*point->GetCPoint().GetMax();
638 ampc = 1.0*cl->GetMax();
639 //ampc = 1.0*point->GetCPoint().GetQ();
640 //AliTPCClusterPoint & p = point->GetCPoint();
641 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.4)) - TMath::Abs(p.GetY()/0.4)+0.5);
642 //Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
644 // TMath::Abs( Int_t(iz) - iz + 0.5);
646 //ampc *= 1.15*(1-0.3*dy);
647 //ampc *= 1.15*(1-0.3*dz);
648 // Float_t zfactor = (1.02-0.000*TMath::Abs(point->GetCPoint().GetZ()));
652 ampc *= 2.0; // put mean value to channel 50
653 //ampc *= 0.58; // put mean value to channel 50
655 // if (type>0) w = 1./(type/2.-0.5);
656 // Float_t z = TMath::Abs(cl->GetZ());
659 //ampc /= (1+0.0008*z);
663 //ampc /= (1+0.0008*z);
665 //ampc /= (1+0.0008*z);
668 if (type<0) { //amp at the border - lower weight
673 if (rsigma>1.5) ampc/=1.3; // if big backround
675 angular[nc[of]] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
680 TMath::Sort(nc[of],amp,index,kFALSE);
684 //meanlog = amp[index[Int_t(nc[of]*0.33)]];
686 for (Int_t i=int(nc[of]*low+0.5);i<int(nc[of]*up+0.5);i++){
687 Float_t ampl = amp[index[i]]/angular[index[i]];
688 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
690 sumw += weight[index[i]];
691 sumamp += weight[index[i]]*ampl;
692 sumamp2 += weight[index[i]]*ampl*ampl;
693 norm[of] += angular[index[i]]*weight[index[i]];
700 mean[of] = sumamp/sumw;
701 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
703 sigma[of] = TMath::Sqrt(sigma[of]);
707 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
708 //mean *=(1-0.02*(sigma/(mean*0.17)-1.));
709 //mean *=(1-0.1*(norm-1.));
716 // mean[0]*= (1-0.05*(sigma[0]/(0.01+mean[1]*0.18)-1));
717 // mean[1]*= (1-0.05*(sigma[1]/(0.01+mean[0]*0.18)-1));
720 // dedx = (mean[0]* TMath::Sqrt((1.+nc[0]))+ mean[1]* TMath::Sqrt((1.+nc[1])) )/
721 // ( TMath::Sqrt((1.+nc[0]))+TMath::Sqrt((1.+nc[1])));
725 for (Int_t i =0;i<4;i++){
726 if (nc[i]>2&&nc[i]<1000){
727 dedx += mean[i] *nc[i];
728 fSdEdx += sigma[i]*(nc[i]-2);
729 fMAngular += norm[i] *nc[i];
734 fSDEDX[i] = sigma[i];
747 // Float_t dedx1 =dedx;
750 for (Int_t i =0;i<4;i++){
751 if (nc[i]>2&&nc[i]<1000){
752 mean[i] = mean[i]*(1-0.12*(sigma[i]/(fSdEdx)-1.));
753 dedx += mean[i] *nc[i];
764 Double_t AliTPCseed::Bethe(Double_t bg){
766 // This is the Bethe-Bloch function normalised to 1 at the minimum
771 bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
772 else // Density effect ( approximately :)
773 bethe=1.15*(1.+ bg2)/bg2*(log(3.5*5940*bg) - bg2/(1.+ bg2));
777 void AliTPCseed::CookPID()
780 // cook PID information according dEdx
782 Double_t fRange = 10.;
786 Int_t ns=AliPID::kSPECIES;
788 for (Int_t j=0; j<ns; j++) {
789 Double_t mass=AliPID::ParticleMass(j);
791 Double_t dedx=fdEdx/fMIP;
792 Double_t bethe=Bethe(mom/mass);
793 Double_t sigma=fRes*bethe;
795 if (TMath::Abs(dedx-bethe) > fRange*sigma) {
796 fTPCr[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
800 fTPCr[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
808 for (Int_t j=0; j<ns; j++) {
809 fTPCr[j]/=sumr; //normalize
814 void AliTPCseed::CookdEdx2(Double_t low, Double_t up) {
815 //-----------------------------------------------------------------
816 // This funtion calculates dE/dX within the "low" and "up" cuts.
817 //-----------------------------------------------------------------
820 Float_t angular[200];
824 for (Int_t i=0;i<200;i++) inlimit[i]=kFALSE;
825 for (Int_t i=0;i<200;i++) amp[i]=10000;
826 for (Int_t i=0;i<200;i++) angular[i]= 1;;
830 Float_t meanlog = 100.;
831 Int_t indexde[4]={0,64,128,160};
838 Float_t mean[4] = {0,0,0,0};
839 Float_t sigma[4] = {1000,1000,1000,1000};
840 Int_t nc[4] = {0,0,0,0};
841 Float_t norm[4] = {1000,1000,1000,1000};
846 // for (Int_t of =0; of<3; of++){
847 // for (Int_t i=indexde[of];i<indexde[of+1];i++)
848 for (Int_t i =0; i<160;i++)
850 AliTPCTrackPoint * point = GetTrackPoint(i);
851 if (point==0) continue;
852 if (point->fIsShared){
856 Int_t type = point->GetCPoint().GetType();
857 if (type<0) continue;
858 if (point->GetCPoint().GetMax()<5) continue;
859 Float_t angley = point->GetTPoint().GetAngleY();
860 Float_t anglez = point->GetTPoint().GetAngleZ();
861 Float_t rsigmay = point->GetCPoint().GetSigmaY();
862 Float_t rsigmaz = point->GetCPoint().GetSigmaZ();
863 Float_t rsigma = TMath::Sqrt(rsigmay*rsigmaz);
865 Float_t ampc = 0; // normalization to the number of electrons
867 ampc = point->GetCPoint().GetMax();
870 ampc = point->GetCPoint().GetMax();
872 ampc *= 2.0; // put mean value to channel 50
873 // ampc *= 0.565; // put mean value to channel 50
876 Float_t z = TMath::Abs(point->GetCPoint().GetZ());
883 if (type<0) { //amp at the border - lower weight
886 if (rsigma>1.5) ampc/=1.3; // if big backround
887 angular[i] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
888 amp[i] = ampc/angular[i];
893 TMath::Sort(159,amp,index,kFALSE);
894 for (Int_t i=int(anc*low+0.5);i<int(anc*up+0.5);i++){
895 inlimit[index[i]] = kTRUE; // take all clusters
898 // meanlog = amp[index[Int_t(anc*0.3)]];
900 for (Int_t of =0; of<3; of++){
904 for (Int_t i=indexde[of];i<indexde[of+1];i++)
906 if (inlimit[i]==kFALSE) continue;
907 Float_t ampl = amp[i];
909 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
912 sumamp += weight[i]*ampl;
913 sumamp2 += weight[i]*ampl*ampl;
914 norm[of] += angular[i]*weight[i];
922 mean[of] = sumamp/sumw;
923 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
925 sigma[of] = TMath::Sqrt(sigma[of]);
928 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
938 Float_t www[3] = {12.,14.,17.};
939 //Float_t www[3] = {1.,1.,1.};
941 for (Int_t i =0;i<3;i++){
942 if (nc[i]>2&&nc[i]<1000){
943 dedx += mean[i] *nc[i]*www[i]/sigma[i];
944 fSdEdx += sigma[i]*(nc[i]-2)*www[i]/sigma[i];
945 fMAngular += norm[i] *nc[i];
946 norm2 += nc[i]*www[i]/sigma[i];
947 norm3 += (nc[i]-2)*www[i]/sigma[i];
950 fSDEDX[i] = sigma[i];
963 // Float_t dedx1 =dedx;
967 for (Int_t i =0;i<3;i++){
968 if (nc[i]>2&&nc[i]<1000&&sigma[i]>3){
969 //mean[i] = mean[i]*(1+0.08*(sigma[i]/(fSdEdx)-1.));
970 dedx += mean[i] *(nc[i])/(sigma[i]);
971 norm4 += (nc[i])/(sigma[i]);
975 if (norm4>0) dedx /= norm4;