SetNumberOfClusters(0);
}
+//____________________________________________________________________________
void AliITStrackV2::UpdateESDtrack(ULong_t flags) const {
+ // Update track params
fESDtrack->UpdateTrackParams(this,flags);
// copy the module indices
for(Int_t i=0;i<12;i++) {
// printf(" %d\n",GetModuleIndex(i));
fESDtrack->SetITSModuleIndex(i,GetModuleIndex(i));
}
+ // copy the 4 dedx samples
+ Double_t sdedx[4]={0.,0.,0.,0.};
+ for(Int_t i=0; i<4; i++) sdedx[i]=fdEdxSample[i];
+ fESDtrack->SetITSdEdxSamples(sdedx);
}
//____________________________________________________________________________
//-----------------------------------------------------------------
// This function calculates dE/dX within the "low" and "up" cuts.
// Origin: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
+ // Updated: F. Prino 8-June-2009
//-----------------------------------------------------------------
- // The clusters order is: SSD-2, SSD-1, SDD-2, SDD-1, SPD-2, SPD-1
+ // The cluster order is: SDD-1, SDD-2, SSD-1, SSD-2
- Int_t i;
Int_t nc=0;
- for (i=0; i<GetNumberOfClusters(); i++) {
- Int_t idx=GetClusterIndex(i);
- idx=(idx&0xf0000000)>>28;
- if (idx>1) nc++; // Take only SSD and SDD
+ Float_t dedx[4];
+ for (Int_t il=0; il<4; il++) { // count good (>0) dE/dx values
+ if(fdEdxSample[il]>0.){
+ dedx[nc]= fdEdxSample[il];
+ nc++;
+ }
+ }
+ if(nc<1){
+ SetdEdx(0.);
+ return;
}
- Int_t swap;//stupid sorting
+ Int_t swap; // sort in ascending order
do {
swap=0;
- for (i=0; i<nc-1; i++) {
- if (fdEdxSample[i]<=fdEdxSample[i+1]) continue;
- Float_t tmp=fdEdxSample[i];
- fdEdxSample[i]=fdEdxSample[i+1]; fdEdxSample[i+1]=tmp;
+ for (Int_t i=0; i<nc-1; i++) {
+ if (dedx[i]<=dedx[i+1]) continue;
+ Float_t tmp=dedx[i];
+ dedx[i]=dedx[i+1];
+ dedx[i+1]=tmp;
swap++;
}
} while (swap);
- Int_t nl=Int_t(low*nc), nu=Int_t(up*nc); //b.b. to take two lowest dEdX
- // values from four ones choose
- // nu=2
- Float_t dedx=0;
- for (i=nl; i<nu; i++) dedx += fdEdxSample[i];
- if (nu-nl>0) dedx /= (nu-nl);
- SetdEdx(dedx);
+ Double_t nl=low*nc, nu =up*nc;
+ Float_t sumamp = 0;
+ Float_t sumweight =0;
+ for (Int_t i=0; i<nc; i++) {
+ Float_t weight =1;
+ if (i<nl+0.1) weight = TMath::Max(1.-(nl-i),0.);
+ if (i>nu-1) weight = TMath::Max(nu-i,0.);
+ sumamp+= dedx[i]*weight;
+ sumweight+=weight;
+ }
+ SetdEdx(sumamp/sumweight);
}
//____________________________________________________________________________
AliDebug(2,"update failed");
continue;
}
- updatetrack->SetSampledEdx(cl->GetQ(),updatetrack->GetNumberOfClusters()-1); //b.b.
+ updatetrack->SetSampledEdx(cl->GetQ(),ilayer-2);
modstatus = 1; // found
} else { // virtual cluster in dead zone
updatetrack->SetNDeadZone(updatetrack->GetNDeadZone()+1);
if (clAcc) {
if (!UpdateMI(track,clAcc,maxchi2,idx)) return kFALSE;
- track->SetSampledEdx(clAcc->GetQ(),track->GetNumberOfClusters()-1);
+ track->SetSampledEdx(clAcc->GetQ(),ilayer-2);
}
track->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
void AliITStrackerMI::CookdEdx(AliITStrackMI* track)
{
//
- //
- // Int_t list[6];
- //AliITSRecPoint * clist[6];
- // Int_t shared = GetNumberOfSharedClusters(track,index,list,clist);
- Float_t dedx[4];
- Int_t accepted=0;
track->SetChi2MIP(9,0);
for (Int_t i=0;i<track->GetNumberOfClusters();i++){
Int_t cindex = track->GetClusterIndex(i);
if (cl->GetLabel(ind)==lab) isWrong=0;
}
track->SetChi2MIP(9,track->GetChi2MIP(9)+isWrong*(2<<l));
- if (l<2) continue;
- //if (l>3 && (cl->GetNy()>4) || (cl->GetNz()>4)) continue; //shared track
- //if (l>3&& !(cl->GetType()==1||cl->GetType()==10)) continue;
- //if (l<4&& !(cl->GetType()==1)) continue;
- dedx[accepted]= track->GetSampledEdx(i);
- //dedx[accepted]= track->fNormQ[l];
- accepted++;
- }
- if (accepted<1) {
- track->SetdEdx(0);
- return;
}
- Int_t indexes[4];
- TMath::Sort(accepted,dedx,indexes,kFALSE);
Double_t low=0.;
Double_t up=0.51;
- Double_t nl=low*accepted, nu =up*accepted;
- Float_t sumamp = 0;
- Float_t sumweight =0;
- for (Int_t i=0; i<accepted; i++) {
- Float_t weight =1;
- if (i<nl+0.1) weight = TMath::Max(1.-(nl-i),0.);
- if (i>nu-1) weight = TMath::Max(nu-i,0.);
- sumamp+= dedx[indexes[i]]*weight;
- sumweight+=weight;
- }
- track->SetdEdx(sumamp/sumweight);
+ track->CookdEdx(low,up);
}
//------------------------------------------------------------------------
void AliITStrackerMI::MakeCoefficients(Int_t ntracks){
for(Int_t i=0;i<12;i++) {
outtrack.SetITSModuleIndex(i,t->GetModuleIndex(i));
}
+ Double_t sdedx[4]={0.,0.,0.,0.};
+ for(Int_t i=0; i<4; i++) sdedx[i]=t->GetSampledEdx(i);
+ outtrack.SetITSdEdxSamples(sdedx);
event->AddTrack(&outtrack);
return;
CookLabel(&fTrackToFollow,0.); //For comparison only
if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) {//The beam pipe
+ fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSrefit);
AliESDtrack *esdTrack =fTrackToFollow.GetESDtrack();
- esdTrack->UpdateTrackParams(&fTrackToFollow,AliESDtrack::kITSrefit);
Double_t r[3]={0.,0.,0.};
Double_t maxD=3.;
esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD);
if (TMath::Abs(fTrackToFollow.GetD(GetX(),GetY()))>4) return 0;
fTrackToFollow.
- SetSampledEdx(cc->GetQ(),fTrackToFollow.GetNumberOfClusters()-1); //b.b.
+ SetSampledEdx(cc->GetQ(),fI-2); //b.b.
{
Double_t x0;
if (!t->Update(cl,maxchi2,idx)) {
return kFALSE;
}
- t->SetSampledEdx(cl->GetQ(),t->GetNumberOfClusters()-1);
+ t->SetSampledEdx(cl->GetQ(),i-2);
}
{