AliITSdetector &det=fgLayers[i-1].GetDetector((j-1)*ndet + k-1);
new(&det) AliITSdetector(r,phi);
+ // compute the real radius (with misalignment)
+ TGeoHMatrix mmisal(*(AliITSgeomTGeo::GetMatrix(i,j,k)));
+ mmisal.Multiply(tm);
+ xyz[0]=0.;xyz[1]=0.;xyz[2]=0.;
+ mmisal.LocalToMaster(txyz,xyz);
+ Double_t rmisal=TMath::Sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
+ det.SetRmisal(rmisal);
+
} // end loop on detectors
} // end loop on ladders
} // end loop on layers
// only for plane efficiency evaluation
if (AliITSReconstructor::GetRecoParam()->GetComputePlaneEff()) {
- for(Int_t ilay=0;ilay<6;ilay++) {
- if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(ilay)) {
- if (ilay<2) fPlaneEff = new AliITSPlaneEffSPD();
- else if (ilay<4) fPlaneEff = new AliITSPlaneEffSDD();
- else fPlaneEff = new AliITSPlaneEffSSD();
- break; // only one layer type to skip at once
- }
- }
+ Int_t iplane=AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff();
+ if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(iplane))
+ AliWarning(Form("Evaluation of Plane Eff for layer %d will be attempted without removing it from tracker",iplane));
+ if (iplane<2) fPlaneEff = new AliITSPlaneEffSPD();
+ else if (iplane<4) fPlaneEff = new AliITSPlaneEffSDD();
+ else fPlaneEff = new AliITSPlaneEffSSD();
if(AliITSReconstructor::GetRecoParam()->GetReadPlaneEffFromOCDB())
- if(!fPlaneEff->ReadFromCDB())
- {AliWarning("AliITStrackerMI reading of AliITSPlaneEff from OCDB failed") ;}
- if(AliITSReconstructor::GetRecoParam()->GetHistoPlaneEff()) {
- fPlaneEff->SetCreateHistos(kTRUE);
- //fPlaneEff->ReadHistosFromFile();
- }
+ if(!fPlaneEff->ReadFromCDB()) {AliWarning("AliITStrackerMI reading of AliITSPlaneEff from OCDB failed") ;}
+ if(AliITSReconstructor::GetRecoParam()->GetHistoPlaneEff()) fPlaneEff->SetCreateHistos(kTRUE);
}
}
//------------------------------------------------------------------------
for (fPass=0; fPass<2; fPass++) {
Int_t &constraint=fConstraint[fPass]; if (constraint<0) continue;
for (fCurrentEsdTrack=0; fCurrentEsdTrack<nentr; fCurrentEsdTrack++) {
- //cerr<<fPass<<" "<<fCurrentEsdTrack<<'\n';
AliITStrackMI *t=(AliITStrackMI*)itsTracks.UncheckedAt(fCurrentEsdTrack);
if (t==0) continue; //this track has been already tracked
+ //cout<<"========== "<<fPass<<" "<<fCurrentEsdTrack<<" =========\n";
if (t->GetReconstructed()&&(t->GetNUsed()<1.5)) continue; //this track was already "succesfully" reconstructed
Float_t dz[2]; t->GetDZ(GetX(),GetY(),GetZ(),dz); //I.B.
if (fConstraint[fPass]) {
ResetBestTrack();
FollowProlongationTree(t,fCurrentEsdTrack,fConstraint[fPass]);
+
SortTrackHypothesys(fCurrentEsdTrack,20,0); //MI change
//
if (fConstraint[fPass]&&(!besttrack->IsGoldPrimary())) continue; //to be tracked also without vertex constrain
t->SetReconstructed(kTRUE);
- ntrk++;
+ ntrk++;
}
GetBestHypothesysMIP(itsTracks);
} // end loop on the two tracking passes
cl->GetGlobalXYZ(xyz);
cl->GetGlobalCov(cov);
p.SetXYZ(xyz, cov);
-
+ p.SetCharge(cl->GetQ());
+ p.SetDriftTime(cl->GetDriftTime());
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
switch (l) {
case 0:
Float_t expQ = TMath::Max(0.8*t->GetTPCsignal(),30.);
Float_t errlocalx,errlocalz;
- AliITSClusterParam::GetError(l,cl,tgl,tgphi,expQ,errlocalx,errlocalz);
+ Bool_t addMisalErr=kFALSE;
+ AliITSClusterParam::GetError(l,cl,tgl,tgphi,expQ,errlocalx,errlocalz,addMisalErr);
Float_t xyz[3];
Float_t cov[6];
tmpcl.GetGlobalCov(cov);
p.SetXYZ(xyz, cov);
+ p.SetCharge(cl->GetQ());
+ p.SetDriftTime(cl->GetDriftTime());
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
switch (l) {
//
// follow prolongations
for (Int_t ilayer=5; ilayer>=0; ilayer--) {
+ //printf("FollowProlongationTree: layer %d\n",ilayer);
fI = ilayer;
//
AliITSlayer &layer=fgLayers[ilayer];
const AliITSdetector &det=layer.GetDetector(idet);
new(¤ttrack2) AliITStrackMI(currenttrack1);
if (!currenttrack1.Propagate(det.GetPhi(),det.GetR())) continue;
-
- LocalModuleCoord(ilayer,idet,¤ttrack1,xloc,zloc); // local module coords
currenttrack2.Propagate(det.GetPhi(),det.GetR());
currenttrack1.SetDetectorIndex(idet);
currenttrack2.SetDetectorIndex(idet);
+ LocalModuleCoord(ilayer,idet,¤ttrack1,xloc,zloc); // local module coords
//***************
- // DEFINITION OF SEARCH ROAD FOR CLUSTERS SELECTION
+ // DEFINITION OF SEARCH ROAD AND CLUSTERS SELECTION
//
- Double_t dz=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadZ()*
- TMath::Sqrt(currenttrack1.GetSigmaZ2() +
- AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
- AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
- AliITSReconstructor::GetRecoParam()->GetSigmaZ2(ilayer));
- Double_t dy=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadY()*
- TMath::Sqrt(currenttrack1.GetSigmaY2() +
- AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
- AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
- AliITSReconstructor::GetRecoParam()->GetSigmaY2(ilayer));
-
- // track at boundary between detectors, enlarge road
- Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidth();
- if ( (currenttrack1.GetY()-dy < det.GetYmin()+boundaryWidth) ||
- (currenttrack1.GetY()+dy > det.GetYmax()-boundaryWidth) ||
- (currenttrack1.GetZ()-dz < det.GetZmin()+boundaryWidth) ||
- (currenttrack1.GetZ()+dz > det.GetZmax()-boundaryWidth) ) {
- Float_t tgl = TMath::Abs(currenttrack1.GetTgl());
- if (tgl > 1.) tgl=1.;
- Double_t deltaXNeighbDets=AliITSRecoParam::GetDeltaXNeighbDets();
- dz = TMath::Sqrt(dz*dz+deltaXNeighbDets*deltaXNeighbDets*tgl*tgl);
- Float_t snp = TMath::Abs(currenttrack1.GetSnp());
- if (snp > AliITSReconstructor::GetRecoParam()->GetMaxSnp()) continue;
- dy = TMath::Sqrt(dy*dy+deltaXNeighbDets*deltaXNeighbDets*snp*snp);
- } // boundary
-
// road in global (rphi,z) [i.e. in tracking ref. system]
- Double_t zmin = currenttrack1.GetZ() - dz;
- Double_t zmax = currenttrack1.GetZ() + dz;
- Double_t ymin = currenttrack1.GetY() + r*det.GetPhi() - dy;
- Double_t ymax = currenttrack1.GetY() + r*det.GetPhi() + dy;
+ Double_t zmin,zmax,ymin,ymax;
+ if (!ComputeRoad(¤ttrack1,ilayer,idet,zmin,zmax,ymin,ymax)) continue;
// select clusters in road
layer.SelectClusters(zmin,zmax,ymin,ymax);
}
msz = 1./msz; // 1/RoadZ^2
msy = 1./msy; // 1/RoadY^2
+
//
//
// LOOP OVER ALL POSSIBLE TRACK PROLONGATIONS ON THIS LAYER
// check if the road contains a dead zone
Bool_t noClusters = kFALSE;
if (!layer.GetNextCluster(clidx,kTRUE)) noClusters=kTRUE;
- Int_t dead = CheckDeadZone(¤ttrack1,ilayer,idet,zmin,zmax,ymin,ymax,noClusters);
+ //if (noClusters) printf("no clusters in road\n");
+ Double_t dz=0.5*(zmax-zmin);
+ Double_t dy=0.5*(ymax-ymin);
+ Int_t dead = CheckDeadZone(¤ttrack1,ilayer,idet,dz,dy,noClusters);
// create a prolongation without clusters (check also if there are no clusters in the road)
if (dead ||
(noClusters &&
Int_t idetc=cl->GetDetectorIndex();
if (currenttrack->GetDetectorIndex()==idetc) { // track already on the cluster's detector
+ // take into account misalignment (bring track to real detector plane)
+ Double_t xTrOrig = currenttrack->GetX();
+ currenttrack->PropagateTo(xTrOrig+cl->GetX(),0.,0.);
// a first cut on track-cluster distance
if ( (currenttrack->GetZ()-cl->GetZ())*(currenttrack->GetZ()-cl->GetZ())*msz +
(currenttrack->GetY()-cl->GetY())*(currenttrack->GetY()-cl->GetY())*msy > 1. )
- continue; // cluster not associated to track
+ { // cluster not associated to track
+ //printf("not ass\n");
+ continue;
+ }
+ // bring track back to ideal detector plane
+ currenttrack->PropagateTo(xTrOrig,0.,0.);
} else { // have to move track to cluster's detector
const AliITSdetector &detc=layer.GetDetector(idetc);
// a first cut on track-cluster distance
Double_t y;
- if (!currenttrack2.GetProlongationFast(detc.GetPhi(),detc.GetR(),y,z)) continue;
+ if (!currenttrack2.GetProlongationFast(detc.GetPhi(),detc.GetR()+cl->GetX(),y,z)) continue;
if ( (z-cl->GetZ())*(z-cl->GetZ())*msz +
(y-cl->GetY())*(y-cl->GetY())*msy > 1. )
continue; // cluster not associated to track
// calculate track-clusters chi2
chi2trkcl = GetPredictedChi2MI(currenttrack,cl,ilayer);
// chi2 cut
+ //printf("chi2 %f max %f\n",chi2trkcl,AliITSReconstructor::GetRecoParam()->GetMaxChi2s(ilayer));
if (chi2trkcl < AliITSReconstructor::GetRecoParam()->GetMaxChi2s(ilayer)) {
if (cl->GetQ()==0) deadzoneSPD=kTRUE; // only 1 prolongation with virtual cluster
if (ntracks[ilayer]>=100) continue;
if (changedet) new (¤ttrack2) AliITStrackMI(backuptrack);
if (cl->GetQ()!=0) { // real cluster
- if (!UpdateMI(updatetrack,cl,chi2trkcl,(ilayer<<28)+clidx)) continue;
+ if (!UpdateMI(updatetrack,cl,chi2trkcl,(ilayer<<28)+clidx)) {
+ //printf("update failed\n");
+ continue;
+ }
updatetrack->SetSampledEdx(cl->GetQ(),updatetrack->GetNumberOfClusters()-1); //b.b.
modstatus = 1; // found
} else { // virtual cluster in dead zone
} //apply vertex constrain
ntracks[ilayer]++;
} // create new hypothesis
+ //else printf("chi2 too large\n");
} // loop over possible prolongations
// allow one prolongation without clusters
return m;
}
//------------------------------------------------------------------------
+Bool_t AliITStrackerMI::ComputeRoad(AliITStrackMI* track,Int_t ilayer,Int_t idet,Double_t &zmin,Double_t &zmax,Double_t &ymin,Double_t &ymax) const {
+ //--------------------------------------------------------------------
+ // This function computes the rectangular road for this track
+ //--------------------------------------------------------------------
+
+
+ AliITSdetector &det = fgLayers[ilayer].GetDetector(idet);
+ // take into account the misalignment: propagate track to misaligned detector plane
+ if (!track->Propagate(det.GetPhi(),det.GetRmisal())) return kFALSE;
+
+ Double_t dz=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadZ()*
+ TMath::Sqrt(track->GetSigmaZ2() +
+ AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
+ AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
+ AliITSReconstructor::GetRecoParam()->GetSigmaZ2(ilayer));
+ Double_t dy=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadY()*
+ TMath::Sqrt(track->GetSigmaY2() +
+ AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
+ AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
+ AliITSReconstructor::GetRecoParam()->GetSigmaY2(ilayer));
+
+ // track at boundary between detectors, enlarge road
+ Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidth();
+ if ( (track->GetY()-dy < det.GetYmin()+boundaryWidth) ||
+ (track->GetY()+dy > det.GetYmax()-boundaryWidth) ||
+ (track->GetZ()-dz < det.GetZmin()+boundaryWidth) ||
+ (track->GetZ()+dz > det.GetZmax()-boundaryWidth) ) {
+ Float_t tgl = TMath::Abs(track->GetTgl());
+ if (tgl > 1.) tgl=1.;
+ Double_t deltaXNeighbDets=AliITSRecoParam::GetDeltaXNeighbDets();
+ dz = TMath::Sqrt(dz*dz+deltaXNeighbDets*deltaXNeighbDets*tgl*tgl);
+ Float_t snp = TMath::Abs(track->GetSnp());
+ if (snp > AliITSReconstructor::GetRecoParam()->GetMaxSnp()) return kFALSE;
+ dy = TMath::Sqrt(dy*dy+deltaXNeighbDets*deltaXNeighbDets*snp*snp);
+ } // boundary
+
+ // add to the road a term (up to 2-3 mm) to deal with misalignments
+ dy = TMath::Sqrt(dy*dy + AliITSReconstructor::GetRecoParam()->GetRoadMisal()*AliITSReconstructor::GetRecoParam()->GetRoadMisal());
+ dz = TMath::Sqrt(dz*dz + AliITSReconstructor::GetRecoParam()->GetRoadMisal()*AliITSReconstructor::GetRecoParam()->GetRoadMisal());
+
+ Double_t r = fgLayers[ilayer].GetR();
+ zmin = track->GetZ() - dz;
+ zmax = track->GetZ() + dz;
+ ymin = track->GetY() + r*det.GetPhi() - dy;
+ ymax = track->GetY() + r*det.GetPhi() + dy;
+
+ // bring track back to idead detector plane
+ if (!track->Propagate(det.GetPhi(),det.GetR())) return kFALSE;
+
+ return kTRUE;
+}
+//------------------------------------------------------------------------
void AliITStrackerMI::AliITSlayer::
SelectClusters(Double_t zmin,Double_t zmax,Double_t ymin, Double_t ymax) {
//--------------------------------------------------------------------
//------------------------------------------------------------------------
AliITStrackerMI::AliITSdetector::AliITSdetector(const AliITSdetector& det):
fR(det.fR),
+fRmisal(det.fRmisal),
fPhi(det.fPhi),
fSinPhi(det.fSinPhi),
fCosPhi(det.fCosPhi),
(detType==0 && calibSPDdead->IsBad())) // TEMPORARY
{
SetBad();
- printf("lay %d bad %d\n",ilayer,idet);
+ // printf("lay %d bad %d\n",ilayer,idet);
}
// Get segmentation from AliITSDetTypeRec
if (idet<0) return kFALSE;
const AliITSdetector &det=layer.GetDetector(idet);
- phi=det.GetPhi();
- if (!track->Propagate(phi,det.GetR())) return kFALSE;
+ if (!track->Propagate(det.GetPhi(),det.GetR())) return kFALSE;
track->SetDetectorIndex(idet);
LocalModuleCoord(ilayer,idet,track,xloc,zloc); // local module coords
track->SetDetectorIndex(idet);
LocalModuleCoord(ilayer,idet,track,xloc,zloc); // local module coords
}
- //Double_t chi2=track->GetPredictedChi2(cl);
Int_t cllayer = (idx & 0xf0000000) >> 28;;
Double_t chi2=GetPredictedChi2MI(track,cl,cllayer);
if (chi2<maxchi2) {
} else { // no cluster in this layer
if (skip==1) {
modstatus = 3; // skipped
- // Plane Eff determination:
- if (planeeff && AliITSReconstructor::GetRecoParam()->GetLayersToSkip(ilayer)) {
- if (IsOKForPlaneEff(track,ilayer)) // only adequate track for plane eff. evaluation
- UseTrackForPlaneEff(track,ilayer);
+ // Plane Eff determination:
+ if (planeeff && ilayer==AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()) {
+ if (IsOKForPlaneEff(track,clusters,ilayer)) // only adequate track for plane eff. evaluation
+ UseTrackForPlaneEff(track,ilayer);
}
} else {
modstatus = 5; // no cls in road
// check dead
- dz=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadZ()*
- TMath::Sqrt(track->GetSigmaZ2() +
- AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
- AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
- AliITSReconstructor::GetRecoParam()->GetSigmaZ2(ilayer));
- zmin=track->GetZ() - dz;
- zmax=track->GetZ() + dz;
- dy=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadY()*
- TMath::Sqrt(track->GetSigmaY2() +
- AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
- AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
- AliITSReconstructor::GetRecoParam()->GetSigmaY2(ilayer));
- ymin=track->GetY() - dy;
- ymax=track->GetY() + dy;
- Int_t dead = CheckDeadZone(track,ilayer,idet,zmin,zmax,ymin,ymax,kTRUE);
+ if (!ComputeRoad(track,ilayer,idet,zmin,zmax,ymin,ymax)) return kFALSE;
+ dz = 0.5*(zmax-zmin);
+ dy = 0.5*(ymax-ymin);
+ Int_t dead = CheckDeadZone(track,ilayer,idet,dz,dy,kTRUE);
if (dead==1) modstatus = 7; // holes in z in SPD
if (dead==2 || dead==3) modstatus = 2; // dead from OCDB
}
if (extra) { // search for extra clusters in overlapped modules
AliITStrackV2 tmp(*track);
- Double_t dy,ymin,ymax;
- dz=4*TMath::Sqrt(tmp.GetSigmaZ2()+AliITSReconstructor::GetRecoParam()->GetSigmaZ2(ilayer));
- if (dz < 0.5*TMath::Abs(tmp.GetTgl())) dz=0.5*TMath::Abs(tmp.GetTgl());
- dy=4*TMath::Sqrt(track->GetSigmaY2()+AliITSReconstructor::GetRecoParam()->GetSigmaY2(ilayer));
- if (dy < 0.5*TMath::Abs(tmp.GetSnp())) dy=0.5*TMath::Abs(tmp.GetSnp());
- zmin=track->GetZ() - dz;
- zmax=track->GetZ() + dz;
- ymin=track->GetY() + phi*r - dy;
- ymax=track->GetY() + phi*r + dy;
+ if (!ComputeRoad(track,ilayer,idet,zmin,zmax,ymin,ymax)) return kFALSE;
layer.SelectClusters(zmin,zmax,ymin,ymax);
const AliITSRecPoint *clExtra=0; Int_t ci=-1,cci=-1;
const AliITSdetector &detx=layer.GetDetector(idetExtra);
- if (!tmp.Propagate(detx.GetPhi(),detx.GetR())) continue;
-
+ if (!tmp.Propagate(detx.GetPhi(),detx.GetR()+clExtra->GetX())) continue;
if (TMath::Abs(tmp.GetZ() - clExtra->GetZ()) > tolerance) continue;
if (TMath::Abs(tmp.GetY() - clExtra->GetY()) > tolerance) continue;
+ if (!tmp.Propagate(detx.GetPhi(),detx.GetR())) continue;
Double_t chi2=tmp.GetPredictedChi2(clExtra);
if (chi2<maxchi2) { maxchi2=chi2; cci=ci; }
Float_t phi = track->GetSnp();
phi = TMath::Sqrt(phi*phi/(1.-phi*phi));
AliITSClusterParam::GetError(layer,cluster,theta,phi,track->GetExpQ(),erry,errz);
+ //printf(" chi2: tr-cl %f %f tr X %f cl X %f\n",track->GetY()-cluster->GetY(),track->GetZ()-cluster->GetZ(),track->GetX(),cluster->GetX());
+
+ // Take into account the mis-alignment (bring track to cluster plane)
+ Double_t xTrOrig=track->GetX();
+ if (!track->PropagateTo(xTrOrig+cluster->GetX(),0.,0.)) return 1000.;
+ //printf(" chi2: tr-cl %f %f tr X %f cl X %f\n",track->GetY()-cluster->GetY(),track->GetZ()-cluster->GetZ(),track->GetX(),cluster->GetX());
Double_t chi2 = track->GetPredictedChi2MI(cluster->GetY(),cluster->GetZ(),erry,errz);
+ // Bring the track back to detector plane in ideal geometry
+ // [mis-alignment will be accounted for in UpdateMI()]
+ if (!track->PropagateTo(xTrOrig,0.,0.)) return 1000.;
Float_t ny,nz;
AliITSClusterParam::GetNTeor(layer,cluster,theta,phi,ny,nz);
Double_t delta = cluster->GetNy()+cluster->GetNz()-nz-ny;
if (cl->GetQ()<=0) return 0; // ingore the "virtual" clusters
- // Float_t clxyz[3]; cl->GetGlobalXYZ(clxyz);Double_t trxyz[3]; track->GetXYZ(trxyz);//printf("gtr %f %f %f\n",trxyz[0],trxyz[1],trxyz[2]);printf("gcl %f %f %f\n",clxyz[0],clxyz[1],clxyz[2]);
-
- // Take into account the mis-alignment
- Double_t x=track->GetX()+cl->GetX();
- if (!track->PropagateTo(x,0.,0.)) return 0;
+ // Take into account the mis-alignment (bring track to cluster plane)
+ Double_t xTrOrig=track->GetX();
+ //Float_t clxyz[3]; cl->GetGlobalXYZ(clxyz);Double_t trxyz[3]; track->GetXYZ(trxyz);printf("gtr %f %f %f\n",trxyz[0],trxyz[1],trxyz[2]);printf("gcl %f %f %f\n",clxyz[0],clxyz[1],clxyz[2]);
+ //printf(" xtr %f xcl %f\n",track->GetX(),cl->GetX());
+ if (!track->PropagateTo(xTrOrig+cl->GetX(),0.,0.)) return 0;
AliCluster c(*cl);
c.SetSigmaY2(track->GetSigmaY(layer)*track->GetSigmaY(layer));
c.SetSigmaZ2(track->GetSigmaZ(layer)*track->GetSigmaZ(layer));
- return track->UpdateMI(&c,chi2,index);
+
+ Int_t updated = track->UpdateMI(&c,chi2,index);
+
+ // Bring the track back to detector plane in ideal geometry
+ if (!track->PropagateTo(xTrOrig,0.,0.)) return 0;
+
+ //if(!updated) printf("update failed\n");
+ return updated;
}
//------------------------------------------------------------------------
if (fnorm0<0) fnorm0*=-3;
Float_t fnorm1 = normdist[itrack1];
if (fnorm1<0) fnorm1*=-3;
- if (pvertex->GetAnglep()[2]>0.1 || (pvertex->GetRr()<10.5)&& pvertex->GetAnglep()[2]>0.05 || pvertex->GetRr()<3){
+ if ((pvertex->GetAnglep()[2]>0.1) || ( (pvertex->GetRr()<10.5)&& pvertex->GetAnglep()[2]>0.05 ) || (pvertex->GetRr()<3)){
pb0 = TMath::Exp(-TMath::Min(fnorm0,Float_t(16.))/12.);
pb1 = TMath::Exp(-TMath::Min(fnorm1,Float_t(16.))/12.);
}
Double_t point1[3],point2[3];
Double_t phi,cosphi,sinphi,z;
// 0-5 layers, 6 pipe, 7-8 shields
- Double_t rmin[9]={ 3.5, 5.5,13.0,22.0,35.0,41.0, 2.0, 7.5,25.0};
- Double_t rmax[9]={ 5.5, 7.3,17.0,26.0,41.0,47.0, 3.0,10.5,30.0};
+ Double_t rmin[9]={ 3.5, 5.5,13.0,22.0,35.0,41.0, 2.0, 8.0,25.0};
+ Double_t rmax[9]={ 5.5, 8.0,17.0,26.0,41.0,47.0, 3.0,10.5,30.0};
Int_t ifirst=0,ilast=0;
if(material.Contains("Pipe")) {
Float_t dir = (direction.Contains("inward") ? 1. : -1.);
Double_t rToGo=(dir>0 ? AliITSRecoParam::GetrInsidePipe() : AliITSRecoParam::GetrOutsidePipe());
- Double_t xToGo; t->GetLocalXat(rToGo,xToGo);
+ Double_t xToGo;
+ if (!t->GetLocalXat(rToGo,xToGo)) return 0;
Double_t xOverX0,x0,lengthTimesMeanDensity;
Bool_t anglecorr=kTRUE;
Error("CorrectForShieldMaterial"," Wrong shield name\n");
return 0;
}
- Double_t xToGo; t->GetLocalXat(rToGo,xToGo);
+ Double_t xToGo;
+ if (!t->GetLocalXat(rToGo,xToGo)) return 0;
Int_t index=2*fCurrentEsdTrack+shieldindex;
Double_t deltar=(layerindex<2 ? 0.10*r : 0.05*r);
Double_t rToGo=TMath::Sqrt(t->GetX()*t->GetX()+t->GetY()*t->GetY())-deltar*dir;
- Double_t xToGo; t->GetLocalXat(rToGo,xToGo);
+ Double_t xToGo;
+ if (!t->GetLocalXat(rToGo,xToGo)) return 0;
Int_t index=6*fCurrentEsdTrack+layerindex;
//------------------------------------------------------------------------
Int_t AliITStrackerMI::CheckDeadZone(AliITStrackMI *track,
Int_t ilayer,Int_t idet,
- Double_t zmin,Double_t zmax,
- Double_t ymin,Double_t ymax,
+ Double_t dz,Double_t dy,
Bool_t noClusters) const {
//-----------------------------------------------------------------
// This method is used to decide whether to allow a prolongation
fSPDdetzcentre[2] - 0.5*AliITSRecoParam::GetSPDdetzlength(),
fSPDdetzcentre[3] - 0.5*AliITSRecoParam::GetSPDdetzlength()};
for (Int_t i=0; i<3; i++)
- if (zmin<zmaxdead[i] && zmax>zmindead[i]) return 1;
+ if (track->GetZ()-dz<zmaxdead[i] && track->GetZ()+dz>zmindead[i]) return 1;
}
// check bad zones from OCDB
// check if the road overlaps with bad chips
Float_t xloc,zloc;
LocalModuleCoord(ilayer,idet,track,xloc,zloc);
- Float_t zlocmin = zloc-0.5*(zmax-zmin);
- Float_t zlocmax = zloc+0.5*(zmax-zmin);
- Float_t xlocmin = xloc-0.5*(ymax-ymin);
- Float_t xlocmax = xloc+0.5*(ymax-ymin);
+ Float_t zlocmin = zloc-dz;
+ Float_t zlocmax = zloc+dz;
+ Float_t xlocmin = xloc-dy;
+ Float_t xlocmax = xloc+dy;
Int_t chipsInRoad[100];
if (TMath::Max(TMath::Abs(xlocmin),TMath::Abs(xlocmax))>0.5*detSizeX ||
Double_t xyzGlob[3],xyzLoc[3];
- track->GetXYZ(xyzGlob);
+ AliITSdetector &detector = fgLayers[ilayer].GetDetector(idet);
+ // take into account the misalignment: xyz at real detector plane
+ track->GetXYZAt(detector.GetRmisal(),GetBz(),xyzGlob);
AliITSgeomTGeo::GlobalToLocal(ilayer+1,lad,det,xyzGlob,xyzLoc);
return kTRUE;
}
//------------------------------------------------------------------------
-Bool_t AliITStrackerMI::IsOKForPlaneEff(AliITStrackMI* track, Int_t ilayer) const {
-// Method still to be implemented:
+Bool_t AliITStrackerMI::IsOKForPlaneEff(AliITStrackMI* track, const Int_t *clusters, Int_t ilayer) const {
+//
+// Method to be optimized further:
+// Aim: decide whether a track can be used for PlaneEff evaluation
+// the decision is taken based on the track quality at the layer under study
+// no information on the clusters on this layer has to be used
+// The criterium is to reject tracks at boundaries between basic block (e.g. SPD chip)
+// the cut is done on number of sigmas from the boundaries
+//
+// Input: Actual track, layer [0,5] under study
+// Output: none
+// Return: kTRUE if this is a good track
//
// it will apply a pre-selection to obtain good quality tracks.
// Here also you will have the possibility to put a control on the
// this will be done by calling a proper method of the AliITSPlaneEff class.
//
// input: AliITStrackMI* track, ilayer= layer number [0,5]
-// output: Bool_t -> kTRUE 2f usable track, kFALSE if not usable.
- if(!fPlaneEff)
+// return: Bool_t -> kTRUE if usable track, kFALSE if not usable.
+//
+ Int_t index[AliITSgeomTGeo::kNLayers];
+ Int_t k;
+ for (k=0; k<AliITSgeomTGeo::GetNLayers(); k++) index[k]=-1;
+ //
+ for (k=0; k<AliITSgeomTGeo::GetNLayers(); k++) {
+ index[k]=clusters[k];
+ }
+
+ if(!fPlaneEff)
{AliWarning("IsOKForPlaneEff: null pointer to AliITSPlaneEff"); return kFALSE;}
AliITSlayer &layer=fgLayers[ilayer];
Double_t r=layer.GetR();
- //AliITStrackV2 tmp(*track);
AliITStrackMI tmp(*track);
+// require a minimal number of cluster in other layers and eventually clusters in closest layers
+ Int_t ncl=0;
+ for(Int_t lay=AliITSgeomTGeo::kNLayers-1;lay>ilayer;lay--) {
+ AliDebug(2,Form("trak=%d lay=%d ; index=%d ESD label= %d",tmp.GetLabel(),lay,
+ tmp.GetClIndex(lay),((AliESDtrack*)tmp.GetESDtrack())->GetLabel())) ;
+ if (tmp.GetClIndex(lay)>0) ncl++;
+ }
+ Bool_t nextout = kFALSE;
+ if(ilayer==AliITSgeomTGeo::kNLayers-1) nextout=kTRUE; // you are already on the outermost layer
+ else nextout = ((tmp.GetClIndex(ilayer+1)>0)? kTRUE : kFALSE );
+ Bool_t nextin = kFALSE;
+ if(ilayer==0) nextin=kTRUE; // you are already on the innermost layer
+ else nextin = ((index[ilayer-1]>=0)? kTRUE : kFALSE );
+ if(ncl<AliITSgeomTGeo::kNLayers-(ilayer+1)-AliITSReconstructor::GetRecoParam()->GetMaxMissingClustersPlaneEff())
+ return kFALSE;
+ if(AliITSReconstructor::GetRecoParam()->GetRequireClusterInOuterLayerPlaneEff() && !nextout) return kFALSE;
+ if(AliITSReconstructor::GetRecoParam()->GetRequireClusterInInnerLayerPlaneEff() && !nextin) return kFALSE;
+ if(tmp.Pt() < AliITSReconstructor::GetRecoParam()->GetMinPtPlaneEff()) return kFALSE;
+ // if(AliITSReconstructor::GetRecoParam()->GetOnlyConstraintPlaneEff() && !tmp.GetConstrain()) return kFALSE;
+
// detector number
Double_t phi,z;
if (!tmp.GetPhiZat(r,phi,z)) return kFALSE;
Float_t locx; //
Float_t locz; //
- LocalModuleCoord(ilayer,idet,&tmp,locx,locz);
+ if(!LocalModuleCoord(ilayer,idet,&tmp,locx,locz)) return kFALSE;
UInt_t key=fPlaneEff->GetKeyFromDetLocCoord(ilayer,idet,locx,locz);
if(key>fPlaneEff->Nblock()) return kFALSE;
Float_t blockXmn,blockXmx,blockZmn,blockZmx;
if (!fPlaneEff->GetBlockBoundaries(key,blockXmn,blockXmx,blockZmn,blockZmx)) return kFALSE;
- // transform Local boundaries of the basic block into
- // Global (i.e. ALICE, not tracking reference) coordinate
- //
- Double_t a1[3]={blockXmn,0.,blockZmn};
- Double_t a2[3]={blockXmx,0.,blockZmn};
- Double_t a3[3]={blockXmn,0.,blockZmx};
- Int_t ndet=AliITSgeomTGeo::GetNDetectors(ilayer+1); // layers from 1 to 6
- Int_t lad = Int_t(idet/ndet) + 1;
- Int_t hdet = idet - (lad-1)*ndet + 1;
- Double_t xyzGlob[3];
- AliITSgeomTGeo::LocalToGlobal(ilayer+1,lad,hdet,a1,a1);
- AliITSgeomTGeo::LocalToGlobal(ilayer+1,lad,hdet,a2,a2);
- AliITSgeomTGeo::LocalToGlobal(ilayer+1,lad,hdet,a3,a3);
- Double_t gBlockYmn,gBlockYmx,gBlockZmn,gBlockZmx;
- if(a1[1]>a2[1]) {gBlockYmn=a2[1]; gBlockYmx=a1[1];}
- else {gBlockYmn=a1[1]; gBlockYmx=a2[1];}
- if(a2[2]>a3[2]) {gBlockZmn=a3[2]; gBlockZmx=a2[2];}
- else {gBlockZmn=a2[2]; gBlockZmx=a3[2];}
- AliDebug(2,Form("Boundaries in Global system Ymin=%f, Ymax=%f, Zmin=%f, Zmax=%f",
- gBlockYmn,gBlockYmx,gBlockZmn,gBlockZmx));
-
//***************
- // DEFINITION OF SEARCH ROAD FOR accepting a track
+ // DEFINITION OF SEARCH ROAD FOR accepting a track
//
//For the time being they are hard-wired, later on from AliITSRecoParam
- Double_t dz=4.*TMath::Sqrt(tmp.GetSigmaZ2()); // those are precisions in the tracking reference system
- Double_t dy=4.*TMath::Sqrt(tmp.GetSigmaY2()); // dy needs to be reduced (it is max now) if you do
- // comparison in Global Reference system
- Float_t gdz=dz;
- Float_t gdy=dy*TMath::Abs(TMath::Cos(tmp.GetAlpha()));
-
- // exclude tracks at boundary between detectors
- //Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidth();
+ // Double_t nsigx=AliITSRecoParam::GetNSigXFarFromBoundary();
+ // Double_t nsigz=AliITSRecoParam::GetNSigZFarFromBoundary();
+ Double_t nsigz=4;
+ Double_t nsigx=4;
+ Double_t dx=nsigx*TMath::Sqrt(tmp.GetSigmaY2()); // those are precisions in the tracking reference system
+ Double_t dz=nsigz*TMath::Sqrt(tmp.GetSigmaZ2()); // Use it also for the module reference system, as it is
+ // done for RecPoints
+
+ // exclude tracks at boundary between detectors
+ //Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidthPlaneEff();
Double_t boundaryWidth=0; // for the time being hard-wired, later on from AliITSRecoParam
AliDebug(2,Form("Tracking: track impact x=%f, y=%f, z=%f",tmp.GetX(), tmp.GetY(), tmp.GetZ()));
- tmp.GetXYZ(xyzGlob);
- AliDebug(2,Form("Global: track impact x=%f, y=%f, z=%f",xyzGlob[0],xyzGlob[1],xyzGlob[2]));
- //AliInfo(Form("TEST GLOBAL track y = %f, z=%f",tmp.GetY(),tmp.GetZ()));
- AliDebug(2,Form("Search Road. Tracking: dy=%f , dz=%f",dy,dz));
- AliDebug(2,Form("Search Road. Global: Gdy=%f , Gdz=%f",gdy,gdz));
- if ( (xyzGlob[1]-gdy < gBlockYmn+boundaryWidth) ||
- (xyzGlob[1]+gdy > gBlockYmx-boundaryWidth) ||
- (xyzGlob[2]-gdz < gBlockZmn+boundaryWidth) ||
- (xyzGlob[2]+gdz > gBlockZmx-boundaryWidth) ) return kFALSE;
+ AliDebug(2,Form("Local: track impact x=%f, z=%f",locx,locz));
+ AliDebug(2,Form("Search Road. Tracking: dy=%f , dz=%f",dx,dz));
+ if ( (locx-dx < blockXmn+boundaryWidth) ||
+ (locx+dx > blockXmx-boundaryWidth) ||
+ (locz-dz < blockZmn+boundaryWidth) ||
+ (locz+dz > blockZmx-boundaryWidth) ) return kFALSE;
return kTRUE;
}
//------------------------------------------------------------------------
{AliWarning("UseTrackForPlaneEff: null pointer to AliITSPlaneEff"); return;}
AliITSlayer &layer=fgLayers[ilayer];
Double_t r=layer.GetR();
- //AliITStrackV2 tmp(*track);
AliITStrackMI tmp(*track);
// detector number
if(idet<0) { AliInfo(Form("cannot find detector"));
return;}
- //Double_t trackGlobXYZ1[3];
- //tmp.GetXYZ(trackGlobXYZ1);
//propagate to the intersection with the detector plane
const AliITSdetector &det=layer.GetDetector(idet);
if (!tmp.Propagate(det.GetPhi(),det.GetR())) return;
- //Float_t xloc,zloc;
//***************
// DEFINITION OF SEARCH ROAD FOR CLUSTERS SELECTION
}*/
Float_t locx; //
Float_t locz; //
- LocalModuleCoord(ilayer,idet,&tmp,locx,locz);
+ if(!LocalModuleCoord(ilayer,idet,&tmp,locx,locz)) return;
//
AliDebug(2,Form("ilayer= %d, idet=%d, x= %f, z=%f",ilayer,idet,locx,locz));
UInt_t key=fPlaneEff->GetKeyFromDetLocCoord(ilayer,idet,locx,locz);
Float_t tr[4]={99999.,99999.,9999.,9999.}; // initialize to high values
Float_t clu[4]={-99999.,-99999.,9999.,9999.}; // (in some cases GetCov fails)
Int_t cltype[2]={-999,-999};
- Int_t ndet=AliITSgeomTGeo::GetNDetectors(ilayer+1); // layers from 1 to 6
- Int_t lad = Int_t(idet/ndet) + 1;
- Int_t hdet = idet - (lad-1)*ndet + 1;
- Double_t xyzGlob[3],xyzLoc[3],cv[21],exyzLoc[3],exyzGlob[3];
- if(tmp.GetXYZ(xyzGlob)) {
- if (AliITSgeomTGeo::GlobalToLocal(ilayer+1,lad,hdet,xyzGlob,xyzLoc)) {
- tr[0]=xyzLoc[0];
- tr[1]=xyzLoc[2];
- }
- }
- if(tmp.GetCovarianceXYZPxPyPz(cv)) {
- exyzGlob[0]=TMath::Sqrt(cv[0]);
- exyzGlob[1]=TMath::Sqrt(cv[2]);
- exyzGlob[2]=TMath::Sqrt(cv[5]);
- if (AliITSgeomTGeo::GlobalToLocalVect(AliITSgeomTGeo::GetModuleIndex(ilayer+1,lad,hdet),exyzGlob,exyzLoc)) {
- tr[2]=TMath::Abs(exyzLoc[0]);
- tr[3]=TMath::Abs(exyzLoc[2]);
- }
- }
+
+ tr[0]=locx;
+ tr[1]=locz;
+ tr[2]=TMath::Sqrt(tmp.GetSigmaY2()); // those are precisions in the tracking reference system
+ tr[3]=TMath::Sqrt(tmp.GetSigmaZ2()); // Use it also for the module reference system, as it is
+
if (found){
clu[0]=layer.GetCluster(ci)->GetDetLocalX();
clu[1]=layer.GetCluster(ci)->GetDetLocalZ();
AliCluster c(*layer.GetCluster(ci));
c.SetSigmaY2(tmp.GetSigmaY(ilayer)*tmp.GetSigmaY(ilayer));
c.SetSigmaZ2(tmp.GetSigmaZ(ilayer)*tmp.GetSigmaZ(ilayer));
- Float_t cov[6];
//if (layer.GetCluster(ci)->GetGlobalCov(cov)) // by using this, instead, you got nominal cluster errors
- if (c.GetGlobalCov(cov))
- {
- exyzGlob[0]=TMath::Sqrt(cov[0]);
- exyzGlob[1]=TMath::Sqrt(cov[3]);
- exyzGlob[2]=TMath::Sqrt(cov[5]);
- if (AliITSgeomTGeo::GlobalToLocalVect(AliITSgeomTGeo::GetModuleIndex(ilayer+1,lad,hdet),exyzGlob,exyzLoc)) {
- clu[2]=TMath::Abs(exyzLoc[0]);
- clu[3]=TMath::Abs(exyzLoc[2]);
- }
- }
+ clu[2]=TMath::Sqrt(c.GetSigmaY2());
+ clu[3]=TMath::Sqrt(c.GetSigmaZ2());
//}
}
fPlaneEff->FillHistos(key,found,tr,clu,cltype);