#include <TRandom.h>
+#include "AliLog.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
#include "AliESDVertex.h"
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);
}
}
//------------------------------------------------------------------------
if(!AliITSReconstructor::GetRecoParam()->GetUseBadZonesFromOCDB()) return;
- Info("ReadBadFromDetTypeRec","Reading info about bad ITS detectors and channels\n");
+ Info("ReadBadFromDetTypeRec","Reading info about bad ITS detectors and channels");
if(!fDetTypeRec) Error("ReadBadFromDetTypeRec","AliITSDetTypeRec nof found!\n");
// ITS channels map
if(fITSChannelStatus) delete fITSChannelStatus;
- fITSChannelStatus = new AliITSChannelStatus(AliCDBManager::Instance());
+ fITSChannelStatus = new AliITSChannelStatus(fDetTypeRec);
// ITS detectors and chips
Int_t i=0,j=0,k=0,ndet=0;
for (i=1; i<AliITSgeomTGeo::GetNLayers()+1; i++) {
+ Int_t nBadDetsPerLayer=0;
ndet=AliITSgeomTGeo::GetNDetectors(i);
for (j=1; j<AliITSgeomTGeo::GetNLadders(i)+1; j++) {
for (k=1; k<ndet+1; k++) {
AliITSdetector &det=fgLayers[i-1].GetDetector((j-1)*ndet + k-1);
det.ReadBadDetectorAndChips(i-1,(j-1)*ndet + k-1,fDetTypeRec);
+ if(det.IsBad()) {nBadDetsPerLayer++;}
} // end loop on detectors
} // end loop on ladders
+ Info("ReadBadFromDetTypeRec",Form("Layer %d: %d bad out of %d",i-1,nBadDetsPerLayer,ndet*AliITSgeomTGeo::GetNLadders(i)));
} // end loop on layers
return;
Info("Clusters2Tracks", "Number of ESD tracks: %d\n", nentr);
while (nentr--) {
AliESDtrack *esd=event->GetTrack(nentr);
+ // ---- for debugging:
+ //if(TMath::Abs(esd->GetX()-83.65)<0.1) { FILE *f=fopen("tpc.dat","a"); fprintf(f,"%f %f %f %f %f %f\n",(Float_t)event->GetEventNumberInFile(),(Float_t)TMath::Abs(esd->GetLabel()),(Float_t)esd->GetX(),(Float_t)esd->GetY(),(Float_t)esd->GetZ(),(Float_t)esd->Pt()); fclose(f); }
if ((esd->GetStatus()&AliESDtrack::kTPCin)==0) continue;
if (esd->GetStatus()&AliESDtrack::kTPCout) continue;
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]) {
}
Int_t tpcLabel=t->GetLabel(); //save the TPC track label
+ AliDebug(2,Form("LABEL %d pass %d",tpcLabel,fPass));
fI = 6;
ResetTrackToFollow(*t);
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++;
+ AliDebug(2,Form("TRACK! (label %d) ncls %d",besttrack->GetLabel(),besttrack->GetNumberOfClusters()));
}
GetBestHypothesysMIP(itsTracks);
} // end loop on the two tracking passes
//Refitting...
Bool_t pe=AliITSReconstructor::GetRecoParam()->GetComputePlaneEff();
+ AliDebug(2,Form("Refit LABEL %d %d",t->GetLabel(),t->GetNumberOfClusters()));
if (RefitAt(AliITSRecoParam::GetrInsideSPD1(),&fTrackToFollow,t,kTRUE,pe)) {
+ AliDebug(2," refit OK");
fTrackToFollow.SetLabel(t->GetLabel());
// fTrackToFollow.CookdEdx();
CookdEdx(&fTrackToFollow);
AliESDtrack *esdTrack =fTrackToFollow.GetESDtrack();
//printf(" %d\n",esdTrack->GetITSModuleIndex(0));
//esdTrack->UpdateTrackParams(&fTrackToFollow,AliESDtrack::kITSrefit); //original line
- Float_t r[3]={0.,0.,0.};
+ Double_t r[3]={0.,0.,0.};
Double_t maxD=3.;
esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD);
ntrk++;
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:
Int_t c=(index & 0x0fffffff) >> 00;
const AliITSRecPoint *cl = fgLayers[l].GetCluster(c);
Int_t idet = cl->GetDetectorIndex();
+
const AliITSdetector &det=fgLayers[l].GetDetector(idet);
// tgphi and tglambda of the track in tracking frame with alpha=det.GetPhi
detxy[1] = det.GetR()*TMath::Sin(det.GetPhi());
Double_t alpha = t->GetAlpha();
Double_t xdetintrackframe = detxy[0]*TMath::Cos(alpha)+detxy[1]*TMath::Sin(alpha);
- Float_t phi = TMath::ASin(t->GetSnpAt(xdetintrackframe,AliTracker::GetBz()));
+ Float_t phi = TMath::ASin(t->GetSnpAt(xdetintrackframe,GetBz()));
phi += alpha-det.GetPhi();
Float_t tgphi = TMath::Tan(phi);
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) {
break;
};
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,idet);
+
p.SetVolumeID((UShort_t)volid);
return kTRUE;
}
//
// follow prolongations
for (Int_t ilayer=5; ilayer>=0; ilayer--) {
+ AliDebug(2,Form("FollowProlongationTree: layer %d",ilayer));
fI = ilayer;
//
AliITSlayer &layer=fgLayers[ilayer];
Int_t idet=layer.FindDetectorIndex(phi,z);
Double_t trackGlobXYZ1[3];
- currenttrack1.GetXYZ(trackGlobXYZ1);
+ if (!currenttrack1.GetXYZ(trackGlobXYZ1)) continue;
// Get the budget to the primary vertex for the current track being prolonged
Double_t budgetToPrimVertex = GetEffectiveThickness();
if (skip) {
AliITStrackMI* vtrack = new (&tracks[ilayer][ntracks[ilayer]]) AliITStrackMI(currenttrack1);
// propagate to the layer radius
- Double_t xToGo; vtrack->GetLocalXat(r,xToGo);
- vtrack->AliExternalTrackParam::PropagateTo(xToGo,GetBz());
+ Double_t xToGo; if (!vtrack->GetLocalXat(r,xToGo)) continue;
+ if(!vtrack->Propagate(xToGo)) continue;
// apply correction for material of the current layer
CorrectForLayerMaterial(vtrack,ilayer,trackGlobXYZ1,"inward");
vtrack->SetNDeadZone(vtrack->GetNDeadZone()+1);
vtrack->SetClIndex(ilayer,0);
modstatus = (skip==1 ? 3 : 4); // skipped : out in z
- LocalModuleCoord(ilayer,idet,vtrack,xloc,zloc); // local module coords
- vtrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
+ if(LocalModuleCoord(ilayer,idet,vtrack,xloc,zloc)) { // local module coords
+ vtrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
+ }
if(constrain) vtrack->Improve(budgetToPrimVertex,xyzVtx,ersVtx);
ntracks[ilayer]++;
continue;
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());
+ if (!currenttrack2.Propagate(det.GetPhi(),det.GetR())) continue;
currenttrack1.SetDetectorIndex(idet);
currenttrack2.SetDetectorIndex(idet);
+ if(!LocalModuleCoord(ilayer,idet,¤ttrack1,xloc,zloc)) continue; // 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) AliDebug(2,"no clusters in road");
+ Double_t dz=0.5*(zmax-zmin);
+ Double_t dy=0.5*(ymax-ymin);
+ Int_t dead = CheckDeadZone(¤ttrack1,ilayer,idet,dz,dy,noClusters);
+ if(dead) AliDebug(2,Form("DEAD (%d)\n",dead));
// 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();
+ if (!currenttrack->Propagate(xTrOrig+cl->GetX())) continue;
// 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
+ AliDebug(2,"not associated");
+ continue;
+ }
+ // bring track back to ideal detector plane
+ if (!currenttrack->Propagate(xTrOrig)) continue;
} 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
+ AliDebug(2,Form("chi2 %f max %f",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)) {
+ AliDebug(2,"update failed");
+ continue;
+ }
updatetrack->SetSampledEdx(cl->GetQ(),updatetrack->GetNumberOfClusters()-1); //b.b.
modstatus = 1; // found
} else { // virtual cluster in dead zone
if (changedet) {
Float_t xlocnewdet,zlocnewdet;
- LocalModuleCoord(ilayer,idet,updatetrack,xlocnewdet,zlocnewdet); // local module coords
- updatetrack->SetModuleIndexInfo(ilayer,idet,modstatus,xlocnewdet,zlocnewdet);
+ if(LocalModuleCoord(ilayer,idet,updatetrack,xlocnewdet,zlocnewdet)) { // local module coords
+ updatetrack->SetModuleIndexInfo(ilayer,idet,modstatus,xlocnewdet,zlocnewdet);
+ }
} else {
updatetrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
}
} //apply vertex constrain
ntracks[ilayer]++;
} // create new hypothesis
+ else {
+ AliDebug(2,"chi2 too large");
+ }
+
} // 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),
// Get calibration from AliITSDetTypeRec
AliITSCalibration *calib = (AliITSCalibration*)detTypeRec->GetCalibrationModel(idet);
+ calib->SetModuleIndex(idet);
AliITSCalibration *calibSPDdead = 0;
if(detType==0) calibSPDdead = (AliITSCalibration*)detTypeRec->GetSPDDeadModel(idet); // TEMPORARY
if (calib->IsBad() ||
(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
for (Int_t iCh=0;iCh<fNChips;iCh++) {
fChipIsBad[iCh] = calib->IsChipBad(iCh);
if (detType==0 && calibSPDdead->IsChipBad(iCh)) fChipIsBad[iCh] = kTRUE; // TEMPORARY
+ //if(fChipIsBad[iCh]) {printf("lay %d det %d bad chip %d\n",ilayer,idet,iCh);}
}
return;
// remember old position [SR, GSI 18.02.2003]
Double_t oldX=0., oldY=0., oldZ=0.;
if (track->IsStartedTimeIntegral() && step==1) {
- track->GetGlobalXYZat(track->GetX(),oldX,oldY,oldZ);
+ if (!track->GetGlobalXYZat(track->GetX(),oldX,oldY,oldZ)) return kFALSE;
}
//
Double_t oldGlobXYZ[3];
- track->GetXYZ(oldGlobXYZ);
+ if (!track->GetXYZ(oldGlobXYZ)) return kFALSE;
+ //TMath::Sqrt(track->GetSigmaY2());
Double_t phi,z;
if (!track->GetPhiZat(r,phi,z)) return kFALSE;
Int_t skip = CheckSkipLayer(track,ilayer,idet);
if (skip==2) {
// propagate to the layer radius
- Double_t xToGo; track->GetLocalXat(r,xToGo);
- track->AliExternalTrackParam::PropagateTo(xToGo,GetBz());
+ Double_t xToGo; if (!track->GetLocalXat(r,xToGo)) return kFALSE;
+ if (!track->Propagate(xToGo)) return kFALSE;
// apply correction for material of the current layer
CorrectForLayerMaterial(track,ilayer,oldGlobXYZ,dir);
modstatus = 4; // out in z
- LocalModuleCoord(ilayer,idet,track,xloc,zloc); // local module coords
- track->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
+ if(LocalModuleCoord(ilayer,idet,track,xloc,zloc)) { // local module coords
+ track->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
+ }
// track time update [SR, GSI 17.02.2003]
if (track->IsStartedTimeIntegral() && step==1) {
Double_t newX, newY, newZ;
- track->GetGlobalXYZat(track->GetX(),newX,newY,newZ);
+ if (!track->GetGlobalXYZat(track->GetX(),newX,newY,newZ)) return kFALSE;
Double_t dL2 = (oldX-newX)*(oldX-newX) + (oldY-newY)*(oldY-newY) +
(oldZ-newZ)*(oldZ-newZ);
track->AddTimeStep(TMath::Sqrt(dL2));
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
+ if(!LocalModuleCoord(ilayer,idet,track,xloc,zloc)) return kFALSE; // local module coords
Double_t dz,zmin,zmax,dy,ymin,ymax;
const AliITSdetector &detc=layer.GetDetector(idet);
if (!track->Propagate(detc.GetPhi(),detc.GetR())) return kFALSE;
track->SetDetectorIndex(idet);
- LocalModuleCoord(ilayer,idet,track,xloc,zloc); // local module coords
+ if(!LocalModuleCoord(ilayer,idet,track,xloc,zloc)) return kFALSE; // 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; }
// track time update [SR, GSI 17.02.2003]
if (track->IsStartedTimeIntegral() && step==1) {
Double_t newX, newY, newZ;
- track->GetGlobalXYZat(track->GetX(),newX,newY,newZ);
+ if (!track->GetGlobalXYZat(track->GetX(),newX,newY,newZ)) return kFALSE;
Double_t dL2 = (oldX-newX)*(oldX-newX) + (oldY-newY)*(oldY-newY) +
(oldZ-newZ)*(oldZ-newZ);
track->AddTimeStep(TMath::Sqrt(dL2));
{
//
// return matching chi2 between two tracks
+ Double_t largeChi2=1000.;
+
AliITStrackMI track3(*track2);
- track3.Propagate(track1->GetAlpha(),track1->GetX());
+ if (!track3.Propagate(track1->GetAlpha(),track1->GetX())) return largeChi2;
TMatrixD vec(5,1);
vec(0,0)=track1->GetY() - track3.GetY();
vec(1,0)=track1->GetZ() - track3.GetZ();
for (Int_t ind=0;ind<3;ind++){
if (tpcLabel>0)
if (cl->GetLabel(ind)==tpcLabel) isWrong=0;
+ AliDebug(2,Form("icl %d ilab %d lab %d",i,ind,cl->GetLabel(ind)));
}
track->SetChi2MIP(9,track->GetChi2MIP(9)+isWrong*(2<<l));
nwrong+=isWrong;
else
track->SetLabel(tpcLabel);
}
+ AliDebug(2,Form(" nls %d wrong %d label %d tpcLabel %d\n",nclusters,nwrong,track->GetLabel(),tpcLabel));
}
//------------------------------------------------------------------------
Float_t erry,errz;
Float_t theta = track->GetTgl();
Float_t phi = track->GetSnp();
- phi = TMath::Sqrt(phi*phi/(1.-phi*phi));
+ phi = TMath::Abs(phi)*TMath::Sqrt(1./((1.-phi)*(1.+phi)));
AliITSClusterParam::GetError(layer,cluster,theta,phi,track->GetExpQ(),erry,errz);
+ AliDebug(2,Form(" chi2: tr-cl %f %f tr X %f cl X %f",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->Propagate(xTrOrig+cluster->GetX())) return 1000.;
+ AliDebug(2,Form(" chi2: tr-cl %f %f tr X %f cl X %f",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->Propagate(xTrOrig)) return 1000.;
Float_t ny,nz;
AliITSClusterParam::GetNTeor(layer,cluster,theta,phi,ny,nz);
Double_t delta = cluster->GetNy()+cluster->GetNz()-nz-ny;
track->SetSigmaY(layer,erry);
track->SetSigmaZ(layer, errz);
//track->fNormQ[layer] = cluster->GetQ()/TMath::Sqrt(1+theta*theta+phi*phi);
- track->SetNormQ(layer,cluster->GetQ()/TMath::Sqrt((1.+ track->GetTgl()*track->GetTgl())/(1.- track->GetSnp()*track->GetSnp())));
+ track->SetNormQ(layer,cluster->GetQ()/TMath::Sqrt((1.+ track->GetTgl()*track->GetTgl())/((1.-track->GetSnp())*(1.+track->GetSnp()))));
return chi2;
}
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 (bring track to cluster plane)
+ Double_t xTrOrig=track->GetX();
+ Float_t clxyz[3]; cl->GetGlobalXYZ(clxyz);Double_t trxyz[3]; track->GetXYZ(trxyz);
+ AliDebug(2,Form("gtr %f %f %f",trxyz[0],trxyz[1],trxyz[2]));
+ AliDebug(2,Form("gcl %f %f %f",clxyz[0],clxyz[1],clxyz[2]));
+ AliDebug(2,Form(" xtr %f xcl %f",track->GetX(),cl->GetX()));
- // Take into account the mis-alignment
- Double_t x=track->GetX()+cl->GetX();
- if (!track->PropagateTo(x,0.,0.)) return 0;
-
+ if (!track->Propagate(xTrOrig+cl->GetX())) 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->Propagate(xTrOrig)) return 0;
+
+ if(!updated) AliDebug(2,"update failed");
+ return updated;
}
//------------------------------------------------------------------------
//I.B. trackat0 = *bestLong;
new (&trackat0) AliITStrackMI(*bestLong);
Double_t xx,yy,zz,alpha;
- bestLong->GetGlobalXYZat(bestLong->GetX(),xx,yy,zz);
+ if (!bestLong->GetGlobalXYZat(bestLong->GetX(),xx,yy,zz)) continue;
alpha = TMath::ATan2(yy,xx);
- trackat0.Propagate(alpha,0);
+ if (!trackat0.Propagate(alpha,0)) continue;
// calculate normalized distances to the vertex
//
Float_t ptfac = (1.+100.*TMath::Abs(trackat0.GetC()));
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")) {
// Define budget mode:
// 0: material from AliITSRecoParam (hard coded)
- // 1: material from TGeo (on the fly)
+ // 1: material from TGeo in one step (on the fly)
// 2: material from lut
- // 3: material from TGeo (same for all hypotheses)
+ // 3: material from TGeo in one step (same for all hypotheses)
Int_t mode;
switch(fUseTGeo) {
case 0:
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;
xOverX0 = AliITSRecoParam::GetdPipe();
x0 = AliITSRecoParam::GetX0Be();
lengthTimesMeanDensity = xOverX0*x0;
+ lengthTimesMeanDensity *= dir;
+ if (!t->Propagate(xToGo)) return 0;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
case 1:
if (!t->PropagateToTGeo(xToGo,1)) return 0;
- return 1;
break;
case 2:
if(fxOverX0Pipe<0) BuildMaterialLUT("Pipe");
xOverX0 = fxOverX0Pipe;
lengthTimesMeanDensity = fxTimesRhoPipe;
+ lengthTimesMeanDensity *= dir;
+ if (!t->Propagate(xToGo)) return 0;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
case 3:
if(!fxOverX0PipeTrks || index<0 || index>=fNtracks) Error("CorrectForPipeMaterial","Incorrect usage of UseTGeo option!\n");
if(fxOverX0PipeTrks[index]<0) {
if (!t->PropagateToTGeo(xToGo,1,xOverX0,lengthTimesMeanDensity)) return 0;
Double_t angle=TMath::Sqrt((1.+t->GetTgl()*t->GetTgl())/
- (1.-t->GetSnp()*t->GetSnp()));
+ ((1.-t->GetSnp())*(1.+t->GetSnp())));
fxOverX0PipeTrks[index] = TMath::Abs(xOverX0)/angle;
fxTimesRhoPipeTrks[index] = TMath::Abs(lengthTimesMeanDensity)/angle;
return 1;
}
xOverX0 = fxOverX0PipeTrks[index];
lengthTimesMeanDensity = fxTimesRhoPipeTrks[index];
+ lengthTimesMeanDensity *= dir;
+ if (!t->Propagate(xToGo)) return 0;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
}
- lengthTimesMeanDensity *= dir;
-
- if (!t->AliExternalTrackParam::PropagateTo(xToGo,GetBz())) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
-
return 1;
}
//------------------------------------------------------------------------
// Define budget mode:
// 0: material from AliITSRecoParam (hard coded)
- // 1: material from TGeo (on the fly)
+ // 1: material from TGeo in steps of X cm (on the fly)
+ // X = AliITSRecoParam::GetStepSizeTGeo()
// 2: material from lut
- // 3: material from TGeo (same for all hypotheses)
+ // 3: material from TGeo in one step (same for all hypotheses)
Int_t mode;
switch(fUseTGeo) {
case 0:
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 xOverX0,x0,lengthTimesMeanDensity;
Bool_t anglecorr=kTRUE;
+ Int_t nsteps=1;
switch(mode) {
case 0:
xOverX0 = AliITSRecoParam::Getdshield(shieldindex);
x0 = AliITSRecoParam::GetX0shield(shieldindex);
lengthTimesMeanDensity = xOverX0*x0;
+ lengthTimesMeanDensity *= dir;
+ if (!t->Propagate(xToGo)) return 0;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
case 1:
- if (!t->PropagateToTGeo(xToGo,1)) return 0;
- return 1;
+ nsteps= (Int_t)(TMath::Abs(t->GetX()-xToGo)/AliITSReconstructor::GetRecoParam()->GetStepSizeTGeo())+1;
+ if (!t->PropagateToTGeo(xToGo,nsteps)) return 0; // cross the material and apply correction
break;
case 2:
if(fxOverX0Shield[shieldindex]<0) BuildMaterialLUT("Shields");
xOverX0 = fxOverX0Shield[shieldindex];
lengthTimesMeanDensity = fxTimesRhoShield[shieldindex];
+ lengthTimesMeanDensity *= dir;
+ if (!t->Propagate(xToGo)) return 0;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
case 3:
if(!fxOverX0ShieldTrks || index<0 || index>=2*fNtracks) Error("CorrectForShieldMaterial","Incorrect usage of UseTGeo option!\n");
if(fxOverX0ShieldTrks[index]<0) {
if (!t->PropagateToTGeo(xToGo,1,xOverX0,lengthTimesMeanDensity)) return 0;
Double_t angle=TMath::Sqrt((1.+t->GetTgl()*t->GetTgl())/
- (1.-t->GetSnp()*t->GetSnp()));
+ ((1.-t->GetSnp())*(1.+t->GetSnp())));
fxOverX0ShieldTrks[index] = TMath::Abs(xOverX0)/angle;
fxTimesRhoShieldTrks[index] = TMath::Abs(lengthTimesMeanDensity)/angle;
return 1;
}
xOverX0 = fxOverX0ShieldTrks[index];
lengthTimesMeanDensity = fxTimesRhoShieldTrks[index];
+ lengthTimesMeanDensity *= dir;
+ if (!t->Propagate(xToGo)) return 0;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
}
- lengthTimesMeanDensity *= dir;
-
- if (!t->AliExternalTrackParam::PropagateTo(xToGo,GetBz())) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
-
return 1;
}
//------------------------------------------------------------------------
// Define budget mode:
// 0: material from AliITSRecoParam (hard coded)
- // 1: material from TGeo (on the fly)
+ // 1: material from TGeo in stepsof X cm (on the fly)
+ // X = AliITSRecoParam::GetStepSizeTGeo()
// 2: material from lut
- // 3: material from TGeo (same for all hypotheses)
+ // 3: material from TGeo in one step (same for all hypotheses)
Int_t mode;
switch(fUseTGeo) {
case 0:
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;
- // Bring the track beyond the material
- if (!t->AliExternalTrackParam::PropagateTo(xToGo,GetBz())) return 0;
- Double_t globXYZ[3];
- t->GetXYZ(globXYZ);
Double_t xOverX0=0.0,x0=0.0,lengthTimesMeanDensity=0.0;
Double_t mparam[7];
Bool_t anglecorr=kTRUE;
+ Int_t nsteps=1;
+ Double_t rOld,xOld;
+ Bool_t addTime = kFALSE;
switch(mode) {
case 0:
xOverX0 = fgLayers[layerindex].GetThickness(t->GetY(),t->GetZ(),x0);
lengthTimesMeanDensity = xOverX0*x0;
+ // Bring the track beyond the material
+ if (!t->Propagate(xToGo)) return 0;
+ lengthTimesMeanDensity *= dir;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
case 1:
- AliTracker::MeanMaterialBudget(oldGlobXYZ,globXYZ,mparam);
- if(mparam[1]>900000) return 0;
- xOverX0=mparam[1];
- lengthTimesMeanDensity=mparam[0]*mparam[4];
- anglecorr=kFALSE;
+ rOld=TMath::Sqrt(oldGlobXYZ[0]*oldGlobXYZ[0]+oldGlobXYZ[1]*oldGlobXYZ[1]);
+ if (!t->GetLocalXat(rOld,xOld)) return 0;
+ if (!t->Propagate(xOld)) return 0; // back before material (no correction)
+ nsteps = (Int_t)(TMath::Abs(xOld-xToGo)/AliITSReconstructor::GetRecoParam()->GetStepSizeTGeo())+1;
+ if (!t->PropagateToTGeo(xToGo,nsteps,addTime)) return 0; // cross the material and apply correction
break;
case 2:
if(fxOverX0Layer[layerindex]<0) BuildMaterialLUT("Layers");
xOverX0 = fxOverX0Layer[layerindex];
lengthTimesMeanDensity = fxTimesRhoLayer[layerindex];
+ // Bring the track beyond the material
+ if (!t->Propagate(xToGo)) return 0;
+ lengthTimesMeanDensity *= dir;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
case 3:
if(!fxOverX0LayerTrks || index<0 || index>=6*fNtracks) Error("CorrectForLayerMaterial","Incorrect usage of UseTGeo option!\n");
- if(fxOverX0LayerTrks[index]<0) {
+ // Bring the track beyond the material
+ if (!t->Propagate(xToGo)) return 0;
+ Double_t globXYZ[3];
+ if (!t->GetXYZ(globXYZ)) return 0;
+ if (fxOverX0LayerTrks[index]<0) {
AliTracker::MeanMaterialBudget(oldGlobXYZ,globXYZ,mparam);
if(mparam[1]>900000) return 0;
Double_t angle=TMath::Sqrt((1.+t->GetTgl()*t->GetTgl())/
- (1.-t->GetSnp()*t->GetSnp()));
+ ((1.-t->GetSnp())*(1.+t->GetSnp())));
xOverX0=mparam[1]/angle;
lengthTimesMeanDensity=mparam[0]*mparam[4]/angle;
fxOverX0LayerTrks[index] = TMath::Abs(xOverX0);
}
xOverX0 = fxOverX0LayerTrks[index];
lengthTimesMeanDensity = fxTimesRhoLayerTrks[index];
+ lengthTimesMeanDensity *= dir;
+ if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
break;
}
- lengthTimesMeanDensity *= dir;
-
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
-
return 1;
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
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]) {
+ AliDebug(2,Form("crack SPD %d",ilayer));
+ return 1;
+ }
}
// check bad zones from OCDB
AliITSdetector &det=fgLayers[ilayer].GetDetector(idet);
- // check if this detector is bad
- if (det.IsBad()) {
- //printf("lay %d bad detector %d\n",ilayer,idet);
- return 2;
- }
-
Int_t detType=-1;
Float_t detSizeFactorX=0.0001,detSizeFactorZ=0.0001;
if (ilayer==0 || ilayer==1) { // ---------- SPD
// 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 ||
- TMath::Max(TMath::Abs(zlocmin),TMath::Abs(zlocmax))>0.5*detSizeZ) return 0;
- //printf("lay %d det %d zmim zmax %f %f xmin xmax %f %f %f %f\n",ilayer,idet,zlocmin,zlocmax,xlocmin,xlocmax,segm->Dx(),segm->Dz());
+ // check if road goes out of detector
+ Bool_t touchNeighbourDet=kFALSE;
+ if (TMath::Abs(xlocmin)>0.5*detSizeX) {xlocmin=-0.5*detSizeX; touchNeighbourDet=kTRUE;}
+ if (TMath::Abs(xlocmax)>0.5*detSizeX) {xlocmax=+0.5*detSizeX; touchNeighbourDet=kTRUE;}
+ if (TMath::Abs(zlocmin)>0.5*detSizeZ) {zlocmin=-0.5*detSizeZ; touchNeighbourDet=kTRUE;}
+ if (TMath::Abs(zlocmax)>0.5*detSizeZ) {zlocmax=+0.5*detSizeZ; touchNeighbourDet=kTRUE;}
+ AliDebug(2,Form("layer %d det %d zmim zmax %f %f xmin xmax %f %f %f %f",ilayer,idet,zlocmin,zlocmax,xlocmin,xlocmax,detSizeZ,detSizeX));
+
+ // check if this detector is bad
+ if (det.IsBad()) {
+ AliDebug(2,Form("lay %d bad detector %d",ilayer,idet));
+ if(!touchNeighbourDet) {
+ return 2; // all detectors in road are bad
+ } else {
+ return 3; // at least one is bad
+ }
+ }
+
Int_t nChipsInRoad = segm->GetChipsInLocalWindow(chipsInRoad,zlocmin,zlocmax,xlocmin,xlocmax);
- //printf("lay %d nChipsInRoad %d\n",ilayer,nChipsInRoad);
+ AliDebug(2,Form("lay %d nChipsInRoad %d",ilayer,nChipsInRoad));
if (!nChipsInRoad) return 0;
Bool_t anyBad=kFALSE,anyGood=kFALSE;
for (Int_t iCh=0; iCh<nChipsInRoad; iCh++) {
if (chipsInRoad[iCh]<0 || chipsInRoad[iCh]>det.GetNChips()-1) continue;
- //printf(" chip %d bad %d\n",chipsInRoad[iCh],(Int_t)det.IsChipBad(chipsInRoad[iCh]));
+ AliDebug(2,Form(" chip %d bad %d",chipsInRoad[iCh],(Int_t)det.IsChipBad(chipsInRoad[iCh])));
if (det.IsChipBad(chipsInRoad[iCh])) {
anyBad=kTRUE;
} else {
}
}
- if (!anyGood) return 2; // all chips in road are bad
+ if (!anyGood) {
+ if(!touchNeighbourDet) {
+ AliDebug(2,"all bad in road");
+ return 2; // all chips in road are bad
+ } else {
+ return 3; // at least a bad chip in road
+ }
+ }
- if (anyBad) return 3; // at least a bad chip in road
+ if (anyBad) {
+ AliDebug(2,"at least a bad in road");
+ return 3; // at least a bad chip in road
+ }
if (!AliITSReconstructor::GetRecoParam()->GetUseSingleBadChannelsFromOCDB()
// There are no clusters in road: check if there is at least
// a bad SPD pixel or SDD anode
- if(ilayer==1 || ilayer==3 || ilayer==5)
- idet += AliITSgeomTGeo::GetNLadders(ilayer)*AliITSgeomTGeo::GetNDetectors(ilayer);
-
- //if (fITSChannelStatus->AnyBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax)) return 3;
+ Int_t idetInITS=idet;
+ for(Int_t l=0;l<ilayer;l++) idetInITS+=AliITSgeomTGeo::GetNLadders(l+1)*AliITSgeomTGeo::GetNDetectors(l+1);
- if (fITSChannelStatus->FractionOfBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax) > AliITSReconstructor::GetRecoParam()->GetMinFractionOfBadInRoad()) return 3;
+ if (fITSChannelStatus->AnyBadInRoad(idetInITS,zlocmin,zlocmax,xlocmin,xlocmax)) {
+ AliDebug(2,Form("Bad channel in det %d of layer %d\n",idet,ilayer));
+ return 3;
+ }
+ //if (fITSChannelStatus->FractionOfBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax) > AliITSReconstructor::GetRecoParam()->GetMinFractionOfBadInRoad()) return 3;
return 0;
}
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
+ if(!track->GetXYZAt(detector.GetRmisal(),GetBz(),xyzGlob)) return kFALSE;
- AliITSgeomTGeo::GlobalToLocal(ilayer+1,lad,det,xyzGlob,xyzLoc);
+ if(!AliITSgeomTGeo::GlobalToLocal(ilayer+1,lad,det,xyzGlob,xyzLoc)) return kFALSE;
xloc = (Float_t)xyzLoc[0];
zloc = (Float_t)xyzLoc[2];
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);
}
return;
}
+