- }
- ind = 0; // the running index is reset for Layer 2
- for(Int_t module= fFirstL2; module<=fLastL2;module++){
- branch->GetEvent(module);
- Int_t nrecp2 = itsRec->GetEntries();
- for(Int_t j=0;j<nrecp2;j++){
- AliITSRecPoint *recp = (AliITSRecPoint*)itsRec->At(j);
- lc[0]=recp->GetDetLocalX();
- lc[2]=recp->GetDetLocalZ();
- geom->LtoG(module,lc,gc);
- gc[0]-=fX0;
- gc[1]-=fY0;
- xc2[ind]=gc[0];
- yc2[ind]=gc[1];
- zc2[ind]=gc[2];
- phi2[ind] = TMath::ATan2(gc[1],gc[0]);
- if(phi2[ind]<0)phi2[ind]=2*TMath::Pi()+phi2[ind];
- ind++;
- }
- detTypeRec.ResetRecPoints();
- }
-
- // Int_t nolines=0;
- for(Int_t i=0;i<nrpL1;i++){ // loop on L1 RP
- Float_t r1=TMath::Sqrt(xc1[i]*xc1[i]+yc1[i]*yc1[i]); // radius L1 RP
- for(Int_t j=0;j<nrpL2;j++){ // loop on L2 RP
- Float_t diff = TMath::Abs(phi2[j]-phi1[i]); // diff in azimuth
- if(diff>TMath::Pi())diff=2.*TMath::Pi()-diff; //diff<pi
- if(diff<fDiffPhiMax){ // cut on 10 milliradians by def.
- Float_t r2=TMath::Sqrt(xc2[j]*xc2[j]+yc2[j]*yc2[j]); // radius L2 RP
- Float_t zr0=(r2*zc1[i]-r1*zc2[j])/(r2-r1); //Z @ null radius
- fZCombf->Fill(zr0);
- fZCombc->Fill(zr0);
- fZCombv->Fill(zr0);
- Double_t pA[3];
- Double_t pB[3];
- pA[0]=xc1[i];
- pA[1]=yc1[i];
- pA[2]=zc1[i];
- pB[0]=xc2[j];
- pB[1]=yc2[j];
- pB[2]=zc2[j];
- // MakeTracklet(pA,pB,nolines);
+ for(Int_t j1=0;j1<nrecp1;j1++){
+ AliITSRecPoint *recp = (AliITSRecPoint*)prpl1.At(j1);
+ /*
+ lc1[0]=recp->GetDetLocalX();
+ lc1[2]=recp->GetDetLocalZ();
+ geom->LtoG(modul1,lc1,gc1);
+ // Global coordinates of this recpoints
+ */
+ recp->GetGlobalXYZ(gc1);
+ gc1[0]-=GetNominalPos()[0]; // Possible beam offset in the bending plane
+ gc1[1]-=GetNominalPos()[1]; // " "
+ Float_t r1=TMath::Sqrt(gc1[0]*gc1[0]+gc1[1]*gc1[1]);
+ Float_t phi1 = TMath::ATan2(gc1[1],gc1[0]);
+ if(phi1<0)phi1+=2*TMath::Pi();
+ Float_t zc1=gc1[2];
+ Float_t erz1=recp->GetSigmaZ2();
+ for(Int_t ladl2=0 ; ladl2<fLadOnLay2*2+1;ladl2++){
+ for(Int_t k=0;k<4;k++){
+ Int_t ladmod=fLadders[ladder-1]+ladl2;
+ if(ladmod>AliITSgeomTGeo::GetNLadders(2)) ladmod=ladmod-AliITSgeomTGeo::GetNLadders(2);
+ Int_t modul2=AliITSgeomTGeo::GetModuleIndex(2,ladmod,k+1);
+ if(!fUseModule[modul2]) continue;
+ branch->GetEvent(modul2);
+ Int_t nrecp2 = itsRec->GetEntries();
+ for(Int_t j2=0;j2<nrecp2;j2++){
+ recp = (AliITSRecPoint*)itsRec->At(j2);
+ /*
+ lc2[0]=recp->GetDetLocalX();
+ lc2[2]=recp->GetDetLocalZ();
+ geom->LtoG(modul2,lc2,gc2);
+ */
+ recp->GetGlobalXYZ(gc2);
+ gc2[0]-=GetNominalPos()[0];
+ gc2[1]-=GetNominalPos()[1];
+ Float_t r2=TMath::Sqrt(gc2[0]*gc2[0]+gc2[1]*gc2[1]);
+ Float_t phi2 = TMath::ATan2(gc2[1],gc2[0]);
+ if(phi2<0)phi2+=2*TMath::Pi();
+ Float_t zc2=gc2[2];
+ Float_t erz2=recp->GetSigmaZ2();
+
+ Float_t diff = TMath::Abs(phi2-phi1);
+ if(diff>TMath::Pi())diff=2.*TMath::Pi()-diff;
+ if(diff<fDiffPhiMax){
+ // Float_t tgth=(zc2[j]-zc1[i])/(r2-r1); // slope (used for multiple scattering)
+ Float_t zr0=(r2*zc1-r1*zc2)/(r2-r1); //Z @ null radius
+ Float_t ezr0q=(r2*r2*erz1+r1*r1*erz2)/(r2-r1)/(r2-r1); //error on Z @ null radius
+ /*
+ // Multiple scattering
+ ezr0q+=r1*r1*(1+tgth*tgth)*theta2L1/2; // multiple scattering in layer 1
+ ezr0q+=rBP*rBP*(1+tgth*tgth)*theta2BP/2; // multiple scattering in beam pipe
+ */
+ if(nopoints<maxdim) new(points[nopoints++])AliITSZPoint(zr0,ezr0q);
+ fZCombc->Fill(zr0);
+ }
+ }
+ detTypeRec.ResetRecPoints();
+ }