X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSV0Finder.cxx;h=8e7807f2f3ccb93798adb6fdd35e97faa49645d7;hb=9fa9a24529466cf4bc6a32f9d7962645484bdb16;hp=21be8aaad23e25653ff479b5662ef5b31fd9e5ee;hpb=cd90f0a2aa99f2e8fd64581c970b3d46b151f148;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSV0Finder.cxx b/ITS/AliITSV0Finder.cxx index 21be8aaad23..8e7807f2f3c 100644 --- a/ITS/AliITSV0Finder.cxx +++ b/ITS/AliITSV0Finder.cxx @@ -32,18 +32,28 @@ #include "AliESDVertex.h" #include "AliESDEvent.h" #include "AliESDtrack.h" +#include "AliESDV0Params.h" #include "AliV0.h" #include "AliHelix.h" #include "AliITSRecPoint.h" #include "AliITSReconstructor.h" #include "AliITStrackerMI.h" #include "AliITSV0Finder.h" +#include "AliKFParticle.h" +#include "AliKFVertex.h" ClassImp(AliITSV0Finder) -AliITSV0Finder::AliITSV0Finder() { + +AliITSV0Finder::AliITSV0Finder(): +fDebugStreamer(0) + { //Default constructor -} + + if (AliITSReconstructor::GetRecoParam()->GetESDV0Params()->StreamLevel()>0) + fDebugStreamer = new TTreeSRedirector("ITSdebug.root"); +} + //------------------------------------------------------------------------ void AliITSV0Finder::UpdateTPCV0(const AliESDEvent *event, AliITStrackerMI *tracker) @@ -51,6 +61,8 @@ void AliITSV0Finder::UpdateTPCV0(const AliESDEvent *event, // //try to update, or reject TPC V0s // + const Float_t kMinTgl2= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinTgl2(); + TObjArray *trackHypothesys = tracker->GetTrackHypothesys(); Int_t nv0s = event->GetNumberOfV0s(); @@ -126,7 +138,7 @@ void AliITSV0Finder::UpdateTPCV0(const AliESDEvent *event, if (clayer < 5 ){ // calculate chi2 after vertex Float_t chi2p = 0, chi2m=0; // - if (trackp&&TMath::Abs(trackp->GetTgl())<1.){ + if (trackp&&TMath::Abs(trackp->GetTgl())GetClIndex(ilayer)>=0){ chi2p+=trackp->GetDy(ilayer)*trackp->GetDy(ilayer)/(trackp->GetSigmaY(ilayer)*trackp->GetSigmaY(ilayer))+ @@ -140,7 +152,7 @@ void AliITSV0Finder::UpdateTPCV0(const AliESDEvent *event, chi2p = 0; } // - if (trackm&&TMath::Abs(trackm->GetTgl())<1.){ + if (trackm&&TMath::Abs(trackm->GetTgl())GetClIndex(ilayer)>=0){ chi2m+=trackm->GetDy(ilayer)*trackm->GetDy(ilayer)/(trackm->GetSigmaY(ilayer)*trackm->GetSigmaY(ilayer))+ @@ -170,20 +182,61 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, // max distance DCA between 2 tracks cut // maxDist = TMath::Min(kMaxDist,kMaxDist0+pvertex->GetRr()*kMaxDist); // - const Float_t kMaxDist0 = 0.1; - const Float_t kMaxDist1 = 0.1; - const Float_t kMaxDist = 1; - const Float_t kMinPointAngle = 0.85; - const Float_t kMinPointAngle2 = 0.99; - const Float_t kMinR = 0.5; - const Float_t kMaxR = 220; - //const Float_t kCausality0Cut = 0.19; - //const Float_t kLikelihood01Cut = 0.25; - //const Float_t kPointAngleCut = 0.9996; - const Float_t kCausality0Cut = 0.19; - const Float_t kLikelihood01Cut = 0.45; - const Float_t kLikelihood1Cut = 0.5; - const Float_t kCombinedCut = 0.55; + const Bool_t kCheckPropagate = kFALSE; + const Float_t kMaxDist0 = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxDist0(); + const Float_t kMaxDist1 = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxDist1(); + const Float_t kMaxDist = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxDist(); + const Float_t kMinPointAngle = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinPointAngle(); + const Float_t kMinPointAngle2 = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinPointAngle2(); + const Float_t kMinR = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinR(); + const Float_t kMaxR = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxR(); + const Float_t kMinPABestConst = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinPABestConst(); + const Float_t kMaxRBestConst = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxRBestConst(); + const Float_t kCausality0Cut = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetCausality0Cut(); + const Float_t kLikelihood01Cut = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetLikelihood01Cut(); + const Float_t kLikelihood1Cut = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetLikelihood1Cut(); + const Float_t kCombinedCut = AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetCombinedCut(); + const Float_t kMinClFullTrk= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinClFullTrk(); + const Float_t kMinTgl0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinTgl0(); + const Float_t kMinRTgl0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinRTgl0(); + + const Float_t kMinNormDistForbTgl0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForbTgl0(); + const Float_t kMinClForb0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinClForb0(); + const Float_t kMinNormDistForb1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForb1(); + const Float_t kMinNormDistForb2= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForb2(); + const Float_t kMinNormDistForb3= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForb3(); + const Float_t kMinNormDistForb4= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForb4(); + const Float_t kMinNormDistForb5= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForb5(); + const Float_t kMinNormDistForbProt= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinNormDistForbProt(); + const Float_t kMaxPidProbPionForb= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxPidProbPionForb(); + + const Float_t kMinRTPCdensity= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinRTPCdensity(); + const Float_t kMaxRTPCdensity0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxRTPCdensity0(); + const Float_t kMaxRTPCdensity10= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxRTPCdensity10(); + const Float_t kMaxRTPCdensity20= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxRTPCdensity20(); + const Float_t kMaxRTPCdensity30= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxRTPCdensity30(); + + + const Float_t kMinTPCdensity= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinTPCdensity(); + const Float_t kMinTgl1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinTgl1(); + + const Float_t kMinchi2before0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinchi2before0(); + const Float_t kMinchi2before1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinchi2before1(); + const Float_t kMinchi2after0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinchi2after0(); + const Float_t kMinchi2after1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMinchi2after1(); + const Float_t kAddchi2SharedCl= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetAddchi2SharedCl(); + const Float_t kAddchi2NegCl0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetAddchi2NegCl0(); + const Float_t kAddchi2NegCl1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetAddchi2NegCl1(); + + const Float_t kSigp0Par0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetSigp0Par0(); + const Float_t kSigp0Par1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetSigp0Par1(); + const Float_t kSigp0Par2= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetSigp0Par2(); + + const Float_t kSigpPar0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetSigpPar0(); + const Float_t kSigpPar1= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetSigpPar1(); + const Float_t kSigpPar2= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetSigpPar2(); + const Float_t kMaxDcaLh0= AliITSReconstructor::GetRecoParam()->GetESDV0Params()->GetMaxDcaLh0(); + TObjArray *trackHypothesys = tracker->GetTrackHypothesys(); TObjArray *bestHypothesys = tracker->GetBestHypothesys(); @@ -201,6 +254,9 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, TObjArray trackarray(ntracks+2); //array with tracks - with vertex constrain TObjArray trackarrayc(ntracks+2); //array of "best tracks" - without vertex constrain TObjArray trackarrayl(ntracks+2); //array of "longest tracks" - without vertex constrain + //Change from Bool_t to Int_t for optimization + // Int_t forbN=0; + // Int_t * forbidden = new Int_t [ntracks+2]; Bool_t * forbidden = new Bool_t [ntracks+2]; Int_t *itsmap = new Int_t [ntracks+2]; Float_t *dist = new Float_t[ntracks+2]; @@ -223,6 +279,7 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, // for (Int_t itrack=0;itrackAt(ih); if (!trackh->GetConstrain()) continue; if (!bestConst) bestConst = trackh; - if (trackh->GetNumberOfClusters()>5.0){ + if (trackh->GetNumberOfClusters()>kMinClFullTrk ){ bestConst = trackh; // full track - with minimal chi2 break; } @@ -285,7 +342,7 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, if (trackh->GetConstrain()) continue; if (!best) best = trackh; if (!bestLong) bestLong = trackh; - if (trackh->GetNumberOfClusters()>5.0){ + if (trackh->GetNumberOfClusters()>kMinClFullTrk){ bestLong = trackh; // full track - with minimal chi2 break; } @@ -300,9 +357,12 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, new (&trackat0) AliITStrackMI(*bestLong); Double_t xx,yy,zz,alpha; if (!bestLong->GetGlobalXYZat(bestLong->GetX(),xx,yy,zz)) continue; + + alpha = TMath::ATan2(yy,xx); // if (!trackat0.Propagate(alpha,0)) continue; - trackat0.Propagate(alpha,0); //PH The check on the return value is temporarily disabled (bug 45751) + // trackat0.Propagate(alpha,0); //PH The check on the return value is temporarily disabled (bug 45751) + if(!trackat0.Propagate(alpha,0) && kCheckPropagate)continue; // calculate normalized distances to the vertex // Float_t ptfac = (1.+100.*TMath::Abs(trackat0.GetC())); @@ -334,14 +394,20 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, normdist0[itsindex] = TMath::Abs(trackat0.GetY()/norm[itsindex]); normdist1[itsindex] = TMath::Abs((trackat0.GetZ()-primvertex[2])/(ptfac*TMath::Sqrt(trackat0.GetSigmaZ2()))); normdist[itsindex] = TMath::Sqrt(normdist0[itsindex]*normdist0[itsindex]+normdist1[itsindex]*normdist1[itsindex]); - if (TMath::Abs(trackat0.GetTgl())>1.05){ - if (normdist[itsindex]<3) forbidden[itsindex]=kTRUE; - if (normdist[itsindex]>3) { - minr[itsindex] = TMath::Max(Float_t(40.),minr[itsindex]); + if (TMath::Abs(trackat0.GetTgl())>kMinTgl0){ + if (normdist[itsindex]kMinNormDistForbTgl0) { + minr[itsindex] = TMath::Max(kMinRTgl0,minr[itsindex]); } } } } + + // //----------------------------------------------------------- //Forbid primary track candidates - @@ -354,15 +420,39 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, //treetr->SetAlias("forbidden5","ND<5&&Tr1.fNormChi2[0]<1"); //----------------------------------------------------------- if (bestConst){ - if (bestLong->GetNumberOfClusters()<4 && bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()>4.5) forbidden[itsindex]=kTRUE; - if (normdist[itsindex]<3 && bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()>5.5) forbidden[itsindex]=kTRUE; - if (normdist[itsindex]<2 && bestConst->GetClIndex(0)>=0 && bestConst->GetClIndex(1)>=0 ) forbidden[itsindex]=kTRUE; - if (normdist[itsindex]<1 && bestConst->GetClIndex(0)>=0) forbidden[itsindex]=kTRUE; - if (normdist[itsindex]<4 && bestConst->GetNormChi2(0)<2) forbidden[itsindex]=kTRUE; - if (normdist[itsindex]<5 && bestConst->GetNormChi2(0)<1) forbidden[itsindex]=kTRUE; + if (bestLong->GetNumberOfClusters()<4 && bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()>kMinClForb0){ + // forbN=2; + // forbidden[itsindex]+=1<GetNumberOfClusters()+bestConst->GetNDeadZone()>5.5){ + // forbN=3; + // forbidden[itsindex]+=1<GetClIndex(0)>=0 && bestConst->GetClIndex(1)>=0 ){ + // forbN=4; + // forbidden[itsindex]+=1<GetClIndex(0)>=0){ + // forbN=5; + // forbidden[itsindex]+=1<GetNormChi2(0)<2){ + // forbN=6; + // forbidden[itsindex]+=1<GetNormChi2(0)<1){ + // forbN=7; + // forbidden[itsindex]+=1<GetNormChi2(0)<2.5) { - minPointAngle[itsindex]= 0.9999; - maxr[itsindex] = 10; + minPointAngle[itsindex]= kMinPABestConst; + maxr[itsindex] = kMaxRBestConst; } } // @@ -382,22 +472,28 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, normdist[itsindex]*=-1; } if (isProton){ - if (normdist[itsindex]>2) forbidden[itsindex]=kFALSE; + if (normdist[itsindex]>kMinNormDistForbProt) forbidden[itsindex]=kFALSE; normdist[itsindex]*=-1; } + // We allow all tracks that are not pions + if( (pid[1]+pid[2])< kMaxPidProbPionForb ){ + forbidden[itsindex]=kFALSE; + } + // // Causality cuts in TPC volume // - if (esdtrack->GetTPCdensity(0,10) >0.6) maxr[itsindex] = TMath::Min(Float_t(110),maxr[itsindex]); - if (esdtrack->GetTPCdensity(10,30)>0.6) maxr[itsindex] = TMath::Min(Float_t(120),maxr[itsindex]); - if (esdtrack->GetTPCdensity(20,40)>0.6) maxr[itsindex] = TMath::Min(Float_t(130),maxr[itsindex]); - if (esdtrack->GetTPCdensity(30,50)>0.6) maxr[itsindex] = TMath::Min(Float_t(140),maxr[itsindex]); + if (esdtrack->GetTPCdensity(0,10) >kMinTPCdensity) maxr[itsindex] = TMath::Min(Float_t(kMaxRTPCdensity0),maxr[itsindex]); + if (esdtrack->GetTPCdensity(10,30)>kMinTPCdensity) maxr[itsindex] = TMath::Min(Float_t(kMaxRTPCdensity10),maxr[itsindex]); + if (esdtrack->GetTPCdensity(20,40)>kMinTPCdensity) maxr[itsindex] = TMath::Min(Float_t(kMaxRTPCdensity20),maxr[itsindex]); + if (esdtrack->GetTPCdensity(30,50)>kMinTPCdensity) maxr[itsindex] = TMath::Min(Float_t(kMaxRTPCdensity30),maxr[itsindex]); // - if (esdtrack->GetTPCdensity(0,60)<0.4&&bestLong->GetNumberOfClusters()<3) minr[itsindex]=100; + if (esdtrack->GetTPCdensity(0,60)<0.4&&bestLong->GetNumberOfClusters()<3) minr[itsindex]=kMinRTPCdensity; // // - if (kFALSE){ + + if (AliITSReconstructor::GetRecoParam()->GetESDV0Params()->StreamLevel()>0){ cstream<<"Track"<< "Tr0.="<GetRr()); - Float_t sigmap = 0.5*sigmap0*(0.6+0.4*p12); // "resolution: of point angle - as a function of radius and momenta + + Float_t sigmap0 = kSigp0Par0+kSigp0Par1/(kSigp0Par2+pvertex->GetRr()); + Float_t sigmap = kSigpPar0*sigmap0*(kSigpPar1+kSigpPar2*p12); // "resolution: of point angle - as a function of radius and momenta + Float_t causalityA = (1.0-pvertex->GetCausalityP()[0])*(1.0-pvertex->GetCausalityP()[1]); Float_t causalityB = TMath::Sqrt(TMath::Min(pvertex->GetCausalityP()[2],Double_t(0.7))* @@ -714,25 +934,42 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, // //Bo: Float_t likelihood0 = (TMath::Exp(-pvertex->GetDistNorm())+0.1) *(pvertex->GetDist2()<0.5)*(pvertex->GetDistNorm()<5); Float_t lDistNorm = pvertex->GetDcaV0Daughters()/pvertex->GetDistSigma(); - Float_t likelihood0 = (TMath::Exp(-lDistNorm)+0.1) *(pvertex->GetDcaV0Daughters()<0.5)*(lDistNorm<5); + Float_t likelihood0 = (TMath::Exp(-lDistNorm)+0.1) *(pvertex->GetDcaV0Daughters()GetV0CosineOfPointingAngle())/sigmap)+ 0.4*TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/(4.*sigmap))+ 0.4*TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/(8.*sigmap))+ 0.1*TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/0.01); // - if (causalityAGetESDV0Params()->StreamLevel()>0){ Bool_t gold = TMath::Abs(TMath::Abs(track0->GetLabel())-TMath::Abs(track1->GetLabel()))==1; cstream<<"It0"<< "Tr0.="<0) continue; + //if (forbidden[itrack0]>0 ||forbidden[itrack1]>0) continue; // pvertex->SetStatus(0); // if (rejectBase) { @@ -762,6 +1011,7 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, //Bo: pvertex->SetESDindexes(track0->GetESDtrack()->GetID(),track1->GetESDtrack()->GetID()); pvertex->SetIndex(0,track0->GetESDtrack()->GetID());//Bo: consistency 0 for neg pvertex->SetIndex(1,track1->GetESDtrack()->GetID());//Bo: consistency 1 for pos + // if (v0OK==0){ if (v0OK){ // AliV0vertex vertexjuri(*track0,*track1); // vertexjuri.SetESDindexes(track0->fESDtrack->GetID(),track1->fESDtrack->GetID()); @@ -790,6 +1040,7 @@ void AliITSV0Finder::FindV02(AliESDEvent *event, delete[] itsmap; delete[] helixes; delete pvertex; + delete dummy; } //------------------------------------------------------------------------ void AliITSV0Finder::RefitV02(const AliESDEvent *event, @@ -820,7 +1071,7 @@ void AliITSV0Finder::RefitV02(const AliESDEvent *event, v0temp.SetParamN(tpc0); v0temp.SetParamP(tpc1); v0temp.Update(primvertex); - if (kFALSE) cstream<<"Refit"<< + if (AliITSReconstructor::GetRecoParam()->GetESDV0Params()->StreamLevel()>0) cstream<<"Refit"<< "V0.="<GetESDV0Params()->StreamLevel()>0) cstream<<"Refit"<< "V0.="<GetESDV0Params()->StreamLevel()>0) cstream<<"Refit"<< "V0.="<