AliTPCclusterMI* c =track->GetCurrentCluster();
- if (accept>0) track->SetCurrentClusterIndex1(track->GetCurrentClusterIndex1() | 0x8000); //sign not accepted clusters
-
+ if (accept > 0) //sign not accepted clusters
+ track->SetCurrentClusterIndex1(track->GetCurrentClusterIndex1() | 0x8000);
+ else // unsign accpeted clusters
+ track->SetCurrentClusterIndex1(track->GetCurrentClusterIndex1() & 0xffff7fff);
UInt_t i = track->GetCurrentClusterIndex1();
Int_t sec=(i&0xff000000)>>24;
seed->SetNFoundable(seed->GetNFoundable()-1);
return 2;
}
+
+ if (AliTPCReconstructor::GetRecoParam()->GetUseHLTClusters() == 3 ||
+ AliTPCReconstructor::GetRecoParam()->GetUseHLTClusters() == 4 ) {
+ if(!AliTPCReconstructor::GetRecoParam()->GetUseOnePadCluster())
+ if (TMath::Abs(cluster->GetSigmaY2()) < kAlmost0)
+ return 2;
+ }
return 0;
}
Int_t AliTPCtrackerMI::LoadClusters (TTree *const tree)
{
- //
+ // load clusters
//
fInput = tree;
return LoadClusters();
void AliTPCtrackerMI::Transform(AliTPCclusterMI * cluster){
//
- //
+ // transformation
//
AliTPCcalibDB * calibDB = AliTPCcalibDB::Instance();
AliTPCTransform *transform = calibDB->GetTransform() ;
if (fIteration>0 && tpcindex>=-1){ //if we have already clusters
//
if (tpcindex==-1) return 0; //track in dead zone
- if (tpcindex>0){ //
+ if (tpcindex >= 0){ //
cl = t.GetClusterPointer(nr);
if ( (cl==0) ) cl = GetClusterMI(tpcindex);
t.SetCurrentClusterIndex1(tpcindex);
t.SetNFoundable(t.GetNFoundable()+1);
UpdateTrack(&t,accept);
return 1;
- }
+ }
+ else { // Remove old cluster from track
+ t.SetClusterIndex(nr, -3);
+ t.SetClusterPointer(nr, 0);
+ }
}
}
if (TMath::Abs(t.GetSnp())>AliTPCReconstructor::GetMaxSnpTracker()) return 0; // cut on angle
//
UInt_t index=0;
// if (TMath::Abs(t.GetSnp())>0.95 || TMath::Abs(x*t.GetC()-t.GetEta())>0.95) return 0;// patch 28 fev 06
- Double_t y=t.GetYat(x);
+ if (!t.PropagateTo(x)) {
+ if (fIteration==0) t.SetRemoval(10);
+ return 0;
+ }
+ Double_t y = t.GetY();
if (TMath::Abs(y)>ymax){
if (y > ymax) {
t.SetRelativeSector((t.GetRelativeSector()+1) % fN);
if (!t.Rotate(-fSectors->GetAlpha()))
return 0;
}
- //return 1;
+ if (!t.PropagateTo(x)) {
+ if (fIteration==0) t.SetRemoval(10);
+ return 0;
+ }
+ y = t.GetY();
}
//
- if (!t.PropagateTo(x)) {
- if (fIteration==0) t.SetRemoval(10);
- return 0;
- }
- y=t.GetY();
Double_t z=t.GetZ();
//
// This function tries to find a track prolongation to next pad row
//-----------------------------------------------------------------
t.SetCurrentCluster(0);
- t.SetCurrentClusterIndex1(0);
+ t.SetCurrentClusterIndex1(-3);
Double_t xt=t.GetX();
Int_t row = GetRowNumber(xt)-1;
} else {
if (fIteration==0){
- if ( ( (t.GetSigmaY2()+t.GetSigmaZ2())>0.16)&& t.GetNumberOfClusters()>18) t.SetRemoval(10);
- if ( t.GetChi2()/t.GetNumberOfClusters()>6 &&t.GetNumberOfClusters()>18) t.SetRemoval(10);
+ if ( t.GetNumberOfClusters()>18 && ( (t.GetSigmaY2()+t.GetSigmaZ2())>0.16)) t.SetRemoval(10);
+ if ( t.GetNumberOfClusters()>18 && t.GetChi2()/t.GetNumberOfClusters()>6 ) t.SetRemoval(10);
if (( (t.GetNFoundable()*0.5 > t.GetNumberOfClusters()) || t.GetNoCluster()>15)) t.SetRemoval(10);
}
//_____________________________________________________________________________
-Int_t AliTPCtrackerMI::FollowProlongation(AliTPCseed& t, Int_t rf, Int_t step) {
+Int_t AliTPCtrackerMI::FollowProlongation(AliTPCseed& t, Int_t rf, Int_t step, Bool_t fromSeeds) {
//-----------------------------------------------------------------
// This function tries to find a track prolongation.
//-----------------------------------------------------------------
Double_t xt=t.GetX();
//
- Double_t alpha=t.GetAlpha() - fSectors->GetAlphaShift();
+ Double_t alpha=t.GetAlpha();
if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
if (alpha < 0. ) alpha += 2.*TMath::Pi();
//
- t.SetRelativeSector(Int_t(alpha/fSectors->GetAlpha()+0.0001)%fN);
+ t.SetRelativeSector(Int_t(alpha/fSectors->GetAlpha())%fN);
- Int_t first = GetRowNumber(xt)-1;
+ Int_t first = GetRowNumber(xt);
+ if (!fromSeeds)
+ first -= step;
for (Int_t nr= first; nr>=rf; nr-=step) {
// update kink info
if (t.GetKinkIndexes()[0]>0){
-Int_t AliTPCtrackerMI::FollowBackProlongation(AliTPCseed& t, Int_t rf) {
+Int_t AliTPCtrackerMI::FollowBackProlongation(AliTPCseed& t, Int_t rf, Bool_t fromSeeds) {
//-----------------------------------------------------------------
// This function tries to find a track prolongation.
//-----------------------------------------------------------------
//
Double_t xt=t.GetX();
- Double_t alpha=t.GetAlpha() - fSectors->GetAlphaShift();
+ Double_t alpha=t.GetAlpha();
if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
if (alpha < 0. ) alpha += 2.*TMath::Pi();
- t.SetRelativeSector(Int_t(alpha/fSectors->GetAlpha()+0.0001)%fN);
+ t.SetRelativeSector(Int_t(alpha/fSectors->GetAlpha())%fN);
Int_t first = t.GetFirstPoint();
- if (first<GetRowNumber(xt)+1) first = GetRowNumber(xt)+1;
+ Int_t ri = GetRowNumber(xt);
+ if (!fromSeeds)
+ ri += 1;
+
+ if (first<ri) first = ri;
//
if (first<0) first=0;
for (Int_t nr=first; nr<=rf; nr++) {
Float_t AliTPCtrackerMI::OverlapFactor(AliTPCseed * s1, AliTPCseed * s2, Int_t &sum1, Int_t & sum2)
{
- //
+ // overlapping factor
//
sum1=0;
sum2=0;
void AliTPCtrackerMI::SignShared(AliTPCseed * s1, AliTPCseed * s2)
{
- //
+ // shared clusters
//
Float_t thetaCut = 0.2;//+10.*TMath::Sqrt(s1->GetSigmaTglZ()+ s2->GetSigmaTglZ());
if (TMath::Abs(s1->GetTgl()-s2->GetTgl())>thetaCut) return;
}
transform->SetCurrentRecoParam((AliTPCRecoParam*)AliTPCReconstructor::GetRecoParam());
const AliTPCRecoParam * recoParam = AliTPCcalibDB::Instance()->GetTransform()->GetCurrentRecoParam();
-
+ Int_t nContribut = event->GetNumberOfTracks();
TGraphErrors * graphMultDependenceDeDx = 0x0;
if (recoParam && recoParam->GetUseMultiplicityCorrectionDedx() && gainCalibArray) {
if (recoParam->GetUseTotCharge()) {
AliESDtrack *esd=event->GetTrack(i);
if (seed->GetNumberOfClusters()<60 && seed->GetNumberOfClusters()<(esd->GetTPCclusters(0) -5)*0.8){
+ AliInfo("Refitting track");
AliExternalTrackParam paramIn;
AliExternalTrackParam paramOut;
Int_t ncl = seed->RefitTrack(seed,¶mIn,¶mOut);
Float_t dedx = seed->GetdEdx();
// apply mutliplicity dependent dEdx correction if available
if (graphMultDependenceDeDx) {
- Int_t nContribut = event->GetPrimaryVertexTPC()->GetNContributors();
Double_t corrGain = AliTPCcalibDButil::EvalGraphConst(graphMultDependenceDeDx, nContribut);
- dedx /= corrGain;
+ dedx += (1 - corrGain)*50.; // MIP is normalized to 50
}
esd->SetTPCsignal(dedx, sdedx, ndedx);
//
seed->UpdatePoints();
AddCovariance(seed);
AliESDtrack *esd=event->GetTrack(i);
+ if (!esd) continue; //never happen
if (seed->GetNumberOfClusters()<60 && seed->GetNumberOfClusters()<(esd->GetTPCclusters(0) -5)*0.8){
AliExternalTrackParam paramIn;
AliExternalTrackParam paramOut;
fSeeds =0;
}
-void AliTPCtrackerMI::ReadSeeds(AliESDEvent *const event, Int_t direction)
+void AliTPCtrackerMI::ReadSeeds(const AliESDEvent *const event, Int_t direction)
{
//
//read seeds from the event
// rotate to the local coordinate system
//
fSectors=fInnerSec; fN=fkNIS;
- Double_t alpha=seed->GetAlpha() - fSectors->GetAlphaShift();
+ Double_t alpha=seed->GetAlpha();
if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
if (alpha < 0. ) alpha += 2.*TMath::Pi();
Int_t ns=Int_t(alpha/fSectors->GetAlpha())%fN;
alpha =ns*fSectors->GetAlpha() + fSectors->GetAlphaShift();
+ alpha-=seed->GetAlpha();
if (alpha<-TMath::Pi()) alpha += 2*TMath::Pi();
if (alpha>=TMath::Pi()) alpha -= 2*TMath::Pi();
- alpha-=seed->GetAlpha();
- if (!seed->Rotate(alpha)) {
- delete seed;
- continue;
+ if (TMath::Abs(alpha) > 0.001) { // This should not happen normally
+ AliWarning(Form("Rotating track over %f",alpha));
+ if (!seed->Rotate(alpha)) {
+ delete seed;
+ continue;
+ }
}
seed->SetESD(esd);
// sign clusters
Int_t AliTPCtrackerMI::Clusters2Tracks (AliESDEvent *const esd)
{
//
+ // clusters to tracks
if (fSeeds) DeleteSeeds();
- fEvent = esd;
+ fEvent = esd;
+
+ AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
+ transform->SetCurrentTimeStamp( esd->GetTimeStamp());
+ transform->SetCurrentRun(esd->GetRunNumber());
+
Clusters2Tracks();
if (!fSeeds) return 1;
FillESD(fSeeds);
fIteration = 2;
PrepareForProlongation(fSeeds,5.);
- PropagateForward2(fSeeds);
+ PropagateForard2(fSeeds);
printf("Time for FORWARD propagation: \t");timer.Print();timer.Start();
// RemoveUsed(fSeeds,0.7,0.7,6);
TObjArray * AliTPCtrackerMI::Tracking()
{
- //
+ // tracking
//
if (AliTPCReconstructor::GetRecoParam()->GetSpecialSeeding()) return TrackingSpecial();
TStopwatch timer;
}
}
-void AliTPCtrackerMI::PrepareForBackProlongation(TObjArray *const arr,Float_t fac) const
+void AliTPCtrackerMI::PrepareForBackProlongation(const TObjArray *const arr,Float_t fac) const
{
//
//
}
-Int_t AliTPCtrackerMI::PropagateBack(TObjArray *const arr)
+Int_t AliTPCtrackerMI::PropagateBack(const TObjArray *const arr)
{
//
// make back propagation
fSectors = fInnerSec;
//FollowBackProlongation(*pt,fInnerSec->GetNRows()-1);
//fSectors = fOuterSec;
- FollowBackProlongation(*pt,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1);
+ FollowBackProlongation(*pt,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1,1);
//if (pt->GetNumberOfClusters()<(pt->fEsd->GetTPCclusters(0)) ){
// Error("PropagateBack","Not prolonged track %d",pt->GetLabel());
// FollowBackProlongation(*pt2,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1);
AliESDkink * kink = fEvent->GetKink(pt->GetKinkIndex(0)-1);
pt->SetFirstPoint(kink->GetTPCRow0());
fSectors = fInnerSec;
- FollowBackProlongation(*pt,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1);
+ FollowBackProlongation(*pt,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1,1);
}
CookLabel(pt,0.3);
}
}
-Int_t AliTPCtrackerMI::PropagateForward2(TObjArray *const arr)
+Int_t AliTPCtrackerMI::PropagateForward2(const TObjArray *const arr)
{
//
// make forward propagation
for (Int_t i=0;i<nseed;i++){
AliTPCseed *pt = (AliTPCseed*)arr->UncheckedAt(i);
if (pt) {
- FollowProlongation(*pt,0);
+ FollowProlongation(*pt,0,1,1);
CookLabel(pt,0.3);
}
}
- return 0;
+ return 0;
}
void AliTPCtrackerMI::GetShape(AliTPCseed * seed, Int_t row)
{
- //
+ // gets cluster shape
//
AliTPCClusterParam * clparam = AliTPCcalibDB::Instance()->GetClusterParam();
Float_t zdrift = TMath::Abs((fkParam->GetZLength(0)-TMath::Abs(seed->GetZ())));
void AliTPCtrackerMI::AddCovariance(AliTPCseed * seed){
//
- // Adding systematic error
+ // Adding systematic error estimate to the covariance matrix
// !!!! the systematic error for element 4 is in 1/cm not in pt
+ //
+ const Double_t *param = AliTPCReconstructor::GetRecoParam()->GetSystematicError();
+ //
+ // use only the diagonal part if not specified otherwise
+ if (!AliTPCReconstructor::GetRecoParam()->GetUseSystematicCorrelation()) return AddCovarianceAdd(seed);
+ //
+ Double_t *covarS= (Double_t*)seed->GetCovariance();
+ Double_t factor[5]={1,1,1,1,1};
+ Double_t facC = AliTracker::GetBz()*kB2C;
+ factor[0]= TMath::Sqrt(TMath::Abs((covarS[0] + param[0]*param[0])/covarS[0]));
+ factor[1]= TMath::Sqrt(TMath::Abs((covarS[2] + param[1]*param[1])/covarS[2]));
+ factor[2]= TMath::Sqrt(TMath::Abs((covarS[5] + param[2]*param[2])/covarS[5]));
+ factor[3]= TMath::Sqrt(TMath::Abs((covarS[9] + param[3]*param[3])/covarS[9]));
+ factor[4]= TMath::Sqrt(TMath::Abs((covarS[14] + facC*facC*param[4]*param[4])/covarS[14]));
+ // 0
+ // 1 2
+ // 3 4 5
+ // 6 7 8 9
+ // 10 11 12 13 14
+ for (Int_t i=0; i<5; i++){
+ for (Int_t j=i; j<5; j++){
+ Int_t index=seed->GetIndex(i,j);
+ covarS[index]*=factor[i]*factor[j];
+ }
+ }
+}
+
+void AliTPCtrackerMI::AddCovarianceAdd(AliTPCseed * seed){
+ //
+ // Adding systematic error - as additive factor without correlation
+ //
const Double_t *param = AliTPCReconstructor::GetRecoParam()->GetSystematicError();
Double_t *covarIn= (Double_t*)seed->GetCovariance();
Double_t covar[15];