changes in AliLeadingV0Correlation (Jayarathna Sandun Y <sypahula@Central.UH.EDU...
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Nov 2012 09:56:25 +0000 (09:56 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Nov 2012 09:56:25 +0000 (09:56 +0000)
PWGCF/Correlations/DPhi/AliLeadingV0Correlation.cxx
PWGCF/Correlations/DPhi/AliLeadingV0Correlation.h
PWGCF/Correlations/macros/AddTaskLV0Correlation.C

index 94ef46b..4258c02 100644 (file)
@@ -1,6 +1,8 @@
-//
-//            Class for Leading Charged Track+V0 Correlations Analysis
-
+/* Leading Charged Track+V0 Correlation.(Works for Real,Monte Carlo Data)
+ *                            Sandun Jayarathna
+ *                          University of Houston
+ *                      sandun.pahula.hewage@cern.ch
+ *****************************************************************************************/
 #include <TROOT.h>
 #include <TList.h>
 #include <TChain.h>
 #include "AliAODTrack.h"
 #include "AliAODEvent.h"
 #include "AliAODv0.h"
-#include "AliAODcascade.h"
 #include "AliAODVertex.h"
 #include "AliAODPid.h"
 #include "AliPIDResponse.h"
 #include "AliEventPoolManager.h"
 #include "AliCentrality.h"
-#include "AliAnalyseLeadingTrackUE.h"
-#include "AliPhysicsSelectionTask.h"
 #include "AliAODHandler.h"
 #include "AliAODInputHandler.h"
 #include "AliAODMCParticle.h"
 #include "AliInputEventHandler.h"
-#include "AliLog.h"
-#include "AliMCEventHandler.h"
 #include "AliVParticle.h"
-#include "AliCFContainer.h"
 #include "AliMultiplicity.h"
-#include "AliStack.h"
 #include "AliAODMCHeader.h"
 #include "AliPID.h"
-#include "AliPIDResponse.h"
 #include "AliExternalTrackParam.h"
 
 #include "AliLeadingV0Correlation.h"
 
-#define CorrBinsX 26
-#define CorrBinsY 24
+#define CorrBinsX 24
+#define CorrBinsY 26
 
 ClassImp(AliLeadingV0Correlation)
 ClassImp(AliLeadingBasicParticle)
@@ -52,131 +46,87 @@ ClassImp(AliLeadingBasicParticle)
 //---------------------------------------------------------------------------------------
 AliLeadingV0Correlation::AliLeadingV0Correlation()
    : AliAnalysisTaskSE(),
-  fAODEvent(0x0),
-  fPoolMgr(0x0),         
-  fPoolK0(0x0),
-  fPoolLambda(0x0),
-  fPIDResponse(0x0),
-  fPoolMaxNEvents(0), 
-  fPoolMinNTracks(0), 
-  fMinEventsToMix(0),
-  fNzVtxBins(0), 
-  fNCentBins(0),
-  fcollidingSys("PbPb"),
-  fpvzcut(0),
-  fTrackEtaCut(0),
-  fFilterBit(128),
-  ftrigPtLow(0),
-  ftrigPtHigh(0),
-  fassocPtLow(0),
-  fassocPtHigh(0),
-  fAnalysisMC(0),
-  fUsePID(""),
-  fRapidityCut(0.),
-  fCutV0Radius(0.),
-  fCutDCANegToPV(0.),
-  fCutDCAPosToPV(0.),
-  fCutDCAV0Daughters(0.),
-  fCutV0CosPA(0.),
-  fSpecialArmenterosCutK0s(0.),
-  fPerformMultiplicityStudy(0), 
-  fLoMultBound(0),
-  fHiMultBound(0),
-  fOutputList(0),
-  fHistMCPrimaryVertexX(0),
-  fHistMCPrimaryVertexY(0),
-  fHistMCPrimaryVertexZ(0),
-  fHistMCtracksProdRadiusK0s(0),
-  fHistMCtracksProdRadiusLambda(0),
-  fHistMCtracksProdRadiusAntiLambda(0),
-  fHistMCtracksDecayRadiusK0s(0),
-  fHistMCtracksDecayRadiusLambda(0),
-  fHistMCtracksDecayRadiusAntiLambda(0),
-  fHistMCPtAllK0s(0),
-  fHistMCPtAllLambda(0),
-  fHistMCPtAllAntiLambda(0),
-  fHistMCProdRadiusK0s(0),
-  fHistMCProdRadiusLambda(0),
-  fHistMCProdRadiusAntiLambda(0),
-  fHistMCRapK0s(0),
-  fHistMCRapLambda(0),
-  fHistMCRapAntiLambda(0),
-  fHistMCPtK0s(0),
-  fHistMCPtLambda(0),
-  fHistMCPtAntiLambda(0),
-  fHistMCPtLambdaFromSigma(0),
-  fHistMCPtAntiLambdaFromSigma(0),
-  fHistNTimesRecK0s(0),
-  fHistNTimesRecLambda(0),
-  fHistNTimesRecAntiLambda(0),
-  fHistNTimesRecK0sVsPt(0),
-  fHistNTimesRecLambdaVsPt(0),
-  fHistNTimesRecAntiLambdaVsPt(0),
-  fHistMCDaughterTrack(0),
-  fHistPrimRawPtVsYK0s(0),
-  fHistPrimRawPtVsYLambda(0),
-  fHistPrimRawPtVsYAntiLambda(0),
-  fHistPrimaryVertexX(0),
-  fHistPrimaryVertexY(0),
-  fHistPrimaryVertexZ(0),
-  fHistDcaPosToPrimVertexK0(0),
-  fHistDcaNegToPrimVertexK0(0),
-  fHistRadiusV0K0(0),
-  fHistDecayLengthV0K0(0),
-  fHistDcaV0DaughtersK0(0),
-  fHistChi2K0(0),
-  fHistCosPointAngleK0(0),
-  fHistDcaPosToPrimVertexK0vsMassK0(0),
-  fHistDcaNegToPrimVertexK0vsMassK0(0),
-  fHistRadiusV0K0vsMassK0(0),
-  fHistDecayLengthV0K0vsMassK0(0),
-  fHistDcaV0DaughtersK0vsMassK0(0),
-  fHistCosPointAngleK0vsMassK0(0),
-  fHistDcaPosToPrimVertexL(0),
-  fHistDcaNegToPrimVertexL(0),
-  fHistRadiusV0L(0),
-  fHistDecayLengthV0L(0),
-  fHistDcaV0DaughtersL(0),
-  fHistChi2L(0),
-  fHistCosPointAngleL(0),
-  fHistcTauL(0),
-  fHistDcaPosToPrimVertexLvsMassL(0),
-  fHistDcaNegToPrimVertexLvsMassL(0),
-  fHistRadiusV0LvsMassL(0),
-  fHistDecayLengthV0LvsMassL(0),
-  fHistDcaV0DaughtersLvsMassL(0),
-  fHistCosPointAngleLvsMassL(0),
-  fHistCosPointAngleLVsMassVsPtsigL(0),
-  fHistCosPointAngleLVsMassVsPtbackL(0),
-  fHistDcaPosToPrimVertexAntiL(0),
-  fHistDcaNegToPrimVertexAntiL(0),
-  fHistRadiusV0AntiL(0),
-  fHistDecayLengthV0AntiL(0),
-  fHistDcaV0DaughtersAntiL(0),
-  fHistChi2AntiL(0),
-  fHistCosPointAngleAntiL(0),
-  fHistDcaPosToPrimVertexAntiLvsMass(0),
-  fHistDcaNegToPrimVertexAntiLvsMass(0),
-  fHistRadiusV0AntiLvsMass(0),
-  fHistDecayLengthV0AntiLvsMass(0),
-  fHistDcaV0DaughtersAntiLvsMass(0),
-  fHistCosPointAngleAntiLvsMass(0),
-  fHistMassK0(0),
-  fHistMassLambda(0),
-  fHistMassAntiLambda(0),
-  fHistMassVsRadiusK0(0),
-  fHistMassVsRadiusLambda(0),
-  fHistMassVsRadiusAntiLambda(0),
-  fHistPtVsMassK0(0),
-  fHistPtVsMassLambda(0),
-  fHistPtVsMassAntiLambda(0),
-  fHistArmenterosPodolanski(0),
-  fHistNsigmaPosProtonLambda(0),
-  fHistNsigmaNegPionLambda(0),
-  fHistNsigmaPosProtonAntiLambda(0),
-  fHistNsigmaNegPionAntiLambda(0),
-  fHistNsigmaPosPionK0(0),
-       fHistNsigmaNegPionK0(0),
+       fAODEvent(0x0),
+       fPoolMgr(0x0),
+       fPoolMgrMC(0x0),
+       fPoolK0(0x0),
+       fPoolLambda(0x0),
+       fPoolK0MC(0x0),
+       fPoolLambdaMC(0x0),
+       fPIDResponse(0x0),
+       fPoolMaxNEvents(0), 
+       fPoolMinNTracks(0), 
+       fMinEventsToMix(0),
+       fNzVtxBins(0), 
+       fNCentBins(0),
+       fcollidingSys(""),
+       fTriggerMask(""),
+       fpvzcut(0),
+       fTrackEtaCut(0),
+       fFilterBit(128),
+       ftrigPtLow(0),
+       ftrigPtHigh(0),
+       fassocPtLow(0),
+       fassocPtHigh(0),
+       fAnalysisMC(0),
+       fUsePID(""),
+       fRapidityCut(0),
+       fCutV0Radius(0.),
+       fCutDCANegToPV(0.),
+       fCutDCAPosToPV(0.),
+       fCutDCAV0Daughters(0.),
+       fCutV0CosPA(0.),
+       fSpecialArmenterosCutK0s(0.),
+       fCTauK0(0.),
+       fCTauLambda(0.),
+       fOutputList(0),
+       fHistMCPrimaryVertexX(0),
+       fHistMCPrimaryVertexY(0),
+       fHistMCPrimaryVertexZ(0),
+       fHistMCPtAllK0s(0),
+       fHistMCPtAllLambda(0),
+       fHistMCPtAllAntiLambda(0),
+       fHistMCRapK0s(0),
+       fHistMCRapLambda(0),
+       fHistMCRapAntiLambda(0),
+       fHistMCPtK0s(0),
+       fHistMCPtLambda(0),
+       fHistMCPtAntiLambda(0),
+       fHistMCPtLambdaFromSigma(0),
+       fHistMCPtAntiLambdaFromSigma(0),
+       fHistPrimRawPtVsYK0s(0),
+       fHistPrimRawPtVsYLambda(0),
+       fHistPrimRawPtVsYAntiLambda(0),
+       fHistPrimaryVertexX(0),
+       fHistPrimaryVertexY(0),
+       fHistPrimaryVertexZ(0),
+       fHistDcaPosToPrimVertexK0vsMassK0(0),
+       fHistDcaNegToPrimVertexK0vsMassK0(0),
+       fHistRadiusV0K0vsMassK0(0),
+       fHistDecayLengthV0K0vsMassK0(0),
+       fHistDcaV0DaughtersK0vsMassK0(0),
+       fHistCosPointAngleK0vsMassK0(0),
+       fHistDcaPosToPrimVertexLvsMassL(0),
+       fHistDcaNegToPrimVertexLvsMassL(0),
+       fHistRadiusV0LvsMassL(0),
+       fHistDecayLengthV0LvsMassL(0),
+       fHistDcaV0DaughtersLvsMassL(0),
+       fHistCosPointAngleLvsMassL(0),
+       fHistDcaPosToPrimVertexAntiLvsMass(0),
+       fHistDcaNegToPrimVertexAntiLvsMass(0),
+       fHistRadiusV0AntiLvsMass(0),
+       fHistDecayLengthV0AntiLvsMass(0),
+       fHistDcaV0DaughtersAntiLvsMass(0),
+       fHistCosPointAngleAntiLvsMass(0),
+       fHistMassK0(0),
+       fHistMassLambda(0),
+       fHistMassAntiLambda(0),
+       fHistPtVsMassK0(0),
+       fHistPtVsMassLambda(0),
+       fHistPtVsMassAntiLambda(0),
+       fHistArmenterosPodolanskiK0(0),
+       fHistArmenterosPodolanskiLambda(0),
+       fHistArmenterosPodolanskiAntiLambda(0),
        fHistAsMcPtK0(0),
        fHistAsMcPtLambda(0),
        fHistAsMcPtAntiLambda(0),
@@ -189,39 +139,6 @@ AliLeadingV0Correlation::AliLeadingV0Correlation()
        fHistPidMcMassK0(0),
        fHistPidMcMassLambda(0),
        fHistPidMcMassAntiLambda(0),
-       fHistAsMcMassK0(0),
-       fHistAsMcMassLambda(0),
-       fHistAsMcMassAntiLambda(0),
-       fHistAsMcPtVsMassK0(0),
-       fHistAsMcPtVsMassLambda(0),
-       fHistAsMcPtVsMassAntiLambda(0),
-       fHistAsMcMassVsRadiusK0(0),
-       fHistAsMcMassVsRadiusLambda(0),
-       fHistAsMcMassVsRadiusAntiLambda(0),
-       fHistAsMcResxK0(0),
-       fHistAsMcResyK0(0),
-       fHistAsMcReszK0(0),
-       fHistAsMcResrVsRadiusK0(0),
-       fHistAsMcReszVsRadiusK0(0),
-       fHistAsMcResxLambda(0),
-       fHistAsMcResyLambda(0),
-       fHistAsMcReszLambda(0),
-       fHistAsMcResrVsRadiusLambda(0),
-       fHistAsMcReszVsRadiusLambda(0),
-       fHistAsMcResxAntiLambda(0),
-       fHistAsMcResyAntiLambda(0),
-       fHistAsMcReszAntiLambda(0),
-       fHistAsMcResrVsRadiusAntiLambda(0),
-       fHistAsMcReszVsRadiusAntiLambda(0),
-       fHistAsMcResPtK0(0),
-       fHistAsMcResPtLambda(0),
-       fHistAsMcResPtAntiLambda(0),
-       fHistAsMcResPtVsRapK0(0),
-       fHistAsMcResPtVsRapLambda(0),
-       fHistAsMcResPtVsRapAntiLambda(0),
-       fHistAsMcResPtVsPtK0(0),
-       fHistAsMcResPtVsPtLambda(0),
-       fHistAsMcResPtVsPtAntiLambda(0),
        fHistAsMcPtLambdaFromSigma(0),
        fHistAsMcPtAntiLambdaFromSigma(0),
        fHistAsMcSecondaryPtVsRapK0s(0),
@@ -242,69 +159,58 @@ AliLeadingV0Correlation::AliLeadingV0Correlation()
        fHistSibK0MC(0),
        fHistMixK0MC(0),
        fHistSibLambdaMC(0),
-       fHistMixLambdaMC(0)
-
-
+       fHistMixLambdaMC(0),
+    fHistLeadInfo(0),
+    fHistLeadInfoMC(0),
+       fHistLeadInfoMix(0),
+       fHistLeadInfoMixMC(0)
 {
-       fRapidityCut=0.75;
-       fUsePID="withPID";
-       fCutV0Radius=0.5;
-       fCutDCANegToPV=0.06;
-       fCutDCAPosToPV=0.06;
-       fCutDCAV0Daughters=1.0;
-       fCutV0CosPA=0.995;
-       fSpecialArmenterosCutK0s=5;
+
 
 }
 //---------------------------------------------------------------------------------------
 AliLeadingV0Correlation::AliLeadingV0Correlation(const char *name)
    : AliAnalysisTaskSE(name),
        fAODEvent(0x0),
-       fPoolMgr(0x0),         
+       fPoolMgr(0x0),
+       fPoolMgrMC(0x0),
        fPoolK0(0x0),
        fPoolLambda(0x0),
+       fPoolK0MC(0x0),
+       fPoolLambdaMC(0x0),
     fPIDResponse(0x0),
        fPoolMaxNEvents(0), 
        fPoolMinNTracks(0), 
        fMinEventsToMix(0),
        fNzVtxBins(0), 
        fNCentBins(0),
-       fcollidingSys("PbPb"),
+       fcollidingSys(""),
+       fTriggerMask(""),
        fpvzcut(0),
     fTrackEtaCut(0),
     fFilterBit(128),
-  ftrigPtLow(0),
-  ftrigPtHigh(0),
-  fassocPtLow(0),
-  fassocPtHigh(0),
-  fAnalysisMC(0),
-  fUsePID(""),
-  fRapidityCut(0.),
-  fCutV0Radius(0.),
-  fCutDCANegToPV(0.),
-  fCutDCAPosToPV(0.),
-  fCutDCAV0Daughters(0.),
-  fCutV0CosPA(0.),
-  fSpecialArmenterosCutK0s(0.),
-  fPerformMultiplicityStudy(0), 
-  fLoMultBound(0),
-  fHiMultBound(0),
-  fOutputList(0),
+       ftrigPtLow(0),
+       ftrigPtHigh(0),
+       fassocPtLow(0),
+       fassocPtHigh(0),
+       fAnalysisMC(0),
+       fUsePID(""),
+    fRapidityCut(0),
+       fCutV0Radius(0.),
+       fCutDCANegToPV(0.),
+       fCutDCAPosToPV(0.),
+       fCutDCAV0Daughters(0.),
+       fCutV0CosPA(0.),
+       fSpecialArmenterosCutK0s(0.),
+    fCTauK0(0.),
+    fCTauLambda(0.),
+       fOutputList(0),
        fHistMCPrimaryVertexX(0),
        fHistMCPrimaryVertexY(0),
        fHistMCPrimaryVertexZ(0),
-       fHistMCtracksProdRadiusK0s(0),
-       fHistMCtracksProdRadiusLambda(0),
-       fHistMCtracksProdRadiusAntiLambda(0),
-       fHistMCtracksDecayRadiusK0s(0),
-       fHistMCtracksDecayRadiusLambda(0),
-       fHistMCtracksDecayRadiusAntiLambda(0),
        fHistMCPtAllK0s(0),
        fHistMCPtAllLambda(0),
        fHistMCPtAllAntiLambda(0),
-       fHistMCProdRadiusK0s(0),
-       fHistMCProdRadiusLambda(0),
-       fHistMCProdRadiusAntiLambda(0),
        fHistMCRapK0s(0),
        fHistMCRapLambda(0),
        fHistMCRapAntiLambda(0),
@@ -313,55 +219,24 @@ AliLeadingV0Correlation::AliLeadingV0Correlation(const char *name)
        fHistMCPtAntiLambda(0),
        fHistMCPtLambdaFromSigma(0),
        fHistMCPtAntiLambdaFromSigma(0),
-       fHistNTimesRecK0s(0),
-       fHistNTimesRecLambda(0),
-       fHistNTimesRecAntiLambda(0),
-       fHistNTimesRecK0sVsPt(0),
-       fHistNTimesRecLambdaVsPt(0),
-       fHistNTimesRecAntiLambdaVsPt(0),
-       fHistMCDaughterTrack(0),
        fHistPrimRawPtVsYK0s(0),
        fHistPrimRawPtVsYLambda(0),
        fHistPrimRawPtVsYAntiLambda(0),
        fHistPrimaryVertexX(0),
        fHistPrimaryVertexY(0),
        fHistPrimaryVertexZ(0),
-       fHistDcaPosToPrimVertexK0(0),
-       fHistDcaNegToPrimVertexK0(0),
-       fHistRadiusV0K0(0),
-       fHistDecayLengthV0K0(0),
-       fHistDcaV0DaughtersK0(0),
-       fHistChi2K0(0),
-       fHistCosPointAngleK0(0),
        fHistDcaPosToPrimVertexK0vsMassK0(0),
        fHistDcaNegToPrimVertexK0vsMassK0(0),
        fHistRadiusV0K0vsMassK0(0),
        fHistDecayLengthV0K0vsMassK0(0),
        fHistDcaV0DaughtersK0vsMassK0(0),
        fHistCosPointAngleK0vsMassK0(0),
-       fHistDcaPosToPrimVertexL(0),
-       fHistDcaNegToPrimVertexL(0),
-       fHistRadiusV0L(0),
-       fHistDecayLengthV0L(0),
-       fHistDcaV0DaughtersL(0),
-       fHistChi2L(0),
-       fHistCosPointAngleL(0),
-       fHistcTauL(0),
        fHistDcaPosToPrimVertexLvsMassL(0),
        fHistDcaNegToPrimVertexLvsMassL(0),
        fHistRadiusV0LvsMassL(0),
        fHistDecayLengthV0LvsMassL(0),
        fHistDcaV0DaughtersLvsMassL(0),
        fHistCosPointAngleLvsMassL(0),
-       fHistCosPointAngleLVsMassVsPtsigL(0),
-       fHistCosPointAngleLVsMassVsPtbackL(0),
-       fHistDcaPosToPrimVertexAntiL(0),
-       fHistDcaNegToPrimVertexAntiL(0),
-       fHistRadiusV0AntiL(0),
-       fHistDecayLengthV0AntiL(0),
-       fHistDcaV0DaughtersAntiL(0),
-       fHistChi2AntiL(0),
-       fHistCosPointAngleAntiL(0),
        fHistDcaPosToPrimVertexAntiLvsMass(0),
        fHistDcaNegToPrimVertexAntiLvsMass(0),
        fHistRadiusV0AntiLvsMass(0),
@@ -371,19 +246,12 @@ AliLeadingV0Correlation::AliLeadingV0Correlation(const char *name)
        fHistMassK0(0),
        fHistMassLambda(0),
        fHistMassAntiLambda(0),
-       fHistMassVsRadiusK0(0),
-       fHistMassVsRadiusLambda(0),
-       fHistMassVsRadiusAntiLambda(0),
        fHistPtVsMassK0(0),
        fHistPtVsMassLambda(0),
        fHistPtVsMassAntiLambda(0),
-       fHistArmenterosPodolanski(0),
-       fHistNsigmaPosProtonLambda(0),
-       fHistNsigmaNegPionLambda(0),
-       fHistNsigmaPosProtonAntiLambda(0),
-       fHistNsigmaNegPionAntiLambda(0),
-       fHistNsigmaPosPionK0(0),
-       fHistNsigmaNegPionK0(0),
+       fHistArmenterosPodolanskiK0(0),
+       fHistArmenterosPodolanskiLambda(0),
+       fHistArmenterosPodolanskiAntiLambda(0),
        fHistAsMcPtK0(0),
        fHistAsMcPtLambda(0),
        fHistAsMcPtAntiLambda(0),
@@ -396,39 +264,6 @@ AliLeadingV0Correlation::AliLeadingV0Correlation(const char *name)
        fHistPidMcMassK0(0),
        fHistPidMcMassLambda(0),
        fHistPidMcMassAntiLambda(0),
-       fHistAsMcMassK0(0),
-       fHistAsMcMassLambda(0),
-       fHistAsMcMassAntiLambda(0),
-       fHistAsMcPtVsMassK0(0),
-       fHistAsMcPtVsMassLambda(0),
-       fHistAsMcPtVsMassAntiLambda(0),
-       fHistAsMcMassVsRadiusK0(0),
-       fHistAsMcMassVsRadiusLambda(0),
-       fHistAsMcMassVsRadiusAntiLambda(0),
-       fHistAsMcResxK0(0),
-       fHistAsMcResyK0(0),
-       fHistAsMcReszK0(0),
-       fHistAsMcResrVsRadiusK0(0),
-       fHistAsMcReszVsRadiusK0(0),
-       fHistAsMcResxLambda(0),
-       fHistAsMcResyLambda(0),
-       fHistAsMcReszLambda(0),
-       fHistAsMcResrVsRadiusLambda(0),
-       fHistAsMcReszVsRadiusLambda(0),
-       fHistAsMcResxAntiLambda(0),
-       fHistAsMcResyAntiLambda(0),
-       fHistAsMcReszAntiLambda(0),
-       fHistAsMcResrVsRadiusAntiLambda(0),
-       fHistAsMcReszVsRadiusAntiLambda(0),
-       fHistAsMcResPtK0(0),
-       fHistAsMcResPtLambda(0),
-       fHistAsMcResPtAntiLambda(0),
-       fHistAsMcResPtVsRapK0(0),
-       fHistAsMcResPtVsRapLambda(0),
-       fHistAsMcResPtVsRapAntiLambda(0),
-       fHistAsMcResPtVsPtK0(0),
-       fHistAsMcResPtVsPtLambda(0),
-       fHistAsMcResPtVsPtAntiLambda(0),
        fHistAsMcPtLambdaFromSigma(0),
        fHistAsMcPtAntiLambdaFromSigma(0),
        fHistAsMcSecondaryPtVsRapK0s(0),
@@ -449,17 +284,12 @@ AliLeadingV0Correlation::AliLeadingV0Correlation(const char *name)
        fHistSibK0MC(0),
        fHistMixK0MC(0),
        fHistSibLambdaMC(0),
-       fHistMixLambdaMC(0)
+       fHistMixLambdaMC(0),
+       fHistLeadInfo(0),
+       fHistLeadInfoMC(0),
+       fHistLeadInfoMix(0),
+       fHistLeadInfoMixMC(0)
 {      
-       fRapidityCut=0.75;
-       fUsePID="withPID";
-       fCutV0Radius=0.5;
-       fCutDCANegToPV=0.06;
-       fCutDCAPosToPV=0.06;
-       fCutDCAV0Daughters=1.0;
-       fCutV0CosPA=0.995;
-       fSpecialArmenterosCutK0s=5;
-       
    DefineOutput(1, TList::Class());                                            
 }
 
@@ -475,178 +305,82 @@ AliLeadingV0Correlation::~AliLeadingV0Correlation()
 //---------------------------------------------------------------------------------------
 void AliLeadingV0Correlation::UserCreateOutputObjects()
 {      
-   fOutputList = new TList();
-   fOutputList->SetOwner();
+       fOutputList = new TList();
+       fOutputList->SetOwner();
        
        Int_t lCustomNBins = 200; 
        Double_t lCustomPtUpperLimit = 20; 
-       //Int_t lCustomNBinsMultiplicity = 100;
-       
        
        //---------------------------------------------- MC histograms -----------------------------------------------------//
-       
-       // Primary Vertex:
-       fHistMCPrimaryVertexX          = new TH1F("h1MCPrimaryVertexX", "MC Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5);
+       fHistMCPrimaryVertexX         = new TH1F("h1MCPrimaryVertexX", "MC Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5);
        fOutputList->Add(fHistMCPrimaryVertexX);
        
-       fHistMCPrimaryVertexY          = new TH1F("h1MCPrimaryVertexY", "MC Primary Vertex Position Y;Primary Vertex Position Y (cm);Events",100,-0.5,0.5);
+       fHistMCPrimaryVertexY         = new TH1F("h1MCPrimaryVertexY", "MC Primary Vertex Position Y;Primary Vertex Position Y (cm);Events",100,-0.5,0.5);
        fOutputList->Add(fHistMCPrimaryVertexY);
        
-       fHistMCPrimaryVertexZ          = new TH1F("h1MCPrimaryVertexZ", "MC Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-20,20);
+       fHistMCPrimaryVertexZ         = new TH1F("h1MCPrimaryVertexZ", "MC Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-20,20);
        fOutputList->Add(fHistMCPrimaryVertexZ);
-       
-       
-       // Production Radius of non-primary particles:
-       fHistMCtracksProdRadiusK0s           = new TH2F("h2MCtracksProdRadiusK0s","Non-primary MC K^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
-       fOutputList->Add(fHistMCtracksProdRadiusK0s);
-       
-       fHistMCtracksProdRadiusLambda        = new TH2F("h2MCtracksProdRadiusLambda","Non-primary MC #Lambda^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
-       fOutputList->Add(fHistMCtracksProdRadiusLambda);
-       
-       fHistMCtracksProdRadiusAntiLambda    = new TH2F("h2MCtracksProdRadiusAntiLambda","Non-primary MC #bar{#Lambda}^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
-       fOutputList->Add(fHistMCtracksProdRadiusAntiLambda);
-       
-       // Decay Radius of non-primary particles:
-       fHistMCtracksDecayRadiusK0s          = new TH1F("h1MCtracksDecayRadiusK0s","Non-primary MC K^{0} Decay Radius;r (cm)",101,-1,100);
-       fOutputList->Add(fHistMCtracksDecayRadiusK0s);
-       
-       fHistMCtracksDecayRadiusLambda       = new TH1F("h1MCtracksDecayRadiusLambda","Non-primary MC #Lambda^{0} Decay Radius;r (cm)",101,-1,100);
-       fOutputList->Add(fHistMCtracksDecayRadiusLambda);
-       
-       fHistMCtracksDecayRadiusAntiLambda   = new TH1F("h1MCtracksDecayRadiusAntiLambda","Non-primary #bar{#Lambda}^{0} Decay Radius;r (cm)",100,1,101);
-       fOutputList->Add(fHistMCtracksDecayRadiusAntiLambda);
-       
-       // Rapidity distribution:
+
        fHistMCRapK0s                 = new TH1F("h1MCRapK0s", "K^{0};y",160,-4,4);
        fOutputList->Add(fHistMCRapK0s);
        
        fHistMCRapLambda              = new TH1F("h1MCRapLambda", "#Lambda;y",160,-4,4);
        fOutputList->Add(fHistMCRapLambda);
        
-       
        fHistMCRapAntiLambda          = new TH1F("h1MCRapAntiLambda", "#bar{#Lambda};y",160,-4,4);
        fOutputList->Add(fHistMCRapAntiLambda);
-       
-       
-       // Production Radius
-       fHistMCProdRadiusK0s                 = new TH1F("h1MCProdRadiusK0s", "MC K^{0} Production Radius;r (cm);Count", 400, -2, 2);
-       fOutputList->Add(fHistMCProdRadiusK0s);
-       
-       fHistMCProdRadiusLambda              = new TH1F("h1MCProdRadiusLambda", "MC #Lambda^{0} Production Radius;r (cm);Count", 400, -2, 2);
-       fOutputList->Add(fHistMCProdRadiusLambda);
-       
-       fHistMCProdRadiusAntiLambda         = new TH1F("h1MCProdRadiusAntiLambda", "MC #bar{#Lambda}^{0} Production Radius;r (cm);Count", 400, -2, 2);
-       fOutputList->Add(fHistMCProdRadiusAntiLambda);
-       
-       
-       // Pt distribution:
-       fHistMCPtK0s               = new TH1F("h1MCPtK0s", "K^{0};p{t} (GeV/c)",240,0,12);
+
+       fHistMCPtK0s                  = new TH1F("h1MCPtK0s", "K^{0};p{t} (GeV/c)",240,0,12);
        fOutputList->Add(fHistMCPtK0s);
        
-       fHistMCPtLambda            = new TH1F("h1MCPtLambda", "#Lambda^{0};p{t} (GeV/c)",240,0,12);
+       fHistMCPtLambda               = new TH1F("h1MCPtLambda", "#Lambda^{0};p{t} (GeV/c)",240,0,12);
        fOutputList->Add(fHistMCPtLambda);
        
-       fHistMCPtAntiLambda            = new TH1F("h1MCPtAntiLambda", "#AntiLambda^{0};p{t} (GeV/c)",240,0,12);
+       fHistMCPtAntiLambda           = new TH1F("h1MCPtAntiLambda", "#AntiLambda^{0};p{t} (GeV/c)",240,0,12);
        fOutputList->Add(fHistMCPtAntiLambda);
-       
-       // Pt distribution of Lambda coming from Sigma decay
+
        fHistMCPtLambdaFromSigma      = new TH1F("h1MCPtLambdaFromSigma", "#Lambda^{0};p{t} (GeV/c)",240,0,12);
        fOutputList->Add(fHistMCPtLambdaFromSigma);
        
        fHistMCPtAntiLambdaFromSigma  = new TH1F("h1MCPtAntiLambdaFromSigma", "#Lambda^{0};p{t} (GeV/c)",240,0,12);
        fOutputList->Add(fHistMCPtAntiLambdaFromSigma);
        
-       // Multiple reconstruction studies
-       fHistNTimesRecK0s             = new TH1F("h1NTimesRecK0s","number of times a K0s is reconstructed in -1<y<1;number of times;counts",500,-0.5,4.5);
-       fOutputList->Add(fHistNTimesRecK0s);
-       
-       fHistNTimesRecLambda          = new TH1F("h1NTimesRecLambda","number of times a Lambda is reconstructed in -1<y<1;number of times;counts",500,-0.5,4.5);
-       fOutputList->Add(fHistNTimesRecLambda);
-       
-       fHistNTimesRecAntiLambda      = new TH1F("h1NTimesRecAntiLambda","number of times an AntiLambda is reconstructed in -1<y<1;number of times;counts",500,-0.5,4.5);
-       fOutputList->Add(fHistNTimesRecAntiLambda);
-       
-       fHistNTimesRecK0sVsPt         = new TH2F("h2NTimesRecK0sVsPt","NTimes versus Pt, K^{0} in -1<y<1;p{t} (GeV/c);number of times",75,0,15,5,-0.5,4.5);
-       fOutputList->Add(fHistNTimesRecK0sVsPt);
-       
-       fHistNTimesRecLambdaVsPt      = new TH2F("h2NTimesRecLambdaVsPt","NTimes versus Pt, #Lambda^{0} in -1<y<1;p{t} (GeV/c);number of times",75,0,15,5,-0.5,4.5);
-       fOutputList->Add(fHistNTimesRecLambdaVsPt);
-       
-       fHistNTimesRecAntiLambdaVsPt  = new TH2F("h2NTimesRecAntiLambdaVsPt","NTimes versus Pt, #bar{#Lambda}^{0} in -1<y<1;p{t} (GeV/c);number of times",75,0,15,5,-0.5,4.5);
-       fOutputList->Add(fHistNTimesRecAntiLambdaVsPt);
-       
-       // Pt Distribution of non-primary particles:
-       fHistMCPtAllK0s                      = new TH1F("h1MCPtAllK0s", "Non-primary MC K^{0};p{t} (GeV/c);Counts",240,0,12);
+       fHistMCPtAllK0s               = new TH1F("h1MCPtAllK0s", "Non-primary MC K^{0};p{t} (GeV/c);Counts",240,0,12);
        fOutputList->Add(fHistMCPtAllK0s);
        
-       fHistMCPtAllLambda                   = new TH1F("h1MCPtAllLambda", "Non-primary MC #Lambda^{0};p{t} (GeV/c);Counts",240,0,12);
+       fHistMCPtAllLambda            = new TH1F("h1MCPtAllLambda", "Non-primary MC #Lambda^{0};p{t} (GeV/c);Counts",240,0,12);
        fOutputList->Add(fHistMCPtAllLambda);
        
-       fHistMCPtAllAntiLambda               = new TH1F("h1MCPtAllAntiLambda", "Non-primary MC #bar{#Lambda}^{0};p{t} (GeV/c);Counts",240,0,12);
+       fHistMCPtAllAntiLambda        = new TH1F("h1MCPtAllAntiLambda", "Non-primary MC #bar{#Lambda}^{0};p{t} (GeV/c);Counts",240,0,12);
        fOutputList->Add(fHistMCPtAllAntiLambda);
-
-       fHistMCDaughterTrack         = new TH1F("h1MCDaughterTrack","Distribution of mc id for daughters;id tags;Counts",15,0,15);
-       fOutputList->Add(fHistMCDaughterTrack);
        
-       fHistPrimRawPtVsYK0s = new TH2F( "f3dHistPrimRawPtVsYVsMultK0Short", "Pt{K0S} Vs Y{K0S} Vs Multiplicity; Pt{K0S} (GeV/c); Y{K0S} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2);
+       fHistPrimRawPtVsYK0s          = new TH2F( "f3dHistPrimRawPtVsYVsMultK0Short", "Pt{K0S} Vs Y{K0S} Vs Multiplicity; Pt{K0S} (GeV/c); Y{K0S} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2);
        fOutputList->Add(fHistPrimRawPtVsYK0s);
 
        
-       fHistPrimRawPtVsYLambda = new TH2F( "f3dHistPrimRawPtVsYVsMultLambda", "Pt{lambda} Vs Y{#Lambda} Vs Multiplicity; Pt{lambda} (GeV/c); Y{#Lambda} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2);
+       fHistPrimRawPtVsYLambda       = new TH2F( "f3dHistPrimRawPtVsYVsMultLambda", "Pt{lambda} Vs Y{#Lambda} Vs Multiplicity; Pt{lambda} (GeV/c); Y{#Lambda} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2);
        fOutputList->Add(fHistPrimRawPtVsYLambda);
        
-
-       fHistPrimRawPtVsYAntiLambda = new TH2F( "f3dHistPrimRawPtVsYVsMultAntiLambda", "Pt{antilambda} Vs Y{#Lambda} Vs Multiplicity; Pt{antilambda} (GeV/c); Y{#Lambda} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2);
+       fHistPrimRawPtVsYAntiLambda   = new TH2F( "f3dHistPrimRawPtVsYVsMultAntiLambda", "Pt{antilambda} Vs Y{#Lambda} Vs Multiplicity; Pt{antilambda} (GeV/c); Y{#Lambda} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2);
        fOutputList->Add(fHistPrimRawPtVsYAntiLambda);
        
        //---------------------------------------------End Of MC Histos-----------------------------------------------------//
-       
-       // Primary Vertex:
-       
-       fHistPrimaryVertexX          = new TH1F("h1PrimaryVertexX", "Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5);
+
+       fHistPrimaryVertexX           = new TH1F("h1PrimaryVertexX", "Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5);
        fOutputList->Add(fHistPrimaryVertexX);
        
-       fHistPrimaryVertexY          = new TH1F("h1PrimaryVertexY", "Primary Vertex Position Y;Primary Vertex Position Y (cm);Events",100,-0.5,0.5);
+       fHistPrimaryVertexY           = new TH1F("h1PrimaryVertexY", "Primary Vertex Position Y;Primary Vertex Position Y (cm);Events",100,-0.5,0.5);
        fOutputList->Add(fHistPrimaryVertexY);
        
-       fHistPrimaryVertexZ          = new TH1F("h1PrimaryVertexZ", "Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-20,20);
+       fHistPrimaryVertexZ           = new TH1F("h1PrimaryVertexZ", "Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-20,20);
        fOutputList->Add(fHistPrimaryVertexZ);
-       
-       //////K0s///////////////// 2D histos: cut vs on fly status////
-       
-       fHistDcaPosToPrimVertexK0      = new TH2F("h2DcaPosToPrimVertexK0", "Positive V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaPosToPrimVertexK0);
-       
-       fHistDcaNegToPrimVertexK0      = new TH2F("h2DcaNegToPrimVertexK0", "Negative V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaNegToPrimVertexK0);
-       
-       
-       fHistRadiusV0K0                = new TH2F("h2RadiusV0K0", "Radius;Radius(cm);Status",500,0,500,2,-0.5,1.5);
-       fOutputList->Add(fHistRadiusV0K0);
-       
-       fHistDecayLengthV0K0           = new TH2F("h2DecayLengthV0K0", "V0s decay Length;decay length(cm);Status", 500, 0, 500,2,-0.5,1.5);
-       fOutputList->Add(fHistDecayLengthV0K0);
-       
-       fHistDcaV0DaughtersK0          = new TH2F("h2DcaV0DaughtersK0", "DCA between daughters;dca(cm);Status", 300, 0, 3.0,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaV0DaughtersK0);
-       
-       fHistChi2K0                    = new TH2F("h2Chi2K0", "V0s chi2;chi2;Status", 1000, 0, 0.1,2,-0.5,1.5);
-       fOutputList->Add(fHistChi2K0);
-       
-       fHistCosPointAngleK0           = new TH2F("h2CosPointAngleK0", "Cosine of V0's pointing angle", 200,0.99,1.01,2,-0.5,1.5);
-       fOutputList->Add(fHistCosPointAngleK0);
-       
-       
-       ////////////K0s///////////////// 2D histos: cut vs mass////
-       
-       
+
        fHistDcaPosToPrimVertexK0vsMassK0 = new TH2F("h2DcaPosToPrimVertexK0vsMassK0", "Positive V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
        fOutputList->Add(fHistDcaPosToPrimVertexK0vsMassK0);
        
        fHistDcaNegToPrimVertexK0vsMassK0 = new TH2F("h2DcaNegToPrimVertexK0vsMassK0", "Negative V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
        fOutputList->Add(fHistDcaNegToPrimVertexK0vsMassK0);
        
-       
        fHistRadiusV0K0vsMassK0           = new TH2F("h2RadiusV0K0vsMassK0", "Radius;Radius(cm);K0s inv. mass",110,0,110,200,0.4,0.6);
        fOutputList->Add(fHistRadiusV0K0vsMassK0);
        
@@ -656,319 +390,129 @@ void AliLeadingV0Correlation::UserCreateOutputObjects()
        fHistDcaV0DaughtersK0vsMassK0     = new TH2F("h2DcaV0DaughtersK0vsMassK0", "DCA between daughters;dca(cm);K0s inv. mass", 110, 0, 1.1,200,0.4,0.6);
        fOutputList->Add(fHistDcaV0DaughtersK0vsMassK0);
        
-       
        fHistCosPointAngleK0vsMassK0      = new TH2F("h2CosPointAngleK0vsMassK0", "Cosine of V0's pointing angle", 200,0.997,1.007,200,0.4,0.6);
        fOutputList->Add(fHistCosPointAngleK0vsMassK0);
-       //////////Lambda////////////// 2D histos: cut vs on fly status////
-       
-       fHistDcaPosToPrimVertexL      = new TH2F("h2DcaPosToPrimVertexL", "Positive V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaPosToPrimVertexL);
-       
-       fHistDcaNegToPrimVertexL      = new TH2F("h2DcaNegToPrimVertexL", "Negative V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaNegToPrimVertexL);
-       
-       fHistRadiusV0L                = new TH2F("h2RadiusV0L", "Radius;Radius(cm);Status",100,0,110,2,-0.5,1.5);
-       fOutputList->Add(fHistRadiusV0L);
-       
-       fHistDecayLengthV0L           = new TH2F("h2DecayLengthV0L", "V0s decay Length;decay length(cm);Status", 500, 0, 500,2,-0.5,1.5);
-       fOutputList->Add(fHistDecayLengthV0L);
-       
-       fHistDcaV0DaughtersL          = new TH2F("h2DcaV0DaughtersL", "DCA between daughters;dca(cm);Status", 300, 0, 3.0,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaV0DaughtersL);
-       
-       fHistChi2L                    = new TH2F("h2Chi2L", "V0s chi2;chi2;Status", 100, 0, 0.10,2,-0.5,1.5);
-       fOutputList->Add(fHistChi2L);
-       
-       fHistCosPointAngleL           = new TH2F("h2CosPointAngleL", "Cosine of V0's pointing angle", 200,0.99,1.01,2,-0.5,1.5);
-       fOutputList->Add(fHistCosPointAngleL);
        
-       fHistcTauL                    = new TH1F("h1cTauL","cTaou of Lambdas",100,0,100);
-       fOutputList->Add(fHistcTauL);
-       //////////Lambda////////////// 2D histos: cut vs mass////
-       fHistDcaPosToPrimVertexLvsMassL      = new TH2F("h2DcaPosToPrimVertexLvsMassL", "Positive V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
+       fHistDcaPosToPrimVertexLvsMassL   = new TH2F("h2DcaPosToPrimVertexLvsMassL", "Positive V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
        fOutputList->Add(fHistDcaPosToPrimVertexLvsMassL);
        
-       fHistDcaNegToPrimVertexLvsMassL      = new TH2F("h2DcaNegToPrimVertexLvsMassL", "Negative V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
+       fHistDcaNegToPrimVertexLvsMassL   = new TH2F("h2DcaNegToPrimVertexLvsMassL", "Negative V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
        fOutputList->Add(fHistDcaNegToPrimVertexLvsMassL);
        
-       
-       fHistRadiusV0LvsMassL                = new TH2F("h2RadiusV0LvsMassL", "Radius;Radius(cm);Status",110,0,110,140, 1.06, 1.2);
+       fHistRadiusV0LvsMassL             = new TH2F("h2RadiusV0LvsMassL", "Radius;Radius(cm);Status",110,0,110,140, 1.06, 1.2);
        fOutputList->Add(fHistRadiusV0LvsMassL);
        
-       fHistDecayLengthV0LvsMassL           = new TH2F("h2DecayLengthV0LvsMassL", "V0s decay Length;decay length(cm);Status", 120, 0, 120,140, 1.06, 1.2);
+       fHistDecayLengthV0LvsMassL        = new TH2F("h2DecayLengthV0LvsMassL", "V0s decay Length;decay length(cm);Status", 120, 0, 120,140, 1.06, 1.2);
        fOutputList->Add(fHistDecayLengthV0LvsMassL);
        
-       fHistDcaV0DaughtersLvsMassL          = new TH2F("h2DcaV0DaughtersLvsMassL", "DCA between daughters;dca(cm);Status", 110, 0, 1.1,140, 1.06, 1.2);
+       fHistDcaV0DaughtersLvsMassL        = new TH2F("h2DcaV0DaughtersLvsMassL", "DCA between daughters;dca(cm);Status", 110, 0, 1.1,140, 1.06, 1.2);
        fOutputList->Add(fHistDcaV0DaughtersLvsMassL);
        
-       fHistCosPointAngleLvsMassL           = new TH2F("h2CosPointAngleLvsMassL", "Cosine of V0's pointing angle", 200,0.997,1.007,140, 1.06, 1.2);
+       fHistCosPointAngleLvsMassL         = new TH2F("h2CosPointAngleLvsMassL", "Cosine of V0's pointing angle", 200,0.997,1.007,140, 1.06, 1.2);
        fOutputList->Add(fHistCosPointAngleLvsMassL);
-       
-       fHistCosPointAngleLVsMassVsPtsigL           = new TH3F("h3McCosPointAngleLVsMassVsPtsigL", "Cosine of V0's pointing angle",3,0,12, 2,00.997,1.007,140, 1.06, 1.2);
-       fOutputList->Add(fHistCosPointAngleLVsMassVsPtsigL);
-       
-       fHistCosPointAngleLVsMassVsPtbackL           = new TH3F("h3McCosPointAngleLVsMassVsPtbackL", "Cosine of V0's pointing angle",3,0,12, 20,0.997,1.007,140, 1.06, 1.2);
-       fOutputList->Add(fHistCosPointAngleLVsMassVsPtbackL);
-       
-       
-       //////////AntiLambda////////////// 2D histos: cut vs on fly status////
-       
-       fHistDcaPosToPrimVertexAntiL      = new TH2F("h2DcaPosToPrimVertexAntiL", "Positive V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaPosToPrimVertexAntiL);
-       
-       fHistDcaNegToPrimVertexAntiL      = new TH2F("h2DcaNegToPrimVertexAntiL", "Negative V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaNegToPrimVertexAntiL);
-       
-       
-       fHistRadiusV0AntiL                = new TH2F("h2RadiusV0AntiL", "Radius;Radius(cm);Status",100,0,110,2,-0.5,1.5);
-       fOutputList->Add(fHistRadiusV0AntiL);
-       
-       fHistDecayLengthV0AntiL           = new TH2F("h2DecayLengthV0AntiL", "V0s decay Length;decay length(cm);Status", 500, 0, 500,2,-0.5,1.5);
-       fOutputList->Add(fHistDecayLengthV0AntiL);
-       
-       fHistDcaV0DaughtersAntiL          = new TH2F("h2DcaV0DaughtersAntiL", "DCA between daughters;dca(cm);Status", 300, 0, 3.0,2,-0.5,1.5);
-       fOutputList->Add(fHistDcaV0DaughtersAntiL);
-       
-       fHistChi2AntiL                    = new TH2F("h2Chi2AntiL", "V0s chi2;chi2;Status", 100, 0, 0.10,2,-0.5,1.5);
-       fOutputList->Add(fHistChi2AntiL);
-       
-       fHistCosPointAngleAntiL           = new TH2F("h2CosPointAngleAntiL", "Cosine of V0's pointing angle", 200,0.99,1.01,2,-0.5,1.5);
-       fOutputList->Add(fHistCosPointAngleAntiL);
-       
-       //////////AntiLambda////////////// 2D histos: cut vs mass////
-       
-       fHistDcaPosToPrimVertexAntiLvsMass      = new TH2F("h2DcaPosToPrimVertexAntiLvsMass", "Positive V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
+
+       fHistDcaPosToPrimVertexAntiLvsMass   = new TH2F("h2DcaPosToPrimVertexAntiLvsMass", "Positive V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
        fOutputList->Add(fHistDcaPosToPrimVertexAntiLvsMass);
        
-       fHistDcaNegToPrimVertexAntiLvsMass      = new TH2F("h2DcaNegToPrimVertexAntiLvsMass", "Negative V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
+       fHistDcaNegToPrimVertexAntiLvsMass   = new TH2F("h2DcaNegToPrimVertexAntiLvsMass", "Negative V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
        fOutputList->Add(fHistDcaNegToPrimVertexAntiLvsMass);
-       
-       
-       fHistRadiusV0AntiLvsMass                = new TH2F("h2RadiusV0AntiLvsMass", "Radius;Radius(cm);Status",110,0,110,140, 1.06, 1.2);
+
+       fHistRadiusV0AntiLvsMass             = new TH2F("h2RadiusV0AntiLvsMass", "Radius;Radius(cm);Status",110,0,110,140, 1.06, 1.2);
        fOutputList->Add(fHistRadiusV0AntiLvsMass);
        
-       fHistDecayLengthV0AntiLvsMass           = new TH2F("h2DecayLengthV0AntiLvsMass", "V0s decay Length;decay length(cm);Status", 120, 0, 120,140, 1.06, 1.2);
+       fHistDecayLengthV0AntiLvsMass        = new TH2F("h2DecayLengthV0AntiLvsMass", "V0s decay Length;decay length(cm);Status", 120, 0, 120,140, 1.06, 1.2);
        fOutputList->Add(fHistDecayLengthV0AntiLvsMass);
        
-       fHistDcaV0DaughtersAntiLvsMass          = new TH2F("h2DcaV0DaughtersAntiLvsMass", "DCA between daughters;dca(cm);Status", 110, 0, 1.1,140, 1.06, 1.2);
+       fHistDcaV0DaughtersAntiLvsMass       = new TH2F("h2DcaV0DaughtersAntiLvsMass", "DCA between daughters;dca(cm);Status", 110, 0, 1.1,140, 1.06, 1.2);
        fOutputList->Add(fHistDcaV0DaughtersAntiLvsMass);
        
-       fHistCosPointAngleAntiLvsMass           = new TH2F("h2CosPointAngleAntiLvsMass", "Cosine of V0's pointing angle", 200,0.997,1.007,140, 1.06, 1.2);
+       fHistCosPointAngleAntiLvsMass        = new TH2F("h2CosPointAngleAntiLvsMass", "Cosine of V0's pointing angle", 200,0.997,1.007,140, 1.06, 1.2);
        fOutputList->Add(fHistCosPointAngleAntiLvsMass);
        
-       // Mass:
-       fHistMassK0                   = new TH1F("h1MassK0", "K^{0} candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 200, 0.4, 0.6);
+       fHistMassK0                          = new TH1F("h1MassK0", "K^{0} candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 200, 0.4, 0.6);
        fOutputList->Add(fHistMassK0);
        
-       fHistMassLambda               = new TH1F("h1MassLambda", "#Lambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});Counts", 150, 1.05, 1.2);
+       fHistMassLambda                      = new TH1F("h1MassLambda", "#Lambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});Counts", 150, 1.05, 1.2);
        fOutputList->Add(fHistMassLambda);
        
-       fHistMassAntiLambda           = new TH1F("h1MassAntiLambda", "#bar{#Lambda}^{0} candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 150, 1.05, 1.2);
+       fHistMassAntiLambda                  = new TH1F("h1MassAntiLambda", "#bar{#Lambda}^{0} candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 150, 1.05, 1.2);
        fOutputList->Add(fHistMassAntiLambda);
        
-       fHistMassVsRadiusK0           = new TH2F("h2MassVsRadiusK0", "K^{0} candidates;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",200,0,200, 200, 0.4, 0.6);
-       fOutputList->Add(fHistMassVsRadiusK0);
-       
-       fHistMassVsRadiusLambda       = new TH2F("h2MassVsRadiusLambda", "#Lambda candidates;radius (cm);M(p#pi^{-}) (GeV/c^{2})",200,0,200, 140, 1.06, 1.2);
-       fOutputList->Add(fHistMassVsRadiusLambda);
-       
-       fHistMassVsRadiusAntiLambda   = new TH2F("h2MassVsRadiusAntiLambda", "#bar{#Lambda} candidates;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",200,0,200, 140, 1.06, 1.2);
-       fOutputList->Add(fHistMassVsRadiusAntiLambda);
-       
-       // Pt Vs Mass
-       fHistPtVsMassK0               = new TH2F("h2PtVsMassK0","K^{0} candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",400, 0.4, 0.6,240,0,12);
+       fHistPtVsMassK0                      = new TH2F("h2PtVsMassK0","K^{0} candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",400, 0.4, 0.6,240,0,12);
        fOutputList->Add(fHistPtVsMassK0);
        
-       fHistPtVsMassLambda           = new TH2F("h2PtVsMassLambda","#Lambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",280, 1.06, 1.2,240,0,12);
+       fHistPtVsMassLambda                  = new TH2F("h2PtVsMassLambda","#Lambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",280, 1.06, 1.2,240,0,12);
        fOutputList->Add(fHistPtVsMassLambda);
        
-       fHistPtVsMassAntiLambda           = new TH2F("h2PtVsMassAntiLambda","#AntiLambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",280, 1.06, 1.2,240,0,12);
+       fHistPtVsMassAntiLambda              = new TH2F("h2PtVsMassAntiLambda","#AntiLambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",280, 1.06, 1.2,240,0,12);
        fOutputList->Add(fHistPtVsMassAntiLambda);
        
-       ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-       
-       ///Armenteros Podolansky
-       fHistArmenterosPodolanski     = new TH2F("h2ArmenterosPodolanski","Armenteros-Podolanski phase space;#alpha;p{t} arm",100,-1.0,1.0,50,0,0.5);
-       fOutputList->Add(fHistArmenterosPodolanski);
+       fHistArmenterosPodolanskiK0          = new TH2F("h2ArmenterosPodolanskiK0","Armenteros-Podolanski phase space;#alpha;p{t} arm",100,-1.0,1.0,50,0,0.5);
+       fOutputList->Add(fHistArmenterosPodolanskiK0);
        
-       //PID
-       
-       fHistNsigmaPosProtonLambda     = new TH1F("h1NsigmaPosProtonLambda", "Positive daughter of Lambda;NsigmaProton;Counts",25,0,5); 
-       fOutputList->Add(fHistNsigmaPosProtonLambda);
-       
-       fHistNsigmaNegPionLambda       = new TH1F("h1NsigmaNegPionLambda", "Negative daughter of Lambda;NsigmaPion;Counts",25,0,5);
-       fOutputList->Add(fHistNsigmaNegPionLambda);
-       
-       fHistNsigmaPosProtonAntiLambda     = new TH1F("h1NsigmaPosProtonAntiLambda", "Positive daughter of AntiLambda;NsigmaProton;Counts",25,0,5); 
-       fOutputList->Add(fHistNsigmaPosProtonAntiLambda);
-       
-       fHistNsigmaNegPionAntiLambda       = new TH1F("h1NsigmaNegPionAntiLambda", "Negative daughter of AntiLambda;NsigmaPion;Counts",25,0,5);
-       fOutputList->Add(fHistNsigmaNegPionAntiLambda);
-       
-       fHistNsigmaPosPionK0           = new TH1F("h1NsigmaPosPionK0", "Positive daughter of K0s;NsigmaPion;Counts",25,0,5);
-       fOutputList->Add(fHistNsigmaPosPionK0);
-       
-       fHistNsigmaNegPionK0           = new TH1F("h1NsigmaNegPionK0", "Negative daughter of K0s;NsigmaPion;Counts",25,0,5);
-       fOutputList->Add(fHistNsigmaNegPionK0);
+       fHistArmenterosPodolanskiLambda      = new TH2F("h2ArmenterosPodolanskiLambda","Armenteros-Podolanski phase space;#alpha;p{t} arm",100,-1.0,1.0,50,0,0.5);
+       fOutputList->Add(fHistArmenterosPodolanskiLambda);
        
+       fHistArmenterosPodolanskiAntiLambda  = new TH2F("h2ArmenterosPodolanskiAntiLambda","Armenteros-Podolanski phase space;#alpha;p{t} arm",100,-1.0,1.0,50,0,0.5);
+       fOutputList->Add(fHistArmenterosPodolanskiAntiLambda);
        
 //--------------------------------------------MC Associated histograms -----------------------------------------------------//
        
-       //Pt distribution
-       fHistAsMcPtK0                = new TH1F("h1AsMcPtK0", "K^{0} associated;p{t} (GeV/c);Counts", 240,0,12);
+       fHistAsMcPtK0                        = new TH1F("h1AsMcPtK0", "K^{0} associated;p{t} (GeV/c);Counts", 240,0,12);
        fOutputList->Add(fHistAsMcPtK0);
        
-       fHistAsMcPtLambda            = new TH1F("h1AsMcPtLambda", "#Lambda^{0} associated;p{t} (GeV/c);Counts", 240,0,12);
+       fHistAsMcPtLambda                    = new TH1F("h1AsMcPtLambda", "#Lambda^{0} associated;p{t} (GeV/c);Counts", 240,0,12);
        fOutputList->Add(fHistAsMcPtLambda);
        
-       fHistAsMcPtAntiLambda            = new TH1F("h1AsMcPtAntiLambda", "#AntiLambda^{0} associated;p{t} (GeV/c);Counts", 240,0,12);
+       fHistAsMcPtAntiLambda                = new TH1F("h1AsMcPtAntiLambda", "#AntiLambda^{0} associated;p{t} (GeV/c);Counts", 240,0,12);
        fOutputList->Add(fHistAsMcPtAntiLambda);
        
-       // Radius distribution
-       fHistAsMcProdRadiusK0               = new TH1F("h1AsMcProdRadiusK0", "K^{0} associated;r (cm);Counts", 500, 0, 100);
+       fHistAsMcProdRadiusK0                = new TH1F("h1AsMcProdRadiusK0", "K^{0} associated;r (cm);Counts", 500, 0, 100);
        fOutputList->Add(fHistAsMcProdRadiusK0);
        
-       fHistAsMcProdRadiusLambda           = new TH1F("h1AsMcProdRadiusLambda", "#Lambda^{0} associated;r (cm);Counts", 500, 0, 100);
+       fHistAsMcProdRadiusLambda            = new TH1F("h1AsMcProdRadiusLambda", "#Lambda^{0} associated;r (cm);Counts", 500, 0, 100);
        fOutputList->Add(fHistAsMcProdRadiusLambda);
        
-       fHistAsMcProdRadiusAntiLambda       = new TH1F("h1AsMcProdRadiusAntiLambda", "#bar{#Lambda}^{0} associated;r (cm);Counts", 500, 0, 100);
+       fHistAsMcProdRadiusAntiLambda        = new TH1F("h1AsMcProdRadiusAntiLambda", "#bar{#Lambda}^{0} associated;r (cm);Counts", 500, 0, 100);
        fOutputList->Add(fHistAsMcProdRadiusAntiLambda);
        
-       fHistAsMcProdRadiusXvsYK0s          = new TH2F("h2AsMcProdRadiusXvsYK0s","Associated Secondary K^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
+       fHistAsMcProdRadiusXvsYK0s           = new TH2F("h2AsMcProdRadiusXvsYK0s","Associated Secondary K^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
        fOutputList->Add(fHistAsMcProdRadiusXvsYK0s);
        
-       fHistAsMcProdRadiusXvsYLambda       = new TH2F("h2AsMcProdRadiusXvsYLambda","Associated Secondary #Lambda^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
+       fHistAsMcProdRadiusXvsYLambda        = new TH2F("h2AsMcProdRadiusXvsYLambda","Associated Secondary #Lambda^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
        fOutputList->Add(fHistAsMcProdRadiusXvsYLambda);
        
-       fHistAsMcProdRadiusXvsYAntiLambda   = new TH2F("h2AsMcProdRadiusXvsYAntiLambda","Associated Secondary #bar{#Lambda}^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
+       fHistAsMcProdRadiusXvsYAntiLambda    = new TH2F("h2AsMcProdRadiusXvsYAntiLambda","Associated Secondary #bar{#Lambda}^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
        fOutputList->Add(fHistAsMcProdRadiusXvsYAntiLambda);
        
-       // Mass
-       fHistPidMcMassK0             = new TH1F("h1PidMcMassK0", "K^{0} MC PId checked;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6);
+       fHistPidMcMassK0                     = new TH1F("h1PidMcMassK0", "K^{0} MC PId checked;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6);
        fOutputList->Add(fHistPidMcMassK0);
        
-       fHistPidMcMassLambda         = new TH1F("h1PidMcMassLambda", "#Lambda^{0} MC PId checked;M(p#pi^{-}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
+       fHistPidMcMassLambda                 = new TH1F("h1PidMcMassLambda", "#Lambda^{0} MC PId checked;M(p#pi^{-}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
        fOutputList->Add(fHistPidMcMassLambda);
        
-       fHistPidMcMassAntiLambda     = new TH1F("h1PidMcMassAntiLambda", "#bar{#Lambda}^{0} MC PId checked;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
+       fHistPidMcMassAntiLambda             = new TH1F("h1PidMcMassAntiLambda", "#bar{#Lambda}^{0} MC PId checked;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
        fOutputList->Add(fHistPidMcMassAntiLambda);
        
-       fHistAsMcMassK0              = new TH1F("h1AsMcMassK0", "K^{0} associated;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6);
-       fOutputList->Add(fHistAsMcMassK0);
-       
-       fHistAsMcMassLambda          = new TH1F("h1AsMcMassLambda", "#Lambda^{0} associated;M(p#pi^{-}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
-       fOutputList->Add(fHistAsMcMassLambda);
-       
-       fHistAsMcMassAntiLambda      = new TH1F("h1AsMcMassAntiLambda", "#bar{#Lambda}^{0} associated;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
-       fOutputList->Add(fHistAsMcMassAntiLambda);
-       
-       //Pt versus Mass
-       fHistAsMcPtVsMassK0               = new TH2F("h2AsMcPtVsMassK0","K^{0} associated;M(#pi^{+}#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",200, 0.4, 0.6,240,0,12);
-       fOutputList->Add(fHistAsMcPtVsMassK0);
-       
-       fHistAsMcPtVsMassLambda           = new TH2F("h2AsMcPtVsMassLambda","#Lambda^{0} associated;M(p#pi^{-}) (GeV/c^{2});p{t} (GeV/c)",140, 1.06, 1.2,240,0,12);
-       fOutputList->Add(fHistAsMcPtVsMassLambda);
-       
-       fHistAsMcPtVsMassAntiLambda       = new TH2F("h2AsMcPtVsMassAntiLambda","#bar{#Lambda}^{0} associated;M(#bar{p}#pi^{+}) (GeV/c^{2});p{t} (GeV/c)",140, 1.06, 1.2,240,0,12);
-       fOutputList->Add(fHistAsMcPtVsMassAntiLambda);
-       
-       
-       // invariant mass vs radius
-       fHistAsMcMassVsRadiusK0             = new TH2F("h2AsMcMassVsRadiusK0", "K^{0} associated;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",200,0,200, 500, 0.47, 0.52);
-       fOutputList->Add(fHistAsMcMassVsRadiusK0);
-       
-       fHistAsMcMassVsRadiusLambda         = new TH2F("h2AsMcMassVsRadiusLambda", "#Lambda associated;radius (cm);M(p#pi^{-}) (GeV/c^{2})",200,0,200, 1.10, 1.13);
-       fOutputList->Add(fHistAsMcMassVsRadiusLambda);
-       
-       fHistAsMcMassVsRadiusAntiLambda     = new TH2F("h2AsMcMassVsRadiusAntiLambda", "#bar{#Lambda} associated;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",200,0,200 , 1.10, 1.13);
-       fOutputList->Add(fHistAsMcMassVsRadiusAntiLambda);
-       
-       // Position Resolution
-       fHistAsMcResxK0                     = new TH1F("h1AsMcResxK0", "K^{0} associated;#Delta x (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResxK0);
-       fHistAsMcResyK0                     = new TH1F("h1AsMcResyK0", "K^{0} associated;#Delta y (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResyK0);
-       fHistAsMcReszK0                     = new TH1F("h1AsMcReszK0", "K^{0} associated;#Delta z (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcReszK0);
-       fHistAsMcResrVsRadiusK0             = new TH2F("h2AsMcResrVsRadiusK0", "K^{0} associated;Radius (cm);#Delta r (cm)",200,0.0,50., 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResrVsRadiusK0);
-       fHistAsMcReszVsRadiusK0             = new TH2F("h2AsMcReszVsRadiusK0", "K^{0} associated;Radius (cm);#Delta z (cm)",200,0.0,50.0, 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcReszVsRadiusK0);
-       
-       fHistAsMcResxLambda                 = new TH1F("h1AsMcResxLambda", "#Lambda^{0} associated;#Delta x (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResxLambda);
-       fHistAsMcResyLambda                 = new TH1F("h1AsMcResyLambda", "#Lambda^{0} associated;#Delta y (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResyLambda);
-       fHistAsMcReszLambda                 = new TH1F("h1AsMcReszLambda", "#Lambda^{0} associated;#Delta z (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcReszLambda);
-       fHistAsMcResrVsRadiusLambda         = new TH2F("h2AsMcResrVsRadiusLambda", "#Lambda^{0} associated;Radius (cm);#Delta r (cm)",200,0.0,50.0, 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResrVsRadiusLambda);
-       fHistAsMcReszVsRadiusLambda         = new TH2F("h2AsMcReszVsRadiusLambda", "#Lambda^{0} associated;Radius (cm);#Delta z (cm)",200,0.0,50.0, 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcReszVsRadiusLambda);
-       
-       fHistAsMcResxAntiLambda             = new TH1F("h1AsMcResxAntiLambda", "#bar{#Lambda}^{0} associated;#Delta x (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResxAntiLambda);
-       fHistAsMcResyAntiLambda             = new TH1F("h1AsMcResyAntiLambda", "#bar{#Lambda}^{0} associated;#Delta y (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResyAntiLambda);
-       fHistAsMcReszAntiLambda             = new TH1F("h1AsMcReszAntiLambda", "#bar{#Lambda}^{0} associated;#Delta z (cm);Counts", 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcReszAntiLambda);
-       fHistAsMcResrVsRadiusAntiLambda     = new TH2F("h2AsMcResrVsRadiusAntiLambda", "#bar{#Lambda}^{0} associated;Radius (cm);#Delta r (cm)",200,0.0,50.0, 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcResrVsRadiusAntiLambda);
-       fHistAsMcReszVsRadiusAntiLambda     = new TH2F("h2AsMcReszVsRadiusAntiLambda", "#bar{#Lambda}^{0} associated;Radius (cm);#Delta z (cm)",200,0.0,50.0, 50, -0.25, 0.25);
-       fOutputList->Add(fHistAsMcReszVsRadiusAntiLambda);
-       
-       // Pt Resolution
-       fHistAsMcResPtK0                   = new TH1F("h1AsMcResPtK0","Pt Resolution K^{0};#Delta Pt;Counts",200,-1,1);
-       fOutputList->Add(fHistAsMcResPtK0);
-       
-       fHistAsMcResPtLambda               = new TH1F("h1AsMcResPtLambda","Pt Resolution #Lambda^{0};#Delta Pt;Counts",200,-1,1);
-       fOutputList->Add(fHistAsMcResPtLambda);
-       
-       fHistAsMcResPtAntiLambda           = new TH1F("h1AsMcResPtAntiLambda","Pt Resolution #bar{#Lambda}^{0};#Delta Pt;Counts",200,-1,1);
-       fOutputList->Add(fHistAsMcResPtAntiLambda);
-       
-       
-       fHistAsMcResPtVsRapK0              = new TH2F("h2AsMcResPtVsRapK0","Pt Resolution K^{0};#Delta Pt;Rap",200,-1,1,20,-1,1);
-       fOutputList->Add(fHistAsMcResPtVsRapK0);
-       
-       fHistAsMcResPtVsRapLambda          = new TH2F("h2AsMcResPtVsRapLambda","Pt Resolution #Lambda^{0};#Delta Pt;Rap",200,-1,1,20,-1,1);
-       fOutputList->Add(fHistAsMcResPtVsRapLambda);
-       
-       fHistAsMcResPtVsRapAntiLambda      = new TH2F("h2AsMcResPtVsRapAntiLambda","Pt Resolution #bar{#Lambda}^{0};#Delta Pt;Rap",200,-1,1,20,-1,1);
-       fOutputList->Add(fHistAsMcResPtVsRapAntiLambda);
-       
-       fHistAsMcResPtVsPtK0               = new TH2F("h2AsMcResPtVsPtK0","Pt Resolution K^{0};#Delta Pt;Pt",600,-0.15,0.15,240,0,12);
-       fOutputList->Add(fHistAsMcResPtVsPtK0);
-    
-       fHistAsMcResPtVsPtLambda           = new TH2F("h2AsMcResPtVsPtLambda","Pt Resolution #Lambda^{0};#Delta Pt;Pt",600,-0.15,0.15,240,0,12);
-       fOutputList->Add(fHistAsMcResPtVsPtLambda);
-       
-       fHistAsMcResPtVsPtAntiLambda       = new TH2F("h2AsMcResPtVsPtAntiLambda","Pt Resolution #bar{#Lambda}^{0};#Delta Pt;Pt",300,-0.15,0.15,240,0,12);
-       fOutputList->Add(fHistAsMcResPtVsPtAntiLambda);
-       
-       // Pt distribution Lambda from Sigma
-       fHistAsMcPtLambdaFromSigma          = new TH1F("h1AsMcPtLambdaFromSigma","#Lambda}^{0} associated from Sigma;p{t} (GeV/c);Count",240,0,12);
+       fHistAsMcPtLambdaFromSigma           = new TH1F("h1AsMcPtLambdaFromSigma","#Lambda}^{0} associated from Sigma;p{t} (GeV/c);Count",240,0,12);
        fOutputList->Add(fHistAsMcPtLambdaFromSigma);
        
-       fHistAsMcPtAntiLambdaFromSigma      = new TH1F("h1AsMcPtAntiLambdaFromSigma","#bar{#Lambda}^{0} associated from Sigma;p{t} (GeV/c);Count",240,0,12);
+       fHistAsMcPtAntiLambdaFromSigma       = new TH1F("h1AsMcPtAntiLambdaFromSigma","#bar{#Lambda}^{0} associated from Sigma;p{t} (GeV/c);Count",240,0,12);
        fOutputList->Add(fHistAsMcPtAntiLambdaFromSigma);
        
-       // Associated secondary particles:
-       // Pt and rapidity distribution
-       fHistAsMcSecondaryPtVsRapK0s          = new TH2F("h2AsMcSecondaryPtVsRapK0s", "K^{0} associated secondary;p{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
+       fHistAsMcSecondaryPtVsRapK0s         = new TH2F("h2AsMcSecondaryPtVsRapK0s", "K^{0} associated secondary;p{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
        fOutputList->Add(fHistAsMcSecondaryPtVsRapK0s);
        
-       fHistAsMcSecondaryPtVsRapLambda       = new TH2F("h2AsMcSecondaryPtVsRapLambda", "#Lambda^{0} associated secondary;p{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
+       fHistAsMcSecondaryPtVsRapLambda      = new TH2F("h2AsMcSecondaryPtVsRapLambda", "#Lambda^{0} associated secondary;p{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
        fOutputList->Add(fHistAsMcSecondaryPtVsRapLambda);
        
-       fHistAsMcSecondaryPtVsRapAntiLambda   = new TH2F("h2AsMcSecondaryPtVsRapAntiLambda", "#bar{#Lambda}^{0} associated secondary;p{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
+       fHistAsMcSecondaryPtVsRapAntiLambda  = new TH2F("h2AsMcSecondaryPtVsRapAntiLambda", "#bar{#Lambda}^{0} associated secondary;p{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
        fOutputList->Add(fHistAsMcSecondaryPtVsRapAntiLambda);
-       
-       // Production radius
-       fHistAsMcSecondaryProdRadiusK0s              = new TH1F("h1AsMcSecondaryProdRadiusK0s", "K^{0} Production Radius;r (cm);Count", 170, -2, 15);
+
+       fHistAsMcSecondaryProdRadiusK0s      = new TH1F("h1AsMcSecondaryProdRadiusK0s", "K^{0} Production Radius;r (cm);Count", 170, -2, 15);
        fOutputList->Add(fHistAsMcSecondaryProdRadiusK0s);
        
-       fHistAsMcSecondaryProdRadiusLambda           = new TH1F("h1AsMcSecondaryProdRadiusLambda", "#Lambda^{0} Production Radius;r (cm);Count", 170, -2, 15);
+       fHistAsMcSecondaryProdRadiusLambda   = new TH1F("h1AsMcSecondaryProdRadiusLambda", "#Lambda^{0} Production Radius;r (cm);Count", 170, -2, 15);
        fOutputList->Add(fHistAsMcSecondaryProdRadiusLambda);
        
        fHistAsMcSecondaryProdRadiusAntiLambda       = new TH1F("h1AsMcSecondaryProdRadiusAntiLambda", "#bar{#Lambda}^{0} Production Radius;r (cm);Count", 170, -2, 15);
@@ -982,70 +526,78 @@ void AliLeadingV0Correlation::UserCreateOutputObjects()
        
        fHistAsMcSecondaryProdRadiusXvsYAntiLambda   = new TH2F("h2AsMcSecondaryProdRadiusXvsYAntiLambda","Associated Secondary #bar{#Lambda}^{0} Production Radius;x (cm); y (cm)",200,-20,20,200,-20,20);
        fOutputList->Add(fHistAsMcSecondaryProdRadiusXvsYAntiLambda);
-       
-       // Pt distribution Lambda from Sigma
+
        fHistAsMcSecondaryPtLambdaFromSigma          = new TH1F("h1AsMcSecondaryPtLambdaFromSigma","#Lambda}^{0} associated from Sigma;p{t} (GeV/c);Count",240,0,12);
        fOutputList->Add(fHistAsMcSecondaryPtLambdaFromSigma);
        
        fHistAsMcSecondaryPtAntiLambdaFromSigma      = new TH1F("h1AsMcSecondaryPtAntiLambdaFromSigma","#bar{#Lambda}^{0} associated from Sigma;p{t} (GeV/c);Count",240,0,12);
        fOutputList->Add(fHistAsMcSecondaryPtAntiLambdaFromSigma);
        
-       
        //----------------------------------------------Correlation histograms -----------------------------------------------------//
        
-       fHistSibK0 = new TH2F("hfHistSibK0","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistSibK0->SetXTitle("#Delta #Phi");
+       fHistSibK0       = new TH3F("hfHistSibK0","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistSibK0->SetStats(0);
        fHistSibK0->Sumw2();
        fOutputList->Add(fHistSibK0);
        
-       fHistMixK0 = new TH2F("hfHistMixK0","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistMixK0->SetXTitle("#Delta #Phi");
+       fHistMixK0       = new TH3F("hfHistMixK0","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistMixK0->SetStats(0);
        fHistMixK0->Sumw2();
        fOutputList->Add(fHistMixK0);
        
-       fHistSibLambda = new TH2F("hfHistSibLambda","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistSibLambda->SetXTitle("#Delta #Phi");
+       fHistSibLambda   = new TH3F("hfHistSibLambda","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistSibLambda->SetStats(0);
        fHistSibLambda->Sumw2();
        fOutputList->Add(fHistSibLambda);
        
-       fHistMixLambda= new TH2F("hfHistMixLambda","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
+       fHistMixLambda   = new TH3F("hfHistMixLambda","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistMixLambda->SetXTitle("#Delta #Phi");
        fHistMixLambda->SetStats(0);
        fHistMixLambda->Sumw2();
        fOutputList->Add(fHistMixLambda);
        
-       fHistSibK0MC = new TH2F("hfHistSibK0MC","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistSibK0MC->SetXTitle("#Delta #Phi");
+       fHistSibK0MC     = new TH3F("hfHistSibK0MC","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistSibK0MC->SetStats(0);
        fHistSibK0MC->Sumw2();
        fOutputList->Add(fHistSibK0MC);
        
-       fHistMixK0MC = new TH2F("hfHistMixK0MC","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistMixK0MC->SetXTitle("#Delta #Phi");
+       fHistMixK0MC     = new TH3F("hfHistMixK0MC","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistMixK0MC->SetStats(0);
        fHistMixK0MC->Sumw2();
        fOutputList->Add(fHistMixK0MC);
        
-       fHistSibLambdaMC = new TH2F("hfHistSibLambdaMC","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistSibLambdaMC->SetXTitle("#Delta #Phi");
+       fHistSibLambdaMC = new TH3F("hfHistSibLambdaMC","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistSibLambdaMC->SetStats(0);
        fHistSibLambdaMC->Sumw2();
        fOutputList->Add(fHistSibLambdaMC);
        
-       fHistMixLambdaMC= new TH2F("hfHistMixLambdaMC","",CorrBinsX,-2*fTrackEtaCut,2*fTrackEtaCut,CorrBinsY,-TMath::Pi()/2,3*TMath::Pi()/2);
-       fHistMixLambdaMC->SetXTitle("#Delta #Phi");
+       fHistMixLambdaMC = new TH3F("hfHistMixLambdaMC","",CorrBinsX,-TMath::Pi()/2,3*TMath::Pi()/2,CorrBinsY,-2*fTrackEtaCut,2*fTrackEtaCut,30,0,6);
        fHistMixLambdaMC->SetStats(0);
        fHistMixLambdaMC->Sumw2();
        fOutputList->Add(fHistMixLambdaMC);
        
+       fHistLeadInfo = new TH3F("hfHistLeadInfo","",60,0,12,CorrBinsY/2,-fTrackEtaCut,fTrackEtaCut,CorrBinsX/2,0,3*TMath::Pi());
+       fOutputList->Add(fHistLeadInfo);
+       
+       fHistLeadInfoMC = new TH3F("hfHistLeadInfoMC","",60,0,12,CorrBinsY/2,-fTrackEtaCut,fTrackEtaCut,CorrBinsX/2,0,3*TMath::Pi());
+       fOutputList->Add(fHistLeadInfoMC);
+       
+       fHistLeadInfoMix = new TH3F("hfHistLeadInfoMix","",60,0,12,CorrBinsY/2,-fTrackEtaCut,fTrackEtaCut,CorrBinsX/2,0,3*TMath::Pi());
+       fOutputList->Add(fHistLeadInfoMix);
+       
+       fHistLeadInfoMixMC = new TH3F("hfHistLeadInfoMixMC","",60,0,12,CorrBinsY/2,-fTrackEtaCut,fTrackEtaCut,CorrBinsX/2,0,3*TMath::Pi());
+       fOutputList->Add(fHistLeadInfoMixMC);
+       
        //----------------------------------------------Event Pool-----------------------------------------------------//
        
        fPoolMgr = new AliEventPoolManager(fPoolMaxNEvents, fPoolMinNTracks, fNCentBins, fCentBins, fNzVtxBins, fZvtxBins);
        if(!fPoolMgr) return;
        
+       if(fAnalysisMC){
+       fPoolMgrMC = new AliEventPoolManager(fPoolMaxNEvents, fPoolMinNTracks, fNCentBins, fCentBins, fNzVtxBins, fZvtxBins);
+       if(!fPoolMgr) return;
+       }
+       
        PostData(1, fOutputList);
 
 }
@@ -1058,25 +610,32 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        if (!inEvMain) return;
        
        // Pointers to PID Response objects.    
-       fPIDResponse = inEvMain->GetPIDResponse(); 
-       //cout << "PID Response object: " << fPIDResponse << endl;
-
+       fPIDResponse = inEvMain->GetPIDResponse();
+       if(!fPIDResponse) return;
+       
     fAODEvent = dynamic_cast<AliAODEvent*>(inEvMain->GetEvent());
        if(!fAODEvent) return;
        
-       
        // physics selection
        UInt_t maskIsSelected = inEvMain->IsEventSelected();
-    Bool_t isSelected = ((maskIsSelected & AliVEvent::kMB) || (maskIsSelected & AliVEvent::kCentral) || (maskIsSelected & AliVEvent::kSemiCentral));
-    if (!isSelected) return;
+       Bool_t isSelected = 0;
+       
+       if( fTriggerMask == "kMB" )
+           isSelected = (maskIsSelected & AliVEvent::kMB)     == AliVEvent::kMB;
+       if( fTriggerMask == "kINT7" )
+               isSelected = (maskIsSelected & AliVEvent::kINT7)   == AliVEvent::kINT7;
+       if( fTriggerMask == "kINT8" )
+               isSelected = (maskIsSelected & AliVEvent::kINT8)   == AliVEvent::kINT8;
+       if( fTriggerMask == "kAnyINT" )
+               isSelected = (maskIsSelected & AliVEvent::kAnyINT) == AliVEvent::kAnyINT;
+       if ( ! isSelected )return;
        
        //-----------------------------MC Accsess------------------------------------------------
        TClonesArray *stack = 0x0;
        Double_t mcXv=0., mcYv=0., mcZv=0.;
        Int_t ntrk =0, ntrk0=0;
        
-       TObjArray *selectedTracksLeadingK0MC =0x0;
-    TObjArray *selectedTracksLeadingLambdaMC = 0x0;
+       TObjArray *selectedTracksLeadingMC =0x0;
        
        TObjArray * selectedK0MC =new TObjArray;
        selectedK0MC->SetOwner(kTRUE);
@@ -1085,6 +644,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        selectedLambdaMC->SetOwner(kTRUE);
        
        if (fAnalysisMC) {
+               
                TList *lst = fAODEvent->GetList();
                stack = (TClonesArray*)lst->FindObject(AliAODMCParticle::StdBranchName());
                if (!stack) {Printf("ERROR: stack not available");return;}
@@ -1094,68 +654,36 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                ntrk=stack->GetEntriesFast(), ntrk0=ntrk;
                if(TMath::Abs(mcZv)>fpvzcut)return;
                
-               selectedTracksLeadingK0MC = FindLeadingObjectsK0MC(stack);
-               if(!selectedTracksLeadingK0MC) return;
-               selectedTracksLeadingK0MC->SetOwner(kTRUE);
-               
-               selectedTracksLeadingLambdaMC = FindLeadingObjectsLambdaMC(stack);
-               if(!selectedTracksLeadingLambdaMC) return;
-               selectedTracksLeadingLambdaMC->SetOwner(kTRUE);
-               
+               selectedTracksLeadingMC = FindLeadingObjectsMC(stack);
+               if(!selectedTracksLeadingMC) return;
+               selectedTracksLeadingMC->SetOwner(kTRUE);
        }
        
        // If PID is used:
-       Double_t lLimitPPID    = 0.7;
-       Float_t cutNSigmaLowP  = 1E3;
-       Float_t cutNSigmaHighP = 1E3;
-       if (fUsePID=="withPID") {
-               cutNSigmaLowP  = 3.0;
-               cutNSigmaHighP = 3.0;
-       }
-       
-       Double_t lmcPrimVtxR      = 0;
-       
-       Int_t lPdgcodeCurrentPart = 0;
-       Double_t lRapCurrentPart  = 0;
-       Double_t lPtCurrentPart   = 0;
-       Double_t lPhiCurrentPart  = 0;
-       Double_t lEtaCurrentPart  = 0;
-       Int_t lComeFromSigma      = 0;
+       Double_t lLimitPPID          = 1.0;
+       Float_t  cutNSigmaLowP       = 3.0;
+       Float_t  cutNSigmaHighP      = 3.0;     
+       Int_t    lPdgcodeCurrentPart = 0;
+       Double_t lRapCurrentPart     = 0;
+       Double_t lPtCurrentPart          = 0;
+       Double_t lPhiCurrentPart         = 0;
+       Double_t lEtaCurrentPart         = 0;
+       Int_t    lComeFromSigma      = 0;
        
        // PID flags:
        Int_t LambdaPID = 0;
        Int_t AntiLambdaPID = 0;
        
-       
-       // Production Radius
-       Double_t mcPosX     = 0.0,  mcPosY      = 0.0,  mcPosZ      = 0.0;
-       Double_t mcPosR     = 0.0;
-       
-       // Decay Radius
-       Double_t mcDecayPosX = 0, mcDecayPosY = 0, mcDecayPosR = 0;
-       
        // current mc particle 's mother
        Int_t iCurrentMother  = 0, lPdgCurrentMother    = 0;
-       
-       // current mc particles 's daughter:
-       Int_t lPdgCurrentDaughter0 = 0, lPdgCurrentDaughter1 = 0; 
-       
-       // variables for multiple reconstruction studies:
-       Int_t id0           = 0, id1          = 0;
-       Int_t lNtimesReconstructedK0s   = 0, lNtimesReconstructedLambda   = 0, lNtimesReconstructedAntiLambda   = 0;
 
-       
        // Start loop over MC particles
        if (fAnalysisMC) {
                
-               // Primary vertex
                fHistMCPrimaryVertexX->Fill(mcXv);
                fHistMCPrimaryVertexY->Fill(mcYv);
                fHistMCPrimaryVertexZ->Fill(mcZv);
                
-               lmcPrimVtxR = TMath::Sqrt(mcXv*mcXv+mcYv*mcYv);
-     
-               
                for (Int_t iMc = 0; iMc < (ntrk); iMc++) {  
                        AliAODMCParticle *p0=(AliAODMCParticle*)stack->UncheckedAt(iMc);
                        if (!p0) continue;
@@ -1174,88 +702,33 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                        AliAODMCParticle *Mother = (AliAODMCParticle*)stack->UncheckedAt(iCurrentMother);
                        if (iCurrentMother == -1){lPdgCurrentMother=0; } else {lPdgCurrentMother = Mother->GetPdgCode();} 
                        
-                       mcPosX = p0->Xv();
-                       mcPosY = p0->Yv();
-                       mcPosZ = p0->Zv();
-                       mcPosR = TMath::Sqrt(mcPosX*mcPosX+mcPosY*mcPosY);
-                       
-                       id0  = p0->GetDaughter(0);
-                       id1  = p0->GetDaughter(1);
-                       
-                       // Decay Radius and Production Radius
-                       if ( id0 <= ntrk && id0 > 0 && id1 <= ntrk && id1 > 0) {
-                               AliAODMCParticle *pDaughter0 = (AliAODMCParticle*)stack->UncheckedAt(id0);
-                               AliAODMCParticle *pDaughter1 = (AliAODMCParticle*)stack->UncheckedAt(id1);
-                               lPdgCurrentDaughter0 = pDaughter0->GetPdgCode();
-                               lPdgCurrentDaughter1 = pDaughter1->GetPdgCode();
-                               
-                               mcDecayPosX = pDaughter0->Xv();
-                               mcDecayPosY = pDaughter0->Yv();
-                               mcDecayPosR = TMath::Sqrt(mcDecayPosX*mcDecayPosX+mcDecayPosY*mcDecayPosY);
-                       }
-                       else  {mcDecayPosR = -1.0;}
-                       
-                       if (lPdgcodeCurrentPart==310)   {
-                               fHistMCtracksProdRadiusK0s->Fill(mcPosX,mcPosY);
-                               fHistMCtracksDecayRadiusK0s->Fill(mcDecayPosR);
-                               if (TMath::Abs(lRapCurrentPart) < fRapidityCut) fHistMCPtAllK0s->Fill(lPtCurrentPart);
-                       }
-                       else if (lPdgcodeCurrentPart==3122)  {
-                               fHistMCtracksProdRadiusLambda->Fill(mcPosX,mcPosY);
-                               fHistMCtracksDecayRadiusLambda->Fill(mcDecayPosR);
-                               if (TMath::Abs(lRapCurrentPart) < fRapidityCut) fHistMCPtAllLambda->Fill(lPtCurrentPart);
-                       }
-                       else if (lPdgcodeCurrentPart==-3122) {
-                               fHistMCtracksProdRadiusAntiLambda->Fill(mcPosX,mcPosY);
-                               fHistMCtracksDecayRadiusAntiLambda->Fill(mcDecayPosR);
-                               if (TMath::Abs(lRapCurrentPart) < fRapidityCut) fHistMCPtAllAntiLambda->Fill(lPtCurrentPart);
-                       }
-                       
-                       if ( ( ( TMath::Abs(lPdgCurrentMother) == 3212)  ||
-                                 ( TMath::Abs(lPdgCurrentMother) == 3224)  ||
-                                 ( TMath::Abs(lPdgCurrentMother) == 3214)  ||
-                                 ( TMath::Abs(lPdgCurrentMother) == 3114) )
+                       if (( ( TMath::Abs(lPdgCurrentMother)  == 3212)  ||
+                                 ( TMath::Abs(lPdgCurrentMother)  == 3224)  ||
+                                 ( TMath::Abs(lPdgCurrentMother)  == 3214)  ||
+                                 ( TMath::Abs(lPdgCurrentMother)  == 3114) )
                           && ( Mother->GetMother() == -1)
                                ) lComeFromSigma = 1;
-                       else lComeFromSigma = 0;                                                                                                                                                              
-                       
-                       Double_t dx = 0;
-                       Double_t dy = 0;
-                       Double_t dz = 0;
-                       Double_t ProdDistance = 0;
-                       
+                       else lComeFromSigma  = 0;
                        
-                       dx = ( ( mcXv) - (mcPosX) );
-                       dy = ( ( mcYv) - (mcPosY) );
-                       dz = ( ( mcZv) - (mcPosZ) );
-                       
-                       ProdDistance = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
-                       if (ProdDistance > 0.001) continue; // secondary V0      
-                       
-                       //********************************************
-                       
-                       lNtimesReconstructedK0s   = 0; lNtimesReconstructedLambda   = 0; lNtimesReconstructedAntiLambda   = 0;
+                       Bool_t isPrimary=p0->IsPhysicalPrimary();
+                       if (!isPrimary)continue; //keep only primary particles
                        
                        // Rapidity Cut
                        if (TMath::Abs(lRapCurrentPart) > fRapidityCut) continue;
                        
                        if (lPdgcodeCurrentPart==310) {
                                fHistMCRapK0s->Fill(lRapCurrentPart);
-                               fHistMCProdRadiusK0s->Fill(mcPosR);
                                fHistMCPtK0s->Fill(lPtCurrentPart);
-                               fHistNTimesRecK0s->Fill(lNtimesReconstructedK0s);
-                               fHistNTimesRecK0sVsPt->Fill(lPtCurrentPart,lNtimesReconstructedK0s);
                                fHistPrimRawPtVsYK0s->Fill(lPtCurrentPart,lRapCurrentPart);
+                               fHistMCPtAllK0s->Fill(lPtCurrentPart);
                                selectedK0MC->Add(new AliLeadingBasicParticle(lEtaCurrentPart,lPhiCurrentPart,lPtCurrentPart));
                        }
                        else 
                        if (lPdgcodeCurrentPart==3122) {
                                    fHistMCRapLambda->Fill(lRapCurrentPart);
-                                       fHistMCProdRadiusLambda->Fill(mcPosR);
                                        fHistMCPtLambda->Fill(lPtCurrentPart);    
-                                       fHistNTimesRecLambda->Fill(lNtimesReconstructedLambda);
-                                       fHistNTimesRecLambdaVsPt->Fill(lPtCurrentPart,lNtimesReconstructedLambda);
                                    fHistPrimRawPtVsYLambda->Fill(lPtCurrentPart,lRapCurrentPart);
+                                       fHistMCPtAllLambda->Fill(lPtCurrentPart);
                                        if (lComeFromSigma) fHistMCPtLambdaFromSigma->Fill(lPtCurrentPart);
                                    selectedLambdaMC->Add(new AliLeadingBasicParticle(lEtaCurrentPart,lPhiCurrentPart,lPtCurrentPart));
                                        
@@ -1263,16 +736,13 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                        else 
                        if (lPdgcodeCurrentPart==-3122) {
                                        fHistMCRapAntiLambda->Fill(lRapCurrentPart);
-                                               fHistMCProdRadiusAntiLambda->Fill(mcPosR);
                                                fHistMCPtAntiLambda->Fill(lPtCurrentPart);        
-                                               fHistNTimesRecAntiLambda->Fill(lNtimesReconstructedAntiLambda);
-                                               fHistNTimesRecAntiLambdaVsPt->Fill(lPtCurrentPart,lNtimesReconstructedAntiLambda);
                                                fHistPrimRawPtVsYAntiLambda->Fill(lPtCurrentPart,lRapCurrentPart);
+                                               fHistMCPtAllAntiLambda->Fill(lPtCurrentPart);
                                                if (lComeFromSigma) fHistMCPtAntiLambdaFromSigma->Fill(lPtCurrentPart);
                                        }
                        
                } // end loop AOD MC
-               
        } // End Loop over MC condition
        
        //-----------------------------------------------------------------------------------------
@@ -1290,7 +760,6 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        
        if (TMath::Abs(lPVx)<10e-5 && TMath::Abs(lPVy)<10e-5 && TMath::Abs(lPVz)<10e-5) return;
        
-       
        fHistPrimaryVertexX->Fill(lPVx);
     fHistPrimaryVertexY->Fill(lPVy);
     fHistPrimaryVertexZ->Fill(lPVz);
@@ -1308,28 +777,21 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        if(fcollidingSys=="PbPb"){ 
                centralityObj = fAODEvent->GetHeader()->GetCentralityP();
                MultipOrCent  = centralityObj->GetCentralityPercentileUnchecked("V0M");
+               if ((MultipOrCent < 0.)||(MultipOrCent > 90.)) return;
        }
        
        Double_t * CentBins = fCentBins;
-       Double_t poolmin=CentBins[0];
-       Double_t poolmax=CentBins[fNCentBins];
-       
-       TObjArray *selectedTracksLeadingK0 = FindLeadingObjectsK0(fAODEvent);
-       if(!selectedTracksLeadingK0) return;
-       selectedTracksLeadingK0->SetOwner(kTRUE);
+       Double_t poolmin    = CentBins[0];
+       Double_t poolmax    = CentBins[fNCentBins];
        
-       TObjArray *selectedTracksLeadingLambda = FindLeadingObjectsLambda(fAODEvent);
-       if(!selectedTracksLeadingLambda) return;
-       selectedTracksLeadingLambda->SetOwner(kTRUE);
+       TObjArray *selectedTracksLeading = FindLeadingObjects(fAODEvent);
+       if(!selectedTracksLeading) return;
+       selectedTracksLeading->SetOwner(kTRUE);
        
        // -------------------------------------V0 loop for reconstructed event------------------------
-       
-       Double_t cutcTauL   = 3*7.89;
-       Double_t cutcTauK0  = 3*2.68;
-
-       Double_t lPLambda = 0;
+       Double_t lPLambda     = 0;
        Double_t lPAntiLambda = 0;
-       Double_t lPK0s = 0;
+       Double_t lPK0s        = 0;
        
        // Variables:
        Double_t  lV0Position[3];
@@ -1338,14 +800,12 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        Double_t lDcaNegToPrimVertex = 0;
        Double_t lDcaV0Daughters     = 0;
        Double_t lV0cosPointAngle    = 0;
-       Double_t lChi2V0             = 0;
        Double_t lV0DecayLength      = 0;
        Double_t lV0Radius           = 0;
        Double_t lDcaV0ToPrimVertex  = 0;
        Double_t lcTauLambda         = 0;   
        Double_t lcTauAntiLambda     = 0;   
        Double_t lcTauK0s            = 0;   
-       Int_t    lOnFlyStatus        = 0;
        
        Double_t lInvMassK0   = 0, lInvMassLambda = 0, lInvMassAntiLambda = 0;
        Double_t lPtK0s       = 0, lPtLambda      = 0, lPtAntiLambda      = 0;
@@ -1355,10 +815,6 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        Double_t lPzK0s       = 0, lPzLambda      = 0, lPzAntiLambda      = 0;
        Double_t lAlphaV0     = 0, lPtArmV0       = 0;
        
-       
-       
-       Double_t lV0Eta = 999;
-       
        //Associated V0s:
        
        UInt_t   lLabelTrackPos       = 0, lLabelTrackNeg         = 0;
@@ -1366,7 +822,6 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        Int_t    lCheckPIdLambda      = 0, lCheckMcLambda         = 0;
        Int_t    lCheckPIdAntiLambda  = 0, lCheckMcAntiLambda     = 0;
        Int_t    lCheckSecondaryK0s   = 0, lCheckSecondaryLambda  = 0, lCheckSecondaryAntiLambda  = 0;
-       Int_t    lCheckGamma          = 0;
        Double_t mcPosMotherX         = 0, mcPosMotherY           = 0, mcPosMotherZ  = 0;
        Double_t mcPosMotherR         = 0;
        Double_t mcMotherPt           = 0;
@@ -1379,36 +834,18 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        Int_t lPdgcodeMother          = 0;
        Int_t lPdgcodeMotherOfMother  = 0;
        
-       // Reconstructed position
-       Double_t rcPosXK0s        = 0,  rcPosYK0s        = 0, rcPosZK0s        = 0;
-       Double_t rcPosRK0s        = 0;
-       Double_t rcPosXLambda     = 0,  rcPosYLambda     = 0, rcPosZLambda     = 0;
-       Double_t rcPosRLambda     = 0;
-       Double_t rcPosXAntiLambda = 0,  rcPosYAntiLambda = 0, rcPosZAntiLambda = 0;
-       Double_t rcPosRAntiLambda = 0;
-       
-       // Pt resolution
-       Double_t deltaPtK0s  = 0, deltaPtLambda  = 0, deltaPtAntiLambda  = 0;
-       
-       //  V0 momentum      
-       //  Double_t V0mom[3] = {999,999,999};
-       Double_t lPosMom = 0;
-       Double_t lNegMom = 0;
-       
        // Daughters' momentum:
        Double_t  lMomPos[3] = {999,999,999};
        Double_t  lMomNeg[3] = {999,999,999};
        Double_t  lPtPos = 999, lPtNeg = 999;
-       Double_t  lPPos = 999, lPNeg = 999;
        
        // Inner Wall parameters:
        Double_t  lMomInnerWallPos =999, lMomInnerWallNeg = 999;
-       Double_t        ldEdxPos =0.0,       ldEdxNeg=0.0;
+       Double_t  ldEdxPos         =0.0, ldEdxNeg         = 0.0;
        
        // PID
        Float_t nSigmaPosPion   = 0;
        Float_t nSigmaNegPion   = 0;
-       
        Float_t nSigmaPosProton = 0;
        Float_t nSigmaNegProton = 0;
        
@@ -1435,7 +872,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                lCheckPIdK0Short    = 0; lCheckMcK0Short     = 0; lCheckSecondaryK0s         = 0;
                lCheckPIdLambda     = 0; lCheckMcLambda      = 0; lCheckSecondaryLambda      = 0;
                lCheckPIdAntiLambda = 0; lCheckMcAntiLambda  = 0; lCheckSecondaryAntiLambda  = 0;       
-               lComeFromSigma      = -1;lCheckGamma = 0;
+               lComeFromSigma      = -1;
                
         // get daughters
                
@@ -1443,12 +880,9 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
         AliAODTrack *myTrackNeg=(AliAODTrack *)(aodV0->GetDaughter(1));
                
                if (!myTrackPos || !myTrackNeg) {Printf("ERROR: Could not retreive one of the daughter track");continue;}
-               
         if (!IsAcseptedV0(fAODEvent,aodV0,myTrackPos,myTrackNeg)) continue;
                
                // VO's main characteristics to check the reconstruction cuts
-               lOnFlyStatus       = aodV0->GetOnFlyStatus();
-               lChi2V0            = aodV0->Chi2V0();
                lDcaV0Daughters    = aodV0->DcaV0Daughters();
                lDcaV0ToPrimVertex = aodV0->DcaV0ToPrimVertex();
                lV0cosPointAngle   = aodV0->CosPointingAngle(lPrimaryVtxPosition);
@@ -1467,13 +901,6 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                lPtPos = TMath::Sqrt(lMomPos[0]*lMomPos[0] + lMomPos[1]*lMomPos[1]);
                lPtNeg = TMath::Sqrt(lMomNeg[0]*lMomNeg[0] + lMomNeg[1]*lMomNeg[1]);
                
-               lPPos = TMath::Sqrt(lMomPos[0]*lMomPos[0] + lMomPos[1]*lMomPos[1] + lMomPos[2]*lMomPos[2]);
-               lPNeg = TMath::Sqrt(lMomNeg[0]*lMomNeg[0] + lMomNeg[1]*lMomNeg[1] + lMomNeg[2]*lMomNeg[2]);
-               
-               // V0 momentum
-               lPosMom = lPPos;
-               lNegMom = lPNeg;
-               
                // Inner Wall parameter:
                const AliAODPid *pidPos=myTrackPos->GetDetPid();      
                const AliAODPid *pidNeg=myTrackNeg->GetDetPid();
@@ -1495,10 +922,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                // Armenteros variables:
                lAlphaV0      =  aodV0->AlphaV0();
                lPtArmV0      =  aodV0->PtArmV0();
-               
-               // Pseudorapidity:
-               lV0Eta = aodV0->PseudoRapV0();
-               //////////////////////////////////////////////////////////////////////////
+
                // Invariant mass
                lInvMassK0 = aodV0->MassK0Short();
                lPtK0s = aodV0->Pt();
@@ -1513,10 +937,10 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                lPzLambda = aodV0->Pz();
                
                lInvMassAntiLambda = aodV0->MassAntiLambda();
-               lPtAntiLambda = aodV0->Pt();
-               lPhiAntiLambda= aodV0->Phi();
-               lEtaAntiLambda= aodV0->Eta();
-               lPzAntiLambda = aodV0->Pz();
+               lPtAntiLambda      = aodV0->Pt();
+               lPhiAntiLambda     = aodV0->Phi();
+               lEtaAntiLambda     = aodV0->Eta();
+               lPzAntiLambda      = aodV0->Pz();
                
                // Rapidity:
                lRapK0s    = aodV0->RapK0Short();
@@ -1527,13 +951,11 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                if (lPtLambda==0) {continue;}
                if (lPtAntiLambda==0) {continue;}
                
-               
-               // PID  new method July 2011
                if (fUsePID=="withPID") {
-                       nSigmaPosPion = TMath::Abs(IsAccepteddEdx(lPPos,ldEdxPos,AliPID::kPion));
-                       nSigmaNegPion = TMath::Abs(IsAccepteddEdx(lPNeg,ldEdxNeg,AliPID::kPion));                              
-                       nSigmaPosProton = TMath::Abs(IsAccepteddEdx(lPPos,ldEdxPos,AliPID::kProton));
-                       nSigmaNegProton = TMath::Abs(IsAccepteddEdx(lPNeg,ldEdxNeg,AliPID::kProton));
+                       nSigmaPosPion   = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(myTrackPos, AliPID::kPion));
+                       nSigmaNegPion   = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(myTrackNeg, AliPID::kPion));
+                       nSigmaPosProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(myTrackPos, AliPID::kProton));
+                       nSigmaNegProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(myTrackNeg, AliPID::kProton));
                }
                else {nSigmaPosPion = 0; nSigmaNegPion =0; nSigmaPosProton = 0; nSigmaNegProton= 0;}
                
@@ -1554,10 +976,6 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                                
                                lPdgcodeMother = 0;
                                lIndexMotherOfMother = 0;
-                               mcPosX = 0;
-                               mcPosY = 0;
-                               mcPosZ = 0;
-                               mcPosR = 0;
                                mcPosMotherX = 0;
                                mcPosMotherY = 0;
                                mcPosMotherZ = 0;
@@ -1576,11 +994,6 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                                        if (!lMCAODMotherOfMother)      {continue;}
                                        lPdgcodeMotherOfMother = lMCAODMotherOfMother->GetPdgCode();
                                }
-                               
-                               mcPosX = pp->Xv();
-                               mcPosY = pp->Yv();
-                               mcPosZ = pp->Zv();
-                               mcPosR = TMath::Sqrt(mcPosX*mcPosX+mcPosY*mcPosY);
                                mcPosMotherX = lMCAODMother->Xv();
                                mcPosMotherY = lMCAODMother->Yv();
                                mcPosMotherZ = lMCAODMother->Zv();
@@ -1592,63 +1005,41 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                
        }
        
-       if (fAnalysisMC) {
-               if( (lIndexPosMother==-1) || (lIndexNegMother==-1) ) {
-                       fHistMCDaughterTrack->Fill(1);
-               }
-               
-               else if( ( (lPDGCodePosDaughter==+211) && (lPDGCodeNegDaughter==-211) )    
-                               ) {
-                       lCheckPIdK0Short    = 1;
-                       fHistMCDaughterTrack->Fill(3);
-                       if ( (lIndexPosMother==lIndexNegMother) &&
-                               (lPdgcodeMother==310) ) {
+       if (fAnalysisMC) {              
+               if(((lPDGCodePosDaughter==+211) && (lPDGCodeNegDaughter==-211))){lCheckPIdK0Short = 1;
+                       if ( (lIndexPosMother==lIndexNegMother) &&(lPdgcodeMother==310) ){
                                if (((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary()) lCheckMcK0Short  = 1;
                                else lCheckSecondaryK0s = 1;
                        }
                }
-               else if( ( (lPDGCodePosDaughter==+2212) && (lPDGCodeNegDaughter==-211)  )  
-                               ) {
-                       lCheckPIdLambda     = 1;
-                       fHistMCDaughterTrack->Fill(5);
-                       if ( (lIndexPosMother==lIndexNegMother) &&
-                               (lPdgcodeMother==3122)  ){
+               else if(((lPDGCodePosDaughter==+2212) && (lPDGCodeNegDaughter==-211))){lCheckPIdLambda = 1;
+                       if ((lIndexPosMother==lIndexNegMother) &&(lPdgcodeMother==3122)  ){
                                if ( ( TMath::Abs(lPdgcodeMotherOfMother) == 3212) ||
                                        ( TMath::Abs(lPdgcodeMotherOfMother)  == 3224) ||
                                        ( TMath::Abs(lPdgcodeMotherOfMother)  == 3214) ||
-                                       ( TMath::Abs(lPdgcodeMotherOfMother)  == 3114)
-                                       ) lComeFromSigma = 1;
+                                       ( TMath::Abs(lPdgcodeMotherOfMother)  == 3114))lComeFromSigma = 1;
                                else lComeFromSigma = 0; 
-                               if ( ((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary() || 
-                                       (!(((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary() ) && (lComeFromSigma) )
-                                       ) lCheckMcLambda  = 1; 
+                               if (((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary()||
+                                  (!(((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary() )&&
+                                  (lComeFromSigma)))lCheckMcLambda  = 1; 
                                else lCheckSecondaryLambda    = 1;
                        }
                }
-               else if( ( (lPDGCodePosDaughter==211)   && (lPDGCodeNegDaughter==-2212) )            
-                               ) {
-                       lCheckPIdAntiLambda = 1;
-                       fHistMCDaughterTrack->Fill(7);
+               else if(((lPDGCodePosDaughter==211) && (lPDGCodeNegDaughter==-2212))){lCheckPIdAntiLambda = 1;
                        if ( (lIndexPosMother==lIndexNegMother) &&
                                (lPdgcodeMother==-3122) ) {
                                if ( ( TMath::Abs(lPdgcodeMotherOfMother) == 3212) ||
                                        ( TMath::Abs(lPdgcodeMotherOfMother)  == 3224) ||
                                        ( TMath::Abs(lPdgcodeMotherOfMother)  == 3214) ||
                                        ( TMath::Abs(lPdgcodeMotherOfMother)  == 3114)
-                                       ) lComeFromSigma = 1;
+                                       )lComeFromSigma = 1;
                                else lComeFromSigma = 0;  
-                               if ( ((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary() || 
-                                       ( (!((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary()) && (lComeFromSigma) )
-                                       ) lCheckMcAntiLambda  = 1;
+                               if (((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary() || 
+                                  ((!((AliAODMCParticle*)stack->UncheckedAt(lIndexPosMother))->IsPrimary())&&
+                                  (lComeFromSigma)))lCheckMcAntiLambda  = 1;
                                else lCheckSecondaryAntiLambda = 1;
                        }
                }
-               
-               // Gamma conversion
-               else if ((lPDGCodePosDaughter==-11) &&
-                                (lPDGCodeNegDaughter==11) &&
-                                (lPdgcodeMother==22 ) )
-                       lCheckGamma = 1;
        } // end "look for associated particles 
        
        // PID condition:
@@ -1657,7 +1048,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        lCheckPIDAntiLambdaPosDaughter = 0, lCheckPIDAntiLambdaNegDaughter = 0;
        
        if (lMomInnerWallPos < lLimitPPID) {
-               if (nSigmaPosPion < cutNSigmaLowP)   {
+               if (nSigmaPosPion < cutNSigmaLowP){
                        lCheckPIDK0sPosDaughter        = 1;
                        lCheckPIDAntiLambdaPosDaughter = 1;
                }
@@ -1673,7 +1064,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        }
        
        if (lMomInnerWallNeg < lLimitPPID) {
-               if (nSigmaNegPion < cutNSigmaLowP)    {
+               if (nSigmaNegPion < cutNSigmaLowP){
                        lCheckPIDK0sNegDaughter       = 1;
                        lCheckPIDLambdaNegDaughter    = 1;
                }
@@ -1681,7 +1072,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                
        }
        else if (lMomInnerWallNeg > lLimitPPID) {
-               if (nSigmaNegPion < cutNSigmaHighP)   {
+               if (nSigmaNegPion < cutNSigmaHighP){
                        lCheckPIDK0sNegDaughter       = 1;
                        lCheckPIDLambdaNegDaughter    = 1;
                }
@@ -1699,36 +1090,15 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        lPAntiLambda = TMath::Sqrt(lPzAntiLambda*lPzAntiLambda + lPtAntiLambda*lPtAntiLambda);
        lPK0s = TMath::Sqrt(lPzK0s*lPzK0s + lPtK0s*lPtK0s);
        
-        
-       lcTauLambda     = (lV0DecayLength*lInvMassLambda)/lPLambda;
-       lcTauAntiLambda = (lV0DecayLength*lInvMassAntiLambda)/lPAntiLambda; 
-       lcTauK0s        = (lV0DecayLength*lInvMassK0)/lPK0s;
-       
-       if (lPLambda <1 && lOnFlyStatus==0 ){
-        fHistcTauL->Fill(lcTauLambda);
-       }
-       
+       if(lPLambda > 0)     lcTauLambda     = (lV0DecayLength*lInvMassLambda)/lPLambda;
+       if(lPAntiLambda > 0) lcTauAntiLambda = (lV0DecayLength*lInvMassAntiLambda)/lPAntiLambda; 
+       if(lPK0s > 0)        lcTauK0s        = (lV0DecayLength*lInvMassK0)/lPK0s;       
        //--------------------------------------------K0s---------------------------------//
-    
-       if (lcTauK0s< cutcTauK0){
+    if(!fAnalysisMC){
+       if (lcTauK0s< fCTauK0){
                if (TMath::Abs(lRapK0s) < fRapidityCut ){
                        if(lPtArmV0*fSpecialArmenterosCutK0s>(TMath::Abs(lAlphaV0))){
-                       
-                       //////2D histos: cut vs on fly status/////////////////////
-                       
-                       fHistDcaPosToPrimVertexK0->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
-                       fHistDcaNegToPrimVertexK0->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
-                       fHistRadiusV0K0->Fill(lV0Radius,lOnFlyStatus);
-                       fHistDecayLengthV0K0->Fill(lV0DecayLength,lOnFlyStatus);
-                       fHistDcaV0DaughtersK0->Fill(lDcaV0Daughters,lOnFlyStatus);
-                       fHistChi2K0->Fill(lChi2V0,lOnFlyStatus);
-                       fHistCosPointAngleK0->Fill(lV0cosPointAngle,lOnFlyStatus);
-                       
-                       //////2D histos: cut vs mass///////////////////// 
-                       
-                       if (lOnFlyStatus==0){
                                fHistMassK0->Fill(lInvMassK0);
-                               fHistMassVsRadiusK0->Fill(rcPosRK0s,lInvMassK0);
                                fHistPtVsMassK0->Fill(lInvMassK0,lPtK0s);
                                fHistDcaPosToPrimVertexK0vsMassK0->Fill(lDcaPosToPrimVertex,lInvMassK0);
                                fHistDcaNegToPrimVertexK0vsMassK0->Fill(lDcaNegToPrimVertex,lInvMassK0);
@@ -1736,70 +1106,34 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                                fHistDecayLengthV0K0vsMassK0->Fill(lV0DecayLength,lInvMassK0);
                                fHistDcaV0DaughtersK0vsMassK0->Fill(lDcaV0Daughters,lInvMassK0);
                                fHistCosPointAngleK0vsMassK0->Fill(lV0cosPointAngle,lInvMassK0);
-                               fHistArmenterosPodolanski->Fill(lAlphaV0,lPtArmV0);
-                               if(IsK0InvMass(lInvMassK0)){selectedK0->Add(new AliLeadingBasicParticle(lEtaK0s,lPhiK0s,lPtK0s));}
-                       }
+                               fHistArmenterosPodolanskiK0->Fill(lAlphaV0,lPtArmV0);
+                       if(IsK0InvMass(lInvMassK0)){selectedK0->Add(new AliLeadingBasicParticle(lEtaK0s,lPhiK0s,lPtK0s));}
                  }//Special Armesto Cut for K0 
                } // if rap. condition
        } // end cTau condition
-       
        //-----------------------------------------Lambda---------------------------------//
-       if (lcTauLambda < cutcTauL){
+       if (lcTauLambda < fCTauLambda){
                if ((LambdaPID==1 && lMomInnerWallPos  <=1 ) || (lMomInnerWallPos >1 ) ||  !(fUsePID=="withPID")){      
                        if (TMath::Abs(lRapLambda) <fRapidityCut) {
-                               
-                               //////2D histos: cut vs on fly status/////////////////////
-                               
-                               fHistDcaPosToPrimVertexL->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
-                               fHistDcaNegToPrimVertexL->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
-                               fHistRadiusV0L->Fill(lV0Radius,lOnFlyStatus);
-                               fHistDecayLengthV0L->Fill(lV0DecayLength,lOnFlyStatus);
-                               fHistDcaV0DaughtersL->Fill(lDcaV0Daughters,lOnFlyStatus);
-                               fHistChi2L->Fill(lChi2V0,lOnFlyStatus);
-                               fHistCosPointAngleL->Fill(lV0cosPointAngle,lOnFlyStatus);
-                               
-                               //////2D histos: cut vs mass/////////////////////
-                               
-                               if (lOnFlyStatus==0){
                                        fHistMassLambda->Fill(lInvMassLambda);
-                                       fHistMassVsRadiusLambda->Fill(rcPosRLambda,lInvMassLambda);
                                        fHistPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
-                                       
                                        fHistDcaPosToPrimVertexLvsMassL->Fill(lDcaPosToPrimVertex,lInvMassLambda);
                                        fHistDcaNegToPrimVertexLvsMassL->Fill(lDcaNegToPrimVertex,lInvMassLambda);
                                        fHistRadiusV0LvsMassL->Fill(lV0Radius,lInvMassLambda);
                                        fHistDecayLengthV0LvsMassL->Fill(lV0DecayLength,lInvMassLambda);
                                        fHistDcaV0DaughtersLvsMassL->Fill(lDcaV0Daughters,lInvMassLambda);
                                        fHistCosPointAngleLvsMassL->Fill(lV0cosPointAngle,lInvMassLambda);
-                                       if(IsLambdaInvMass(lInvMassLambda)){selectedLambda->Add(new AliLeadingBasicParticle(lEtaLambda,lPhiLambda,lPtLambda));}
-                               }
+                                       fHistArmenterosPodolanskiLambda->Fill(lAlphaV0,lPtArmV0);
+                               if(IsLambdaInvMass(lInvMassLambda)){selectedLambda->Add(new AliLeadingBasicParticle(lEtaLambda,lPhiLambda,lPtLambda));}
                        } //end of Rap condition
-               }
+               }//End PID
        }  //end cTau condition
-       
        //--------------------------------------AntiLambda---------------------------------//
-       
-       if (lcTauAntiLambda < cutcTauL){
-               
+       if (lcTauAntiLambda < fCTauLambda){
                if ((AntiLambdaPID==1 && lMomInnerWallNeg <=1) || (lMomInnerWallNeg >1) ||  !(fUsePID=="withPID")){  
                        if (TMath::Abs(lRapAntiLambda) < fRapidityCut) {
-                               
-                               //////2D histos: cut vs on fly status/////////////////////
-                               
-                               fHistDcaPosToPrimVertexAntiL->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
-                               fHistDcaNegToPrimVertexAntiL->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
-                               fHistRadiusV0AntiL->Fill(lV0Radius,lOnFlyStatus);
-                               fHistDecayLengthV0AntiL->Fill(lV0DecayLength,lOnFlyStatus);
-                               fHistDcaV0DaughtersAntiL->Fill(lDcaV0Daughters,lOnFlyStatus);
-                               fHistChi2AntiL->Fill(lChi2V0,lOnFlyStatus);
-                               fHistCosPointAngleAntiL->Fill(lV0cosPointAngle,lOnFlyStatus);
-                               
-                               //////2D histos: cut vs mass/////////////////////
-                               
-                               if (lOnFlyStatus==0){
-                                       
                                        fHistMassAntiLambda->Fill(lInvMassAntiLambda);
-                                       fHistMassVsRadiusAntiLambda->Fill(rcPosRAntiLambda,lInvMassAntiLambda);
                                        fHistPtVsMassAntiLambda->Fill(lInvMassAntiLambda,lPtAntiLambda);
                                        fHistDcaPosToPrimVertexAntiLvsMass->Fill(lDcaPosToPrimVertex,lInvMassAntiLambda);
                                        fHistDcaNegToPrimVertexAntiLvsMass->Fill(lDcaNegToPrimVertex,lInvMassAntiLambda);
@@ -1807,126 +1141,131 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
                                        fHistDecayLengthV0AntiLvsMass->Fill(lV0DecayLength,lInvMassAntiLambda);
                                        fHistDcaV0DaughtersAntiLvsMass->Fill(lDcaV0Daughters,lInvMassAntiLambda);
                                        fHistCosPointAngleAntiLvsMass->Fill(lV0cosPointAngle,lInvMassAntiLambda);
-                               }
+                                       fHistArmenterosPodolanskiAntiLambda->Fill(lAlphaV0,lPtArmV0);
                        } //end of Rap condition
                } // end of PID condition
        } //end cTau condition
-
+}
+       if(fAnalysisMC) {
        //--------------------------------------K0s Associated---------------------------------//
 
-       if (lcTauK0s< cutcTauK0) {
+       if (lcTauK0s< fCTauK0) {
                if (TMath::Abs(lRapK0s) < fRapidityCut) {
-                       fHistNsigmaPosPionK0->Fill(nSigmaPosPion);
-                       fHistNsigmaNegPionK0->Fill(nSigmaNegPion);
-                       if(lOnFlyStatus==0){
                                        if(lCheckPIdK0Short) fHistPidMcMassK0->Fill(lInvMassK0);
                                        if(lCheckMcK0Short) {
-                                               fHistAsMcMassK0->Fill(lInvMassK0);
                                                fHistAsMcPtK0->Fill(lPtK0s);
-                                               fHistAsMcPtVsMassK0->Fill(lInvMassK0,lPtK0s);
-                                               fHistAsMcMassVsRadiusK0->Fill(rcPosRK0s,lInvMassK0);
-                                               fHistAsMcResxK0->Fill(rcPosXK0s-mcPosX);
-                                               fHistAsMcResyK0->Fill(rcPosYK0s-mcPosY);
-                                               fHistAsMcReszK0->Fill(rcPosZK0s-mcPosZ);
-                                               fHistAsMcResrVsRadiusK0->Fill(rcPosRK0s,rcPosRK0s-mcPosR);
-                                               fHistAsMcReszVsRadiusK0->Fill(rcPosZK0s,rcPosZK0s-mcPosZ);
                                                fHistAsMcProdRadiusK0->Fill(mcPosMotherR);
                                                fHistAsMcProdRadiusXvsYK0s->Fill(mcPosMotherX,mcPosMotherY);
-                                               fHistAsMcResPtK0->Fill(deltaPtK0s);
-                                               fHistAsMcResPtVsRapK0->Fill(deltaPtK0s,lRapK0s);
-                                               fHistAsMcResPtVsPtK0->Fill(deltaPtK0s,lPtK0s);
+                                       if(lPtArmV0*fSpecialArmenterosCutK0s>(TMath::Abs(lAlphaV0))){
+                                               fHistMassK0->Fill(lInvMassK0);
+                                               fHistPtVsMassK0->Fill(lInvMassK0,lPtK0s);
+                                               fHistDcaPosToPrimVertexK0vsMassK0->Fill(lDcaPosToPrimVertex,lInvMassK0);
+                                               fHistDcaNegToPrimVertexK0vsMassK0->Fill(lDcaNegToPrimVertex,lInvMassK0);
+                                               fHistRadiusV0K0vsMassK0->Fill(lV0Radius,lInvMassK0);
+                                               fHistDecayLengthV0K0vsMassK0->Fill(lV0DecayLength,lInvMassK0);
+                                               fHistDcaV0DaughtersK0vsMassK0->Fill(lDcaV0Daughters,lInvMassK0);
+                                               fHistCosPointAngleK0vsMassK0->Fill(lV0cosPointAngle,lInvMassK0);
+                                               fHistArmenterosPodolanskiK0->Fill(lAlphaV0,lPtArmV0);
+                                       if(IsK0InvMass(lInvMassK0)){selectedK0->Add(new AliLeadingBasicParticle(lEtaK0s,lPhiK0s,lPtK0s));}
+                                                       }
                                        }
                                        if (lCheckSecondaryK0s) {
                                                fHistAsMcSecondaryPtVsRapK0s->Fill(lPtK0s,lRapK0s);
                                                fHistAsMcSecondaryProdRadiusK0s->Fill(mcPosMotherR);
                                                fHistAsMcSecondaryProdRadiusXvsYK0s->Fill(mcPosMotherX,mcPosMotherY);
                                        }
-                       }
                } // end rapidity condition
        } //end cTau condition
-    
-       
        //-----------------------------------Lambda Associated---------------------------------//
-       if (lcTauLambda < cutcTauL){                                                                                                   
+       if (lcTauLambda < fCTauLambda){                                                                                                   
                if (TMath::Abs(lRapLambda) < fRapidityCut) {
-                       fHistNsigmaPosProtonLambda->Fill(nSigmaPosProton);
-                       fHistNsigmaNegPionLambda->Fill(nSigmaNegPion);
-                       if(lOnFlyStatus==0){
                                        if(lCheckPIdLambda) fHistPidMcMassLambda->Fill(lInvMassLambda);
                                        if(lCheckMcLambda) {
-                                               fHistAsMcMassLambda->Fill(lInvMassLambda);
                                                fHistAsMcPtLambda->Fill(lPtLambda);
-                                               fHistCosPointAngleLVsMassVsPtsigL->Fill(lPtLambda,lV0cosPointAngle,lInvMassLambda);
-                                               fHistAsMcPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
-                                               fHistAsMcMassVsRadiusLambda->Fill(rcPosRLambda,lInvMassLambda);
-                                               fHistAsMcResxLambda->Fill(rcPosXLambda-mcPosX);
-                                               fHistAsMcResyLambda->Fill(rcPosYLambda-mcPosY);
-                                               fHistAsMcReszLambda->Fill(rcPosZLambda-mcPosZ);
-                                               fHistAsMcResrVsRadiusLambda->Fill(rcPosRLambda,rcPosRLambda-mcPosR);
-                                               fHistAsMcReszVsRadiusLambda->Fill(rcPosZLambda,rcPosZLambda-mcPosZ);
                                                fHistAsMcProdRadiusLambda->Fill(mcPosMotherR);
                                                fHistAsMcProdRadiusXvsYLambda->Fill(mcPosMotherX,mcPosMotherY);
-                                               fHistAsMcResPtLambda->Fill(deltaPtLambda);
-                                               fHistAsMcResPtVsRapLambda->Fill(deltaPtLambda,lRapLambda);
-                                               fHistAsMcResPtVsPtLambda->Fill(deltaPtLambda,lPtLambda);
-                                               if (lComeFromSigma) fHistAsMcPtLambdaFromSigma->Fill(lPtLambda);
+                                       if (lComeFromSigma) fHistAsMcPtLambdaFromSigma->Fill(lPtLambda);
+                                               fHistMassLambda->Fill(lInvMassLambda);
+                                               fHistPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
+                                               fHistDcaPosToPrimVertexLvsMassL->Fill(lDcaPosToPrimVertex,lInvMassLambda);
+                                               fHistDcaNegToPrimVertexLvsMassL->Fill(lDcaNegToPrimVertex,lInvMassLambda);
+                                               fHistRadiusV0LvsMassL->Fill(lV0Radius,lInvMassLambda);
+                                               fHistDecayLengthV0LvsMassL->Fill(lV0DecayLength,lInvMassLambda);
+                                               fHistDcaV0DaughtersLvsMassL->Fill(lDcaV0Daughters,lInvMassLambda);
+                                               fHistCosPointAngleLvsMassL->Fill(lV0cosPointAngle,lInvMassLambda);
+                                               fHistArmenterosPodolanskiLambda->Fill(lAlphaV0,lPtArmV0);
+                                       if(IsLambdaInvMass(lInvMassLambda)){selectedLambda->Add(new AliLeadingBasicParticle(lEtaLambda,lPhiLambda,lPtLambda));}
                                        }
-                                       
                                        if (lCheckSecondaryLambda) {
                                                fHistAsMcSecondaryPtVsRapLambda->Fill(lPtLambda,lRapLambda);
                                                fHistAsMcSecondaryProdRadiusLambda->Fill(mcPosMotherR); 
                                                fHistAsMcSecondaryProdRadiusXvsYLambda->Fill(mcPosMotherX,mcPosMotherY);
-                                               if (lComeFromSigma) fHistAsMcSecondaryPtLambdaFromSigma->Fill(lPtLambda);
+                                       if (lComeFromSigma) fHistAsMcSecondaryPtLambdaFromSigma->Fill(lPtLambda);
                                        }
-                                       if(!lCheckMcLambda)fHistCosPointAngleLVsMassVsPtbackL->Fill(lPtLambda,lV0cosPointAngle,lInvMassLambda);
-                       }
                } // end rapidity condition
        }//end cTau condition
-
 //------------------------------AntiLambda Associated---------------------------------//       
-       if (lcTauAntiLambda < cutcTauL){
+       if (lcTauAntiLambda < fCTauLambda){
                if (TMath::Abs(lRapAntiLambda) < fRapidityCut) {
-                       fHistNsigmaPosProtonAntiLambda->Fill(nSigmaPosProton);
-                       fHistNsigmaNegPionAntiLambda->Fill(nSigmaNegPion);
-                       if(lOnFlyStatus==0){
                                        if(lCheckPIdAntiLambda) fHistPidMcMassAntiLambda->Fill(lInvMassAntiLambda);
                                        if(lCheckMcAntiLambda) {
-                                               fHistAsMcMassAntiLambda->Fill(lInvMassAntiLambda);
                                                fHistAsMcPtAntiLambda->Fill(lPtAntiLambda);
-                                               fHistAsMcPtVsMassAntiLambda->Fill(lInvMassAntiLambda,lPtAntiLambda);
-                                               fHistAsMcMassVsRadiusAntiLambda->Fill(rcPosRAntiLambda,lInvMassAntiLambda);
-                                               fHistAsMcResxAntiLambda->Fill(rcPosXAntiLambda-mcPosX);
-                                               fHistAsMcResyAntiLambda->Fill(rcPosYAntiLambda-mcPosY);
-                                               fHistAsMcReszAntiLambda->Fill(rcPosZAntiLambda-mcPosZ);
-                                               fHistAsMcResrVsRadiusAntiLambda->Fill(rcPosRAntiLambda,rcPosRAntiLambda-mcPosR);
-                                               fHistAsMcReszVsRadiusAntiLambda->Fill(rcPosZAntiLambda,rcPosZAntiLambda-mcPosZ);
                                                fHistAsMcProdRadiusAntiLambda->Fill(mcPosMotherR);
                                                fHistAsMcProdRadiusXvsYAntiLambda->Fill(mcPosMotherX,mcPosMotherY);
-                                               fHistAsMcResPtAntiLambda->Fill(deltaPtAntiLambda);
-                                               fHistAsMcResPtVsRapAntiLambda->Fill(deltaPtAntiLambda,lRapAntiLambda);
-                                               fHistAsMcResPtVsPtAntiLambda->Fill(deltaPtAntiLambda,lPtAntiLambda);
-                                               if (lComeFromSigma) fHistAsMcPtAntiLambdaFromSigma->Fill(lPtAntiLambda);
-       
+                                       if (lComeFromSigma) fHistAsMcPtAntiLambdaFromSigma->Fill(lPtAntiLambda);
+                                                       fHistMassAntiLambda->Fill(lInvMassAntiLambda);
+                                                       fHistPtVsMassAntiLambda->Fill(lInvMassAntiLambda,lPtAntiLambda);
+                                                       fHistDcaPosToPrimVertexAntiLvsMass->Fill(lDcaPosToPrimVertex,lInvMassAntiLambda);
+                                                       fHistDcaNegToPrimVertexAntiLvsMass->Fill(lDcaNegToPrimVertex,lInvMassAntiLambda);
+                                                       fHistRadiusV0AntiLvsMass->Fill(lV0Radius,lInvMassAntiLambda);
+                                                       fHistDecayLengthV0AntiLvsMass->Fill(lV0DecayLength,lInvMassAntiLambda);
+                                                       fHistDcaV0DaughtersAntiLvsMass->Fill(lDcaV0Daughters,lInvMassAntiLambda);
+                                                       fHistCosPointAngleAntiLvsMass->Fill(lV0cosPointAngle,lInvMassAntiLambda);
+                                                       fHistArmenterosPodolanskiAntiLambda->Fill(lAlphaV0,lPtArmV0);
                                        }
-                                       
                                        if (lCheckSecondaryAntiLambda) {
                                                fHistAsMcSecondaryPtVsRapAntiLambda->Fill(lPtAntiLambda,lRapAntiLambda);
                                                fHistAsMcSecondaryProdRadiusAntiLambda->Fill(mcPosMotherR); 
                                                fHistAsMcSecondaryProdRadiusXvsYAntiLambda->Fill(mcPosMotherX,mcPosMotherY);
-                                               if (lComeFromSigma) fHistAsMcSecondaryPtAntiLambdaFromSigma->Fill(lPtAntiLambda);
+                                       if (lComeFromSigma) fHistAsMcSecondaryPtAntiLambdaFromSigma->Fill(lPtAntiLambda);
                                        }
-                       }
                } // end rapidity condition      
        }//end cTau condition
        
        // Correlation part
-       if(fAnalysisMC){
-       FillCorrelations(selectedTracksLeadingK0MC,selectedK0MC,fHistSibK0MC);
-       FillCorrelations(selectedTracksLeadingLambdaMC,selectedLambdaMC,fHistSibLambdaMC);
+       FillCorrelations(selectedTracksLeadingMC,selectedK0MC,fHistSibK0MC,fHistLeadInfoMC);
+       FillCorrelations(selectedTracksLeadingMC,selectedLambdaMC,fHistSibLambdaMC,0);
+               
+       // Mixing part
+       if(TMath::Abs(lPVz)>=10 || MultipOrCent>poolmax || MultipOrCent < poolmin) {
+               if(fcollidingSys=="PP")AliInfo(Form("pp Event with Zvertex = %.2f cm and multiplicity = %.0f out of pool bounds, SKIPPING",mcZv,MultipOrCent));
+               if(fcollidingSys=="PbPb") AliInfo(Form("PbPb Event with Zvertex = %.2f cm and centrality = %.1f  out of pool bounds, SKIPPING",mcZv,MultipOrCent));
+               return;
+       }
+               
+       fPoolK0MC = fPoolMgrMC->GetEventPool(MultipOrCent, mcZv);
+       if (!fPoolK0MC){AliInfo(Form("No pool found for multiplicity = %f, zVtx = %f cm", MultipOrCent, mcZv));return;}
+               
+       if (fPoolK0MC->IsReady() || fPoolK0MC->NTracksInPool() > fPoolMinNTracks  || fPoolK0MC->GetCurrentNEvents() >= fMinEventsToMix)
+       {
+               for (Int_t jMix=0; jMix<fPoolK0MC->GetCurrentNEvents(); jMix++) 
+               FillCorrelations(selectedTracksLeadingMC, fPoolK0MC->GetEvent(jMix),fHistMixK0MC,fHistLeadInfoMixMC);
+               fPoolK0MC->UpdatePool(CloneAndReduceTrackList(selectedK0MC));
+       }
+               
+       fPoolLambdaMC = fPoolMgrMC->GetEventPool(MultipOrCent, mcZv);
+       if (!fPoolLambdaMC){AliInfo(Form("No pool found for multiplicity = %f, zVtx = %f cm", MultipOrCent, mcZv));return;}
+               
+       if (fPoolLambdaMC->IsReady() || fPoolLambdaMC->NTracksInPool() > fPoolMinNTracks  || fPoolLambdaMC->GetCurrentNEvents() >= fMinEventsToMix)
+       {
+               for (Int_t jMix=0; jMix<fPoolLambdaMC->GetCurrentNEvents(); jMix++) 
+               FillCorrelations(selectedTracksLeadingMC, fPoolLambdaMC->GetEvent(jMix),fHistMixLambdaMC,0);
+               fPoolLambdaMC->UpdatePool(CloneAndReduceTrackList(selectedLambdaMC));
        }
+}
        
-       FillCorrelations(selectedTracksLeadingK0,selectedK0,fHistSibK0);
-       FillCorrelations(selectedTracksLeadingLambda,selectedLambda,fHistSibLambda);
+       FillCorrelations(selectedTracksLeading,selectedK0,fHistSibK0,fHistLeadInfo);
+       FillCorrelations(selectedTracksLeading,selectedLambda,fHistSibLambda,0);
        
        // Mixing part
        if(TMath::Abs(lPVz)>=10 || MultipOrCent>poolmax || MultipOrCent < poolmin) {
@@ -1941,7 +1280,7 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
     if (fPoolK0->IsReady() || fPoolK0->NTracksInPool() > fPoolMinNTracks  || fPoolK0->GetCurrentNEvents() >= fMinEventsToMix)
        {
                for (Int_t jMix=0; jMix<fPoolK0->GetCurrentNEvents(); jMix++) 
-                       FillCorrelations(selectedTracksLeadingK0, fPoolK0->GetEvent(jMix),fHistMixK0);
+                       FillCorrelations(selectedTracksLeading, fPoolK0->GetEvent(jMix),fHistMixK0,fHistLeadInfoMix);
                fPoolK0->UpdatePool(CloneAndReduceTrackList(selectedK0));
        }
        
@@ -1951,12 +1290,11 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
     if (fPoolLambda->IsReady() || fPoolLambda->NTracksInPool() > fPoolMinNTracks  || fPoolLambda->GetCurrentNEvents() >= fMinEventsToMix)
        {
                for (Int_t jMix=0; jMix<fPoolLambda->GetCurrentNEvents(); jMix++) 
-                       FillCorrelations(selectedTracksLeadingLambda, fPoolLambda->GetEvent(jMix),fHistMixLambda);
+                       FillCorrelations(selectedTracksLeading, fPoolLambda->GetEvent(jMix),fHistMixLambda,0);
                fPoolLambda->UpdatePool(CloneAndReduceTrackList(selectedLambda));
        }
        
        PostData(1, fOutputList);
-
 }              
 //---------------------------------------------------------------------------------------
 TObjArray* AliLeadingV0Correlation::CloneAndReduceTrackList(TObjArray* tracks)
@@ -1987,9 +1325,6 @@ Int_t  AliLeadingV0Correlation::NParticles(TObject* obj)
        }else if (obj->InheritsFrom("AliAODEvent")){  // RECO AOD tracks
                AliAODEvent *aodEvent = static_cast<AliAODEvent*>(obj);
         nTracks = aodEvent->GetNTracks();
-       }else if (obj->InheritsFrom("AliMCEvent")){  // RECO ESD tracks
-               AliMCEvent *mcEvent = static_cast<AliMCEvent*>(obj);
-        nTracks = mcEvent->GetNumberOfTracks();
        }else {
                if (fDebug > 1) AliFatal(" Analysis type not defined !!! ");
                return 0;
@@ -2029,7 +1364,7 @@ Double_t AliLeadingV0Correlation::RangePhi(Double_t DPhi)
        return DPhi;    
 }
 //---------------------------------------------------------------------------------------
-void AliLeadingV0Correlation::FillCorrelations(TObjArray* particles, TObjArray* mixed,TH2F*histo)
+void AliLeadingV0Correlation::FillCorrelations(TObjArray* particles, TObjArray* mixed,TH3F*histo,TH3F*leadinfo)
 {
  TObjArray* input = (mixed) ? mixed : particles;
  TArrayF eta(input->GetEntriesFast());
@@ -2065,14 +1400,15 @@ void AliLeadingV0Correlation::FillCorrelations(TObjArray* particles, TObjArray*
                                        vars[2] = triggerParticle->Pt();  //Triger Pt
                                        vars[3] = RangePhi(triggerParticle->Phi() - particle->Phi());
                                        
-                                       histo->Fill(vars[0],vars[3]);
+                                       histo->Fill(vars[3],vars[0],vars[1]);
+                                       if(leadinfo)leadinfo->Fill(vars[2],triggerEta,triggerParticle->Phi());
 
                   }
                }
         }
 }
 //---------------------------------------------------------------------------------------
-TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsK0(TObject *obj)
+TObjArray*  AliLeadingV0Correlation::FindLeadingObjects(TObject *obj)
 {
 
        Int_t nTracks = NParticles(obj);
@@ -2087,35 +1423,7 @@ TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsK0(TObject *obj)
         if (!part) continue;
                
                if(!IsAcseptedPrimaryTrack(((AliAODTrack*)part)))continue;
-               if(!IsTrackNotFromK0(ipart))continue;
-               
-               tracks->AddLast( part );
-       }
-       // Order tracks by pT   
-       QSortTracks( *tracks, 0, tracks->GetEntriesFast() );
-       
-       nTracks = tracks->GetEntriesFast();
-       if( !nTracks ) return 0;
-       
-       return tracks;
-}
-//---------------------------------------------------------------------------------------
-TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsLambda(TObject *obj)
-{
-       
-       Int_t nTracks = NParticles(obj);
-       if( !nTracks ) return 0;
-       
-       // Define array of AliVParticle objects
-       TObjArray* tracks = new TObjArray(nTracks);
-       
-       // Loop over tracks or jets
-       for (Int_t ipart=0; ipart<nTracks; ++ipart) {
-        AliVParticle* part = ParticleWithCuts( obj,ipart);
-        if (!part) continue;
-               
-               if(!IsAcseptedPrimaryTrack(((AliAODTrack*)part)))continue;
-               if(!IsTrackNotFromLambda(ipart))continue;
+               if(!IsTrackNotFromV0(((AliAODTrack*)part)))continue;
                
                tracks->AddLast( part );
        }
@@ -2128,7 +1436,7 @@ TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsLambda(TObject *obj)
        return tracks;
 }
 //---------------------------------------------------------------------------------------
-TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsK0MC(TObject *obj)
+TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsMC(TObject *obj)
 {
        
        Int_t nTracks = NParticles(obj);
@@ -2142,7 +1450,10 @@ TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsK0MC(TObject *obj)
         AliVParticle* part = ParticleWithCuts( obj,ipart);
         if (!part) continue;
                Int_t pdgCodeCurrent = ((AliAODMCParticle*)part)->GetPdgCode();
-               if(pdgCodeCurrent==310)continue;
+               Bool_t isHadron = TMath::Abs(pdgCodeCurrent)==211 ||  // Pion
+               TMath::Abs(pdgCodeCurrent)==2212 || // Proton
+               TMath::Abs(pdgCodeCurrent)==321;    // Kaon
+               if (!isHadron) continue;
                tracks->AddLast( part );
        }
        // Order tracks by pT   
@@ -2154,33 +1465,7 @@ TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsK0MC(TObject *obj)
        return tracks;
 }
 //---------------------------------------------------------------------------------------
-TObjArray*  AliLeadingV0Correlation::FindLeadingObjectsLambdaMC(TObject *obj)
-{
-       
-       Int_t nTracks = NParticles(obj);
-       if( !nTracks ) return 0;
-       
-       // Define array of AliVParticle objects
-       TObjArray* tracks = new TObjArray(nTracks);
-       
-       // Loop over tracks or jets
-       for (Int_t ipart=0; ipart<nTracks; ++ipart) {
-        AliVParticle* part = ParticleWithCuts( obj,ipart);
-        if (!part) continue;
-               Int_t pdgCodeCurrent = ((AliAODMCParticle*)part)->GetPdgCode();
-               if(pdgCodeCurrent==3122)continue;
-               tracks->AddLast( part );
-       }
-       // Order tracks by pT   
-       QSortTracks( *tracks, 0, tracks->GetEntriesFast() );
-       
-       nTracks = tracks->GetEntriesFast();
-       if( !nTracks ) return 0;
-       
-       return tracks;
-}
-//---------------------------------------------------------------------------------------
-void  AliLeadingV0Correlation::QSortTracks(TObjArray &a, Int_t first, Int_t last)
+void AliLeadingV0Correlation::QSortTracks(TObjArray &a, Int_t first, Int_t last)
 {
        // Sort array of TObjArray of tracks by Pt using a quicksort algorithm.
        
@@ -2248,7 +1533,8 @@ AliVParticle*  AliLeadingV0Correlation::ParticleWithCuts(TObject* obj, Int_t ipa
        return part;
 }
 //---------------------------------------------------------------------------------------
-Bool_t   AliLeadingV0Correlation::IsK0InvMass(const Double_t mass) const {
+Bool_t AliLeadingV0Correlation::IsK0InvMass(const Double_t mass) const 
+{
        
        const Float_t massK0            = 0.497;
        const Float_t sigmaK0           = 0.003;
@@ -2257,7 +1543,8 @@ Bool_t   AliLeadingV0Correlation::IsK0InvMass(const Double_t mass) const {
        return ((massK0-nSigmaSignal*sigmaK0)<=mass && mass<=(massK0 + nSigmaSignal*sigmaK0))?1:0;
 }
 //---------------------------------------------------------------------------------------
-Bool_t   AliLeadingV0Correlation::IsLambdaInvMass(const Double_t mass) const {
+Bool_t AliLeadingV0Correlation::IsLambdaInvMass(const Double_t mass) const 
+{
        
        const Float_t massLambda        = 1.116;
        const Float_t sigmaLambda       = 0.003;
@@ -2266,44 +1553,24 @@ Bool_t   AliLeadingV0Correlation::IsLambdaInvMass(const Double_t mass) const {
        return ((massLambda-nSigmaSignal*sigmaLambda)<=mass && mass<=(massLambda + nSigmaSignal*sigmaLambda))?1:0;
 }
 //---------------------------------------------------------------------------------------
-Bool_t   AliLeadingV0Correlation::IsTrackNotFromLambda(const Int_t indexTrack){
-       // check wether track with index is from Lambda (= V0 with proper inv mass)
-       TClonesArray* tracks = fAODEvent->GetTracks();
-       for(int i=0; i<fAODEvent->GetNumberOfV0s(); i++){ // loop over V0s
-               AliAODv0* aodV0 = fAODEvent->GetV0(i);
-               Float_t massLambda         = aodV0->MassLambda();
-               if(IsLambdaInvMass(massLambda)){
-                       AliAODTrack *trackPos = (AliAODTrack *) (aodV0->GetSecondaryVtx()->GetDaughter(0));
-                       AliAODTrack *trackNeg = (AliAODTrack *) (aodV0->GetSecondaryVtx()->GetDaughter(1));
-                       
-                       if ( !(IsAcseptedDaughterTrack(trackPos)) || !(IsAcseptedDaughterTrack(trackNeg)) ) continue;
-                       
-                       Int_t indexPos = tracks->IndexOf(trackPos);
-                       Int_t indexNeg = tracks->IndexOf(trackNeg);
-                       if(indexPos == indexTrack){ return kFALSE;}
-                       if(indexNeg == indexTrack){ return kFALSE;}
-               }
-       }
-       return kTRUE;
-}
-//---------------------------------------------------------------------------------------
-Bool_t   AliLeadingV0Correlation::IsTrackNotFromK0(const Int_t indexTrack){
-       // check wether track with index is from K0 (= V0 with proper inv mass)
-       TClonesArray* tracks = fAODEvent->GetTracks();
+Bool_t AliLeadingV0Correlation::IsTrackNotFromV0(AliAODTrack* track)
+{
+       Int_t atrID = track->GetID();
+
        for(int i=0; i<fAODEvent->GetNumberOfV0s(); i++){ // loop over V0s
                AliAODv0* aodV0 = fAODEvent->GetV0(i);
-               Float_t massK0         = aodV0->MassK0Short();
-               if(IsK0InvMass(massK0)){
-                       AliAODTrack *trackPos = (AliAODTrack *) (aodV0->GetSecondaryVtx()->GetDaughter(0));
-                       AliAODTrack *trackNeg = (AliAODTrack *) (aodV0->GetSecondaryVtx()->GetDaughter(1));
-                       
-                       if ( !(IsAcseptedDaughterTrack(trackPos)) || !(IsAcseptedDaughterTrack(trackNeg)) ) continue;
+               
+               AliAODTrack *trackPos=(AliAODTrack *)(aodV0->GetDaughter(0));
+        AliAODTrack *trackNeg=(AliAODTrack *)(aodV0->GetDaughter(1));
                        
-                       Int_t indexPos = tracks->IndexOf(trackPos);
-                       Int_t indexNeg = tracks->IndexOf(trackNeg);
-                       if(indexPos == indexTrack){ return kFALSE;}
-                   if(indexNeg == indexTrack){ return kFALSE;}
-               }
+               if ( !(IsAcseptedDaughterTrack(trackPos)) || !(IsAcseptedDaughterTrack(trackNeg)) ) continue;
+               //----------------------------------
+               Int_t negID = trackNeg->GetID();
+               Int_t posID = trackPos->GetID();
+               
+               if ((TMath::Abs(negID)+1)==(TMath::Abs(atrID))){ return kFALSE;}
+               if ((TMath::Abs(posID)+1)==(TMath::Abs(atrID))){ return kFALSE;}
+               //----------------------------------
        }
        return kTRUE;
 }
@@ -2312,14 +1579,6 @@ Bool_t AliLeadingV0Correlation::IsAcseptedV0(const AliAODEvent*aod, const AliAOD
 {
        if (!aodV0) return kFALSE;
        
-       Double_t lRapK0s = aodV0->Y(310);
-       Double_t lRapLambda = aodV0->Y(3122);
-       Double_t lRapAntiLambda = aodV0->Y(-3122);
-       
-       if (TMath::Abs(lRapK0s)>=fRapidityCut) return kFALSE;
-       if (TMath::Abs(lRapLambda)>=fRapidityCut) return kFALSE;
-       if (TMath::Abs(lRapAntiLambda)>=fRapidityCut) return kFALSE;
-    
        // Offline reconstructed V0 only
     if (aodV0->GetOnFlyStatus()) return kFALSE;
        
@@ -2373,32 +1632,6 @@ Bool_t AliLeadingV0Correlation::IsAcseptedV0(const AliAODEvent*aod, const AliAOD
        
        return kTRUE;
 }
-//---------------------------------------------------------------------------------------
-Double_t AliLeadingV0Correlation::IsAccepteddEdx(const Double_t mom,const Double_t signal, AliPID::EParticleType n){
-       
-       const Double_t kBBMIP(50.);
-       const Double_t kBBRes(0.07);
-       const Double_t kBBp1(0.76176e-1);
-       const Double_t kBBp2(10.632);
-       const Double_t kBBp3(0.13279e-4);
-       const Double_t kBBp4(1.8631);
-       const Double_t kBBp5(1.9479);
-       
-       Double_t mass=AliPID::ParticleMass(n); 
-       Double_t betaGamma = mom/mass;
-       
-       const Float_t kmeanCorrection =0.1;
-       Double_t bb = AliExternalTrackParam::BetheBlochAleph(betaGamma,kBBp1,kBBp2,kBBp3,kBBp4,kBBp5);
-       Double_t meanCorrection =(1+(bb-1)*kmeanCorrection);
-       Double_t bethe = bb * meanCorrection;
-       Double_t sigma = bethe * kBBRes;
-       
-       Double_t dedx = signal/kBBMIP;
-       Double_t nSig = (TMath::Abs(dedx - bethe))/sigma;
-       
-       return nSig;
-}
-
 //---------------------------------------------------------------------------------------
 void AliLeadingV0Correlation::Terminate(Option_t *)
 {
index f0a0bc1..3b74895 100644 (file)
@@ -1,5 +1,8 @@
-
-//            Class for Leading Charged Track+V0 Correlations Analysis
+/* Leading Charged Track+V0 Correlation.(Works for Real,Monte Carlo Data)
+ *                            Sandun Jayarathna
+ *                          University of Houston
+ *                      sandun.pahula.hewage@cern.ch
+ *****************************************************************************************/
 
 #ifndef ALILEADINGV0CORRELATIONH
 #define ALILEADINGV0CORRELATIONH
@@ -16,7 +19,6 @@ class TH2;
 class AliAODEvent;
 class AliEventPoolManager;
 class AliEventPool;
-class AliAnalyseLeadingTrackUE;
 class AliVParticle;
 class AliPIDResponse;
 class AliPID;
@@ -53,6 +55,7 @@ public:
        }
        
        void SetCollidingSystem(TString system){fcollidingSys = system;}
+       void SetTrigger(TString aTriggerMask){fTriggerMask = aTriggerMask;}
        void SetPrimeryVertexCut(Double_t pvzcut){fpvzcut = pvzcut;}
        void SetEatCut(Double_t  TrackEtaCut){fTrackEtaCut = TrackEtaCut;}
        void SetFilterBit(UInt_t  filterBit){fFilterBit = filterBit;}
@@ -71,33 +74,39 @@ public:
        void SetCutDCADaughters(Double_t aCutDCAV0Daughters){fCutDCAV0Daughters=aCutDCAV0Daughters;}
        void SetCutCPA(Double_t aCutV0CosPA){fCutV0CosPA=aCutV0CosPA;}
        void SetCutArmenterosK0s(Double_t aSpecialArmenterosCutK0s){fSpecialArmenterosCutK0s=aSpecialArmenterosCutK0s;}
+       void SetUSEPID(TString aUsePID){fUsePID=aUsePID;}
+       void SetCutRap(Double_t aRapidityCut){fRapidityCut=aRapidityCut;}
+       void SetCutCTauK0(Double_t aCTauK0){fCTauK0=aCTauK0;}
+       void SetCutCTauLambda(Double_t aCTauLambda){fCTauLambda=aCTauLambda;}
        
        
 private:
+       AliLeadingV0Correlation(const  AliLeadingV0Correlation &det);
+    AliLeadingV0Correlation&   operator=(const  AliLeadingV0Correlation &det);
+       
        AliVParticle* ParticleWithCuts(TObject* obj, Int_t ipart);
        TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
-       TObjArray* FindLeadingObjectsK0(TObject *obj);
-       TObjArray* FindLeadingObjectsLambda(TObject *obj);
-       TObjArray* FindLeadingObjectsK0MC(TObject *obj);
-       TObjArray* FindLeadingObjectsLambdaMC(TObject *obj);
+       TObjArray* FindLeadingObjects(TObject *obj);
+       TObjArray* FindLeadingObjectsMC(TObject *obj);
        Int_t  NParticles(TObject* obj);
        Double_t RangePhi(Double_t DPhi);
-       void FillCorrelations(TObjArray* particles, TObjArray* mixed,TH2F*histo);
+       void FillCorrelations(TObjArray* particles, TObjArray* mixed,TH3F*histo,TH3F*leadinfo);
        void QSortTracks(TObjArray &a, Int_t first, Int_t last);
        Bool_t IsAcseptedPrimaryTrack(const AliAODTrack *itrack);
        Bool_t IsAcseptedDaughterTrack(const AliAODTrack *itrack);
        Bool_t IsK0InvMass(const Double_t mass)const;
        Bool_t IsLambdaInvMass(const Double_t mass) const;
-       Bool_t IsTrackNotFromLambda(const Int_t indexTrack);
-       Bool_t IsTrackNotFromK0(const Int_t indexTrack);
+       Bool_t IsTrackNotFromV0(AliAODTrack* track);
        Bool_t IsAcseptedV0(const AliAODEvent*aod,const AliAODv0* aodV0, const AliAODTrack* myTrackPos, const AliAODTrack* myTrackNeg);
-       Double_t IsAccepteddEdx(const Double_t mom, const Double_t dEdx, AliPID::EParticleType n);
 
     
        AliAODEvent              * fAODEvent;        //! AOD Event
        AliEventPoolManager      * fPoolMgr;         //! event pool manager
+       AliEventPoolManager      * fPoolMgrMC;         //! event pool manager
        AliEventPool             * fPoolK0;          //! Pool for event mixing
        AliEventPool             * fPoolLambda;      //! Pool for event mixing
+       AliEventPool             * fPoolK0MC;          //! Pool for event mixing
+       AliEventPool             * fPoolLambdaMC;      //! Pool for event mixing
        AliPIDResponse           * fPIDResponse;     //  PID response
        
        Int_t fPoolMaxNEvents;                       // set maximum number of events in the pool
@@ -109,6 +118,7 @@ private:
        Double_t fCentBins[100];                     // [fNCentBinsDim]
        
        TString         fcollidingSys;               // "PP" or "PbPb"
+       TString         fTriggerMask;                // "Default"
        Double_t        fpvzcut;                     // PVz cut of event
     Double_t           fTrackEtaCut;                // Eta cut on particles
     UInt_t             fFilterBit;                  // Select tracks from an specific track cut (default 0xFF all track selected)
@@ -116,43 +126,31 @@ private:
        Double_t        ftrigPtHigh;
        Double_t        fassocPtLow;
        Double_t        fassocPtHigh;
-       Bool_t           fAnalysisMC;
+       Bool_t          fAnalysisMC;
        TString         fUsePID;
        Double_t        fRapidityCut;                // Rapidity cut V0
        
        
-       //--- 5 Topological Selections
+       //--- 5 Topological Selections And other quality cuts for V0
        Double_t        fCutV0Radius;
        Double_t        fCutDCANegToPV;
        Double_t        fCutDCAPosToPV;
        Double_t        fCutDCAV0Daughters;
        Double_t        fCutV0CosPA;
        Double_t        fSpecialArmenterosCutK0s;
-       
-       //Perform multiplicity selection 
-       // --- (mult estimator in pp, centrality in PbPb)
-       Bool_t fPerformMultiplicityStudy; 
-       Int_t fLoMultBound;
-       Int_t fHiMultBound;
+       Double_t        fCTauK0;
+       Double_t        fCTauLambda;
        
        
        TList       * fOutputList;           // Output list
-       // MC histograms
+       
+       //---------------------MC--------------
        TH1F        *fHistMCPrimaryVertexX;       
        TH1F        *fHistMCPrimaryVertexY;       
-       TH1F        *fHistMCPrimaryVertexZ;  
-       TH2F        *fHistMCtracksProdRadiusK0s;        
-       TH2F        *fHistMCtracksProdRadiusLambda;        
-       TH2F        *fHistMCtracksProdRadiusAntiLambda;
-       TH1F        *fHistMCtracksDecayRadiusK0s;        
-       TH1F        *fHistMCtracksDecayRadiusLambda;        
-       TH1F        *fHistMCtracksDecayRadiusAntiLambda;
+       TH1F        *fHistMCPrimaryVertexZ;                       
        TH1F        *fHistMCPtAllK0s;
        TH1F        *fHistMCPtAllLambda;
        TH1F        *fHistMCPtAllAntiLambda;
-       TH1F        *fHistMCProdRadiusK0s;
-       TH1F        *fHistMCProdRadiusLambda;
-       TH1F        *fHistMCProdRadiusAntiLambda;
        TH1F        *fHistMCRapK0s;                  
        TH1F        *fHistMCRapLambda;
        TH1F        *fHistMCRapAntiLambda;           
@@ -160,103 +158,45 @@ private:
        TH1F        *fHistMCPtLambda;        
        TH1F        *fHistMCPtAntiLambda;
        TH1F        *fHistMCPtLambdaFromSigma;        
-       TH1F        *fHistMCPtAntiLambdaFromSigma; 
-       TH1F        *fHistNTimesRecK0s;        
-       TH1F        *fHistNTimesRecLambda;        
-       TH1F        *fHistNTimesRecAntiLambda;        
-       TH2F        *fHistNTimesRecK0sVsPt;        
-       TH2F        *fHistNTimesRecLambdaVsPt;        
-       TH2F        *fHistNTimesRecAntiLambdaVsPt; 
-       TH1F        *fHistMCDaughterTrack;
+       TH1F        *fHistMCPtAntiLambdaFromSigma;        
        TH2F        *fHistPrimRawPtVsYK0s;
        TH2F        *fHistPrimRawPtVsYLambda;
        TH2F        *fHistPrimRawPtVsYAntiLambda;
-       
+       //-------------------REAL--------------
        TH1F        *fHistPrimaryVertexX;
        TH1F        *fHistPrimaryVertexY;
        TH1F        *fHistPrimaryVertexZ;
-       ///////////////////////////K0s 2D histos: cut vs on fly status/////////////////
-       
-       TH2F        *fHistDcaPosToPrimVertexK0;        
-       TH2F        *fHistDcaNegToPrimVertexK0;        
-       TH2F        *fHistRadiusV0K0;        
-       TH2F        *fHistDecayLengthV0K0;        
-       TH2F        *fHistDcaV0DaughtersK0;        
-       TH2F        *fHistChi2K0;        
-       TH2F        *fHistCosPointAngleK0;        
-       
-       ///////////////////////////K0s 2D histos: cut vs mass//////////////
        TH2F        *fHistDcaPosToPrimVertexK0vsMassK0;   
        TH2F        *fHistDcaNegToPrimVertexK0vsMassK0;   
        TH2F        *fHistRadiusV0K0vsMassK0;             
        TH2F        *fHistDecayLengthV0K0vsMassK0;        
        TH2F        *fHistDcaV0DaughtersK0vsMassK0;       
        TH2F        *fHistCosPointAngleK0vsMassK0;        
-       
-       //////////////////////////Lambda 2D histos: cut vs on fly status////////////////////
-       
-       TH2F        *fHistDcaPosToPrimVertexL;        
-       TH2F        *fHistDcaNegToPrimVertexL;        
-       TH2F        *fHistRadiusV0L;        
-       TH2F        *fHistDecayLengthV0L;        
-       TH2F        *fHistDcaV0DaughtersL;        
-       TH2F        *fHistChi2L;        
-       TH2F        *fHistCosPointAngleL;        
-       TH1F        *fHistcTauL;                   
-       
-       //////////////////////////Lambda 2D histos: cut vs mass////////////////
        TH2F        *fHistDcaPosToPrimVertexLvsMassL;       
        TH2F        *fHistDcaNegToPrimVertexLvsMassL;       
        TH2F        *fHistRadiusV0LvsMassL;                  
        TH2F        *fHistDecayLengthV0LvsMassL;             
        TH2F        *fHistDcaV0DaughtersLvsMassL;          
-       TH2F        *fHistCosPointAngleLvsMassL;             
-       TH3F        *fHistCosPointAngleLVsMassVsPtsigL;     
-       TH3F        *fHistCosPointAngleLVsMassVsPtbackL;     
-       //////////////////////////Lambda 2D histos: cut vs on fly status////////////////////
-       
-       TH2F        *fHistDcaPosToPrimVertexAntiL;        
-       TH2F        *fHistDcaNegToPrimVertexAntiL;        
-       TH2F        *fHistRadiusV0AntiL;        
-       TH2F        *fHistDecayLengthV0AntiL;        
-       TH2F        *fHistDcaV0DaughtersAntiL;        
-       TH2F        *fHistChi2AntiL;        
-       TH2F        *fHistCosPointAngleAntiL;           
-       
-       //////////////////////////AntiLambda 2D histos: cut vs mass////////////////
+       TH2F        *fHistCosPointAngleLvsMassL;                
        TH2F        *fHistDcaPosToPrimVertexAntiLvsMass;       
        TH2F        *fHistDcaNegToPrimVertexAntiLvsMass;       
        TH2F        *fHistRadiusV0AntiLvsMass;                  
        TH2F        *fHistDecayLengthV0AntiLvsMass;             
        TH2F        *fHistDcaV0DaughtersAntiLvsMass;          
        TH2F        *fHistCosPointAngleAntiLvsMass;             
-       ////////////////////////////////////////////////////////////////////// 
        TH1F        *fHistMassK0;        
        TH1F        *fHistMassLambda;        
-       TH1F        *fHistMassAntiLambda;        
-       TH2F        *fHistMassVsRadiusK0;        
-       TH2F        *fHistMassVsRadiusLambda;        
-       TH2F        *fHistMassVsRadiusAntiLambda;        
-       ////////////////////////////////////////////////////////////////////////////
+       TH1F        *fHistMassAntiLambda;                
        TH2F        *fHistPtVsMassK0;        
        TH2F        *fHistPtVsMassLambda;        
-       TH2F        *fHistPtVsMassAntiLambda;        
-       TH2F        *fHistArmenterosPodolanski;                       
-       
-       //PID
-       TH1F        *fHistNsigmaPosProtonLambda;         
-       TH1F        *fHistNsigmaNegPionLambda;            
-       TH1F        *fHistNsigmaPosProtonAntiLambda;         
-       TH1F        *fHistNsigmaNegPionAntiLambda;            
-       TH1F        *fHistNsigmaPosPionK0;                 
-       TH1F        *fHistNsigmaNegPionK0;                  
-       
-       // Associated particles histograms       
-       ////////////////////////////////////////////////////////////////////
+       TH2F        *fHistPtVsMassAntiLambda;
+       TH2F        *fHistArmenterosPodolanskiK0; 
+       TH2F        *fHistArmenterosPodolanskiLambda;
+       TH2F        *fHistArmenterosPodolanskiAntiLambda;
+       //-----------Associated----------------       
        TH1F        *fHistAsMcPtK0;        
        TH1F        *fHistAsMcPtLambda;        
        TH1F        *fHistAsMcPtAntiLambda;        
-       /////////////////////////////////////////////////////////////////////       
        TH1F        *fHistAsMcProdRadiusK0;        
        TH1F        *fHistAsMcProdRadiusLambda;        
        TH1F        *fHistAsMcProdRadiusAntiLambda;        
@@ -265,43 +205,9 @@ private:
        TH2F        *fHistAsMcProdRadiusXvsYAntiLambda;        
        TH1F        *fHistPidMcMassK0;        
        TH1F        *fHistPidMcMassLambda;        
-       TH1F        *fHistPidMcMassAntiLambda;        
-       TH1F        *fHistAsMcMassK0;        
-       TH1F        *fHistAsMcMassLambda;        
-       TH1F        *fHistAsMcMassAntiLambda;        
-       TH2F        *fHistAsMcPtVsMassK0;        
-       TH2F        *fHistAsMcPtVsMassLambda;        
-       TH2F        *fHistAsMcPtVsMassAntiLambda;        
-       TH2F        *fHistAsMcMassVsRadiusK0;        
-       TH2F        *fHistAsMcMassVsRadiusLambda;        
-       TH2F        *fHistAsMcMassVsRadiusAntiLambda;        
-       TH1F        *fHistAsMcResxK0;        
-       TH1F        *fHistAsMcResyK0;        
-       TH1F        *fHistAsMcReszK0;        
-       TH2F        *fHistAsMcResrVsRadiusK0;        
-       TH2F        *fHistAsMcReszVsRadiusK0;        
-       TH1F        *fHistAsMcResxLambda;        
-       TH1F        *fHistAsMcResyLambda;        
-       TH1F        *fHistAsMcReszLambda;        
-       TH2F        *fHistAsMcResrVsRadiusLambda;        
-       TH2F        *fHistAsMcReszVsRadiusLambda;        
-       TH1F        *fHistAsMcResxAntiLambda;        
-       TH1F        *fHistAsMcResyAntiLambda;        
-       TH1F        *fHistAsMcReszAntiLambda;        
-       TH2F        *fHistAsMcResrVsRadiusAntiLambda;        
-       TH2F        *fHistAsMcReszVsRadiusAntiLambda;        
-       TH1F        *fHistAsMcResPtK0;        
-       TH1F        *fHistAsMcResPtLambda;        
-       TH1F        *fHistAsMcResPtAntiLambda;        
-       TH2F        *fHistAsMcResPtVsRapK0;        
-       TH2F        *fHistAsMcResPtVsRapLambda;        
-       TH2F        *fHistAsMcResPtVsRapAntiLambda;        
-       TH2F        *fHistAsMcResPtVsPtK0;        
-       TH2F        *fHistAsMcResPtVsPtLambda;        
-       TH2F        *fHistAsMcResPtVsPtAntiLambda;        
+       TH1F        *fHistPidMcMassAntiLambda;                             
        TH1F        *fHistAsMcPtLambdaFromSigma;        
        TH1F        *fHistAsMcPtAntiLambdaFromSigma;        
-       // Associated secondary particles:
        TH2F        *fHistAsMcSecondaryPtVsRapK0s;        
        TH2F        *fHistAsMcSecondaryPtVsRapLambda;        
        TH2F        *fHistAsMcSecondaryPtVsRapAntiLambda;        
@@ -313,16 +219,19 @@ private:
        TH2F        *fHistAsMcSecondaryProdRadiusXvsYAntiLambda;        
        TH1F        *fHistAsMcSecondaryPtLambdaFromSigma;        
        TH1F        *fHistAsMcSecondaryPtAntiLambdaFromSigma;        
-       
-       TH2F        * fHistSibK0;
-       TH2F        * fHistMixK0;
-       TH2F        * fHistSibLambda;
-       TH2F        * fHistMixLambda;
-       
-       TH2F        * fHistSibK0MC;
-       TH2F        * fHistMixK0MC;
-       TH2F        * fHistSibLambdaMC;
-       TH2F        * fHistMixLambdaMC;
+       //-----------Correlation----------------
+       TH3F        * fHistSibK0;
+       TH3F        * fHistMixK0;
+       TH3F        * fHistSibLambda;
+       TH3F        * fHistMixLambda;
+       TH3F        * fHistSibK0MC;
+       TH3F        * fHistMixK0MC;
+       TH3F        * fHistSibLambdaMC;
+       TH3F        * fHistMixLambdaMC;
+       TH3F        * fHistLeadInfo;
+       TH3F        * fHistLeadInfoMC;
+       TH3F        * fHistLeadInfoMix;
+       TH3F        * fHistLeadInfoMixMC;
        
        ClassDef(AliLeadingV0Correlation, 1); 
 };
@@ -366,7 +275,6 @@ class AliLeadingBasicParticle : public AliVParticle
     virtual Int_t   PdgCode()     const { AliFatal("Not implemented"); return 0; }
     virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
        
-
   private:
     Float_t fEta;      // eta
     Float_t fPhi;      // phi
index bff1273..e604c4b 100644 (file)
@@ -1,15 +1,24 @@
-AliLeadingV0Correlation* AddTaskLV0Correlation(TString fListName                = "LV0Correlation",
-                                              TString fCollisiontype           = "PbPb",
-                                              Bool_t  fAnalysisMC              = 0,
+AliLeadingV0Correlation* AddTaskLV0Correlation(TString fListName = "LV0Correlation",
+                                              TString  fCollisiontype           = "PbPb",
+                                                  TString      fTriggerMask             = "kMB",
+                                                  TString  fwithPID                 = "withPID",
+                                              Bool_t   fAnalysisMC              = 0,
                                               Double_t aPVzCut                  = 10,
                                               UInt_t   aFilterBit               = 128,
+                                                  Double_t aRapidityCut             = 0.75,
+                                                  Double_t aEtaCut                  = 0.9,
                                               Double_t aCutV0Radius             = 0.5,
                                               Double_t aCutDCANegToPV           = 0.06,
                                               Double_t aCutDCAPosToPV           = 0.06,
                                               Double_t aCutDCAV0Daughters       = 1.0,
                                               Double_t aCutV0CosPA              = 0.995,
-                                              Double_t aSpecialArmenterosCutK0s = 5
-                                              ) 
+                                              Double_t aSpecialArmenterosCutK0s = 5,
+                                                  Double_t aCTauK0                  = 20,
+                                                  Double_t aCTauLambda              = 30,
+                                                  Int_t    fmaxEventsinPool         = 2000,
+                                                  Int_t    fmaxTracksinPool         = 1000,
+                                                  Double_t  aTrigLow                = 6,
+                                                  Double_t  aTrigHigh               = 12) 
 {
        // Get the current analysis manager.
     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -20,35 +29,40 @@ AliLeadingV0Correlation* AddTaskLV0Correlation(TString fListName
        Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
        
        //Cent(PbPb) or Mult(PP) Binning for pool       
-       Double_t cent_mult_binlimits[] = {0,20,40,60,80,100}; 
+       Double_t cent_mult_binlimits[] = {0,10,20,30,40,50,60,70,80,90,100}; 
        Int_t cent_mult_bin_numb = sizeof(cent_mult_binlimits)/sizeof(Double_t) - 1;
 
        //Correlation task
        AliLeadingV0Correlation *myTask = new AliLeadingV0Correlation(fListName.Data());
        
        myTask->SetCollidingSystem(fCollisiontype);
+       myTask->SetTrigger(fTriggerMask);
        myTask->SetMCAnalysis(fAnalysisMC);
-       myTask->SetMaxNEventsInPool(2000);
-       myTask->SetMinNTracksInPool(1000);
+       myTask->SetMaxNEventsInPool(fmaxEventsinPool);
+       myTask->SetMinNTracksInPool(fmaxTracksinPool);
        myTask->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);
        myTask->SetPoolCentBinLimits(cent_mult_bin_numb,cent_mult_binlimits);
        myTask->SetPrimeryVertexCut(aPVzCut);
-       myTask->SetEatCut(0.9);
+       myTask->SetEatCut(aEtaCut);
        myTask->SetFilterBit(aFilterBit);
-       myTask->SetTrigPtBinLimits(6.0,12.0);
-       myTask->SetAssocPtBinLimits(0.15,6.0);
+       myTask->SetTrigPtBinLimits(aTrigLow,aTrigHigh);
+       myTask->SetAssocPtBinLimits(0.15,aTrigLow);
        myTask->SetCutV0Radius(aCutV0Radius);
        myTask->SetCutDCANToP(aCutDCANegToPV);
        myTask->SetCutDCAPToP(aCutDCAPosToPV);
        myTask->SetCutDCADaughters(aCutDCAV0Daughters);
        myTask->SetCutCPA(aCutV0CosPA);
        myTask->SetCutArmenterosK0s(aSpecialArmenterosCutK0s);
+       myTask->SetCutCTauK0(aCTauK0);
+       myTask->SetCutCTauLambda(aCTauLambda);
+       myTask->SetUSEPID(fwithPID);
+       myTask->SetCutRap(aRapidityCut);
        
        mgr->AddTask(myTask);
        
        // Create containers for input/output
        TString outputFileName = AliAnalysisManager::GetCommonFileName();
-       AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+       AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
        AliAnalysisDataContainer *coutput = mgr->CreateContainer(fListName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName);
        
        //____________________________________________//