- //loop on different minNPoints
- Int_t minMinNPoints=minNPoints;
- if(AliITSReconstructor::GetRecoParam()->GetAllowProlongationWithEmptyRoad()) minMinNPoints=2;
- for(Int_t iMinNPoints=minNPoints; iMinNPoints>=minMinNPoints; iMinNPoints--) {
- //loop on the different windows
- for(Int_t nloop=0;nloop<fNloop;nloop++){
- for(Int_t ncl=0;ncl<fCluLayer[0]->GetEntries();ncl++){ //loop starting from layer 0
-
- ResetForFinding();
- Int_t pflag=0;
-
- AliITSRecPoint* cl = (AliITSRecPoint*)fCluLayer[0]->At(ncl);
-
- if(!cl) continue;
- if (cl->GetQ()<=0) continue;
-
- AliITSclusterTable* arr = (AliITSclusterTable*)GetClusterCoord(0,ncl);
- fPhic = arr->GetPhi();
- fLambdac = arr->GetLambda();
- fPhiEstimate = fPhic;
- AliITStrackSA* trs = new AliITStrackSA();
- fPoint1[0]=primaryVertex[0];
- fPoint1[1]=primaryVertex[1];
-
-
- fPoint2[0]=arr->GetX();
- fPoint2[1]=arr->GetY();
- for(Int_t i=0;i<AliITSgeomTGeo::GetNLayers();i++) nClusLay[i]=0;
- nClusLay[0] = SearchClusters(0,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
- nClusLay[1] = SearchClusters(1,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
- if(nClusLay[1]>0){
- pflag=1;
- fPoint3[0] = fPointc[0];
- fPoint3[1] = fPointc[1];
- }
- nClusLay[2] = SearchClusters(2,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
- if(nClusLay[1]==0 && nClusLay[2]==0) pflag=0;
- if(nClusLay[2]!=0 && nClusLay[1]!=0){ pflag=1; UpdatePoints();}
- if(nClusLay[2]!=0 && nClusLay[1]==0){
- pflag=1;
- fPoint3[0]=fPointc[0];
- fPoint3[1]=fPointc[1];
- }
-
- nClusLay[3] = SearchClusters(3,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
- pflag=1;
- if(nClusLay[3]!=0) UpdatePoints();
- nClusLay[4] = SearchClusters(4,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
- pflag=1;
- if(nClusLay[4]!=0) UpdatePoints();
- nClusLay[5] = SearchClusters(5,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
-
-
- Int_t layOK=0;
- //check of the candidate track
- for(Int_t nnp=0;nnp<AliITSgeomTGeo::GetNLayers();nnp++) {
- if(nClusLay[nnp]!=0) layOK+=1;
- }
-
- if(layOK>=iMinNPoints) {
- //printf("-NPOINTS: %d; MAP: %d %d %d %d %d %d\n",layOK,nClusLay[0],nClusLay[1],nClusLay[2],nClusLay[3],nClusLay[4],nClusLay[5]);
- AliITStrackV2* tr2 = 0;
- tr2 = FitTrack(trs,primaryVertex);
- if(!tr2) continue;
- //printf("-NPOINTS fit: %d\n",tr2->GetNumberOfClusters());
-
- StoreTrack(tr2,event);
- ntrack++;
- }
- delete trs;
- }//end loop on clusters of layer1
- }//end loop on windows
- }//end loop on min points
-
-
- minNPoints--;
-
- //if 5/6 points are required, second loop starting
- //from second layer (SPD2), to find tracks with point of
- //layer 1 missing. Not done for cosmics.
- if(!fSixPoints && fOuterStartLayer==0) {
- //printf("looking from SPD2\n");
- // counter for clusters on each layer
- for(Int_t nloop=0;nloop<fNloop;nloop++){
- Int_t ncl2=fCluLayer[1]->GetEntries();
- while(ncl2--){ //loop starting from layer 2
- ResetForFinding();
- Int_t pflag=0;
- AliITSRecPoint* cl = (AliITSRecPoint*)fCluLayer[1]->At(ncl2);
-
- if(!cl) continue;
- AliITSclusterTable* arr = (AliITSclusterTable*)GetClusterCoord(1,ncl2);
- fPhic = arr->GetPhi();
- fLambdac = arr->GetLambda();
- fPhiEstimate = fPhic;
-
- AliITStrackSA* trs = new AliITStrackSA();
- fPoint1[0]=primaryVertex[0];
- fPoint1[1]=primaryVertex[1];
-
- fPoint2[0]=arr->GetX();
- fPoint2[1]=arr->GetY();
- for(Int_t kk=0;kk<AliITSgeomTGeo::GetNLayers();kk++) nClusLay[kk] = 0;
- nClusLay[0] = SearchClusters(1,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag);
- nClusLay[1] = SearchClusters(2,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag);
- if(nClusLay[1]!=0){
- pflag=1;
- fPoint3[0]=fPointc[0];
- fPoint3[1]=fPointc[1];
- }
- nClusLay[2]= SearchClusters(3,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag);
- if(nClusLay[2]!=0){
- pflag=1;
- UpdatePoints();
- }
- nClusLay[3]= SearchClusters(4,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag);
- if(nClusLay[3]!=0){
- pflag=1;
- UpdatePoints();
- }
- nClusLay[4]=SearchClusters(5,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag);
-
- Int_t layOK=0;
- for(Int_t nnp=0;nnp<AliITSgeomTGeo::GetNLayers()-1;nnp++){
- if(nClusLay[nnp]!=0) layOK+=1;
- }
- if(layOK>=minNPoints){ // 5/6
- //printf("--NPOINTS: %d; MAP: %d %d %d %d %d %d\n",layOK,nClusLay[0],nClusLay[1],nClusLay[2],nClusLay[3],nClusLay[4],nClusLay[5]);
-
- AliITStrackV2* tr2 = 0;
- tr2 = FitTrack(trs,primaryVertex);
- if(!tr2) continue;
- //printf("--NPOINTS fit: %d\n",tr2->GetNumberOfClusters());
-
- StoreTrack(tr2,event);
- ntrack++;
-
- }
-
- delete trs;
- }//end loop on clusters of layer2
- }
-
- } //end opt="5/6"
-
- // search for tracks starting from SPD2, SDD1, SDD2, SSD2
- // for cosmics (A. Dainese 31.07.07)
- if(fOuterStartLayer>0 && !AliITSReconstructor::GetRecoParam()->GetAllowProlongationWithEmptyRoad()) {
- for(Int_t innLay=1; innLay<=fOuterStartLayer; innLay++) {
- //printf("Searching from layer %d outward\n",innLay);
- minNPoints=AliITSgeomTGeo::GetNLayers()-innLay;
- for(Int_t i=innLay;i<AliITSgeomTGeo::GetNLayers();i++)
- if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(i))