Skip to content

Commit

Permalink
Fix for CookdEdx in TPC Cluster2Tracks
Browse files Browse the repository at this point in the history
The clusters pointers were not attached to TPC seed during Clusters2Traks phase, as a result the
TPCsignal stored was always 0 and all tracks were tracked in ITS as pions dirung ITS Clusters2Tracks stage
  • Loading branch information
shahor02 authored and dberzano committed Nov 2, 2016
1 parent 458fd0a commit 0df6b02
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 56 deletions.
5 changes: 3 additions & 2 deletions ITS/ITSbase/AliITStrackerMI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ Int_t AliITStrackerMI::Clusters2Tracks(AliESDEvent *event) {
for (fCurrentEsdTrack=0; fCurrentEsdTrack<nentr; fCurrentEsdTrack++) {
AliITStrackMI *t=(AliITStrackMI*)itsTracks.UncheckedAt(fCurrentEsdTrack);
if (t==0) continue; //this track has been already tracked
Int_t tpcLabel=t->GetESDtrack()->GetLabel(); //save the TPC track label
AliDebug(2,Form("LABEL %d pass %d",tpcLabel,fPass));

//cout<<"========== "<<fPass<<" "<<fCurrentEsdTrack<<" =========\n";
if (t->GetReconstructed()&&(t->GetNUsed()<1.5)) continue; //this track was already "succesfully" reconstructed
Float_t dz[2]={0}; t->GetDZ(GetX(),GetY(),GetZ(),dz); //I.B.
Expand All @@ -637,8 +640,6 @@ Int_t AliITStrackerMI::Clusters2Tracks(AliESDEvent *event) {
TMath::Abs(dz[1])>AliITSReconstructor::GetRecoParam()->GetMaxDZToUseConstraint()) 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();
Expand Down
86 changes: 32 additions & 54 deletions TPC/TPCrec/AliTPCtracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7441,11 +7441,24 @@ void AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
//
RemoveUsed2(array,0.5,0.4,30);
UnsignClusters();
// RS: the cluster pointers are not permanently attached to the seed during the tracking, need to attach temporarily
AliTPCclusterMI* seedClusters[kMaxRow] = {0};
//
for (Int_t i=0;i<nentries;i++){
AliTPCseed * track0 = (AliTPCseed*)array->At(i);
if (!track0) continue;
//RS: if needed, attach temporary cluster array
const AliTPCclusterMI** seedClustersSave = track0->GetClusters();
if (!seedClustersSave) { //RS: temporary attach clusters
for (int ir=kMaxRow;ir--;) {
int idx = track0->GetClusterIndex2(ir);
seedClusters[ir] = idx<0 ? 0 : GetClusterMI(idx);
}
track0->SetClustersArrayTMP(seedClusters);
}
track0->CookdEdx(0.02,0.6);
track0->CookPID();
if (!seedClustersSave) track0->SetClustersArrayTMP(0);
}
//
// RS use stack allocation instead of the heap
Expand Down Expand Up @@ -8104,78 +8117,43 @@ Int_t AliTPCtracker::Clusters2Tracks() {
//
nseed=fSeeds->GetEntriesFast();
found = 0;
// RS: the cluster pointers are not permanently attached to the seed during the tracking, need to attach temporarily
AliTPCclusterMI* seedClusters[kMaxRow];
//
for (Int_t i=0; i<nseed; i++) {
AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i), &t=*pt;
AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i), &t = *pt;
if (!pt) continue;
Int_t nc=t.GetNumberOfClusters();
if (nc<15) {
MarkSeedFree( fSeeds->RemoveAt(i) );
continue;
}
t.SetUniqueID(i);
t.CookdEdx(0.02,0.6);

// CheckKinkPoint(&t,0.05);
//if ((pt->IsActive() || (pt->fRemoval==10) )&& nc>50 &&pt->GetNumberOfClusters()>0.4*pt->fNFoundable){
if ((pt->IsActive() || (pt->GetRemoval()==10) )){
found++;
if (fDebug>0){
cerr<<found<<'\r';
}
if (fDebug>0) cerr<<found<<'\r';
pt->SetLab2(i);
}
else
MarkSeedFree( fSeeds->RemoveAt(i) );
//AliTPCseed * seed1 = ReSeed(pt,0.05,0.5,1);
//if (seed1){
// FollowProlongation(*seed1,0);
// Int_t n = seed1->GetNumberOfClusters();
// printf("fP4\t%f\t%f\n",seed1->GetC(),pt->GetC());
// printf("fN\t%d\t%d\n", seed1->GetNumberOfClusters(),pt->GetNumberOfClusters());
else {MarkSeedFree( fSeeds->RemoveAt(i) );}
//
// temporarilly attach clusters and cook dedx
const AliTPCclusterMI** seedClustersSave = t.GetClusters();
if (!seedClustersSave) { //RS: temporary attach clusters
for (int ir=kMaxRow;ir--;) {
int idx = t.GetClusterIndex2(ir);
seedClusters[ir] = idx<0 ? 0 : GetClusterMI(idx);
}
t.SetClustersArrayTMP(seedClusters);
}
t.CookdEdx(0.02,0.6);
if (!seedClustersSave) t.SetClustersArrayTMP(0);
//
//}
//AliTPCseed * seed2 = ReSeed(pt,0.95,0.5,0.05);

}

SortTracks(fSeeds, 1);

/*
fIteration = 1;
PrepareForBackProlongation(fSeeds,5.);
PropagateBack(fSeeds);
printf("Time for back propagation: \t");timer.Print();timer.Start();

fIteration = 2;

PrepareForProlongation(fSeeds,5.);
PropagateForard2(fSeeds);

printf("Time for FORWARD propagation: \t");timer.Print();timer.Start();
// RemoveUsed(fSeeds,0.7,0.7,6);
//RemoveOverlap(fSeeds,0.9,7,kTRUE);

nseed=fSeeds->GetEntriesFast();
found = 0;
for (Int_t i=0; i<nseed; i++) {
AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i), &t=*pt;
if (!pt) continue;
Int_t nc=t.GetNumberOfClusters();
if (nc<15) {
MarkSeedFree( fSeeds->RemoveAt(i) );
continue;
}
t.CookdEdx(0.02,0.6);
// CookLabel(pt,0.1); //For comparison only
//if ((pt->IsActive() || (pt->fRemoval==10) )&& nc>50 &&pt->GetNumberOfClusters()>0.4*pt->fNFoundable){
if ((pt->IsActive() || (pt->fRemoval==10) )){
cerr<<found++<<'\r';
}
else
MarkSeedFree( fSeeds->RemoveAt(i) );
pt->fLab2 = i;
}
*/

// fNTracks = found;
if (fDebug>0){
Info("Clusters2Tracks","Time for overlap removal, track writing and dedx cooking: \t"); timer.Print();timer.Start();
Expand Down

0 comments on commit 0df6b02

Please sign in to comment.