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<160;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];
111 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=s.fTPCr[i];
112 for (Int_t i=0;i<4;i++) {
113 fDEDX[i] = s.fDEDX[i];
114 fSDEDX[i] = s.fSDEDX[i];
115 fNCDEDX[i] = s.fNCDEDX[i];
117 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = s.fOverlapLabels[i];
121 AliTPCseed::AliTPCseed(const AliTPCtrack &t):
124 fClusterOwner(kFALSE),
130 fCurrentSigmaY2(1e10),
131 fCurrentSigmaZ2(1e10),
134 fCurrentCluster(0x0),
135 fCurrentClusterIndex1(-1),
148 // Constructor from AliTPCtrack
151 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
152 for (Int_t i=0;i<160;i++) {
153 fClusterPointer[i] = 0;
154 Int_t index = t.GetClusterIndex(i);
156 SetClusterIndex2(i,index);
159 SetClusterIndex2(i,-3);
162 for (Int_t i=0;i<4;i++) {
167 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
170 AliTPCseed::AliTPCseed(Double_t xr, Double_t alpha, const Double_t xx[5],
171 const Double_t cc[15], Int_t index):
172 AliTPCtrack(xr, alpha, xx, cc, index),
174 fClusterOwner(kFALSE),
180 fCurrentSigmaY2(1e10),
181 fCurrentSigmaZ2(1e10),
184 fCurrentCluster(0x0),
185 fCurrentClusterIndex1(-1),
201 for (Int_t i=0;i<160;i++) SetClusterIndex2(i,-3);
202 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
203 for (Int_t i=0;i<5;i++) fTPCr[i]=0.2;
204 for (Int_t i=0;i<4;i++) {
209 for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
212 AliTPCseed::~AliTPCseed(){
215 if (fPoints) delete fPoints;
217 if (fEPoints) delete fEPoints;
221 for (Int_t icluster=0; icluster<160; icluster++){
222 delete fClusterPointer[icluster];
226 //_________________________________________________
227 AliTPCseed & AliTPCseed::operator =(const AliTPCseed & param)
230 // assignment operator - dummy
235 //____________________________________________________
236 AliTPCTrackerPoint * AliTPCseed::GetTrackPoint(Int_t i)
240 return &fTrackPoints[i];
243 void AliTPCseed::RebuildSeed()
246 // rebuild seed to be ready for storing
247 AliTPCclusterMI cldummy;
249 AliTPCTrackPoint pdummy;
250 pdummy.GetTPoint().SetShared(10);
251 for (Int_t i=0;i<160;i++){
252 AliTPCclusterMI * cl0 = fClusterPointer[i];
253 AliTPCTrackPoint *trpoint = (AliTPCTrackPoint*)fPoints->UncheckedAt(i);
255 trpoint->GetTPoint() = *(GetTrackPoint(i));
256 trpoint->GetCPoint() = *cl0;
257 trpoint->GetCPoint().SetQ(TMath::Abs(cl0->GetQ()));
261 trpoint->GetCPoint()= cldummy;
269 Double_t AliTPCseed::GetDensityFirst(Int_t n)
273 // return cluster for n rows bellow first point
274 Int_t nfoundable = 1;
276 for (Int_t i=fLastPoint-1;i>0&&nfoundable<n; i--){
277 Int_t index = GetClusterIndex2(i);
278 if (index!=-1) nfoundable++;
279 if (index>0) nfound++;
281 if (nfoundable<n) return 0;
282 return Double_t(nfound)/Double_t(nfoundable);
287 void AliTPCseed::GetClusterStatistic(Int_t first, Int_t last, Int_t &found, Int_t &foundable, Int_t &shared, Bool_t plus2)
289 // get cluster stat. on given region
294 for (Int_t i=first;i<last; i++){
295 Int_t index = GetClusterIndex2(i);
296 if (index!=-1) foundable++;
297 if (fClusterPointer[i]) {
303 if (fClusterPointer[i]->IsUsed(10)) {
307 if (!plus2) continue; //take also neighborhoud
309 if ( (i>0) && fClusterPointer[i-1]){
310 if (fClusterPointer[i-1]->IsUsed(10)) {
315 if ( fClusterPointer[i+1]){
316 if (fClusterPointer[i+1]->IsUsed(10)) {
324 //Error("AliTPCseed::GetClusterStatistic","problem\n");
332 void AliTPCseed::Reset(Bool_t all)
336 SetNumberOfClusters(0);
339 ResetCovariance(10.);
342 for (Int_t i=0;i<8;i++){
343 delete [] fTrackPoints[i];
351 for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
352 for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
358 void AliTPCseed::Modify(Double_t factor)
361 //------------------------------------------------------------------
362 //This function makes a track forget its history :)
363 //------------------------------------------------------------------
365 ResetCovariance(10.);
368 ResetCovariance(factor);
370 SetNumberOfClusters(0);
374 fCurrentSigmaY2 = 0.000005;
375 fCurrentSigmaZ2 = 0.000005;
384 Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const
386 //-----------------------------------------------------------------
387 // This function find proloncation of a track to a reference plane x=xk.
388 // doesn't change internal state of the track
389 //-----------------------------------------------------------------
391 Double_t x1=GetX(), x2=x1+(xk-x1), dx=x2-x1;
393 if (TMath::Abs(GetSnp()+GetC()*dx) >= AliTPCReconstructor::GetMaxSnpTrack()) {
397 // Double_t y1=fP0, z1=fP1;
398 Double_t c1=GetSnp(), r1=sqrt(1.- c1*c1);
399 Double_t c2=c1 + GetC()*dx, r2=sqrt(1.- c2*c2);
403 //y += dx*(c1+c2)/(r1+r2);
404 //z += dx*(c1+c2)/(c1*r2 + c2*r1)*fP3;
406 Double_t dy = dx*(c1+c2)/(r1+r2);
409 Double_t delta = GetC()*dx*(c1+c2)/(c1*r2 + c2*r1);
411 if (TMath::Abs(delta)>0.0001){
412 dz = fP3*TMath::ASin(delta)/fP4;
414 dz = dx*fP3*(c1+c2)/(c1*r2 + c2*r1);
417 // dz = fP3*AliTPCFastMath::FastAsin(delta)/fP4;
418 dz = GetTgl()*TMath::ASin(delta)/GetC();
428 //_____________________________________________________________________________
429 Double_t AliTPCseed::GetPredictedChi2(const AliCluster *c) const
431 //-----------------------------------------------------------------
432 // This function calculates a predicted chi2 increment.
433 //-----------------------------------------------------------------
434 Double_t p[2]={c->GetY(), c->GetZ()};
435 Double_t cov[3]={fErrorY2, 0., fErrorZ2};
436 return AliExternalTrackParam::GetPredictedChi2(p,cov);
439 //_________________________________________________________________________________________
442 Int_t AliTPCseed::Compare(const TObject *o) const {
443 //-----------------------------------------------------------------
444 // This function compares tracks according to the sector - for given sector according z
445 //-----------------------------------------------------------------
446 AliTPCseed *t=(AliTPCseed*)o;
449 if (t->fRelativeSector>fRelativeSector) return -1;
450 if (t->fRelativeSector<fRelativeSector) return 1;
451 Double_t z2 = t->GetZ();
452 Double_t z1 = GetZ();
454 if (z2<z1) return -1;
459 f2 = 1-20*TMath::Sqrt(t->GetSigma1Pt2())/(TMath::Abs(t->Get1Pt())+0.0066);
460 if (t->fBConstrain) f2=1.2;
463 f1 = 1-20*TMath::Sqrt(GetSigma1Pt2())/(TMath::Abs(Get1Pt())+0.0066);
465 if (fBConstrain) f1=1.2;
467 if (t->GetNumberOfClusters()*f2 <GetNumberOfClusters()*f1) return -1;
475 //_____________________________________________________________________________
476 Bool_t AliTPCseed::Update(const AliCluster *c, Double_t chisq, Int_t /*index*/)
478 //-----------------------------------------------------------------
479 // This function associates a cluster with this track.
480 //-----------------------------------------------------------------
481 Double_t p[2]={c->GetY(), c->GetZ()};
482 Double_t cov[3]={fErrorY2, 0., fErrorZ2};
484 if (!AliExternalTrackParam::Update(p,cov)) return kFALSE;
486 Int_t n=GetNumberOfClusters();
488 SetNumberOfClusters(n+1);
489 SetChi2(GetChi2()+chisq);
496 //_____________________________________________________________________________
497 Float_t AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t onlyused) {
498 //-----------------------------------------------------------------
499 // This funtion calculates dE/dX within the "low" and "up" cuts.
500 //-----------------------------------------------------------------
503 Float_t angular[200];
507 // TClonesArray & arr = *fPoints;
508 Float_t meanlog = 100.;
510 Float_t mean[4] = {0,0,0,0};
511 Float_t sigma[4] = {1000,1000,1000,1000};
512 Int_t nc[4] = {0,0,0,0};
513 Float_t norm[4] = {1000,1000,1000,1000};
518 for (Int_t of =0; of<4; of++){
519 for (Int_t i=of+i1;i<i2;i+=4)
521 Int_t index = fIndex[i];
522 if (index<0||index&0x8000) continue;
524 //AliTPCTrackPoint * point = (AliTPCTrackPoint *) arr.At(i);
525 AliTPCTrackerPoint * point = GetTrackPoint(i);
526 //AliTPCTrackerPoint * pointm = GetTrackPoint(i-1);
527 //AliTPCTrackerPoint * pointp = 0;
528 //if (i<159) pointp = GetTrackPoint(i+1);
530 if (point==0) continue;
531 AliTPCclusterMI * cl = fClusterPointer[i];
533 if (onlyused && (!cl->IsUsed(10))) continue;
534 if (cl->IsUsed(11)) {
538 Int_t type = cl->GetType();
539 //if (point->fIsShared){
544 // if (pointm->fIsShared) continue;
546 // if (pointp->fIsShared) continue;
548 if (type<0) continue;
549 //if (type>10) continue;
550 //if (point->GetErrY()==0) continue;
551 //if (point->GetErrZ()==0) continue;
553 //Float_t ddy = (point->GetY()-cl->GetY())/point->GetErrY();
554 //Float_t ddz = (point->GetZ()-cl->GetZ())/point->GetErrZ();
555 //if ((ddy*ddy+ddz*ddz)>10) continue;
558 // if (point->GetCPoint().GetMax()<5) continue;
559 if (cl->GetMax()<5) continue;
560 Float_t angley = point->GetAngleY();
561 Float_t anglez = point->GetAngleZ();
563 Float_t rsigmay2 = point->GetSigmaY();
564 Float_t rsigmaz2 = point->GetSigmaZ();
568 rsigmay += pointm->GetTPoint().GetSigmaY();
569 rsigmaz += pointm->GetTPoint().GetSigmaZ();
573 rsigmay += pointp->GetTPoint().GetSigmaY();
574 rsigmaz += pointp->GetTPoint().GetSigmaZ();
581 Float_t rsigma = TMath::Sqrt(rsigmay2*rsigmaz2);
583 Float_t ampc = 0; // normalization to the number of electrons
585 // ampc = 1.*point->GetCPoint().GetMax();
586 ampc = 1.*cl->GetMax();
587 //ampc = 1.*point->GetCPoint().GetQ();
588 // AliTPCClusterPoint & p = point->GetCPoint();
589 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.6)) - TMath::Abs(p.GetY()/0.6)+0.5);
590 // Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
592 // TMath::Abs( Int_t(iz) - iz + 0.5);
593 //ampc *= 1.15*(1-0.3*dy);
594 //ampc *= 1.15*(1-0.3*dz);
595 // Float_t zfactor = (AliTPCReconstructor::GetCtgRange()-0.0004*TMath::Abs(point->GetCPoint().GetZ()));
599 //ampc = 1.0*point->GetCPoint().GetMax();
600 ampc = 1.0*cl->GetMax();
601 //ampc = 1.0*point->GetCPoint().GetQ();
602 //AliTPCClusterPoint & p = point->GetCPoint();
603 // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.4)) - TMath::Abs(p.GetY()/0.4)+0.5);
604 //Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
606 // TMath::Abs( Int_t(iz) - iz + 0.5);
608 //ampc *= 1.15*(1-0.3*dy);
609 //ampc *= 1.15*(1-0.3*dz);
610 // Float_t zfactor = (1.02-0.000*TMath::Abs(point->GetCPoint().GetZ()));
614 ampc *= 2.0; // put mean value to channel 50
615 //ampc *= 0.58; // put mean value to channel 50
617 // if (type>0) w = 1./(type/2.-0.5);
618 // Float_t z = TMath::Abs(cl->GetZ());
621 //ampc /= (1+0.0008*z);
625 //ampc /= (1+0.0008*z);
627 //ampc /= (1+0.0008*z);
630 if (type<0) { //amp at the border - lower weight
635 if (rsigma>1.5) ampc/=1.3; // if big backround
637 angular[nc[of]] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
642 TMath::Sort(nc[of],amp,index,kFALSE);
646 //meanlog = amp[index[Int_t(nc[of]*0.33)]];
648 for (Int_t i=int(nc[of]*low+0.5);i<int(nc[of]*up+0.5);i++){
649 Float_t ampl = amp[index[i]]/angular[index[i]];
650 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
652 sumw += weight[index[i]];
653 sumamp += weight[index[i]]*ampl;
654 sumamp2 += weight[index[i]]*ampl*ampl;
655 norm[of] += angular[index[i]]*weight[index[i]];
662 mean[of] = sumamp/sumw;
663 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
665 sigma[of] = TMath::Sqrt(sigma[of]);
669 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
670 //mean *=(1-0.02*(sigma/(mean*0.17)-1.));
671 //mean *=(1-0.1*(norm-1.));
678 // mean[0]*= (1-0.05*(sigma[0]/(0.01+mean[1]*0.18)-1));
679 // mean[1]*= (1-0.05*(sigma[1]/(0.01+mean[0]*0.18)-1));
682 // dedx = (mean[0]* TMath::Sqrt((1.+nc[0]))+ mean[1]* TMath::Sqrt((1.+nc[1])) )/
683 // ( TMath::Sqrt((1.+nc[0]))+TMath::Sqrt((1.+nc[1])));
687 for (Int_t i =0;i<4;i++){
688 if (nc[i]>2&&nc[i]<1000){
689 dedx += mean[i] *nc[i];
690 fSdEdx += sigma[i]*(nc[i]-2);
691 fMAngular += norm[i] *nc[i];
696 fSDEDX[i] = sigma[i];
709 // Float_t dedx1 =dedx;
712 for (Int_t i =0;i<4;i++){
713 if (nc[i]>2&&nc[i]<1000){
714 mean[i] = mean[i]*(1-0.12*(sigma[i]/(fSdEdx)-1.));
715 dedx += mean[i] *nc[i];
726 Double_t AliTPCseed::Bethe(Double_t bg){
728 // This is the Bethe-Bloch function normalised to 1 at the minimum
733 bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
734 else // Density effect ( approximately :)
735 bethe=1.15*(1.+ bg2)/bg2*(log(3.5*5940*bg) - bg2/(1.+ bg2));
739 void AliTPCseed::CookPID()
742 // cook PID information according dEdx
744 Double_t fRange = 10.;
748 Int_t ns=AliPID::kSPECIES;
750 for (Int_t j=0; j<ns; j++) {
751 Double_t mass=AliPID::ParticleMass(j);
753 Double_t dedx=fdEdx/fMIP;
754 Double_t bethe=Bethe(mom/mass);
755 Double_t sigma=fRes*bethe;
757 if (TMath::Abs(dedx-bethe) > fRange*sigma) {
758 fTPCr[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
762 fTPCr[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
770 for (Int_t j=0; j<ns; j++) {
771 fTPCr[j]/=sumr; //normalize
776 void AliTPCseed::CookdEdx2(Double_t low, Double_t up) {
777 //-----------------------------------------------------------------
778 // This funtion calculates dE/dX within the "low" and "up" cuts.
779 //-----------------------------------------------------------------
782 Float_t angular[200];
786 for (Int_t i=0;i<200;i++) inlimit[i]=kFALSE;
787 for (Int_t i=0;i<200;i++) amp[i]=10000;
788 for (Int_t i=0;i<200;i++) angular[i]= 1;;
792 Float_t meanlog = 100.;
793 Int_t indexde[4]={0,64,128,160};
800 Float_t mean[4] = {0,0,0,0};
801 Float_t sigma[4] = {1000,1000,1000,1000};
802 Int_t nc[4] = {0,0,0,0};
803 Float_t norm[4] = {1000,1000,1000,1000};
808 // for (Int_t of =0; of<3; of++){
809 // for (Int_t i=indexde[of];i<indexde[of+1];i++)
810 for (Int_t i =0; i<160;i++)
812 AliTPCTrackPoint * point = GetTrackPoint(i);
813 if (point==0) continue;
814 if (point->fIsShared){
818 Int_t type = point->GetCPoint().GetType();
819 if (type<0) continue;
820 if (point->GetCPoint().GetMax()<5) continue;
821 Float_t angley = point->GetTPoint().GetAngleY();
822 Float_t anglez = point->GetTPoint().GetAngleZ();
823 Float_t rsigmay = point->GetCPoint().GetSigmaY();
824 Float_t rsigmaz = point->GetCPoint().GetSigmaZ();
825 Float_t rsigma = TMath::Sqrt(rsigmay*rsigmaz);
827 Float_t ampc = 0; // normalization to the number of electrons
829 ampc = point->GetCPoint().GetMax();
832 ampc = point->GetCPoint().GetMax();
834 ampc *= 2.0; // put mean value to channel 50
835 // ampc *= 0.565; // put mean value to channel 50
838 Float_t z = TMath::Abs(point->GetCPoint().GetZ());
845 if (type<0) { //amp at the border - lower weight
848 if (rsigma>1.5) ampc/=1.3; // if big backround
849 angular[i] = TMath::Sqrt(1.+angley*angley+anglez*anglez);
850 amp[i] = ampc/angular[i];
855 TMath::Sort(159,amp,index,kFALSE);
856 for (Int_t i=int(anc*low+0.5);i<int(anc*up+0.5);i++){
857 inlimit[index[i]] = kTRUE; // take all clusters
860 // meanlog = amp[index[Int_t(anc*0.3)]];
862 for (Int_t of =0; of<3; of++){
866 for (Int_t i=indexde[of];i<indexde[of+1];i++)
868 if (inlimit[i]==kFALSE) continue;
869 Float_t ampl = amp[i];
871 ampl = meanlog*TMath::Log(1.+ampl/meanlog);
874 sumamp += weight[i]*ampl;
875 sumamp2 += weight[i]*ampl*ampl;
876 norm[of] += angular[i]*weight[i];
884 mean[of] = sumamp/sumw;
885 sigma[of] = sumamp2/sumw-mean[of]*mean[of];
887 sigma[of] = TMath::Sqrt(sigma[of]);
890 mean[of] = (TMath::Exp(mean[of]/meanlog)-1)*meanlog;
900 Float_t www[3] = {12.,14.,17.};
901 //Float_t www[3] = {1.,1.,1.};
903 for (Int_t i =0;i<3;i++){
904 if (nc[i]>2&&nc[i]<1000){
905 dedx += mean[i] *nc[i]*www[i]/sigma[i];
906 fSdEdx += sigma[i]*(nc[i]-2)*www[i]/sigma[i];
907 fMAngular += norm[i] *nc[i];
908 norm2 += nc[i]*www[i]/sigma[i];
909 norm3 += (nc[i]-2)*www[i]/sigma[i];
912 fSDEDX[i] = sigma[i];
925 // Float_t dedx1 =dedx;
929 for (Int_t i =0;i<3;i++){
930 if (nc[i]>2&&nc[i]<1000&&sigma[i]>3){
931 //mean[i] = mean[i]*(1+0.08*(sigma[i]/(fSdEdx)-1.));
932 dedx += mean[i] *(nc[i])/(sigma[i]);
933 norm4 += (nc[i])/(sigma[i]);
937 if (norm4>0) dedx /= norm4;
947 Double_t AliTPCseed::GetYat(Double_t xk) const {
948 //-----------------------------------------------------------------
949 // This function calculates the Y-coordinate of a track at the plane x=xk.
950 //-----------------------------------------------------------------
951 if (TMath::Abs(GetSnp())>AliTPCReconstructor::GetMaxSnpTrack()) return 0.; //patch 01 jan 06
952 Double_t c1=GetSnp(), r1=TMath::Sqrt(1.- c1*c1);
953 Double_t c2=c1+GetC()*(xk-GetX());
954 if (TMath::Abs(c2)>AliTPCReconstructor::GetMaxSnpTrack()) return 0;
955 Double_t r2=TMath::Sqrt(1.- c2*c2);
956 return GetY() + (xk-GetX())*(c1+c2)/(r1+r2);