//#include <TProfile2D.h>
#include <TVector3.h>
#include "TMath.h"
+#include "AliTracker.h"
#include "AliGeomManager.h"
#include "AliITSRecPoint.h"
#include "AliITSClusterParam.h"
Int_t AliITSClusterParam::GetError(Int_t layer,
const AliITSRecPoint *cl,
Float_t tgl,Float_t tgphitr,Float_t expQ,
- Float_t &erry,Float_t &errz,
+ Float_t &erry,Float_t &errz,Float_t &covyz,
Bool_t addMisalErr)
{
//
// Calculate cluster position error
//
Int_t retval=0;
+ covyz=0.;
switch(AliITSReconstructor::GetRecoParam()->GetClusterErrorsParam()) {
case 0:
- retval = GetErrorOrigRecPoint(cl,erry,errz);
+ retval = GetErrorOrigRecPoint(cl,erry,errz,covyz);
break;
case 1:
retval = GetErrorParamMI(layer,cl,tgl,tgphitr,expQ,erry,errz);
break;
}
+ // for SSD use the error provided by the cluster finder
+ // if single-sided clusters are enabled
+ if(layer>=4 && AliITSReconstructor::GetRecoParam()->GetUseBadChannelsInClusterFinderSSD()) {
+ //printf("error 1 erry errz covyz %10.7f %10.7f %15.13f\n",erry,errz,covyz);
+ retval = GetErrorOrigRecPoint(cl,erry,errz,covyz);
+ //printf("type %d erry errz covyz %10.7f %10.7f %15.13f\n",cl->GetType(),erry,errz,covyz);
+ }
+
if(addMisalErr) {
+ Double_t bz = (Double_t)AliTracker::GetBz();
// add error due to misalignment (to be improved)
- Float_t errmisalY2 = AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorY(layer)
- *AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorY(layer);
- Float_t errmisalZ2 = AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorZ(layer)
- *AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorZ(layer);
+ Float_t errmisalY2 = AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorY(layer,bz)
+ *AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorY(layer,bz);
+ Float_t errmisalZ2 = AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorZ(layer,bz)
+ *AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorZ(layer,bz);
erry = TMath::Sqrt(erry*erry+errmisalY2);
errz = TMath::Sqrt(errz*errz+errmisalZ2);
}
}
//--------------------------------------------------------------------------
Int_t AliITSClusterParam::GetErrorOrigRecPoint(const AliITSRecPoint*cl,
- Float_t &erry,Float_t &errz)
+ Float_t &erry,Float_t &errz,Float_t &covyz)
{
//
// Calculate cluster position error (just take error from AliITSRecPoint)
//
erry = TMath::Sqrt(cl->GetSigmaY2());
errz = TMath::Sqrt(cl->GetSigmaZ2());
+ covyz = cl->GetSigmaYZ();
return 1;
}
Float_t &ny,Float_t &nz);
static Int_t GetError(Int_t layer,const AliITSRecPoint*cl,
Float_t tgl,Float_t tgphitr,Float_t expQ,
- Float_t &erry,Float_t &errz,
+ Float_t &erry,Float_t &errz,Float_t &covyz,
Bool_t addMisalErr=kTRUE);
+ static Int_t GetError(Int_t layer,const AliITSRecPoint*cl,
+ Float_t tgl,Float_t tgphitr,Float_t expQ,
+ Float_t &erry,Float_t &errz,
+ Bool_t addMisalErr=kTRUE) {
+ Float_t covyz;
+ return GetError(layer,cl,tgl,tgphitr,expQ,erry,errz,covyz,addMisalErr);
+ }
//void FitData(TTree * tree);
//
protected:
static AliITSClusterParam* fgInstance; //! Instance of this class (singleton implementation)
static Int_t GetErrorOrigRecPoint(const AliITSRecPoint*cl,
- Float_t &erry,Float_t &errz);
+ Float_t &erry,Float_t &errz,Float_t &covyz);
static Int_t GetErrorParamMI(Int_t layer,const AliITSRecPoint*cl,
Float_t tgl,Float_t tgphitr,Float_t expQ,
Float_t &erry,Float_t &errz);
//constructor
for(Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fClIndex[i]=-1;
for(Int_t i=0; i<6; i++) { fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000; fDeadZoneProbability[i]=0;}
- for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fChi2MIP[i]=0;}
+ for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0; fChi2MIP[i]=0;}
fD[0]=0; fD[1]=0;
fDnorm[0]=0; fDnorm[1]=0;
}
// If c==kTRUE, create the ITS track out of the constrained params.
//------------------------------------------------------------------
for(Int_t i=0; i<6; i++) {fClIndex[i]=-1; fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000; fDeadZoneProbability[i]=0;}
- for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0;fChi2MIP[i]=0;}
+ for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0; fChi2MIP[i]=0;}
fD[0]=0; fD[1]=0;
fDnorm[0]=0; fDnorm[1]=0;
//if (!Invariant()) throw "AliITStrackV2: conversion failed !\n";
fClIndex[i]= t.fClIndex[i]; fNy[i]=t.fNy[i]; fNz[i]=t.fNz[i]; fNormQ[i]=t.fNormQ[i]; fNormChi2[i] = t.fNormChi2[i]; fDeadZoneProbability[i]=t.fDeadZoneProbability[i];
}
for(Int_t i=0; i<12; i++) {fDy[i]=t.fDy[i]; fDz[i]=t.fDz[i];
- fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i];fChi2MIP[i]=t.fChi2MIP[i];}
+ fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i]; fSigmaYZ[i]=t.fSigmaYZ[i]; fChi2MIP[i]=t.fChi2MIP[i];}
//memcpy(fDy,t.fDy,6*sizeof(Float_t));
//memcpy(fDz,t.fDz,6*sizeof(Float_t));
//memcpy(fSigmaY,t.fSigmaY,6*sizeof(Float_t));
}
-Double_t AliITStrackMI::GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz) const
+Double_t AliITStrackMI::GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t covyz) const
{
//-----------------------------------------------------------------
// This function calculates a predicted chi2 increment.
//-----------------------------------------------------------------
Double_t p[2]={cy, cz};
- Double_t cov[3]={cerry*cerry, 0., cerrz*cerrz};
+ Double_t cov[3]={cerry*cerry, covyz, cerrz*cerrz};
return AliExternalTrackParam::GetPredictedChi2(p,cov);
}
fDz[layer] = dz;
fSigmaY[layer] = TMath::Sqrt(c->GetSigmaY2()+GetSigmaY2());
fSigmaZ[layer] = TMath::Sqrt(c->GetSigmaZ2()+GetSigmaZ2());
+ fSigmaYZ[layer] = c->GetSigmaYZ()+GetSigmaZY();
+
return Update(c,chi2,index);
}
void SetDnorm(Int_t i, Float_t d) {fDnorm[i]=d;}
Float_t GetSigmaY(Int_t i) const {return fSigmaY[i];}
Float_t GetSigmaZ(Int_t i) const {return fSigmaZ[i];}
+ Float_t GetSigmaYZ(Int_t i) const {return fSigmaYZ[i];}
void SetSigmaY(Int_t i, Float_t s) {fSigmaY[i]=s;}
void SetSigmaZ(Int_t i, Float_t s) {fSigmaZ[i]=s;}
+ void SetSigmaYZ(Int_t i, Float_t s) {fSigmaYZ[i]=s;}
Float_t GetNDeadZone() const {return fNDeadZone;}
void SetNDeadZone(Float_t d) {fNDeadZone=d;}
Int_t* ClIndex() {return fClIndex;}
Float_t GetDeadZoneProbability(Int_t ilayer) const {return fDeadZoneProbability[ilayer];}
void SetDeadZoneProbability(Int_t ilayer,Float_t d) {fDeadZoneProbability[ilayer]=d;}
- Double_t GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz) const;
+ Double_t GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t covyz=0.) const;
Bool_t IsGoldPrimary();
protected:
Float_t fDz[12]; //dz in layer
Float_t fSigmaY[12]; //sigma y
Float_t fSigmaZ[12]; //sigma z
+ Float_t fSigmaYZ[12]; //covariance of y and z
Float_t fNy[6]; //expected size of cluster
Float_t fNz[6]; //expected size of cluster
Float_t fD[2]; //distance to the vertex
Bool_t fConstrain; //indication of the vertex constrain
Int_t fClIndex[6]; //cluster Index
Bool_t fGoldV0; //corresponding gold V0 found
- ClassDef(AliITStrackMI,2) //ITS reconstructed track
+ ClassDef(AliITStrackMI,3) //ITS reconstructed track
};
#endif
//This function updates track parameters
//------------------------------------------------------------------
Double_t p[2]={c->GetY(), c->GetZ()};
- Double_t cov[3]={c->GetSigmaY2(), 0., c->GetSigmaZ2()};
+ Double_t cov[3]={c->GetSigmaY2(), c->GetSigmaYZ(), c->GetSigmaZ2()};
if (!AliExternalTrackParam::Update(p,cov)) return kFALSE;
// take into account the misalignment error
Float_t maxMisalErrY2=0,maxMisalErrZ2=0;
for (Int_t lay=0; lay<AliITSgeomTGeo::kNLayers; lay++) {
- maxMisalErrY2 = TMath::Max(maxMisalErrY2,AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorY(lay));
- maxMisalErrZ2 = TMath::Max(maxMisalErrZ2,AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorZ(lay));
+ maxMisalErrY2 = TMath::Max(maxMisalErrY2,AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorY(lay,GetBz()));
+ maxMisalErrZ2 = TMath::Max(maxMisalErrZ2,AliITSReconstructor::GetRecoParam()->GetClusterMisalErrorZ(lay,GetBz()));
}
maxMisalErrY2 *= maxMisalErrY2;
maxMisalErrZ2 *= maxMisalErrZ2;
Float_t tgl = t->GetTgl(); // tgl about const along track
Float_t expQ = TMath::Max(0.8*t->GetTPCsignal(),30.);
- Float_t errlocalx,errlocalz;
+ Float_t errtrky,errtrkz,covyz;
Bool_t addMisalErr=kFALSE;
- AliITSClusterParam::GetError(l,cl,tgl,tgphi,expQ,errlocalx,errlocalz,addMisalErr);
+ AliITSClusterParam::GetError(l,cl,tgl,tgphi,expQ,errtrky,errtrkz,covyz,addMisalErr);
Float_t xyz[3];
Float_t cov[6];
cl->GetGlobalXYZ(xyz);
// cl->GetGlobalCov(cov);
Float_t pos[3] = {0.,0.,0.};
- AliCluster tmpcl((UShort_t)cl->GetVolumeId(),pos[0],pos[1],pos[2],errlocalx*errlocalx,errlocalz*errlocalz,0);
+ AliCluster tmpcl((UShort_t)cl->GetVolumeId(),pos[0],pos[1],pos[2],errtrky*errtrky,errtrkz*errtrkz,covyz);
tmpcl.GetGlobalCov(cov);
p.SetXYZ(xyz, cov);
fZcs(0),
fNcs(0),
fCurrentSlice(-1),
+fZmin(0),
fZmax(0),
fYmin(0),
fYmax(0),
fImax(0),
fSkip(0),
fAccepted(0),
-fRoad(0){
+fRoad(0),
+fMaxSigmaClY(0),
+fMaxSigmaClZ(0),
+fNMaxSigmaCl(3)
+{
//--------------------------------------------------------------------
//default AliITSlayer constructor
//--------------------------------------------------------------------
fZcs(0),
fNcs(0),
fCurrentSlice(-1),
+fZmin(0),
fZmax(0),
fYmin(0),
fYmax(0),
fImax(0),
fSkip(0),
fAccepted(0),
-fRoad(0) {
+fRoad(0),
+fMaxSigmaClY(0),
+fMaxSigmaClZ(0),
+fNMaxSigmaCl(3) {
//--------------------------------------------------------------------
//main AliITSlayer constructor
//--------------------------------------------------------------------
fZcs(layer.fZcs),
fNcs(layer.fNcs),
fCurrentSlice(layer.fCurrentSlice),
+fZmin(layer.fZmin),
fZmax(layer.fZmax),
fYmin(layer.fYmin),
fYmax(layer.fYmax),
fImax(layer.fImax),
fSkip(layer.fSkip),
fAccepted(layer.fAccepted),
-fRoad(layer.fRoad){
+fRoad(layer.fRoad),
+fMaxSigmaClY(layer.fMaxSigmaClY),
+fMaxSigmaClZ(layer.fMaxSigmaClZ),
+fNMaxSigmaCl(layer.fNMaxSigmaCl)
+{
//Copy constructor
}
//------------------------------------------------------------------------
fClusters[fN]=cl;
fN++;
AliITSdetector &det=GetDetector(cl->GetDetectorIndex());
+ //AD
+ Double_t nSigmaY=fNMaxSigmaCl*TMath::Sqrt(cl->GetSigmaY2());
+ Double_t nSigmaZ=fNMaxSigmaCl*TMath::Sqrt(cl->GetSigmaZ2());
+ if (cl->GetY()-nSigmaY<det.GetYmin()) det.SetYmin(cl->GetY()-nSigmaY);
+ if (cl->GetY()+nSigmaY>det.GetYmax()) det.SetYmax(cl->GetY()+nSigmaY);
+ if (cl->GetZ()-nSigmaZ<det.GetZmin()) det.SetZmin(cl->GetZ()-nSigmaZ);
+ if (cl->GetZ()+nSigmaZ>det.GetZmax()) det.SetZmax(cl->GetZ()+nSigmaZ);
+ //AD
+ /*
if (cl->GetY()<det.GetYmin()) det.SetYmin(cl->GetY());
if (cl->GetY()>det.GetYmax()) det.SetYmax(cl->GetY());
if (cl->GetZ()<det.GetZmin()) det.SetZmin(cl->GetZ());
if (cl->GetZ()>det.GetZmax()) det.SetZmax(cl->GetZ());
-
+ */
return 0;
}
//------------------------------------------------------------------------
Float_t *z = new Float_t[fN];
Int_t * index = new Int_t[fN];
//
+ fMaxSigmaClY=0.; //AD
+ fMaxSigmaClZ=0.; //AD
+
for (Int_t i=0;i<fN;i++){
z[i] = fClusters[i]->GetZ();
+ // save largest errors in y and z for this layer
+ fMaxSigmaClY=TMath::Max(fMaxSigmaClY,TMath::Sqrt(fClusters[i]->GetSigmaY2()));
+ fMaxSigmaClZ=TMath::Max(fMaxSigmaClZ,TMath::Sqrt(fClusters[i]->GetSigmaZ2()));
}
TMath::Sort(fN,z,index,kFALSE);
for (Int_t i=0;i<fN;i++){
//--------------------------------------------------------------------
Double_t circle=2*TMath::Pi()*fR;
- fYmin = ymin; fYmax =ymax;
+ fYmin = ymin;
+ fYmax = ymax;
+ fZmin = zmin;
+ fZmax = zmax;
+ // AD
+ // enlarge road in y by maximum cluster error on this layer (3 sigma)
+ fYmin -= fNMaxSigmaCl*fMaxSigmaClY;
+ fYmax += fNMaxSigmaCl*fMaxSigmaClY;
+ fZmin -= fNMaxSigmaCl*fMaxSigmaClZ;
+ fZmax += fNMaxSigmaCl*fMaxSigmaClZ;
+
Float_t ymiddle = (fYmin+fYmax)*0.5;
if (ymiddle<fYB[0]) {
fYmin+=circle; fYmax+=circle; ymiddle+=circle;
}
}
//
- fI=FindClusterIndex(zmin); fZmax=zmax;
- fImax = TMath::Min(FindClusterIndex(zmax)+1,fNcs);
- fSkip = 0;
- fAccepted =0;
+ fI = FindClusterIndex(fZmin);
+ fImax = TMath::Min(FindClusterIndex(fZmax)+1,fNcs);
+ fSkip = 0;
+ fAccepted = 0;
return;
}
Double_t rpi2 = 2.*fR*TMath::Pi();
for (Int_t i=fI; i<fImax; i++) {
Double_t y = fY[i];
+ Double_t z = fZ[i];
if (fYmax<y) y -= rpi2;
if (fYmin>y) y += rpi2;
if (y<fYmin) continue;
if (y>fYmax) continue;
+ // AD
+ // skip clusters that are in "extended" road but they
+ // 3sigma error does not touch the original road
+ if (z+fNMaxSigmaCl*TMath::Sqrt(fClusters[i]->GetSigmaZ2())<fZmin+fNMaxSigmaCl*fMaxSigmaClZ) continue;
+ if (z-fNMaxSigmaCl*TMath::Sqrt(fClusters[i]->GetSigmaZ2())>fZmax-fNMaxSigmaCl*fMaxSigmaClZ) continue;
+ //
if (fClusters[i]->GetQ()==0&&fSkip==2) continue;
ci=i;
if (!test) fI=i+1;
//
// Compute predicted chi2
//
- Float_t erry,errz;
+ Float_t erry,errz,covyz;
Float_t theta = track->GetTgl();
Float_t phi = track->GetSnp();
phi = TMath::Abs(phi)*TMath::Sqrt(1./((1.-phi)*(1.+phi)));
- AliITSClusterParam::GetError(layer,cluster,theta,phi,track->GetExpQ(),erry,errz);
+ AliITSClusterParam::GetError(layer,cluster,theta,phi,track->GetExpQ(),erry,errz,covyz);
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);
+ Double_t chi2 = track->GetPredictedChi2MI(cluster->GetY(),cluster->GetZ(),erry,errz,covyz);
// Bring the track back to detector plane in ideal geometry
// [mis-alignment will be accounted for in UpdateMI()]
if (!track->Propagate(xTrOrig)) return 1000.;
track->SetNz(layer,nz);
track->SetSigmaY(layer,erry);
track->SetSigmaZ(layer, errz);
+ track->SetSigmaYZ(layer,covyz);
//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())*(1.+track->GetSnp()))));
return chi2;
AliDebug(2,Form(" xtr %f xcl %f",track->GetX(),cl->GetX()));
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));
+ c.SetSigmaYZ(track->GetSigmaYZ(layer));
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;
}
//
Float_t fClusterWeight[AliITSRecoParam::fgkMaxClusterPerLayer]; // probabilistic weight of the cluster
Int_t fClusterTracks[4][AliITSRecoParam::fgkMaxClusterPerLayer]; //tracks registered to given cluster
+ Float_t fZmin; // the
Float_t fZmax; // edges
Float_t fYmin; // of the
Float_t fYmax; // "window"
Int_t fSkip; // indicates possibility to skip cluster
Int_t fAccepted; // accept indicator
Double_t fRoad; // road defined by the cluster density
+ Double_t fMaxSigmaClY; // maximum cluster error Y (to enlarge road)
+ Double_t fMaxSigmaClZ; // maximum cluster error Z (to enlarge road)
+ Double_t fNMaxSigmaCl; // number of sigma for road enlargement
};
AliITStrackerMI::AliITSlayer & GetLayer(Int_t layer) const;
AliITStrackerMI::AliITSdetector & GetDetector(Int_t layer, Int_t n) const {return GetLayer(layer).GetDetector(n); }
private:
AliITStrackerMI(const AliITStrackerMI &tracker);
AliITStrackerMI & operator=(const AliITStrackerMI &tracker);
- ClassDef(AliITStrackerMI,7) //ITS tracker MI
+ ClassDef(AliITStrackerMI,8) //ITS tracker MI
};