X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITStrackerSA.cxx;h=ea8abebb330c94bfd3515b6d7877e8c36e4c35eb;hb=be6cab25c720cead4ba25e51f6eec3200cc99565;hp=fb7135b30720374237b33f496480569cbbeb15ae;hpb=e8432c6d746abc4371038121bf25edce44de710b;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITStrackerSA.cxx b/ITS/AliITStrackerSA.cxx index fb7135b3072..ea8abebb330 100644 --- a/ITS/AliITStrackerSA.cxx +++ b/ITS/AliITStrackerSA.cxx @@ -55,8 +55,6 @@ fCoef3(0), fNloop(0), fPhiWin(0), fLambdaWin(0), -fVert(0), -fVertexer(0), fListOfTracks(0), fListOfSATracks(0), fITSclusters(0), @@ -65,7 +63,6 @@ fOuterStartLayer(0), fInnerStartLayer(5), fMinNPoints(0), fMinQ(0.), -fCluLayer(0), fCluCoord(0){ // Default constructor Init(); @@ -83,8 +80,6 @@ fCoef3(0), fNloop(0), fPhiWin(0), fLambdaWin(0), -fVert(0), -fVertexer(0), fListOfTracks(0), fListOfSATracks(0), fITSclusters(0), @@ -93,7 +88,6 @@ fOuterStartLayer(0), fInnerStartLayer(5), fMinNPoints(0), fMinQ(0.), -fCluLayer(0), fCluCoord(0) { // Standard constructor (Vertex is known and passed to this obj.) @@ -102,138 +96,12 @@ fCluCoord(0) } Init(); - fVert = 0; - -} - -//____________________________________________________________________________ -AliITStrackerSA::AliITStrackerSA(const Char_t *geom, AliESDVertex *vert):AliITStrackerMI(0), -fPhiEstimate(0), -fITSStandAlone(0), -fLambdac(0), -fPhic(0), -fCoef1(0), -fCoef2(0), -fCoef3(0), -fNloop(0), -fPhiWin(0), -fLambdaWin(0), -fVert(vert), -fVertexer(0), -fListOfTracks(0), -fListOfSATracks(0), -fITSclusters(0), -fInwardFlag(0), -fOuterStartLayer(0), -fInnerStartLayer(5), -fMinNPoints(0), -fMinQ(0.), -fCluLayer(0), -fCluCoord(0) -{ - // Standard constructor (Vertex is known and passed to this obj.) - if (geom) { - AliWarning("\"geom\" is actually a dummy argument !"); - } - Init(); - -} - -//____________________________________________________________________________ -AliITStrackerSA::AliITStrackerSA(const Char_t *geom, AliITSVertexer *vertexer):AliITStrackerMI(0), -fPhiEstimate(0), -fITSStandAlone(0), -fLambdac(0), -fPhic(0), -fCoef1(0), -fCoef2(0), -fCoef3(0), -fNloop(0), -fPhiWin(0), -fLambdaWin(0), -fVert(), -fVertexer(vertexer), -fListOfTracks(0), -fListOfSATracks(0), -fITSclusters(0), -fInwardFlag(0), -fOuterStartLayer(0), -fInnerStartLayer(5), -fMinNPoints(0), -fMinQ(0.), -fCluLayer(0), -fCluCoord(0) -{ - // Standard constructor (Vertex is unknown - vertexer is passed to this obj) - if (geom) { - AliWarning("\"geom\" is actually a dummy argument !"); - } - Init(); - fVertexer = vertexer; - -} - -//____________________________________________________________________________ -AliITStrackerSA::AliITStrackerSA(const AliITStrackerSA& tracker):AliITStrackerMI(), -fPhiEstimate(tracker.fPhiEstimate), -fITSStandAlone(tracker.fITSStandAlone), -fLambdac(tracker.fLambdac), -fPhic(tracker.fPhic), -fCoef1(tracker.fCoef1), -fCoef2(tracker.fCoef2), -fCoef3(tracker.fCoef3), -fNloop(tracker.fNloop), -fPhiWin(tracker.fPhiWin), -fLambdaWin(tracker.fLambdaWin), -fVert(tracker.fVert), -fVertexer(tracker.fVertexer), -fListOfTracks(tracker.fListOfTracks), -fListOfSATracks(tracker.fListOfSATracks), -fITSclusters(tracker.fITSclusters), -fInwardFlag(tracker.fInwardFlag), -fOuterStartLayer(tracker.fOuterStartLayer), -fInnerStartLayer(tracker.fInnerStartLayer), -fMinNPoints(tracker.fMinNPoints), -fMinQ(tracker.fMinQ), -fCluLayer(tracker.fCluLayer), -fCluCoord(tracker.fCluCoord) { - // Copy constructor - for(Int_t i=0;i<2;i++){ - fPoint1[i]=tracker.fPoint1[i]; - fPoint2[i]=tracker.fPoint2[i]; - fPoint3[i]=tracker.fPoint3[i]; - fPointc[i]=tracker.fPointc[i]; - } - if(tracker.fVertexer && tracker.fVert){ - fVert = new AliESDVertex(*tracker.fVert); - } - else { - fVert = tracker.fVert; - } - for(Int_t i=0;i~AliITStrackerSA(); - new(this) AliITStrackerSA(source); - return *this; } //____________________________________________________________________________ AliITStrackerSA::~AliITStrackerSA(){ // destructor - // if fVertexer is not null, the AliESDVertex obj. is owned by this class - // and is deleted here - if(fVertexer){ - if(fVert)delete fVert; - } - fVert = 0; - fVertexer = 0; if(fPhiWin)delete []fPhiWin; if(fLambdaWin)delete []fLambdaWin; @@ -241,15 +109,6 @@ AliITStrackerSA::~AliITStrackerSA(){ delete fListOfTracks; fListOfSATracks->Delete(); delete fListOfSATracks; - if(fCluLayer){ - for(Int_t i=0;iDelete(); - delete fCluLayer[i]; - } - } - delete [] fCluLayer; - } if(fCluCoord){ for(Int_t i=0;iGetSAUseAllClusters()==kTRUE) { + Int_t nSPDcontr=0; + const AliESDVertex *spdv = event->GetPrimaryVertexSPD(); + if(spdv) nSPDcontr = spdv->GetNContributors(); + if(AliITSReconstructor::GetRecoParam()->GetSAUseAllClusters()==kTRUE && + nSPDcontr<=AliITSReconstructor::GetRecoParam()->GetMaxSPDcontrForSAToUseAllClusters()) { rc=FindTracks(event,kTRUE); } } - return rc; } @@ -290,7 +152,7 @@ Int_t AliITStrackerSA::Clusters2Tracks(AliESDEvent *event){ void AliITStrackerSA::Init(){ // Reset all data members fPhiEstimate=0; - for(Int_t i=0;i<3;i++){fPoint1[i]=0;fPoint2[i]=0;fPoint3[i]=0;} + for(Int_t i=0;i<2;i++){fPoint1[i]=0;fPoint2[i]=0;fPoint3[i]=0;} fLambdac=0; fPhic=0; fCoef1=0; @@ -298,10 +160,8 @@ void AliITStrackerSA::Init(){ fCoef3=0; fPointc[0]=0; fPointc[1]=0; - fVert = 0; - fVertexer = 0; Int_t nLoops=AliITSReconstructor::GetRecoParam()->GetNLoopsSA(); - if(nLoops==33){ + if(nLoops==32){ SetFixedWindowSizes(); }else{ Double_t phimin=AliITSReconstructor::GetRecoParam()->GetMinPhiSA(); @@ -316,7 +176,6 @@ void AliITStrackerSA::Init(){ SetSAFlag(kFALSE); fListOfTracks=new TClonesArray("AliITStrackMI",100); fListOfSATracks=new TClonesArray("AliITStrackSA",100); - fCluLayer = 0; fCluCoord = 0; fMinNPoints = 3; } @@ -324,7 +183,7 @@ void AliITStrackerSA::Init(){ void AliITStrackerSA::ResetForFinding(){ // Reset data members used in all loops during track finding fPhiEstimate=0; - for(Int_t i=0;i<3;i++){fPoint1[i]=0;fPoint2[i]=0;fPoint3[i]=0;} + for(Int_t i=0;i<2;i++){fPoint1[i]=0;fPoint2[i]=0;fPoint3[i]=0;} fLambdac=0; fPhic=0; fCoef1=0; @@ -347,7 +206,7 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){ AliDebug(2,Form("SKIPPING %d %d %d %d %d %d",ForceSkippingOfLayer(0),ForceSkippingOfLayer(1),ForceSkippingOfLayer(2),ForceSkippingOfLayer(3),ForceSkippingOfLayer(4),ForceSkippingOfLayer(5))); if(!fITSclusters){ - Fatal("FindTracks","ITS cluster tree is not accessed - Abort!!!\n Please use method SetClusterTree to pass the pointer to the tree\n"); + Fatal("FindTracks","ITS cluster tree is not accessed!!!\n Please use method SetClusterTree to pass the pointer to the tree\n"); return -1; } //Reads event and mark clusters of traks already found, with flag kITSin @@ -384,11 +243,9 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){ //by AliITStrackerMI are not considered Int_t nclusters[AliITSgeomTGeo::kNLayers]={0,0,0,0,0,0}; Int_t dmar[AliITSgeomTGeo::kNLayers]={0,0,0,0,0,0}; - if (fCluLayer == 0) { - fCluLayer = new TClonesArray*[AliITSgeomTGeo::kNLayers]; + if (fCluCoord == 0) { fCluCoord = new TClonesArray*[AliITSgeomTGeo::kNLayers]; for(Int_t i=0;iDelete(); - fCluLayer[i]->Expand(nclusters[i]); - } if(!fCluCoord[i]){ fCluCoord[i] = new TClonesArray("AliITSclusterTable",nclusters[i]); }else{ @@ -419,7 +270,6 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){ } for(Int_t ilay=0;ilayGetQ()==0) continue; if(ilay>1 && cls->GetQ()<=fMinQ) continue; Double_t phi=0;Double_t lambda=0; - Float_t x=0;Float_t y=0;Float_t z=0; - Float_t sx=0;Float_t sy=0;Float_t sz=0; + Double_t x=0;Double_t y=0;Double_t z=0; + Double_t sx=0;Double_t sy=0;Double_t sz=0; GetCoorAngles(cls,phi,lambda,x,y,z,primaryVertex); GetCoorErrors(cls,sx,sy,sz); - new (clulay[dmar[ilay]]) AliITSRecPoint(*cls); new (clucoo[dmar[ilay]]) AliITSclusterTable(x,y,z,sx,sy,sz,phi,lambda,cli); dmar[ilay]++; } } + fCluCoord[ilay]->Sort(); } // track counter @@ -471,7 +321,7 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){ // loop on phi and lambda window size for(Int_t nloop=0;nloopGetEntries(); + Int_t nclTheLay=fCluCoord[theLay]->GetEntries(); while(nclTheLay--){ ResetForFinding(); Bool_t useRP=SetFirstPoint(theLay,nclTheLay,primaryVertex); @@ -487,6 +337,7 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){ &trs,primaryVertex[2],pflag); Int_t nextLay=theLay+seedStep; Bool_t goon=kTRUE; + if(nextLay<0 || nextLay == 6) goon = kFALSE; while(goon){ kk++; nClusLay[kk] = SearchClusters(nextLay,fPhiWin[nloop],fLambdaWin[nloop], @@ -543,7 +394,7 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){ // counter for clusters on each layer for(Int_t nloop=0;nloopGetEntries(); + Int_t nclInnLay=fCluCoord[innLay]->GetEntries(); while(nclInnLay--){ //loop starting from layer innLay ResetForFinding(); Bool_t useRP=SetFirstPoint(innLay,nclInnLay,primaryVertex); @@ -691,8 +542,8 @@ AliITStrackV2* AliITStrackerSA::FitTrack(AliITStrackSA* tr,Double_t *primaryVert Int_t module1 = p1->GetDetectorIndex()+firstmod[firstLay]; Int_t layer,ladder,detector; AliITSgeomTGeo::GetModuleId(module1,layer,ladder,detector); - Float_t yclu1 = p1->GetY(); - Float_t zclu1 = p1->GetZ(); + Double_t yclu1 = p1->GetY(); + Double_t zclu1 = p1->GetZ(); Double_t x1,y1,z1; Double_t x2,y2,z2; @@ -783,9 +634,7 @@ AliITStrackV2* AliITStrackerSA::FitTrack(AliITStrackSA* tr,Double_t *primaryVert for(Int_t nlay=0;nlayGetNumberOfMarked(nlay);cln++){ Int_t index = trsa->GetClusterMark(nlay,cln); - fCluLayer[nlay]->RemoveAt(index); RemoveClusterCoord(nlay,index); - fCluLayer[nlay]->Compress(); } } @@ -808,6 +657,28 @@ void AliITStrackerSA::StoreTrack(AliITStrackV2 *t,AliESDEvent *event, Bool_t pur Double_t sdedx[4]={0.,0.,0.,0.}; for(Int_t i=0; i<4; i++) sdedx[i]=t->GetSampledEdx(i); outtrack.SetITSdEdxSamples(sdedx); + + + if(AliITSReconstructor::GetRecoParam()->GetSAUsedEdxInfo()){ + Double_t mom=t->P(); + Double_t ppid[AliPID::kSPECIES]; + for(Int_t isp=0;ispGetdEdx(); + Int_t ide=fITSPid->GetParticleIdFromdEdxVsP(mom,truncmean,kTRUE); + if(ide==AliPID::kProton){ + ppid[AliPID::kProton]=1.; + ppid[AliPID::kPion]=0.; + } + else if(ide==AliPID::kKaon){ + ppid[AliPID::kKaon]=1.; + ppid[AliPID::kPion]=0.; + } + } + outtrack.SetITSpid(ppid); + outtrack.SetESDpid(ppid); + } event->AddTrack(&outtrack); return; @@ -820,11 +691,12 @@ Int_t AliITStrackerSA::SearchClusters(Int_t layer,Double_t phiwindow,Double_t la if(ForceSkippingOfLayer(layer)) return 0; + Int_t nc=0; AliITSlayer &lay = fgLayers[layer]; Double_t r=lay.GetR(); if(pflag==1){ - Float_t cx1,cx2,cy1,cy2; + Double_t cx1,cx2,cy1,cy2; FindEquation(fPoint1[0],fPoint1[1],fPoint2[0],fPoint2[1],fPoint3[0],fPoint3[1],fCoef1,fCoef2,fCoef3); if (FindIntersection(fCoef1,fCoef2,fCoef3,-r*r,cx1,cy1,cx2,cy2)==0) return 0; @@ -834,32 +706,40 @@ Int_t AliITStrackerSA::SearchClusters(Int_t layer,Double_t phiwindow,Double_t la } - Int_t ncl = fCluLayer[layer]->GetEntries(); - for (Int_t index=0; indexAt(index); - if (!c) continue; - if (c->GetQ()<=0) continue; - if(layer>1 && c->GetQ()<=fMinQ) continue; - - AliITSclusterTable* arr = (AliITSclusterTable*)GetClusterCoord(layer,index); - Double_t phi = arr->GetPhi(); - if (TMath::Abs(phi-fPhiEstimate)>phiwindow) continue; + Double_t phiExpect=fPhiEstimate; + Double_t lamExpect=fLambdac; - Double_t lambda = arr->GetLambda(); - if (TMath::Abs(lambda-fLambdac)>lambdawindow) continue; + Int_t ncl = fCluCoord[layer]->GetEntriesFast(); + Int_t startcl=FindIndex(layer,lamExpect-lambdawindow*1.02); + Int_t endcl=FindIndex(layer,lamExpect+lambdawindow*1.02)+1; + if(endcl>=ncl) endcl=ncl-1; - if(trs->GetNumberOfClustersSA()==trs->GetMaxNumberOfClusters()) return 0; - if(trs->GetNumberOfMarked(layer)==trs->GetMaxNMarkedPerLayer()) return 0; - Int_t orind = arr->GetOrInd(); - trs->AddClusterSA(layer,orind); - trs->AddClusterMark(layer,index); - nc++; - fLambdac=lambda; - fPhiEstimate=phi; + for (Int_t index=startcl; index<=endcl; index++) { + //for (Int_t index=0; indexGetX(); - fPointc[1]=arr->GetY(); + Double_t phi = arr->GetPhi(); + Double_t deltaPhi = phi-phiExpect; + if(deltaPhi>TMath::Pi()) deltaPhi-=2*TMath::Pi(); + else if(deltaPhi<-TMath::Pi()) deltaPhi+=2*TMath::Pi(); + if (TMath::Abs(deltaPhi)>phiwindow) continue; + + Double_t lambda = arr->GetLambda(); + if (TMath::Abs(lambda-lamExpect)>lambdawindow) continue; + + if(trs->GetNumberOfClustersSA()==trs->GetMaxNumberOfClusters()) return 0; + if(trs->GetNumberOfMarked(layer)==trs->GetMaxNMarkedPerLayer()) return 0; + Int_t orind = arr->GetOrInd(); + trs->AddClusterSA(layer,orind); + trs->AddClusterMark(layer,index); + nc++; + fLambdac=lambda; + fPhiEstimate=phi; + + fPointc[0]=arr->GetX(); + fPointc[1]=arr->GetY(); + } return nc; } @@ -868,11 +748,6 @@ Int_t AliITStrackerSA::SearchClusters(Int_t layer,Double_t phiwindow,Double_t la Bool_t AliITStrackerSA::SetFirstPoint(Int_t lay, Int_t clu, Double_t* primaryVertex){ // Sets the first point (seed) for tracking - AliITSRecPoint* cl = (AliITSRecPoint*)fCluLayer[lay]->At(clu); - if(!cl) return kFALSE; - if (cl->GetQ()<=0) return kFALSE; - if(lay>1 && cl->GetQ()<=fMinQ) return kFALSE; - AliITSclusterTable* arr = (AliITSclusterTable*)GetClusterCoord(lay,clu); fPhic = arr->GetPhi(); fLambdac = arr->GetLambda(); @@ -897,20 +772,27 @@ void AliITStrackerSA::UpdatePoints(){ } //___________________________________________________________________ -Int_t AliITStrackerSA::FindEquation(Float_t x1, Float_t y1, Float_t x2, Float_t y2, Float_t x3, Float_t y3,Float_t& a, Float_t& b, Float_t& c){ +Int_t AliITStrackerSA::FindEquation(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3,Double_t& a, Double_t& b, Double_t& c){ //given (x,y) of three recpoints (in global coordinates) //returns the parameters a,b,c of circonference x*x + y*y +a*x + b*y +c - - Float_t den = (x3-x1)*(y2-y1)-(x2-x1)*(y3-y1); + double dx31=x3-x1,dy31=y3-y1,dx21=x2-x1,dy21=y2-y1; + Double_t den = dx31*dy21-dx21*dy31; if(den==0) return 0; - a = ((y3-y1)*(x2*x2+y2*y2-x1*x1-y1*y1)-(y2-y1)*(x3*x3+y3*y3-x1*x1-y1*y1))/den; - b = -(x2*x2-x1*x1+y2*y2-y1*y1+a*(x2-x1))/(y2-y1); + else den = 1./den; + // + double r31 = -dx31*(x1+x3) - dy31*(y1+y3); + double r21 = -dx21*(x1+x2) - dy21*(y1+y2); + // + double da = r31*dy21 - r21*dy31; + double db = r21*dx31 - r31*dx21; + a = da*den; + b = db*den; c = -x1*x1-y1*y1-a*x1-b*y1; return 1; } //__________________________________________________________________________ - Int_t AliITStrackerSA::FindIntersection(Float_t a1, Float_t b1, Float_t c1, Float_t c2,Float_t& x1,Float_t& y1, Float_t& x2, Float_t& y2){ + Int_t AliITStrackerSA::FindIntersection(Double_t a1, Double_t b1, Double_t c1, Double_t c2,Double_t& x1,Double_t& y1, Double_t& x2, Double_t& y2){ //Finds the intersection between the circonference of the track and the circonference centered in (0,0) represented by one layer //c2 is -rlayer*rlayer @@ -992,7 +874,7 @@ Int_t AliITStrackerSA::FindTrackLowChiSquare() const { //__________________________________________________________ Int_t AliITStrackerSA::FindLabel(AliITStrackV2* track){ - // + // compute the track label starting from cluster labels Int_t labl[AliITSgeomTGeo::kNLayers][3]; Int_t cnts[AliITSgeomTGeo::kNLayers][3]; @@ -1047,18 +929,18 @@ Int_t AliITStrackerSA::FindLabel(AliITStrackV2* track){ return label; } //_____________________________________________________________________________ -void AliITStrackerSA::SetCalculatedWindowSizes(Int_t n, Float_t phimin, Float_t phimax, Float_t lambdamin, Float_t lambdamax){ +void AliITStrackerSA::SetCalculatedWindowSizes(Int_t n, Double_t phimin, Double_t phimax, Double_t lambdamin, Double_t lambdamax){ // Set sizes of the phi and lambda windows used for track finding fNloop = n; if(fPhiWin) delete [] fPhiWin; if(fLambdaWin) delete [] fLambdaWin; fPhiWin = new Double_t[fNloop]; fLambdaWin = new Double_t[fNloop]; - Float_t stepPhi=(phimax-phimin)/(Float_t)(fNloop-1); - Float_t stepLambda=(lambdamax-lambdamin)/(Float_t)(fNloop-1); + Double_t stepPhi=(phimax-phimin)/(Double_t)(fNloop-1); + Double_t stepLambda=(lambdamax-lambdamin)/(Double_t)(fNloop-1); for(Int_t k=0;kGetRotMatrix(module,rot); Int_t lay,lad,det; fGeom->GetModuleId(module,lay,lad,det); - Float_t tx,ty,tz; fGeom->GetTrans(lay,lad,det,tx,ty,tz); + Double_t tx,ty,tz; fGeom->GetTrans(lay,lad,det,tx,ty,tz); Double_t alpha=TMath::ATan2(rot[1],rot[0])+TMath::Pi(); Double_t phi1=TMath::Pi()/2+alpha; if (lay==1) phi1+=TMath::Pi(); - Float_t cp=TMath::Cos(phi1), sp=TMath::Sin(phi1); - Float_t r=tx*cp+ty*sp; + Double_t cp=TMath::Cos(phi1), sp=TMath::Sin(phi1); + Double_t r=tx*cp+ty*sp; xyz= r*cp - cl->GetY()*sp; y= r*sp + cl->GetY()*cp; @@ -1136,7 +1022,7 @@ void AliITStrackerSA::GetCoorAngles(AliITSRecPoint* cl,Double_t &phi,Double_t &l } //________________________________________________________________________ -void AliITStrackerSA::GetCoorErrors(AliITSRecPoint* cl,Float_t &sx,Float_t &sy, Float_t &sz){ +void AliITStrackerSA::GetCoorErrors(AliITSRecPoint* cl,Double_t &sx,Double_t &sy, Double_t &sz){ //returns sigmax, y, z of cluster in global coordinates /* @@ -1148,7 +1034,7 @@ void AliITStrackerSA::GetCoorErrors(AliITSRecPoint* cl,Float_t &sx,Float_t &sy, Double_t phi=TMath::Pi()/2+alpha; if (lay==1) phi+=TMath::Pi(); - Float_t cp=TMath::Cos(phi), sp=TMath::Sin(phi); + Double_t cp=TMath::Cos(phi), sp=TMath::Sin(phi); */ Float_t covm[6]; cl->GetGlobalCov(covm); @@ -1162,3 +1048,26 @@ void AliITStrackerSA::GetCoorErrors(AliITSRecPoint* cl,Float_t &sx,Float_t &sy, */ } +//________________________________________________________________________ +Int_t AliITStrackerSA::FindIndex(Int_t lay, Double_t lamVal) const { + // Find the cluster at limit of lambda window + + Int_t base = 0; + Int_t last = fCluCoord[lay]->GetEntriesFast()-1; + if(last<0) return 0; + Int_t position; + Double_t lamfirst=((AliITSclusterTable*)fCluCoord[lay]->At(base))->GetLambda(); + if(lamfirst>lamVal) return base; + Double_t lamlast=((AliITSclusterTable*)fCluCoord[lay]->At(last))->GetLambda(); + if(lamlast<=lamVal) return last; + while (last >= base) { + position = (base+last) / 2; + Double_t a=((AliITSclusterTable*)fCluCoord[lay]->At(position))->GetLambda()-lamVal; + Double_t b=((AliITSclusterTable*)fCluCoord[lay]->At(position+1))->GetLambda()-lamVal; + if(a*b<=0) return position; + if(a>0) last = position; + else base = position; + } + return 0; +} +