#include <TRandom.h>
+#include "AliLog.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
#include "AliESDVertex.h"
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;
}
Int_t tpcLabel=t->GetLabel(); //save the TPC track label
+ AliDebug(2,Form("LABEL %d pass %d",tpcLabel,fPass));
fI = 6;
ResetTrackToFollow(*t);
ResetBestTrack();
t->SetReconstructed(kTRUE);
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);
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);
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--) {
- //printf("FollowProlongationTree: layer %d\n",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;
- currenttrack2.Propagate(det.GetPhi(),det.GetR());
+ if (!currenttrack2.Propagate(det.GetPhi(),det.GetR())) continue;
currenttrack1.SetDetectorIndex(idet);
currenttrack2.SetDetectorIndex(idet);
- LocalModuleCoord(ilayer,idet,¤ttrack1,xloc,zloc); // local module coords
+ if(!LocalModuleCoord(ilayer,idet,¤ttrack1,xloc,zloc)) continue; // local module coords
//***************
// DEFINITION OF SEARCH ROAD AND CLUSTERS SELECTION
// check if the road contains a dead zone
Bool_t noClusters = kFALSE;
if (!layer.GetNextCluster(clidx,kTRUE)) noClusters=kTRUE;
- //if (noClusters) printf("no clusters in road\n");
+ 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 &&
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.);
+ 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. )
{ // cluster not associated to track
- //printf("not ass\n");
+ AliDebug(2,"not associated");
continue;
}
// bring track back to ideal detector plane
- currenttrack->PropagateTo(xTrOrig,0.,0.);
+ 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
// calculate track-clusters chi2
chi2trkcl = GetPredictedChi2MI(currenttrack,cl,ilayer);
// chi2 cut
- //printf("chi2 %f max %f\n",chi2trkcl,AliITSReconstructor::GetRecoParam()->GetMaxChi2s(ilayer));
+ 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 (cl->GetQ()!=0) { // real cluster
if (!UpdateMI(updatetrack,cl,chi2trkcl,(ilayer<<28)+clidx)) {
- //printf("update failed\n");
+ AliDebug(2,"update failed");
continue;
}
updatetrack->SetSampledEdx(cl->GetQ(),updatetrack->GetNumberOfClusters()-1); //b.b.
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 printf("chi2 too large\n");
+ else {
+ AliDebug(2,"chi2 too large");
+ }
+
} // loop over possible prolongations
// allow one prolongation without clusters
// 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 (!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
}
Int_t cllayer = (idx & 0xf0000000) >> 28;;
Double_t chi2=GetPredictedChi2MI(track,cl,cllayer);
// 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));
} // end loop on layers
- if (!track->PropagateTo(xx,0.,0.)) return kFALSE;
+ if (!track->Propagate(xx)) return kFALSE;
return kTRUE;
}
{
//
// 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 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());
-
+ 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->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());
+ 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->PropagateTo(xTrOrig,0.,0.)) return 1000.;
+ 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;
// 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());
+ 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()));
- if (!track->PropagateTo(xTrOrig+cl->GetX(),0.,0.)) return 0;
+ if (!track->Propagate(xTrOrig+cl->GetX())) return 0;
AliCluster c(*cl);
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 (!track->Propagate(xTrOrig)) return 0;
- //if(!updated) printf("update failed\n");
+ 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.);
}
// 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");
}
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");
}
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;
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;
+ Double_t rOld=TMath::Sqrt(oldGlobXYZ[0]*oldGlobXYZ[0]+oldGlobXYZ[1]*oldGlobXYZ[1]);
+ Double_t xOld;
+ 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)) 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())/
}
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;
}
//------------------------------------------------------------------------
fSPDdetzcentre[2] - 0.5*AliITSRecoParam::GetSPDdetzlength(),
fSPDdetzcentre[3] - 0.5*AliITSRecoParam::GetSPDdetzlength()};
for (Int_t i=0; i<3; i++)
- if (track->GetZ()-dz<zmaxdead[i] && track->GetZ()+dz>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
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);
+ Int_t idetInITS=idet;
+ for(Int_t l=0;l<ilayer;l++) idetInITS+=AliITSgeomTGeo::GetNLadders(l+1)*AliITSgeomTGeo::GetNDetectors(l+1);
- //if (fITSChannelStatus->AnyBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax)) return 3;
-
- 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;
}
AliITSdetector &detector = fgLayers[ilayer].GetDetector(idet);
// take into account the misalignment: xyz at real detector plane
- track->GetXYZAt(detector.GetRmisal(),GetBz(),xyzGlob);
+ 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];