+
+
+
+ if(repa->GetUseBadChannelsInClusterFinderSSD()==kTRUE) {
+
+ //---------------------------------------------------------
+ // recover crosses of good 1D clusters with bad strips on the other side
+ // Note1: at first iteration skip modules with a bad side (or almost), (would produce too many fake!)
+ // Note2: for modules with a bad side see below
+
+ AliITSCalibrationSSD* cal = (AliITSCalibrationSSD*)GetResp(fModule);
+ Int_t countPbad=0, countNbad=0;
+ for(Int_t ib=0; ib<768; ib++) {
+ if(cal->IsPChannelBad(ib)) countPbad++;
+ if(cal->IsNChannelBad(ib)) countNbad++;
+ }
+ // AliInfo(Form("module %d has %d P- and %d N-bad strips",fModule,countPbad,countNbad));
+
+ if( (countPbad<100) && (countNbad<100) ) { // no bad side!!
+
+ for (Int_t i=0; i<np; i++) { // loop over Nside 1Dclusters with no crosses
+ if(cnegative[i]) continue; // if intersecting Pside clusters continue;
+
+ // for(Int_t ib=0; ib<768; ib++) { // loop over all Pstrips
+ for(Int_t ib=15; ib<753; ib++) { // loop over all Pstrips
+
+ if(cal->IsPChannelBad(ib)) { // check if strips is bad
+ Float_t yN=pos[i].GetY();
+ Float_t xt, zt;
+ seg->GetPadCxz(1.*ib, yN, xt, zt);
+
+ //----------
+ // bad Pstrip is crossing the Nside 1Dcluster -> create recpoint
+ //
+ if ( (TMath::Abs(xt)<hwSSD) && (TMath::Abs(zt)<hlSSD) ) {
+ Double_t loc[3]={xt,0.,zt},trk[3]={0.,0.,0.};
+ mT2L->MasterToLocal(loc,trk);
+ lp[0]=trk[1];
+ lp[1]=trk[2];
+ lp[4]=pos[i].GetQ(); //Q
+ for (Int_t ilab=0;ilab<10;ilab++) milab[ilab]=-2;
+ for (Int_t ilab=0;ilab<3;ilab++) milab[ilab] = pos[i].GetLabel(ilab);
+ CheckLabels2(milab);
+ milab[3]=( (i<<10) << 10 ) + idet; // pos|neg|det
+ Int_t info[3] = {pos[i].GetNd(),0,fNlayer[fModule]};
+
+ lp[2]=4.968e-06; // 0.00223*0.00223; //SigmaY2
+ lp[3]=0.012; // 0.110*0.110; //SigmaZ2
+ lp[5]=-0.00012; // out-of-diagonal element of covariance matrix
+ if (info[0]>1) {
+ lp[2]=4.80e-06;
+ lp[3]=0.0093;
+ lp[5]=0.00014;
+ }
+
+ AliITSRecPoint * cl2;
+ if(clusters){
+ cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(50);
+ }
+ else{
+ cl2 = new AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(50);
+ fDetTypeRec->AddRecPoint(*cl2);
+ }
+ ncl++;
+ } // cross is within the detector
+ //
+ //--------------
+
+ } // bad Pstrip
+
+ } // end loop over Pstrips
+
+ } // end loop over Nside 1D clusters
+
+ for (Int_t j=0; j<nn; j++) { // loop over Pside 1D clusters with no crosses
+ if(cpositive[j]) continue;
+
+ // for(Int_t ib=0; ib<768; ib++) { // loop over all Nside strips
+ for(Int_t ib=15; ib<753; ib++) { // loop over all Nside strips
+
+ if(cal->IsNChannelBad(ib)) { // check if strip is bad
+ Float_t yP=neg[j].GetY();
+ Float_t xt, zt;
+ seg->GetPadCxz(yP, 1.*ib, xt, zt);
+
+ //----------
+ // bad Nstrip is crossing the Pside 1Dcluster -> create recpoint
+ //
+ if ( (TMath::Abs(xt)<hwSSD) && (TMath::Abs(zt)<hlSSD) ) {
+ Double_t loc[3]={xt,0.,zt},trk[3]={0.,0.,0.};
+ mT2L->MasterToLocal(loc,trk);
+ lp[0]=trk[1];
+ lp[1]=trk[2];
+ lp[4]=neg[j].GetQ(); //Q
+ for (Int_t ilab=0;ilab<10;ilab++) milab[ilab]=-2;
+ for (Int_t ilab=0;ilab<3;ilab++) milab[ilab] = neg[j].GetLabel(ilab);
+ CheckLabels2(milab);
+ milab[3]=( j << 10 ) + idet; // pos|neg|det
+ Int_t info[3]={0,(Int_t)neg[j].GetNd(),fNlayer[fModule]};
+
+ lp[2]=4.968e-06; // 0.00223*0.00223; //SigmaY2
+ lp[3]=0.012; // 0.110*0.110; //SigmaZ2
+ lp[5]=-0.00012; // out-of-diagonal element of covariance matrix
+ if (info[0]>1) {
+ lp[2]=2.79e-06;
+ lp[3]=0.00935;
+ lp[5]=-4.32e-05;
+ }
+
+ AliITSRecPoint * cl2;
+ if(clusters){
+ cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(60);
+ }
+ else{
+ cl2 = new AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(60);
+ fDetTypeRec->AddRecPoint(*cl2);
+ }
+ ncl++;
+ } // cross is within the detector
+ //
+ //--------------
+
+ } // bad Nstrip
+ } // end loop over Nstrips
+ } // end loop over Pside 1D clusters
+
+ } // no bad sides
+
+ //---------------------------------------------------------
+
+ else if( (countPbad>700) && (countNbad<100) ) { // bad Pside!!
+
+ for (Int_t i=0; i<np; i++) { // loop over Nside 1Dclusters with no crosses
+ if(cnegative[i]) continue; // if intersecting Pside clusters continue;
+
+ Float_t xt, zt;
+ Float_t yN=pos[i].GetY();
+ Float_t yP=0.;
+ if (seg->GetLayer()==5) yP = yN + (7.6/1.9);
+ else yP = yN - (7.6/1.9);
+ seg->GetPadCxz(yP, yN, xt, zt);
+
+ if ( (TMath::Abs(xt)<hwSSD) && (TMath::Abs(zt)<hlSSD) ) {
+ Double_t loc[3]={xt,0.,zt},trk[3]={0.,0.,0.};
+ mT2L->MasterToLocal(loc,trk);
+ lp[0]=trk[1];
+ lp[1]=trk[2];
+ lp[4]=pos[i].GetQ(); //Q
+ for (Int_t ilab=0;ilab<10;ilab++) milab[ilab]=-2;
+ for (Int_t ilab=0;ilab<3;ilab++) milab[ilab] = pos[i].GetLabel(ilab);
+ CheckLabels2(milab);
+ milab[3]=( (i<<10) << 10 ) + idet; // pos|neg|det
+ Int_t info[3] = {(Int_t)pos[i].GetNd(),0,fNlayer[fModule]};
+
+ lp[2]=0.00098; // 0.031*0.031; //SigmaY2
+ lp[3]=1.329; // 1.15*1.15; //SigmaZ2
+ lp[5]=-0.0359;
+ if(info[0]>1) lp[2]=0.00097;
+
+ AliITSRecPoint * cl2;
+ if(clusters){
+ cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(70);
+ }
+ else{
+ cl2 = new AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(70);
+ fDetTypeRec->AddRecPoint(*cl2);
+ }
+ ncl++;
+ } // cross is within the detector
+ //
+ //--------------
+
+ } // end loop over Nside 1D clusters
+
+ } // bad Pside module
+
+ else if( (countNbad>700) && (countPbad<100) ) { // bad Nside!!
+
+ for (Int_t j=0; j<nn; j++) { // loop over Pside 1D clusters with no crosses
+ if(cpositive[j]) continue;
+
+ Float_t xt, zt;
+ Float_t yP=neg[j].GetY();
+ Float_t yN=0.;
+ if (seg->GetLayer()==5) yN = yP - (7.6/1.9);
+ else yN = yP + (7.6/1.9);
+ seg->GetPadCxz(yP, yN, xt, zt);
+
+ if ( (TMath::Abs(xt)<hwSSD) && (TMath::Abs(zt)<hlSSD) ) {
+ Double_t loc[3]={xt,0.,zt},trk[3]={0.,0.,0.};
+ mT2L->MasterToLocal(loc,trk);
+ lp[0]=trk[1];
+ lp[1]=trk[2];
+ lp[4]=neg[j].GetQ(); //Q
+ for (Int_t ilab=0;ilab<10;ilab++) milab[ilab]=-2;
+ for (Int_t ilab=0;ilab<3;ilab++) milab[ilab] = neg[j].GetLabel(ilab);
+ CheckLabels2(milab);
+ milab[3]=( j << 10 ) + idet; // pos|neg|det
+ Int_t info[3] = {0,(Int_t)neg[j].GetNd(),fNlayer[fModule]};
+
+ lp[2]=7.27e-05; // 0.0085*0.0085; //SigmaY2
+ lp[3]=1.33; // 1.15*1.15; //SigmaZ2
+ lp[5]=0.00931;
+ if(info[1]>1) lp[2]=6.91e-05;
+
+ AliITSRecPoint * cl2;
+ if(clusters){
+ cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(80);
+ }
+ else{
+ cl2 = new AliITSRecPoint(milab,lp,info);
+ cl2->SetChargeRatio(1.);
+ cl2->SetType(80);
+ fDetTypeRec->AddRecPoint(*cl2);
+ }
+ ncl++;
+ } // cross is within the detector
+ //
+ //--------------
+
+ } // end loop over Pside 1D clusters
+
+ } // bad Nside module
+
+ //---------------------------------------------------------
+
+ } // use bad channels
+
+ //cout<<ncl<<" clusters for this module"<<endl;
+