Adding some checks for track splitting
authorxsanchez <xitzel.sanchez.castro@cern.ch>
Fri, 4 Jul 2014 15:14:33 +0000 (17:14 +0200)
committerxsanchez <xitzel.sanchez.castro@cern.ch>
Fri, 4 Jul 2014 15:14:33 +0000 (17:14 +0200)
PWGLF/STRANGENESS/Correlations/AliAnalysisTaskLambdaOverK0sJets.cxx
PWGLF/STRANGENESS/Correlations/AliAnalysisTaskLambdaOverK0sJets.h

index d3e1c27..88912b2 100644 (file)
@@ -83,7 +83,7 @@ AliAnalysisTaskLambdaOverK0sJets::AliAnalysisTaskLambdaOverK0sJets(const char *n
 
   fMinPtDaughter(0.160), fMaxEtaDaughter(0.8), fMaxDCADaughter(1.0), fUseEtaCut(kFALSE), fYMax(0.7), fDCAToPrimVtx(0.1), fMinCPA(0.998), fNSigma(3.0), fDaugNClsTPC(70.), fMinCtau(0.), fMaxCtau(3.), fIdTrigger(-1), fIsV0LP(0), fPtV0LP(0.), fIsSndCheck(0),
 
-  fOutput(0), fOutputQA(0), fOutputME(0), fMEList(0x0), fTriggerParticles(0x0), fTriggerPartMC(0x0), fAssocParticles(0x0), fAssocPartMC(0x0), fEvents(0), fCentrality(0),  fCentrality2(0), fCentralityTrig(0), fPrimaryVertexX(0), fPrimaryVertexY(0), fPrimaryVertexZ(0),
+  fOutput(0), fOutputQA(0), fOutputME(0), fMEList(0x0), fTriggerParticles(0x0), fTriggerPartMC(0x0), fAssocParticles(0x0), fAssocPartMC(0x0), fEvents(0), fCentrality(0),  fCentrality2(0), fCentralityTrig(0), fPrimayVtxGlobalvsSPD(0), fPrimaryVertexX(0), fPrimaryVertexY(0), fPrimaryVertexZ(0),
 
  fTriggerEventPlane(0),  fTriggerMCPtCent(0), fTriggerMCResPt(0), fTriggerMCResEta(0), fTriggerMCResPhi(0), fTriggerPtCent(0),  fTriggerPtCentCh(0), fNTrigPerEvt(0), fTriggerWiSPDHit(0), fTriggerEtaPhi(0), fCheckTriggerFromV0Daug(0), fTriggerComingFromDaug(0), fTriggerIsV0(0), fCheckIDTrigPtK0s(0), fCheckIDTrigPhiK0s(0), fCheckIDTrigEtaK0s(0), fCheckIDTrigNclsK0s(0), fCheckIDTrigPtLambda(0), fCheckIDTrigPhiLambda(0), fCheckIDTrigEtaLambda(0),  fCheckIDTrigNclsLambda(0), fCheckIDTrigPtAntiLambda(0), fCheckIDTrigPhiAntiLambda(0), fCheckIDTrigEtaAntiLambda(0), fCheckIDTrigNclsAntiLambda(0), 
 
@@ -93,11 +93,11 @@ fK0sMCPt(0), fK0sMCPtRap(0), fK0sMCPtRap2(0),  fK0sMCPtRapEmbeded(0), fK0sAssocP
 
   fHistArmenterosPodolanski(0), fHistArmPodBckg(0),
   
-  fK0sMass(0), fK0sMassEmbeded(0), fK0sMassPtEta(0), fK0sMassPtPhi(0), fK0sDaughtersPt(0), fK0sDCADaugToPrimVtx(0), fK0sSpatialRes(0), fK0sBckgDecLength(0), fK0sBckgDCADaugToPrimVtx(0), fK0sBckgEtaPhi(0), fK0sBckgPhiRadio(0), fK0sBckgDCANegDaugToPrimVtx(0), fK0sBckgDCAPosDaugToPrimVtx(0), fV0MassCascade(0),
+  fK0sMass(0), fK0sMassEmbeded(0), fK0sMassPtEta(0), fK0sMassPtPhi(0), fK0sDaughtersPt(0),  fSharedClsTrigDaug(0), fK0sPosDaugSplCheckCovMat(0x0), fK0sNegDaugSplCheckCovMat(0x0), fK0sDCADaugToPrimVtx(0), fK0sSpatialRes(0), fK0sBckgDecLength(0), fK0sBckgDCADaugToPrimVtx(0), fK0sBckgEtaPhi(0), fK0sBckgPhiRadio(0), fK0sBckgDCANegDaugToPrimVtx(0), fK0sBckgDCAPosDaugToPrimVtx(0), fV0MassCascade(0),
   
-  fLambdaMass(0), fLambdaMassEmbeded(0), fLambdaMass2(0), fLambdaMass2Embeded(0), fLambdaMassPtEta(0), fLambdaMassPtPhi(0), fLambdaDaughtersPt(0), fLambdaDCADaugToPrimVtx(0), fLambdaSpatialRes(0), fLambdaBckgDecLength(0), fLambdaBckgDCADaugToPrimVtx(0), fLambdaBckgEtaPhi(0), fLambdaBckgPhiRadio(0), fLambdaBckgDCANegDaugToPrimVtx(0), fLambdaBckgDCAPosDaugToPrimVtx(0), 
+  fLambdaMass(0), fLambdaMassEmbeded(0), fLambdaMass2(0), fLambdaMass2Embeded(0), fLambdaMassPtEta(0), fLambdaMassPtPhi(0), fLambdaDaughtersPt(0), fLambdaPosDaugSplCheckCovMat(0x0), fLambdaNegDaugSplCheckCovMat(0x0), fLambdaDCADaugToPrimVtx(0), fLambdaSpatialRes(0), fLambdaBckgDecLength(0), fLambdaBckgDCADaugToPrimVtx(0), fLambdaBckgEtaPhi(0), fLambdaBckgPhiRadio(0), fLambdaBckgDCANegDaugToPrimVtx(0), fLambdaBckgDCAPosDaugToPrimVtx(0), 
 
-  fAntiLambdaMass(0), fAntiLambdaMassEmbeded(0), fAntiLambdaMass2(0), fAntiLambdaMass2Embeded(0), fAntiLambdaMassPtEta(0), fAntiLambdaMassPtPhi(0), fAntiLambdaDaughtersPt(0), fAntiLambdaDCADaugToPrimVtx(0), fAntiLambdaSpatialRes(0), fAntiLambdaBckgDecLength(0), fAntiLambdaBckgDCADaugToPrimVtx(0), fAntiLambdaBckgEtaPhi(0), fAntiLambdaBckgPhiRadio(0), fAntiLambdaBckgDCANegDaugToPrimVtx(0), fAntiLambdaBckgDCAPosDaugToPrimVtx(0), 
+  fAntiLambdaMass(0), fAntiLambdaMassEmbeded(0), fAntiLambdaMass2(0), fAntiLambdaMass2Embeded(0), fAntiLambdaMassPtEta(0), fAntiLambdaMassPtPhi(0), fAntiLambdaDaughtersPt(0), fAntiLambdaPosDaugSplCheckCovMat(0x0), fAntiLambdaNegDaugSplCheckCovMat(0x0), fAntiLambdaDCADaugToPrimVtx(0), fAntiLambdaSpatialRes(0), fAntiLambdaBckgDecLength(0), fAntiLambdaBckgDCADaugToPrimVtx(0), fAntiLambdaBckgEtaPhi(0), fAntiLambdaBckgPhiRadio(0), fAntiLambdaBckgDCANegDaugToPrimVtx(0), fAntiLambdaBckgDCAPosDaugToPrimVtx(0), 
 
   fK0sPtPosDaug(0), fK0sPtNegDaug(0), fK0sBckgPtPosDaug(0), fK0sBckgPtNegDaug(0), fK0sPhiEtaPosDaug(0), fK0sPhiEtaNegDaug(0), fK0sBckgPhiEtaPosDaug(0), fK0sBckgPhiEtaNegDaug(0), fK0sDCAPosDaug(0), fK0sDCANegDaug(0), fK0sBckgDCAPosDaug(0), fK0sBckgDCANegDaug(0), fK0sDecayPos(0), fK0sBckgDecayPos(0), fK0sDecayVertex(0), fK0sBckgDecayVertex(0), fK0sCPA(0), fK0sBckgCPA(0), fK0sDCAV0Daug(0), fK0sBckgDCAV0Daug(0), fK0sNClustersTPC(0), fK0sBckgNClustersTPC(0), fK0sNClustersITSPos(0), fK0sNClustersITSNeg(0), fK0sBckgNClustersITSPos(0), fK0sBckgNClustersITSNeg(0),   
 
@@ -289,16 +289,16 @@ void AliAnalysisTaskLambdaOverK0sJets::UserCreateOutputObjects()
   fEvents->GetXaxis()->SetBinLabel(2,"AOD available");
   fEvents->GetXaxis()->SetBinLabel(3,"CINT1B");
   fEvents->GetXaxis()->SetBinLabel(4,"V0M Cent");
-  fEvents->GetXaxis()->SetBinLabel(5,"Vtx > 3 part");
-  fEvents->GetXaxis()->SetBinLabel(6,"|VtxZ| < 10 cm");
-  fEvents->GetXaxis()->SetBinLabel(7,"Mult && Cent");
-  fEvents->GetXaxis()->SetBinLabel(8,"Bad ID Trigger");
+  fEvents->GetXaxis()->SetBinLabel(5,"Global Vtx > 3 part");
+  fEvents->GetXaxis()->SetBinLabel(6,"SPD Vtx > 3 part");
+  fEvents->GetXaxis()->SetBinLabel(7,"|ZVtx Global - Zvtx SPD| < 0.5 cm");
+  fEvents->GetXaxis()->SetBinLabel(8,"|VtxZ| < 10 cm");
   fEvents->GetXaxis()->SetBinLabel(9,"V0 is LP");
-  fEvents->GetXaxis()->SetBinLabel(10,"Trigger is V0 daug");
-  fEvents->GetXaxis()->SetBinLabel(11,"Trigger is V0 daug && 2nd check");
+  fEvents->GetXaxis()->SetBinLabel(10," ");
+  fEvents->GetXaxis()->SetBinLabel(11," ");
   fEvents->GetXaxis()->SetBinLabel(12,"Triggered");
   fEvents->GetXaxis()->SetBinLabel(13,"NOT Triggered");
-  fEvents->GetXaxis()->SetBinLabel(14,"V0 is LP in MC");
+  fEvents->GetXaxis()->SetBinLabel(14," ");
   fEvents->GetYaxis()->SetTitle("Counts"); 
   fOutput->Add(fEvents);
 
@@ -316,6 +316,9 @@ void AliAnalysisTaskLambdaOverK0sJets::UserCreateOutputObjects()
   fOutput->Add(fCentralityTrig);
 
   // Primary Vertex:
+  fPrimayVtxGlobalvsSPD = new TH2F("fPrimayVtxGlobalvsSPD",";Z_{vtx,tr} (cm);Z_{SPD,tr} (cm)",200,-20,20,200,-20,20);
+  fOutput->Add(fPrimayVtxGlobalvsSPD);
+
   fPrimaryVertexX = new TH1F("fPrimaryVertexX", "Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5);
   fOutput->Add(fPrimaryVertexX);
   
@@ -851,11 +854,14 @@ void AliAnalysisTaskLambdaOverK0sJets::UserCreateOutputObjects()
   fOutput->Add(fHistArmenterosPodolanski);
  
   fHistArmPodBckg =
-    new TH3F("fHistArmPodBckg","Background: Armenteros-Podolanski phase space;#alpha;p_{t} arm",
-             100,-1.0,1.0,50,0,0.5,4,-0.5,3.5);
-  fHistArmPodBckg->GetZaxis()->SetBinLabel(1,"K^{0}_{S}: Trig events");
-  fHistArmPodBckg->GetZaxis()->SetBinLabel(2,"#Lambda: Trig events");
-  fHistArmPodBckg->GetZaxis()->SetBinLabel(3,"#bar{#Lambda}: Trig events");
+    new TH3F("fHistArmPodBckg","Armenteros-Podolanski phase space for correlations;#alpha;p_{t} arm",
+             100,-1.0,1.0,50,0,0.5,6,-0.5,5.5);
+  fHistArmPodBckg->GetZaxis()->SetBinLabel(1,"K^{0}_{S} SigBck: Trig events");
+  fHistArmPodBckg->GetZaxis()->SetBinLabel(2,"K^{0}_{S} Bck: Trig events");
+  fHistArmPodBckg->GetZaxis()->SetBinLabel(3,"#Lambda SigBck: Trig events");
+  fHistArmPodBckg->GetZaxis()->SetBinLabel(4,"#Lambda Bck: Trig events");
+  fHistArmPodBckg->GetZaxis()->SetBinLabel(5,"#bar{#Lambda} SigBck: Trig events");
+  fHistArmPodBckg->GetZaxis()->SetBinLabel(6,"#bar{#Lambda} Bck: Trig events");
   fOutput->Add(fHistArmPodBckg);
  
   // ****** K0s ******
@@ -887,7 +893,34 @@ void AliAnalysisTaskLambdaOverK0sJets::UserCreateOutputObjects()
              nbins,0.398,0.598,nbins,pMin,pMax,nbinsPhi,0.,2.*TMath::Pi());
   fOutput->Add(fK0sMassPtPhi);
   
-  // Correlations:
+  // ================== Correlations =================
+
+  // ----------------Splitting:
+  //    Shared TPC clusters status between trigger and daughter tracks
+  fSharedClsTrigDaug = new TH3F("fSharedClsTrigDaug","Splitting chech with TPC map;",100,0.,10.,100,0.,10.,6,0.,6.);
+  fOutput->Add(fSharedClsTrigDaug);
+
+  //-----
+  Double_t binsDev[120];
+  binsDev[0] = 0;
+
+  for (Int_t k=0;k<=11;k++)
+    for (Int_t j=1;j<=10;j++)
+      binsDev[k*10+j] = j*TMath::Power(10,k);
+     
+  Int_t binsSplit[4] = {100,100,120,7};   Double_t xminSplit[4] = {pMin,pMin,0,0.}; Double_t xmaxSplit[4] = {pMax,pMax,1e+12,7.0};    
+
+  // positive daughter
+  fK0sPosDaugSplCheckCovMat  = new THnSparseD("fK0sPosDaugSplCheckCovMat", "K^{0}_{S} Pos. daughter; #it{p}_{T,V0} (GeV/#it{c}); #it{p}_{Daug} (GeV/#it{c});  X-X'/( #sigma^{2} - #sigma'^{2} ); Variables;",4,binsSplit,xminSplit,xmaxSplit);
+  fK0sPosDaugSplCheckCovMat->SetBinEdges(2,binsDev);
+  fOutput->Add(fK0sPosDaugSplCheckCovMat);  
+
+  // negative daughter
+  fK0sNegDaugSplCheckCovMat  = new THnSparseD("fK0sNegDaugSplCheckCovMat", "K^{0}_{S} Neg. daughter; #it{p}_{T,V0} (GeV/#it{c}); #it{p}_{Daug} (GeV/#it{c});  X-X'/( #sigma^{2} - #sigma'^{2} ); Variables;",4,binsSplit,xminSplit,xmaxSplit);
+  fK0sNegDaugSplCheckCovMat->SetBinEdges(2,binsDev);
+  fOutput->Add(fK0sNegDaugSplCheckCovMat); 
+
+  //    DCA to prim vertex
   fK0sDCADaugToPrimVtx  
     = new TH3F("fK0sDCADaugToPrimVtx","K^{0}_{S} Bckg: dca daughter vs. p_{T,l};DCA Pos daug (cm);DCA Neg daug (cm);p_{T,l} (GeV/#it{c})",
               90,0.,3.3,90,0.,3.3,nbinPtLP,pMin,ptMaxLP);
@@ -1038,7 +1071,21 @@ void AliAnalysisTaskLambdaOverK0sJets::UserCreateOutputObjects()
             nbins,1.065,1.165,nbins,pMin,pMax,nbinsPhi,0.,2.*TMath::Pi());
   fOutput->Add(fLambdaMassPtPhi);
 
-  // Correlations:
+  // ================== Correlations =================
+
+  // ----------------Splitting:
+
+  // positive daughter
+  fLambdaPosDaugSplCheckCovMat  = new THnSparseD("fLambdaPosDaugSplCheckCovMat", "#Lambda Pos. daughter; #it{p}_{T,V0} (GeV/#it{c}); #it{p}_{Daug} (GeV/#it{c});  X-X'/( #sigma^{2} - #sigma'^{2} ); Variables;",4,binsSplit,xminSplit,xmaxSplit);
+  fLambdaPosDaugSplCheckCovMat->SetBinEdges(2,binsDev);
+  fOutput->Add(fLambdaPosDaugSplCheckCovMat);  
+
+  // negative daughter
+  fLambdaNegDaugSplCheckCovMat  = new THnSparseD("fLambdaNegDaugSplCheckCovMat", "#Lambda Neg. daughter; #it{p}_{T,V0} (GeV/#it{c}); #it{p}_{Daug} (GeV/#it{c});  X-X'/( #sigma^{2} - #sigma'^{2} ); Variables;",4,binsSplit,xminSplit,xmaxSplit);
+  fLambdaNegDaugSplCheckCovMat->SetBinEdges(2,binsDev);
+  fOutput->Add(fLambdaNegDaugSplCheckCovMat); 
+
+  //    DCA to prim vertex
   fLambdaDCADaugToPrimVtx  
     = new TH3F("fLambdaDCADaugToPrimVtx","#Lambda Bckg: dca daughter vs. p_{T,l}",
               90,0.,3.3,90,0.,3.3,nbinPtLP,pMin,ptMaxLP);
@@ -1190,7 +1237,22 @@ void AliAnalysisTaskLambdaOverK0sJets::UserCreateOutputObjects()
   fOutput->Add(fAntiLambdaMassPtPhi);
 
 
-  // Correlations:
+
+  // ================== Correlations =================
+
+  // ----------------Splitting:
+
+  // positive daughter
+  fAntiLambdaPosDaugSplCheckCovMat  = new THnSparseD("fAntiLambdaPosDaugSplCheckCovMat", "#bar{#Lambda} Pos. daughter; #it{p}_{T,V0} (GeV/#it{c}); #it{p}_{Daug} (GeV/#it{c});  X-X'/( #sigma^{2} - #sigma'^{2} ); Variables;",4,binsSplit,xminSplit,xmaxSplit);
+  fAntiLambdaPosDaugSplCheckCovMat->SetBinEdges(2,binsDev);
+  fOutput->Add(fAntiLambdaPosDaugSplCheckCovMat);  
+
+  // negative daughter
+  fAntiLambdaNegDaugSplCheckCovMat  = new THnSparseD("fAntiLambdaNegDaugSplCheckCovMat", "#bar{#Lambda} Neg. daughter; #it{p}_{T,V0} (GeV/#it{c}); #it{p}_{Daug} (GeV/#it{c});  X-X'/( #sigma^{2} - #sigma'^{2} ); Variables;",4,binsSplit,xminSplit,xmaxSplit);
+  fAntiLambdaNegDaugSplCheckCovMat->SetBinEdges(2,binsDev);
+  fOutput->Add(fAntiLambdaNegDaugSplCheckCovMat); 
+
+  //    DCA to prim vertex
   fAntiLambdaDCADaugToPrimVtx  
     = new TH3F("fAntiLambdaDCADaugToPrimVtx","#bar{#Lambda} Bckg: dca daughter vs. p_{T,l}",
               90,0.,3.3,90,0.,3.3,nbinPtLP,pMin,ptMaxLP);
@@ -2028,6 +2090,62 @@ static Float_t SpatialResolution(Float_t p1x,Float_t p1y,Float_t p2x,Float_t p2y
 
 //___________________________________________________________________________________________
 
+Bool_t AliAnalysisTaskLambdaOverK0sJets::GoodTPCSharedMap(const AliAODTrack *track){
+  // Rejects tracks with shared clusters after filling a control histogram
+  // This overload is used for primaries
+  // Get the shared maps
+  const TBits sharedMap = track->GetTPCSharedMap();
+  // Fill a control histogram
+  //fPriHistShare->Fill(sharedMap.CountBits());
+  // Reject shared clusters
+  if((sharedMap.CountBits()) >= 1){
+    // Bad track, has too many shared clusters!
+    return kFALSE;
+  }
+  return kTRUE;
+}
+
+//___________________________________________________________________________________________
+
+Bool_t AliAnalysisTaskLambdaOverK0sJets::GoodTPCSharedMap(AliAODTrack *track){
+  // Rejects tracks with shared clusters after filling a control histogram
+  // This overload is used for primaries
+  // Get the shared maps
+  const TBits sharedMap = track->GetTPCSharedMap();
+  // Fill a control histogram
+  //fPriHistShare->Fill(sharedMap.CountBits());
+  // Reject shared clusters
+  if((sharedMap.CountBits()) >= 1){
+    // Bad track, has too many shared clusters!
+    return kFALSE;
+  }
+  return kTRUE;
+}
+
+//___________________________________________________________________________________________
+/*   under developing
+Float_t AliAnalysisTaskLambdaOverK0sJets::GetFractionTPCSharedCls(AliAODTrack *track1,const AliAODTrack *track2){
+  // Rejects tracks with shared clusters after filling a control histogram
+  // This overload is used for primaries
+  // Get the shared maps
+  const TBits fTPCClusterMap1 = track1->GetTPCClusterMap();
+  const TBits fTPCClusterMap2 = track2->GetTPCClusterMap();
+  // Fill a control histogram
+  //fPriHistShare->Fill(sharedMap.CountBits());
+  // Reject shared clusters
+  
+  for(Int_t i=0; i<=159; i++)
+    cout << fTPCClusterMap1.CountBits(i) << "    " << fTPCClusterMap2.CountBits(i) << endl;
+   
+  return 1.;
+  
+}
+*/
+//___________________________________________________________________________________________
+
 void AliAnalysisTaskLambdaOverK0sJets::RecCascade(AliAODTrack *trk1,const AliAODTrack *trk2,const AliAODTrack *trkBch,TString histo)
 {
   // Local method to reconstruct cascades candidates from the combinations of three tracks
@@ -3368,24 +3486,31 @@ void AliAnalysisTaskLambdaOverK0sJets::TriggerParticle()
   Float_t centrality = cent->GetCentralityPercentile("V0M");
   const AliAODVertex *vtx = fAOD->GetPrimaryVertex();
   Float_t zv=vtx->GetZ();
+  Double_t pt  = -1000.;
+  Double_t eta = -1000.;
+  Double_t phi = -1000.;
+  Float_t resPt = -1000.; 
+  Float_t resEta = -1000.; 
+  Float_t resPhi = -1000.;
 
   for (Int_t i=0; i<nTrk; i++) {
     AliAODTrack *t = fAOD->GetTrack(i);
     if(!AcceptTrack(t)) continue;
-    Double_t pt=t->Pt();
-    Double_t eta=t->Eta();
-    Double_t phi=t->Phi();
-
+    pt=t->Pt();
+    eta=t->Eta();
+   
     if( (pt>fTrigPtMin)  && (pt<fTrigPtMax) &&  (TMath::Abs(eta)<fTrigEtaMax) ) {
+
+      phi=t->Phi();
       fTriggerParticles->Add( new AliMiniParticle(centrality, zv, i, pt, phi, eta, 0, 0, 1) );    
 
       if(fIsMC){    
        Int_t lab = TMath::Abs(t->GetLabel());
        AliAODMCParticle *part=(AliAODMCParticle*)stack->UncheckedAt(lab);
 
-       Float_t resPt  = (part->Pt()  - pt)/pt; 
-       Float_t resEta = part->Eta() - eta;     
-       Float_t resPhi = part->Phi() - phi;
+       resPt  = (part->Pt()  - pt)/pt; 
+       resEta = part->Eta() - eta;     
+       resPhi = part->Phi() - phi;
 
        fTriggerMCResPt->Fill(resPt,pt,centrality);
        fTriggerMCResEta->Fill(resEta,pt,centrality);
@@ -3461,15 +3586,27 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
   if (!cent->IsEventInCentralityClass(fCentMin,fCentMax,"V0M")) return;
   fEvents->Fill(3);
 
-  // Primary vertex
+  // Global primary vertex 
   const AliAODVertex *vtx = fAOD->GetPrimaryVertex();
   if (vtx->GetNContributors()<3) return;
   fEvents->Fill(4);
 
-  Float_t xv=vtx->GetX(), yv=vtx->GetY(), zv=vtx->GetZ();
+  // SPD primary vertex 
+  const AliAODVertex *vtxSPD = fAOD->GetPrimaryVertexSPD(); 
+  if (vtxSPD->GetNContributors()<3) return;
+  fEvents->Fill(5);
+  
+  // Correlaiton between global Zvtx and SPD Zvtx
+  Float_t zv=vtx->GetZ(), zvSPD=vtxSPD->GetZ();
+  fPrimayVtxGlobalvsSPD->Fill(zv,zvSPD);
+  
+  if( TMath::Abs( zv - zvSPD ) > 0.5) return;
+  fEvents->Fill(6);
+
+  Float_t xv=vtx->GetX(), yv=vtx->GetY();
 
   if (TMath::Abs(zv) > 10.) return;   
-  fEvents->Fill(5);
+  fEvents->Fill(7);
  
   fPrimaryVertexX->Fill(xv);
   fPrimaryVertexY->Fill(yv);
@@ -3837,7 +3974,13 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
   Float_t dx=-100., dy=-100., lt=-100., res=-100.;
   Float_t dlK=-100., dlL=-100.;
   Float_t dPhi=-100., dEta=-100., radio=-100.;
-  
+  Bool_t  trigTPCMapOk=kTRUE, posDaugTPCMapOk=kTRUE, negDaugTPCMapOk=kTRUE;  
+  Float_t  fracPosDaugTPCMap =0., fracNegDaugTPCMap =0., den=1.;
+  Double_t trigCov[21], posDaugCov[21], negDaugCov[21];
+  Double_t trigPos[6], posDaugPos[6], negDaugPos[6];
+  Double_t trigXYZ[3], posDaugXYZ[3], negDaugXYZ[3];
+  Double_t devPosDaugTrig[7], devNegDaugTrig[7], splitCont[4];
+
   // --------------------------------
   // h-V0 correlations
   for (Int_t i=0; i<(fTriggerParticles->GetEntriesFast()); i++){
@@ -3889,11 +4032,75 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
       Int_t lMCAssocNegDaug = trackAssocME->NegDaugMCLabel();
       Int_t lMCAssocPosDaug = trackAssocME->PosDaugMCLabel();
 
+      // ------------------------------------------
+      // Track splitting check
+      // ------------------------------------------
+
+      trigTPCMapOk=kTRUE; posDaugTPCMapOk=kTRUE; negDaugTPCMapOk=kTRUE;
+      if(TMath::Abs(dPhi)<0.06 && TMath::Abs(dEta)<0.06){
+
+       // TPC Shared Map
+       trigTPCMapOk    = GoodTPCSharedMap(tTrig);
+       posDaugTPCMapOk = GoodTPCSharedMap(ptrack);
+       negDaugTPCMapOk = GoodTPCSharedMap(ntrack);
+
+       // fraction of shared clusters
+       //if(!trigTPCMapOk && !posDaugTPCMapOk) fracPosDaugTPCMap = GetFractionTPCSharedCls(tTrig,ptrack);
+       //if(!trigTPCMapOk && !negDaugTPCMapOk) fracNegDaugTPCMap = GetFractionTPCSharedCls(tTrig,ntrack);
+
+       // get position
+       tTrig->GetXYZ(trigXYZ);
+       ptrack->GetXYZ(posDaugXYZ);
+       ntrack->GetXYZ(negDaugXYZ);
+
+       // Covaraince matrix for the tracks
+       tTrig->GetCovarianceXYZPxPyPz(trigCov);
+       ptrack->GetCovarianceXYZPxPyPz(posDaugCov);
+       ntrack->GetCovarianceXYZPxPyPz(negDaugCov);
+
+       // position and momentum
+       // trigger particle
+       trigPos[0] = trigXYZ[0];        trigPos[1] = trigXYZ[1];        trigPos[2] = trigXYZ[2];
+       trigPos[3] = tTrig->Px();       trigPos[4] = tTrig->Py();       trigPos[5] = tTrig->Pz();
+
+       // positive daughter
+       posDaugPos[0] = posDaugXYZ[0];  posDaugPos[1] = posDaugXYZ[1];  posDaugPos[2] = posDaugXYZ[2];
+       posDaugPos[3] = ptrack->Px();   posDaugPos[4] = ptrack->Py();   posDaugPos[5] = ptrack->Pz();
+
+       // negative daughter
+       negDaugPos[0] = negDaugXYZ[0];  negDaugPos[1] = negDaugXYZ[1];  negDaugPos[2] = negDaugXYZ[2];
+       negDaugPos[3] = ntrack->Px();   negDaugPos[4] = ntrack->Py();   negDaugPos[5] = ntrack->Pz();
+
+       
+       // deviation between the two tracks
+       for(Int_t ll=0;ll<6;ll++){
+         den = trigCov[ll*(ll+1)/2+ll]*trigCov[ll*(ll+1)/2+ll]  +  posDaugCov[ll*(ll+1)/2+ll]* posDaugCov[ll*(ll+1)/2+ll] ;
+         devPosDaugTrig[ll] = 0.;
+         
+         if(den>0)  devPosDaugTrig[ll] = TMath::Power( trigPos[ll] - posDaugPos[ll] ,2) / den;
+         
+         devPosDaugTrig[6] +=  devPosDaugTrig[ll];
+       }
+
+
+       for(Int_t ll=0;ll<6;ll++){
+         den = trigCov[ll*(ll+1)/2+ll]*trigCov[ll*(ll+1)/2+ll]  +  negDaugCov[ll*(ll+1)/2+ll]* negDaugCov[ll*(ll+1)/2+ll] ;
+         devNegDaugTrig[ll] = 0;
+
+         if(den>0)  devNegDaugTrig[ll] = TMath::Power( trigPos[ll] - negDaugPos[ll] ,2) / den;
+         
+         devNegDaugTrig[6] +=  devNegDaugTrig[ll];
+       }
+
+      }
+      
+      // ----------------------------------------------------------------------------
+        
       // *******************
       //   K0s selection
       // *******************
       if( trackAssocME->WhichCandidate() == 3 ){
-
+              
        massK0s = tAssoc->MassK0Short();
        mK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass();
        if( fCollision.Contains("PbPb2010") )
@@ -3903,14 +4110,45 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
        
        // ==== Correlations K0s invariant mass peak ==== //
        // +++++++++++ Pt bin & centrality
-       fK0sdPhidEtaPtL[curCentBin*kN1*kNVtxZ + binPtv0*kNVtxZ + curVtxBin]->Fill(dPhi,dEta,massK0s);
+       if(trigTPCMapOk && posDaugTPCMapOk && negDaugTPCMapOk) // splitting rejection according to the TPC shared map
+         fK0sdPhidEtaPtL[curCentBin*kN1*kNVtxZ + binPtv0*kNVtxZ + curVtxBin]->Fill(dPhi,dEta,massK0s);
 
        // ==== Correlations K0s invariant mass peak ==== //
        if (TMath::Abs(mK0s-massK0s) < 3*sK0s) {
 
-         if(radio<0.1)
+         // -------------- splitting checks ---------------
+         if(TMath::Abs(dPhi)<0.06 && TMath::Abs(dEta)<0.06){
+
+           //// -------- TPC Map ------- ////
+           if(!trigTPCMapOk && !posDaugTPCMapOk)
+             fSharedClsTrigDaug->Fill(pt,ptrack->P(),0.5);
+           if(!trigTPCMapOk && !negDaugTPCMapOk)
+             fSharedClsTrigDaug->Fill(pt,ntrack->P(),1.5);
+
+           //// -------- Covariance matrix ------- ////
+           // positive daughter
+           splitCont[0] = pt;  splitCont[1] = ptrack->P(); 
+           for(Int_t ll=0; ll<=6; ll++){
+             splitCont[2] = devPosDaugTrig[ll]; splitCont[3] = ll; 
+             fK0sPosDaugSplCheckCovMat->Fill(splitCont);
+           }
+
+           // negative daughter
+           splitCont[0] = pt;  splitCont[1] = ntrack->P(); 
+           for(Int_t ll=0; ll<=6; ll++){
+             splitCont[2] = devNegDaugTrig[ll]; splitCont[3] = ll; 
+             fK0sNegDaugSplCheckCovMat->Fill(splitCont);
+           }
+
+         }
+
+         // ----------------------------------------------
+
+         if(radio<0.1){
            fK0sSpatialRes->Fill(dPhi,res,lt);
+         }
          if(radio < 0.4){
+           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,0);
            fK0sDCADaugToPrimVtx->Fill(dcaPos,dcaNeg,ptTrig);       
            RecCascade(tTrig,ntrack,ptrack,"K0s");
            RecCascade(tTrig,ptrack,ntrack,"K0s");      
@@ -3934,7 +4172,7 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
          //fK0sdPhidEtaPtLBckg[curCentBin*kN1+binPtv0]->Fill(dPhi,dEta,zv);
            
          if(radio < 0.4){ // Under the correlation peak
-           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,0);
+           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,1);
            fK0sBckgDecLength->Fill(dlK,ptTrig);
            fK0sBckgDCADaugToPrimVtx->Fill(dcaPos,dcaNeg,ptTrig);
            fK0sBckgEtaPhi->Fill(lPhi,lEta);
@@ -3962,14 +4200,44 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
 
        // ==== Correlations Lambda invariant mass peak ==== //
         // +++++++++++ Pt bin & centrality
-        fLambdadPhidEtaPtL[curCentBin*kN1*kNVtxZ + binPtv0*kNVtxZ + curVtxBin]->Fill(dPhi,dEta,massL);
+       if(trigTPCMapOk && posDaugTPCMapOk && negDaugTPCMapOk) // splitting rejection according to the TPC shared map
+         fLambdadPhidEtaPtL[curCentBin*kN1*kNVtxZ + binPtv0*kNVtxZ + curVtxBin]->Fill(dPhi,dEta,massL);
 
        // ==== Correlations Lambda invariant mass peak ==== //
        if (TMath::Abs(mL-massL) < 3*sL) {
-               
+                         
+         // -------------- splitting checks ---------------
+         if(TMath::Abs(dPhi)<0.06 && TMath::Abs(dEta)<0.06){
+
+           //// -------- TPC Map ------- ////
+           if(!trigTPCMapOk && !posDaugTPCMapOk)
+             fSharedClsTrigDaug->Fill(pt,ptrack->P(),2.5);
+           if(!trigTPCMapOk && !negDaugTPCMapOk)
+             fSharedClsTrigDaug->Fill(pt,ntrack->P(),3.5);
+
+           //// -------- Covariance matrix ------- ////
+           // positive daughter
+           splitCont[0] = pt;  splitCont[1] = ptrack->P(); 
+           for(Int_t ll=0; ll<=6; ll++){
+             splitCont[2] = devPosDaugTrig[ll]; splitCont[3] = ll; 
+             fLambdaPosDaugSplCheckCovMat->Fill(splitCont);
+           }
+
+           // negative daughter
+           splitCont[0] = pt;  splitCont[1] = ntrack->P(); 
+           for(Int_t ll=0; ll<=6; ll++){
+             splitCont[2] = devNegDaugTrig[ll]; splitCont[3] = ll; 
+             fLambdaNegDaugSplCheckCovMat->Fill(splitCont);
+           }
+
+         }
+
+         // ----------------------------------------------
+
          if(radio<0.1)
            fLambdaSpatialRes->Fill(dPhi,res,lt);
          if(radio < 0.4){
+           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,2);
            fLambdaDCADaugToPrimVtx->Fill(dcaPos,dcaNeg,ptTrig);
            RecCascade(tTrig,ntrack,ptrack,"Lambda");
            RecCascade(tTrig,ptrack,ntrack,"Lambda");
@@ -3992,7 +4260,7 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
          //fLambdadPhidEtaPtLBckg[curCentBin*kN1+binPtv0]->Fill(dPhi,dEta,zv);
        
          if(radio < 0.4){ // Under the peak
-           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,1);
+           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,3);
            fLambdaBckgDecLength->Fill(dlL,ptTrig);
            fLambdaBckgDCADaugToPrimVtx->Fill(dcaPos,dcaNeg,ptTrig);
            fLambdaBckgEtaPhi->Fill(lPhi,lEta);
@@ -4020,14 +4288,44 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
 
        // ==== Correlations Lambda invariant mass peak ==== //
         // +++++++++++ Pt bin & centrality
-        fAntiLambdadPhidEtaPtL[curCentBin*kN1*kNVtxZ + binPtv0*kNVtxZ + curVtxBin]->Fill(dPhi,dEta,massAL);
+       if(trigTPCMapOk && posDaugTPCMapOk && negDaugTPCMapOk)  // splitting rejection according to the TPC shared map
+         fAntiLambdadPhidEtaPtL[curCentBin*kN1*kNVtxZ + binPtv0*kNVtxZ + curVtxBin]->Fill(dPhi,dEta,massAL);
 
        // ==== Correlations AntiLambda invariant mass peak ==== //
        if (TMath::Abs(mL-massAL) < 3*sL) {
 
+         // -------------- splitting checks ---------------
+         if(TMath::Abs(dPhi)<0.06 && TMath::Abs(dEta)<0.06){
+
+           //// -------- TPC Map ------- ////
+           if(!trigTPCMapOk && !posDaugTPCMapOk)
+             fSharedClsTrigDaug->Fill(pt,ptrack->P(),4.5);
+           if(!trigTPCMapOk && !negDaugTPCMapOk)
+             fSharedClsTrigDaug->Fill(pt,ntrack->P(),5.5);
+
+           //// -------- Covariance matrix ------- ////
+           // positive daughter
+           splitCont[0] = pt;  splitCont[1] = ptrack->P(); 
+           for(Int_t ll=0; ll<=6; ll++){
+             splitCont[2] = devPosDaugTrig[ll]; splitCont[3] = ll; 
+             fAntiLambdaPosDaugSplCheckCovMat->Fill(splitCont);
+           }
+
+           // negative daughter
+           splitCont[0] = pt;  splitCont[1] = ntrack->P(); 
+           for(Int_t ll=0; ll<=6; ll++){
+             splitCont[2] = devNegDaugTrig[ll]; splitCont[3] = ll; 
+             fAntiLambdaNegDaugSplCheckCovMat->Fill(splitCont);
+           }
+
+         }
+
+         // ----------------------------------------------
+
          if(radio<0.1)
            fAntiLambdaSpatialRes->Fill(dPhi,res,lt);         
          if(radio < 0.4){
+           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,4);
            fAntiLambdaDCADaugToPrimVtx->Fill(dcaPos,dcaNeg,ptTrig);
            RecCascade(tTrig,ntrack,ptrack,"AntiLambda");
            RecCascade(tTrig,ptrack,ntrack,"AntiLambda");
@@ -4050,7 +4348,7 @@ void AliAnalysisTaskLambdaOverK0sJets::UserExec(Option_t *)
          //fAntiLambdadPhidEtaPtLBckg[curCentBin*kN1+binPtv0]->Fill(dPhi,dEta,zv);
        
          if(radio < 0.4){ // Under the peak
-           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,2);
+           fHistArmPodBckg->Fill(lAlphaV0,lPtArmV0,5);
            fAntiLambdaBckgDecLength->Fill(dlL,ptTrig);
            fAntiLambdaBckgDCADaugToPrimVtx->Fill(dcaPos,dcaNeg,ptTrig);
            fAntiLambdaBckgEtaPhi->Fill(lPhi,lEta);
index c1e7f1b..ebef28c 100644 (file)
@@ -110,6 +110,9 @@ class AliAnalysisTaskLambdaOverK0sJets : public AliAnalysisTaskSE {
   virtual Bool_t   AcceptTrack(AliAODTrack *t); 
   virtual Bool_t   AcceptTrackV0(const AliAODTrack *t);
   virtual Bool_t   AcceptV0(AliAODVertex *vtx, const AliAODv0 *v0);
+  virtual Bool_t   GoodTPCSharedMap(const AliAODTrack *t);
+  virtual Bool_t   GoodTPCSharedMap(AliAODTrack *t);
+  //virtual Float_t  GetFractionTPCSharedCls(AliAODTrack *track1,const AliAODTrack *track2);
   virtual void     RecCascade(AliAODTrack *trk1,const AliAODTrack *trk2,const AliAODTrack *trkBch,TString histo);
   virtual void     V0Loop(V0LoopStep_t step, Bool_t isTriggered, Int_t iArray, Int_t idTrig);
   virtual void     TriggerParticle();
@@ -171,6 +174,7 @@ class AliAnalysisTaskLambdaOverK0sJets : public AliAnalysisTaskSE {
   TH1F*   fCentrality;                   //! Event centrality per centil
   TH1F*   fCentrality2;                  //! Event centrality per centil with |VtxZ|<10cm
   TH2F*   fCentralityTrig;               //! Event centrality per trigger
+  TH2F*   fPrimayVtxGlobalvsSPD;         //! Zvtx tracking vs Zvtx SPD
   TH1F*   fPrimaryVertexX;               //! Primary vertex position in X
   TH1F*   fPrimaryVertexY;               //! Primary vertex position in Y
   TH1F*   fPrimaryVertexZ;               //! Primary vertex position in Z
@@ -322,6 +326,9 @@ class AliAnalysisTaskLambdaOverK0sJets : public AliAnalysisTaskSE {
   TH3F*   fK0sMassPtPhi;                 //! K0s: mass vs pt vs phi
 
   TH2F*   fK0sDaughtersPt;               //! K0s: pt of daughters
+  TH3F*   fSharedClsTrigDaug;            //! Splitting studies according to the TPC Shared Bit Map for K0s Lambda and AntiLambda
+  THnSparse* fK0sPosDaugSplCheckCovMat;  //! Check Covariance Matrix elemenets between trigger trcak and daughter track
+  THnSparse* fK0sNegDaugSplCheckCovMat;  //! Check Covariance Matrix elemenets between trigger trcak and daughter track
   TH3F*   fK0sDCADaugToPrimVtx;          //! K0s: DCA to primary vertex of daughters vs leading particle's pt inside a radio wrt the near-side peak
   TH3F*   fK0sSpatialRes;                //! K0s: Spatial resolution  
    
@@ -348,6 +355,8 @@ class AliAnalysisTaskLambdaOverK0sJets : public AliAnalysisTaskSE {
   TH3F*   fLambdaMassPtPhi;              //! Lambda: mass vs pt vs phi 
 
   TH2F*   fLambdaDaughtersPt;            //! Lambda: pt of daughters
+  THnSparse* fLambdaPosDaugSplCheckCovMat;  //! Check Covariance Matrix elemenets between trigger trcak and daughter track
+  THnSparse* fLambdaNegDaugSplCheckCovMat;  //! Check Covariance Matrix elemenets between trigger trcak and daughter track
   TH3F*   fLambdaDCADaugToPrimVtx;       //! Lambda: DCA to primary vrtex of daughters vs leading particle's pt inside a radio wrt the near-side peak
   TH3F*   fLambdaSpatialRes;             //! Lambda: Spatial resolution  
 
@@ -375,6 +384,8 @@ class AliAnalysisTaskLambdaOverK0sJets : public AliAnalysisTaskSE {
   TH3F*   fAntiLambdaMassPtPhi;                //! Lambda: mass vs phi 
 
   TH2F*   fAntiLambdaDaughtersPt;              //! AntiLambda: pt of daughters
+  THnSparse* fAntiLambdaPosDaugSplCheckCovMat;  //! Check Covariance Matrix elemenets between trigger trcak and daughter track
+  THnSparse* fAntiLambdaNegDaugSplCheckCovMat;  //! Check Covariance Matrix elemenets between trigger trcak and daughter track
   TH3F*   fAntiLambdaDCADaugToPrimVtx;         //! AntiLambda: DCA to primary vrtex of daughters vs leading particle's pt inside a radio wrt the near-side peak
   TH3F*   fAntiLambdaSpatialRes;               //! AntiLambda: Spatial resolution