From: Massimo Masera Date: Tue, 10 Dec 2013 16:04:53 +0000 (+0100) Subject: Updated treatment of track labels (Ruben) X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=773dd1f50bb13cac78352e59c0d55f808ef93b5a Updated treatment of track labels (Ruben) --- diff --git a/ITS/AliITStrackV2.cxx b/ITS/AliITStrackV2.cxx index a4d86770e9b..ae71822d02f 100644 --- a/ITS/AliITStrackV2.cxx +++ b/ITS/AliITStrackV2.cxx @@ -65,7 +65,7 @@ AliITStrackV2::AliITStrackV2(AliESDtrack& t,Bool_t c): } Set(par->GetX(),par->GetAlpha(),par->GetParameter(),par->GetCovariance()); - SetLabel(t.GetLabel()); + SetLabel(t.GetITSLabel()); SetMass(t.GetMass()); SetNumberOfClusters(t.GetITSclusters(fIndex)); @@ -94,6 +94,19 @@ void AliITStrackV2::ResetClusters() { void AliITStrackV2::UpdateESDtrack(ULong_t flags) const { // Update track params fESDtrack->UpdateTrackParams(this,flags); + // + // set correctly the global label + if (fESDtrack->IsOn(AliESDtrack::kTPCin)) { + // for global track the GetLabel should be negative if + // 1) GetTPCLabel<0 + // 2) this->GetLabel()<0 + // 3) GetTPCLabel() != this->GetLabel() + int label = fESDtrack->GetTPCLabel(); + int itsLabel = GetLabel(); + if (label<0 || itsLabel<0 || itsLabel!=label) label = -TMath::Abs(label); + fESDtrack->SetLabel(label); + } + // // copy the module indices Int_t i; for(i=0;i<2*AliITSgeomTGeo::kNLayers;i++) { diff --git a/ITS/AliITStrackerMI.cxx b/ITS/AliITStrackerMI.cxx index b7d73309eae..e6877423890 100644 --- a/ITS/AliITStrackerMI.cxx +++ b/ITS/AliITStrackerMI.cxx @@ -752,9 +752,9 @@ Int_t AliITStrackerMI::PropagateBack(AliESDEvent *event) { fTrackToFollow.ResetCovariance(10.); fTrackToFollow.ResetClusters(); if (RefitAt(AliITSRecoParam::GetrInsideITSscreen(),&fTrackToFollow,&t)) { if (!CorrectForTPCtoITSDeadZoneMaterial(&fTrackToFollow)) continue; - fTrackToFollow.SetLabel(t.GetLabel()); + // fTrackToFollow.SetLabel(t.GetLabel()); // why do we neet this //fTrackToFollow.CookdEdx(); - CookLabel(&fTrackToFollow,0.); //For comparison only + CookLabel(&fTrackToFollow,0.); //For comparison only // why do we need this? fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSout); //UseClusters(&fTrackToFollow); ntrk++; @@ -833,7 +833,7 @@ Int_t AliITStrackerMI::RefitInward(AliESDEvent *event) { // fTrackToFollow.CookdEdx(); CookdEdx(&fTrackToFollow); - CookLabel(&fTrackToFollow,0.0); //For comparison only + CookLabel(&fTrackToFollow,0.0); //For comparison only // RS why do we need this? //The beam pipe if (CorrectForPipeMaterial(&fTrackToFollow,"inward")) { @@ -3986,6 +3986,64 @@ void AliITStrackerMI::FlagFakes(const TObjArray &itsTracks) for (int i=6;i--;) delete refArr[i]; } + + +//------------------------------------------------------------------------ +void AliITStrackerMI::CookLabel(AliITStrackMI *track,Float_t wrong) const { + //-------------------------------------------------------------------- + //This function "cooks" a track label. If label<0, this track is fake. + //-------------------------------------------------------------------- + const int kMaxLbPerCl = 3; + int lbID[36],lbStat[36]; + Int_t nLab=0, nCl = track->GetNumberOfClusters(); + // + // track->SetLabel(-1); + // track->SetFakeRatio(0); + // + for (Int_t i=0;iGetClusterIndex(i); + // Int_t l=(cindex & 0xf0000000) >> 28; + AliITSRecPoint *cl = (AliITSRecPoint*)GetCluster(cindex); + // + for (int imc=0;imcGetLabel(imc); + if (trLb<0) break; + // search this mc track in already accounted ones + int iLab; + for (iLab=0;iLabGetESDtrack() && track->GetESDtrack()->IsOn(AliESDtrack::kTPCin)){ + tpcLabel = TMath::Abs(track->GetESDtrack()->GetTPCLabel()); + } + // + // find majority label + if (nCl && nLab) { + int maxLab=0,tpcLabID=-1; + for (int ilb=nLab;ilb--;) { + int st = lbStat[ilb]; + if (lbStat[maxLab]0 && (tpcLabID!=maxLab) && lbStat[maxLab]==lbStat[tpcLabID]) maxLab=tpcLabID; + + track->SetFakeRatio(1.-float(lbStat[maxLab])/nCl); + track->SetLabel( lbStat[maxLab]>=nCl-wrong ? lbID[maxLab] : -lbID[maxLab]); + } + // +} + +/* //------------------------------------------------------------------------ void AliITStrackerMI::CookLabel(AliITStrackMI *track,Float_t wrong) const { //-------------------------------------------------------------------- @@ -4020,9 +4078,10 @@ void AliITStrackerMI::CookLabel(AliITStrackMI *track,Float_t wrong) const { } else { track->SetLabel(tpcLabel); } - AliDebug(2,Form(" nls %d wrong %d label %d tpcLabel %d\n",nclusters,nwrong,track->GetLabel(),tpcLabel)); - + AliDebug(2,Form(" nls %d wrong %d label %d tpcLabel %d\n",nclusters,nwrong,track->GetLabel(),tpcLabel)); } +*/ + //------------------------------------------------------------------------ void AliITStrackerMI::CookdEdx(AliITStrackMI* track){ // @@ -5334,3 +5393,4 @@ Int_t AliITStrackerMI::AliITSlayer::FindClusterForLabel(Int_t label, Int_t *stor } return nfound; } +