Commit for Simone
authorbdoenigu <bdoenigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Nov 2013 21:55:50 +0000 (21:55 +0000)
committerbdoenigu <bdoenigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Nov 2013 21:55:50 +0000 (21:55 +0000)
PWGLF/STRANGENESS/LambdaK0PbPb/AddTaskV0ForRAA.C
PWGLF/STRANGENESS/LambdaK0PbPb/AliAnalysisTaskV0ForRAA.cxx
PWGLF/STRANGENESS/LambdaK0PbPb/AliAnalysisTaskV0ForRAA.h

index 4a6d7a4..cdc250a 100644 (file)
@@ -65,44 +65,87 @@ AliAnalysisTaskV0ForRAA *AddTaskV0ForRAA(Bool_t anaPP=kFALSE, Int_t cent=0,Int_t
    
    AliAnalysisTaskV0ForRAA *task = new AliAnalysisTaskV0ForRAA(taskname);
 
-   Double_t minPt=0.0;//15;
+   Double_t minPt=0.0;
    
    //--- esd track cuts V0 daughters ---//
-  
+   // esd track cuts for pions high pt
    AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts(cutsname);
-   //    esdTrackCuts->SetMinNClustersTPC(70);
    esdTrackCuts->SetMaxChi2PerClusterTPC(4);
    esdTrackCuts->SetMinNCrossedRowsTPC(70);
-   esdTrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
-   
    esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
    esdTrackCuts->SetRequireTPCRefit(kTRUE);
    esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-   
-   //esdTrackCuts->SetEtaRange(-0.9,+0.9);
-   task->SetESDTrackCuts(esdTrackCuts);
 
+   // esd track cuts for protons high pt
+   TString cutsnameCh = cutsname;
+   cutsnameCh +="_charged";
+   AliESDtrackCuts* esdTrackCutsCharged = new AliESDtrackCuts(cutsnameCh);
+   esdTrackCutsCharged->SetMaxChi2PerClusterTPC(4);
+   esdTrackCutsCharged->SetMinNCrossedRowsTPC(70);
+   esdTrackCutsCharged->SetAcceptKinkDaughters(kFALSE);
+   esdTrackCutsCharged->SetRequireTPCRefit(kTRUE);
+   esdTrackCutsCharged->SetRequireSigmaToVertex(kFALSE);
+
+   // esd track cuts for all low pt
+   TString cutsnameLowPt  = cutsname;
+   cutsnameLowPt +="_lowpt";
+   AliESDtrackCuts* esdTrackCutsLowPt = new AliESDtrackCuts(cutsnameLowPt);
+   esdTrackCutsLowPt->SetMaxChi2PerClusterTPC(4);
+   esdTrackCutsLowPt->SetMinNCrossedRowsTPC(70);
+   esdTrackCutsLowPt->SetAcceptKinkDaughters(kFALSE);
+   esdTrackCutsLowPt->SetRequireTPCRefit(kTRUE);
+   esdTrackCutsLowPt->SetRequireSigmaToVertex(kFALSE);
+
+   //Add cuts to task
+   task->SetESDTrackCutsCharged(esdTrackCutsCharged);
+   task->SetESDTrackCuts(esdTrackCuts);
+   task->SetESDTrackCutsLowPt(esdTrackCutsLowPt);
 
    //--- analysis modes ---//
    task->SetAnapp(anaPP);
    task->SetMCMode(mcMode);
    task->SetMCTruthMode(mcTruthMode);
-   
-   //--- general cuts ---//
+
+   //---------- cuts -------------//
+   //general cuts
    task->SetUseOnthefly(onFly);
-   task->SetUsePID(usePID,4.0,2100.0);
+   task->SetUsePID(usePID,3.0,100.0);
    task->SetPrimVertexZCut(10.0,kTRUE);
-   task->SetCosOfPointingAngleK(0.99,1000.0);
-   task->SetCosOfPointingAngleL(0.99,1000.0);
+   //rapidity
    task->SetRapidityCutMother(kTRUE,0.5);
    task->SetDoEtaOfMCDaughtersCut(mcEtaCut,etaCut);
    
+   //TPC cuts
+   task->SetCutMoreNclsThanRows(kTRUE);
+   task->SetCutMoreNclsThanFindable(kTRUE);
+   task->SetLowPtTPCCutAliESDTrackCut(-1.0);
+   task->SetRatioFoundOverFindable(0.5);
+
+   //V0 specific cuts
+   task->SetCosOfPointingAngleK(0.99,1000.0);
+   task->SetCosOfPointingAngleL(0.998,1000.0);
+
+   task->SetCtauCut(5.0,6.0,0.3,2.0);
+
+   task->SetArmenterosCutQt(-1.0,100.0,kTRUE,kFALSE);
+   
+   task->SetDCAV0ToVertexK0(0.4);
+   task->SetDCAV0ToVertexL(1.2);
+
+   task->SetDCADaughtersK0(0.23);
+   task->SetDCADaughtersL(0.35);
+   task->SetDCADaughtersAL(0.35);
+   
+   task->SetDecayRadiusXYMinMax(5.0,1000.0);
+
+   
    //--- centrality ---//
-   task->SetUseCentrality(centDet);     // 0=off, 1=VZERO, 2=SPD
-   task->SetUseCentralityBin(cent);     // Bin to be used 0,5,10,20,30,40,50,60,70,80,90,(100=SPDonly)
-   task->SetUseCentralityRange(centRange);
+   task->SetUseCentrality(centDet);        // 0=off, 1=VZERO, 2=SPD
+   task->SetUseCentralityBin(cent);        // bin to be used 0,5,10,20,30,40,50,60,70,80,90,(100=SPDonly)
+   task->SetUseCentralityRange(centRange); // add centrality bin for increasing original bin range. For cent 60-80%: cent = 60 and centRange = 10
    
-   task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral );
+   task->SelectCollisionCandidates(AliVEvent::kMB);// | AliVEvent::kCentral | AliVEvent::kSemiCentral );
    
    mgr->AddTask(task);
  
index 472b2fb..be0dcc5 100644 (file)
-/***************************************************************          *\r
- * Authors : Simone Schuchmann \r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-//-----------------------------------------------------------------\r
-// AliAnalysisTaskV0ForRAA class\r
-// This task is for analysing Lambda and K0s pt spectra in PbPb and\r
-// pp as well as with MC. The flag for pp and MC  must be set\r
-// accordingly, default is PbPb data.\r
-// It works with ESD files only.\r
-//-----------------------------------------------------------------\r
-\r
-\r
-#define AliAnalysisTaskV0ForRAA_cxx\r
-\r
-#include "AliAnalysisTaskV0ForRAA.h"\r
-\r
-#include "Riostream.h"\r
-\r
-#include "TROOT.h"\r
-#include "TH1.h"\r
-#include "TH2.h"\r
-#include "TLorentzVector.h"\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-#include "AliAnalysisManager.h"\r
-#include "AliESDInputHandler.h"\r
-#include "AliMCEventHandler.h"\r
-\r
-#include "AliESDVZERO.h"\r
-#include "AliMultiplicity.h"\r
-#include "AliCentrality.h"\r
-\r
-#include "AliKFParticle.h"\r
-#include "AliKFVertex.h"\r
-#include "AliESDtrackCuts.h"\r
-#include "AliESDpid.h"\r
-#include "AliESDv0.h"\r
-#include "AliESDEvent.h"\r
-#include "AliMCEvent.h"\r
-#include "AliStack.h"\r
-#include "AliGenEventHeader.h"\r
-\r
-\r
-\r
-ClassImp(AliAnalysisTaskV0ForRAA)\r
-\r
-//________________________________________________________________________\r
-AliAnalysisTaskV0ForRAA::AliAnalysisTaskV0ForRAA(const char *name)\r
-:AliAnalysisTaskSE(name),\r
-  fESD(0),\r
-  fMCev(0),\r
-//other objects\r
-  fESDpid(0),\r
-  fESDTrackCuts(0),\r
-  fESDTrackCutsCharged(0),\r
-  fOutputContainer(0),\r
-//event histos\r
-  fHistNEvents(0),  \r
-  fHistMuliplicity(0),\r
-  fHistMuliplicityRaw(0),\r
-  fHistMultiplicityPrimary(0),\r
-  fHistESDVertexZ(0),\r
-  fHistPrimVtxZESD(0),\r
-  fHistPrimVtxZESDVSNContributors(0),\r
-  fHistNPrim(0),\r
-  fHistITSLayerHits(0),\r
-  fHistOneHitWithSDD(0),\r
-  fHistPrimVtxZESDTPC(0),\r
-  fHistPrimVtxZESDSPD(0),  \r
-  fHistPrimVtxZESDTPCVSNContributors(0),\r
-  fHistPrimVtxZESDSPDVSNContributors(0),\r
-  fHistCentBinRaw(0),\r
-  fHistCentBin(0),\r
-  fHistPrimVtxZESDVSNContributorsMC(0),\r
-  fHistPrimVtxZESDTPCVSNContributorsMC(0),\r
-  fHistPrimVtxZESDSPDVSNContributorsMC(0),\r
-  fHistMCVertexZ(0),\r
-//MC pdg code histos\r
-  fHistPiPiPDGCode(0),\r
-  fHistPiPPDGCode(0),\r
-  fHistPiAPPDGCode(0),\r
-//cosine of pointing angle of Xi vs pt histos\r
-  fHistPiPCosPointAngXiVsPt(0),\r
-  fHistPiAPCosPointAngXiVsPt(0),\r
-// fHistUserPtShift(0),\r
-//selection booleans and values\r
-  fMCMode(0),\r
-  fMCTruthMode(0),\r
-  fSelectInjected(0),\r
-  fUseCentrality(0),\r
-  fUseCentralityBin(0),\r
-  fUseCentralityRange(0),\r
-  fAnapp(0),\r
-  fSelSDD(0),\r
-  fOntheFly(0),\r
-  fVertexZCut(0),\r
-  fVtxStatus(0),\r
-  fUsePID(0),\r
-  fNSigma(0),\r
-  fPPIDcut(0),\r
-  fMoreNclsThanRows(0),\r
-  fMoreNclsThanFindable(0),\r
-  fChi2PerClusterITS(0),\r
-  fRapCutV0(0),\r
-  fRap(0),\r
-  fEtaCutMCDaughters(0),\r
-  fEtaCutMCDaughtersVal(0),\r
-  fMinPt(0),\r
-  fAlfaCut(0),\r
-  fQtCut(0),\r
-  fQtCutPtLow(0),\r
-  fArmCutK0(0),      \r
-  fArmCutL(0),  \r
-  fDCAToVertexK0(0),\r
-  fDCAToVertexL(0),\r
-  fDCAXK(0),\r
-  fDCAYK(0),\r
-  fDCAXL(0),\r
-  fDCAYL(0),\r
-  fDCAZ(0),\r
-  fDCADaughtersL(0),\r
-  fDCADaughtersAL(0),\r
-  fDCADaughtersK0(0),\r
-  fDCADaughtersToVtxLarge(0),\r
-  fDCADaughtersToVtxSmall(0),\r
-  fDecayRadXYMin(0),\r
-  fDecayRadXYMax(0),\r
-  fCosPointAngL(0),\r
-  fCosPointAngK(0),\r
-  fCPAPtCutK0(0),\r
-  fCPAPtCutL(0),\r
-  fOpengAngleDaughters(0),\r
-  fOpAngPtCut(0),\r
-  fDecayLengthMax(0),\r
-  fDecayLengthMin(0),\r
-  fCtauK0s(0),\r
-  fCtauL(0),\r
-  fCtauPtCutK0(0),\r
-  fCtauPtCutL(0),\r
-  fChiCutKf(0)                                //  fShift(0),\r
-  // fDeltaInvP(0)\r
-{  // Constructor.\r
-\r
-  DefineOutput(1,TList::Class());\r
-\r
-  // define defaults for globals\r
-  /*\r
-    fShift = kFALSE;                       // shift in charge/pt yes/no\r
-    fDeltaInvP = 0.00;                     // shift value\r
-  */\r
-   \r
-  fMCMode = kFALSE;\r
-  fMCTruthMode = kFALSE;\r
-\r
-  fUseCentrality = 0;\r
-  fUseCentralityBin = 0;\r
-  fUseCentralityRange =0;\r
-\r
-  fAnapp = kFALSE;\r
-  fSelSDD = kFALSE;\r
-\r
-  fSelectInjected = kFALSE;\r
-\r
-  fVertexZCut = 100000.0;\r
-  fVtxStatus = kFALSE;\r
-   \r
-  fOntheFly = kTRUE;\r
-\r
-  //----- define defaults for V0 and track cuts ----//\r
-  fUsePID = kFALSE;\r
-  fMoreNclsThanRows = kFALSE;\r
-  fMoreNclsThanFindable = kFALSE;\r
-  fChi2PerClusterITS = 100000.0;\r
-  fNSigma = 100000.0;\r
-  fPPIDcut = 100.0;\r
-\r
-  fRapCutV0=kFALSE;\r
-  fRap=1000.0;\r
-  fRap=1000.0;\r
-\r
-  fAlfaCut= -100.0;\r
-  fQtCut = 100.0;\r
-  fQtCutPtLow = -1.0;\r
-  fArmCutK0=kFALSE;     \r
-  fArmCutL=kFALSE;  \r
-\r
-  fEtaCutMCDaughters = kFALSE;\r
-  fEtaCutMCDaughtersVal = 50.0;\r
-\r
-  fMinPt= -1.0;\r
-\r
-  fDCAToVertexK0 = 10000.0;\r
-  fDCAToVertexL = 10000.0;\r
-  fDCAXK=10000.0;\r
-  fDCAYK=10000.0;\r
-  fDCAXL=10000.0;\r
-  fDCAYL=10000.0;\r
-  fDCAZ=10000.0;\r
-   \r
-  fDCADaughtersL=10000.0;\r
-  fDCADaughtersAL=10000.0;\r
-  fDCADaughtersK0=10000.0;\r
-\r
-  fDCADaughtersToVtxLarge=-1.0;\r
-  fDCADaughtersToVtxSmall=-1.0;\r
-\r
-  fDecayRadXYMin=-1.0;\r
-  fDecayRadXYMax=1000000.0;\r
-  fDecayLengthMax=100000.0;\r
-  fDecayLengthMin=-1.0;\r
-   \r
-  fCosPointAngL=-1.0;\r
-  fCosPointAngK=-1.0;\r
-  fCPAPtCutK0 = 1000.0;\r
-  fCPAPtCutL =1000.0;\r
-  fOpengAngleDaughters = -1.0;\r
-  fOpAngPtCut = -1.0;\r
-      \r
-  fCtauK0s=10000.0;\r
-  fCtauL=10000.0;\r
-  fCtauPtCutK0=1000.0;\r
-  fCtauPtCutL=10000.0;\r
-\r
-  fChiCutKf=1000000.0;\r
-\r
-   \r
-  //---- histograms ----//\r
-  for(Int_t j=0;j<2;j++){\r
-    fHistV0RadiusZ[j] =NULL;\r
-    fHistV0RadiusZVSPt[j] =NULL;\r
-    fHistV0RadiusXY[j] =NULL;\r
-    fHistV0RadiusXYVSY[j] =NULL;\r
-    fHistArmenteros[j]=NULL;\r
\r
-    //K0\r
-    fHistPiPiMass[j]=NULL;\r
-    fHistPiPiMassVSPt[j]=NULL;\r
-    fHistPiPiMassVSPtMCTruth[j]=NULL;\r
-    fHistPiPiPtVSY[j]=NULL;\r
-    // fHistPiPiMassVSAlpha[j]=NULL;\r
-    fHistPiPiDecayLengthVsPt[j]=NULL;\r
-    fHistPiPiMonitorCuts[j] =NULL;\r
-      \r
-    //Lambda\r
-    fHistPiPMass[j]=NULL;\r
-    fHistPiPMassVSPt[j]=NULL;\r
-    fHistPiPMassVSPtMCTruth[j]=NULL;\r
-    fHistPiPPtVSY[j]=NULL;\r
-    fHistPiPDecayLengthVsPt[j]=NULL;\r
-    fHistPiPMonitorCuts[j] =NULL;\r
-    //ALambda\r
-    fHistPiAPMass[j]=NULL;\r
-    fHistPiAPMassVSPt[j]=NULL;\r
-    fHistPiAPMassVSPtMCTruth[j]=NULL;\r
-    fHistPiAPPtVSY[j]=NULL;\r
-    fHistPiAPDecayLengthVsPt[j]=NULL;\r
-    fHistPiAPMonitorCuts[j] =NULL;\r
-\r
-    //eta daughters reco\r
-    fHistPiPiEtaDReco[j] = NULL;\r
-    fHistPiPEtaDReco[j] = NULL;      \r
-\r
-    //K0s\r
-    fHistPiPiDCADaughters[j]=NULL; \r
-    fHistPiPiDCADaughterPosToPrimVtxVSMass[j]=NULL;\r
-    // fHistPiPiMassVSPtK0L[j]=NULL;\r
-    fHistPiPiDCAVSMass[j]=NULL;\r
-    fHistPiPiCosPointAng[j]=NULL;\r
-    fHistPiPiDecayLengthVsMass[j]=NULL;\r
-    fHistPiPiRadiusXY[j]=NULL;\r
-\r
-\r
-    //Lambda\r
-    fHistPiPDCADaughters[j]=NULL;\r
-    fHistPiPDCADaughterPosToPrimVtxVSMass[j]=NULL;\r
-    fHistPiPDCAVSMass[j]=NULL;\r
-    fHistPiPCosPointAng[j]=NULL;\r
-    fHistPiPDecayLengthVsMass[j]=NULL;\r
-    fHistPiPRadiusXY[j]=NULL;   \r
-    //ALambda\r
-    fHistPiAPDCADaughters[j]=NULL;\r
-    fHistPiAPDCADaughterPosToPrimVtxVSMass[j]=NULL;\r
-    fHistPiAPDCAVSMass[j]=NULL;\r
-    fHistPiAPCosPointAng[j]=NULL;\r
-    fHistPiAPDecayLengthVsMass[j]=NULL;\r
-    fHistPiAPRadiusXY[j]=NULL;\r
-\r
-    //other \r
-    fHistDedxSecProt[j]=NULL;\r
-    fHistDedxSecPiPlus[j]=NULL;\r
-    fHistDedxSecAProt[j]=NULL;\r
-    fHistDedxSecPiMinus[j]=NULL;\r
-\r
-    fHistNclsITSPosK0[j]=NULL;\r
-    fHistNclsITSNegK0[j]=NULL;\r
-    fHistNclsTPCPosK0[j]=NULL;\r
-    fHistNclsTPCNegK0[j]=NULL;\r
-    fHistChi2PerNclsITSPosK0[j]=NULL;\r
-    fHistChi2PerNclsITSNegK0[j]=NULL;\r
-\r
-    fHistNclsITSPosL[j]=NULL;\r
-    fHistNclsITSNegL[j]=NULL;\r
-    fHistNclsTPCPosL[j]=NULL;\r
-    fHistNclsTPCNegL[j]=NULL;\r
-    fHistChi2PerNclsITSPosL[j]=NULL;\r
-    fHistChi2PerNclsITSNegL[j]=NULL;\r
-\r
-    fHistNclsITSPos[j]=NULL;\r
-    fHistNclsITSNeg[j]=NULL;\r
-    fHistNclsTPCPos[j]=NULL;\r
-    fHistNclsTPCNeg[j]=NULL;\r
-    fHistChi2PerNclsITSPos[j]=NULL;\r
-    fHistChi2PerNclsITSNeg[j]=NULL;\r
-    fHistNclsITS[j]=NULL;\r
-    fHistNclsTPC[j]=NULL;\r
-    fHistNCRowsTPCPos[j]=NULL;\r
-    fHistNCRowsTPCNeg[j]=NULL;\r
-      \r
-    // eta daughters MC\r
-    fHistPiPiEtaDMC[j] = NULL;\r
-    fHistPiPEtaDMC[j] = NULL;      \r
-\r
-    //Lambda sec      \r
-    fHistPiPMassVSPtSecSigma[j]=NULL;\r
-    fHistPiPMassVSPtSecXi[j]=NULL;\r
-    fHistPiPMassVSYSecXi[j]=NULL;\r
-    fHistPiPXi0PtVSLambdaPt[j]=NULL;\r
-    fHistPiPXiMinusPtVSLambdaPt[j]=NULL;\r
-      \r
-    //ALambda sec\r
-    fHistPiAPMassVSPtSecSigma[j]=NULL;\r
-    fHistPiAPMassVSPtSecXi[j]=NULL;\r
-    fHistPiAPMassVSYSecXi[j]=NULL;\r
-    fHistPiAPXi0PtVSLambdaPt[j]=NULL;\r
-    fHistPiAPXiMinusPtVSLambdaPt[j]=NULL;\r
-\r
-  }\r
-   \r
-}\r
-//_____________________________________________________\r
-AliAnalysisTaskV0ForRAA::~AliAnalysisTaskV0ForRAA()\r
-{\r
-  //---- Remove all pointers ----//\r
-  if(fOutputContainer) delete fOutputContainer;fOutputContainer=0;\r
-  if(fESDTrackCuts) delete fESDTrackCuts;fESDTrackCuts=0;\r
-  if(fESDTrackCutsCharged) delete fESDTrackCutsCharged;fESDTrackCutsCharged=0;\r
-\r
-}\r
-//________________________________________________________________________\r
-void AliAnalysisTaskV0ForRAA::UserCreateOutputObjects(){\r
-  //create output objects\r
-\r
-  Int_t nbPt=800;\r
-  Int_t nbMass=500;\r
-\r
-   \r
-  //-----------------  create output container -----------------//\r
-\r
-  fOutputContainer = new TList() ;\r
-  fOutputContainer->SetName(GetName()) ;\r
-  fOutputContainer->SetOwner();\r
\r
-\r
-  //------------ create allways -----------------------//\r
-  fHistNEvents = new TH1F("fHistNEvents","no of events before cuts =0, after cuts=1, after process =2",5,0.0,5.0);\r
-  fOutputContainer->Add(fHistNEvents);\r
-      \r
-  fHistMuliplicity =  new TH1F("fHistMuliplicity","V0 multiplicity",3000,0.0,30000);\r
-  fOutputContainer->Add(fHistMuliplicity);\r
-      \r
-  fHistMuliplicityRaw =  new TH1F("fHistMuliplicityRaw","V0 multiplicity before process",3000,0.0,30000);      \r
-  fOutputContainer->Add(fHistMuliplicityRaw);\r
-      \r
-  fHistMultiplicityPrimary = new TH1F("fHistMultiplicityPrimary","number of charged tracks",5000,0.0,20000);\r
-  fOutputContainer->Add(fHistMultiplicityPrimary);\r
-      \r
-  fHistESDVertexZ= new TH1F("fHistESDVertexZ"," z vertex distr in cm",500,-50,50);\r
-  fOutputContainer->Add(fHistESDVertexZ);\r
-   \r
-  fHistPrimVtxZESD = new TH1F("fHistPrimVtxZESD","z vertex pos ESD",250,-50,50);\r
-  fOutputContainer->Add(fHistPrimVtxZESD);\r
-      \r
-  fHistPrimVtxZESDVSNContributors = new TH2F("fHistPrimVtxZESDVSNContributors","prim vtx pos z ESD vs no. of contributers TPC",250,-50,50,500,0.0,500.0);\r
-  fOutputContainer->Add(fHistPrimVtxZESDVSNContributors);\r
-      \r
-  fHistNPrim = new TH1F("fHistNPrim","Number of contributers to vertex",2500,0.0,5000);\r
-  fOutputContainer->Add(fHistNPrim);\r
\r
-  //------------------------ pp analysis only -------------------------//\r
-  if(fAnapp){\r
-    fHistITSLayerHits = new TH1F("fHistITSLayerHits","SDD layer -1=0,1=1,2=2 ... 5=5,0=nothing",7,-1.5,5.5);\r
-    fOutputContainer->Add(fHistITSLayerHits);\r
-    fHistOneHitWithSDD = new TH1F("fHistOneHitWithSDD","min one hit in SDD",2,-0.5,1.5);\r
-    fOutputContainer->Add(fHistOneHitWithSDD);\r
-    fHistPrimVtxZESDTPC = new TH1F("fHistPrimVtxZESDTPC","z vertex pos TPC",250,-50,50);\r
-    fOutputContainer->Add(fHistPrimVtxZESDTPC);\r
-    fHistPrimVtxZESDSPD = new TH1F("fHistPrimVtxZESDSPD","z vertex pos SPD",250,-50,50);\r
-    fOutputContainer->Add(fHistPrimVtxZESDSPD);  \r
-    fHistPrimVtxZESDTPCVSNContributors = new TH2F("fHistPrimVtxZESDTPCVSNContributors","prim vtx pos z TPC vs no. of contributers TPC",250,-50,50,500,0.0,500.0);\r
-    fOutputContainer->Add(fHistPrimVtxZESDTPCVSNContributors);\r
-    fHistPrimVtxZESDSPDVSNContributors = new TH2F("fHistPrimVtxZESDSPDVSNContributors","prim vtx pos z SPD vs no. of contributers TPC",250,-50,50,500,0.0,500.0);\r
-    fOutputContainer->Add(fHistPrimVtxZESDSPDVSNContributors);\r
-\r
-  }\r
-  else {\r
-    Double_t binsCent[12]={0.0,5.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0};\r
-    fHistCentBinRaw = new TH1F("fHistCentBinRaw","centrality bin before cent selection",11,binsCent);\r
-    fOutputContainer->Add(fHistCentBinRaw);\r
-    fHistCentBin = new TH1F("fHistCentBin","centrality bin",11,binsCent);\r
-    fOutputContainer->Add(fHistCentBin);\r
-      \r
-  }\r
-   \r
-\r
-   \r
-  fHistPrimVtxZESDVSNContributorsMC = new TH2F("fHistPrimVtxZESDVSNContributorsMC","prim vtx pos z ESD vs no. of contributers MC",250,-50,50,500,0.0,500.0);\r
-  fOutputContainer->Add(fHistPrimVtxZESDVSNContributorsMC);\r
-  fHistPrimVtxZESDTPCVSNContributorsMC = new TH2F("fHistPrimVtxZESDTPCVSNContributorsMC","prim vtx pos z TPC vs no. of contributers MC",250,-50,50,500,0.0,500.0);\r
-  fOutputContainer->Add(fHistPrimVtxZESDTPCVSNContributorsMC);\r
-  fHistPrimVtxZESDSPDVSNContributorsMC = new TH2F("fHistPrimVtxZESDSPDVSNContributorsMC","prim vtx pos z SPD vs no. of contributers MC",250,-50,50,500,0.0,500.0);\r
-  fOutputContainer->Add(fHistPrimVtxZESDSPDVSNContributorsMC);\r
-  fHistMCVertexZ= new TH1F("fHistMCVertexZ"," z vertex distr in cm MC",500,-50,50);\r
-  fOutputContainer->Add(fHistMCVertexZ);\r
-  fHistPiPiPDGCode = new TH1F("fHistPiPiPDGCode","PDG code of K0s mothers",3500,0,3500);\r
-  fOutputContainer->Add(fHistPiPiPDGCode);\r
-  fHistPiPPDGCode = new TH1F("fHistPiPPDGCode","PDG code of #Lambda  mothers",3500,0,3500);\r
-  fOutputContainer->Add(fHistPiPPDGCode);\r
-  fHistPiAPPDGCode = new TH1F("fHistPiAPPDGCode","PDG code of #bar{#Lambda} mothers",3500,0,3500);\r
-  fOutputContainer->Add(fHistPiAPPDGCode);\r
-  fHistPiPCosPointAngXiVsPt= new TH2F("fHistPiPCosPointAngXiVsPt","pi-p cos of pointing angle vs pt from xi",200,0.0,20.0,250,0.99,1.00);\r
-  fOutputContainer->Add(fHistPiPCosPointAngXiVsPt);\r
-  fHistPiAPCosPointAngXiVsPt= new TH2F("fHistPiAPCosPointAngXiVsPt","pi+p- cos of pointing angle vs pt from xi",200,0.0,20.0,250,0.98,1.00);   \r
-  fOutputContainer->Add(fHistPiAPCosPointAngXiVsPt);    \r
-\r
-\r
-\r
-  // ------------------- add always ---------------------------//\r
-  fHistV0RadiusZ[0]  = new TH2F("fHistV0RadiusZ","z of decay radius vs 2D radius",100,0.0,100.0,250,-125.0,125.0);\r
-  fOutputContainer->Add(fHistV0RadiusZ[0]);\r
-\r
-  fHistV0RadiusZVSPt[0]  = new TH2F("fHistV0RadiusZVSPt","z of decay radius vs pt radius",200,0.0,20.0,125,0.0,125.0);\r
-  fOutputContainer->Add( fHistV0RadiusZVSPt[0]);\r
-  fHistV0RadiusXY[0]  = new TH2F("fHistV0RadiusXY","y vs x decay radius",250,-125.0,125.0,250,-125.0,125.0);\r
-  fOutputContainer->Add( fHistV0RadiusXY[0]);\r
-  fHistV0RadiusXYVSY[0]  = new TH2F("fHistV0RadiusXYVSY","2D decay radius vs rap",100,-10,10,100,0.0,100.0);\r
-  fOutputContainer->Add( fHistV0RadiusXYVSY[0] );\r
-  fHistArmenteros[0] = new TH2F("fHistArmenteros"," pi+pi- armenteros",nbMass,-1.,1.,500,0.,0.5);\r
-  fOutputContainer->Add(fHistArmenteros[0]);\r
-  //***************************************** K0s **********************************//\r
-  fHistPiPiMass[0] = new TH1F("fHistPiPiMass"," pi+pi- InvMass distribution",2*nbMass,0.,2.);\r
-  fOutputContainer->Add(  fHistPiPiMass[0]);\r
-  fHistPiPiMassVSPt[0] = new TH2F("fHistPiPiMassVSPt","pi+pi- InvMass distribution",nbMass,0.25,0.75,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiPiMassVSPt[0]);\r
-  fHistPiPiMassVSPtMCTruth[0] = new TH2F("fHistPiPiMassVSPtMCTruth","pi+pi- InvMass distribution vs pt MCTruth",nbMass,0.25,0.75,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiPiMassVSPtMCTruth[0]);\r
-  fHistPiPiPtVSY[0] = new TH2F("fHistPiPiPtVSY","p{t} vs y",100,-1,1,100,0.0,20);\r
-  fOutputContainer->Add(  fHistPiPiPtVSY[0]);\r
-  fHistPiPiDecayLengthVsPt[0] = new TH2F("fHistPiPiDecayLengthVsPt","K0 decay length vs pt",200,0.0,20.0,200,0.0,100.0);\r
-  fOutputContainer->Add(fHistPiPiDecayLengthVsPt[0]); \r
-  fHistPiPiMonitorCuts[0] = new TH1F("fHistPiPiMonitorCuts","K0 cut monitor",25,0.5,25.5);\r
-  fOutputContainer->Add(  fHistPiPiMonitorCuts[0]);\r
-  //***************************************** Lambda **********************************//\r
-  fHistPiPMass[0] = new TH1F("fHistPiPMass"," p+pi- InvMass distribution",2*nbMass,0.,2.);\r
-  fOutputContainer->Add(  fHistPiPMass[0]); \r
-  fHistPiPMassVSPt[0] = new TH2F("fHistPiPMassVSPt","p+pi- InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiPMassVSPt[0]);\r
-  fHistPiPMassVSPtMCTruth[0] = new TH2F("fHistPiPMassVSPtMCTruth","p+pi- InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiPMassVSPtMCTruth[0]);\r
-  fHistPiPPtVSY[0] = new TH2F("fHistPiPPtVSY","p{t} vs y",100,-1,1,100,0.0,20);\r
-  fOutputContainer->Add( fHistPiPPtVSY[0]);\r
-  fHistPiPDecayLengthVsPt[0] = new TH2F("fHistPiPDecayLengthVsPt","#Lambda decay length vs pt",200,0.0,20.0,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiPDecayLengthVsPt[0] );\r
-  fHistPiPMonitorCuts[0] = new TH1F("fHistPiPMonitorCuts","#Lambda cut monitor",25,0.5,25.5);\r
-  fOutputContainer->Add(  fHistPiPMonitorCuts[0]);\r
-  //***************************************** AntiLambda **********************************//\r
-  fHistPiAPMass[0] = new TH1F("fHistPiAPMass"," ap-pi+ InvMass distribution",2*nbMass,0.,2.);\r
-  fOutputContainer->Add( fHistPiAPMass[0] );\r
-  fHistPiAPMassVSPt[0] = new TH2F("fHistPiAPMassVSPt","p-pi+ InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiAPMassVSPt[0]);\r
-  fHistPiAPMassVSPtMCTruth[0] = new TH2F("fHistPiAPMassVSPtMCTruth","p-pi+ InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add(        fHistPiAPMassVSPtMCTruth[0]);         \r
-  fHistPiAPPtVSY[0] = new TH2F("fHistPiAPPtVSY","p{t} vs y",100,-1,1,100,0.0,20);\r
-  fOutputContainer->Add( fHistPiAPPtVSY[0]);\r
-  fHistPiAPDecayLengthVsPt[0] = new TH2F("fHistPiAPDecayLengthVsPt","#bar{#Lambda} decay length vs pt",200,0.0,20.0,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiAPDecayLengthVsPt[0] );\r
-  fHistPiAPMonitorCuts[0] = new TH1F("fHistPiAPMonitorCuts","#bar{#Lambda} cut monitor",25,0.5,25.5);   \r
-  fOutputContainer->Add(  fHistPiAPMonitorCuts[0]);\r
-  //  if(mchist==2){// for MC reco\r
-  fHistV0RadiusZ[1]  = new TH2F("fHistV0RadiusZSec","z of decay radius vs 2D radius",100,0.0,100.0,250,-125.0,125.0);\r
-  fOutputContainer->Add( fHistV0RadiusZ[1]); \r
-  fHistV0RadiusZVSPt[1]  = new TH2F("fHistV0RadiusZVSPtSec","z of decay radius vs pt radius",200,0.0,20.0,125,0.0,125.0);\r
-  fOutputContainer->Add( fHistV0RadiusZVSPt[1]);\r
-  fHistV0RadiusXY[1]  = new TH2F("fHistV0RadiusXYSec","y vs x decay radius",250,-125.0,125.0,250,-125.0,125.0);\r
-  fOutputContainer->Add(  fHistV0RadiusXY[1] );\r
-  fHistV0RadiusXYVSY[1]  = new TH2F("fHistV0RadiusXYVSYSec","2D decay radius vs rap",100,-10,10,100,0.0,100.0);\r
-  fOutputContainer->Add( fHistV0RadiusXYVSY[1]); \r
-  fHistArmenteros[1] = new TH2F("fHistArmenterosSec"," pi+pi- armenteros",nbMass,-1.,1.,500,0.,0.5);\r
-  fOutputContainer->Add( fHistArmenteros[1]);\r
-  //***************************************** K0s **********************************//\r
-  fHistPiPiMass[1] = new TH1F("fHistPiPiMassSec"," pi+pi- InvMass distribution",2*nbMass,0.,2.);\r
-  fOutputContainer->Add( fHistPiPiMass[1] );\r
-  fHistPiPiMassVSPt[1] = new TH2F("fHistPiPiMassVSPtSec","pi+pi- InvMass distribution",nbMass,0.25,0.75,300,0.0,30.0);\r
-  fOutputContainer->Add(fHistPiPiMassVSPt[1]);\r
-  fHistPiPiMassVSPtMCTruth[1] = new TH2F("fHistPiPiMassVSPtMCTruthSec","pi+pi- InvMass distribution vs pt MCTruth",nbMass,0.25,0.75,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiPiMassVSPtMCTruth[1] );\r
-  fHistPiPiPtVSY[1] = new TH2F("fHistPiPiPtVSYSec","p{t} vs y",100,-1,1,100,0.0,20);\r
-  fOutputContainer->Add(fHistPiPiPtVSY[1]);\r
-  fHistPiPiDecayLengthVsPt[1] = new TH2F("fHistPiPiDecayLengthVsPtSec","K0 decay length vs pt",200,0.0,20.0,200,0.0,100.0);\r
-  fOutputContainer->Add(fHistPiPiDecayLengthVsPt[1]);\r
-  fHistPiPiMonitorCuts[1] = new TH1F("fHistPiPiMonitorCutsSec","K0 cut monitor",25,0.5,25.5);\r
-  fOutputContainer->Add(fHistPiPiMonitorCuts[1]);\r
-  //***************************************** Lambda **********************************//\r
-  fHistPiPMass[1] = new TH1F("fHistPiPMassSec"," p+pi- InvMass distribution",2*nbMass,0.,2.);\r
-  fOutputContainer->Add( fHistPiPMass[1]);\r
-  fHistPiPMassVSPt[1] = new TH2F("fHistPiPMassVSPtSec","p+pi- InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add( fHistPiPMassVSPt[1]);\r
-  fHistPiPMassVSPtMCTruth[1] = new TH2F("fHistPiPMassVSPtMCTruthSec","p+pi- InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add(fHistPiPMassVSPtMCTruth[1]);\r
-  fHistPiPPtVSY[1] = new TH2F("fHistPiPPtVSYSec","p{t} vs y",100,-1,1,100,0.0,20);\r
-  fOutputContainer->Add( fHistPiPPtVSY[1]);\r
-  fHistPiPDecayLengthVsPt[1] = new TH2F("fHistPiPDecayLengthVsPtSec","#Lambda decay length vs pt",200,0.0,20.0,200,0.0,100.0);\r
-  fOutputContainer->Add(  fHistPiPDecayLengthVsPt[1]);         \r
-  fHistPiPMonitorCuts[1] = new TH1F("fHistPiPMonitorCutsSec","#Lambda cut monitor",25,0.5,25.5);\r
-  fOutputContainer->Add( fHistPiPMonitorCuts[1]);\r
-  //***************************************** AntiLambda **********************************//\r
-  fHistPiAPMass[1] = new TH1F("fHistPiAPMassSec"," ap-pi+ InvMass distribution",2*nbMass,0.,2.);\r
-  fOutputContainer->Add( fHistPiAPMass[1]);\r
-  fHistPiAPMassVSPt[1] = new TH2F("fHistPiAPMassVSPtSec","p-pi+ InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add(    fHistPiAPMassVSPt[1]);\r
-  fHistPiAPMassVSPtMCTruth[1] = new TH2F("fHistPiAPMassVSPtMCTruthSec","p-pi+ InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);\r
-  fOutputContainer->Add(fHistPiAPMassVSPtMCTruth[1]);\r
-  fHistPiAPPtVSY[1] = new TH2F("fHistPiAPPtVSYSec","p{t} vs y",100,-1,1,100,0.0,20);\r
-  fOutputContainer->Add( fHistPiAPPtVSY[1]);\r
-  fHistPiAPDecayLengthVsPt[1] = new TH2F("fHistPiAPDecayLengthVsPtSec","#bar{#Lambda} decay length vs pt",200,0.0,20.0,200,0.0,100.0);\r
-  fOutputContainer->Add(    fHistPiAPDecayLengthVsPt[1] );\r
-  fHistPiAPMonitorCuts[1] = new TH1F("fHistPiAPMonitorCutsSec","#bar{#Lambda} cut monitor",25,0.5,25.5);\r
-  fOutputContainer->Add( fHistPiAPMonitorCuts[1]);\r
-      \r
-\r
-  //----------------- for reco or data or mc data like MC reco only -----------------//\r
-  \r
-    \r
-  fHistPiPiEtaDReco[0] = new TH2F("fHistPiPiEtaDRecoRaw","K0s daughters eta raw",300,-6,6,100,0,20);\r
-  fOutputContainer->Add(fHistPiPiEtaDReco[0]);\r
-  fHistPiPiEtaDReco[1] = new TH2F("fHistPiPiEtaDReco","K0s daughters eta after rap V0 cut pos",300,-3,3,300,-3.00,3.0);\r
-  fOutputContainer->Add(fHistPiPiEtaDReco[1]);  \r
-  fHistPiPEtaDReco[0] = new TH2F("fHistPiPEtaDRecoRaw","#Lambda daughters eta raw",300,-6,6,100,0,20);\r
-  fOutputContainer->Add(fHistPiPEtaDReco[0]);\r
-  fHistPiPEtaDReco[1] = new TH2F("fHistPiPEtaDReco","#Lambda daughters eta after rap V0 cut neg",300,-3,3,300,-3.00,3.0);\r
-  fOutputContainer->Add(fHistPiPEtaDReco[1]);\r
-       \r
-  //********************************************** K0 *************************************************//\r
-  \r
-  // fHistPiPiMassVSAlpha[0] = new TH2F("fHistPiPiMassVSAlpha"," alpha armenteros vs pi+pi- InvMass distribution",nbMass,0.25,0.75,500,-1.,1.);\r
-\r
-  fHistPiPiDCADaughters[0] = new TH2F("fHistPiPiDCADaughters","dca of K0 daughters",nbMass,0.25,0.75,250,0.0,2);\r
-  fOutputContainer->Add( fHistPiPiDCADaughters[0]); \r
-  fHistPiPiDCADaughterPosToPrimVtxVSMass[0] = new TH2F("fHistPiPiDCADaughterPosToPrimVtxVSMass","pi+ DCA daughter to prim vtx vsinvmass",nbMass,0.25,0.75,250,0.0,25.0);\r
-  fOutputContainer->Add(  fHistPiPiDCADaughterPosToPrimVtxVSMass[0] );\r
-  fHistPiPiDCAVSMass[0] = new TH2F("fHistPiPiDCAVSMass","pi+pi- dca  vs pt",nbMass,0.25,0.75,250,0.0,5.0);\r
-  fOutputContainer->Add(  fHistPiPiDCAVSMass[0]);\r
-  fHistPiPiCosPointAng[0]  = new TH2F("fHistPiPiCosPointAng","K0 cosine of pointing angle vs dca to prim vtx",200,0.0,10.0,250,0.99,1.00);\r
-  fOutputContainer->Add( fHistPiPiCosPointAng[0] );\r
-  fHistPiPiDecayLengthVsMass[0] = new TH2F("fHistPiPiDecayLengthVsMass","K0 decay length vs mass",nbMass,0.25,0.75,200,0.0,100.0);\r
-  fOutputContainer->Add(fHistPiPiDecayLengthVsMass[0]);\r
-  fHistPiPiRadiusXY[0] = new TH2F("fHistPiPiRadiusXY","pi+pi- opening angle vs mass",nbMass,0.25,0.75,200,0.0,4.0);\r
-  fOutputContainer->Add( fHistPiPiRadiusXY[0]);\r
-  // fHistPiPiPtDaughters[0] = new TH2F("fHistPiPiPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);\r
-\r
-        \r
-  //***************************************** Lambda *********************************************//\r
-  fHistPiPDCADaughters[0] = new TH2F("fHistPiPDCADaughters","dca of #Lambda daughters",nbMass,1.05,1.25,250,0.0,2.0);\r
-  fOutputContainer->Add(fHistPiPDCADaughters[0]);\r
-  fHistPiPDCADaughterPosToPrimVtxVSMass[0] = new TH2F("fHistPiPDCADaughterPosToPrimVtxVSMass","p DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);\r
-  fOutputContainer->Add( fHistPiPDCADaughterPosToPrimVtxVSMass[0]);\r
-  fHistPiPDCAVSMass[0] = new TH2F("fHistPiPDCAVSMass","ppi- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);\r
-  fOutputContainer->Add(  fHistPiPDCAVSMass[0]);\r
-  fHistPiPCosPointAng[0]  = new TH2F("fHistPiPCosPointAng","#Lambda cosine of pointing angle vs dca to prim vtx",200,0.0,10.0,250,0.99,1.00);\r
-  fOutputContainer->Add( fHistPiPCosPointAng[0] );\r
-  fHistPiPDecayLengthVsMass[0] = new TH2F("fHistPiPDecayLengthVsMass","#Lambda decay length vs mass",nbMass,1.05,1.25,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiPDecayLengthVsMass[0]);\r
-  fHistPiPRadiusXY[0] = new TH2F("fHistPiPRadiusXY","pi-p+ opening angle vs mass",nbMass,1.05,1.25,200,0.0,4.0);\r
-  fOutputContainer->Add(   fHistPiPRadiusXY[0]);\r
-  // fHistPiPPtDaughters[0] = new TH2F("fHistPiPPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);\r
-     \r
-  //************************************** Antilambda **********************************************//\r
-  fHistPiAPDCADaughters[0] = new TH2F("fHistPiAPDCADaughters","dca of #bar{#Lambda} daughters",nbMass,1.05,1.25,250,0.0,2.0);\r
-  fOutputContainer->Add( fHistPiAPDCADaughters[0]);\r
-  fHistPiAPDCADaughterPosToPrimVtxVSMass[0] = new TH2F("fHistPiAPDCADaughterPosToPrimVtxVSMass","pi+ DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);\r
-  fOutputContainer->Add(fHistPiAPDCADaughterPosToPrimVtxVSMass[0]);\r
-  fHistPiAPDCAVSMass[0] = new TH2F("fHistPiAPDCAVSMass","pi+p- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);\r
-  fOutputContainer->Add( fHistPiAPDCAVSMass[0]);\r
-  fHistPiAPCosPointAng [0] = new TH2F("fHistPiAPCosPointAng","#bar{#Lambda} cosine of pointing angle vs dcs to prim vtx",200,0.0,10.0,250,0.99,1.00);\r
-  fOutputContainer->Add( fHistPiAPCosPointAng [0] );\r
-  fHistPiAPDecayLengthVsMass[0] = new TH2F("fHistPiAPDecayLengthVsMass","#bar{#Lambda} decay length vs mass",nbMass,1.05,1.25,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiAPDecayLengthVsMass[0]);\r
-  fHistPiAPRadiusXY[0] = new TH2F("fHistPiAPRadiusXY","pi+p- opening angle vs mass",nbMass,1.05,1.25,200,0.0,4.0);\r
-  fOutputContainer->Add( fHistPiAPRadiusXY[0]);\r
-  // fHistPiAPPtDaughters[0] = new TH2F("fHistPiAPPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);\r
-   \r
-  //**********************************************TPC*****************************************************//\r
-\r
-  fHistDedxSecProt[0] = new TH2F("fHistDedxSecProt","proton", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add( fHistDedxSecProt[0]);\r
-  fHistDedxSecPiPlus[0] = new TH2F("fHistDedxSecPiPlus","pi plus", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add( fHistDedxSecPiPlus[0]);\r
-  fHistDedxSecAProt[0] = new TH2F("fHistDedxSecAProt","antiproton", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add( fHistDedxSecAProt[0]);\r
-  fHistDedxSecPiMinus[0] = new TH2F("fHistDedxSecPiMinus","pi minus", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add( fHistDedxSecPiMinus[0]);\r
-  fHistNclsITSPosK0[0] = new TH1F("fHistNclsITSPosK0","fHistNclsITSPos K0",10,-0.5,9.5);\r
-  fOutputContainer->Add(fHistNclsITSPosK0[0]);\r
-  fHistNclsITSNegK0[0] = new TH1F("fHistNclsITSNegK0","fHistNclsITSNeg K0",10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSNegK0[0]);\r
-  fHistNclsTPCPosK0[0] = new TH1F("fHistNclsTPCPosK0","fHistNclsTPCPos K0",200,-0.5,199.5);\r
-  fOutputContainer->Add( fHistNclsTPCPosK0[0]);\r
-  fHistNclsTPCNegK0[0] = new TH1F("fHistNclsTPCNegK0","fHistNclsTPCNeg K0",200,-0.5,199.5);\r
-  fOutputContainer->Add( fHistNclsTPCNegK0[0] );\r
-  fHistChi2PerNclsITSPosK0[0] = new TH1F("fHistChi2PerNclsITSPosK0","chi2 per cluster ITS pi+pi-",250,0.0,50.0);\r
-  fOutputContainer->Add(fHistChi2PerNclsITSPosK0[0]);\r
-  fHistChi2PerNclsITSNegK0[0] = new TH1F("fHistChi2PerNclsITSNegK0","chi2 per cluster ITS pi+pi- neg",250,0.0,50.0);\r
-  fOutputContainer->Add(fHistChi2PerNclsITSNegK0[0]);\r
-  fHistNclsITSPosL[0] = new TH1F("fHistNclsITSPosL","fHistNclsITSPos #Lambda",10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSPosL[0] );\r
-  fHistNclsITSNegL[0] = new TH1F("fHistNclsITSNegL","fHistNclsITSNeg #Lambda",10,-0.5,9.5);\r
-  fOutputContainer->Add(fHistNclsITSNegL[0]);\r
-  fHistNclsTPCPosL[0] = new TH1F("fHistNclsTPCPosL","fHistNclsTPCPos #Lambda",200,-0.5,199.5);\r
-  fOutputContainer->Add(fHistNclsTPCPosL[0]);\r
-  fHistNclsTPCNegL[0] = new TH1F("fHistNclsTPCNegL","fHistNclsTPCNeg #Lambda",200,-0.5,199.5);\r
-  fOutputContainer->Add( fHistNclsTPCNegL[0]);\r
-  fHistChi2PerNclsITSPosL[0] = new TH1F("fHistChi2PerNclsITSPosL","chi2 per cluster ITS pi-p+ pos",250,0.0,50.0);\r
-  fOutputContainer->Add( fHistChi2PerNclsITSPosL[0]);\r
-  fHistChi2PerNclsITSNegL[0] = new TH1F("fHistChi2PerNclsITSNegL","chi2 per cluster ITS pi-p+ neg",250,0.0,50.0);\r
-  fOutputContainer->Add( fHistChi2PerNclsITSNegL[0]);\r
-  //for 2d pt dep studies\r
-  fHistNclsITSPos[0] = new TH2F("fHistNclsITSPos","fHistNclsITSPos  vs pt pos",200,0.0,20.0,10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSPos[0]);\r
-  fHistNclsITSNeg[0] = new TH2F("fHistNclsITSNeg","fHistNclsITSNeg vs pt neg",200,0.0,20.0,10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSNeg[0]);\r
-  fHistNclsTPCPos[0] = new TH2F("fHistNclsTPCPos","ncls vs findable ncls pos",200,0.0,200.0,200,0.0,200.0);\r
-  fOutputContainer->Add(fHistNclsTPCPos[0] );\r
-  fHistNclsTPCNeg[0] = new TH2F("fHistNclsTPCNeg","ncls vs findable ncls neg",200,0.0,200.0,200,0.0,200.0);\r
-  fOutputContainer->Add(   fHistNclsTPCNeg[0]);\r
-  fHistChi2PerNclsITSPos[0] = new TH2F("fHistChi2PerNclsITSPos","chi2 per cluster ITS pi+p-vs pt pos",200,0.0,20.0,250,0.0,50.0);\r
-  fOutputContainer->Add(  fHistChi2PerNclsITSPos[0] );\r
-  fHistChi2PerNclsITSNeg[0] = new TH2F("fHistChi2PerNclsITSNeg","chi2 per cluster ITS pi+p- neg vs pt neg",200,0.0,20.0,250,0.0,50.0);\r
-  fOutputContainer->Add( fHistChi2PerNclsITSNeg[0] );\r
-  fHistNclsITS[0] = new TH2F("fHistNclsITS","fHistNclsITS pos vs neg",10,-0.5,9.5,10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITS[0]);\r
-  fHistNclsTPC[0] = new TH2F("fHistNclsTPC","ncls TPC neg vs crossed rows neg",200,-0.5,199.5,200,-0.5,199.5);\r
-  fOutputContainer->Add( fHistNclsTPC[0]);\r
-  fHistNCRowsTPCPos[0] = new TH2F("fHistNCRowsTPCPos","n crossed rows vs pt pos",200,0.0,20.0,200,0.0,200.0);\r
-  fOutputContainer->Add(  fHistNCRowsTPCPos[0] );\r
-  fHistNCRowsTPCNeg[0] = new TH2F("fHistNCRowsTPCNeg","n crossed rows vs pt neg",200,0.0,20.0,200,0.0,200.0);\r
-  fOutputContainer->Add( fHistNCRowsTPCNeg[0] );\r
-\r
-   \r
-  // if(mchist==2){// for MC reco\r
-\r
-  //********************************************** K0 *************************************************//\r
-  // fHistPiPiMassVSAlpha[0] = new TH2F("fHistPiPiMassVSAlpha"," alpha armenteros vs pi+pi- InvMass distribution",nbMass,0.25,0.75,500,-1.,1.);\r
-  fHistPiPiDCADaughters[1] = new TH2F("fHistPiPiDCADaughtersSec","dca of K0 daughters",nbMass,0.25,0.75,250,0.0,2);\r
-  fOutputContainer->Add(   fHistPiPiDCADaughters[1] );\r
-  fHistPiPiDCADaughterPosToPrimVtxVSMass[1] = new TH2F("fHistPiPiDCADaughterPosToPrimVtxVSMassSec","pi+ DCA daughter to prim vtx vsinvmass",nbMass,0.25,0.75,250,0.0,25.0);\r
-  fOutputContainer->Add(  fHistPiPiDCADaughterPosToPrimVtxVSMass[1]);\r
-  fHistPiPiDCAVSMass[1] = new TH2F("fHistPiPiDCAVSMassSec","pi+pi- dca  vs pt",nbMass,0.25,0.75,250,0.0,5.0);\r
-  fOutputContainer->Add(fHistPiPiDCAVSMass[1]);\r
-  fHistPiPiCosPointAng[1]  = new TH2F("fHistPiPiCosPointAngSec","K0 cosine of pointing angle vs dca to prim vtx",200,0.0,10.0,250,0.99,1.00);\r
-  fOutputContainer->Add( fHistPiPiCosPointAng[1]);\r
-  fHistPiPiDecayLengthVsMass[1] = new TH2F("fHistPiPiDecayLengthVsMassSec","K0 decay length vs mass",nbMass,0.25,0.75,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiPiDecayLengthVsMass[1]);\r
-  fHistPiPiRadiusXY[1] = new TH2F("fHistPiPiRadiusXYSec","pi+pi- opening angle vs mass",nbMass,0.25,0.75,200,0.0,4.0);\r
-  fOutputContainer->Add(fHistPiPiRadiusXY[1]);\r
-  // fHistPiPiPtDaughters[0] = new TH2F("fHistPiPiPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);\r
-\r
-        \r
-  //********************************************** Lambda ***********************************************//\r
-  fHistPiPDCADaughters[1] = new TH2F("fHistPiPDCADaughtersSec","dca of #Lambda daughters",nbMass,1.05,1.25,250,0.0,2.0);\r
-  fOutputContainer->Add( fHistPiPDCADaughters[1]);\r
-  fHistPiPDCADaughterPosToPrimVtxVSMass[1] = new TH2F("fHistPiPDCADaughterPosToPrimVtxVSMassSec","p DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);\r
-  fOutputContainer->Add( fHistPiPDCADaughterPosToPrimVtxVSMass[1]);\r
-  fHistPiPDCAVSMass[1] = new TH2F("fHistPiPDCAVSMassSec","ppi- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);\r
-  fOutputContainer->Add( fHistPiPDCAVSMass[1] );\r
-  fHistPiPCosPointAng[1]  = new TH2F("fHistPiPCosPointAngSec","#Lambda cosine of pointing angle vs dca to prim vtx",200,0.0,10.0,250,0.99,1.00);\r
-  fOutputContainer->Add( fHistPiPCosPointAng[1] );\r
-  fHistPiPDecayLengthVsMass[1] = new TH2F("fHistPiPDecayLengthVsMassSec","#Lambda decay length vs mass",nbMass,1.05,1.25,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiPDecayLengthVsMass[1]);\r
-  fHistPiPRadiusXY[1] = new TH2F("fHistPiPRadiusXYSec","pi-p+ opening angle vs mass",nbMass,1.05,1.25,200,0.0,4.0);\r
-  // fHistPiPPtDaughters[0] = new TH2F("fHistPiPPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);\r
-  fOutputContainer->Add(  fHistPiPRadiusXY[1]);\r
-  //******************************************* Antilambda **********************************************//\r
-  fHistPiAPDCADaughters[1] = new TH2F("fHistPiAPDCADaughtersSec","dca of #bar{#Lambda} daughters",nbMass,1.05,1.25,250,0.0,2.0);\r
-  fOutputContainer->Add(  fHistPiAPDCADaughters[1]);\r
-  fHistPiAPDCADaughterPosToPrimVtxVSMass[1] = new TH2F("fHistPiAPDCADaughterPosToPrimVtxVSMassSec","pi+ DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);\r
-  fOutputContainer->Add( fHistPiAPDCADaughterPosToPrimVtxVSMass[1]);\r
-  fHistPiAPDCAVSMass[1] = new TH2F("fHistPiAPDCAVSMassSec","pi+p- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);\r
-  fOutputContainer->Add(    fHistPiAPDCAVSMass[1]);\r
-  fHistPiAPCosPointAng[1] = new TH2F("fHistPiAPCosPointAngSec","#bar{#Lambda} cosine of pointing angle vs dcs to prim vtx",200,0.0,10.0,250,0.99,1.00);\r
-  fOutputContainer->Add(  fHistPiAPCosPointAng[1]);\r
-  fHistPiAPDecayLengthVsMass[1] = new TH2F("fHistPiAPDecayLengthVsMassSec","#bar{#Lambda} decay length vs mass",nbMass,1.05,1.25,200,0.0,100.0);\r
-  fOutputContainer->Add( fHistPiAPDecayLengthVsMass[1]);\r
-  fHistPiAPRadiusXY[1] = new TH2F("fHistPiAPRadiusXYSec","pi+p- opening angle vs mass",nbMass,1.05,1.25,200,0.0,4.0);\r
-  fOutputContainer->Add( fHistPiAPRadiusXY[1] );\r
-  // fHistPiAPPtDaughters[0] = new TH2F("fHistPiAPPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);\r
-\r
-  //******************************************* TPC ****************************************************//\r
-             \r
-  fHistDedxSecProt[1] = new TH2F("fHistDedxSecProtSec","proton", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add( fHistDedxSecProt[1]); \r
-  fHistDedxSecPiPlus[1] = new TH2F("fHistDedxSecPiPlusSec","pi plus", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add(  fHistDedxSecPiPlus[1]);\r
-  fHistDedxSecAProt[1] = new TH2F("fHistDedxSecAProtSec","antiproton", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add(fHistDedxSecAProt[1]);\r
-  fHistDedxSecPiMinus[1] = new TH2F("fHistDedxSecPiMinusSec","pi minus", nbPt, 0, 20, 100, 0, 400);\r
-  fOutputContainer->Add(   fHistDedxSecPiMinus[1]);\r
-  fHistNclsITSPosK0[1] = new TH1F("fHistNclsITSPosK0Sec","fHistNclsITSPos K0 ",10,-0.5,9.5);\r
-  fOutputContainer->Add(  fHistNclsITSPosK0[1]);\r
-  fHistNclsITSNegK0[1] = new TH1F("fHistNclsITSNegK0Sec","fHistNclsITSNeg K0",10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSNegK0[1]);\r
-  fHistNclsTPCPosK0[1] = new TH1F("fHistNclsTPCPosK0Sec","fHistNclsTPCPos K0",200,-0.5,199.5);\r
-  fOutputContainer->Add(  fHistNclsTPCPosK0[1]);\r
-  fHistNclsTPCNegK0[1] = new TH1F("fHistNclsTPCNegK0Sec","fHistNclsTPCNeg K0",200,-0.5,199.5);\r
-  fOutputContainer->Add(fHistNclsTPCNegK0[1] );\r
-  fHistChi2PerNclsITSPosK0[1] = new TH1F("fHistChi2PerNclsITSPosK0Sec","chi2 per cluster ITS pi+pi- pos",250,0.0,50.0);\r
-  fOutputContainer->Add(   fHistChi2PerNclsITSPosK0[1] );\r
-  fHistChi2PerNclsITSNegK0[1] = new TH1F("fHistChi2PerNclsITSNegK0Sec","chi2 per cluster ITS pi+pi- neg",250,0.0,50.0);\r
-  fOutputContainer->Add(     fHistChi2PerNclsITSNegK0[1]);\r
-  fHistNclsITSPosL[1] = new TH1F("fHistNclsITSPosLSec","fHistNclsITSPos #Lambda",10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSPosL[1]);\r
-  fHistNclsITSNegL[1] = new TH1F("fHistNclsITSNegLSec","fHistNclsITSNeg #Lambda",10,-0.5,9.5);\r
-  fOutputContainer->Add(   fHistNclsITSNegL[1]);\r
-  fHistNclsTPCPosL[1] = new TH1F("fHistNclsTPCPosLSec","fHistNclsTPCPos #Lambda",200,-0.5,199.5);\r
-  fOutputContainer->Add( fHistNclsTPCPosL[1]);\r
-  fHistNclsTPCNegL[1] = new TH1F("fHistNclsTPCNegLSec","fHistNclsTPCNeg #Lambda",200,-0.5,199.5);\r
-  fOutputContainer->Add( fHistNclsTPCNegL[1] );\r
-  fHistChi2PerNclsITSPosL[1] = new TH1F("fHistChi2PerNclsITSPosLSec","chi2 per cluster ITS pi-p+ pos",250,0.0,50.0);\r
-  fOutputContainer->Add( fHistChi2PerNclsITSPosL[1]);\r
-  fHistChi2PerNclsITSNegL[1] = new TH1F("fHistChi2PerNclsITSNegLSec","chi2 per cluster ITS pi-p+ neg",250,0.0,50.0);\r
-  fOutputContainer->Add( fHistChi2PerNclsITSNegL[1]);\r
-  //for 2d pt dep studies\r
-  fHistNclsITSPos[1] = new TH2F("fHistNclsITSPosSec","fHistNclsITSPos  vs pt pos",200,0.0,20.0,10,-0.5,9.5);\r
-  fOutputContainer->Add( fHistNclsITSPos[1]);\r
-  fHistNclsITSNeg[1] = new TH2F("fHistNclsITSNegSec","fHistNclsITSNeg vs pt neg",200,0.0,20.0,10,-0.5,9.5);\r
-  fOutputContainer->Add(fHistNclsITSNeg[1]);\r
-  fHistNclsTPCPos[1] = new TH2F("fHistNclsTPCPosSec","ncls vs findable ncls pos",200,0.0,200.0,200,0.0,200.0);\r
-  fOutputContainer->Add( fHistNclsTPCPos[1] );\r
-  fHistNclsTPCNeg[1] = new TH2F("fHistNclsTPCNegSec","ncls vs findable ncls neg",200,0.0,200.0,200,0.0,200.0);\r
-  fOutputContainer->Add( fHistNclsTPCNeg[1]);\r
-  fHistChi2PerNclsITSPos[1] = new TH2F("fHistChi2PerNclsITSPosSec","chi2 per cluster ITS pi+p-vs pt pos",200,0.0,20.0,250,0.0,50.0);\r
-  fOutputContainer->Add(  fHistChi2PerNclsITSPos[1]);\r
-  fHistChi2PerNclsITSNeg[1] = new TH2F("fHistChi2PerNclsITSNegSec","chi2 per cluster ITS pi+p- neg vs pt neg",200,0.0,20.0,250,0.0,50.0);\r
-  fOutputContainer->Add(  fHistChi2PerNclsITSNeg[1]);\r
-  fHistNclsITS[1] = new TH2F("fHistNclsITSSec","fHistNclsITS pos vs neg",10,-0.5,9.5,10,-0.5,9.5);\r
-  fOutputContainer->Add(  fHistNclsITS[1]);\r
-  fHistNclsTPC[1] = new TH2F("fHistNclsTPCSec","ncls TPC neg vs crossed rows neg",200,-0.5,199.5,200,-0.5,199.5);\r
-  fOutputContainer->Add(fHistNclsTPC[1] );\r
-  fHistNCRowsTPCPos[1] = new TH2F("fHistNCRowsTPCPosSec","n crossed rows vs pt pos",200,0.0,20.0,200,0.0,200.0);\r
-  fOutputContainer->Add( fHistNCRowsTPCPos[1]);\r
-  fHistNCRowsTPCNeg[1] = new TH2F("fHistNCRowsTPCNegSec","n crossed rows vs pt neg",200,0.0,20.0,200,0.0,200.0);\r
-  fOutputContainer->Add( fHistNCRowsTPCNeg[1]);\r
-\r
-  fHistPiPiEtaDMC[0] = new TH2F("fHistPiPiEtaDMCRaw","K0s daughters etaMC raw",300,-6,6,100,0,20);//\r
-  fOutputContainer->Add(fHistPiPiEtaDMC[0]);\r
-  fHistPiPiEtaDMC[1] = new TH2F("fHistPiPiEtaDMC","K0s daughters etaMC after rap V0 cut",300,-6,6,100,0,20);\r
-  fOutputContainer->Add(fHistPiPiEtaDMC[1]); \r
-  fHistPiPEtaDMC[0] = new TH2F("fHistPiPEtaDMCRaw","#Lambda daughters etaMC raw",300,-6,6,100,0,20);\r
-  fOutputContainer->Add(fHistPiPEtaDMC[0]); \r
-  fHistPiPEtaDMC[1] = new TH2F("fHistPiPEtaDMC","#Lambda daughters etaMC after rap V0 cut",300,-6,6,100,0,20);\r
-  fOutputContainer->Add(fHistPiPEtaDMC[1]);\r
-\r
-  //********************************************** K0 *************************************************//\r
-   \r
-        \r
-        \r
-  //********************************************** Lambda **********************************************//\r
\r
-  fHistPiPMassVSPtSecSigma[0] = new TH2F("fHistPiPMassVSPtSecSigmaMC"," pi-p+ InvMass distribution secondaries from sigma MC",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add( fHistPiPMassVSPtSecSigma[0]);\r
-  fHistPiPMassVSPtSecSigma[1] = new TH2F("fHistPiPMassVSPtSecSigma"," pi-p+ InvMass distribution secondaries from Sigma reco",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add( fHistPiPMassVSPtSecSigma[1]);\r
-  fHistPiPMassVSPtSecXi[0] = new TH2F("fHistPiPMassVSPtSecXiMC"," pi-p+ InvMass distribution secondaries from  xi MC",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add(  fHistPiPMassVSPtSecXi[0]);\r
-  fHistPiPMassVSPtSecXi[1] = new TH2F("fHistPiPMassVSPtSecXi"," pi-p+ InvMass distribution secondaries from  xi  reco",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add( fHistPiPMassVSPtSecXi[1] );\r
-  fHistPiPMassVSYSecXi[0] = new TH2F("fHistPiPMassVSYSecXiMC"," pi-p+ InvMass distribution secondaries from xi MC",nbMass,1.05,1.25,100,-2.,2);\r
-  fOutputContainer->Add( fHistPiPMassVSYSecXi[0]);\r
-  fHistPiPMassVSYSecXi[1] = new TH2F("fHistPiPMassVSYSecXi"," pi-p+ InvMass distribution secondaries from xi reco",nbMass,1.05,1.25,100,-2.,2);\r
-  fOutputContainer->Add(fHistPiPMassVSYSecXi[1] );\r
-  fHistPiPXi0PtVSLambdaPt[0]= new TH2F("fHistPiPXi0PtVSLambdaPtMC"," pt xi 0 vs pt lambda MC truth",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add(fHistPiPXi0PtVSLambdaPt[0]);\r
-  fHistPiPXi0PtVSLambdaPt[1]= new TH2F("fHistPiPXi0PtVSLambdaPt"," pt xi 0 truth vs pt lambda reco",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add( fHistPiPXi0PtVSLambdaPt[1]);\r
-  fHistPiPXiMinusPtVSLambdaPt[0]= new TH2F("fHistPiPXiMinusPtVSLambdaPtMC","pt xi- vs pt lambda MC truth",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add( fHistPiPXiMinusPtVSLambdaPt[0]);\r
-  fHistPiPXiMinusPtVSLambdaPt[1]= new TH2F("fHistPiPXiMinusPtVSLambdaPt","pt xi- truth vs pt lambda reco",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add( fHistPiPXiMinusPtVSLambdaPt[1]);\r
-  //******************************************* Antilambda **********************************************//\r
-\r
-  fHistPiAPMassVSPtSecSigma[0] = new TH2F("fHistPiAPMassVSPtSecSigmaMC"," pi+p- InvMass distribution secondaries from Sigma MC",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add(fHistPiAPMassVSPtSecSigma[0]);\r
-  fHistPiAPMassVSPtSecSigma[1] = new TH2F("fHistPiAPMassVSPtSecSigma"," pi+p- InvMass distribution secondaries from  Sigma  reco",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add( fHistPiAPMassVSPtSecSigma[1]);\r
-  fHistPiAPMassVSPtSecXi[0] = new TH2F("fHistPiAPMassVSPtSecXiMC"," pi+p- InvMass distribution secondaries from xi MC",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add( fHistPiAPMassVSPtSecXi[0]);\r
-  fHistPiAPMassVSPtSecXi[1] = new TH2F("fHistPiAPMassVSPtSecXi"," pi+p- InvMass distribution secondaries from  Xi reco",nbMass,1.05,1.25,200,0.,20);\r
-  fOutputContainer->Add(fHistPiAPMassVSPtSecXi[1]);\r
-\r
-  fHistPiAPMassVSYSecXi[0] = new TH2F("fHistPiAPMassVSYSecXiMC"," pi+p- InvMass distribution secondaries from  xi MC",nbMass,1.05,1.25,100,-2,2);\r
-  fOutputContainer->Add(fHistPiAPMassVSYSecXi[0]);\r
-  fHistPiAPMassVSYSecXi[1] = new TH2F("fHistPiAPMassVSYSecXi"," pi+p- InvMass distribution secondaries from xi reco",nbMass,1.05,1.25,100,-2.,2);\r
-  fOutputContainer->Add(    fHistPiAPMassVSYSecXi[1]);\r
-  fHistPiAPXi0PtVSLambdaPt[0]= new TH2F("fHistPiAPXi0PtVSLambdaPtMC"," pt xi 0 vs pt Alambda MC truth",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add( fHistPiAPXi0PtVSLambdaPt[0]);\r
-  fHistPiAPXi0PtVSLambdaPt[1]= new TH2F("fHistPiAPXi0PtVSLambdaPt"," pt xi 0 truth vs pt Alambda reco",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add(fHistPiAPXi0PtVSLambdaPt[1]);\r
-  fHistPiAPXiMinusPtVSLambdaPt[0]= new TH2F("fHistPiAPXiMinusPtVSLambdaPtMC","pt xi- vs pt Alambda MC truth",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add(fHistPiAPXiMinusPtVSLambdaPt[0]);\r
-  fHistPiAPXiMinusPtVSLambdaPt[1]= new TH2F("fHistPiAPXiMinusPtVSLambdaPt","pt xi- truth vs pt Alambda reco",200,0.0,20.0,200,0.0,20.0);\r
-  fOutputContainer->Add( fHistPiAPXiMinusPtVSLambdaPt[1]);\r
-   \r
-  PostData(1,fOutputContainer);               \r
\r
-}\r
-\r
-//________________________________________________________________________\r
-void AliAnalysisTaskV0ForRAA::UserExec(Option_t *) {\r
-  //user exec\r
-\r
-  //-- esd handler --//\r
-  AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> \r
-    (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r
-  if (!esdH) {\r
-    printf("ERROR: Could not get ESDInputHandler");\r
-    return;\r
-  } \r
-  fESD = esdH->GetEvent();\r
-  if(!fESD) {\r
-    printf("ERROR: fESD not available \n");\r
-    return ;\r
-  }\r
-\r
-  //-- mc handler --//\r
-  if(fMCMode || fMCTruthMode){\r
-    AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> \r
-      (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());\r
-    if(!mcH) {\r
-      printf("ERROR: Could not get MCInputHandler");\r
-      return;\r
-    }\r
-    fMCev = mcH->MCEvent();\r
-    if (!fMCev) {\r
-      printf("ERROR: fMCev not available \n");\r
-      return ;\r
-    }\r
-  }\r
-    \r
-\r
-  //--  AliPIDResponse --//\r
-  fESDpid = esdH->GetPIDResponse();\r
-   \r
-  //-- Count events before cuts --//\r
-  fHistNEvents->Fill(0);\r
-\r
-  //-- Check object existence --//\r
-  const AliESDVertex *    vtxESD    = fESD->GetPrimaryVertexTracks();\r
-  const AliESDVertex *    vtxESDTPC = fESD->GetPrimaryVertexTPC();  \r
-  const AliESDVertex *    vtxESDSPD = fESD->GetPrimaryVertexSPD();  \r
-  const AliMultiplicity * multESD   = fESD->GetMultiplicity();  \r
-\r
-  if ( !vtxESD ){\r
-    AliError("No Tracks Vertex");\r
-    return;\r
-  }\r
-\r
-  if ( !vtxESDTPC ){\r
-    AliError("No TPC Vertex");\r
-    return ;\r
-  }\r
-\r
-  if ( !vtxESDSPD ){\r
-    AliError("No SPD Vertex");\r
-    return ;\r
-  }\r
-\r
-  if ( !multESD ){\r
-    AliError("No Multiplicity");\r
-    return ;\r
-  }\r
-   \r
-\r
-  // ----------- MC vertex -----------------------------------//\r
\r
-  Int_t nContr =0;\r
-  if(fMCMode && fMCTruthMode){\r
-    Double_t vVertexPrim[3];\r
-    fMCev->GetPrimaryVertex()->GetXYZ(vVertexPrim);\r
-    fHistMCVertexZ->Fill(vVertexPrim[2]);\r
-      \r
-    if (vtxESD->GetStatus()){\r
-      nContr=vtxESD->GetNContributors();\r
-      fHistPrimVtxZESDVSNContributorsMC->Fill(vVertexPrim[2],nContr);\r
-      fHistPrimVtxZESDTPCVSNContributorsMC->Fill(vVertexPrim[2],nContr);\r
-    }\r
-    else {\r
-      if(vtxESDSPD->GetStatus()){\r
-       nContr=vtxESDSPD->GetNContributors();\r
-       fHistPrimVtxZESDTPCVSNContributorsMC->Fill(vVertexPrim[2],nContr);\r
-       fHistPrimVtxZESDSPDVSNContributorsMC->Fill(vVertexPrim[2],nContr);\r
-      }\r
-      else{\r
-       fHistPrimVtxZESDVSNContributorsMC->Fill(vVertexPrim[2],nContr);//add for correction ESD and ESDPSD!!!!\r
-       fHistPrimVtxZESDTPCVSNContributorsMC->Fill(vVertexPrim[2],nContr);\r
-      }\r
-    }\r
-  }\r
-  \r
-  //-- Monitor event cuts --//\r
-  fHistNEvents->Fill(1);\r
-  \r
-  // -- Check fo centrality\r
-  Bool_t process = kTRUE;\r
-  Int_t centBin = -1;\r
-  if(fUseCentrality) {\r
-    centBin = CalculateCentralityBin();\r
-    if(!fUseCentralityRange){\r
-      if(centBin!= fUseCentralityBin) process=kFALSE;\r
-    }\r
-    else if(centBin < fUseCentralityBin || centBin > fUseCentralityBin+fUseCentralityRange)\r
-      process = kFALSE;\r
-  }\r
-\r
-  AliESDVZERO* esdV0 = fESD->GetVZEROData();\r
-  Float_t multV0 = esdV0->GetMTotV0A() + esdV0->GetMTotV0C();\r
-  \r
-  if(fAnapp){// pp Analysis\r
-    // SDD test for 2.76TeV pp\r
-    // select events with SDD\r
-    //    TString trCl = fESD->GetFiredTriggerClasses();\r
-    //if(!(trCl.Contains("ALLNOTRD")) && fSelSDD) return;\r
-    UInt_t maskSel = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();\r
-    if(maskSel& AliVEvent::kFastOnly && fSelSDD) return;  \r
-\r
-    Int_t ntracks = fESD->GetNumberOfTracks();\r
-    for(Int_t i=0;i<ntracks;i++){//check sdd event selection\r
-      AliESDtrack *tr=   fESD->GetTrack(i);\r
-      \r
-      Bool_t sdd0 = tr->HasPointOnITSLayer(0);\r
-      Bool_t sdd1 = tr->HasPointOnITSLayer(1);\r
-      Bool_t sdd2 = tr->HasPointOnITSLayer(2);\r
-      Bool_t sdd3 = tr->HasPointOnITSLayer(3);\r
-      Bool_t sdd4 = tr->HasPointOnITSLayer(4);\r
-      Bool_t sdd5 = tr->HasPointOnITSLayer(5);\r
-       \r
-      fHistITSLayerHits->Fill(Int_t(sdd0)*(-1),ntracks);\r
-      fHistITSLayerHits->Fill(Int_t(sdd1)*1,ntracks);\r
-      fHistITSLayerHits->Fill(Int_t(sdd2)*2,ntracks);\r
-      fHistITSLayerHits->Fill(Int_t(sdd3)*3,ntracks);\r
-      fHistITSLayerHits->Fill(Int_t(sdd4)*4,ntracks);\r
-      fHistITSLayerHits->Fill(Int_t(sdd5)*5,ntracks);\r
-    }\r
-      \r
-    //vertex selection\r
-    if (vtxESD->GetStatus()){\r
-      fHistNEvents->Fill(2);\r
-      fHistESDVertexZ->Fill(vtxESD->GetZv());\r
-      if(fabs(vtxESD->GetZv()) < fVertexZCut){\r
-       fHistMuliplicityRaw->Fill(multV0);\r
-       fHistNEvents->Fill(3);\r
-       fHistNPrim->Fill(nContr);\r
-       \r
-       Process();\r
-       \r
-       fHistMuliplicity->Fill(multV0);\r
-       \r
-       nContr = vtxESD->GetNContributors();\r
-       //  if(nContr<501){\r
-       fHistPrimVtxZESDVSNContributors->Fill(vtxESD->GetZv(),nContr);\r
-       fHistPrimVtxZESDTPCVSNContributors->Fill(vtxESDTPC->GetZv(),nContr);\r
-       //fHistPrimVtxZESDSPDVSNContributorsTPC->Fill(vtxESDSPD->GetZv(),nContr);\r
-       //   }\r
-       fHistPrimVtxZESD->Fill(vtxESD->GetZv());\r
-       fHistPrimVtxZESDTPC->Fill(vtxESDTPC->GetZv());\r
-       // fHistPrimVtxZESDSPD->Fill(vtxESDSPD->GetZv());\r
-       // -- count events after processing\r
-       fHistNEvents->Fill(4);\r
-      }\r
-    }\r
-    else{\r
-      if(vtxESDSPD->GetStatus()){\r
-       fHistNEvents->Fill(2);\r
-       \r
-       fHistESDVertexZ->Fill(vtxESDSPD->GetZv());\r
-       if(fabs(vtxESDSPD->GetZv()) < fVertexZCut){\r
-         \r
-         fHistMuliplicityRaw->Fill(multV0);\r
-         fHistNEvents->Fill(3);\r
-         fHistNPrim->Fill(nContr);\r
-         \r
-         Process();\r
-         \r
-         fHistMuliplicity->Fill(multV0);\r
-         \r
-         nContr = vtxESDSPD->GetNContributors();\r
-         //  if(nContr<501){\r
-         //fHistPrimVtxZESDVSNContributors->Fill(vtxESD->GetZv(),nContr);\r
-         fHistPrimVtxZESDTPCVSNContributors->Fill(vtxESDTPC->GetZv(),nContr);\r
-         fHistPrimVtxZESDSPDVSNContributors->Fill(vtxESDSPD->GetZv(),nContr);\r
-         // }\r
-         // fHistPrimVtxZESD->Fill(vtxESD->GetZv());\r
-         fHistPrimVtxZESDTPC->Fill(vtxESDTPC->GetZv());\r
-         fHistPrimVtxZESDSPD->Fill(vtxESDSPD->GetZv());\r
-         // -- count events after processing\r
-         fHistNEvents->Fill(4);\r
-       }\r
-      }\r
-      //else return;\r
-    }\r
-  }\r
-  else{// PbPb analysis\r
-    if(vtxESD->GetStatus()){\r
-      Double_t vtxZ = vtxESD->GetZv();\r
-      fHistESDVertexZ->Fill(vtxZ);\r
-      if(process){\r
-       fHistNEvents->Fill(2);\r
-       if(fabs(vtxZ) < fVertexZCut){\r
-         nContr = vtxESD->GetNContributors();\r
-         fHistMuliplicityRaw->Fill(multV0);\r
-         fHistNEvents->Fill(3);\r
-         fHistNPrim->Fill(nContr);\r
-         Process();\r
-         fHistMuliplicity->Fill(multV0);\r
-         fHistPrimVtxZESD->Fill(vtxZ);\r
-         fHistPrimVtxZESDVSNContributors->Fill(vtxZ,nContr);\r
-         // -- count events after processing --//\r
-         fHistCentBin->Fill(centBin);\r
-         fHistNEvents->Fill(4);\r
-       }\r
-      }\r
-      if(fabs(vtxZ) < fVertexZCut) fHistCentBinRaw->Fill(centBin);\r
-    }\r
-  }\r
\r
-    \r
-}\r
-\r
-//________________________________________________________________________\r
-void AliAnalysisTaskV0ForRAA::Terminate(Option_t *) {\r
-  //terminate\r
-}\r
-//________________________________________________________________________\r
-void AliAnalysisTaskV0ForRAA::Process(){\r
-  //run the analysis\r
-\r
-  Int_t ntracks = fESD->GetNumberOfTracks();\r
-  Int_t count = 0;\r
-\r
-  //-- count number of tracks --//\r
-   \r
-  if(!(!fMCMode && fMCTruthMode)){\r
-    for(Int_t i=0;i<ntracks;i++){\r
-      AliESDtrack *track = (AliESDtrack*)fESD->GetTrack(i);\r
-      if(!fESDTrackCuts->AcceptTrack(track)) continue;\r
-      if( track->Eta() > fEtaCutMCDaughtersVal) continue;\r
-      count++;\r
-    }\r
-    fHistMultiplicityPrimary->Fill(count);\r
-  }\r
-   \r
-  //-- check number of V0s in case of data or mc data like analysis--//\r
-  Int_t nV0 = fESD->GetNumberOfV0s();\r
-  if(!fMCTruthMode) if(nV0 < 1) return;\r
-   \r
-  //-- run analysis --//\r
-  if(fMCTruthMode)  V0MCTruthLoop();\r
-  else  V0RecoLoop(0,0,0,0,0.0,0,0.0);\r
-\r
-}\r
-//________________________________________________________________________\r
-void AliAnalysisTaskV0ForRAA::V0MCTruthLoop(){\r
-  //loop over MC truth particles\r
-\r
-  //-- get MC stack --//\r
-  AliStack *stack = fMCev->Stack();\r
-\r
-  /*\r
-  //histo fo user defined shift in charge/pt \r
-  if(fShift){\r
-  fHistUserPtShift->Fill(fDeltaInvP);\r
-  }\r
-  */\r
-  /*\r
-    AliKFVertex primVtxStart(*(fESD->GetPrimaryVertex()));\r
-    Int_t nTracksPrim=primVtxStart.GetNContributors();\r
-    fHistNPrim->Fill(nTracksPrim);\r
-  */\r
-  /*\r
-  // MC\r
-    \r
-  Int_t mcPrimaries = stack->GetNprimary();\r
-  Int_t mcParticles    = stack->GetNtrack();\r
-    \r
-  fHistMultiplicityPrimary->Fill(mcPrimaries);\r
-  fHistMCMultiplicityTracks->Fill(mcParticles);\r
-    \r
-  // number of V0\r
-  fHistNV0->Fill(nV0);\r
-  if(nTracksPrim>0) {\r
-  fHistNV0WithVertex->Fill(nV0);\r
-  }\r
-  */\r
-\r
-\r
-  //-- MC truht loop for V0s --//\r
-  for (Int_t iMc = 0; iMc < (stack->GetNtrack()); iMc++){//MC truth loop\r
-    Int_t fillMCtruth= int(fMCTruthMode);\r
-    if(fMCTruthMode){\r
-      fHistPiPiMonitorCuts[0]->Fill(1*fillMCtruth);\r
-      fHistPiPMonitorCuts[0]->Fill(1*fillMCtruth);\r
-      fHistPiAPMonitorCuts[0]->Fill(1*fillMCtruth);\r
-    }\r
-    TParticle *p0 = stack->Particle(iMc);\r
-    if(!p0) continue;\r
-\r
-    if(fMCTruthMode){\r
-      fHistPiPiMonitorCuts[0]->Fill(2*fillMCtruth);\r
-      fHistPiPMonitorCuts[0]->Fill(2*fillMCtruth);\r
-      fHistPiAPMonitorCuts[0]->Fill(2*fillMCtruth);\r
-    }\r
-\r
-    Int_t pdgCode = p0->GetPdgCode();\r
-\r
-    //-------------- only K0s and Lambda ----------//\r
-    if( (pdgCode != 310 ) && ( fabs(pdgCode) != 3122 ) ) continue;\r
-    Int_t fillFlagK0 = (3122- fabs(pdgCode))/(3122-310)*fillMCtruth;\r
-    Int_t fillFlagL = (fabs(pdgCode) - 310)/(3122-310)*(pdgCode+3122)/(2*3122)*fillMCtruth;\r
-    Int_t fillFlagAL = (fabs(pdgCode) - 310)/(3122-310)*(pdgCode-3122)/(-2*3122)*fillMCtruth;\r
-    \r
-    fHistPiPiMonitorCuts[0]->Fill(3*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(3*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(3*fillFlagAL);\r
-      \r
-    if(p0->GetNDaughters() !=2) continue;\r
-    fHistPiPiMonitorCuts[0]->Fill(4*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(4*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(4*fillFlagAL);\r
-      \r
-    //-------------- unique ID check-------------- //\r
-    Int_t uniqueID =  p0->GetUniqueID();\r
-    if(uniqueID==13) continue;\r
-      \r
-    fHistPiPiMonitorCuts[0]->Fill(5*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(5*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(5*fillFlagAL);\r
-      \r
-    //-------------- daughters --------------------//\r
-    Int_t id0  = p0->GetDaughter(0);\r
-    Int_t id1  = p0->GetDaughter(1);\r
-    if(id0<0 || id1 <0) continue;\r
-      \r
-    fHistPiPiMonitorCuts[0]->Fill(6*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(6*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(6*fillFlagAL);\r
-            \r
-    Int_t pdgCodeD0 = stack->Particle(id0)->GetPdgCode();\r
-    Int_t pdgCodeD1 = stack->Particle(id1)->GetPdgCode();\r
-      \r
-    if(pdgCodeD0 == pdgCodeD1) continue;\r
-    if(pdgCodeD0*pdgCodeD1>0) continue;\r
-      \r
-    fHistPiPiMonitorCuts[0]->Fill(7*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(7*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(7*fillFlagAL);\r
-            \r
-    if((fabs(pdgCodeD0) != 211 ) && ( fabs(pdgCodeD0) != 2212 )) continue;\r
-    if((fabs(pdgCodeD1) != 211 ) && ( fabs(pdgCodeD1) != 2212 )) continue;\r
-      \r
-    fHistPiPiMonitorCuts[0]->Fill(8*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(8*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(8*fillFlagAL);\r
-      \r
-    TParticle *p00 =stack->Particle(id0);\r
-    TParticle *p01 =stack->Particle(id1);\r
-    Double_t etaMC00   = p00->Eta();\r
-    Double_t etaMC01   = p01->Eta();\r
-    \r
-    //----------- unique ID check daughters-------- //\r
-    Int_t uniqueIDdaughter0 = p00->GetUniqueID();\r
-    Int_t uniqueIDdaughter1 = p01->GetUniqueID();\r
-    if (uniqueIDdaughter0 !=4 || uniqueIDdaughter1 !=4 ) continue;\r
-      \r
-    fHistPiPiMonitorCuts[0]->Fill(9*fillFlagK0);\r
-    fHistPiPMonitorCuts[0]->Fill(9*fillFlagL);\r
-    fHistPiAPMonitorCuts[0]->Fill(9*fillFlagAL);\r
-\r
-    fHistPiPiMonitorCuts[1]->Fill(9*fillFlagK0);\r
-    fHistPiPMonitorCuts[1]->Fill(9*fillFlagL);\r
-    fHistPiAPMonitorCuts[1]->Fill(9*fillFlagAL);\r
-      \r
-\r
-    //-----------get geometric properties --------------//\r
-    // DCA of mother to prim vertex = production vertex\r
-    //-- primary and secondary vetex --//\r
-    Double_t vVertex[3];\r
-    fMCev->GetPrimaryVertex()->GetXYZ(vVertex);\r
-    //Double_t x0=p0->Vx(),y0=p0->Vy(),z0=p0->Vz();//mother production vertex\r
-    Double_t x=p00->Vx(),y=p00->Vy(),z=p00->Vz();//daughter vertex =V0 decay vertex\r
-\r
-    //-- decay radii --//\r
-    Double_t rMC2D  = sqrt(x*x+y*y);\r
-    const  Double_t xyzMC[3] = {x,y,z};\r
-    // Double_t rMC = p00->R();\r
-      \r
-    //-- phi --//\r
-    Double_t pi = TMath::Pi();\r
-    Double_t phi = p0->Phi();\r
-    if(phi>pi) phi -=2*pi;\r
-\r
-    //-------------------- V0 variables ----------------//\r
-    Double_t rapidity = p0->Y();\r
-    Double_t massV0MC = p0->GetMass();\r
-    Double_t ptV0MC =  p0->Pt();\r
-    Double_t pV0MC =  p0->P();\r
-\r
-     \r
-    //----------------- mother variables-----------------//\r
-    Int_t indexMother1  = p0->GetMother(0);\r
-    Int_t isSecd=0;\r
-    Int_t pdgMother =0;\r
-    // Int_t goodMother=1;\r
-    Int_t uniqueIDmother=0;\r
-    Double_t ptXiMother=0.0;\r
-          \r
-    //------check mother and fill mother histos---------//\r
-      \r
-    Bool_t isPrim= stack->IsPhysicalPrimary(iMc);\r
-    if(!isPrim){\r
-      isSecd=1;// is secondary V0s\r
-      if(indexMother1 >-1){// && !isPrim){//secondary V0s\r
-       //     isSecd=1;// is secondary V0s\r
-        \r
-       //-- check for mother --//\r
-       TParticle *mother = stack->Particle(indexMother1);\r
-       if(!mother) {\r
-         Printf("no mother pointer!");continue;\r
-       }\r
-       pdgMother = mother->GetPdgCode();\r
-       fHistPiPiMonitorCuts[1]->Fill(10*fillFlagK0);\r
-       fHistPiPMonitorCuts[1]->Fill(10*fillFlagL);\r
-       fHistPiAPMonitorCuts[1]->Fill(10*fillFlagAL);\r
-\r
-       Bool_t isPrimMother= stack->IsPhysicalPrimary(indexMother1);\r
-       if(!isPrimMother) continue;\r
-       fHistPiPiMonitorCuts[1]->Fill(11*fillFlagK0);\r
-       fHistPiPMonitorCuts[1]->Fill(11*fillFlagL);\r
-       fHistPiAPMonitorCuts[1]->Fill(11*fillFlagAL);\r
-      \r
-       uniqueIDmother =  mother->GetUniqueID();\r
-\r
-       if(uniqueIDmother==13){\r
-         //    goodMother =0;\r
-         continue;\r
-       }\r
-       fHistPiPiMonitorCuts[1]->Fill(12*fillFlagK0);\r
-       fHistPiPMonitorCuts[1]->Fill(12*fillFlagL);\r
-       fHistPiAPMonitorCuts[1]->Fill(12*fillFlagAL);\r
-\r
-       //-- fill secondary V0s histos and pdg histos --// \r
-       ptXiMother=mother->Pt();\r
-        \r
-       //-- K0s --//\r
-       if(pdgCode==310){\r
-         if(fabs(pdgMother)==311 || fabs(pdgMother)==313 || fabs(pdgMother)==323 ) isSecd=0; // from K0L,  K0 and K* as primary\r
-         else fHistPiPiPDGCode->Fill(fabs(pdgMother));\r
-         //goodMother=1;\r
-       }\r
-       //-- Lambda --//\r
-       if(pdgCode==3122){\r
-         fHistPiPPDGCode->Fill(fabs(pdgMother));\r
-         if (//sigma family\r
-             ( TMath::Abs(pdgMother) == 3112) || //sigma minus\r
-             ( TMath::Abs(pdgMother) == 3222) || //sigma plus\r
-             ( TMath::Abs(pdgMother) == 3224) || //sigma *plus\r
-             ( TMath::Abs(pdgMother) == 3114) || //sigma *minus\r
-             ( TMath::Abs(pdgMother) == 3214) || //sigma *0 counts as primary????\r
-             ( TMath::Abs(pdgMother) == 3212)    //sigma 0 counts as primary\r
-             )\r
-           {\r
-             isSecd=0;\r
-             //goodMother=1;\r
-           }\r
-          \r
-         if( TMath::Abs(pdgMother) == 3322) //xi0\r
-           {\r
-             if(!fRapCutV0 || fabs(rapidity)<fRap){\r
-               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){\r
-                 fHistPiPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiPMassVSYSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiPXi0PtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);\r
-               }\r
-             }\r
-             //goodMother=1;\r
-           }\r
-         if( TMath::Abs(pdgMother) == 3312) //xi minus\r
-           {\r
-             if(!fRapCutV0 || fabs(rapidity)<fRap){\r
-               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){\r
-                 fHistPiPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiPMassVSYSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiPXiMinusPtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);\r
-               }\r
-             }\r
-             //goodMother=1;\r
-\r
-           }       \r
-         if(TMath::Abs(pdgMother) == 3334)//omega-\r
-           {\r
-             //  fHistPiPDCAtoPrimVtxOmega[0]->Fill(p0->GetMass(),dcaV0ToPrimVertex);\r
-             //goodMother=1;\r
-           }\r
-       }\r
-       //-- AntiLambda --//\r
-       if(pdgCode==-3122 ){\r
-         fHistPiAPPDGCode->Fill(fabs(pdgMother));\r
-         if (//sigma family\r
-             ( TMath::Abs(pdgMother) == 3112) ||//sigma minus\r
-             ( TMath::Abs(pdgMother) == 3222) ||//sigma plus\r
-             ( TMath::Abs(pdgMother) == 3224) ||//sigma *plus\r
-             ( TMath::Abs(pdgMother) == 3114) ||//sigma *minus\r
-             ( TMath::Abs(pdgMother) == 3214) || //sigma *0\r
-             ( TMath::Abs(pdgMother) == 3212)    //sigma 0 counts as primary\r
-             )\r
-           {\r
-             isSecd=0;\r
-             //            goodMother=1;\r
-           }\r
-                  \r
-         if( TMath::Abs(pdgMother) == 3322) //xi0\r
-           {\r
-             if(!fRapCutV0 || fabs(rapidity)<fRap){\r
-               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){\r
-                 fHistPiAPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiAPMassVSYSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiAPXi0PtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);\r
-               }\r
-             }\r
-             // goodMother=1;\r
-           }\r
-         if( TMath::Abs(pdgMother) == 3312) //xi minus\r
-           {\r
-             if(!fRapCutV0 || fabs(rapidity)<fRap){\r
-               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){\r
-                 fHistPiAPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiAPMassVSYSecXi[0]->Fill(massV0MC,ptV0MC);\r
-                 fHistPiAPXiMinusPtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);\r
-               }\r
-             }\r
-             //goodMother=1;\r
-           }\r
-         if(\r
-            (TMath::Abs(pdgMother) == 3334)//omega-\r
-            )\r
-           {\r
-             // fHistPiAPDCAtoPrimVtxOmega[0]->Fill(p0->GetMass(),dcaV0ToPrimVertex);\r
-             // goodMother=1;\r
-           }\r
-       }\r
-      }        \r
-    }//end secondaries\r
-    //else goodMother=1;\r
-    // if(!goodMother) continue;// for (A)Lambda important\r
-      \r
-    //-------------- MC truth or reco mode -----------------//\r
-    if(fMCTruthMode && !fMCMode){//MC true ana\r
-      fHistPiPiMonitorCuts[isSecd]->Fill(13*fillFlagK0);\r
-      fHistPiPMonitorCuts[isSecd]->Fill(13*fillFlagL);\r
-      fHistPiAPMonitorCuts[isSecd]->Fill(13*fillFlagAL);\r
-      \r
-      //-- DCA daughters --//\r
-      // values of one daugher, should be the same      \r
-      /*\r
-      //to primary vertex\r
-      trackPos->GetImpactParameters(tdcaPosToVertex[0],tdcaPosToVertex[1]);\r
-      trackNeg->GetImpactParameters(tdcaNegToVertex[0],tdcaNegToVertex[1]);\r
-        \r
-      Double_t dcaPosToVertex = TMath::Sqrt(tdcaPosToVertex[0]*tdcaPosToVertex[0]+tdcaPosToVertex[1]*tdcaPosToVertex[1]);\r
-      Double_t dcaNegToVertex = TMath::Sqrt(tdcaNegToVertex[0]*tdcaNegToVertex[0]+tdcaNegToVertex[1]*tdcaNegToVertex[1]);\r
-      fHistDCADaughtersToPrimVtx[isSecd]->Fill(dcaPosToVertex,dcaNegToVertex);\r
-      */\r
-        \r
-        \r
-      //-- armenteros values --//\r
-      TVector3 vecPip;\r
-      TVector3 vecPin;\r
-       \r
-      Double_t ptPlus=0, ptMinus=0;\r
-      Double_t pt00 = p00->Pt();\r
-      Double_t pt01 = p01->Pt();\r
-        \r
-      if(p00->GetPdgCode()<0)\r
-       {\r
-         vecPip.SetXYZ(p01->Px(),p01->Py(),p01->Pz());\r
-         vecPin.SetXYZ(p00->Px(),p00->Py(),p00->Pz());\r
-         ptMinus = pt00;\r
-         ptPlus = pt01;\r
-       }\r
-      else{\r
-       vecPin.SetXYZ(p01->Px(),p01->Py(),p01->Pz());\r
-       vecPip.SetXYZ(p00->Px(),p00->Py(),p00->Pz());\r
-       ptMinus = pt01;\r
-       ptPlus = pt00;\r
-      }\r
-      TVector3 momTot(p0->Px(),p0->Py(),p0->Pz());\r
-      Double_t lQlNeg = fabs(vecPin.Dot(momTot)/momTot.Mag());\r
-      Double_t lQlPos = fabs(vecPip.Dot(momTot)/momTot.Mag());\r
-      Double_t alfa =0.0;\r
-      Double_t den = lQlPos + lQlNeg;\r
-      if(den>0) alfa = (lQlPos - lQlNeg)/den;\r
-      TVector3 qtvec= vecPin.Cross(momTot);//vecPip.Mag()*sqrt(1-pow(thetapip,2));\r
-      Float_t qt = qtvec.Mag()/momTot.Mag();\r
-      \r
-      //-- check for injejcted --//\r
-      Bool_t injected = kTRUE;\r
-      injected = fMCev->IsFromBGEvent(iMc);\r
-\r
-      if(fSelectInjected && injected ) continue;\r
-      fHistPiPiMonitorCuts[isSecd]->Fill(14*fillFlagK0);\r
-      fHistPiPMonitorCuts[isSecd]->Fill(14*fillFlagL);\r
-      fHistPiAPMonitorCuts[isSecd]->Fill(14*fillFlagAL);\r
-        \r
-      if(pdgCode == 310) {\r
-       fHistPiPiEtaDMC[isSecd]->Fill(etaMC00,ptV0MC);\r
-       fHistPiPiEtaDMC[isSecd]->Fill(etaMC01,ptV0MC);\r
-      }\r
-      if(fabs(pdgCode) == 3122) {\r
-       fHistPiPEtaDMC[isSecd]->Fill(etaMC00,ptV0MC);\r
-       fHistPiPEtaDMC[isSecd]->Fill(etaMC01,ptV0MC);\r
-      }\r
-\r
-      //-- rapidity and eta cut --//      \r
-      if(fRapCutV0 && fabs(rapidity)>fRap) continue;\r
-      fHistPiPiMonitorCuts[isSecd]->Fill(15*fillFlagK0);\r
-      fHistPiPMonitorCuts[isSecd]->Fill(15*fillFlagL);\r
-      fHistPiAPMonitorCuts[isSecd]->Fill(15*fillFlagAL);\r
-        \r
-      if(fEtaCutMCDaughters) { if(fabs(etaMC00)>fEtaCutMCDaughtersVal || fabs(etaMC01)>fEtaCutMCDaughtersVal ) continue; }\r
-      fHistPiPiMonitorCuts[isSecd]->Fill(16*fillFlagK0);\r
-      fHistPiPMonitorCuts[isSecd]->Fill(16*fillFlagL);\r
-      fHistPiAPMonitorCuts[isSecd]->Fill(16*fillFlagAL);\r
-\r
-      Double_t declength=p00->Rho();      \r
-\r
-      //-- Fill Particle histos --//\r
-      if (pdgCode==310){//K0s\r
-       fHistPiPiMonitorCuts[isSecd]->Fill(17);\r
-\r
-       fHistPiPiEtaDMC[1]->Fill(etaMC00,ptV0MC);\r
-       fHistPiPiEtaDMC[1]->Fill(etaMC01,ptV0MC);\r
-         \r
-       fHistPiPiMass[isSecd]->Fill(massV0MC);\r
-       fHistPiPiMassVSPt[isSecd]->Fill(massV0MC,ptV0MC);\r
-       // fHistPiPiPtDaughters[isSecd]->Fill(ptMinus,ptPlus);\r
-       fHistPiPiPtVSY[isSecd]->Fill(rapidity,ptV0MC);\r
-          \r
-       Double_t ctK0s=0.0;\r
-       if(pV0MC>0.0) ctK0s=declength*0.497614/pV0MC;\r
-       fHistPiPiDecayLengthVsPt[isSecd]->Fill(ptV0MC,ctK0s);\r
-       \r
-       //all V0s histo\r
-       fHistArmenteros[isSecd]->Fill(alfa,qt);\r
-       fHistV0RadiusZ[isSecd]->Fill(rMC2D,xyzMC[2]);\r
-       fHistV0RadiusXY[isSecd]->Fill(xyzMC[0],xyzMC[1]);\r
-       fHistV0RadiusZVSPt[isSecd]->Fill(ptV0MC,xyzMC[2]);\r
-           \r
-      }\r
-      else if (pdgCode==3122){ //Lambda\r
-       fHistPiPMonitorCuts[isSecd]->Fill(17);\r
-       \r
-       fHistPiPEtaDMC[1]->Fill(etaMC00,ptV0MC);\r
-       fHistPiPEtaDMC[1]->Fill(etaMC01,ptV0MC);\r
-\r
-       fHistPiPMassVSPt[isSecd]->Fill(massV0MC,ptV0MC);\r
-       fHistPiPMass[isSecd]->Fill(massV0MC);  \r
-       //  fHistPiPPtDaughters[isSecd]->Fill(ptMinus,ptPlus);\r
-       fHistPiPPtVSY[isSecd]->Fill(rapidity,ptV0MC);\r
-          \r
-       Double_t ctL=0.0;\r
-       if(pV0MC>0.0) ctL=declength*1.115683/pV0MC;\r
-       fHistPiPDecayLengthVsPt[isSecd]->Fill(ptV0MC,ctL);\r
-\r
-       //all V0s hito  \r
-       fHistArmenteros[isSecd]->Fill(alfa,qt);\r
-       fHistV0RadiusZ[isSecd]->Fill(rMC2D,xyzMC[2]);\r
-       fHistV0RadiusXY[isSecd]->Fill(xyzMC[0],xyzMC[1]);\r
-       fHistV0RadiusZVSPt[isSecd]->Fill(ptV0MC,xyzMC[2]);\r
-      }\r
-      else if (pdgCode==-3122){ //AntiLambda\r
-       fHistPiAPMonitorCuts[isSecd]->Fill(17);\r
-           \r
-       fHistPiPEtaDMC[1]->Fill(etaMC00,ptV0MC);\r
-       fHistPiPEtaDMC[1]->Fill(etaMC01,ptV0MC);\r
-\r
-       fHistPiAPMassVSPt[isSecd]->Fill(massV0MC,ptV0MC);\r
-       fHistPiAPMass[isSecd]->Fill(massV0MC);\r
-       //  fHistPiAPPtDaughters[isSecd]->Fill(ptMinus,ptPlus);\r
-       fHistPiAPPtVSY[isSecd]->Fill(rapidity,ptV0MC);\r
-         \r
-       Double_t ctAL=0.0;\r
-       if(pV0MC>0.0) ctAL=declength*1.115683/pV0MC;\r
-       fHistPiAPDecayLengthVsPt[isSecd]->Fill(ptV0MC,ctAL);\r
-\r
-       //all V0s histo    \r
-       fHistArmenteros[isSecd]->Fill(alfa,qt);\r
-       fHistV0RadiusZ[isSecd]->Fill(rMC2D,xyzMC[2]);\r
-       fHistV0RadiusXY[isSecd]->Fill(xyzMC[0],xyzMC[1]);\r
-       fHistV0RadiusZVSPt[isSecd]->Fill(ptV0MC,xyzMC[2]);\r
-       fHistV0RadiusXYVSY[isSecd]->Fill(rapidity,rMC2D);\r
-      }\r
-    }//MC true ana\r
-    else{// V0 reco ana\r
-      V0RecoLoop(id0,id1,isSecd,pdgCode,ptV0MC,pdgMother,ptXiMother);\r
-    }\r
-      \r
-  }//end MC stack loop\r
-   \r
-}\r
-//________________________________________________________________________\r
-void AliAnalysisTaskV0ForRAA::V0RecoLoop(Int_t id0,Int_t id1,Int_t isSecd,Int_t what,Double_t ptV0MC, Int_t pdgMother,Double_t ptXiMother){\r
-  //loop over reconstructed particles\r
-\r
-   \r
-  //--------------------- define variables -----------------------//\r
-  Double_t pp[3];\r
-  Double_t pm[3];\r
-  Double_t xr[3];\r
-   \r
-  Double_t massPi=0.13957018;\r
-  Double_t massP=0.93827203;\r
-  \r
-  TLorentzVector positivesMIP;\r
-  TLorentzVector negativesMIAP;\r
-  TLorentzVector positivesMIPi;\r
-  TLorentzVector negativesMIPi;\r
-\r
-  /*\r
-    AliKFParticle::SetField(fESD->GetMagneticField());\r
-    AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));\r
-    AliKFVertex primVtxImproved = primVtx;\r
-\r
-    AliKFParticle* negPiKF=NULL;\r
-    AliKFParticle* posPiKF=NULL;\r
-    AliKFParticle* posPKF=NULL;\r
-    AliKFParticle* negAPKF=NULL;\r
-  */\r
-\r
-  AliESDtrack* trackPos=NULL;\r
-  AliESDtrack* trackNeg=NULL;\r
-  AliESDtrack* trackPosTest = NULL;\r
-  AliESDtrack* trackNegTest =NULL;\r
-\r
-  Float_t nSigmaTPCtrackPosToPion;\r
-  Float_t nSigmaTPCtrackNegToPion;\r
-  Float_t nSigmaTPCtrackPosToProton;\r
-  Float_t nSigmaTPCtrackNegToProton;\r
-\r
-  Double_t primaryVtxPosition[3];\r
-  primaryVtxPosition[0] = fESD->GetPrimaryVertex()->GetXv();\r
-  primaryVtxPosition[1] = fESD->GetPrimaryVertex()->GetYv();\r
-  primaryVtxPosition[2] = fESD->GetPrimaryVertex()->GetZv();\r
-   \r
-  Int_t nV0 = fESD->GetNumberOfV0s();\r
-  AliESDv0 * v0MIs=NULL;\r
-   \r
-  //------------------------ V0 reco loop --------------------//\r
-  for(Int_t iV0MI = 0; iV0MI < nV0; iV0MI++) {//V0 loop\r
-    //-- get V0 info --//\r
-    v0MIs = fESD->GetV0(iV0MI);\r
-\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(1);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(1);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(1);\r
-\r
-    //------------ get references of daughters --------------//\r
-    //-- esd tracks --//\r
-    trackPosTest = fESD->GetTrack(v0MIs->GetPindex());\r
-    trackNegTest = fESD->GetTrack(v0MIs->GetNindex());\r
-     \r
-    if ( trackPosTest->GetSign() == trackNegTest->GetSign()) continue;\r
-        \r
-    fHistPiPiMonitorCuts[isSecd]->Fill(2);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(2);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(2);\r
-      \r
-    //-- for MC mode --//\r
-    if(fMCMode){\r
-      //check MC labels (and find partners for MC truth V0 daughters for fMCTruthMode=kTRUE)\r
-      if(!GetMCTruthPartner(trackPosTest,trackNegTest,id0,id1)) continue;\r
-    }\r
-\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(3);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(3);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(3);\r
-\r
-    //-- onthefly selection --//\r
-    Bool_t onthefly = v0MIs->GetOnFlyStatus();\r
-    if(fOntheFly!=onthefly) continue;\r
-\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(4);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(4);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(4);\r
-         \r
-    //--  get eta from V0 daughters --//\r
-    Double_t posDaughterEta=0.0;\r
-    Double_t negDaughterEta=0.0;\r
-      \r
-    Double_t eta00 = trackPosTest->Eta();\r
-    Double_t eta01 = trackNegTest->Eta();\r
-            \r
-    //---------- check sign assignment for daughters --------//\r
-    Bool_t switchSign = kFALSE;\r
-      \r
-    if( trackPosTest->GetSign() >0){//pos\r
-      trackPos =fESD->GetTrack(v0MIs->GetPindex());\r
-      trackNeg =fESD->GetTrack(v0MIs->GetNindex());\r
-\r
-      v0MIs->GetPPxPyPz(pp[0],pp[1],pp[2]);\r
-      v0MIs->GetNPxPyPz(pm[0],pm[1],pm[2]);\r
-\r
-      posDaughterEta =v0MIs->GetParamP()->Eta();\r
-      negDaughterEta=v0MIs->GetParamN()->Eta();\r
-      \r
-      /*      \r
-             if (negPiKF) delete negPiKF; negPiKF=NULL;\r
-             if (posPiKF) delete posPiKF; posPiKF=NULL;\r
-             if (posPKF) delete posPKF; posPKF=NULL;\r
-             if (negAPKF) delete negAPKF; negAPKF=NULL;\r
-\r
-             negPiKF = new AliKFParticle( *(v0MIs->GetParamN()) ,-211);\r
-             posPiKF = new AliKFParticle( *(v0MIs->GetParamP()) ,211);\r
-             posPKF = new AliKFParticle( *(v0MIs->GetParamP()) ,2212);\r
-             negAPKF = new AliKFParticle( *(v0MIs->GetParamN()) ,-2212);\r
-      */\r
-    }\r
-    if( trackPosTest->GetSign() <0){//neg\r
-      trackPos =fESD->GetTrack(v0MIs->GetNindex());\r
-      trackNeg =fESD->GetTrack(v0MIs->GetPindex());\r
-     \r
-      v0MIs->GetNPxPyPz(pp[0],pp[1],pp[2]);\r
-      v0MIs->GetPPxPyPz(pm[0],pm[1],pm[2]);\r
-      \r
-      posDaughterEta = v0MIs->GetParamN()->Eta();\r
-      negDaughterEta = v0MIs->GetParamP()->Eta();\r
-        \r
-      /*\r
-       if (negPiKF) delete negPiKF; negPiKF=NULL;\r
-       if (posPiKF) delete posPiKF; posPiKF=NULL;\r
-       if (posPKF) delete posPKF; posPKF=NULL;\r
-       if (negAPKF) delete negAPKF; negAPKF=NULL;\r
-\r
-\r
-       negPiKF = new AliKFParticle( *(v0MIs->GetParamP()) ,-211);\r
-       posPiKF = new AliKFParticle( *(v0MIs->GetParamN()) ,211);\r
-       posPKF = new AliKFParticle( *(v0MIs->GetParamN()) ,2212);\r
-       negAPKF = new AliKFParticle( *(v0MIs->GetParamP()) ,-2212);\r
-      */\r
-      switchSign = kTRUE;\r
-      eta01 = trackPosTest->Eta();\r
-      eta00 = trackNegTest->Eta();\r
-\r
-    }\r
-    \r
-    // ------------- calc masses and 4 vectors -------------- //\r
-    //K0\r
-    positivesMIPi.SetXYZM(pp[0],pp[1],pp[2],massPi);\r
-    negativesMIPi.SetXYZM(pm[0],pm[1],pm[2],massPi);\r
-    TLorentzVector v0K0=positivesMIPi+negativesMIPi;\r
-    \r
-    //Lambda\r
-    positivesMIP.SetXYZM(pp[0],pp[1],pp[2],massP);\r
-    TLorentzVector v0Lambda=positivesMIP+negativesMIPi;\r
-     \r
-    //Anitlambda\r
-    negativesMIAP.SetXYZM(pm[0],pm[1],pm[2],massP);\r
-    TLorentzVector v0ALambda=positivesMIPi+negativesMIAP;\r
-     \r
-    //---------------------AliKFParticle ---------------------//\r
-    /*  \r
-       Double_t chi2K0C=0.0;\r
-       Double_t chi2LambdaC=0.0;\r
-       Double_t chi2ALambdaC=0.0;\r
-\r
-     \r
-       AliKFParticle v0K0KF;\r
-       v0K0KF +=(*negPiKF);\r
-       v0K0KF +=(*posPiKF);\r
-       //v0K0C.SetVtxGuess(xr[0],xr[1],xr[2]);\r
-       v0K0KF.SetProductionVertex(primVtxImproved);\r
-         \r
-       AliKFParticle v0LambdaKF;\r
-       v0LambdaKF +=(*negPiKF);\r
-       v0LambdaKF +=(*posPKF);\r
-       //v0LambdaC.SetVtxGuess(xr[0],xr[1],xr[2]);\r
-       v0LambdaKF.SetProductionVertex(primVtxImproved);\r
-         \r
-       AliKFParticle v0ALambdaKF;\r
-       v0ALambdaKF +=(*negAPKF);\r
-       v0ALambdaKF +=(*posPiKF);\r
-       //v0ALambdaC.SetVtxGuess(xr[0],xr[1],xr[2]);\r
-       v0ALambdaKF.SetProductionVertex(primVtxImproved);\r
-       \r
-       if( v0K0KF.GetNDF() != 0) {\r
-       chi2K0C = v0K0KF.GetChi2()/v0K0KF.GetNDF();\r
-       }\r
-\r
-       Double_t chi2LambdaC=100000.;\r
-       if( v0LambdaKF.GetNDF() != 0) {\r
-       chi2LambdaC = v0LambdaKF.GetChi2()/v0LambdaKF.GetNDF();\r
-       }\r
-\r
-       Double_t chi2ALambdaC=100000.;\r
-       if( v0ALambdaKF.GetNDF() != 0) {\r
-       chi2ALambdaC = v0ALambdaKF.GetChi2()/v0ALambdaKF.GetNDF();\r
-       }\r
-    */\r
-    \r
-    // ----------------- for MC mode ------------------------ //\r
-    Bool_t fillK0sMC = kTRUE;\r
-    Bool_t fillLambdaMC = kTRUE;\r
-    Bool_t fillALambdaMC = kTRUE;\r
-\r
-    if(fMCMode && fMCTruthMode) {\r
-      if(what == 310) {\r
-       fillLambdaMC = kFALSE;\r
-       fillALambdaMC = kFALSE;\r
-      }\r
-      else if(what == 3122){\r
-       fillALambdaMC = kFALSE;\r
-       fillK0sMC = kFALSE;\r
-      }\r
-      else if(what == -3122){\r
-       fillLambdaMC = kFALSE;\r
-       fillK0sMC = kFALSE;\r
-      }\r
-    }\r
-   \r
-    //----------------- prepare for V0 ana ------------------//\r
-    TVector3 ppTrack(pp);\r
-    TVector3 pmTrack(pm);\r
-      \r
-    Double_t posDaughterPt = ppTrack.Pt();\r
-    Double_t negDaughterPt = pmTrack.Pt();\r
-    /*\r
-      Double_t v0sPt=v0MIs->Pt();\r
-      if(what == 310 || what ==0){\r
-      fHistPiPiEtaDReco[0]->Fill(posDaughterPt,v0sPt);\r
-      fHistPiPiEtaDReco[0]->Fill(negDaughterPt,v0sPt);\r
-      }\r
-      if(fabs(what) == 3122 || what == 0){\r
-      fHistPiPEtaDReco[0]->Fill(posDaughterPt,v0sPt);\r
-      fHistPiPEtaDReco[0]->Fill(negDaughterPt,v0sPt);\r
-      }\r
-    */\r
-    //------------------- DCA daughters ---------------------//\r
-    //-- between the daughters --//\r
-    Double_t dcaDaughters = v0MIs->GetDcaV0Daughters();  \r
-    \r
-    //-- to primary vertex --\r
-    Double_t dcaPosToVertex=0.0,dcaNegToVertex=0.0;\r
-    Double_t dzPos=(primaryVtxPosition[0]-xr[0])*ppTrack.Y() - (primaryVtxPosition[1]-xr[1])*ppTrack.X();\r
-    dcaPosToVertex=TMath::Sqrt(dzPos*dzPos/(pow(ppTrack.X(),2)+pow(ppTrack.Y(),2)));\r
-    Double_t dzNeg=(primaryVtxPosition[0]-xr[0])*pmTrack.Y() - (primaryVtxPosition[1]-xr[1])*pmTrack.X();\r
-    dcaNegToVertex=TMath::Sqrt(dzNeg*dzNeg/(pow(pmTrack.X(),2)+pow(pmTrack.Y(),2)));\r
-     \r
-    // Double_t dcaPosToVertex[3];dcaNegToVertex[3];\r
-    // trackPos->GetImpactParameters(dcaPosToVertex[0],dcaPosToVertex[1]);\r
-    // trackNeg->GetImpactParameters(dcaNegToVertex[0],dcaNegToVertex[1]);\r
-        \r
-    // dcaPosToVertex = TMath::Sqrt(dcaPosToVertex[0]*dcaPosToVertex[0]+dcaPosToVertex[1]*dcaPosToVertex[1]);\r
-    // dcaNegToVertex = TMath::Sqrt(dcaNegToVertex[0]*dcaNegToVertex[0]+dcaNegToVertex[1]*dcaNegToVertex[1]);\r
-        \r
-    //dcaPosToVertex  =   posPKF->GetDistanceFromVertexXY(primaryVtxPosition);\r
-    //dcaNegToVertex  =   negPiKF->GetDistanceFromVertexXY(primaryVtxPosition);\r
-        \r
-    //------------------- dca and decay radius V0 -------------//\r
-    v0MIs->GetXYZ(xr[0],xr[1],xr[2]);\r
-       \r
-    Double_t dim2V0Radius      = TMath::Sqrt(xr[0]*xr[0]+xr[1]*xr[1]);\r
-\r
-    Double_t decayLength =\r
-      TMath::Sqrt(TMath::Power(xr[0] - primaryVtxPosition[0],2) +\r
-                 TMath::Power(xr[1] - primaryVtxPosition[1],2) +\r
-                 TMath::Power(xr[2] - primaryVtxPosition[2],2 ));\r
-\r
-    Double_t  dcaV0ToPrimVertex= v0MIs->GetD(primaryVtxPosition[0],primaryVtxPosition[1]);////v0K0KF.GetDistanceFromVertexXY(tPrimaryVtxPosition);\r
-\r
-    //-------------------- general cuts -------------------//\r
-    //-- esd track cuts for daughters --//\r
-    if(fESDTrackCuts){\r
-      if(!fESDTrackCuts->AcceptTrack(trackPosTest)) continue;\r
-      if(!fESDTrackCuts->AcceptTrack(trackNegTest)) continue;\r
-    }\r
-      \r
-    fHistPiPiMonitorCuts[isSecd]->Fill(5);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(5);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(5);\r
-      \r
-    //-- eta cut --//\r
-    if( fabs(posDaughterEta) > fEtaCutMCDaughtersVal || fabs(negDaughterEta) > fEtaCutMCDaughtersVal) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(6);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(6);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(6);\r
-\r
-    //-- pt cut --//\r
-    if( fabs(posDaughterPt)<fMinPt || fabs(negDaughterPt) < fMinPt ) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(7);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(7);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(7);\r
-\r
-      \r
-    //-- radius xy min cut --//\r
-    if(dim2V0Radius < fDecayRadXYMin) continue;\r
-    //     if(fabs(xr[1])<fDecayRadY) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(8);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(8);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(8);\r
-\r
-    //-- radius xy max cut --//\r
-    if(dim2V0Radius > fDecayRadXYMax) continue;\r
-    //     if(fabs(xr[1])<fDecayRadY) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(9);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(9);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(9);\r
-      \r
-    //-- decay length min ->ctau --//\r
-    //  if(decayLength<fDecayLengthMin) continue;\r
-    //       fHistPiPiMonitorCuts[isSecd]->Fill(11);\r
-    //       fHistPiPMonitorCuts[isSecd]->Fill(11);\r
-    //       fHistPiAPMonitorCuts[isSecd]->Fill(11);\r
-\r
-    //-- decay length max cut --//\r
-    if(decayLength>fDecayLengthMax) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(10);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(10);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(10);\r
-   \r
-    //----------------------- V0 variables --------------------//\r
-    //-- armenteros --//\r
-    TVector3 momTot = ppTrack + pmTrack;\r
-    Double_t lQlNeg = fabs(pmTrack.Dot(momTot)/momTot.Mag());\r
-    Double_t lQlPos = fabs(ppTrack.Dot(momTot)/momTot.Mag());\r
-    //return 1.-2./(1.+lQlNeg/lQlPos);\r
-    Double_t alfa =0.0;\r
-    Double_t den = lQlPos + lQlNeg;\r
-    if(den>0) alfa = (lQlPos - lQlNeg)/den;\r
-    TVector3 qtvec= pmTrack.Cross(momTot);//vecPip.Mag()*sqrt(1-pow(thetapip,2));\r
-    Double_t qt = qtvec.Mag()/momTot.Mag();\r
-\r
-    //-- momenta --//\r
-    Double_t ptK0s = v0K0.Pt();\r
-    Double_t ptLambda = v0Lambda.Pt();\r
-    Double_t ptALambda = v0ALambda.Pt();\r
-      \r
-    Double_t pK0s = v0K0.P();\r
-    Double_t pLambda = v0Lambda.P();\r
-    Double_t pALambda = v0ALambda.P();\r
-      \r
-    //-- masses --//\r
-    Double_t massK0s = v0K0.M();\r
-    Double_t massLambda = v0Lambda.M();\r
-    Double_t massALambda = v0ALambda.M();\r
-\r
-    //-- rapidity --//\r
-    Double_t rapK0s = v0MIs->Y(310);\r
-    Double_t rapL   = v0MIs->Y(3122);\r
-    Double_t rapAL  = v0MIs->Y(3122);\r
-\r
-    //-- other variables --//\r
-    Double_t opAng =   fabs(ppTrack.Angle(pmTrack));\r
-    //    if( ppTrack.Angle(pmTrack)<0.001) continue;  \r
-    //    if( ppTrack.Angle(pmTrack)<0.004) continue;   \r
-    \r
-    Double_t cosOPAng = v0MIs->GetV0CosineOfPointingAngle();\r
-    \r
-    /*     \r
-    //introduce more histo\r
-    Double_t errOnMassK0s = v0MIs->ChangeMassHypothesis(310);\r
-    Double_t errOnMassLambda = 0.0;\r
-    Double_t errOnMassALambda = 0.0;\r
-    if(!switchSign){\r
-    errOnMassLambda  = v0MIs->ChangeMassHypothesis(3122);\r
-    errOnMassALambda = v0MIs->ChangeMassHypothesis(-3122);\r
-    }\r
-    else{\r
-    errOnMassLambda  = v0MIs->ChangeMassHypothesis(-3122);\r
-    errOnMassALambda = v0MIs->ChangeMassHypothesis(3122);\r
-    }\r
-    */\r
-\r
-      \r
-    //------------------------ detector values -------------------------------//\r
-    //-- TPC ITS values pos --//\r
-    Int_t nclsTPCPos =  trackPos->GetNcls(1);\r
-    Int_t nclsTPCFindablePos =  trackPos->GetTPCNclsF();\r
-    Int_t nclsITSPos =  trackPos->GetNcls(0);\r
-    Double_t chi2PerClusterITSPos = -1.0;\r
-    if(nclsITSPos>0) chi2PerClusterITSPos = trackPos->GetITSchi2()/Double_t(nclsITSPos);\r
-    Double_t crossedRowsTPCPos = trackPos->GetTPCCrossedRows();\r
-      \r
-    //-- TPC ITS values neg --//\r
-    Int_t nclsTPCNeg =  trackNeg->GetNcls(1);\r
-    Int_t nclsTPCFindableNeg =  trackNeg->GetTPCNclsF();\r
-    Int_t nclsITSNeg =  trackNeg->GetNcls(0);\r
-    Double_t chi2PerClusterITSNeg = -1.0;\r
-    if(nclsITSNeg>0) chi2PerClusterITSNeg =trackNeg->GetITSchi2()/Double_t(nclsITSNeg);\r
-    Double_t crossedRowsTPCNeg = trackNeg->GetTPCCrossedRows();    \r
-\r
-    if(fMoreNclsThanRows && (crossedRowsTPCPos < nclsTPCPos || crossedRowsTPCNeg < nclsTPCNeg  )) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(11);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(11);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(11);\r
-      \r
-    if(fMoreNclsThanFindable && (nclsTPCFindablePos < nclsTPCPos || nclsTPCFindableNeg < nclsTPCNeg  )) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(12);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(12);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(12);      \r
-\r
-    if(chi2PerClusterITSNeg > fChi2PerClusterITS || chi2PerClusterITSPos > fChi2PerClusterITS ) continue;\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(13);\r
-    fHistPiPMonitorCuts[isSecd]->Fill(13);\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(13);  \r
-      \r
-    //-- cut flags for V0 specific cuts --//\r
-    Bool_t cutOKK0s = kTRUE;\r
-    Bool_t cutOKLambda = kTRUE;\r
-    Bool_t cutOKALambda = kTRUE;\r
-      \r
-    //-------------------------- K0 cuts -----------------------------//\r
-\r
-    if(dcaV0ToPrimVertex > fDCAToVertexK0) continue;\r
-    if(fabs(xr[2])>fDCAZ) continue;//like decay radius z component\r
-    fHistPiPiMonitorCuts[isSecd]->Fill(14);\r
-      \r
-    Double_t ctK0 = 0.0;\r
-    if(fabs(pK0s)>0.0)  ctK0 = decayLength*0.497614/pK0s;\r
-    if( ctK0 > fCtauK0s &&  fabs(ptK0s) <fCtauPtCutK0) cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(15);\r
-      \r
-    if((cosOPAng < fCosPointAngK && fabs(ptK0s) < fCPAPtCutK0) || cosOPAng<0.99) cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(16);\r
-\r
-    if(dcaDaughters > fDCADaughtersK0 )cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(17);\r
-        \r
-    if(dcaNegToVertex < fDCADaughtersToVtxSmall || dcaPosToVertex < fDCADaughtersToVtxSmall)  cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(18);\r
-\r
-    if(fRapCutV0 && fabs(rapK0s) > fRap) cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(19);  \r
-       \r
-    // if(chi2K0C > fChiCutKf) cutOKK0s = kFALSE;\r
-    if(opAng < fOpengAngleDaughters && fabs(ptK0s) < fOpAngPtCut )  cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(20);\r
-\r
-    Bool_t ptbinokK0s=kFALSE;\r
-    if( ptK0s < fQtCut &&  ptK0s > fQtCutPtLow ) ptbinokK0s=kTRUE;\r
-    Double_t qtval  = 0.2*fabs(alfa);\r
-    if(fArmCutK0 && ptbinokK0s && qt < qtval) cutOKK0s = kFALSE;\r
-    else  fHistPiPiMonitorCuts[isSecd]->Fill(21);\r
-       \r
-    //-------------------------- Lambda cuts -------------------------//\r
-    if(dcaV0ToPrimVertex > fDCAToVertexL) continue;\r
-    if(fabs(xr[2])>fDCAZ) continue;//like decay radius z component\r
-    fHistPiPMonitorCuts[isSecd]->Fill(14);\r
-         \r
-    Double_t ctL = 0.0;\r
-    if(fabs(pLambda)>0.0)  ctL = decayLength*1.115683/fabs(pLambda);\r
-    if(ctL > fCtauL && fabs(ptLambda) <fCtauPtCutL)  cutOKLambda = kFALSE;\r
-    else  fHistPiPMonitorCuts[isSecd]->Fill(15);\r
-      \r
-    if((cosOPAng<fCosPointAngL && fabs(ptLambda) < fCPAPtCutL)|| cosOPAng<0.99)  cutOKLambda = kFALSE;\r
-    else fHistPiPMonitorCuts[isSecd]->Fill(16);\r
-\r
-    if(dcaDaughters > fDCADaughtersL )cutOKLambda = kFALSE;\r
-    else  fHistPiPMonitorCuts[isSecd]->Fill(17);\r
\r
-    if( dcaNegToVertex < fDCADaughtersToVtxSmall || dcaPosToVertex < fDCADaughtersToVtxLarge)  cutOKLambda = kFALSE;\r
-    else  fHistPiPMonitorCuts[isSecd]->Fill(18);\r
-\r
-    if(fRapCutV0 && fabs(rapL) > fRap) cutOKLambda = kFALSE;\r
-    else  fHistPiPMonitorCuts[isSecd]->Fill(19);\r
-    /*  \r
-        if(chi2LambdaC > fChiCutKf) cutOKLambda = kFALSE;\r
-        else  fHistPiPMonitorCuts[isSecd]->Fill(20);\r
-    */\r
-    fHistPiPMonitorCuts[isSecd]->Fill(20);\r
-      \r
-    if(alfa<fAlfaCut  || (fArmCutL && qt>fQtCut)) cutOKLambda = kFALSE;\r
-    else  fHistPiPMonitorCuts[isSecd]->Fill(21);\r
-      \r
-    //--------------------------- ALambda cuts --------------------------//\r
-\r
-    if(dcaV0ToPrimVertex > fDCAToVertexL) continue;\r
-    if(fabs(xr[2])>fDCAZ) continue;//like decay radius z component\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(14);\r
-      \r
-    Double_t ctAL = 0.0;\r
-    if(fabs(pALambda)>0.0)  ctAL = decayLength*1.115683/fabs(pALambda);\r
-    if(ctAL > fCtauL &&  fabs(ptALambda) <fCtauPtCutL)  cutOKALambda = kFALSE;\r
-    else  fHistPiAPMonitorCuts[isSecd]->Fill(15);\r
-\r
-    if((cosOPAng<fCosPointAngL && fabs(ptALambda) < fCPAPtCutL)|| cosOPAng<0.99)  cutOKALambda = kFALSE;\r
-    else fHistPiAPMonitorCuts[isSecd]->Fill(16);\r
-      \r
-    if(dcaDaughters > fDCADaughtersAL )cutOKALambda = kFALSE;\r
-    else  fHistPiAPMonitorCuts[isSecd]->Fill(17);\r
-        \r
-    if( dcaPosToVertex < fDCADaughtersToVtxSmall || dcaNegToVertex < fDCADaughtersToVtxLarge)  cutOKALambda = kFALSE;\r
-    else fHistPiAPMonitorCuts[isSecd]->Fill(18);\r
-        \r
-    if(fRapCutV0 && fabs(rapAL) > fRap) cutOKALambda = kFALSE;\r
-    else fHistPiAPMonitorCuts[isSecd]->Fill(19);\r
-    /*\r
-      if(chi2ALambdaC > fChiCutKf) cutOKALambda = kFALSE;\r
-      else  fHistPiAPMonitorCuts[isSecd]->Fill(20);\r
-    */\r
-    fHistPiAPMonitorCuts[isSecd]->Fill(20);\r
-      \r
-    if((fArmCutL && qt>fQtCut) || alfa > -1.0*fAlfaCut) cutOKALambda = kFALSE;\r
-    else  fHistPiAPMonitorCuts[isSecd]->Fill(21);\r
-      \r
-    //--------------------- PID ----------------------------//\r
-    //-- dEdx --//  \r
-    nSigmaTPCtrackPosToPion = fabs(fESDpid->NumberOfSigmasTPC(trackPos,AliPID::kPion));\r
-    nSigmaTPCtrackNegToPion = fabs(fESDpid->NumberOfSigmasTPC(trackNeg,AliPID::kPion));\r
-    nSigmaTPCtrackPosToProton = fabs(fESDpid->NumberOfSigmasTPC(trackPos,AliPID::kProton));\r
-    nSigmaTPCtrackNegToProton = fabs(fESDpid->NumberOfSigmasTPC(trackNeg,AliPID::kProton));\r
-\r
-    Bool_t pipidEdx=kTRUE;\r
-    Bool_t pipdEdx =kTRUE;\r
-    Bool_t piapdEdx=kTRUE;\r
-\r
-    Double_t posDaughterP = ppTrack.Mag();\r
-    Double_t negDaughterP = pmTrack.Mag();\r
-\r
-    Double_t tpcsigPos= trackPos->GetTPCsignal();\r
-    Double_t tpcsigNeg= trackNeg->GetTPCsignal();\r
-\r
-    //-- dedx cut --//\r
-    if(fUsePID){\r
-      //       if(fabs(posDaughterP)<fPPIDcut && nSigmaTPCtrackPosToPion > fNSigma ){\r
-      //              pipidEdx =kFALSE;//k0s\r
-      //       }\r
-      if(fabs(posDaughterP)<fPPIDcut && tpcsigPos < 5.0){//no zero dedx values!\r
-       pipidEdx =kFALSE;//k0s\r
-       piapdEdx =kFALSE;//antilambda\r
-      }\r
-      if(fabs(posDaughterP)<fPPIDcut && (nSigmaTPCtrackPosToProton > fNSigma || tpcsigPos < 5.0)) pipdEdx =kFALSE;//lambda\r
-           \r
-      //       if(fabs(negDaughterP)<fPPIDcut && nSigmaTPCtrackNegToPion > fNSigma ){\r
-      //           pipidEdx =kFALSE;//k0s\r
-      //       }\r
-      if(fabs(negDaughterP)<fPPIDcut &&  tpcsigNeg < 5.0){//no zero dedx values!\r
-       pipidEdx =kFALSE;//k0s\r
-       pipdEdx =kFALSE;//lambda\r
-      }\r
-      if(fabs(negDaughterP)<fPPIDcut && (nSigmaTPCtrackNegToProton > fNSigma || tpcsigNeg< 5.0)) piapdEdx =kFALSE;//antilambda\r
-    }\r
-      \r
-     \r
-\r
-    //-------------------- V0 ana -------------------------//\r
-    //-- cut flags for furhter histos--//\r
-    Bool_t k0sOK=kFALSE;\r
-    Bool_t lambdaOK=kFALSE;\r
-    Bool_t alambdaOK=kFALSE;\r
-\r
-    //--  Check for K0 --//\r
-    if( cutOKK0s  && fillK0sMC && pipidEdx){\r
-      fHistPiPiMonitorCuts[isSecd]->Fill(22);\r
-      k0sOK=kTRUE;                 \r
-      if(massK0s>0.25 && massK0s<0.75 ){\r
-       fHistPiPiMonitorCuts[isSecd]->Fill(23);\r
-       fHistPiPiMass[isSecd]->Fill(massK0s);\r
-       fHistPiPiMassVSPt[isSecd]->Fill(massK0s,ptK0s);\r
-       fHistPiPiMassVSPtMCTruth[isSecd]->Fill(massK0s,ptV0MC);\r
-       fHistPiPiRadiusXY[isSecd]->Fill(massK0s,opAng);\r
-       fHistPiPiCosPointAng[isSecd]->Fill(dcaV0ToPrimVertex,cosOPAng);\r
-       fHistPiPiDecayLengthVsPt[isSecd]->Fill(ptK0s,ctK0);\r
-       fHistPiPiDecayLengthVsMass[isSecd]->Fill(massK0s,ctK0);\r
-       fHistPiPiDCADaughters[isSecd]->Fill(massK0s,dcaDaughters);\r
-       fHistPiPiDCADaughterPosToPrimVtxVSMass[isSecd]->Fill(massK0s,dcaPosToVertex);\r
-       fHistPiPiDCAVSMass[isSecd]->Fill(massK0s,dcaV0ToPrimVertex);\r
-       // fHistPiPiPtDaughters[isSecd]->Fill(posDaughterPt,negDaughterPt);\r
-       fHistPiPiPtVSY[isSecd]->Fill(rapK0s,ptK0s);\r
-      }\r
-      fHistArmenteros[isSecd]->Fill(alfa,qt);\r
-      fHistDedxSecPiPlus[isSecd]->Fill(posDaughterP,tpcsigPos);\r
-      fHistDedxSecPiMinus[isSecd]->Fill(negDaughterP,tpcsigNeg);\r
-\r
-      fHistV0RadiusZ[isSecd]->Fill(dim2V0Radius,xr[2]);\r
-      fHistV0RadiusXY[isSecd]->Fill(xr[0],xr[1]);\r
-      fHistV0RadiusZVSPt[isSecd]->Fill(ptK0s,dim2V0Radius);\r
-      fHistV0RadiusXYVSY[isSecd]->Fill(rapK0s,dim2V0Radius);\r
-\r
-      //-- detector values --/\r
-      fHistNclsITSPosK0[isSecd]->Fill(nclsITSPos);\r
-      fHistNclsITSNegK0[isSecd]->Fill(nclsITSNeg);\r
-      fHistNclsTPCPosK0[isSecd]->Fill(nclsTPCPos);\r
-      fHistNclsTPCNegK0[isSecd]->Fill(nclsTPCNeg);\r
-      fHistChi2PerNclsITSPosK0[isSecd]->Fill(chi2PerClusterITSPos);\r
-      fHistChi2PerNclsITSNegK0[isSecd]->Fill(chi2PerClusterITSNeg);\r
-    }\r
-    \r
-    //--  Check for Lambda --//\r
-    if(cutOKLambda && fillLambdaMC && pipdEdx){\r
-      fHistPiPMonitorCuts[isSecd]->Fill(22);\r
-      lambdaOK=kTRUE;\r
-      if( massLambda>1.05 && massLambda<1.25 ){\r
-       fHistPiPMonitorCuts[isSecd]->Fill(23);\r
-       fHistPiPMass[isSecd]->Fill(massLambda);\r
-       fHistPiPMassVSPtMCTruth[isSecd]->Fill(massLambda,ptV0MC);\r
-       fHistPiPMassVSPt[isSecd]->Fill(massLambda,ptLambda);\r
-       fHistPiPRadiusXY[isSecd]->Fill(massLambda,opAng);\r
-       fHistPiPCosPointAng[isSecd]->Fill(dcaV0ToPrimVertex,cosOPAng);\r
-       fHistPiPPtVSY[isSecd]->Fill(rapL,ptLambda);\r
-       //   fHistPiPPtDaughters[isSecd]->Fill(posDaughterPt,negDaughterPt);\r
-       fHistPiPDCADaughters[isSecd]->Fill(massLambda,dcaDaughters);\r
-       fHistPiPDCAVSMass[isSecd]->Fill(massLambda,dcaV0ToPrimVertex);\r
-       fHistPiPDCADaughterPosToPrimVtxVSMass[isSecd]->Fill(massLambda,dcaPosToVertex);\r
-       fHistPiPDecayLengthVsPt[isSecd]->Fill(ptLambda,ctL);\r
-       fHistPiPDecayLengthVsMass[isSecd]->Fill(massLambda,ctL);\r
-\r
-       //-- secondaries --//\r
-       if(isSecd==1){\r
-         if(fabs(pdgMother)==3112 || fabs(pdgMother)==3114 || fabs(pdgMother)==3222 || fabs(pdgMother)==3224 || fabs(pdgMother)==3214 ){\r
-           fHistPiPMassVSPtSecSigma[1]->Fill(massLambda,ptLambda);\r
-               \r
-         }\r
-         //  if(pdgMother==3334){\r
-         //              fHistPiPDCAtoPrimVtxOmega[1]->Fill(massLambda,dcaV0ToPrimVertex);\r
-         //           }\r
-         if(pdgMother==3322){\r
-           fHistPiPCosPointAngXiVsPt->Fill(ptLambda,cosOPAng);\r
-           fHistPiPMassVSPtSecXi[1]->Fill(massLambda,ptLambda);\r
-           fHistPiPMassVSYSecXi[1]->Fill(massLambda,rapL);\r
-           fHistPiPXi0PtVSLambdaPt[1]->Fill(ptLambda,ptXiMother);\r
-         }\r
-         if(pdgMother==3312){\r
-           fHistPiPCosPointAngXiVsPt->Fill(ptLambda,cosOPAng);\r
-           fHistPiPMassVSPtSecXi[1]->Fill(massLambda,ptLambda);\r
-           fHistPiPMassVSYSecXi[1]->Fill(massLambda,rapL);\r
-           fHistPiPXiMinusPtVSLambdaPt[1]->Fill(ptLambda,ptXiMother);\r
-         }\r
-       }  \r
-      }\r
-      if(ptLambda>0.4) fHistArmenteros[isSecd]->Fill(alfa,qt);\r
-      fHistV0RadiusZ[isSecd]->Fill(dim2V0Radius,xr[2]);\r
-      fHistV0RadiusXY[isSecd]->Fill(xr[0],xr[1]);\r
-      fHistV0RadiusZVSPt[isSecd]->Fill(ptLambda,dim2V0Radius);\r
-      fHistV0RadiusXYVSY[isSecd]->Fill(rapL,dim2V0Radius);\r
-      fHistDedxSecProt[isSecd]->Fill(posDaughterP,tpcsigPos);\r
-      fHistDedxSecPiMinus[isSecd]->Fill(negDaughterP,tpcsigNeg);\r
-        \r
-      //-- detector values --//\r
-      fHistNclsITSPosL[isSecd]->Fill(nclsITSPos);\r
-      fHistNclsITSNegL[isSecd]->Fill(nclsITSNeg);\r
-      fHistNclsTPCPosL[isSecd]->Fill(nclsTPCPos);\r
-      fHistNclsTPCNegL[isSecd]->Fill(nclsTPCNeg);\r
-      fHistChi2PerNclsITSPosL[isSecd]->Fill(chi2PerClusterITSPos);\r
-      fHistChi2PerNclsITSNegL[isSecd]->Fill(chi2PerClusterITSNeg);\r
-    }\r
-\r
\r
-    //-- Check for AntiLambda --//\r
-    if(cutOKALambda && fillALambdaMC && piapdEdx){\r
-      fHistPiAPMonitorCuts[isSecd]->Fill(22);\r
-      alambdaOK=kTRUE;\r
-      if( massALambda>1.05 && massALambda<1.25  ){\r
-       fHistPiAPMonitorCuts[isSecd]->Fill(23);\r
-       fHistPiAPMass[isSecd]->Fill(massALambda);\r
-       fHistPiAPMassVSPtMCTruth[isSecd]->Fill(massALambda,ptV0MC);\r
-       fHistPiAPMassVSPt[isSecd]->Fill(massALambda,ptALambda);\r
-       fHistPiAPRadiusXY[isSecd]->Fill(massALambda,opAng);\r
-       fHistPiAPCosPointAng[isSecd]->Fill(dcaV0ToPrimVertex,cosOPAng);\r
-       fHistPiAPPtVSY[isSecd]->Fill(rapAL,ptALambda);\r
-       //  fHistPiAPPtDaughters[isSecd]->Fill(posDaughterPt,negDaughterPt);\r
-       fHistPiAPDCADaughters[isSecd]->Fill(massALambda,dcaDaughters);\r
-       fHistPiAPDCAVSMass[isSecd]->Fill(massALambda,dcaV0ToPrimVertex);\r
-       fHistPiAPDCADaughterPosToPrimVtxVSMass[isSecd]->Fill(massALambda,dcaPosToVertex);\r
-       fHistPiAPDecayLengthVsPt[isSecd]->Fill(ptALambda,ctAL);\r
-       fHistPiAPDecayLengthVsMass[isSecd]->Fill(massALambda,ctAL);\r
-\r
-       //-- secondaries --//\r
-       if(isSecd==1){\r
-         if(fabs(pdgMother)==3112 || fabs(pdgMother)==3114 || fabs(pdgMother)==3222 || fabs(pdgMother)==3224 || fabs(pdgMother)==3214 ){\r
-           fHistPiAPMassVSPtSecSigma[1]->Fill(massALambda,ptALambda);\r
-         }\r
-         //  if(fabs(pdgMother)==3334){\r
-         //              fHistPiAPDCAtoPrimVtxOmega[1]->Fill(massALambda,dcaV0ToPrimVertex);\r
-         //           }\r
-         if(fabs(pdgMother) == 3322){\r
-           fHistPiAPCosPointAngXiVsPt->Fill(ptALambda,cosOPAng);\r
-           fHistPiAPMassVSPtSecXi[1]->Fill(massALambda,ptALambda);\r
-           fHistPiAPMassVSYSecXi[1]->Fill(massALambda,rapAL);\r
-           fHistPiAPXi0PtVSLambdaPt[1]->Fill(ptALambda,ptXiMother);\r
-         }\r
-         if(pdgMother == -3312){\r
-           fHistPiAPCosPointAngXiVsPt->Fill(ptALambda,cosOPAng);\r
-           fHistPiAPMassVSPtSecXi[1]->Fill(massALambda,ptALambda);\r
-           fHistPiAPMassVSYSecXi[1]->Fill(massALambda,rapAL);\r
-           fHistPiAPXiMinusPtVSLambdaPt[1]->Fill(ptALambda,ptXiMother);\r
-         }\r
-       }\r
-      }\r
-      if(ptALambda>0.4) fHistArmenteros[isSecd]->Fill(alfa,qt);\r
-      fHistDedxSecAProt[isSecd]->Fill(negDaughterP,tpcsigNeg);\r
-      fHistDedxSecPiPlus[isSecd]->Fill(posDaughterP,tpcsigPos);\r
-      fHistV0RadiusZ[isSecd]->Fill(dim2V0Radius,xr[2]);\r
-      fHistV0RadiusXY[isSecd]->Fill(xr[0],xr[1]);\r
-      fHistV0RadiusZVSPt[isSecd]->Fill(ptALambda,dim2V0Radius);\r
-      fHistV0RadiusXYVSY[isSecd]->Fill(rapAL,dim2V0Radius);\r
-\r
-    }\r
-    \r
-    //-- fill detector histos general --//\r
-    if(lambdaOK || alambdaOK || k0sOK){\r
-      //-- pos --//\r
-      fHistNclsITSPos[isSecd]->Fill(fabs(posDaughterPt),nclsITSPos);\r
-      fHistNclsTPCPos[isSecd]->Fill(nclsTPCFindablePos,nclsTPCPos);\r
-      fHistNCRowsTPCPos[isSecd]->Fill(fabs(posDaughterPt),crossedRowsTPCPos);\r
-      fHistChi2PerNclsITSPos[isSecd]->Fill(fabs(posDaughterPt),chi2PerClusterITSPos);\r
-      //--neg --//\r
-      fHistNclsITSNeg[isSecd]->Fill(fabs(negDaughterPt),nclsITSNeg);\r
-      fHistNclsTPCNeg[isSecd]->Fill(nclsTPCFindableNeg,nclsTPCNeg);\r
-      fHistNCRowsTPCNeg[isSecd]->Fill(fabs(negDaughterPt),crossedRowsTPCNeg);\r
-      fHistChi2PerNclsITSNeg[isSecd]->Fill(fabs(negDaughterPt),chi2PerClusterITSNeg);\r
-      \r
-      fHistNclsITS[isSecd]->Fill(nclsITSPos,nclsITSNeg);\r
-      //if(negDaughterPt >1.0)\r
-      fHistNclsTPC[isSecd]->Fill(crossedRowsTPCNeg,nclsTPCNeg);\r
-      \r
-      fHistPiPiEtaDReco[1]->Fill(posDaughterEta,eta00);\r
-      fHistPiPEtaDReco[1]->Fill(negDaughterEta,eta01);\r
-    }\r
-    \r
-    /*\r
-    //-- AliKFParticle --//\r
-    if (negPiKF) delete negPiKF; negPiKF=NULL;\r
-    if (posPiKF) delete posPiKF; posPiKF=NULL;\r
-    if (posPKF) delete posPKF; posPKF=NULL;\r
-    if (negAPKF) delete negAPKF; negAPKF=NULL;\r
-    */\r
-    if(fMCMode && fMCTruthMode) break;// otherwise we would not have ended up here\r
-  }//end V0 reco loop\r
-\r
-}\r
-  \r
-//________________________________________________________________________\r
-\r
-Int_t AliAnalysisTaskV0ForRAA::CalculateCentralityBin(){\r
-  //find centrality bin for centrality selection\r
-\r
-  if (fUseCentrality == 0) return -1;\r
-\r
-  AliCentrality *esdCentrality = fESD->GetCentrality();\r
-\r
-  Float_t centralityVZERO  = esdCentrality->GetCentralityPercentile("V0M");  \r
-  Float_t centralitySPD    = esdCentrality->GetCentralityPercentile("CL1");\r
-\r
-  Int_t centralityVZEROBin = -1;\r
-  Int_t centralitySPDBin   = -1;\r
-\r
-  //-- SPD centrality --//\r
-  if ( fUseCentrality == 2 ){\r
-    if      ( centralitySPD >=  0. && centralitySPD <   5.) centralitySPDBin =  0;\r
-    else if ( centralitySPD >=  5. && centralitySPD <  10.) centralitySPDBin =  5;\r
-    else if ( centralitySPD >= 10. && centralitySPD <  20.) centralitySPDBin = 10;\r
-    else if ( centralitySPD >= 20. && centralitySPD <  30.) centralitySPDBin = 20;\r
-    else if ( centralitySPD >= 30. && centralitySPD <  40.) centralitySPDBin = 30;\r
-    else if ( centralitySPD >= 40. && centralitySPD <  50.) centralitySPDBin = 40;\r
-    else if ( centralitySPD >= 50. && centralitySPD <  60.) centralitySPDBin = 50;\r
-    else if ( centralitySPD >= 60. && centralitySPD <  70.) centralitySPDBin = 60;\r
-    else if ( centralitySPD >= 70. && centralitySPD <  80.) centralitySPDBin = 70;\r
-    else if ( centralitySPD >= 80. && centralitySPD <  90.) centralitySPDBin = 80;\r
-    else if ( centralitySPD >= 90. && centralitySPD <  99.) centralitySPDBin = 90;\r
-    else if ( centralitySPD >= 99. ) centralitySPDBin = 100;\r
-    else if ( fabs(centralitySPD)< 0.0001 ) centralitySPDBin = 100;\r
-    return centralitySPDBin;\r
-  }\r
-  //-- V0 centrality --//\r
-  if ( fUseCentrality == 1 ){\r
-    if      ( centralityVZERO >  0. && centralityVZERO <   5.) centralityVZEROBin =  0;\r
-    else if ( centralityVZERO >=  5. && centralityVZERO <  10.) centralityVZEROBin =  5;\r
-    else if ( centralityVZERO >= 10. && centralityVZERO <  20.) centralityVZEROBin = 10;\r
-    else if ( centralityVZERO >= 20. && centralityVZERO <  30.) centralityVZEROBin = 20;\r
-    else if ( centralityVZERO >= 30. && centralityVZERO <  40.) centralityVZEROBin = 30;\r
-    else if ( centralityVZERO >= 40. && centralityVZERO <  50.) centralityVZEROBin = 40;\r
-    else if ( centralityVZERO >= 50. && centralityVZERO <  60.) centralityVZEROBin = 50;\r
-    else if ( centralityVZERO >= 60. && centralityVZERO <  70.) centralityVZEROBin = 60;\r
-    else if ( centralityVZERO >= 70. && centralityVZERO <  80.) centralityVZEROBin = 70;\r
-    else if ( centralityVZERO >= 80. && centralityVZERO <  90.) centralityVZEROBin = 80;\r
-    else if ( centralityVZERO >= 90. && centralityVZERO <  99.) centralityVZEROBin = 90;\r
-    else if ( centralityVZERO >= 99. ) centralityVZEROBin = 100;\r
-    else if ( fabs(centralityVZERO)< 0.0001 ) centralityVZEROBin = 100;\r
-    return centralityVZEROBin;\r
-  }\r
-  return -1;\r
-  \r
-}\r
-//________________________________________________________________________\r
-Bool_t  AliAnalysisTaskV0ForRAA::GetMCTruthPartner(AliESDtrack *pos,AliESDtrack *neg,Int_t id0,Int_t id1){\r
-  //-- get daughter label and check it --//\r
-  Int_t labelP = fabs(pos->GetLabel());\r
-  Int_t labelN = fabs(neg->GetLabel());\r
-\r
-  if (labelN==labelP)  return kFALSE;\r
-   \r
-  if(fMCTruthMode){\r
-    if ((labelP!=id0) && (labelP!=id1))  return kFALSE;\r
-    if ((labelN!=id0) && (labelN!=id1))  return kFALSE;\r
-  }\r
-\r
-  return kTRUE;\r
-}\r
+/***************************************************************          *
+ * Authors : Simone Schuchmann 
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-----------------------------------------------------------------
+// AliAnalysisTaskV0ForRAA class
+// This task is for analysing Lambda and K0s pt spectra in PbPb and
+// pp as well as with MC. The flag for pp and MC  must be set
+// accordingly, default is PbPb data.
+// It works with ESD files only.
+//-----------------------------------------------------------------
+
+
+#define AliAnalysisTaskV0ForRAA_cxx
+
+#include "AliAnalysisTaskV0ForRAA.h"
+
+#include "Riostream.h"
+
+#include "TROOT.h"
+#include "TH1.h"
+#include "TH2.h"
+#include "TLorentzVector.h"
+
+#include "AliAnalysisTaskSE.h"
+#include "AliAnalysisManager.h"
+#include "AliESDInputHandler.h"
+#include "AliMCEventHandler.h"
+
+#include "AliESDVZERO.h"
+#include "AliMultiplicity.h"
+#include "AliCentrality.h"
+
+#include "AliKFParticle.h"
+#include "AliKFVertex.h"
+#include "AliESDtrackCuts.h"
+#include "AliESDpid.h"
+#include "AliESDv0.h"
+#include "AliESDEvent.h"
+#include "AliMCEvent.h"
+#include "AliStack.h"
+#include "AliGenEventHeader.h"
+
+
+ClassImp(AliAnalysisTaskV0ForRAA)
+
+//________________________________________________________________________
+AliAnalysisTaskV0ForRAA::AliAnalysisTaskV0ForRAA(const char *name)
+:AliAnalysisTaskSE(name),
+  fESD(0),
+  fMCev(0),
+//----------other objects------------
+  fESDpid(0),
+  fESDTrackCuts(0),
+  fESDTrackCutsCharged(0),
+  fESDTrackCutsLowPt(0),
+  fOutputContainer(0),
+//-----------event histos-----------
+  fHistITSLayerHits(0),
+  fHistOneHitWithSDD(0),
+  fHistNEvents(0),
+  fHistPrimVtxZESDVSNContributors(0),
+  fHistPrimVtxZESDTPCVSNContributors(0),
+  fHistPrimVtxZESDSPDVSNContributors(0),
+  fHistPrimVtxZESDVSNContributorsMC(0),
+  fHistPrimVtxZESDTPCVSNContributorsMC(0),
+  fHistPrimVtxZESDSPDVSNContributorsMC(0),
+  fHistPrimVtxZESD(0),
+  fHistPrimVtxZESDTPC(0),
+  fHistPrimVtxZESDSPD(0),
+  fHistESDVertexZ(0),
+  fHistMCVertexZ(0),
+  fHistMuliplicity(0),
+  fHistMuliplicityRaw(0),
+  fHistCentBinRaw(0),
+  fHistCentBin(0),
+  fHistMultiplicityPrimary(0),
+  fHistNPrim(0),
+//--------MC pdg code histos-------------
+//K0s
+  fHistPiPiPDGCode(0),
+//Lambda
+  fHistPiPPDGCode(0),
+  fHistPiPCosPointAngXiVsPt(0),
+  fHistPiPMassVSPtSecXiMCTruth(0),
+  fHistPiPMassVSPtSecOmegaMCTruth(0),
+//AntiLambda
+  fHistPiAPPDGCode(0),
+  fHistPiAPCosPointAngXiVsPt(0),
+  fHistPiAPMassVSPtSecXiMCTruth(0),
+  fHistPiAPMassVSPtSecOmegaMCTruth(0),
+// fHistUserPtShift(0),
+
+//----------selection booleans and values---------
+  fMCMode(0),
+  fMCTruthMode(0),
+  fSelectInjected(0),
+  fSelectMBMotherMC(0),
+  fCheckNegLabelReco(0),
+  fOnlyFoundRecoV0(0),
+  fUseCentrality(0),
+  fUseCentralityBin(0),
+  fUseCentralityRange(0),
+  fAnapp(0),
+  fSelSDD(0),
+  fSelNoSDD(0),
+  fOntheFly(0),
+  fVertexZCut(0),
+  fVtxStatus(0),
+  fUsePID(0),
+  fNSigma(0),
+  fPPIDcut(0),
+  fPtTPCCut(0),
+  fMoreNclsThanRows(0),
+  fMoreNclsThanFindable(0),
+  fMoreNclsThanFindableMax(0),
+  fRatioFoundOverFindable(0),
+  fRatioMaxCRowsOverFindable(0),
+  fChi2PerClusterITS(0),
+  fRapCutV0(0),
+  fRap(0),
+  fEtaCutMCDaughters(0),
+  fEtaCutMCDaughtersVal(0),
+  fMinPt(0),
+  fAlfaCut(0),
+  fQtCut(0),
+  fQtCutPtLow(0),
+  fArmCutK0(0),      
+  fArmCutL(0),
+  fArmQtSlope(0),
+  fExcludeLambdaFromK0s(0),
+  fExcludeK0sFromLambda(0),
+  fDCAToVertexK0(0),
+  fDCAToVertexL(0),
+  fDCAXK(0),
+  fDCAYK(0),
+  fDCAXL(0),
+  fDCAYL(0),
+  fDCAZ(0),
+  fDCADaughtersL(0),
+  fDCADaughtersAL(0),
+  fDCADaughtersK0(0),
+  fDCADaughtersToVtxLarge(0),
+  fDCADaughtersToVtxSmall(0),
+  fDecayRadXYMin(0),
+  fDecayRadXYMax(0),
+  fCosPointAngL(0),
+  fCosPointAngK(0),
+  fCPAPtCutK0(0),
+  fCPAPtCutL(0),
+  fOpengAngleDaughters(0),
+  fOpAngPtCut(0),
+  fDecayLengthMax(0),
+  fDecayLengthMin(0),
+  fCtauK0s(0),
+  fCtauL(0),
+  fCtauPtCutK0(0),
+  fCtauPtCutL(0),
+  fChiCutKf(0) 
+  //  fShift(0),
+  // fDeltaInvP(0)
+{  // Constructor
+
+  DefineOutput(1,TList::Class());
+
+  // define defaults for globals
+  /*
+    fShift = kFALSE;                       // shift in charge/pt yes/no
+    fDeltaInvP = 0.00;                     // shift value
+  */
+  
+  //MC general
+  fMCMode      = kFALSE; // run on MC reco or MC as data
+  fMCTruthMode = kFALSE; // run on MC truth (needed kTRUE for MC reco as well)
+  //MC mode
+  fSelectInjected    = kFALSE; // reject injected particles in MC
+  fSelectMBMotherMC  = kFALSE; // reject injected mothers of particles in MC
+  fCheckNegLabelReco = kFALSE; // check if particle with negative reco label is bad in MC truth
+  fOnlyFoundRecoV0   = kFALSE; // select only found reco V0 in MC truth 
+
+  //centrality
+  fUseCentrality      = 0; // flag for centrality usage
+  fUseCentralityBin   = 0; // select centrality bin
+  fUseCentralityRange = 0; // set centrality bin range
+
+  //pp analysis
+  fAnapp    = kFALSE; // analyse pp collisions
+  fSelSDD   = kFALSE; // select events with SDD
+  fSelNoSDD = kFALSE; // select events without SDD
+  //vertex
+  fVertexZCut = 100000.0; // select z vertex window
+  fVtxStatus  = kFALSE;   // check vertex status
+   
+  //V0 finder
+  fOntheFly   = kTRUE;    // on-the-fly V0 finder default
+
+
+  //----- define defaults for V0 and track cuts ----//
+  
+  fMoreNclsThanRows          = kFALSE; // cut on more TPC clusters than crossed rows
+  fMoreNclsThanFindable      = kFALSE; // cut on more TPC clusters than findable clusters
+  fMoreNclsThanFindableMax   = kFALSE; // cut on more TPC clusters than findalbe max
+  fRatioFoundOverFindable    = -1.0;   // cut value on ratio TPC clusters found over findable
+  fRatioMaxCRowsOverFindable = 1000.0; // cut value on max ratio TPC crossed rows over findable clusters
+
+  fChi2PerClusterITS = 100000.0; // cut value on chi2 per ITS cluster
+
+  //PID
+  fUsePID                    = kFALSE; // use PID dEdx TPC  
+  fNSigma            = 100000.0; // number of sigmas in TPC dEdx
+  fPPIDcut           = 100.0;    // select momentum for PID cut
+  fPtTPCCut          = -1.0;     // select pt value for low and high pt esd track cuts
+
+
+  fRapCutV0 = kFALSE; // cut on rapidity
+  fRap      = 1000.0; // cut value on rapidity
+
+  fAlfaCut    = -100.0; // cut value on alpha of armenteros-podolanski diagram
+  fQtCut      =  100.0; // cut value on qt of armenteros-podolanski diagram
+  fQtCutPtLow = -1.0;   // select pt max for cut on qt in armenteros-podolanski diagram
+  fArmCutK0   = kFALSE; // cut in armenteros-podolanski diagram  for K0s
+  fArmCutL    = kFALSE; // cut in armenteros-podolanski diagram  for Lambda
+  fArmQtSlope = 0.2;    // slope of diagonal cut in armenteros-podolanski diagram  for K0s
+
+  fExcludeLambdaFromK0s = -1.0; //cut value on mass exclusion of Lambdas from K0s
+  fExcludeK0sFromLambda = -1.0; //cut value on mass exclusion of K0s from Lambdas
+
+  fEtaCutMCDaughters    = kFALSE; // cut on eta in MC truth
+  fEtaCutMCDaughtersVal = 50.0;   // cut value on eta for data, MC reco and truth
+
+  fMinPt= -1.0; // cut value on min pt
+  //DCA to vertex in 2D and 1D cut value
+  fDCAToVertexK0 = 10000.0;// 2D K0s
+  fDCAToVertexL  = 10000.0;// 2D Lambda
+  fDCAXK         = 10000.0;// 1D x K0s
+  fDCAYK         = 10000.0;// 1D y K0s
+  fDCAXL         = 10000.0;// 1D x Lambda
+  fDCAYL         = 10000.0;// 1D y Lambda
+  fDCAZ          = 10000.0;// 1D z all
+   
+  // DCA between daughters cut value
+  fDCADaughtersL  = 10000.0;
+  fDCADaughtersAL = 10000.0;
+  fDCADaughtersK0 = 10000.0;
+
+  // DCA of daughters to vertex cut value
+  fDCADaughtersToVtxLarge = -1.0; //large value ((a)proton)
+  fDCADaughtersToVtxSmall = -1.0; //small value (pion)
+
+  //decay radii 2D cut value
+  fDecayRadXYMin  = -100000.0;
+  fDecayRadXYMax  =  100000.0;
+
+  //decay length 3D cut value
+  fDecayLengthMax =  100000.0;
+  fDecayLengthMin = -100000.0;
+
+  //cosine of pointing angle cut value
+  fCosPointAngL = -1.0;
+  fCosPointAngK = -1.0;
+  fCPAPtCutK0   = 1000.0; // pt max for cut
+  fCPAPtCutL    = 1000.0; // pt max for cut
+  //opening angle between daughters cut value 
+  fOpengAngleDaughters = -1.0;
+  fOpAngPtCut          = -1.0; // pt max for cut
+
+  //ctau cut values
+  fCtauK0s     = 1000.0;
+  fCtauL       = 1000.0;
+  fCtauPtCutK0 = 1000.0; // pt max for cut
+  fCtauPtCutL  = 1000.0; // pt max for cut
+
+  fChiCutKf = 1000000.0; // cut value on chi2 of KF particle mass fit
+
+   
+  //---- histograms ----//
+  for(Int_t j=0;j<2;j++){
+    fHistV0RadiusZ[j]     =NULL;
+    fHistV0RadiusZVSPt[j] =NULL;
+    fHistV0RadiusXY[j]    =NULL;
+    fHistV0RadiusXYVSY[j] =NULL;
+    fHistArmenteros[j]    =NULL;
+  
+    if(j<1){ //K0
+      fHistPiPiMass[j]                         =NULL;
+      fHistPiPiMassVSPt[j]                     =NULL;
+      fHistPiPiMassVSPtMCTruth[j]              =NULL;
+      // fHistPiPiMassVSAlpha[j]=NULL;
+      fHistPiPiRadiusXY[j]                     =NULL;
+      fHistPiPiCosPointAng[j]                  =NULL;
+      fHistPiPiDecayLengthVsPt[j]              =NULL;
+      fHistPiPiDecayLengthVsMass[j]            =NULL;
+      fHistPiPiDecayLengthVsCtau[j]            =NULL;
+      fHistPiPiDCADaughterPosToPrimVtxVSMass[j]=NULL;
+      fHistPiPiDCADaughters[j]                 =NULL; 
+      //    fHistPiPiPtDaughters[j]=NULL;
+      fHistPiPiPtVSY[j]                        =NULL;
+      fHistPiPiDCAVSMass[j]                    =NULL;
+      fHistPiPiMonitorCuts[j]                  =NULL;
+      fHistPiPiMonitorMCCuts[j]                =NULL;
+      fHistPiPiDecayLengthResolution[j]        =NULL;
+      
+      fHistNclsITSPosK0[j]                     =NULL;
+      fHistNclsITSNegK0[j]                     =NULL;
+      fHistNclsTPCPosK0[j]                     =NULL;
+      fHistNclsTPCNegK0[j]                     =NULL;
+      fHistChi2PerNclsITSPosK0[j]              =NULL;
+      fHistChi2PerNclsITSNegK0[j]              =NULL;
+    }
+    
+    //Lambda
+    fHistPiPMass[j]                            =NULL;
+    fHistPiPMassVSPt[j]                        =NULL;
+    fHistPiPMassVSPtMCTruth[j]                 =NULL;
+    fHistPiPRadiusXY[j]                        =NULL;
+    fHistPiPCosPointAng[j]                     =NULL;
+    fHistPiPDecayLengthVsPt[j]                 =NULL;
+    fHistPiPDecayLengthVsMass[j]               =NULL;
+    fHistPiPDecayLengthVsCtau[j]               =NULL;
+    fHistPiPDCADaughterPosToPrimVtxVSMass[j]   =NULL;
+    fHistPiPMassVSPtSecSigma[j]                =NULL;
+    fHistPiPMassVSPtSecXi[j]                   =NULL;
+    fHistPiPMassVSPtSecOmega[j]                =NULL;
+    fHistPiPMassVSYSecXi[j]                    =NULL;
+    fHistPiPXi0PtVSLambdaPt[j]                 =NULL;
+    fHistPiPXiMinusPtVSLambdaPt[j]             =NULL;
+    fHistPiPOmegaPtVSLambdaPt[j]               =NULL;
+    fHistPiPDCADaughters[j]                    =NULL;
+    //  fHistPiPPtDaughters[j]=NULL;
+    fHistPiPPtVSY[j]                           =NULL;
+    fHistPiPDCAVSMass[j]                       =NULL;
+    fHistPiPMonitorCuts[j]                     =NULL;
+    fHistPiPMonitorMCCuts[j]                   =NULL;
+    fHistPiPDecayLengthResolution[j]           =NULL;
+      
+    //AntiLambda
+    fHistPiAPMass[j]                           =NULL;
+    fHistPiAPMassVSPt[j]                       =NULL;
+    fHistPiAPMassVSPtMCTruth[j]                =NULL;
+    fHistPiAPRadiusXY[j]                       =NULL;
+    fHistPiAPCosPointAng[j]                    =NULL;
+    fHistPiAPDecayLengthVsPt[j]                =NULL;
+    fHistPiAPDecayLengthVsMass[j]              =NULL;
+    fHistPiAPDecayLengthVsCtau[j]              =NULL;
+    fHistPiAPDCADaughterPosToPrimVtxVSMass[j]  =NULL;
+    fHistPiAPMassVSPtSecSigma[j]               =NULL;
+    fHistPiAPMassVSPtSecXi[j]                  =NULL;
+    fHistPiAPMassVSPtSecOmega[j]               =NULL;
+    fHistPiAPMassVSYSecXi[j]                   =NULL;
+    fHistPiAPXi0PtVSLambdaPt[j]                =NULL;
+    fHistPiAPXiMinusPtVSLambdaPt[j]            =NULL;
+    fHistPiAPOmegaPtVSLambdaPt[j]              =NULL;
+    fHistPiAPDCADaughters[j]                   =NULL;
+    // fHistPiAPPtDaughters[j]=NULL;
+    fHistPiAPPtVSY[j]                          =NULL;
+    fHistPiAPDCAVSMass[j]                      =NULL;
+    fHistPiAPMonitorCuts[j]                    =NULL;
+    fHistPiAPMonitorMCCuts[j]                  =NULL;
+    fHistPiAPDecayLengthResolution[j]          =NULL;
+
+    //----- other ------------------//
+    //dedx
+    fHistDedxSecProt[j]               =NULL;
+    fHistDedxSecAProt[j]              =NULL;
+    fHistDedxSecPiMinus[j]            =NULL;
+    fHistDedxSecPiPlus[j]             =NULL;
+    fHistDedxProt[j]                  =NULL;
+    fHistDedxAProt[j]                 =NULL;
+    fHistDedxPiMinus[j]               =NULL;
+    fHistDedxPiPlus[j]                =NULL;
+    //TPC Lambda
+    fHistNclsITSPosL[j]               =NULL;
+    fHistNclsITSNegL[j]               =NULL;
+    fHistNclsTPCPosL[j]               =NULL;
+    fHistNclsTPCNegL[j]               =NULL;
+    fHistChi2PerNclsITSPosL[j]        =NULL;
+    fHistChi2PerNclsITSNegL[j]        =NULL;
+    //TPC all
+    fHistNclsITSPos[j]                =NULL;
+    fHistNclsITSNeg[j]                =NULL;
+    fHistNclsTPCPos[j]                =NULL;
+    fHistNclsTPCNeg[j]                =NULL;
+    fHistChi2PerNclsITSPos[j]         =NULL;
+    fHistChi2PerNclsITSNeg[j]         =NULL;
+    fHistNclsITS[j]                   =NULL;
+    fHistNclsTPC[j]                   =NULL;
+    fHistNCRowsTPCPos[j]              =NULL;
+    fHistNCRowsTPCNeg[j]              =NULL;
+    fHistRatioFoundOverFinableTPCK0[j]=NULL;
+    fHistRatioFoundOverFinableTPCL[j] =NULL;
+    //eta
+    fHistPiPiEtaDMC[j]                =NULL;
+    fHistPiPiEtaDReco[j]              =NULL;
+    fHistPiPEtaDMC[j]                 =NULL;
+    fHistPiPEtaDReco[j]               =NULL;
+  }
+   
+}
+
+//_____________________________________________________
+AliAnalysisTaskV0ForRAA::~AliAnalysisTaskV0ForRAA()
+{
+  //---- Remove all pointers ----//
+  if(fOutputContainer)     delete fOutputContainer;    fOutputContainer     = 0;
+  if(fESDTrackCuts)        delete fESDTrackCuts;       fESDTrackCuts        = 0;
+  if(fESDTrackCutsCharged) delete fESDTrackCutsCharged;fESDTrackCutsCharged = 0;
+  if(fESDTrackCutsLowPt)   delete fESDTrackCutsLowPt;  fESDTrackCutsLowPt   = 0;
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskV0ForRAA::UserCreateOutputObjects(){
+  //create output objects
+
+  Int_t nbPt   = 800;
+  Int_t nbMass = 500;
+
+   
+  //-----------------  create output container -----------------//
+
+  fOutputContainer = new TList() ;
+  fOutputContainer->SetName(GetName()) ;
+  fOutputContainer->SetOwner();
+  
+  Int_t mchist = 1;   //for data or MC as data
+  if((fMCMode && fMCTruthMode) || fMCTruthMode) mchist = 2; //for MC reco or truth
+       
+
+  //------------ create allways -----------------------//
+  fHistNEvents = new TH1F("fHistNEvents","no of events before cuts =0, after cuts=1, after process =2",5,0.0,5.0);
+  fOutputContainer->Add(fHistNEvents);
+      
+  fHistMuliplicity =  new TH1F("fHistMuliplicity","V0 multiplicity",3000,0.0,30000);
+  fOutputContainer->Add(fHistMuliplicity);
+      
+  fHistMuliplicityRaw =  new TH1F("fHistMuliplicityRaw","V0 multiplicity before process",3000,0.0,30000);      
+  fOutputContainer->Add(fHistMuliplicityRaw);
+      
+  fHistMultiplicityPrimary = new TH1F("fHistMultiplicityPrimary","number of charged tracks",5000,0.0,20000);
+  fOutputContainer->Add(fHistMultiplicityPrimary);
+      
+  fHistESDVertexZ  = new TH1F("fHistESDVertexZ"," z vertex distr in cm",500,-50,50);
+  fOutputContainer->Add(fHistESDVertexZ);
+   
+  fHistPrimVtxZESD = new TH1F("fHistPrimVtxZESD","z vertex pos ESD",250,-50,50);
+  fOutputContainer->Add(fHistPrimVtxZESD);
+      
+  fHistPrimVtxZESDVSNContributors = new TH2F("fHistPrimVtxZESDVSNContributors","prim vtx pos z ESD vs no. of contributers TPC",250,-50,50,500,0.0,500.0);
+  fOutputContainer->Add(fHistPrimVtxZESDVSNContributors);
+      
+  fHistNPrim       = new TH1F("fHistNPrim","Number of contributers to vertex",2500,0.0,5000);
+  fOutputContainer->Add(fHistNPrim);
+  //------------------------ pp analysis only -------------------------//
+  if(fAnapp){
+    fHistITSLayerHits   = new TH1F("fHistITSLayerHits","SDD layer -1=0,1=1,2=2 ... 5=5,0=nothing",7,-1.5,5.5);
+    fOutputContainer->Add(fHistITSLayerHits);
+    fHistOneHitWithSDD  = new TH1F("fHistOneHitWithSDD","min one hit in SDD",2,-0.5,1.5);
+    fOutputContainer->Add(fHistOneHitWithSDD);
+    fHistPrimVtxZESDTPC = new TH1F("fHistPrimVtxZESDTPC","z vertex pos TPC",250,-50,50);
+    fOutputContainer->Add(fHistPrimVtxZESDTPC);
+    fHistPrimVtxZESDSPD = new TH1F("fHistPrimVtxZESDSPD","z vertex pos SPD",250,-50,50);
+    fOutputContainer->Add(fHistPrimVtxZESDSPD);  
+    fHistPrimVtxZESDTPCVSNContributors = new TH2F("fHistPrimVtxZESDTPCVSNContributors","prim vtx pos z TPC vs no. of contributers TPC",250,-50,50,500,0.0,500.0);
+    fOutputContainer->Add(fHistPrimVtxZESDTPCVSNContributors);
+    fHistPrimVtxZESDSPDVSNContributors = new TH2F("fHistPrimVtxZESDSPDVSNContributors","prim vtx pos z SPD vs no. of contributers TPC",250,-50,50,500,0.0,500.0);
+    fOutputContainer->Add(fHistPrimVtxZESDSPDVSNContributors);
+
+  }
+  else {
+    Double_t binsCent[12]={0.0,5.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0};
+    fHistCentBinRaw = new TH1F("fHistCentBinRaw","centrality bin before cent selection",11,binsCent);
+    fOutputContainer->Add(fHistCentBinRaw);
+    fHistCentBin    = new TH1F("fHistCentBin","centrality bin",11,binsCent);
+    fOutputContainer->Add(fHistCentBin);
+      
+  }
+   
+  // ------------------- add always ---------------------------//
+  fHistV0RadiusZ[0]      = new TH2F("fHistV0RadiusZ","z of decay radius vs 2D radius",100,0.0,100.0,250,-125.0,125.0);
+  fHistV0RadiusZVSPt[0]  = new TH2F("fHistV0RadiusZVSPt","z of decay radius vs pt radius",200,0.0,20.0,125,0.0,125.0);
+  fHistV0RadiusXY[0]     = new TH2F("fHistV0RadiusXY","y vs x decay radius",250,-125.0,125.0,250,-125.0,125.0);
+  fHistV0RadiusXYVSY[0]  = new TH2F("fHistV0RadiusXYVSY","2D decay radius vs rap",100,-1,1,100,0.0,100.0);
+  fHistArmenteros[0]     = new TH2F("fHistArmenteros"," pi+pi- armenteros",nbMass,-1.,1.,500,0.,0.5);
+
+  //***************************************** K0s **********************************//
+  fHistPiPiMass[0]              = new TH1F("fHistPiPiMass"," pi+pi- InvMass distribution",2*nbMass,0.,2.);
+  fHistPiPiMassVSPt[0]          = new TH2F("fHistPiPiMassVSPt","pi+pi- InvMass distribution",nbMass,0.25,0.75,300,0.0,30.0);
+  fHistPiPiMassVSPtMCTruth[0]   = new TH2F("fHistPiPiMassVSPtMCTruth","pi+pi- InvMass distribution vs pt MCTruth",nbMass,0.25,0.75,300,0.0,30.0);
+  fHistPiPiPtVSY[0]             = new TH2F("fHistPiPiPtVSY","phi vs mass",100,-1,1,100,0.0,20);
+  fHistPiPiDecayLengthVsPt[0]   = new TH2F("fHistPiPiDecayLengthVsPt","K0 decay length vs pt",200,0.0,20.0,220,0.0,110.0);
+  fHistPiPiDecayLengthVsCtau[0] = new TH2F("fHistPiPiDecayLengthVsCtau","K0s ctau vs mass",nbMass,0.25,0.75,250,0.0,50.0);
+  fHistPiPiDecayLengthVsMass[0] = new TH2F("fHistPiPiDecayLengthVsMass","K0s decay length vs mass",nbMass,0.25,0.75,220,0.0,110.0);
+  fHistPiPiMonitorCuts[0]       = new TH1F("fHistPiPiMonitorCuts","K0 cut monitor",25,0.5,25.5);
+  fHistPiPiMonitorMCCuts[0]     = new TH1F("fHistPiPiMonitorMCCuts","K0 cut monitor mc",25,0.5,25.5);
+  
+  //***************************************** Lambda **********************************//
+  fHistPiPMass[0]               = new TH1F("fHistPiPMass"," p+pi- InvMass distribution",2*nbMass,0.,2.);
+  fHistPiPMassVSPt[0]           = new TH2F("fHistPiPMassVSPt","p+pi- InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);
+  fHistPiPMassVSPtMCTruth[0]    = new TH2F("fHistPiPMassVSPtMCTruth","p+pi- InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);
+  fHistPiPPtVSY[0]              = new TH2F("fHistPiPPtVSY","p{t} vs y",100,-1,1,100,0.0,20);
+  fHistPiPDecayLengthVsPt[0]    = new TH2F("fHistPiPDecayLengthVsPt","#Lambda decay length vs pt",200,0.0,20.0,220,0.0,110.0);
+  fHistPiPDecayLengthVsCtau[0]  = new TH2F("fHistPiPDecayLengthVsCtau","L ctau vs mass",nbMass,1.05,1.25,250,0.0,50.0);
+  fHistPiPDecayLengthVsMass[0]  = new TH2F("fHistPiPDecayLengthVsMass","#Lambda decay length vs mass",nbMass,1.05,1.25,220,0.0,110.0);
+  fHistPiPMonitorCuts[0]        = new TH1F("fHistPiPMonitorCuts","#Lambda cut monitor",25,0.5,25.5);
+  fHistPiPMonitorMCCuts[0]      = new TH1F("fHistPiPMonitorMCCuts","#Lambda cut monitor mc ",25,0.5,25.5);
+  
+  //***************************************** AntiLambda **********************************//
+  fHistPiAPMass[0]              = new TH1F("fHistPiAPMass"," ap-pi+ InvMass distribution",2*nbMass,0.,2.);
+  fHistPiAPMassVSPt[0]          = new TH2F("fHistPiAPMassVSPt","p-pi+ InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);
+  fHistPiAPMassVSPtMCTruth[0]   = new TH2F("fHistPiAPMassVSPtMCTruth","p-pi+ InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);
+  fHistPiAPPtVSY[0]             = new TH2F("fHistPiAPPtVSY","p{t} vs y",100,-1,1,100,0.0,20);
+  fHistPiAPDecayLengthVsPt[0]   = new TH2F("fHistPiAPDecayLengthVsPt","#bar{#Lambda} decay length vs pt",200,0.0,20.0,220,0.0,110.0);
+  fHistPiAPDecayLengthVsCtau[0] = new TH2F("fHistPiAPDecayLengthVsCtau","AL ctau vs mass",nbMass,1.05,1.25,200,0.0,100.0);
+  fHistPiAPDecayLengthVsMass[0] = new TH2F("fHistPiAPDecayLengthVsMass","#bar{#Lambda} decay length vs mass",nbMass,1.05,1.25,220,0.0,110.0);
+  fHistPiAPMonitorCuts[0]       = new TH1F("fHistPiAPMonitorCuts","#bar{#Lambda} cut monitor",25,0.5,25.5);
+  fHistPiAPMonitorMCCuts[0]     = new TH1F("fHistPiAPMonitorMCCuts","#bar{#Lambda} cut monitor mc",25,0.5,25.5);   
+  
+  if(mchist==2){// for MC reco
+    fHistV0RadiusZ[1]      = new TH2F("fHistV0RadiusZSec","z of decay radius vs 2D radius",100,0.0,100.0,250,-125.0,125.0);
+    fHistV0RadiusZVSPt[1]  = new TH2F("fHistV0RadiusZVSPtSec","z of decay radius vs pt radius",200,0.0,20.0,125,0.0,125.0);
+    fHistV0RadiusXY[1]     = new TH2F("fHistV0RadiusXYSec","y vs x decay radius",250,-125.0,125.0,250,-125.0,125.0);
+    fHistV0RadiusXYVSY[1]  = new TH2F("fHistV0RadiusXYVSYSec","2D decay radius vs rap",100,-1,1,100,0.0,100.0);
+    fHistArmenteros[1]     = new TH2F("fHistArmenterosSec"," pi+pi- armenteros",nbMass,-1.,1.,500,0.,0.5);
+
+    //***************************************** K0s **********************************//
+    
+    //***************************************** Lambda **********************************//
+    fHistPiPMass[1]               = new TH1F("fHistPiPMassSec"," p+pi- InvMass distribution",2*nbMass,0.,2.);
+    fHistPiPMassVSPt[1]           = new TH2F("fHistPiPMassVSPtSec","p+pi- InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);
+    fHistPiPMassVSPtMCTruth[1]    = new TH2F("fHistPiPMassVSPtMCTruthSec","p+pi- InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);
+    fHistPiPPtVSY[1]              = new TH2F("fHistPiPPtVSYSec","p{t} vs y",100,-1,1,100,0.0,20);
+    fHistPiPDecayLengthVsPt[1]    = new TH2F("fHistPiPDecayLengthVsPtSec","#Lambda decay length vs pt",200,0.0,20.0,220,0.0,11.0);
+    fHistPiPDecayLengthVsCtau[1]  = new TH2F("fHistPiPDecayLengthVsCtauSec","AL ctau vs mass",nbMass,1.05,1.25,250,0.0,50.0);
+    fHistPiPDecayLengthVsMass[1]  = new TH2F("fHistPiPDecayLengthVsMassSec","#Lambda decay length vs mass",nbMass,1.05,1.25,220,0.0,110.0);
+    fHistPiPMonitorCuts[1]        = new TH1F("fHistPiPMonitorCutsSec","#Lambda cut monitor",25,0.5,25.5);
+    fHistPiPMonitorMCCuts[1]      = new TH1F("fHistPiPMonitorMCCutsSec","#Lambda cut monitor mc",25,0.5,25.5);
+    //***************************************** AntiLambda **********************************//
+    fHistPiAPMass[1]              = new TH1F("fHistPiAPMassSec"," ap-pi+ InvMass distribution",2*nbMass,0.,2.);
+    fHistPiAPMassVSPt[1]          = new TH2F("fHistPiAPMassVSPtSec","p-pi+ InvMass distribution",nbMass,1.05,1.25,300,0.0,30.0);
+    fHistPiAPMassVSPtMCTruth[1]   = new TH2F("fHistPiAPMassVSPtMCTruthSec","p-pi+ InvMass distribution vs pt MCTruth",nbMass,1.05,1.25,300,0.0,30.0);
+    fHistPiAPPtVSY[1]             = new TH2F("fHistPiAPPtVSYSec","p{t} vs y",100,-1,1,100,0.0,20);
+    fHistPiAPDecayLengthVsPt[1]   = new TH2F("fHistPiAPDecayLengthVsPtSec","#bar{#Lambda} decay length vs pt",200,0.0,20.0,220,0.0,11.0);
+    fHistPiAPDecayLengthVsCtau[1] = new TH2F("fHistPiAPDecayLengthVsCtauSec","AL ctau vs mass",nbMass,1.05,1.25,250,0.0,50.0);
+    fHistPiAPDecayLengthVsMass[1] = new TH2F("fHistPiAPDecayLengthVsMassSec","#bar{#Lambda} decay length vs mass",nbMass,1.05,1.25,220,0.0,110.0);
+    fHistPiAPMonitorCuts[1]       = new TH1F("fHistPiAPMonitorCutsSec","#bar{#Lambda} cut monitor",25,0.5,25.5);
+    fHistPiAPMonitorMCCuts[1]     = new TH1F("fHistPiAPMonitorMCCutsSec","#bar{#Lambda} cut monitor mc",25,0.5,25.5);
+  }
+
+  //------- add K0s histos -----//
+  fOutputContainer->Add(fHistPiPiMass[0]);
+  fOutputContainer->Add(fHistPiPiMassVSPt[0]);
+  fOutputContainer->Add(fHistPiPiMassVSPtMCTruth[0]);
+  fOutputContainer->Add(fHistPiPiPtVSY[0]);
+  fOutputContainer->Add(fHistPiPiDecayLengthVsPt[0]);
+  fOutputContainer->Add(fHistPiPiDecayLengthVsCtau[0]);
+  fOutputContainer->Add(fHistPiPiDecayLengthVsMass[0]);
+  fOutputContainer->Add(fHistPiPiMonitorCuts[0]);
+  fOutputContainer->Add(fHistPiPiMonitorMCCuts[0]);
+  
+  //------- add (A)Lambda histos -----//
+  for(Int_t j=0;j<mchist;j++){
+     
+    fOutputContainer->Add(fHistArmenteros[j]);
+    fOutputContainer->Add(fHistV0RadiusZ[j]);
+    fOutputContainer->Add(fHistV0RadiusZVSPt[j]);
+    fOutputContainer->Add(fHistV0RadiusXY[j]);
+    fOutputContainer->Add(fHistV0RadiusXYVSY[j]);
+    
+    fOutputContainer->Add(fHistPiPMass[j]);
+    fOutputContainer->Add(fHistPiAPMass[j]);
+   
+    fOutputContainer->Add(fHistPiPMassVSPt[j]);
+    fOutputContainer->Add(fHistPiAPMassVSPt[j]);
+  
+    fOutputContainer->Add(fHistPiPMassVSPtMCTruth[j]);
+    fOutputContainer->Add(fHistPiAPMassVSPtMCTruth[j]);
+  
+    fOutputContainer->Add(fHistPiPPtVSY[j]);
+    fOutputContainer->Add(fHistPiAPPtVSY[j]);
+   
+    fOutputContainer->Add(fHistPiPDecayLengthVsPt[j]);
+    fOutputContainer->Add(fHistPiAPDecayLengthVsPt[j]);
+   
+    fOutputContainer->Add(fHistPiPDecayLengthVsCtau[j]);
+    fOutputContainer->Add(fHistPiAPDecayLengthVsCtau[j]);
+    
+    fOutputContainer->Add(fHistPiPDecayLengthVsMass[j]);
+    fOutputContainer->Add(fHistPiAPDecayLengthVsMass[j]);
+   
+    fOutputContainer->Add(fHistPiPMonitorCuts[j]);
+    fOutputContainer->Add(fHistPiAPMonitorCuts[j]);
+   
+    fOutputContainer->Add(fHistPiPMonitorMCCuts[j]);
+    fOutputContainer->Add(fHistPiAPMonitorMCCuts[j]);
+  }
+
+  //----------------- for reco or data or mc data like MC reco only -----------------//
+  if((fMCMode) || (!fMCTruthMode && !fMCMode)){//reco or data
+    
+    fHistPiPiEtaDReco[0] = new TH2F("fHistPiPiEtaDRecoRaw","K0s daughters eta raw",300,-6,6,100,0,20);
+    fOutputContainer->Add(fHistPiPiEtaDReco[0]);
+    fHistPiPiEtaDReco[1] = new TH2F("fHistPiPiEtaDReco","K0s daughters eta after rap V0 cut pos",300,-3,3,300,-3.00,3.0);
+    fOutputContainer->Add(fHistPiPiEtaDReco[1]);        
+    fHistPiPEtaDReco[0]  = new TH2F("fHistPiPEtaDRecoRaw","#Lambda daughters eta raw",300,-6,6,100,0,20);
+    fOutputContainer->Add(fHistPiPEtaDReco[0]);
+    fHistPiPEtaDReco[1]  = new TH2F("fHistPiPEtaDReco","#Lambda daughters eta after rap V0 cut neg",300,-3,3,300,-3.00,3.0);
+    fOutputContainer->Add(fHistPiPEtaDReco[1]);
+       
+    //********************************************** K0 *************************************************//
+    // fHistPiPiMassVSAlpha[0] = new TH2F("fHistPiPiMassVSAlpha"," alpha armenteros vs pi+pi- InvMass distribution",nbMass,0.25,0.75,500,-1.,1.);
+    fHistPiPiDCADaughters[0]                  = new TH2F("fHistPiPiDCADaughters","dca of K0 daughters",nbMass,0.25,0.75,250,0.0,2);
+    fHistPiPiDCADaughterPosToPrimVtxVSMass[0] = new TH2F("fHistPiPiDCADaughterPosToPrimVtxVSMass","pi+ DCA daughter to prim vtx vsinvmass",nbMass,0.25,0.75,250,0.0,25.0);
+    fHistPiPiDCAVSMass[0]                     = new TH2F("fHistPiPiDCAVSMass","pi+pi- dca  vs pt",nbMass,0.25,0.75,250,0.0,5.0);
+    fHistPiPiCosPointAng[0]                   = new TH2F("fHistPiPiCosPointAng","K0 cosine of pointing angle vs mass ",nbMass,0.25,0.75,200,0.9,1.00);
+    fHistPiPiRadiusXY[0]                      = new TH2F("fHistPiPiRadiusXY","pi+pi- phi dist vs mass",nbMass,0.25,0.75,200,0.0,4.0);
+    // fHistPiPiPtDaughters[0] = new TH2F("fHistPiPiPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);
+        
+    //***************************************** Lambda *********************************************//
+    fHistPiPDCADaughters[0] = new TH2F("fHistPiPDCADaughters","dca of #Lambda daughters",nbMass,1.05,1.25,250,0.0,2.0);
+    fHistPiPDCADaughterPosToPrimVtxVSMass[0]  = new TH2F("fHistPiPDCADaughterPosToPrimVtxVSMass","p DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);
+    fHistPiPDCAVSMass[0]                      = new TH2F("fHistPiPDCAVSMass","ppi- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);
+    fHistPiPCosPointAng[0]                    = new TH2F("fHistPiPCosPointAng","#Lambda cosine of pointing angle vs mass ",nbMass,1.05,1.25,200,0.9,1.00);
+    fHistPiPRadiusXY[0]                       = new TH2F("fHistPiPRadiusXY","pi-p+ phi dist vs mass",nbMass,1.05,1.25,200,0.0,4.0);
+    // fHistPiPPtDaughters[0] = new TH2F("fHistPiPPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);
+     
+    //************************************** Antilambda **********************************************//
+    fHistPiAPDCADaughters[0]                  = new TH2F("fHistPiAPDCADaughters","dca of #bar{#Lambda} daughters",nbMass,1.05,1.25,250,0.0,2.0);
+    fHistPiAPDCADaughterPosToPrimVtxVSMass[0] = new TH2F("fHistPiAPDCADaughterPosToPrimVtxVSMass","pi+ DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);
+    fHistPiAPDCAVSMass[0]                     = new TH2F("fHistPiAPDCAVSMass","pi+p- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);
+    fHistPiAPCosPointAng [0]                  = new TH2F("fHistPiAPCosPointAng","#bar{#Lambda} cosine of pointing angle vs mass",nbMass,1.05,1.25,200,0.9,1.00);
+    fHistPiAPRadiusXY[0]                      = new TH2F("fHistPiAPRadiusXY","pi+p- phi dist vs mass",nbMass,1.05,1.25,200,0.0,4.0);
+    // fHistPiAPPtDaughters[0] = new TH2F("fHistPiAPPtDaughters","p_{t} pos vs p_{t} neg of daughters",400,0.0,20.0,400,0,20.0);
+   
+    //**********************************************TPC*****************************************************//
+
+    fHistDedxSecProt[0]         = new TH2F("fHistDedxSecProt","proton", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxSecPiPlus[0]       = new TH2F("fHistDedxSecPiPlus","pi plus", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxSecAProt[0]        = new TH2F("fHistDedxSecAProt","antiproton", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxSecPiMinus[0]      = new TH2F("fHistDedxSecPiMinus","pi minus", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxProt[0]            = new TH2F("fHistDedxProt","proton", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxPiPlus[0]          = new TH2F("fHistDedxPiPlus","pi plus", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxAProt[0]           = new TH2F("fHistDedxAProt","antiproton", nbPt, 0, 20, 100, 0, 400);
+    fHistDedxPiMinus[0]         = new TH2F("fHistDedxPiMinus","pi minus", nbPt, 0, 20, 100, 0, 400);
+    //K0s
+    fHistNclsITSPosK0[0]        = new TH1F("fHistNclsITSPosK0","fHistNclsITSPos K0",10,-0.5,9.5);
+    fHistNclsITSNegK0[0]        = new TH1F("fHistNclsITSNegK0","fHistNclsITSNeg K0",10,-0.5,9.5);
+    
+    fHistNclsTPCPosK0[0]        = new TH1F("fHistNclsTPCPosK0","fHistNclsTPCPos K0",200,-0.5,199.5);
+    fHistNclsTPCNegK0[0]        = new TH1F("fHistNclsTPCNegK0","fHistNclsTPCNeg K0",200,-0.5,199.5);
+    
+    fHistChi2PerNclsITSPosK0[0] = new TH1F("fHistChi2PerNclsITSPosK0","chi2 per cluster ITS pi+pi-",250,0.0,50.0);
+    fHistChi2PerNclsITSNegK0[0] = new TH1F("fHistChi2PerNclsITSNegK0","chi2 per cluster ITS pi+pi- neg",250,0.0,50.0);
+
+    //Lambda
+    fHistNclsITSPosL[0]         = new TH1F("fHistNclsITSPosL","fHistNclsITSPos #Lambda",10,-0.5,9.5);
+    fHistNclsITSNegL[0]         = new TH1F("fHistNclsITSNegL","fHistNclsITSNeg #Lambda",10,-0.5,9.5);
+    
+    fHistNclsTPCPosL[0]         = new TH1F("fHistNclsTPCPosL","fHistNclsTPCPos #Lambda",200,-0.5,199.5);
+    fHistNclsTPCNegL[0]         = new TH1F("fHistNclsTPCNegL","fHistNclsTPCNeg #Lambda",200,-0.5,199.5);
+    
+    fHistChi2PerNclsITSPosL[0]  = new TH1F("fHistChi2PerNclsITSPosL","chi2 per cluster ITS pi-p+ pos",250,0.0,50.0);
+    fHistChi2PerNclsITSNegL[0]  = new TH1F("fHistChi2PerNclsITSNegL","chi2 per cluster ITS pi-p+ neg",250,0.0,50.0);
+    
+    //------------for 2d pt dep studies ------------------------//
+    fHistNclsITSPos[0]        = new TH2F("fHistNclsITSPos","fHistNclsITSPos  vs pt pos",nbMass,1.05,1.25,7,-0.5,6.5);
+    fHistNclsITSNeg[0]        = new TH2F("fHistNclsITSNeg","fHistNclsITSNeg vs pt neg",nbMass,0.25,0.75,7,-0.5,6.5);
+    fHistNclsITSPos[1]        = new TH2F("fHistNclsITSPosSec","fHistNclsITSPos  vs pt pos",nbMass,1.05,1.25,7,-0.5,6.5);
+    fHistNclsITSNeg[1]        = new TH2F("fHistNclsITSNegSec","fHistNclsITSNeg vs pt neg",nbMass,0.25,0.75,7,-0.5,6.5);
+
+    fHistNclsTPCPos[0]        = new TH2F("fHistNclsTPCPos","K0s mass vs phi neg",nbMass,1.05,1.25,200,0.0,200.0);
+    fHistNclsTPCNeg[0]        = new TH2F("fHistNclsTPCNeg","L mass vs phi neg",nbMass,0.25,0.75,200,0.0,200.0);
+    fHistNclsTPCPos[1]        = new TH2F("fHistNclsTPCPosSec","K0s mass vs phi neg",nbMass,1.05,1.25,200,0.0,200.0);
+    fHistNclsTPCNeg[1]        = new TH2F("fHistNclsTPCNegSec","L mass vs phi neg",nbMass,0.25,0.75,200,0.0,200.0);
+      
+    fHistChi2PerNclsITSPos[0] = new TH2F("fHistChi2PerNclsITSPos","chi2 per cluster ITS K0s neg",nbMass,1.05,1.25,250,0.0,25.0);
+    fHistChi2PerNclsITSNeg[0] = new TH2F("fHistChi2PerNclsITSNeg","chi2 per cluster ITS L neg",nbMass,0.25,0.75,250,0.0,25.0);
+    fHistChi2PerNclsITSPos[1] = new TH2F("fHistChi2PerNclsITSPosSec","chi2 per cluster ITS K0s neg",nbMass,1.05,1.25,250,0.0,25.0);
+    fHistChi2PerNclsITSNeg[1] = new TH2F("fHistChi2PerNclsITSNegSec","chi2 per cluster ITS L neg",nbMass,0.25,0.75,250,0.0,25.0);
+  
+    fHistNCRowsTPCPos[0]      = new TH2F("fHistNCRowsTPCPos","n crossed rows vs K0s neg",nbMass,1.05,1.25,200,0.0,200.0);
+    fHistNCRowsTPCNeg[0]      = new TH2F("fHistNCRowsTPCNeg","n crossed rows vs L neg",nbMass,0.25,0.75,200,0.0,200.0);
+    fHistNCRowsTPCPos[1]      = new TH2F("fHistNCRowsTPCPosSec","n crossed rows vs K0s neg",nbMass,1.05,1.25,200,0.0,200.0);
+    fHistNCRowsTPCNeg[1]      = new TH2F("fHistNCRowsTPCNegSec","n crossed rows vs L neg",nbMass,0.25,0.75,200,0.0,200.0);
+        
+    fHistNclsITS[0]           = new TH2F("fHistNclsITS","fHistNclsITS pos vs neg L",10,-0.5,9.5,10,-0.5,9.5);
+    fHistNclsITS[1]           = new TH2F("fHistNclsITSSec","fHistNclsITS pos vs neg K0",10,-0.5,9.5,10,-0.5,9.5);
+
+    fHistNclsTPC[0]           = new TH2F("fHistNclsTPC","ncls TPC neg vs crossed rows neg L",200,-0.5,199.5,200,-0.5,199.5);
+    fHistNclsTPC[1]           = new TH2F("fHistNclsTPCSec","ncls TPC neg vs crossed rows neg K0",200,-0.5,199.5,200,-0.5,199.5);
+   
+    fHistRatioFoundOverFinableTPCK0[0] = new TH2F("fHistRatioFoundOverFinableTPCK0","ncls found over findable K0s",nbMass,0.25,0.75,200,0.0,2.0);
+    fHistRatioFoundOverFinableTPCK0[1] = new TH2F("fHistRatioFoundOverFinableTPCK0Sec","ncls found over findable K0s",nbMass,0.25,0.75,200,0.0,2.0);
+
+    fHistRatioFoundOverFinableTPCL[0]  = new TH2F("fHistRatioFoundOverFinableTPCL","ncls found over findable L neg",nbMass,1.05,1.25,200,0.0,2.0);
+    fHistRatioFoundOverFinableTPCL[1]  = new TH2F("fHistRatioFoundOverFinableTPCLSec","ncls found over findable L neg",nbMass,1.05,1.25,200,0.0,2.0); 
+
+    //--- add histos ----//
+    fOutputContainer->Add(fHistNclsTPCNeg[0]);
+    fOutputContainer->Add(fHistChi2PerNclsITSNeg[0]);
+    fOutputContainer->Add(fHistNCRowsTPCNeg[0]);
+    fOutputContainer->Add(fHistRatioFoundOverFinableTPCK0[0]);
+    fOutputContainer->Add(fHistNclsITSPos[0]);
+    fOutputContainer->Add(fHistNclsITSNeg[0]);
+    fOutputContainer->Add(fHistNclsTPCPos[0]);
+    fOutputContainer->Add(fHistChi2PerNclsITSPos[0]);
+    fOutputContainer->Add(fHistNCRowsTPCPos[0]);
+    fOutputContainer->Add(fHistRatioFoundOverFinableTPCL[0]);
+    fOutputContainer->Add(fHistNclsITS[0]) ;
+    fOutputContainer->Add(fHistNclsTPC[0]);
+
+    fOutputContainer->Add(fHistNclsTPCNeg[1]);
+    fOutputContainer->Add(fHistChi2PerNclsITSNeg[1]);
+    fOutputContainer->Add(fHistNCRowsTPCNeg[1]);
+    fOutputContainer->Add(fHistRatioFoundOverFinableTPCK0[1]);
+    fOutputContainer->Add(fHistNclsTPCPos[1]);
+    fOutputContainer->Add(fHistChi2PerNclsITSPos[1]);
+    fOutputContainer->Add(fHistNCRowsTPCPos[1]);
+    fOutputContainer->Add(fHistRatioFoundOverFinableTPCL[1]);
+    fOutputContainer->Add(fHistNclsITSPos[1]);
+    fOutputContainer->Add(fHistNclsITSNeg[1]);
+    fOutputContainer->Add(fHistNclsITS[1]);
+    fOutputContainer->Add(fHistNclsTPC[1]);
+
+
+    if(mchist==2){// for MC reco
+
+      //********************************************** K0 *************************************************//
+        
+      //********************************************** Lambda ***********************************************//
+      fHistPiPDCADaughters[1] = new TH2F("fHistPiPDCADaughtersSec","dca of #Lambda daughters",nbMass,1.05,1.25,250,0.0,2.0);
+      fHistPiPDCADaughterPosToPrimVtxVSMass[1] = new TH2F("fHistPiPDCADaughterPosToPrimVtxVSMassSec","p DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);
+      fHistPiPDCAVSMass[1] = new TH2F("fHistPiPDCAVSMassSec","ppi- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);
+      fHistPiPCosPointAng[1]  = new TH2F("fHistPiPCosPointAngSec","#Lambda cosine of pointing angle vs mass",nbMass,1.05,1.25,200,0.9,1.00);
+    
+      fHistPiPRadiusXY[1] = new TH2F("fHistPiPRadiusXYSec","pi-p+ phi dist vs mass",nbMass,1.05,1.25,200,0.0,4.0);
+    
+      //******************************************* Antilambda **********************************************//
+      fHistPiAPDCADaughters[1] = new TH2F("fHistPiAPDCADaughtersSec","dca of #bar{#Lambda} daughters",nbMass,1.05,1.25,250,0.0,2.0);
+      fHistPiAPDCADaughterPosToPrimVtxVSMass[1] = new TH2F("fHistPiAPDCADaughterPosToPrimVtxVSMassSec","pi+ DCA daughter to prim vtx vs invmass",nbMass,1.05,1.25,250,0.0,25.0);
+      fHistPiAPDCAVSMass[1] = new TH2F("fHistPiAPDCAVSMassSec","pi+p- dca  vs pt",nbMass,1.05,1.25,250,0.0,5.0);
+      fHistPiAPCosPointAng[1] = new TH2F("fHistPiAPCosPointAngSec","#bar{#Lambda} cosine of pointing angle vs mass",nbMass,1.05,1.25,200,0.9,1.00);
+    
+      fHistPiAPRadiusXY[1] = new TH2F("fHistPiAPRadiusXYSec","pi+p- phi dist vs mass",nbMass,1.05,1.25,200,0.0,4.0);
+
+   
+      //******************************************* TPC ****************************************************//
+             
+      fHistDedxSecProt[1] = new TH2F("fHistDedxSecProtSec","proton", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxSecPiPlus[1] = new TH2F("fHistDedxSecPiPlusSec","pi plus", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxSecAProt[1] = new TH2F("fHistDedxSecAProtSec","antiproton", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxSecPiMinus[1] = new TH2F("fHistDedxSecPiMinusSec","pi minus", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxProt[1] = new TH2F("fHistDedxProtSec","proton", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxPiPlus[1] = new TH2F("fHistDedxPiPlusSec","pi plus", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxAProt[1] = new TH2F("fHistDedxAProtSec","antiproton", nbPt, 0, 20, 100, 0, 400);
+      fHistDedxPiMinus[1] = new TH2F("fHistDedxPiMinusSec","pi minus", nbPt, 0, 20, 100, 0, 400);
+      fHistNclsITSPosK0[1] = new TH1F("fHistNclsITSPosK0Sec","fHistNclsITSPos K0 ",10,-0.5,9.5);
+      fHistNclsITSNegK0[1] = new TH1F("fHistNclsITSNegK0Sec","fHistNclsITSNeg K0",10,-0.5,9.5);
+      fHistNclsTPCPosK0[1] = new TH1F("fHistNclsTPCPosK0Sec","fHistNclsTPCPos K0",200,-0.5,199.5);
+      fHistNclsTPCNegK0[1] = new TH1F("fHistNclsTPCNegK0Sec","fHistNclsTPCNeg K0",200,-0.5,199.5);
+      fHistChi2PerNclsITSPosK0[1] = new TH1F("fHistChi2PerNclsITSPosK0Sec","chi2 per cluster ITS pi+pi- pos",250,0.0,50.0);
+      fHistChi2PerNclsITSNegK0[1] = new TH1F("fHistChi2PerNclsITSNegK0Sec","chi2 per cluster ITS pi+pi- neg",250,0.0,50.0);
+      fHistNclsITSPosL[1] = new TH1F("fHistNclsITSPosLSec","fHistNclsITSPos #Lambda",10,-0.5,9.5);
+      fHistNclsITSNegL[1] = new TH1F("fHistNclsITSNegLSec","fHistNclsITSNeg #Lambda",10,-0.5,9.5);
+      fHistNclsTPCPosL[1] = new TH1F("fHistNclsTPCPosLSec","fHistNclsTPCPos #Lambda",200,-0.5,199.5);
+      fHistNclsTPCNegL[1] = new TH1F("fHistNclsTPCNegLSec","fHistNclsTPCNeg #Lambda",200,-0.5,199.5);
+      fHistChi2PerNclsITSPosL[1] = new TH1F("fHistChi2PerNclsITSPosLSec","chi2 per cluster ITS pi-p+ pos",250,0.0,50.0);
+      fHistChi2PerNclsITSNegL[1] = new TH1F("fHistChi2PerNclsITSNegLSec","chi2 per cluster ITS pi-p+ neg",250,0.0,50.0);
+    }    
+
+       
+    //--------------- add K0s histos --------------//
+    fOutputContainer->Add(fHistPiPiDCADaughters[0]); 
+    fOutputContainer->Add(fHistPiPiDCADaughterPosToPrimVtxVSMass[0]);
+    /*
+      fOutputContainer->Add( fHistPiPiPtDaughters[0]);
+           
+    */
+    fOutputContainer->Add(fHistPiPiDCAVSMass[0]);
+    fOutputContainer->Add(fHistPiPiCosPointAng[0]);
+    /*
+      fOutputContainer->Add(fHistPiPiRadiusXY[0]);
+    */
+    fOutputContainer->Add(fHistNclsITSPosK0[0]);
+    fOutputContainer->Add(fHistNclsITSNegK0[0]);
+    fOutputContainer->Add(fHistNclsTPCPosK0[0]);
+    fOutputContainer->Add(fHistNclsTPCNegK0[0]);
+    fOutputContainer->Add(fHistChi2PerNclsITSPosK0[0]);
+    fOutputContainer->Add(fHistChi2PerNclsITSNegK0[0]);
+         
+    //--------------- add (A)Lambda histos --------------//
+    for(Int_t j=0;j<mchist;j++){
+      fOutputContainer->Add(fHistPiPDCADaughters[j]); 
+      fOutputContainer->Add(fHistPiAPDCADaughters[j]);
+           
+      fOutputContainer->Add( fHistPiPDCADaughterPosToPrimVtxVSMass[j]);
+      fOutputContainer->Add( fHistPiAPDCADaughterPosToPrimVtxVSMass[j]);
+           
+      /*
+       fOutputContainer->Add( fHistPiPPtDaughters[j]);
+       fOutputContainer->Add( fHistPiAPPtDaughters[j]);
+      */
+      fOutputContainer->Add(fHistPiPDCAVSMass[j]);
+      fOutputContainer->Add(fHistPiAPDCAVSMass[j]);
+
+      fOutputContainer->Add(fHistPiPCosPointAng[j]);
+      fOutputContainer->Add(fHistPiAPCosPointAng[j]);
+      /*
+       fOutputContainer->Add(fHistPiPRadiusXY[j]);
+       fOutputContainer->Add(fHistPiAPRadiusXY[j]);
+      */
+
+      //others
+      fOutputContainer->Add(fHistDedxSecProt[j]);
+      fOutputContainer->Add(fHistDedxSecAProt[j]);
+      fOutputContainer->Add(fHistDedxSecPiPlus[j]);
+      fOutputContainer->Add(fHistDedxSecPiMinus[j]);
+
+      fOutputContainer->Add(fHistDedxProt[j]);
+      fOutputContainer->Add(fHistDedxAProt[j]);
+      fOutputContainer->Add(fHistDedxPiPlus[j]);
+      fOutputContainer->Add(fHistDedxPiMinus[j]);
+
+       
+      fOutputContainer->Add(fHistNclsITSPosL[j]);
+      fOutputContainer->Add(fHistNclsITSNegL[j]);
+     
+        
+      fOutputContainer->Add(fHistNclsTPCPosL[j]);
+      fOutputContainer->Add(fHistNclsTPCNegL[j]);
+   
+
+      fOutputContainer->Add(fHistChi2PerNclsITSPosL[j]);
+      fOutputContainer->Add(fHistChi2PerNclsITSNegL[j]);
+    }
+         
+  }
+
+  //----------------------------- MC reco or MC truth only --------------------------//
+  if((fMCMode && fMCTruthMode) || fMCTruthMode){
+    if(fAnapp){
+      fHistPrimVtxZESDVSNContributorsMC = new TH2F("fHistPrimVtxZESDVSNContributorsMC","prim vtx pos z ESD vs no. of contributers MC",250,-50,50,500,0.0,500.0);
+      fOutputContainer->Add(fHistPrimVtxZESDVSNContributorsMC);
+      fHistPrimVtxZESDTPCVSNContributorsMC = new TH2F("fHistPrimVtxZESDTPCVSNContributorsMC","prim vtx pos z TPC vs no. of contributers MC",250,-50,50,500,0.0,500.0);
+      fOutputContainer->Add(fHistPrimVtxZESDTPCVSNContributorsMC);
+      fHistPrimVtxZESDSPDVSNContributorsMC = new TH2F("fHistPrimVtxZESDSPDVSNContributorsMC","prim vtx pos z SPD vs no. of contributers MC",250,-50,50,500,0.0,500.0);
+      fOutputContainer->Add(fHistPrimVtxZESDSPDVSNContributorsMC);
+    }
+
+    fHistMCVertexZ= new TH1F("fHistMCVertexZ"," z vertex distr in cm MC",500,-50,50);
+    fOutputContainer->Add(fHistMCVertexZ);
+    fHistPiPiPDGCode = new TH1F("fHistPiPiPDGCode","PDG code of K0s mothers",3500,0,3500);
+    fOutputContainer->Add(fHistPiPiPDGCode);
+    fHistPiPPDGCode = new TH1F("fHistPiPPDGCode","PDG code of #Lambda  mothers",3500,0,3500);
+    fOutputContainer->Add(fHistPiPPDGCode);
+    fHistPiAPPDGCode = new TH1F("fHistPiAPPDGCode","PDG code of #bar{#Lambda} mothers",3500,0,3500);
+    fOutputContainer->Add(fHistPiAPPDGCode);
+    fHistPiPCosPointAngXiVsPt= new TH2F("fHistPiPCosPointAngXiVsPt","pi-p cos of pointing angle vs pt from xi",200,0.0,20.0,250,0.99,1.00);
+    fOutputContainer->Add(fHistPiPCosPointAngXiVsPt);
+    fHistPiAPCosPointAngXiVsPt= new TH2F("fHistPiAPCosPointAngXiVsPt","pi+p- cos of pointing angle vs pt from xi",200,0.0,20.0,250,0.98,1.00); 
+    fOutputContainer->Add(fHistPiAPCosPointAngXiVsPt);    
+    fHistPiPiEtaDMC[0] = new TH2F("fHistPiPiEtaDMCRaw","K0s daughters etaMC raw",300,-6,6,100,0,20);//
+    fOutputContainer->Add(fHistPiPiEtaDMC[0]);
+    fHistPiPiEtaDMC[1] = new TH2F("fHistPiPiEtaDMC","K0s daughters etaMC after rap V0 cut",300,-6,6,100,0,20);
+    fOutputContainer->Add(fHistPiPiEtaDMC[1]); 
+    fHistPiPEtaDMC[0] = new TH2F("fHistPiPEtaDMCRaw","#Lambda daughters etaMC raw",300,-6,6,100,0,20);
+    fOutputContainer->Add(fHistPiPEtaDMC[0]); 
+    fHistPiPEtaDMC[1] = new TH2F("fHistPiPEtaDMC","#Lambda daughters etaMC after rap V0 cut",300,-6,6,100,0,20);
+    fOutputContainer->Add(fHistPiPEtaDMC[1]);
+
+    //********************************************** K0 *************************************************//
+   
+    fHistPiPiDecayLengthResolution[0] = new TH2F("fHistPiPiDecayLengthResolution","K0s decay length resolution MC",220,0.0,110.0,220,0.0,110);
+       
+    //********************************************** Lambda **********************************************//
+    fHistPiPDecayLengthResolution[0] = new TH2F("fHistPiPDecayLengthResolution","Lambda decay length resolution MC",220,0.0,110.0,220,0.0,110);
+    fHistPiPDecayLengthResolution[1] = new TH2F("fHistPiPDecayLengthResolutionSec","Lambda sec decay length resolution MC",220,0.0,110.0,220,0.0,110);
+
+    fHistPiPMassVSPtSecSigma[0] = new TH2F("fHistPiPMassVSPtSecSigmaMC"," pi-p+ InvMass distribution secondaries from sigma MC",nbMass,1.05,1.25,200,0.,20);
+    fHistPiPMassVSPtSecSigma[1] = new TH2F("fHistPiPMassVSPtSecSigma"," pi-p+ InvMass distribution secondaries from Sigma reco",nbMass,1.05,1.25,200,0.,20);
+   
+    fHistPiPMassVSPtSecXi[0] = new TH2F("fHistPiPMassVSPtSecXiMC"," pi-p+ InvMass distribution secondaries from  xi MC",nbMass,1.05,1.25,200,0.,20);
+    fHistPiPMassVSPtSecXi[1] = new TH2F("fHistPiPMassVSPtSecXi"," pi-p+ InvMass distribution secondaries from  xi  reco",nbMass,1.05,1.25,200,0.,20);
+
+    fHistPiPMassVSPtSecXiMCTruth = new TH2F("fHistPiPMassVSPtSecXiMCTruth","Lambda mass reco vs pt sec Lambda from xi MC truth pt",nbMass,1.05,1.25,200,0.0,20.0);
+    fHistPiPMassVSYSecXi[0] = new TH2F("fHistPiPMassVSYSecXiMC"," pi-p+ InvMass distribution secondaries from xi MC",nbMass,1.05,1.25,100,-2.,2);
+    fHistPiPMassVSYSecXi[1] = new TH2F("fHistPiPMassVSYSecXi"," pi-p+ InvMass distribution secondaries from xi reco",nbMass,1.05,1.25,100,-2.,2);
+
+    fHistPiPXi0PtVSLambdaPt[0]= new TH2F("fHistPiPXi0PtVSLambdaPtMC"," pt xi 0 vs pt lambda MC truth",200,0.0,20.0,200,0.0,20.0);
+    fHistPiPXi0PtVSLambdaPt[1]= new TH2F("fHistPiPXi0PtVSLambdaPt"," pt xi 0 truth vs pt lambda reco",200,0.0,20.0,200,0.0,20.0);
+
+    fHistPiPXiMinusPtVSLambdaPt[0]= new TH2F("fHistPiPXiMinusPtVSLambdaPtMC","pt xi- vs pt lambda MC truth",200,0.0,20.0,200,0.0,20.0);
+    fHistPiPXiMinusPtVSLambdaPt[1]= new TH2F("fHistPiPXiMinusPtVSLambdaPt","pt xi- truth vs pt lambda reco",200,0.0,20.0,200,0.0,20.0);
+
+    fHistPiPOmegaPtVSLambdaPt[0] = new TH2F("fHistPiPOmegaPtVSLambdaPtMC","pt omega vs pt lambda MC truth",200,0.0,20.0,200,0.0,20.0);
+    fHistPiPOmegaPtVSLambdaPt[1] = new TH2F("fHistPiPOmegaPtVSLambdaPt","pt omega vs pt lambda MC reco",200,0.0,20.0,200,0.0,20.0);
+
+    fHistPiPMassVSPtSecOmega[0] = new TH2F("fHistPiPMassVSPtSecOmegaMC","Lambda mass vs pt omega MCtruth",nbMass,1.05,1.25,200,0.0,20.0);
+    fHistPiPMassVSPtSecOmega[1] = new TH2F("fHistPiPMassVSPtSecOmega","Lambda mass vs pt omega MCreco",nbMass,1.05,1.25,200,0.0,20.0);
+    fHistPiPMassVSPtSecOmegaMCTruth= new TH2F("fHistPiPMassVSPtSecOmegaMCTruth","Lambda mass vs pt sec Lambda from Omega MC truth pt",nbMass,1.05,1.25,200,0.0,20.0);
+
+    //******************************************* Antilambda **********************************************//
+    fHistPiAPDecayLengthResolution[0] = new TH2F("fHistPiAPDecayLengthResolution","ALambda decay length resolution MC",220,0.0,110.0,220,0.0,110);
+    fHistPiAPDecayLengthResolution[1] = new TH2F("fHistPiAPDecayLengthResolutionSec","ALambda sec decay length resolution MC",220,0.0,110.0,220,0.0,110);
+
+    fHistPiAPMassVSPtSecSigma[0] = new TH2F("fHistPiAPMassVSPtSecSigmaMC"," pi+p- InvMass distribution secondaries from Sigma MC",nbMass,1.05,1.25,200,0.,20);
+    fHistPiAPMassVSPtSecSigma[1] = new TH2F("fHistPiAPMassVSPtSecSigma"," pi+p- InvMass distribution secondaries from  Sigma  reco",nbMass,1.05,1.25,200,0.,20);
+
+    fHistPiAPMassVSPtSecXi[0] = new TH2F("fHistPiAPMassVSPtSecXiMC"," pi+p- InvMass distribution secondaries from xi MC",nbMass,1.05,1.25,200,0.,20);
+    fHistPiAPMassVSPtSecXi[1] = new TH2F("fHistPiAPMassVSPtSecXi"," pi+p- InvMass distribution secondaries from  Xi reco",nbMass,1.05,1.25,200,0.,20);
+
+    fHistPiAPMassVSPtSecXiMCTruth = new TH2F("fHistPiAPMassVSPtSecXiMCTruth","ALambda mass reco vs pt sec Lambda from xi MC truth pt",nbMass,1.05,1.25,200,0.0,20.0);
+      
+    fHistPiAPMassVSYSecXi[0] = new TH2F("fHistPiAPMassVSYSecXiMC"," pi+p- InvMass distribution secondaries from  xi MC",nbMass,1.05,1.25,100,-2,2);
+    fHistPiAPMassVSYSecXi[1] = new TH2F("fHistPiAPMassVSYSecXi"," pi+p- InvMass distribution secondaries from xi reco",nbMass,1.05,1.25,100,-2.,2);
+
+     
+    fHistPiAPXi0PtVSLambdaPt[0]= new TH2F("fHistPiAPXi0PtVSLambdaPtMC"," pt xi 0 vs pt Alambda MC truth",200,0.0,20.0,200,0.0,20.0);
+    fHistPiAPXi0PtVSLambdaPt[1]= new TH2F("fHistPiAPXi0PtVSLambdaPt"," pt xi 0 truth vs pt Alambda reco",200,0.0,20.0,200,0.0,20.0);
+
+    fHistPiAPXiMinusPtVSLambdaPt[0]= new TH2F("fHistPiAPXiMinusPtVSLambdaPtMC","pt xi- vs pt Alambda MC truth",200,0.0,20.0,200,0.0,20.0);
+    fHistPiAPXiMinusPtVSLambdaPt[1]= new TH2F("fHistPiAPXiMinusPtVSLambdaPt","pt xi- truth vs pt Alambda reco",200,0.0,20.0,200,0.0,20.0);
+
+    fHistPiAPOmegaPtVSLambdaPt[0] = new TH2F("fHistPiAPOmegaPtVSLambdaPtMC","pt omega vs pt alambda MC truth",200,0.0,20.0,200,0.0,20.0);
+    fHistPiAPOmegaPtVSLambdaPt[1] = new TH2F("fHistPiAPOmegaPtVSLambdaPt","pt omega vs pt alambda MC reco",200,0.0,20.0,200,0.0,20.0);
+
+    fHistPiAPMassVSPtSecOmega[0] = new TH2F("fHistPiAPMassVSPtSecOmegaMC","ALambda mass vs pt omega MCtruth",nbMass,1.05,1.25,200,0.0,20.0);
+    fHistPiAPMassVSPtSecOmega[1] = new TH2F("fHistPiAPMassVSPtSecOmega","ALambda mass vs pt omega MCreco",nbMass,1.05,1.25,200,0.0,20.0);
+    fHistPiAPMassVSPtSecOmegaMCTruth= new TH2F("fHistPiAPMassVSPtSecOmegaMCTruth","ALambda mass vs pt sec Lambda from Omega MC truth pt",nbMass,1.05,1.25,200,0.0,20.0);
+
+    fOutputContainer->Add(fHistPiPMassVSPtSecXiMCTruth);
+    fOutputContainer->Add(fHistPiPMassVSPtSecOmegaMCTruth);
+
+    fOutputContainer->Add(fHistPiAPMassVSPtSecXiMCTruth);
+    fOutputContainer->Add(fHistPiAPMassVSPtSecOmegaMCTruth);
+     
+    //--- add K0s histo ------//
+    fOutputContainer->Add(fHistPiPiDecayLengthResolution[0]);  
+
+    //--- add (A)Lambda histo ------//
+    for(Int_t j=0;j<2;j++){
+
+      fOutputContainer->Add(fHistPiPDecayLengthResolution[j]);  
+      fOutputContainer->Add(fHistPiAPDecayLengthResolution[j]);
+      
+      fOutputContainer->Add(fHistPiPMassVSPtSecXi[j]);
+      fOutputContainer->Add(fHistPiAPMassVSPtSecXi[j]);
+
+      fOutputContainer->Add(fHistPiPMassVSYSecXi[j]);
+      fOutputContainer->Add(fHistPiAPMassVSYSecXi[j]);
+
+      fOutputContainer->Add(fHistPiPXi0PtVSLambdaPt[j]);
+      fOutputContainer->Add(fHistPiAPXi0PtVSLambdaPt[j]);
+
+      fOutputContainer->Add(fHistPiPXiMinusPtVSLambdaPt[j]);
+      fOutputContainer->Add(fHistPiAPXiMinusPtVSLambdaPt[j]);
+
+      fOutputContainer->Add(fHistPiPMassVSPtSecSigma[j]);
+      fOutputContainer->Add(fHistPiAPMassVSPtSecSigma[j]);
+
+      fOutputContainer->Add(fHistPiPOmegaPtVSLambdaPt[j]);
+      fOutputContainer->Add(fHistPiAPOmegaPtVSLambdaPt[j]);
+      fOutputContainer->Add(fHistPiPMassVSPtSecOmega[j]);
+      fOutputContainer->Add(fHistPiAPMassVSPtSecOmega[j]);
+    }
+  }
+
+  /*    
+  //shift q/pt
+  fHistUserPtShift = new TH1F("fHistUserPtShift","user defined shift in 1/pt",100,-0.5,1.5);
+  */
+   
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskV0ForRAA::UserExec(Option_t *) {
+  //user exec
+
+  //-- esd handler --//
+  AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> 
+    (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+  if (!esdH) {
+    printf("ERROR: Could not get ESDInputHandler");
+    return;
+  } 
+  fESD = esdH->GetEvent();
+  if(!fESD) {
+    printf("ERROR: fESD not available \n");
+    return ;
+  }
+
+  //-- mc handler --//
+  if(fMCMode || fMCTruthMode){
+    AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> 
+      (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if(!mcH) {
+      printf("ERROR: Could not get MCInputHandler");
+      return;
+    }
+    fMCev = mcH->MCEvent();
+    if (!fMCev) {
+      printf("ERROR: fMCev not available \n");
+      return ;
+    }
+  }
+    
+  //--  AliPIDResponse --//
+  fESDpid = esdH->GetPIDResponse();
+  //-- Count events before cuts --//
+  fHistNEvents->Fill(0);
+
+  //-- Check object existence --//
+  const AliESDVertex *    vtxESD    = fESD->GetPrimaryVertexTracks();
+  const AliESDVertex *    vtxESDTPC = fESD->GetPrimaryVertexTPC();  
+  const AliESDVertex *    vtxESDSPD = fESD->GetPrimaryVertexSPD();  
+  const AliMultiplicity * multESD   = fESD->GetMultiplicity();  
+
+  if ( !vtxESD ){
+    AliError("No Tracks Vertex");
+    return;
+  }
+
+  if ( !vtxESDTPC ){
+    AliError("No TPC Vertex");
+    return ;
+  }
+
+  if ( !vtxESDSPD ){
+    AliError("No SPD Vertex");
+    return ;
+  }
+
+  if ( !multESD ){
+    AliError("No Multiplicity");
+    return ;
+  }
+   
+
+  // ----------- MC vertex -----------------------------------//
+  Int_t nContr =0;
+  
+  if(fMCTruthMode){
+    Double_t vVertexPrim[3];
+    fMCev->GetPrimaryVertex()->GetXYZ(vVertexPrim);
+    fHistMCVertexZ->Fill(vVertexPrim[2]);
+    
+    if(fMCMode && fAnapp){
+      if (vtxESD->GetStatus()){
+       nContr=vtxESD->GetNContributors();
+       fHistPrimVtxZESDVSNContributorsMC->Fill(vVertexPrim[2],nContr);
+       fHistPrimVtxZESDTPCVSNContributorsMC->Fill(vVertexPrim[2],nContr);
+      }
+      else {
+       if(vtxESDSPD->GetStatus()){
+         nContr=vtxESDSPD->GetNContributors();
+         fHistPrimVtxZESDTPCVSNContributorsMC->Fill(vVertexPrim[2],nContr);
+         fHistPrimVtxZESDSPDVSNContributorsMC->Fill(vVertexPrim[2],nContr);
+       }
+       else{
+         fHistPrimVtxZESDVSNContributorsMC->Fill(vVertexPrim[2],nContr);//add for correction ESD and ESDPSD!!!!
+         fHistPrimVtxZESDTPCVSNContributorsMC->Fill(vVertexPrim[2],nContr);
+       }
+      }
+    }
+  }
+  
+     
+  
+  // -- Check fo centrality
+  Bool_t process = kTRUE;
+  Int_t centBin = -1;
+  if(fUseCentrality) {
+    centBin = CalculateCentralityBin();
+    if(!fUseCentralityRange){
+      if(centBin!= fUseCentralityBin) process=kFALSE;
+    }
+    else if(centBin < fUseCentralityBin || centBin > fUseCentralityBin+fUseCentralityRange)
+      process = kFALSE;
+  }
+
+  AliESDVZERO* esdV0 = fESD->GetVZEROData();
+  Float_t multV0 = esdV0->GetMTotV0A() + esdV0->GetMTotV0C();
+  
+  if(fAnapp){// pp Analysis
+    // SDD test for 2.76TeV pp
+    // select events with SDD
+    //   TString trCl = fESD->GetFiredTriggerClasses();
+    //if(!(trCl.Contains("ALLNOTRD")) && fSelSDD) return;
+    UInt_t maskSel = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+    if(maskSel& AliVEvent::kFastOnly && fSelSDD) return;
+    if(!(maskSel& AliVEvent::kFastOnly) && fSelNoSDD) return;
+        
+
+    //-- Monitor event cuts --//
+    fHistNEvents->Fill(1);
+
+    Int_t ntracks = fESD->GetNumberOfTracks();
+    for(Int_t i=0;i<ntracks;i++){//check sdd event selection
+      AliESDtrack *tr=   fESD->GetTrack(i);
+      
+      Bool_t sdd0 = tr->HasPointOnITSLayer(0);
+      Bool_t sdd1 = tr->HasPointOnITSLayer(1);
+      Bool_t sdd2 = tr->HasPointOnITSLayer(2);
+      Bool_t sdd3 = tr->HasPointOnITSLayer(3);
+      Bool_t sdd4 = tr->HasPointOnITSLayer(4);
+      Bool_t sdd5 = tr->HasPointOnITSLayer(5);
+       
+      fHistITSLayerHits->Fill(Int_t(sdd0)*(-1),ntracks);
+      fHistITSLayerHits->Fill(Int_t(sdd1)*1,ntracks);
+      fHistITSLayerHits->Fill(Int_t(sdd2)*2,ntracks);
+      fHistITSLayerHits->Fill(Int_t(sdd3)*3,ntracks);
+      fHistITSLayerHits->Fill(Int_t(sdd4)*4,ntracks);
+      fHistITSLayerHits->Fill(Int_t(sdd5)*5,ntracks);
+    }
+      
+    //vertex selection
+    if (vtxESD->GetStatus()){
+      fHistNEvents->Fill(2);
+      fHistESDVertexZ->Fill(vtxESD->GetZv());
+      if(fabs(vtxESD->GetZv()) < fVertexZCut){
+       fHistMuliplicityRaw->Fill(multV0);
+       fHistNEvents->Fill(3);
+       fHistNPrim->Fill(nContr);
+       
+       Process();
+       
+       fHistMuliplicity->Fill(multV0);
+       
+       nContr = vtxESD->GetNContributors();
+
+       fHistPrimVtxZESDVSNContributors->Fill(vtxESD->GetZv(),nContr);
+       fHistPrimVtxZESDTPCVSNContributors->Fill(vtxESDTPC->GetZv(),nContr);
+
+       fHistPrimVtxZESD->Fill(vtxESD->GetZv());
+       fHistPrimVtxZESDTPC->Fill(vtxESDTPC->GetZv());
+
+       // -- count events after processing
+       fHistNEvents->Fill(4);
+      }
+    }
+    else{
+      if(vtxESDSPD->GetStatus()){
+       fHistNEvents->Fill(2);
+       
+       fHistESDVertexZ->Fill(vtxESDSPD->GetZv());
+       if(fabs(vtxESDSPD->GetZv()) < fVertexZCut){
+         
+         fHistMuliplicityRaw->Fill(multV0);
+         fHistNEvents->Fill(3);
+         fHistNPrim->Fill(nContr);
+         
+         Process();
+         
+         fHistMuliplicity->Fill(multV0);
+         
+         nContr = vtxESDSPD->GetNContributors();
+
+         fHistPrimVtxZESDTPCVSNContributors->Fill(vtxESDTPC->GetZv(),nContr);
+         fHistPrimVtxZESDSPDVSNContributors->Fill(vtxESDSPD->GetZv(),nContr);
+
+         fHistPrimVtxZESDTPC->Fill(vtxESDTPC->GetZv());
+         fHistPrimVtxZESDSPD->Fill(vtxESDSPD->GetZv());
+         // -- count events after processing
+         fHistNEvents->Fill(4);
+       }
+      }
+      //else return;
+    }
+  }
+  else{// PbPb analysis
+    //-- Monitor event cuts --//
+    fHistNEvents->Fill(1);
+
+    if(vtxESD->GetStatus()){
+      Double_t vtxZ = vtxESD->GetZv();
+      fHistESDVertexZ->Fill(vtxZ);
+      if(process){
+       fHistNEvents->Fill(2);
+       if(fabs(vtxZ) < fVertexZCut){
+         nContr = vtxESD->GetNContributors();
+         fHistMuliplicityRaw->Fill(multV0);
+         fHistNEvents->Fill(3);
+         fHistNPrim->Fill(nContr);
+         Process();
+         fHistMuliplicity->Fill(multV0);
+         fHistPrimVtxZESD->Fill(vtxZ);
+         fHistPrimVtxZESDVSNContributors->Fill(vtxZ,nContr);
+         // -- count events after processing --//
+         fHistCentBin->Fill(centBin);
+         fHistNEvents->Fill(4);
+       }
+      }
+      if(fabs(vtxZ) < fVertexZCut) fHistCentBinRaw->Fill(centBin);
+    }
+  }
+  PostData(1,fOutputContainer);
+    
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskV0ForRAA::Terminate(Option_t *) {
+  //terminate
+}
+//________________________________________________________________________
+void AliAnalysisTaskV0ForRAA::Process(){
+  //run the analysis
+
+  Int_t ntracks = fESD->GetNumberOfTracks();
+  Int_t count = 0;
+
+  //-- count number of tracks --//
+   
+  if(!(!fMCMode && fMCTruthMode)){
+    for(Int_t i=0;i<ntracks;i++){
+      AliESDtrack *track = (AliESDtrack*)fESD->GetTrack(i);
+      if(!fESDTrackCuts->AcceptTrack(track)) continue;
+      if( track->Eta() > fEtaCutMCDaughtersVal) continue;
+      count++;
+    }
+    fHistMultiplicityPrimary->Fill(count);
+  }
+   
+  //-- check number of V0s in case of data or mc data like analysis--//
+  Int_t nV0 = fESD->GetNumberOfV0s();
+  if(!fMCTruthMode) if(nV0 < 1) return;
+   
+  //-- run analysis --//
+  if(fMCTruthMode)  V0MCTruthLoop();
+  else  V0RecoLoop(0,0,0,0,0.0,0,0.0,0.0);
+
+}
+//________________________________________________________________________
+void AliAnalysisTaskV0ForRAA::V0MCTruthLoop(){
+  //loop over MC truth particles
+
+  //-- get MC stack --//
+  AliStack *stack = fMCev->Stack();
+
+  /*
+  //histo fo user defined shift in charge/pt 
+  if(fShift){
+  fHistUserPtShift->Fill(fDeltaInvP);
+  }
+  */
+  /*
+    AliKFVertex primVtxStart(*(fESD->GetPrimaryVertex()));
+    Int_t nTracksPrim=primVtxStart.GetNContributors();
+    fHistNPrim->Fill(nTracksPrim);
+  */
+  /*
+  // MC
+    
+  Int_t mcPrimaries = stack->GetNprimary();
+  Int_t mcParticles    = stack->GetNtrack();
+    
+  fHistMultiplicityPrimary->Fill(mcPrimaries);
+  fHistMCMultiplicityTracks->Fill(mcParticles);
+    
+  // number of V0
+  fHistNV0->Fill(nV0);
+  if(nTracksPrim>0) {
+  fHistNV0WithVertex->Fill(nV0);
+  }
+  */
+
+  //-- MC truht loop for V0s --//
+  for (Int_t iMc = 0; iMc < (stack->GetNtrack()); iMc++){//MC truth loop
+    Int_t fillMCtruth= int(fMCTruthMode);
+    if(fMCTruthMode){
+      fHistPiPiMonitorMCCuts[0]->Fill(1*fillMCtruth);
+      fHistPiPMonitorMCCuts[0]->Fill(1*fillMCtruth);
+      fHistPiAPMonitorMCCuts[0]->Fill(1*fillMCtruth);
+    }
+    TParticle *p0 = stack->Particle(iMc);
+    if(!p0) continue;
+
+    if(fMCTruthMode){
+      fHistPiPiMonitorMCCuts[0]->Fill(2*fillMCtruth);
+      fHistPiPMonitorMCCuts[0]->Fill(2*fillMCtruth);
+      fHistPiAPMonitorMCCuts[0]->Fill(2*fillMCtruth);
+    }
+
+
+
+    Int_t pdgCode = p0->GetPdgCode();
+
+    //-------------- only K0s and Lambda ----------//
+    if( (pdgCode != 310 ) && ( fabs(pdgCode) != 3122 ) ) continue; //accept only K0s and (A)Lambda
+    Int_t fillFlagK0 = (3122- fabs(pdgCode))/(3122-310)*fillMCtruth;//K0s flag
+    Int_t fillFlagL  = (fabs(pdgCode) - 310)/(3122-310)*(pdgCode+3122)/(2*3122)*fillMCtruth;// Lambda flag
+    Int_t fillFlagAL = (fabs(pdgCode) - 310)/(3122-310)*(pdgCode-3122)/(-2*3122)*fillMCtruth; // AntiLambda flag
+    
+    fHistPiPiMonitorMCCuts[0]->Fill(3*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(3*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(3*fillFlagAL);
+      
+    if(p0->GetNDaughters() !=2) continue; // 2 body decay
+    fHistPiPiMonitorMCCuts[0]->Fill(4*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(4*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(4*fillFlagAL);
+      
+    //-------------- unique ID check-------------- //
+    Int_t uniqueID =  p0->GetUniqueID();
+    if(uniqueID==13) continue; //reject part. from material
+      
+    fHistPiPiMonitorMCCuts[0]->Fill(5*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(5*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(5*fillFlagAL);
+      
+    //-------------- daughters --------------------//
+    Int_t id0  = p0->GetDaughter(0);
+    Int_t id1  = p0->GetDaughter(1);
+    if(id0<0 || id1 <0) continue;//check if daughters exists in stack
+      
+    fHistPiPiMonitorMCCuts[0]->Fill(6*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(6*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(6*fillFlagAL);
+            
+    Int_t pdgCodeD0 = stack->Particle(id0)->GetPdgCode();
+    Int_t pdgCodeD1 = stack->Particle(id1)->GetPdgCode();
+      
+    if(pdgCodeD0 == pdgCodeD1) continue;//pdg code shall be different
+    if(pdgCodeD0*pdgCodeD1>0) continue;//and not of the same sign
+      
+    fHistPiPiMonitorMCCuts[0]->Fill(7*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(7*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(7*fillFlagAL);
+            
+    if((fabs(pdgCodeD0) != 211 ) && ( fabs(pdgCodeD0) != 2212 )) continue;//accept only pions and protons as daughters
+    if((fabs(pdgCodeD1) != 211 ) && ( fabs(pdgCodeD1) != 2212 )) continue;//accept only pions and protons as daughters
+      
+    fHistPiPiMonitorMCCuts[0]->Fill(8*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(8*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(8*fillFlagAL);
+      
+    TParticle *p00 =stack->Particle(id0);
+    TParticle *p01 =stack->Particle(id1);
+    Double_t etaMC00   = p00->Eta();
+    Double_t etaMC01   = p01->Eta();
+
+    //----------- unique ID check daughters-------- //
+    Int_t uniqueIDdaughter0 = p00->GetUniqueID();
+    Int_t uniqueIDdaughter1 = p01->GetUniqueID();
+    if (uniqueIDdaughter0 !=4 || uniqueIDdaughter1 !=4 ) continue;// daughters shall come from decay
+      
+    fHistPiPiMonitorMCCuts[0]->Fill(9*fillFlagK0);
+    fHistPiPMonitorMCCuts[0]->Fill(9*fillFlagL);
+    fHistPiAPMonitorMCCuts[0]->Fill(9*fillFlagAL);
+
+    fHistPiPiMonitorMCCuts[1]->Fill(9*fillFlagK0);
+    fHistPiPMonitorMCCuts[1]->Fill(9*fillFlagL);
+    fHistPiAPMonitorMCCuts[1]->Fill(9*fillFlagAL);
+      
+    //------------ check label reco -------------------//
+    if(fCheckNegLabelReco || fOnlyFoundRecoV0){//optional, set flag in AddTask
+      Bool_t found =kFALSE;
+      Int_t label0=0,label1=0;      
+      AliESDv0 * v0MIsMC=NULL;
+      AliESDtrack *tr0 = NULL;
+      AliESDtrack *tr1 = NULL;
+      for(Int_t recL=0;recL < fESD->GetNumberOfV0s();recL++){
+       v0MIsMC = fESD->GetV0(recL);
+       if(!v0MIsMC) continue;
+       tr0 = fESD->GetTrack(v0MIsMC->GetPindex());
+       tr1 = fESD->GetTrack(v0MIsMC->GetNindex());
+       if(tr0 && tr1){
+         label0 = tr0->GetLabel();
+         label1 = tr1->GetLabel();
+         if((fabs(label0) == id0 && fabs(label1) == id1) || 
+            (fabs(label0) == id1 && fabs(label1) == id0)){
+           found =kTRUE;
+           break; 
+         }     
+       }
+      }
+      if(fCheckNegLabelReco && !fOnlyFoundRecoV0) {
+       if(found && (label0 <0 || label1 < 0)) continue;
+      }
+      else{
+       if(!found) continue;
+       if(fCheckNegLabelReco && found && (label0 <0 || label1 < 0)) continue;
+      }
+      
+    }
+    //-----------get geometric properties --------------//
+    // DCA of mother to prim vertex = production vertex
+    
+    //-- primary and secondary vetex --//
+    Double_t vVertexPrimMC[3];
+    fMCev->GetPrimaryVertex()->GetXYZ(vVertexPrimMC);
+    // Double_t x0=p0->Vx(),y0=p0->Vy(),z0=p0->Vz();//mother production vertex
+    
+    Double_t x=p00->Vx(),y=p00->Vy(),z=p00->Vz();//daughter vertex =V0 decay vertex
+    Double_t rx = x - vVertexPrimMC[0];
+    Double_t ry = y - vVertexPrimMC[1];
+    Double_t rz = z - vVertexPrimMC[2];
+    Double_t sdeclength = rx*rx+ry*ry;//+rz*rz;//=p00->Rho();  
+    Double_t declength =0.0;
+    if(sdeclength>0) declength = sqrt(sdeclength);
+    Double_t declength3d = sqrt( rx*rx+ry*ry+rz*rz);
+   
+    //-- decay radii --//
+    Double_t rMC2D  = sqrt(x*x+y*y);
+    const  Double_t xyzMC[3] = {x,y,z};
+    // Double_t rMC = p00->R();
+      
+    //-- phi --//
+    Double_t pi = TMath::Pi();
+    Double_t phi = p0->Phi();
+    if(phi>pi) phi -=2*pi;
+
+    //-------------------- V0 variables ----------------//
+    Double_t rapidity = p0->Y();
+    Double_t massV0MC = p0->GetMass();
+    Double_t ptV0MC =  p0->Pt();
+    Double_t pV0MC =  p0->P();
+
+     
+    //----------------- mother variables-----------------//
+    Int_t indexMother1  = p0->GetMother(0);
+    Int_t isSecd=0; //primary:0, secondary:1
+    Int_t pdgMother =0;
+    Int_t uniqueIDmother=0;
+    Double_t ptXiMother=0.0;
+    Double_t rapXiMother = 0.0;
+
+
+    //------check mother and fill mother histos---------//
+    Bool_t isPrim= stack->IsPhysicalPrimary(iMc);
+
+    if(!isPrim){//prim or sec
+      isSecd=1;// is secondary V0s
+
+      if(indexMother1 >-1){// && !isPrim){//secondary V0s
+       //     isSecd=1;// is secondary V0s
+
+       //-- check for mother --//
+       TParticle *mother = stack->Particle(indexMother1);
+       if(!mother) {
+         Printf("no mother pointer!");continue;
+       }
+       pdgMother = mother->GetPdgCode();
+       fHistPiPiMonitorMCCuts[1]->Fill(11*fillFlagK0);
+       fHistPiPMonitorMCCuts[1]->Fill(11*fillFlagL);
+       fHistPiAPMonitorMCCuts[1]->Fill(11*fillFlagAL);
+
+       //-- check for injejcted --//
+       Bool_t notinjectedMother = kTRUE;
+       notinjectedMother = fMCev->IsFromBGEvent(indexMother1);
+       
+       if(fSelectInjected && !notinjectedMother ) continue;//reject injected, optional, set flag in AddTask
+       fHistPiPiMonitorMCCuts[1]->Fill(10*fillMCtruth);
+       fHistPiPMonitorMCCuts[1]->Fill(10*fillMCtruth);
+       fHistPiAPMonitorMCCuts[1]->Fill(10*fillMCtruth);
+
+       Bool_t isPrimMother= stack->IsPhysicalPrimary(indexMother1);
+       if(!isPrimMother) continue;
+       fHistPiPiMonitorMCCuts[1]->Fill(12*fillFlagK0);
+       fHistPiPMonitorMCCuts[1]->Fill(12*fillFlagL);
+       fHistPiAPMonitorMCCuts[1]->Fill(12*fillFlagAL);
+      
+       uniqueIDmother =  mother->GetUniqueID();
+
+       if(uniqueIDmother==13){
+         continue;
+       }
+       fHistPiPiMonitorMCCuts[1]->Fill(13*fillFlagK0);
+       fHistPiPMonitorMCCuts[1]->Fill(13*fillFlagL);
+       fHistPiAPMonitorMCCuts[1]->Fill(13*fillFlagAL);
+
+
+       //-- fill secondary V0s histos and pdg histos --// 
+       ptXiMother=mother->Pt();
+       rapXiMother=mother->Y();
+       
+
+       //-- K0s --//
+       if(pdgCode==310){
+         if(fabs(pdgMother)==311 || fabs(pdgMother)==313 || fabs(pdgMother)==323 ) isSecd=0; // from K0L,  K0 and K* as primary
+         else fHistPiPiPDGCode->Fill(fabs(pdgMother));
+       }
+       
+       //-- Lambda --//
+       if(pdgCode==3122){
+         fHistPiPPDGCode->Fill(fabs(pdgMother));
+         if (//sigma family
+             ( TMath::Abs(pdgMother) == 3112) || //sigma minus
+             ( TMath::Abs(pdgMother) == 3222) || //sigma plus
+             ( TMath::Abs(pdgMother) == 3224) || //sigma *plus
+             ( TMath::Abs(pdgMother) == 3114) || //sigma *minus
+             ( TMath::Abs(pdgMother) == 3214) || //sigma *0 counts as primary????
+             ( TMath::Abs(pdgMother) == 3212)    //sigma 0 counts as primary
+             )
+           {
+             isSecd=0;
+           }
+          
+         if( pdgMother == 3322) //xi0
+           {
+             if(!fRapCutV0 || fabs(rapidity)<fRap){
+               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){
+                 fHistPiPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);
+                 fHistPiPMassVSYSecXi[0]->Fill(massV0MC,rapidity);
+                 if(!fRapCutV0 || fabs(rapXiMother)<fRap) fHistPiPXi0PtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);
+               }
+             }
+           }
+         if(pdgMother == 3312) //xi minus
+           {
+             if(!fRapCutV0 || fabs(rapidity)<fRap){
+               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){
+                 fHistPiPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);
+                 fHistPiPMassVSYSecXi[0]->Fill(massV0MC,rapidity);
+                 if(!fRapCutV0 || fabs(rapXiMother)<fRap)  fHistPiPXiMinusPtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);
+               }
+             }
+           }       
+         if(pdgMother == 3334)//omega-
+           {
+             if(!fRapCutV0 || fabs(rapXiMother)<fRap) fHistPiPOmegaPtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);
+             fHistPiPMassVSPtSecOmega[0]->Fill(massV0MC,ptV0MC);
+           }
+       }
+       
+       //-- AntiLambda --//
+       if(pdgCode==-3122 ){
+         fHistPiAPPDGCode->Fill(fabs(pdgMother));
+         if (//sigma family
+             ( TMath::Abs(pdgMother) == 3112) ||//sigma minus
+             ( TMath::Abs(pdgMother) == 3222) ||//sigma plus
+             ( TMath::Abs(pdgMother) == 3224) ||//sigma *plus
+             ( TMath::Abs(pdgMother) == 3114) ||//sigma *minus
+             ( TMath::Abs(pdgMother) == 3214) || //sigma *0
+             ( TMath::Abs(pdgMother) == 3212)    //sigma 0 counts as primary
+             )
+           {
+             isSecd=0;
+           }
+                  
+         if( pdgMother == -3322) //xi0
+           {
+             if(!fRapCutV0 || fabs(rapidity)<fRap){
+               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){
+                 fHistPiAPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);
+                 fHistPiAPMassVSYSecXi[0]->Fill(massV0MC,rapidity);
+                 if(!fRapCutV0 || fabs(rapXiMother)<fRap) fHistPiAPXi0PtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);
+               }
+             }
+           }
+         if(pdgMother == -3312) //xi plus
+           {
+             if(!fRapCutV0 || fabs(rapidity)<fRap){
+               if(!fEtaCutMCDaughters  ||  (fabs(etaMC00)<fEtaCutMCDaughtersVal|| fabs(etaMC01)<fEtaCutMCDaughtersVal)){
+                 fHistPiAPMassVSPtSecXi[0]->Fill(massV0MC,ptV0MC);
+                 fHistPiAPMassVSYSecXi[0]->Fill(massV0MC,rapidity);
+                 if(!fRapCutV0 || fabs(rapXiMother)<fRap) fHistPiAPXiMinusPtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);
+               }
+             }
+           }
+         if(pdgMother == -3334)//omega+
+           {
+             fHistPiAPOmegaPtVSLambdaPt[0]->Fill(ptV0MC,ptXiMother);
+             if(!fRapCutV0 || fabs(rapXiMother)<fRap) fHistPiAPMassVSPtSecOmega[0]->Fill(massV0MC,ptV0MC);
+           }
+       }
+      }        
+    }//end secondaries
+    else{
+      //-- check for injejcted --//
+      Bool_t notinjected = kTRUE;
+      notinjected = fMCev->IsFromBGEvent(iMc);
+      
+      if(fSelectInjected && !notinjected ) continue;//removes injected, optional, set flag in AddTask
+      fHistPiPiMonitorMCCuts[0]->Fill(10*fillMCtruth);
+      fHistPiPMonitorMCCuts[0]->Fill(10*fillMCtruth);
+      fHistPiAPMonitorMCCuts[0]->Fill(10*fillMCtruth);
+    }
+
+
+    //-------------- MC truth mode  --------------//
+    //---------- fill MC truth histos --------------//
+    if(fMCTruthMode && !fMCMode){//MC true ana
+      fHistPiPiMonitorMCCuts[isSecd]->Fill(14*fillFlagK0);
+      fHistPiPMonitorMCCuts[isSecd]->Fill(14*fillFlagL);
+      fHistPiAPMonitorMCCuts[isSecd]->Fill(14*fillFlagAL);
+      
+      //-- DCA daughters --//
+      // values of one daugher, should be the same      
+      /*
+      //to primary vertex
+      trackPos->GetImpactParameters(tdcaPosToVertex[0],tdcaPosToVertex[1]);
+      trackNeg->GetImpactParameters(tdcaNegToVertex[0],tdcaNegToVertex[1]);
+        
+      Double_t dcaPosToVertex = TMath::Sqrt(tdcaPosToVertex[0]*tdcaPosToVertex[0]+tdcaPosToVertex[1]*tdcaPosToVertex[1]);
+      Double_t dcaNegToVertex = TMath::Sqrt(tdcaNegToVertex[0]*tdcaNegToVertex[0]+tdcaNegToVertex[1]*tdcaNegToVertex[1]);
+      fHistDCADaughtersToPrimVtx[isSecd]->Fill(dcaPosToVertex,dcaNegToVertex);
+      */
+        
+        
+      //-- armenteros values --//
+      TVector3 vecPip;
+      TVector3 vecPin;
+       
+      Double_t ptPlus=0, ptMinus=0;
+      Double_t pt00 = p00->Pt();
+      Double_t pt01 = p01->Pt();
+      Double_t  phiPosMC=0.0;
+           
+      if(p00->GetPdgCode()<0)
+       {
+         vecPip.SetXYZ(p01->Px(),p01->Py(),p01->Pz());
+         vecPin.SetXYZ(p00->Px(),p00->Py(),p00->Pz());
+         ptMinus = pt00;
+         ptPlus = pt01;
+         phiPosMC = p01->Phi();
+       }
+      else{
+       vecPin.SetXYZ(p01->Px(),p01->Py(),p01->Pz());
+       vecPip.SetXYZ(p00->Px(),p00->Py(),p00->Pz());
+       ptMinus = pt01;
+       ptPlus = pt00;
+       phiPosMC = p00->Phi();
+      }
+           
+      TVector3 momTot(p0->Px(),p0->Py(),p0->Pz());
+      Double_t lQlNeg = fabs(vecPin.Dot(momTot)/momTot.Mag());
+      Double_t lQlPos = fabs(vecPip.Dot(momTot)/momTot.Mag());
+      Double_t alfa =0.0;
+      Double_t den = lQlPos + lQlNeg;
+      if(den>0) alfa = (lQlPos - lQlNeg)/den;
+      TVector3 qtvec= vecPin.Cross(momTot);//vecPip.Mag()*sqrt(1-pow(thetapip,2));
+      Float_t qt = qtvec.Mag()/momTot.Mag();
+      
+          
+        
+      if(pdgCode == 310) {
+       fHistPiPiEtaDMC[isSecd]->Fill(etaMC00,ptV0MC);
+       fHistPiPiEtaDMC[isSecd]->Fill(etaMC01,ptV0MC);
+      }
+      if(fabs(pdgCode) == 3122) {
+       fHistPiPEtaDMC[isSecd]->Fill(etaMC00,ptV0MC);
+       fHistPiPEtaDMC[isSecd]->Fill(etaMC01,ptV0MC);
+      }
+
+      //-- rapidity and eta cut --//      
+      if(fRapCutV0 && fabs(rapidity)>fRap) continue;//optional, set flag in AddTask
+      fHistPiPiMonitorMCCuts[isSecd]->Fill(15*fillFlagK0);
+      fHistPiPMonitorMCCuts[isSecd]->Fill(15*fillFlagL);
+      fHistPiAPMonitorMCCuts[isSecd]->Fill(15*fillFlagAL);
+        
+      if(fEtaCutMCDaughters) { if(fabs(etaMC00)>fEtaCutMCDaughtersVal || fabs(etaMC01)>fEtaCutMCDaughtersVal ) continue; }//optional, set flag in AddTask
+      fHistPiPiMonitorMCCuts[isSecd]->Fill(16*fillFlagK0);
+      fHistPiPMonitorMCCuts[isSecd]->Fill(16*fillFlagL);
+      fHistPiAPMonitorMCCuts[isSecd]->Fill(16*fillFlagAL);
+
+    
+
+      //-- Fill Particle histos --//
+      if(pdgCode==310){//K0s
+       fHistPiPiMonitorMCCuts[isSecd]->Fill(17);
+
+       fHistPiPiEtaDMC[1]->Fill(etaMC00,ptV0MC);
+       fHistPiPiEtaDMC[1]->Fill(etaMC01,ptV0MC);
+         
+       fHistPiPiMass[isSecd]->Fill(massV0MC);
+       fHistPiPiMassVSPt[isSecd]->Fill(massV0MC,ptV0MC);
+       // fHistPiPiPtDaughters[isSecd]->Fill(ptMinus,ptPlus);
+       fHistPiPiPtVSY[isSecd]->Fill(rapidity,ptV0MC);
+          
+       Double_t ctTK0s=0.0,ctK0s=0.0;
+       if(pV0MC>0.0) ctK0s=declength3d*0.497614/pV0MC;
+       if(ptV0MC>0.0) ctTK0s=declength*0.497614/ptV0MC;
+       fHistPiPiDecayLengthResolution[0]->Fill(declength3d,declength);
+       fHistPiPiDecayLengthVsPt[isSecd]->Fill(ptV0MC,declength);
+       fHistPiPiDecayLengthVsCtau[isSecd]->Fill(massV0MC,ctTK0s);
+       fHistPiPiDecayLengthVsMass[isSecd]->Fill(massV0MC,declength);
+       //all V0s histo
+       fHistArmenteros[isSecd]->Fill(alfa,qt);
+       fHistV0RadiusZ[isSecd]->Fill(rMC2D,xyzMC[2]);
+       fHistV0RadiusXY[isSecd]->Fill(xyzMC[0],xyzMC[1]);
+       fHistV0RadiusZVSPt[isSecd]->Fill(ptV0MC,xyzMC[2]);
+      }
+      if(pdgCode==3122){ //Lambda
+       fHistPiPMonitorMCCuts[isSecd]->Fill(17);
+       
+       fHistPiPEtaDMC[1]->Fill(etaMC00,ptV0MC);
+       fHistPiPEtaDMC[1]->Fill(etaMC01,ptV0MC);
+
+       fHistPiPMassVSPt[isSecd]->Fill(massV0MC,ptV0MC);
+       fHistPiPMass[isSecd]->Fill(massV0MC);  
+       //  fHistPiPPtDaughters[isSecd]->Fill(ptMinus,ptPlus);
+       fHistPiPPtVSY[isSecd]->Fill(rapidity,ptV0MC);
+          
+       Double_t ctTL=0.0, ctL=0.0;
+       if(pV0MC>0.0) ctL=declength3d*1.115683/pV0MC;
+       if(ptV0MC>0.0) ctTL=declength*1.115683/ptV0MC;
+       fHistPiPDecayLengthResolution[0]->Fill(declength3d,declength);
+       fHistPiPDecayLengthVsPt[isSecd]->Fill(ptV0MC,declength);
+       fHistPiPDecayLengthVsCtau[isSecd]->Fill(massV0MC,ctTL);
+       fHistPiPDecayLengthVsMass[isSecd]->Fill(massV0MC,declength);
+       //all V0s hito  
+       fHistArmenteros[isSecd]->Fill(alfa,qt);
+       fHistV0RadiusZ[isSecd]->Fill(rMC2D,xyzMC[2]);
+       fHistV0RadiusXY[isSecd]->Fill(xyzMC[0],xyzMC[1]);
+       fHistV0RadiusZVSPt[isSecd]->Fill(ptV0MC,xyzMC[2]);
+      }
+      
+      if(pdgCode==-3122){ //AntiLambda
+       fHistPiAPMonitorMCCuts[isSecd]->Fill(17);
+           
+       fHistPiPEtaDMC[1]->Fill(etaMC00,ptV0MC);
+       fHistPiPEtaDMC[1]->Fill(etaMC01,ptV0MC);
+
+       fHistPiAPMassVSPt[isSecd]->Fill(massV0MC,ptV0MC);
+       fHistPiAPMass[isSecd]->Fill(massV0MC);
+       //  fHistPiAPPtDaughters[isSecd]->Fill(ptMinus,ptPlus);
+       fHistPiAPPtVSY[isSecd]->Fill(rapidity,ptV0MC);
+         
+       Double_t ctTL=0.0, ctL=0.0;
+       if(pV0MC>0.0) ctL=declength3d*1.115683/pV0MC;
+       if(ptV0MC>0.0) ctTL=declength*1.115683/ptV0MC;
+       fHistPiAPDecayLengthResolution[0]->Fill(declength3d,declength);
+       fHistPiAPDecayLengthVsPt[isSecd]->Fill(ptV0MC,declength);
+       fHistPiAPDecayLengthVsCtau[isSecd]->Fill(massV0MC,ctL);
+       fHistPiAPDecayLengthVsMass[isSecd]->Fill(massV0MC,ctTL);
+       //all V0s histo    
+       fHistArmenteros[isSecd]->Fill(alfa,qt);
+       fHistV0RadiusZ[isSecd]->Fill(rMC2D,xyzMC[2]);
+       fHistV0RadiusXY[isSecd]->Fill(xyzMC[0],xyzMC[1]);
+       fHistV0RadiusZVSPt[isSecd]->Fill(ptV0MC,xyzMC[2]);
+       fHistV0RadiusXYVSY[isSecd]->Fill(rapidity,rMC2D);
+      }
+    }//MC true ana
+    else{//MC reco ana
+      V0RecoLoop(id0,id1,isSecd,pdgCode,ptV0MC,pdgMother,ptXiMother,declength);
+    }
+      
+  }//end MC stack loop
+}
+//________________________________________________________________________
+void AliAnalysisTaskV0ForRAA::V0RecoLoop(Int_t id0,Int_t id1,Int_t isSecd,Int_t what,Double_t ptV0MC, Int_t pdgMother,Double_t ptXiMother,Double_t declengthV0MC){
+  //loop over reconstructed particles MC or Data
+
+   
+  //--------------------- define variables -----------------------//
+  Double_t pp[3];
+  Double_t pm[3];
+  Double_t xr[3];
+   
+  Double_t massPi=0.13957018;
+  Double_t massP=0.93827203;
+  
+  TLorentzVector positivesMIP;
+  TLorentzVector negativesMIAP;
+  TLorentzVector positivesMIPi;
+  TLorentzVector negativesMIPi;
+
+  /*
+    AliKFParticle::SetField(fESD->GetMagneticField());
+    AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));
+    AliKFVertex primVtxImproved = primVtx;
+
+    AliKFParticle* negPiKF=NULL;
+    AliKFParticle* posPiKF=NULL;
+    AliKFParticle* posPKF=NULL;
+    AliKFParticle* negAPKF=NULL;
+  */
+
+  AliESDtrack* trackPos=NULL;
+  AliESDtrack* trackNeg=NULL;
+  AliESDtrack* trackPosTest = NULL;
+  AliESDtrack* trackNegTest =NULL;
+
+  Double_t primaryVtxPosition[3];
+  primaryVtxPosition[0] = fESD->GetPrimaryVertex()->GetXv();
+  primaryVtxPosition[1] = fESD->GetPrimaryVertex()->GetYv();
+  primaryVtxPosition[2] = fESD->GetPrimaryVertex()->GetZv();
+   
+  Int_t nV0 = fESD->GetNumberOfV0s();
+  AliESDv0 * v0MIs=NULL;
+
+  
+  Bool_t stopLoop = kFALSE;
+  //------------------------ V0 reco loop --------------------//
+  for(Int_t iV0MI = 0; iV0MI < nV0; iV0MI++) {//V0 loop
+
+    if(stopLoop) break; //in case of MC if MC truth partner is found
+
+    //-- get V0 info --//       
+    v0MIs = fESD->GetV0(iV0MI);
+    if(!v0MIs ) continue;
+
+    fHistPiPiMonitorCuts[isSecd]->Fill(1);
+    fHistPiPMonitorCuts[isSecd]->Fill(1);
+    fHistPiAPMonitorCuts[isSecd]->Fill(1);
+
+    //------------ get references of daughters --------------//
+    //-- esd tracks --//
+    trackPosTest = fESD->GetTrack(v0MIs->GetPindex());
+    trackNegTest = fESD->GetTrack(v0MIs->GetNindex());
+     
+    if( trackPosTest->GetSign() == trackNegTest->GetSign()) continue;//reject same signed daughters
+        
+    fHistPiPiMonitorCuts[isSecd]->Fill(2);
+    fHistPiPMonitorCuts[isSecd]->Fill(2);
+    fHistPiAPMonitorCuts[isSecd]->Fill(2);
+
+    Bool_t onthefly = v0MIs->GetOnFlyStatus();
+    if(fOntheFly!=onthefly) continue;// select on-the-fly or offline V0 in AddTask
+   
+    fHistPiPiMonitorCuts[isSecd]->Fill(3);
+    fHistPiPMonitorCuts[isSecd]->Fill(3);
+    fHistPiAPMonitorCuts[isSecd]->Fill(3);
+         
+    //-- for MC mode --//
+    if(fMCMode){
+      //check MC labels (and find partners for MC truth V0 daughters for fMCTruthMode=kTRUE)
+      if(!GetMCTruthPartner(trackPosTest,trackNegTest,id0,id1)) continue;
+      else stopLoop = kTRUE;
+    }
+
+    fHistPiPiMonitorCuts[isSecd]->Fill(4);
+    fHistPiPMonitorCuts[isSecd]->Fill(4);
+    fHistPiAPMonitorCuts[isSecd]->Fill(4);
+     
+    
+    //--  get eta from V0 daughters --//
+    Double_t posDaughterEta=0.0;
+    Double_t negDaughterEta=0.0;
+    Double_t posDaughterPhi=0.0;
+    Double_t negDaughterPhi=0.0;
+        
+    Double_t eta00 = trackPosTest->Eta();
+    Double_t eta01 = trackNegTest->Eta();
+
+    Int_t indexPos = 0,indexNeg=0;
+  
+
+    //---------- check sign assignment for daughters --------//
+    Bool_t switchSign = kFALSE;
+     
+    if( trackPosTest->GetSign() >0){//pos
+      indexPos = v0MIs->GetPindex();
+      indexNeg = v0MIs->GetNindex();
+
+      v0MIs->GetPPxPyPz(pp[0],pp[1],pp[2]);
+      v0MIs->GetNPxPyPz(pm[0],pm[1],pm[2]);
+
+      posDaughterEta = v0MIs->GetParamP()->Eta();
+      negDaughterEta = v0MIs->GetParamN()->Eta();
+      posDaughterPhi = v0MIs->GetParamP()->Phi();
+      negDaughterPhi = v0MIs->GetParamN()->Phi();
+      /*      
+             if (negPiKF) delete negPiKF; negPiKF=NULL;
+             if (posPiKF) delete posPiKF; posPiKF=NULL;
+             if (posPKF) delete posPKF; posPKF=NULL;
+             if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+             negPiKF = new AliKFParticle( *(v0MIs->GetParamN()) ,-211);
+             posPiKF = new AliKFParticle( *(v0MIs->GetParamP()) ,211);
+             posPKF = new AliKFParticle( *(v0MIs->GetParamP()) ,2212);
+             negAPKF = new AliKFParticle( *(v0MIs->GetParamN()) ,-2212);
+      */
+           
+    }
+    if( trackPosTest->GetSign() <0){//neg
+
+      indexPos = v0MIs->GetNindex();
+      indexNeg = v0MIs->GetPindex();
+
+      v0MIs->GetNPxPyPz(pp[0],pp[1],pp[2]);
+      v0MIs->GetPPxPyPz(pm[0],pm[1],pm[2]);
+      
+      posDaughterEta = v0MIs->GetParamN()->Eta();
+      negDaughterEta = v0MIs->GetParamP()->Eta();
+      posDaughterPhi = v0MIs->GetParamN()->Phi();
+      negDaughterPhi = v0MIs->GetParamP()->Phi();
+      /*
+       if (negPiKF) delete negPiKF; negPiKF=NULL;
+       if (posPiKF) delete posPiKF; posPiKF=NULL;
+       if (posPKF) delete posPKF; posPKF=NULL;
+       if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+
+       negPiKF = new AliKFParticle( *(v0MIs->GetParamP()) ,-211);
+       posPiKF = new AliKFParticle( *(v0MIs->GetParamN()) ,211);
+       posPKF = new AliKFParticle( *(v0MIs->GetParamN()) ,2212);
+       negAPKF = new AliKFParticle( *(v0MIs->GetParamP()) ,-2212);
+      */
+      
+      switchSign = kTRUE;
+      eta01 = trackPosTest->Eta();
+      eta00 = trackNegTest->Eta();
+
+    }
+    
+    trackPos =fESD->GetTrack(indexPos);
+    trackNeg =fESD->GetTrack(indexNeg);
+    
+    // ------------- calc masses and 4 vectors -------------- //
+    //K0
+    positivesMIPi.SetXYZM(pp[0],pp[1],pp[2],massPi);
+    negativesMIPi.SetXYZM(pm[0],pm[1],pm[2],massPi);
+    TLorentzVector v0K0=positivesMIPi+negativesMIPi;
+    
+    //Lambda
+    positivesMIP.SetXYZM(pp[0],pp[1],pp[2],massP);
+    TLorentzVector v0Lambda=positivesMIP+negativesMIPi;
+     
+    //Anitlambda
+    negativesMIAP.SetXYZM(pm[0],pm[1],pm[2],massP);
+    TLorentzVector v0ALambda=positivesMIPi+negativesMIAP;
+    
+    
+    TVector3 ppTrack(pp);
+    TVector3 pmTrack(pm);
+      
+    //    Double_t posDaughterPt = ppTrack.Pt();
+    //    Double_t negDaughterPt = pmTrack.Pt();
+   
+    Double_t posDaughterP = ppTrack.Mag();
+    Double_t negDaughterP = pmTrack.Mag();
+
+    //---------------------AliKFParticle ---------------------//
+    /*  
+       Double_t chi2K0C=0.0;
+       Double_t chi2LambdaC=0.0;
+       Double_t chi2ALambdaC=0.0;
+
+     
+       AliKFParticle v0K0KF;
+       v0K0KF +=(*negPiKF);
+       v0K0KF +=(*posPiKF);
+       //v0K0C.SetVtxGuess(xr[0],xr[1],xr[2]);
+       v0K0KF.SetProductionVertex(primVtxImproved);
+         
+       AliKFParticle v0LambdaKF;
+       v0LambdaKF +=(*negPiKF);
+       v0LambdaKF +=(*posPKF);
+       //v0LambdaC.SetVtxGuess(xr[0],xr[1],xr[2]);
+       v0LambdaKF.SetProductionVertex(primVtxImproved);
+         
+       AliKFParticle v0ALambdaKF;
+       v0ALambdaKF +=(*negAPKF);
+       v0ALambdaKF +=(*posPiKF);
+       //v0ALambdaC.SetVtxGuess(xr[0],xr[1],xr[2]);
+       v0ALambdaKF.SetProductionVertex(primVtxImproved);
+       
+       if( v0K0KF.GetNDF() != 0) {
+       chi2K0C = v0K0KF.GetChi2()/v0K0KF.GetNDF();
+       }
+
+       Double_t chi2LambdaC=100000.;
+       if( v0LambdaKF.GetNDF() != 0) {
+       chi2LambdaC = v0LambdaKF.GetChi2()/v0LambdaKF.GetNDF();
+       }
+
+       Double_t chi2ALambdaC=100000.;
+       if( v0ALambdaKF.GetNDF() != 0) {
+       chi2ALambdaC = v0ALambdaKF.GetChi2()/v0ALambdaKF.GetNDF();
+       }
+    */
+      
+    
+    //------------------- DCA and decay radius V0 -------------//
+    v0MIs->GetXYZ(xr[0],xr[1],xr[2]);
+       
+    Double_t dim2V0Radius= sqrt( pow(xr[0] - primaryVtxPosition[0],2.0)
+                                +pow(xr[1] - primaryVtxPosition[1],2.0));
+
+    Double_t decayLength = sqrt( pow(xr[0] - primaryVtxPosition[0],2.0) 
+                                +pow(xr[1] - primaryVtxPosition[1],2.0)
+                                +pow(xr[2] - primaryVtxPosition[2],2.0));
+        
+    Double_t  dcaV0ToPrimVertex= v0MIs->GetD(primaryVtxPosition[0],primaryVtxPosition[1]);
+    ////v0K0KF.GetDistanceFromVertexXY(tPrimaryVtxPosition);
+
+   
+    //-------------------- general V0 cuts -------------------//
+         
+    //-- eta cut --//
+    if( fabs(posDaughterEta) > fEtaCutMCDaughtersVal || fabs(negDaughterEta) > fEtaCutMCDaughtersVal) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(6);
+    fHistPiPMonitorCuts[isSecd]->Fill(6);
+    fHistPiAPMonitorCuts[isSecd]->Fill(6);
+
+    //-- pt cut --//
+    //if( fabs(posDaughterPt)<fMinPt || fabs(negDaughterPt) < fMinPt ) continue;
+    // fHistPiPiMonitorCuts[isSecd]->Fill(7);
+    // fHistPiPMonitorCuts[isSecd]->Fill(7);
+    // fHistPiAPMonitorCuts[isSecd]->Fill(7);
+
+      
+    //-- radius xy min cut --//
+    if(dim2V0Radius < fDecayRadXYMin) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(7);
+    fHistPiPMonitorCuts[isSecd]->Fill(7);
+    fHistPiAPMonitorCuts[isSecd]->Fill(7);
+
+    //-- radius xy max cut --//
+    if(dim2V0Radius > fDecayRadXYMax) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(8);
+    fHistPiPMonitorCuts[isSecd]->Fill(8);
+    fHistPiAPMonitorCuts[isSecd]->Fill(8);
+      
+    //-- decay length min ->ctau --//
+    if(decayLength > fDecayLengthMax) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(9);
+    fHistPiPMonitorCuts[isSecd]->Fill(9);
+    fHistPiAPMonitorCuts[isSecd]->Fill(9);
+    
+    //-- decay length min cut --//
+    if(decayLength < fDecayLengthMin) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(10);
+    fHistPiPMonitorCuts[isSecd]->Fill(10);
+    fHistPiAPMonitorCuts[isSecd]->Fill(10);
+   
+
+    //----------------------- V0 variables --------------------//
+    //-- armenteros --//
+    TVector3 momTot = ppTrack + pmTrack;
+    Double_t lQlNeg = fabs(pmTrack.Dot(momTot)/momTot.Mag());
+    Double_t lQlPos = fabs(ppTrack.Dot(momTot)/momTot.Mag());
+  
+    Double_t alfa =0.0;
+    Double_t den = lQlPos + lQlNeg;
+    if(den>0) alfa = (lQlPos - lQlNeg)/den;
+    TVector3 qtvec= pmTrack.Cross(momTot);
+    Double_t qt = qtvec.Mag()/momTot.Mag();
+
+    //-- momenta --//
+    //pT
+    Double_t ptK0s = v0K0.Pt();
+    Double_t ptLambda = v0Lambda.Pt();
+    Double_t ptALambda = v0ALambda.Pt();
+    //p
+    Double_t pK0s = v0K0.P();
+    Double_t pLambda = v0Lambda.P();
+    Double_t pALambda = v0ALambda.P();
+      
+    //-- masses --//
+    Double_t massK0s = v0K0.M();
+    Double_t massLambda = v0Lambda.M();
+    Double_t massALambda = v0ALambda.M();
+
+    //-- rapidity --//
+    Double_t rapK0s = v0MIs->Y(310);
+    Double_t rapL   = v0MIs->Y(3122);
+    Double_t rapAL  = v0MIs->Y(3122);
+
+    //-- other variables --//
+    Double_t opAng =   fabs(ppTrack.Angle(pmTrack));
+    /*
+      Double_t phiK0 =  v0K0.Phi();
+      Double_t phiL =  v0Lambda.Phi();
+      Double_t phiAL =  v0ALambda.Phi();
+    */
+    Double_t cosOPAng = v0MIs->GetV0CosineOfPointingAngle();
+      
+    /*     
+    //introduce more histo
+    Double_t errOnMassK0s = v0MIs->ChangeMassHypothesis(310);
+    Double_t errOnMassLambda = 0.0;
+    Double_t errOnMassALambda = 0.0;
+    if(!switchSign){
+    errOnMassLambda  = v0MIs->ChangeMassHypothesis(3122);
+    errOnMassALambda = v0MIs->ChangeMassHypothesis(-3122);
+    }
+    else{
+    errOnMassLambda  = v0MIs->ChangeMassHypothesis(-3122);
+    errOnMassALambda = v0MIs->ChangeMassHypothesis(3122);
+    }
+    */
+
+    //-- DCAbetween the daughters --//
+    Double_t dcaDaughters = v0MIs->GetDcaV0Daughters();  
+    
+    //-- DCA daughters to primary vertex --//
+    Double_t dcaPosToVertex=0.0,dcaNegToVertex=0.0;
+    Double_t dzPos=(primaryVtxPosition[0]-xr[0])*ppTrack.Y() - (primaryVtxPosition[1]-xr[1])*ppTrack.X();
+    dcaPosToVertex=TMath::Sqrt(dzPos*dzPos/(pow(ppTrack.X(),2)+pow(ppTrack.Y(),2)));
+    Double_t dzNeg=(primaryVtxPosition[0]-xr[0])*pmTrack.Y() - (primaryVtxPosition[1]-xr[1])*pmTrack.X();
+    dcaNegToVertex=TMath::Sqrt(dzNeg*dzNeg/(pow(pmTrack.X(),2)+pow(pmTrack.Y(),2)));
+     
+    // Double_t dcaPosToVertex[3];dcaNegToVertex[3];
+    // trackPos->GetImpactParameters(dcaPosToVertex[0],dcaPosToVertex[1]);
+    // trackNeg->GetImpactParameters(dcaNegToVertex[0],dcaNegToVertex[1]);
+        
+    // dcaPosToVertex = TMath::Sqrt(dcaPosToVertex[0]*dcaPosToVertex[0]+dcaPosToVertex[1]*dcaPosToVertex[1]);
+    // dcaNegToVertex = TMath::Sqrt(dcaNegToVertex[0]*dcaNegToVertex[0]+dcaNegToVertex[1]*dcaNegToVertex[1]);
+        
+    //dcaPosToVertex  =   posPKF->GetDistanceFromVertexXY(primaryVtxPosition);
+    //dcaNegToVertex  =   negPiKF->GetDistanceFromVertexXY(primaryVtxPosition);
+
+
+    //------------------------ detector values -------------------------------//
+    //-- TPC ITS values pos --//
+    Int_t nclsTPCPos =  trackPos->GetNcls(1);
+    Int_t nclsTPCFindablePos =  trackPos->GetTPCNclsF();
+    Int_t nclsITSPos =  trackPos->GetNcls(0);
+    Double_t chi2PerClusterITSPos = -1.0;
+    if(nclsITSPos>0) chi2PerClusterITSPos = trackPos->GetITSchi2()/Double_t(nclsITSPos);
+    Double_t crossedRowsTPCPos = trackPos->GetTPCCrossedRows();
+      
+    //-- TPC ITS values neg --//
+    Int_t nclsTPCNeg =  trackNeg->GetNcls(1);
+    Int_t nclsTPCFindableNeg =  trackNeg->GetTPCNclsF();
+    Int_t nclsITSNeg =  trackNeg->GetNcls(0);
+    Double_t chi2PerClusterITSNeg = -1.0;
+    if(nclsITSNeg>0) chi2PerClusterITSNeg =trackNeg->GetITSchi2()/Double_t(nclsITSNeg);
+    Double_t crossedRowsTPCNeg = trackNeg->GetTPCCrossedRows();    
+
+    //-- ratio TPC crossed rows to clusters --//
+    Double_t ratio = 10.0;
+    if(nclsTPCFindableNeg >0.0) ratio        = double(crossedRowsTPCNeg)/ double(nclsTPCFindableNeg);
+    
+    Double_t ratioPos = 10.0;
+    if(nclsTPCFindablePos >0.0) ratioPos     = double(crossedRowsTPCPos)/ double(nclsTPCFindablePos);
+    
+    Double_t ratioFoFi = 10.0;
+    if(nclsTPCFindableNeg >0.0) ratioFoFi    = double(nclsTPCNeg)/ double(nclsTPCFindableNeg);
+    
+    Double_t ratioFoFiPos = 10.0;
+    if(nclsTPCFindablePos >0.0) ratioFoFiPos = double(nclsTPCPos)/ double(nclsTPCFindablePos);
+      
+      
+    //-------------- cuts on det. values ---------------------------------------//
+    if(fMoreNclsThanRows && (crossedRowsTPCPos < nclsTPCPos || crossedRowsTPCNeg < nclsTPCNeg  )) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(11);
+    fHistPiPMonitorCuts[isSecd]->Fill(11);
+    fHistPiAPMonitorCuts[isSecd]->Fill(11);
+      
+    if(fMoreNclsThanFindable && (nclsTPCFindablePos < nclsTPCPos || nclsTPCFindableNeg < nclsTPCNeg  )) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(12);
+    fHistPiPMonitorCuts[isSecd]->Fill(12);
+    fHistPiAPMonitorCuts[isSecd]->Fill(12);      
+
+    if(fMoreNclsThanFindableMax && ( nclsTPCPos < (nclsTPCFindablePos -60.0) || nclsTPCNeg < (nclsTPCFindableNeg - 60.0) )) continue;
+    // if(chi2PerClusterITSNeg > fChi2PerClusterITS || chi2PerClusterITSPos > fChi2PerClusterITS ) continue;
+    fHistPiPiMonitorCuts[isSecd]->Fill(13);
+    fHistPiPMonitorCuts[isSecd]->Fill(13);
+    fHistPiAPMonitorCuts[isSecd]->Fill(13);  
+      
+    if(ratio > fRatioMaxCRowsOverFindable || ratioPos > fRatioMaxCRowsOverFindable) continue; 
+
+    if(ratioFoFi < fRatioFoundOverFindable || ratioFoFiPos < fRatioFoundOverFindable) continue; 
+    fHistPiPiMonitorCuts[isSecd]->Fill(14);
+    fHistPiPMonitorCuts[isSecd]->Fill(14);
+    fHistPiAPMonitorCuts[isSecd]->Fill(14); 
+
+
+
+    //------------------- cuts on V0 -------------------------------------------------------------------//
+    //-- cut flags for V0 specific cuts --//
+    Bool_t cutOKK0s = kTRUE;
+    Bool_t cutOKLambda = kTRUE;
+    Bool_t cutOKALambda = kTRUE;
+
+    // ----------------- for MC mode ------------------------ //
+    Bool_t fillK0sMC = kTRUE;
+    Bool_t fillLambdaMC = kTRUE;
+    Bool_t fillALambdaMC = kTRUE;
+
+    if(fMCMode && fMCTruthMode) {
+      if(what == 310) {
+       fillLambdaMC = kFALSE;
+       fillALambdaMC = kFALSE;
+      }
+      else if(what == 3122){
+       fillALambdaMC = kFALSE;
+       fillK0sMC = kFALSE;
+      }
+      else if(what == -3122){
+       fillLambdaMC = kFALSE;
+       fillK0sMC = kFALSE;
+      }
+    }
+    
+    //-------------------------- K0 cuts -----------------------------//
+
+    if(dcaV0ToPrimVertex > fDCAToVertexK0)  cutOKK0s = kFALSE;
+    if(fabs(xr[2])>fDCAZ) continue;//like decay radius z component
+    fHistPiPiMonitorCuts[isSecd]->Fill(15);
+      
+    Double_t ctK0 = 0.0,ctTK0 = 0.0;
+    if(fabs(pK0s)>0.0)  ctK0 = decayLength*0.497614/pK0s;//ctau in 3D
+    if(fabs(ptK0s)>0.0)  ctTK0 = dim2V0Radius*0.497614/ptK0s;// "transverse" ctau
+    if(ctK0 > fCtauK0s &&  fabs(ptK0s) <fCtauPtCutK0) cutOKK0s = kFALSE;
+    else  fHistPiPiMonitorCuts[isSecd]->Fill(16);
+      
+    if((cosOPAng < fCosPointAngK && fabs(ptK0s) < fCPAPtCutK0)|| cosOPAng<0.99)
+      cutOKK0s = kFALSE;//cosine of pointing angle
+    else  fHistPiPiMonitorCuts[isSecd]->Fill(17);
+
+    if(dcaDaughters > fDCADaughtersK0 )cutOKK0s = kFALSE;// dca daughters
+    else  fHistPiPiMonitorCuts[isSecd]->Fill(18);
+        
+    if(dcaNegToVertex < fDCADaughtersToVtxSmall || dcaPosToVertex < fDCADaughtersToVtxSmall)  
+      cutOKK0s = kFALSE; //dca neg and pos daughter to vertex
+    else  fHistPiPiMonitorCuts[isSecd]->Fill(19);
+
+    if(fRapCutV0 && fabs(rapK0s) > fRap) cutOKK0s = kFALSE;//rapidity
+    else  fHistPiPiMonitorCuts[isSecd]->Fill(20);  
+    /* 
+       if(chi2K0C > fChiCutKf) cutOKK0s = kFALSE;
+       if(opAng < fOpengAngleDaughters && fabs(ptK0s) < fOpAngPtCut )  cutOKK0s = kFALSE;//opening angle cut
+       else
+    */
+
+    if(fabs(1.115 - massLambda) < fExcludeLambdaFromK0s) cutOKK0s = kFALSE;//exclude Lambdas from K0s
+  if(fabs(1.115 - massALambda) < fExcludeLambdaFromK0s) cutOKK0s = kFALSE;//exclude AntiLambdas from K0s
+    fHistPiPiMonitorCuts[isSecd]->Fill(21);
+
+    Bool_t ptbinokK0s=kFALSE;
+    if( ptK0s < fQtCut &&  ptK0s > fQtCutPtLow ) ptbinokK0s=kTRUE;// cut below pt threshhold
+    Double_t qtval  = fArmQtSlope*fabs(alfa);
+    if(fArmCutK0 && ptbinokK0s && qt < qtval) cutOKK0s = kFALSE; //cut in armenteros-podolanski diagram
+    else  fHistPiPiMonitorCuts[isSecd]->Fill(22);
+    
+    if( ptK0s > fPtTPCCut){
+      if(fESDTrackCuts){
+       if(!fESDTrackCuts->AcceptTrack(trackPosTest)) cutOKK0s = kFALSE; //esd track cuts for pion
+       if(!fESDTrackCuts->AcceptTrack(trackNegTest)) cutOKK0s = kFALSE; //esd track cuts for pion
+      }
+      else  fHistPiPiMonitorCuts[isSecd]->Fill(5); 
+    }
+    else{
+      if(fESDTrackCutsLowPt){
+       if(!fESDTrackCutsLowPt->AcceptTrack(trackPosTest))  cutOKK0s = kFALSE; //esd track cuts at low pt
+       if(!fESDTrackCutsLowPt->AcceptTrack(trackNegTest))  cutOKK0s = kFALSE; //esd track cuts at low pt
+      }
+    }
+
+
+
+    //-------------------------- Lambda cuts -------------------------//
+    if(dcaV0ToPrimVertex > fDCAToVertexL) cutOKLambda = kFALSE;
+    if(fabs(xr[2])>fDCAZ) continue;//like decay radius z component
+    fHistPiPMonitorCuts[isSecd]->Fill(15);
+         
+    Double_t ctL = 0.0,ctTL=0.0;
+    if(fabs(pLambda)>0.0)  ctL  = decayLength*1.115683/fabs(pLambda);//ctau in 3D
+    if(fabs(ptLambda)>0.0) ctTL = dim2V0Radius*1.115683/fabs(ptLambda);// "transverse" ctau
+        
+    if(ctL > fCtauL && fabs(ptLambda) <fCtauPtCutL)  cutOKLambda = kFALSE;
+    else  fHistPiPMonitorCuts[isSecd]->Fill(16);
+      
+    if((cosOPAng<fCosPointAngL && fabs(ptLambda) < fCPAPtCutL)|| cosOPAng<0.99)
+      cutOKLambda = kFALSE;//cosine of pointing angle
+    else fHistPiPMonitorCuts[isSecd]->Fill(17);
+
+    if(dcaDaughters > fDCADaughtersL )cutOKLambda = kFALSE;// dca daughters
+    else  fHistPiPMonitorCuts[isSecd]->Fill(18);
+    if( dcaNegToVertex < fDCADaughtersToVtxSmall || dcaPosToVertex < fDCADaughtersToVtxLarge) 
+      cutOKLambda = kFALSE;//dca negand pos  daughter to vertex
+    else  fHistPiPMonitorCuts[isSecd]->Fill(19);
+
+    if(fRapCutV0 && fabs(rapL) > fRap) cutOKLambda = kFALSE;//rapidity
+    else  fHistPiPMonitorCuts[isSecd]->Fill(20);
+       
+    if(fabs(0.497 - massK0s) < fExcludeK0sFromLambda) cutOKLambda = kFALSE;//exclude K0s from Lambda
+
+    /*  
+        if(chi2LambdaC > fChiCutKf) cutOKLambda = kFALSE;
+        else  fHistPiPMonitorCuts[isSecd]->Fill(20);
+    */
+
+    if(opAng < fOpengAngleDaughters && fabs(ptLambda) < fOpAngPtCut )  cutOKLambda = kFALSE;//opening angle cut
+    else  fHistPiPMonitorCuts[isSecd]->Fill(21);
+    
+
+    if(alfa<fAlfaCut  || (fArmCutL && qt>qtval)) cutOKLambda = kFALSE; //cut in armenteros-podolanski diagram
+    else  fHistPiPMonitorCuts[isSecd]->Fill(22);
+
+    if(ptLambda > fPtTPCCut){
+      if(fESDTrackCuts && fESDTrackCutsCharged){
+       if(!fESDTrackCutsCharged->AcceptTrack(trackPosTest)) cutOKLambda = kFALSE;//esd track cuts for proton
+       if(!fESDTrackCuts->AcceptTrack(trackNegTest)) cutOKLambda = kFALSE;//esd track cuts for pion
+      }
+      else  fHistPiPMonitorCuts[isSecd]->Fill(5); 
+    }
+    else{
+      if(fESDTrackCutsLowPt){
+       if(!fESDTrackCutsLowPt->AcceptTrack(trackPosTest))  cutOKLambda = kFALSE; //esd track cuts at low pt
+       if(!fESDTrackCutsLowPt->AcceptTrack(trackNegTest))  cutOKLambda = kFALSE; //esd track cuts at low pt
+      }
+    }
+
+
+    //--------------------------- ALambda cuts --------------------------//
+
+    if(dcaV0ToPrimVertex > fDCAToVertexL) cutOKALambda = kFALSE;
+    if(fabs(xr[2])>fDCAZ) continue;//like decay radius z component
+    fHistPiAPMonitorCuts[isSecd]->Fill(15);
+      
+    Double_t ctAL = 0.0,ctTAL=0.0;
+    if(fabs(pALambda)>0.0)  ctAL  = decayLength*1.115683/fabs(pALambda);//ctau in 3D
+    if(fabs(ptALambda)>0.0) ctTAL = dim2V0Radius*1.115683/fabs(ptALambda);// "transverse" ctau
+    if(ctAL > fCtauL &&  fabs(ptALambda) <fCtauPtCutL)  cutOKALambda = kFALSE;
+    else  fHistPiAPMonitorCuts[isSecd]->Fill(16);
+
+    if((cosOPAng<fCosPointAngL && fabs(ptALambda) < fCPAPtCutL)|| cosOPAng<0.99) 
+      cutOKALambda = kFALSE;//cosine of pointing angle
+    else fHistPiAPMonitorCuts[isSecd]->Fill(17);
+      
+    if(dcaDaughters > fDCADaughtersAL )cutOKALambda = kFALSE;// dca daughters
+    else  fHistPiAPMonitorCuts[isSecd]->Fill(18);
+        
+    if( dcaPosToVertex < fDCADaughtersToVtxSmall || dcaNegToVertex < fDCADaughtersToVtxLarge) 
+      cutOKALambda = kFALSE;//dca pos and neg daughter to vertex
+    else fHistPiAPMonitorCuts[isSecd]->Fill(19);
+        
+    if(fRapCutV0 && fabs(rapAL) > fRap) cutOKALambda = kFALSE;//rapidity
+    else fHistPiAPMonitorCuts[isSecd]->Fill(20);
+
+    if(fabs(0.497 - massK0s) < fExcludeK0sFromLambda) cutOKALambda = kFALSE;//exclude K0s from (A)Lambda
+    /*
+      if(chi2ALambdaC > fChiCutKf) cutOKALambda = kFALSE;
+      else  fHistPiAPMonitorCuts[isSecd]->Fill(20);
+    */
+     
+    if(opAng < fOpengAngleDaughters && fabs(ptALambda) < fOpAngPtCut )  cutOKALambda = kFALSE;//opening angle cut
+    else  fHistPiAPMonitorCuts[isSecd]->Fill(21);
+    
+      
+    if((fArmCutL && qt>qtval) || alfa > -1.0*fAlfaCut) cutOKALambda = kFALSE; //cut in armenteros-podolanski diagram
+    else  fHistPiAPMonitorCuts[isSecd]->Fill(22);
+
+    if(ptALambda > fPtTPCCut){
+      if(fESDTrackCuts && fESDTrackCutsCharged){
+       if(!fESDTrackCuts->AcceptTrack(trackPosTest)) cutOKALambda = kFALSE;//esd track cuts for pion
+       if(!fESDTrackCutsCharged->AcceptTrack(trackNegTest)) cutOKALambda = kFALSE;//esd track cuts for antiproton
+      }
+      else  fHistPiAPMonitorCuts[isSecd]->Fill(5); 
+    }
+    else{
+      if(fESDTrackCutsLowPt){
+       if(!fESDTrackCutsLowPt->AcceptTrack(trackPosTest))  cutOKALambda = kFALSE; //esd track cuts at low pt
+       if(!fESDTrackCutsLowPt->AcceptTrack(trackNegTest))  cutOKALambda = kFALSE; //esd track cuts at low pt
+      }
+    }
+
+    
+    //--------------------- cut on PID: TPC dEdx ----------------------------//
+    //-- dEdx --//
+    Float_t nSigmaTPCtrackPosToPion = 0.0;
+    Float_t nSigmaTPCtrackNegToPion = 0.0;
+    Float_t nSigmaTPCtrackPosToProton = 0.0;
+    Float_t nSigmaTPCtrackNegToProton = 0.0;
+
+        
+    if(fESDpid){
+      nSigmaTPCtrackPosToPion   = fabs(fESDpid->NumberOfSigmasTPC(trackPos,AliPID::kPion));
+      nSigmaTPCtrackNegToPion   = fabs(fESDpid->NumberOfSigmasTPC(trackNeg,AliPID::kPion));
+      nSigmaTPCtrackPosToProton = fabs(fESDpid->NumberOfSigmasTPC(trackPos,AliPID::kProton));
+      nSigmaTPCtrackNegToProton = fabs(fESDpid->NumberOfSigmasTPC(trackNeg,AliPID::kProton));
+    }
+        
+    Bool_t pipidEdx = kTRUE;
+    Bool_t pipdEdx  = kTRUE;
+    Bool_t piapdEdx = kTRUE;
+
+    Double_t tpcsigPos = trackPos->GetTPCsignal();
+    Double_t tpcsigNeg = trackNeg->GetTPCsignal();
+     
+    /*
+      Double_t tpcsigNPos= trackPos->GetTPCsignalN();
+      Double_t tpcsigNNeg= trackNeg->GetTPCsignalN();
+    */
+     
+    Double_t tpcMomPos = trackPos->GetInnerParam()->GetP();
+    Double_t tpcMomNeg = trackNeg->GetInnerParam()->GetP();
+    
+    //-- dedx cut --//
+    if(fUsePID){
+      
+      if(fabs(posDaughterP)<fPPIDcut && tpcsigPos < 5.0){//no zero dedx values!
+       pipidEdx =kFALSE;//k0s
+       piapdEdx =kFALSE;//antilambda
+      }
+      if(fabs(posDaughterP)<fPPIDcut && (nSigmaTPCtrackPosToProton > fNSigma || tpcsigPos < 5.0)) pipdEdx =kFALSE;//lambda
+           
+      if(fabs(negDaughterP)<fPPIDcut &&  tpcsigNeg < 5.0){//no zero dedx values!
+       pipidEdx =kFALSE;//k0s
+       pipdEdx =kFALSE;//lambda
+      }
+      if(fabs(negDaughterP)<fPPIDcut && (nSigmaTPCtrackNegToProton > fNSigma || tpcsigNeg< 5.0)) piapdEdx =kFALSE;//antilambda  
+           
+    }
+   
+    //-------------------- V0 ana -------------------------//
+    //-- cut flags for furhter histos--//
+    Bool_t k0sOK=kFALSE;
+    Bool_t lambdaOK=kFALSE;
+    Bool_t alambdaOK=kFALSE;
+
+    //--  Check for K0 --//
+    if(ptK0s > fMinPt){//min pt cut
+      if( cutOKK0s  && fillK0sMC && isSecd == 0 ){//cuts ok
+       fHistDedxPiPlus[0]->Fill(tpcMomPos,tpcsigPos);
+       fHistDedxPiMinus[0]->Fill(tpcMomNeg,tpcsigNeg);
+       fHistPiPiMonitorCuts[0]->Fill(23);
+       if(pipidEdx){//PID
+         fHistPiPiMonitorCuts[0]->Fill(24);
+         k0sOK=kTRUE;              
+         if(massK0s>0.25 && massK0s<0.75 ){//mass window
+           if(!fMCMode){
+             ptV0MC = ptK0s;
+             declengthV0MC = dim2V0Radius;
+           }
+           fHistPiPiMonitorCuts[0]->Fill(25);
+           fHistPiPiMass[0]->Fill(massK0s);
+           fHistPiPiMassVSPt[0]->Fill(massK0s,ptK0s);
+           fHistPiPiMassVSPtMCTruth[0]->Fill(massK0s,ptV0MC);
+           fHistPiPiRadiusXY[0]->Fill(massK0s,posDaughterPhi);
+           fHistPiPiCosPointAng[0]->Fill(massK0s,cosOPAng);
+           if(massK0s>0.46 && massK0s<0.53)  fHistPiPiDecayLengthVsPt[0]->Fill(ptV0MC,dim2V0Radius);
+           if(fMCMode)  fHistPiPiDecayLengthResolution[0]->Fill(declengthV0MC,dim2V0Radius);
+           fHistPiPiDecayLengthVsCtau[0]->Fill(massK0s,ctTK0);
+           fHistPiPiDecayLengthVsMass[0]->Fill(massK0s,dim2V0Radius);
+
+           fHistPiPiDCADaughters[0]->Fill(massK0s,dcaDaughters);
+           fHistPiPiDCADaughterPosToPrimVtxVSMass[0]->Fill(massK0s,dcaPosToVertex);
+           fHistPiPiDCAVSMass[0]->Fill(massK0s,dcaV0ToPrimVertex);
+           // fHistPiPiPtDaughters[0]->Fill(posDaughterPt,negDaughterPt);
+           fHistPiPiPtVSY[0]->Fill(rapK0s,ptK0s);
+         }
+         fHistArmenteros[0]->Fill(alfa,qt);
+         fHistDedxSecPiPlus[0]->Fill(tpcMomPos,tpcsigPos);
+         fHistDedxSecPiMinus[0]->Fill(tpcMomNeg,tpcsigNeg);
+
+         fHistV0RadiusZ[0]->Fill(dim2V0Radius,xr[2]);
+         fHistV0RadiusXY[0]->Fill(xr[0],xr[1]);
+         fHistV0RadiusZVSPt[0]->Fill(ptK0s,dim2V0Radius);
+         fHistV0RadiusXYVSY[0]->Fill(rapK0s,dim2V0Radius);
+
+         //-- detector values --/
+         fHistNclsITSPosK0[0]->Fill(nclsITSPos);
+         fHistNclsITSNegK0[0]->Fill(nclsITSNeg);
+         fHistNclsTPCPosK0[0]->Fill(nclsTPCPos);
+         fHistNclsTPCNegK0[0]->Fill(nclsTPCNeg);
+         fHistChi2PerNclsITSPosK0[0]->Fill(chi2PerClusterITSPos);
+         fHistChi2PerNclsITSNegK0[0]->Fill(chi2PerClusterITSNeg);
+
+
+         fHistNclsITSNeg[0]->Fill(massK0s,nclsITSPos);
+         fHistNclsTPCNeg[0]->Fill(massK0s,nclsTPCPos);
+         fHistChi2PerNclsITSNeg[0]->Fill(massK0s,chi2PerClusterITSPos);
+         fHistNCRowsTPCNeg[0]->Fill(massK0s,crossedRowsTPCPos);
+
+
+         fHistNclsITSNeg[1]->Fill(massK0s,nclsITSNeg);
+         fHistNclsTPCNeg[1]->Fill(massK0s,nclsTPCNeg);
+         fHistChi2PerNclsITSNeg[1]->Fill(massK0s,chi2PerClusterITSNeg);
+         fHistNCRowsTPCNeg[1]->Fill(massK0s,crossedRowsTPCNeg);
+              
+         fHistRatioFoundOverFinableTPCK0[0]->Fill(massK0s,ratioFoFi);
+         fHistRatioFoundOverFinableTPCK0[1]->Fill(massK0s,ratioFoFiPos);
+
+         fHistNclsITS[1]->Fill(nclsITSPos,nclsITSNeg);
+         fHistNclsTPC[1]->Fill(crossedRowsTPCNeg,nclsTPCNeg);
+       }
+      }
+    }
+   
+    //-----  Check for Lambda -------//
+    if(ptLambda >fMinPt){//min pt cut
+      if(cutOKLambda && fillLambdaMC){// cuts ok
+       fHistDedxProt[isSecd]->Fill(tpcMomPos,tpcsigPos);
+       fHistDedxPiMinus[isSecd]->Fill(tpcMomNeg,tpcsigNeg);
+       fHistPiPMonitorCuts[isSecd]->Fill(23);
+       if(pipdEdx){//PID
+         fHistPiPMonitorCuts[isSecd]->Fill(24);
+         lambdaOK=kTRUE;
+         if( massLambda>1.05 && massLambda<1.25 ){//mass window
+           if(!fMCMode) {
+             ptV0MC = ptLambda;
+             declengthV0MC = dim2V0Radius;
+           }
+           fHistPiPMonitorCuts[isSecd]->Fill(25);
+           fHistPiPMass[isSecd]->Fill(massLambda);
+           fHistPiPMassVSPtMCTruth[isSecd]->Fill(massLambda,ptV0MC);
+           fHistPiPMassVSPt[isSecd]->Fill(massLambda,ptLambda);
+           fHistPiPRadiusXY[isSecd]->Fill(massLambda,posDaughterPhi);
+           fHistPiPCosPointAng[isSecd]->Fill(massLambda,cosOPAng);
+           fHistPiPPtVSY[isSecd]->Fill(rapL,ptLambda);
+           //   fHistPiPPtDaughters[isSecd]->Fill(posDaughterPt,negDaughterPt);
+           fHistPiPDCADaughters[isSecd]->Fill(massLambda,dcaDaughters);
+           fHistPiPDCAVSMass[isSecd]->Fill(massLambda,dcaV0ToPrimVertex);
+           fHistPiPDCADaughterPosToPrimVtxVSMass[isSecd]->Fill(massLambda,dcaPosToVertex);
+           if( massLambda>1.108 && massLambda<1.123 ) fHistPiPDecayLengthVsPt[isSecd]->Fill(ptV0MC,dim2V0Radius);
+           if(fMCMode)  fHistPiPDecayLengthResolution[isSecd]->Fill(declengthV0MC,dim2V0Radius);
+           fHistPiPDecayLengthVsMass[isSecd]->Fill(massLambda,dim2V0Radius);
+           fHistPiPDecayLengthVsCtau[isSecd]->Fill(massLambda,ctTL);
+          
+           //-- secondaries --//
+           if(isSecd == 1){
+             if(fabs(pdgMother) == 3112 || fabs(pdgMother) == 3114 || fabs(pdgMother) == 3222 || fabs(pdgMother) == 3224 || fabs(pdgMother) == 3214 ){
+               fHistPiPMassVSPtSecSigma[1]->Fill(massLambda,ptLambda);
+             }
+           }
+           if(pdgMother == 3322 || pdgMother == 3312){//Xi0 and xi minus
+             fHistPiPCosPointAngXiVsPt->Fill(ptLambda,cosOPAng);
+             fHistPiPMassVSPtSecXi[1]->Fill(massLambda,ptLambda);
+             fHistPiPMassVSPtSecXiMCTruth->Fill(massLambda,ptV0MC);
+             fHistPiPMassVSYSecXi[1]->Fill(massLambda,rapL);
+             fHistPiPXi0PtVSLambdaPt[1]->Fill(ptLambda,ptXiMother);
+           }
+           if(pdgMother == 3334){//Omega
+             fHistPiPMassVSPtSecOmega[1]->Fill(massLambda,ptLambda);
+             fHistPiPMassVSPtSecOmegaMCTruth->Fill(massLambda,ptV0MC);
+             fHistPiPOmegaPtVSLambdaPt[1]->Fill(ptLambda,ptXiMother);
+           }  
+         }
+       }
+
+       if(ptLambda > 0.4) fHistArmenteros[isSecd]->Fill(alfa,qt);
+       fHistV0RadiusZ[isSecd]->Fill(dim2V0Radius,xr[2]);
+       fHistV0RadiusXY[isSecd]->Fill(xr[0],xr[1]);
+       fHistV0RadiusZVSPt[isSecd]->Fill(ptLambda,dim2V0Radius);
+       fHistV0RadiusXYVSY[isSecd]->Fill(rapL,dim2V0Radius);
+       fHistDedxSecProt[isSecd]->Fill(tpcMomPos,tpcsigPos);
+       fHistDedxSecPiMinus[isSecd]->Fill(tpcMomNeg,tpcsigNeg);
+        
+       //-- detector values --//
+       fHistNclsITSPosL[isSecd]->Fill(nclsITSPos);
+       fHistNclsITSNegL[isSecd]->Fill(nclsITSNeg);
+       fHistNclsTPCPosL[isSecd]->Fill(nclsTPCPos);
+       fHistNclsTPCNegL[isSecd]->Fill(nclsTPCNeg);
+       fHistChi2PerNclsITSPosL[isSecd]->Fill(chi2PerClusterITSPos);
+       fHistChi2PerNclsITSNegL[isSecd]->Fill(chi2PerClusterITSNeg);
+
+       fHistNclsITSPos[0]->Fill(massLambda,nclsITSPos);
+       fHistNclsTPCPos[0]->Fill(massLambda,nclsTPCPos);
+       fHistChi2PerNclsITSPos[0]->Fill(massLambda,chi2PerClusterITSPos);
+       fHistNCRowsTPCPos[0]->Fill(massLambda,crossedRowsTPCPos);
+
+       fHistNclsITSPos[1]->Fill(massLambda,nclsITSNeg);
+       fHistNclsTPCPos[1]->Fill(massLambda,nclsTPCNeg);
+       fHistChi2PerNclsITSPos[1]->Fill(massLambda,chi2PerClusterITSNeg);
+       fHistNCRowsTPCPos[1]->Fill(massLambda,crossedRowsTPCNeg);
+              
+       fHistRatioFoundOverFinableTPCL[0]->Fill(massLambda,ratioFoFi);
+       fHistRatioFoundOverFinableTPCL[1]->Fill(massLambda,ratioFoFiPos);
+
+       fHistNclsITS[0]->Fill(nclsITSPos,nclsITSNeg);
+       fHistNclsTPC[0]->Fill(crossedRowsTPCNeg,nclsTPCNeg);
+      }
+    }
+  
+    if(ptALambda >fMinPt){//min pt cut
+      //-- Check for AntiLambda --//
+      if(cutOKALambda && fillALambdaMC){// cuts ok
+       fHistDedxAProt[isSecd]->Fill(tpcMomNeg,tpcsigNeg);
+       fHistDedxPiPlus[isSecd]->Fill(tpcMomPos,tpcsigPos);
+       fHistPiAPMonitorCuts[isSecd]->Fill(23);
+       if(piapdEdx){//PID
+         fHistPiAPMonitorCuts[isSecd]->Fill(24);
+         alambdaOK=kTRUE;
+         if( massALambda>1.05 && massALambda<1.25){// mass window
+           if(!fMCMode) {
+             ptV0MC = ptALambda;
+             declengthV0MC = dim2V0Radius;
+           }
+           fHistPiAPMonitorCuts[isSecd]->Fill(25);
+           fHistPiAPMass[isSecd]->Fill(massALambda);
+           fHistPiAPMassVSPtMCTruth[isSecd]->Fill(massALambda,ptV0MC);
+           fHistPiAPMassVSPt[isSecd]->Fill(massALambda,ptALambda);
+           fHistPiAPRadiusXY[isSecd]->Fill(massALambda,posDaughterPhi);
+           fHistPiAPCosPointAng[isSecd]->Fill(massALambda,cosOPAng);
+           fHistPiAPPtVSY[isSecd]->Fill(rapAL,ptALambda);
+           //  fHistPiAPPtDaughters[isSecd]->Fill(posDaughterPt,negDaughterPt);
+           fHistPiAPDCADaughters[isSecd]->Fill(massALambda,dcaDaughters);
+           fHistPiAPDCAVSMass[isSecd]->Fill(massALambda,dcaV0ToPrimVertex);
+           fHistPiAPDCADaughterPosToPrimVtxVSMass[isSecd]->Fill(massALambda,dcaPosToVertex);
+           if( massALambda>1.108 && massALambda<1.123 )  fHistPiAPDecayLengthVsPt[isSecd]->Fill(ptV0MC,dim2V0Radius);
+           if(fMCMode)  fHistPiAPDecayLengthResolution[isSecd]->Fill(declengthV0MC,dim2V0Radius);
+           fHistPiAPDecayLengthVsMass[isSecd]->Fill(massALambda,dim2V0Radius);
+           fHistPiAPDecayLengthVsCtau[isSecd]->Fill(massALambda,ctTAL);
+
+           //-- secondaries --//
+           if(isSecd == 1){
+             if(fabs(pdgMother) == 3112 || fabs(pdgMother) == 3114 || fabs(pdgMother) == 3222 || fabs(pdgMother) == 3224 || fabs(pdgMother) == 3214 ){
+               fHistPiAPMassVSPtSecSigma[1]->Fill(massLambda,ptLambda);
+               
+             }
+           }
+           if(pdgMother == -3322 || pdgMother == -3312){//Xi0 and xiplus
+             fHistPiAPCosPointAngXiVsPt->Fill(ptALambda,cosOPAng);
+             fHistPiAPMassVSPtSecXi[1]->Fill(massALambda,ptALambda);
+             fHistPiAPMassVSPtSecXiMCTruth->Fill(massALambda,ptV0MC);
+             fHistPiAPMassVSYSecXi[1]->Fill(massALambda,rapAL);
+             fHistPiAPXi0PtVSLambdaPt[1]->Fill(ptALambda,ptXiMother);
+           }
+           if(pdgMother == -3334){//Omega
+             fHistPiAPMassVSPtSecOmega[1]->Fill(massALambda,ptALambda);
+             fHistPiAPMassVSPtSecOmegaMCTruth->Fill(massALambda,ptV0MC);
+             fHistPiAPOmegaPtVSLambdaPt[1]->Fill(ptALambda,ptXiMother);
+           }  
+         }
+
+       }
+       if(ptALambda > 0.4) fHistArmenteros[isSecd]->Fill(alfa,qt);
+       fHistDedxSecAProt[isSecd]->Fill(tpcMomNeg,tpcsigNeg);
+       fHistDedxSecPiPlus[isSecd]->Fill(tpcMomPos,tpcsigPos);
+       fHistV0RadiusZ[isSecd]->Fill(dim2V0Radius,xr[2]);
+       fHistV0RadiusXY[isSecd]->Fill(xr[0],xr[1]);
+       fHistV0RadiusZVSPt[isSecd]->Fill(ptALambda,dim2V0Radius);
+       fHistV0RadiusXYVSY[isSecd]->Fill(rapAL,dim2V0Radius);
+      }
+    }
+
+       
+    //-- fill detector histos general --//
+    if(lambdaOK || alambdaOK || k0sOK){
+      fHistPiPiEtaDReco[1]->Fill(posDaughterEta,eta00);
+      fHistPiPEtaDReco[1]->Fill(negDaughterEta,eta01);
+    }
+      
+    /*
+    //-- AliKFParticle --//
+    if (negPiKF) delete negPiKF; negPiKF=NULL;
+    if (posPiKF) delete posPiKF; posPiKF=NULL;
+    if (posPKF) delete posPKF; posPKF=NULL;
+    if (negAPKF) delete negAPKF; negAPKF=NULL;
+    */
+       
+       
+  }//end V0 reco loop
+}
+  
+//________________________________________________________________________
+
+Int_t AliAnalysisTaskV0ForRAA::CalculateCentralityBin(){
+  //find centrality bin for centrality selection
+
+  if (fUseCentrality == 0) return -1;
+
+  AliCentrality *esdCentrality = fESD->GetCentrality();
+
+  Float_t centralityVZERO  = esdCentrality->GetCentralityPercentile("V0M");  
+  Float_t centralitySPD    = esdCentrality->GetCentralityPercentile("CL1");
+
+  Int_t centralityVZEROBin = -1;
+  Int_t centralitySPDBin   = -1;
+
+  //-- SPD centrality --//
+  if ( fUseCentrality == 2 ){
+    if      ( centralitySPD >=  0. && centralitySPD <   5.) centralitySPDBin =  0;
+    else if ( centralitySPD >=  5. && centralitySPD <  10.) centralitySPDBin =  5;
+    else if ( centralitySPD >= 10. && centralitySPD <  20.) centralitySPDBin = 10;
+    else if ( centralitySPD >= 20. && centralitySPD <  30.) centralitySPDBin = 20;
+    else if ( centralitySPD >= 30. && centralitySPD <  40.) centralitySPDBin = 30;
+    else if ( centralitySPD >= 40. && centralitySPD <  50.) centralitySPDBin = 40;
+    else if ( centralitySPD >= 50. && centralitySPD <  60.) centralitySPDBin = 50;
+    else if ( centralitySPD >= 60. && centralitySPD <  70.) centralitySPDBin = 60;
+    else if ( centralitySPD >= 70. && centralitySPD <  80.) centralitySPDBin = 70;
+    else if ( centralitySPD >= 80. && centralitySPD <  90.) centralitySPDBin = 80;
+    else if ( centralitySPD >= 90. && centralitySPD <  99.) centralitySPDBin = 90;
+    else if ( centralitySPD >= 99. ) centralitySPDBin = 100;
+    else if ( fabs(centralitySPD)< 0.0001 ) centralitySPDBin = 100;
+    return centralitySPDBin;
+  }
+  //-- V0 centrality --//
+  if ( fUseCentrality == 1 ){
+    if      ( centralityVZERO >  0. && centralityVZERO <   5.) centralityVZEROBin =  0;
+    else if ( centralityVZERO >=  5. && centralityVZERO <  10.) centralityVZEROBin =  5;
+    else if ( centralityVZERO >= 10. && centralityVZERO <  20.) centralityVZEROBin = 10;
+    else if ( centralityVZERO >= 20. && centralityVZERO <  30.) centralityVZEROBin = 20;
+    else if ( centralityVZERO >= 30. && centralityVZERO <  40.) centralityVZEROBin = 30;
+    else if ( centralityVZERO >= 40. && centralityVZERO <  50.) centralityVZEROBin = 40;
+    else if ( centralityVZERO >= 50. && centralityVZERO <  60.) centralityVZEROBin = 50;
+    else if ( centralityVZERO >= 60. && centralityVZERO <  70.) centralityVZEROBin = 60;
+    else if ( centralityVZERO >= 70. && centralityVZERO <  80.) centralityVZEROBin = 70;
+    else if ( centralityVZERO >= 80. && centralityVZERO <  90.) centralityVZEROBin = 80;
+    else if ( centralityVZERO >= 90. && centralityVZERO <  99.) centralityVZEROBin = 90;
+    else if ( centralityVZERO >= 99. ) centralityVZEROBin = 100;
+    else if ( fabs(centralityVZERO)< 0.0001 ) centralityVZEROBin = 100;
+    return centralityVZEROBin;
+  }
+  return -1;
+  
+}
+
+//__________________________________________________________________________________________________________
+Bool_t  AliAnalysisTaskV0ForRAA::GetMCTruthPartner(AliESDtrack *pos,AliESDtrack *neg,Int_t id0,Int_t id1){
+  //-- get daughter label and check it --//
+  Int_t labelP = fabs(pos->GetLabel());
+  Int_t labelN = fabs(neg->GetLabel());
+
+  if (labelN==labelP)  return kFALSE;
+      
+  if(fMCTruthMode){
+    if ((labelP!=id0) && (labelP!=id1))  return kFALSE;
+    if ((labelN!=id0) && (labelN!=id1))  return kFALSE;
+  }
+  
+  return kTRUE;
+}
+
index e727cfd..48407d7 100644 (file)
@@ -11,7 +11,9 @@
 
 class TH1F;
 class TH2F;
+
 class Tlist;
+
 class AliESDv0;
 class AliESDtrack;
 class AliESDtrackCuts;
@@ -42,6 +44,11 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   void SetMCMode(Bool_t mcmode)                               {fMCMode = mcmode; if(fMCMode) Printf("AliAnalysisTaskV0ForRAA::running mc mode: histos of MC reco");}
   void SetMCTruthMode(Bool_t mcmode)                          {fMCTruthMode = mcmode; if(fMCTruthMode) Printf("AliAnalysisTaskV0ForRAA::running mc mode: histos of MC truth");}
   void SelectInjected(Bool_t injected)                        {fSelectInjected = injected; if(fSelectInjected) Printf("AliAnalysisTaskV0ForRAA::only injected MC particles");}
+  void SelectMBMotherMC(Bool_t mbmother)                      {fSelectMBMotherMC = mbmother;if(mbmother)  Printf("AliAnalysisTaskV0ForRAA::only MB mother MC for sec lambdas selected");}
+  void SelectOnlyPosLabelMC(Bool_t poslabel)                  {fCheckNegLabelReco = poslabel;if(poslabel) Printf("AliAnalysisTaskV0ForRAA::Select only MC truth and reco with pos label reco");}
+
+  void SelectOnlyFoundRecoV0MC(Bool_t found)                  {fOnlyFoundRecoV0 = found;if(found) Printf("AliAnalysisTaskV0ForRAA::Select only MC truth with found reco V0");}
+
 
   //-- Centrality  --//
   // use centrality - if yes, which one
@@ -56,14 +63,23 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   void SetPrimVertexZCut(Double_t vtxcut,Bool_t status)       {fVertexZCut = vtxcut;fVtxStatus = status; Printf("AliAnalysisTaskV0ForRAA::SetPrimVertexZCut %3.2f",vtxcut);}
   void SetAnapp(Bool_t anapp)                                 {fAnapp = anapp ;if(fAnapp) Printf("AliAnalysisTaskV0ForRAA::analysing pp!!!");}
   void SelectWithSDD(Bool_t sdd)                              {fSelSDD =sdd; if(sdd) Printf("AliAnalysisTaskV0ForRAA:: only events with SDD selected!");}
+  void SelectWithNoSDD(Bool_t sdd)                              {fSelNoSDD =sdd; if(sdd) Printf("AliAnalysisTaskV0ForRAA:: only events with NO SDD selected!");}
 
   //-- track cuts --//
-  void SetESDTrackCuts(AliESDtrackCuts *esdcuts)              {fESDTrackCuts = esdcuts;Printf("AliAnalysisTaskV0ForRAA::AliESDtrackCuts for V0s set");}
-  void SetESDTrackCutsCharged(AliESDtrackCuts *esdcuts)       {fESDTrackCutsCharged = esdcuts;Printf("AliAnalysisTaskV0ForRAA::AliESDtrackCuts for charged particles set");}
+  void SetESDTrackCuts(AliESDtrackCuts *esdcuts =NULL)        {fESDTrackCuts = esdcuts;Printf("AliAnalysisTaskV0ForRAA::AliESDtrackCuts for V0s set");}
+  void SetESDTrackCutsCharged(AliESDtrackCuts *esdcuts=NULL)  {fESDTrackCutsCharged = esdcuts;Printf("AliAnalysisTaskV0ForRAA::AliESDtrackCuts for charged particles set");}
+  void SetESDTrackCutsLowPt(AliESDtrackCuts *esdcuts=NULL)    {fESDTrackCutsLowPt = esdcuts;Printf("AliAnalysisTaskV0ForRAA::AliESDtrackCuts for low pt particles set");}
   void SetUseOnthefly(Bool_t useonthefly)                     {fOntheFly = useonthefly; if(!fOntheFly) Printf("AliAnalysisTaskV0ForRAA::offline V0s");}
   void SetUsePID(Bool_t usepid,Double_t nsigma=100.0,Double_t pcut=100.0) {fUsePID = usepid;fNSigma = nsigma;fPPIDcut = pcut; if(fUsePID) Printf("AliAnalysisTaskV0ForRAA::PID! of %4.2f for p: %4.2f",fNSigma,pcut);}
-  void SetCutMoreNclsThanRows(Bool_t cut)                     {fMoreNclsThanRows=cut; if(cut) Printf("AliAnalysisTaskV0ForRAA::cut on more ncls than crossed rows");}
+  void SetCutMoreNclsThanRows(Bool_t cut)                     {fMoreNclsThanRows=cut; if(cut) Printf("AliAnalysisTaskV0ForRAA::cut on more ncls than crossed rows");}  
   void SetCutMoreNclsThanFindable(Bool_t cut)                 {fMoreNclsThanFindable=cut; if(cut) Printf("AliAnalysisTaskV0ForRAA::cut on more ncls than ncls findable");}
+  void SetCutMoreNclsThanFindableMax(Bool_t cut)              {fMoreNclsThanFindableMax = cut; if(cut) Printf("AliAnalysisTaskV0ForRAA::cut on more ncls than ncls findable max");}
+
+  void SetRatioFoundOverFindable(Double_t cut)                 {fRatioFoundOverFindable = cut; Printf("AliAnalysisTaskV0ForRAA::cut on found over finable clusters %f",cut);}
+  void SetRatioMaxCRowsOverFindable(Double_t cut)              {fRatioMaxCRowsOverFindable = cut;  Printf("AliAnalysisTaskV0ForRAA::cut on max crossed rows over finable clusters %f",cut);}
+
+  void SetLowPtTPCCutAliESDTrackCut(Double_t pt)              {fPtTPCCut=pt;Printf("AliAnalysisTaskV0ForRAA::SetLowPtTPCCutAliESDTrackCut pt=%2.2f",pt);} 
+   
   void SetMaxChi2PerITSCluster(Double_t chi2)                 {fChi2PerClusterITS = chi2; Printf("AliAnalysisTaskV0ForRAA::max chi2 per ITS cluster %3.2f",chi2);}
   void SetRapidityCutMother(Bool_t cut,Double_t val=5.0)      {fRapCutV0 = cut; fRap = val; if(cut) Printf("AliAnalysisTaskV0ForRAA::cut on mother rapidity %2.2f",val);}
   void SetMinPt(Double_t minPt=0.0)                           {fMinPt = minPt; if(minPt>0.0) Printf("AliAnalysisTaskV0ForRAA::cut on min pt %2.2f",minPt);}
@@ -94,18 +110,21 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   void SetChi2CutKf(Bool_t chi2){ fChiCutKf = chi2; Printf("AliAnalysisTaskV0ForRAA::SetChi2CutKf %i",chi2);}
   //Double_t chi2)                            {fChiCutKf = chi2; Printf("AliAnalysisTaskV0ForRAA::SetChi2CutKf %3.2f",chi2);}
   void SetArmenterosCutAlpha(Double_t alfaMin)                {fAlfaCut=alfaMin;Printf("AliAnalysisTaskV0ForRAA::SetArmenterosCut a=%1.3f",alfaMin);}
-  void SetArmenterosCutQt(Double_t ptmin,Double_t ptmax,Bool_t k0s,Bool_t la){fQtCut = ptmax;fQtCutPtLow=ptmin, fArmCutK0=k0s;fArmCutL=la;Printf("AliAnalysisTaskV0ForRAA::SetArmenterosCut ptmin = %3.2f ptmax = %3.2f. Is K0s? %i La? %i",ptmin,ptmax,k0s,la);}
+  void SetArmenterosCutQt(Double_t ptmin,Double_t ptmax,Bool_t k0s,Bool_t la,Double_t slope=0.2){fQtCut = ptmax;fQtCutPtLow=ptmin, fArmQtSlope=slope,fArmCutK0=k0s;fArmCutL=la;Printf("AliAnalysisTaskV0ForRAA::SetArmenterosCut ptmin = %3.2f ptmax = %3.2f. slope: %1.2f.  Is K0s? %i La? %i",ptmin,ptmax,slope,k0s,la);}
+  void SetMinMassDiffLK0s(Double_t diffK,Double_t diffL)                {fExcludeLambdaFromK0s = diffK;fExcludeK0sFromLambda = diffL; Printf("AliAnalysisTaskV0ForRAA::SetMaxMassDifferenceL for K0s %1.3f  K0s for L %1.3f",diffK,diffL);}
+
   void SetCtauCut(Double_t ctK0s, Double_t ctL,Double_t ptK0=100.0,Double_t ptL=100.0) {fCtauK0s = ctK0s*2.6842; fCtauL = ctL*7.89;fCtauPtCutK0=ptK0; fCtauPtCutL=ptL;
     Printf("AliAnalysisTaskV0ForRAA::SetCtauCut ctK=%2.2f, ctL = %2.2f for ptK= %5.2f ptL=%5.2f",ctK0s,ctL,ptK0,ptL);}
   void SetDoEtaOfMCDaughtersCut(Bool_t doCut,Double_t eta=5.0){fEtaCutMCDaughters =doCut; fEtaCutMCDaughtersVal=eta; Printf("AliAnalysisTaskV0ForRAA::eta cut on V0 (MC truth ? %i) daughters %1.3f !",doCut,eta);}
+  //  void SetEtaSignCut(Double_t etasign)                        {fEtaSignCut = etasign;Printf("AliAnalysisTaskV0ForRAA::eta cut sign on  daughters %2.2f !",etasign);}
+
   
-   
  private:
    
   //----------------------------functions --------------------------------------------//
 
   void   Process();                                                                                                   // process event
-  void   V0RecoLoop(Int_t id0,Int_t id1,Int_t isSecd,Int_t what,Double_t ptV0MC,Int_t pdgMother,Double_t ptXiMother); // loop over reconstructed V0 (data or MC)
+  void   V0RecoLoop(Int_t id0,Int_t id1,Int_t isSecd,Int_t what,Double_t ptV0MC,Int_t pdgMother,Double_t ptXiMother,Double_t decaylengthMCV0); // loop over reconstructed V0 (data or MC)
   void   V0MCTruthLoop();                                                                                             // loop over MC truth V0s
   Int_t  CalculateCentralityBin();                                                                                    // get the centrality bin from multiplicity
   Bool_t GetMCTruthPartner(AliESDtrack *pos,AliESDtrack *neg,Int_t id0,Int_t id1);                                    // find MC truth partner for reconstructed track
@@ -115,116 +134,144 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   //----------------------------- objects ----------------------------------------------//
 
   //event
-  AliESDEvent     *fESD;                //ESD event object
-  AliMCEvent      *fMCev;               //MC event object
-   
+  AliESDEvent     *fESD;                 // ESD event object
+  AliMCEvent      *fMCev;                // MC event object
+
+  
   //PID and track cuts
-  AliPIDResponse  *fESDpid;             // pid object
-  AliESDtrackCuts *fESDTrackCuts;       //esd track cuts for daughters
-  AliESDtrackCuts *fESDTrackCutsCharged;//esd track cuts for all charged particles
+  AliPIDResponse  *fESDpid;              // pid object
+  AliESDtrackCuts *fESDTrackCuts;        // esd track cuts for daughters
+  AliESDtrackCuts *fESDTrackCutsCharged; // esd track cuts for all charged particles
+  AliESDtrackCuts *fESDTrackCutsLowPt;   // esd track cuts for daughters at low pt
 
-  TList           *fOutputContainer;    // output data container
+  TList           *fOutputContainer;     // output data container
    
+
+
   //----------------------------histograms --------------------------------------------//
-  //-------------------event histos -------------------//
-  
-  TH1F   *fHistNEvents;                             // count number of events for each event cut
-  TH1F   *fHistMuliplicity;                         // number of particles from centrality selection
-  TH1F   *fHistMuliplicityRaw;                      // number of particles from centrality selection before processing
-  TH1F   *fHistMultiplicityPrimary;                 // number of charged particles
-  TH1F   *fHistESDVertexZ;                          // primary TPC vertex position z before cuts
-  TH1F   *fHistPrimVtxZESD;                         // primary ESD vertex position z after cuts and processing
-  TH2F   *fHistPrimVtxZESDVSNContributors;          // count contributors to ESD vertex
-  TH1F   *fHistNPrim;                               // number of contributors to the prim vertex
-  
+
+  //---------------------------event histos --------------------------//
   TH1F   *fHistITSLayerHits;                        // pp 2.76 TeV analysis: check hist on div. ITS layer
   TH1F   *fHistOneHitWithSDD;                       // pp 2.76 TeV analysis: check hist on at least one ITS layer
-  TH1F   *fHistPrimVtxZESDTPC;                      // primary TPC vertex position z after cuts and processing
-  TH1F   *fHistPrimVtxZESDSPD;                      // primary SPD vertex position z after cuts and processing
+  TH1F   *fHistNEvents;                             // count number of events for each event cut
+  TH2F   *fHistPrimVtxZESDVSNContributors;          // count contributors to ESD vertex
   TH2F   *fHistPrimVtxZESDTPCVSNContributors;       // count contributors to TPC vertex
   TH2F   *fHistPrimVtxZESDSPDVSNContributors;       // count contributors to SPD vertex
-  TH1F   *fHistCentBinRaw;                          // events per centralitybin before centrality selection
-  TH1F   *fHistCentBin;                             // events per centralitybin
+
   TH2F   *fHistPrimVtxZESDVSNContributorsMC;        // count contributors to ESD vertex MC
   TH2F   *fHistPrimVtxZESDTPCVSNContributorsMC;     // count contributors to TPC vertex MC
   TH2F   *fHistPrimVtxZESDSPDVSNContributorsMC;     // count contributors to SPD vertex MC
-  TH1F   *fHistMCVertexZ;                           // primary MC vertex position z 
 
-  //------------------------ single V0 histos --------------------------//
-  TH1F   *fHistPiPiPDGCode;                         // PDG code of K0 mothers
-  TH1F   *fHistPiPPDGCode;                          // PDG code of Lambda mothers
-  TH1F   *fHistPiAPPDGCode;                         // PDG code of Lambda mothers
+  TH1F   *fHistPrimVtxZESD;                         // primary ESD vertex position z after cuts and processing
+  TH1F   *fHistPrimVtxZESDTPC;                      // primary TPC vertex position z after cuts and processing
+  TH1F   *fHistPrimVtxZESDSPD;                      // primary SPD vertex position z after cuts and processing
 
-  TH2F   *fHistPiPCosPointAngXiVsPt;                // cosine of pointing angle of xis vs pt
-  TH2F   *fHistPiAPCosPointAngXiVsPt;               // cosine of pointing angle of xis vs pt
+  TH1F   *fHistESDVertexZ;                          // primary TPC vertex position z before cuts
+  TH1F   *fHistMCVertexZ;                           // primary MC vertex position z 
+   
+  TH1F   *fHistMuliplicity;                         // number of particles from centrality selection
+  TH1F   *fHistMuliplicityRaw;                      // number of particles from centrality selection before processing
+  TH1F   *fHistCentBinRaw;                          // events per centralitybin before centrality selection
+  TH1F   *fHistCentBin;                             // events per centralitybin
+  TH1F   *fHistMultiplicityPrimary;                 // number of charged particles
+   
+  TH1F   *fHistNPrim;                               // number of contributors to the prim vertex
 
-  //--------------------- V0 histos ------------------------------------//
-  TH2F   *fHistV0RadiusZ[2];                        // V0 decay radius z
-  TH2F   *fHistV0RadiusZVSPt[2];                    // V0 decay radius z vs pt
-  TH2F   *fHistV0RadiusXY[2];                       // V0 decay radius x vs y
-  TH2F   *fHistV0RadiusXYVSY[2];                    // V0 decay radius xy vs rapidity
+
+  //------------------------ single V0 histos MC case--------------------------//
+  //K0s
+  TH1F   *fHistPiPiPDGCode;                         // PDG code of K0 mothers
+  //Lambda
+  TH1F   *fHistPiPPDGCode;                          // PDG code of Lambda mothers 
+  TH2F   *fHistPiPCosPointAngXiVsPt;                // p+pi- cosine of pointing angle of xis vs pt
+  TH2F   *fHistPiPMassVSPtSecXiMCTruth;             // p+pi- InvMass spectrum vs Xi (-,0) pt MC truth
+  TH2F   *fHistPiPMassVSPtSecOmegaMCTruth;          // p+pi- InvMass spectrum vs Omega (-)  pt MC truth
+  
+  //AntiLambda
+  TH1F   *fHistPiAPPDGCode;                         // PDG code of AntiLambda mothers
+  TH2F   *fHistPiAPCosPointAngXiVsPt;               // p-pi+ cosine of pointing angle of xis vs pt
+  TH2F   *fHistPiAPMassVSPtSecXiMCTruth;            // p-pi+ InvMass spectrum vs Xi (+,anti 0) pt MC truth
+  TH2F   *fHistPiAPMassVSPtSecOmegaMCTruth;         // p-pi+ InvMass spectrum vs Omega (+)  pt MC truth
+
+
+  //----------------------------- V0 histos --------------------------------------//
+  TH2F   *fHistV0RadiusZ[2];                        // V0 decay radius z filled for K0s and Lambda candidates
+  TH2F   *fHistV0RadiusZVSPt[2];                    // V0 decay radius z vs pt filled for K0s and Lambda candidates
+  TH2F   *fHistV0RadiusXY[2];                       // V0 decay radius x vs y filled for K0s and Lambda candidates
+  TH2F   *fHistV0RadiusXYVSY[2];                    // V0 decay radius xy vs rapidity filled for K0s and Lambda candidates
    
-  TH2F   *fHistArmenteros[2];                       // armenteros
+  TH2F   *fHistArmenteros[2];                       // armenteros podolanski filled for K0s and Lambda candidates
      
   //-- K0 --//
-  TH1F   *fHistPiPiMass[2];                         // pi+pi- InvMass spectrum
-  TH2F   *fHistPiPiMassVSPt[2];                     // pi+pi- InvMass spectrum vs pt
-  TH2F   *fHistPiPiMassVSPtMCTruth[2];              // pi+pi- InvMass spectrum vs pt MC truth
-  TH2F   *fHistPiPiPtVSY[2];                        // pi+pi- InvMass spectrum vs rapidity
-  TH2F   *fHistPiPiDecayLengthVsPt[2];              // pi+pi- decay lenght vs pt  
-  // TH2F   *fHistPiPiMassVSAlpha[2];                  // pi+pi- InvMass spectrum vs armenteros alpha
-  TH2F   *fHistPiPiRadiusXY[2];                     // pi+pi- opening angle vs mass
-  TH2F   *fHistPiPiCosPointAng[2];                  // pi+pi- cosine of pointing angle vs pt or dca to vertex
-  TH2F   *fHistPiPiDCADaughterPosToPrimVtxVSMass[2];// dca of pos. K0s daughter to prim vtx vs mass
-  TH2F   *fHistPiPiDecayLengthVsMass[2];            // pi+pi- decay lenght vs pt
-  //TH2F   *fHistPiPiMassVSPtK0L[2];                  // K0L InvMass vs pt distribution
-  TH2F   *fHistPiPiDCADaughters[2];                 // pi+pi- dca between daughters
-  //   TH2F   *fHistPiPiPtDaughters[2];                  // pi+pi- daughters pt pos vs pt neg 
-  TH2F   *fHistPiPiDCAVSMass[2];                    // pi+pi- dca to prim vtx vs mass
-  TH1F   *fHistPiPiMonitorCuts[2];                  // pi+pi- cut monitor
-
-  //-- lambda --//
-  TH1F   *fHistPiPMass[2];                         // p+pi- InvMass spectrum
-  TH2F   *fHistPiPMassVSPt[2];                     // p+pi- InvMass spectrum vs pt
-  TH2F   *fHistPiPMassVSPtMCTruth[2];              // p+pi- InvMass spectrum vs pt MC truth
-  TH2F   *fHistPiPPtVSY[2];                        // p+pi- InvMass spectrum vs rapidity
-  TH2F   *fHistPiPDecayLengthVsPt[2];              // p+pi- decay lenght vs pt   
-  TH2F   *fHistPiPRadiusXY[2];                     // p+pi- opening angle vs mass
-  TH2F   *fHistPiPCosPointAng[2];                  // p+pi- cosine of pointing angle vs pt  or dca to vertex
-  TH2F   *fHistPiPDCADaughterPosToPrimVtxVSMass[2];// dca of pos. Lambda daughter to prim vtx vs mass
-
-  TH2F   *fHistPiPDecayLengthVsMass[2];            // p+pi- decay lenght vs pt
-  TH2F   *fHistPiPDCADaughters[2];                 // p+pi- dca between daughters
-  //TH2F   *fHistPiPPtDaughters[2];                  // p+pi- daughters pt pos vs pt neg 
-  TH2F   *fHistPiPDCAVSMass[2];                    // p+pi- dca to prim vtx vs mass
-  TH1F   *fHistPiPMonitorCuts[2];                  // p+pi- cut monitor
-  TH2F   *fHistPiPMassVSPtSecSigma[2];             // InvMass distribution vs pt of secondary lambdas from sigma truth(0) reco(1)
-  TH2F   *fHistPiPMassVSPtSecXi[2];                // InvMass distribution vs pt of secondary lambdas from xi MC truth(0) reco(1)
-  TH2F   *fHistPiPMassVSYSecXi[2];                 // InvMass distribution vs rapidity of secondary lambdas from xi MC truth(0) reco(1)
-  TH2F   *fHistPiPXi0PtVSLambdaPt[2] ;             // pt of xi0 vs pt lambda truth(0) reco(1)
-  TH2F   *fHistPiPXiMinusPtVSLambdaPt[2];          // pt of ximinus vs pt lambda truth(0) reco(1)
-   
-  //-- antilambda --//
+  TH1F   *fHistPiPiMass[1];                         // pi+pi- InvMass spectrum
+  TH2F   *fHistPiPiPtVSY[1];                        // pi+pi- InvMass spectrum vs rapidity
+  TH2F   *fHistPiPiMassVSPt[1];                     // pi+pi- InvMass spectrum vs pt
+  TH2F   *fHistPiPiMassVSPtMCTruth[1];              // pi+pi- InvMass spectrum vs pt MC truth
+  // TH2F   *fHistPiPiMassVSAlpha[1];               // pi+pi- InvMass spectrum vs armenteros alpha
+  TH2F   *fHistPiPiRadiusXY[1];                     // pi+pi- opening angle vs mass
+  TH2F   *fHistPiPiCosPointAng[1];                  // pi+pi- cosine of pointing angle vs pt or dca to vertex
+  TH2F   *fHistPiPiDCADaughterPosToPrimVtxVSMass[1];// dca of pos. K0s daughter to prim vtx vs mass
+  TH2F   *fHistPiPiDecayLengthVsPt[1];              // pi+pi- decay lenght vs pt
+  TH2F   *fHistPiPiDecayLengthVsMass[1];            // pi+pi- decay lenght vs pt
+  TH2F   *fHistPiPiDecayLengthVsCtau[1];            // pi+pi- decay lenght vs pt
+  TH2F   *fHistPiPiDCADaughters[1];                 // pi+pi- dca between daughters
+  //  TH2F   *fHistPiPiPtDaughters[1];              // pi+pi- daughters pt pos vs pt neg 
+  TH2F   *fHistPiPiDCAVSMass[1];                    // pi+pi- dca to prim vtx vs mass
+  TH1F   *fHistPiPiMonitorCuts[1];                  // pi+pi- cut monitor
+  TH1F   *fHistPiPiMonitorMCCuts[1];                // pi+pi- cut monitor mc
+  TH2F   *fHistPiPiDecayLengthResolution[1];        // decay length mc reco vs mc truth K0s
+
+  //-- Lambda --//
+  TH1F   *fHistPiPMass[2];                          // p+pi- InvMass spectrum
+  TH2F   *fHistPiPPtVSY[2];                         // p+pi- InvMass spectrum vs rapidity
+  TH2F   *fHistPiPMassVSPt[2];                      // p+pi- InvMass spectrum vs pt
+  TH2F   *fHistPiPMassVSPtMCTruth[2];               // p+pi- InvMass spectrum vs pt MC truth
+  TH2F   *fHistPiPRadiusXY[2];                      // p+pi- opening angle vs mass
+  TH2F   *fHistPiPCosPointAng[2];                   // p+pi- cosine of pointing angle vs pt  or dca to vertex
+  TH2F   *fHistPiPDCADaughterPosToPrimVtxVSMass[2]; // dca of pos. Lambda daughter to prim vtx vs mass
+  TH2F   *fHistPiPDecayLengthVsPt[2];               // p+pi- decay lenght vs pt
+  TH2F   *fHistPiPDecayLengthVsMass[2];             // p+pi- decay lenght vs pt
+  TH2F   *fHistPiPDecayLengthVsCtau[2];             // p+pi- decay lenght vs pt
+  TH2F   *fHistPiPDCADaughters[2];                  // p+pi- dca between daughters
+  //  TH2F   *fHistPiPPtDaughters[2];               // p+pi- daughters pt pos vs pt neg 
+  TH2F   *fHistPiPDCAVSMass[2];                     // p+pi- dca to prim vtx vs mass
+  TH1F   *fHistPiPMonitorCuts[2];                   // p+pi- cut monitor
+  TH1F   *fHistPiPMonitorMCCuts[2];                 // p+pi- cut monitor mc
+  TH2F   *fHistPiPMassVSPtSecSigma[2];              // InvMass distribution vs pt of secondary lambdas from sigma truth(0) reco(1)
+  TH2F   *fHistPiPMassVSPtSecXi[2];                 // InvMass distribution vs pt of secondary lambdas from xi MC truth(0) reco(1)
+  TH2F   *fHistPiPMassVSPtSecOmega[2];              // InvMass distribution vs pt of secondary lambdas from omega MC truth(0) reco(1)
+  TH2F   *fHistPiPMassVSYSecXi[2];                  // InvMass distribution vs rapidity of secondary lambdas from xi MC truth(0) reco(1)
+  TH2F   *fHistPiPXi0PtVSLambdaPt[2] ;              // pt of xi0 vs pt lambda truth(0) reco(1)
+  TH2F   *fHistPiPXiMinusPtVSLambdaPt[2];           // pt of ximinus vs pt lambda truth(0) reco(1)
+  TH2F   *fHistPiPOmegaPtVSLambdaPt[2];             // pt of omega plus vs pt alambda truth(0) reco(1)
+  TH2F   *fHistPiPDecayLengthResolution[2];         // decay length mc reco vs mc truth lambda
+
+  //-- AntiLambda --//
   TH1F   *fHistPiAPMass[2];                         // pi+p- InvMass spectrum
+  TH2F   *fHistPiAPPtVSY[2];                        // pi+p- InvMass spectrum vs rapidity
   TH2F   *fHistPiAPMassVSPt[2];                     // pi+p- InvMass spectrum vs pt
   TH2F   *fHistPiAPMassVSPtMCTruth[2];              // pi+p- InvMass spectrum vs pt MC Truth
-  TH2F   *fHistPiAPPtVSY[2];                        // pi+p- InvMass spectrum vs rapidity
-  TH2F   *fHistPiAPDecayLengthVsPt[2];              // pi+p- decay lenght vs pt
   TH2F   *fHistPiAPRadiusXY[2];                     // pi+p- opening angle vs mass
   TH2F   *fHistPiAPCosPointAng[2];                  // pi+p- cosine of pointing angle vs pt  or dca to vertex
   TH2F   *fHistPiAPDCADaughterPosToPrimVtxVSMass[2];// dca of pos. Lambda daughter to prim vtx vs mass
+  TH2F   *fHistPiAPDecayLengthVsPt[2];              // pi+p- decay lenght vs pt
   TH2F   *fHistPiAPDecayLengthVsMass[2];            // pi+p- decay lenght vs pt
+  TH2F   *fHistPiAPDecayLengthVsCtau[2];            // pi+p- decay lenght vs pt
   TH2F   *fHistPiAPDCADaughters[2];                 // pi+p- dca between daughters
-  //TH2F   *fHistPiAPPtDaughters[2];                  // pi+p- daughters pt pos vs pt neg 
+  //  TH2F   *fHistPiAPPtDaughters[2];              // pi+p- daughters pt pos vs pt neg 
   TH2F   *fHistPiAPDCAVSMass[2];                    // pi+p- dca to prim vtx vs mass
   TH1F   *fHistPiAPMonitorCuts[2];                  // pi+p- cut monitor
+  TH1F   *fHistPiAPMonitorMCCuts[2];                // pi+p- cut monitor mc
   TH2F   *fHistPiAPMassVSPtSecSigma[2];             // InvMass distribution vs pt of secondary alambdas from sigma truth(0) reco(1)
   TH2F   *fHistPiAPMassVSPtSecXi[2];                // InvMass distribution vs pt of secondary alambdas from xi MC truth(0) reco(1)
+  TH2F   *fHistPiAPMassVSPtSecOmega[2];             // InvMass distribution vs pt of secondary alambdas from omega MC truth(0) reco(1)
   TH2F   *fHistPiAPMassVSYSecXi[2];                 // InvMass distribution vs rapidity of secondary alambdas from xi MC truth(0) reco(1)
   TH2F   *fHistPiAPXi0PtVSLambdaPt[2] ;             // pt of xi0 vs pt alambda truth(0) reco(1)
   TH2F   *fHistPiAPXiMinusPtVSLambdaPt[2];          // pt of ximinus vs pt alambda truth(0) reco(1)
-   
+  TH2F   *fHistPiAPOmegaPtVSLambdaPt[2];            // pt of omega plus vs pt alambda truth(0) reco(1)
+  TH2F   *fHistPiAPDecayLengthResolution[2];        // decay length mc reco vs mc truth antilambda
+
   //-- others --//
   //dEdx
   TH2F   *fHistDedxSecProt[2];                      // dedx from proton cadidates vs pt
@@ -232,19 +279,27 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   TH2F   *fHistDedxSecPiMinus[2];                   // dedx from pi minus candidates vs pt
   TH2F   *fHistDedxSecPiPlus[2];                    // dedx from pi plus candidates vs pt
 
-  //clusters
-  TH1F   *fHistNclsITSPosK0[2];                     // number of clusters from ITS of positive K0s daughters
-  TH1F   *fHistNclsITSNegK0[2];                     // number of clusters from ITS of negative K0s daughters
-  TH1F   *fHistNclsTPCPosK0[2];                     // number of clusters from TPC of positive K0s daughters
-  TH1F   *fHistNclsTPCNegK0[2];                     // number of clusters from TPC of negative K0s daughters
-  TH1F   *fHistChi2PerNclsITSPosK0[2];              // chi^2 per number of clusters ITS of positive K0s daughters
-  TH1F   *fHistChi2PerNclsITSNegK0[2];              // chi^2 per number of clusters ITS of negative K0s daughters
+  TH2F   *fHistDedxProt[2];                         // dedx from proton cadidates vs pt before pidcut
+  TH2F   *fHistDedxAProt[2];                        // dedx from antiproton candidates vs pt before pidcut
+  TH2F   *fHistDedxPiMinus[2];                      // dedx from pi minus candidates vs pt before pidcut
+  TH2F   *fHistDedxPiPlus[2];                       // dedx from pi plus candidates vs pt before pidcut
+   
+  //----------clusters and TPC var.------------//
+  //K0s
+  TH1F   *fHistNclsITSPosK0[1];                     // number of clusters from ITS of positive K0s daughters
+  TH1F   *fHistNclsITSNegK0[1];                     // number of clusters from ITS of negative K0s daughters
+  TH1F   *fHistNclsTPCPosK0[1];                     // number of clusters from TPC of positive K0s daughters
+  TH1F   *fHistNclsTPCNegK0[1];                     // number of clusters from TPC of negative K0s daughters
+  TH1F   *fHistChi2PerNclsITSPosK0[1];              // chi^2 per number of clusters ITS of positive K0s daughters
+  TH1F   *fHistChi2PerNclsITSNegK0[1];              // chi^2 per number of clusters ITS of negative K0s daughters
+  //Lambda
   TH1F   *fHistNclsITSPosL[2];                      // number of clusters from ITS of positive lambda daughters
   TH1F   *fHistNclsITSNegL[2];                      // number of clusters from ITS of negative lambda daughters
   TH1F   *fHistNclsTPCPosL[2];                      // number of clusters from TPC of positive lambda daughters
   TH1F   *fHistNclsTPCNegL[2];                      // number of clusters from TPC of negative lambda daughters
   TH1F   *fHistChi2PerNclsITSPosL[2];               // chi^2 per number of clusters ITS of positive lambda daughters
   TH1F   *fHistChi2PerNclsITSNegL[2];               // chi^2 per number of clusters ITS of negative lambda daughters
+  //general
   TH2F   *fHistNclsITSPos[2];                       // number of clusters from ITS of positive daughters vs pt dautghter
   TH2F   *fHistNclsITSNeg[2];                       // number of clusters from ITS of negative daughters vs pt dautghter
   TH2F   *fHistNclsTPCPos[2];                       // number of clusters from TPC of positive daughters vs number of finabale clutsters
@@ -255,7 +310,9 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   TH2F   *fHistNclsTPC[2];                          // number of clusters TPC  neg daughters vs number of crossed rows
   TH2F   *fHistNCRowsTPCPos[2];                     // number of crossed rows TPC pos. vs pt of daughter
   TH2F   *fHistNCRowsTPCNeg[2];                     // number of crossed rows TPC neg. vs pt of daughter
-
+  TH2F   *fHistRatioFoundOverFinableTPCK0[2];       // ratio of ncls findable over found TPC K0s daughters
+  TH2F   *fHistRatioFoundOverFinableTPCL[2];        // ratio of ncls findable over found TPC L daughters
+  //eta all 
   TH2F   *fHistPiPiEtaDMC[2];                       // eta of daughters vs pt K0s MC truth raw(0) after cuts(1)
   TH2F   *fHistPiPEtaDMC[2];                        // eta of daughters vs pt lambda MC truth raw(0) after cuts(1)
   TH2F   *fHistPiPiEtaDReco[2];                     // eta of daughters ESD track vs eta AliESDv0 or vs pt K0s raw(0) after cuts(1)
@@ -272,88 +329,99 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
 
   //--cut options --//
   //MC only
-  Bool_t    fMCMode;                // run over MC general yes/no
-  Bool_t    fMCTruthMode;           // MC truth selection yes/no
-  Bool_t    fSelectInjected;        // for MC with injected signals, select only injected
+  Bool_t    fMCMode;                   // run over MC general yes/no
+  Bool_t    fMCTruthMode;              // MC truth selection yes/no
+  Bool_t    fSelectInjected;           // for MC with injected signals, select only injected
+  Bool_t    fSelectMBMotherMC;         // for MC with injected signals, select only MB MC mother for sec. Lambdas
+  Bool_t    fCheckNegLabelReco;        // reject MC truth and reco for neg labels in reco
+  Bool_t    fOnlyFoundRecoV0;          // reject MC truth if reco V0 not found
 
   // Calculate centrality
-  Int_t     fUseCentrality;         // use centrality (0=off(default),1=VZERO,2=SPD)
-  Int_t     fUseCentralityBin;      // centrality bin to be used 
-  Int_t     fUseCentralityRange;    // use centrality (0=off(default),1=VZERO,2=SPD) 
+  Int_t     fUseCentrality;            // use centrality (0=off(default),1=VZERO,2=SPD)
+  Int_t     fUseCentralityBin;         // centrality bin to be used 
+  Int_t     fUseCentralityRange;       // use centrality (0=off(default),1=VZERO,2=SPD) 
 
   //pp analysis
-  Bool_t    fAnapp;                 // flag for pp analysis
-  Bool_t    fSelSDD;                // select pp events with SDD (for pp 2.76TeV LHC11a)
+  Bool_t    fAnapp;                    // flag for pp analysis
+  Bool_t    fSelSDD;                   // select pp events with SDD (for pp 2.76TeV LHC11a)
+  Bool_t    fSelNoSDD;                 // select pp events with no SDD (for pp 2.76TeV LHC11a)
 
   //onthefly
-  Bool_t    fOntheFly;              // true if onfly finder shall be used
+  Bool_t    fOntheFly;                 // true if onfly finder shall be used
 
   //vertex
-  Double_t  fVertexZCut;            // z vertex cut value
-  Bool_t    fVtxStatus;             // vertex cut on/off
+  Double_t  fVertexZCut;               // z vertex cut value
+  Bool_t    fVtxStatus;                // vertex cut on/off
 
   //PID
-  Bool_t    fUsePID;                // use pid yes/no
-  Double_t  fNSigma;                // set nsigma value
-  Double_t  fPPIDcut;               // set max momentum for pid cut usage 
-  Bool_t    fMoreNclsThanRows;      // cut on ncls>ncrossed rows yes/no
-  Bool_t    fMoreNclsThanFindable;  // cut on ncls>nfindable cls yes/no
-  Double_t  fChi2PerClusterITS;      // cut on chi2 per ITS cluster
+  Bool_t    fUsePID;                   // use pid yes/no
+  Double_t  fNSigma;                   // set nsigma value
+  Double_t  fPPIDcut;                  // set max momentum for pid cut usage 
+  Double_t  fPtTPCCut;                 // low pt limit cut for TPC cluster cuts from AliESDtrackCuts
+  Bool_t    fMoreNclsThanRows;         // cut on ncls>ncrossed rows yes/no
+  Bool_t    fMoreNclsThanFindable;     // cut on ncls>nfindable cls yes/no
+  Bool_t    fMoreNclsThanFindableMax;  // cut on ncls>nfindable max cls yes/no
+  Double_t  fRatioFoundOverFindable;   // cut on found over findable clusters TPC
+  Double_t  fRatioMaxCRowsOverFindable;// cut on crossed rows over finable max
+  Double_t  fChi2PerClusterITS;        // cut on chi2 per ITS cluster
    
   //rapidity
-  Bool_t    fRapCutV0;              // use rapidity cut for V0 yes/no
-  Double_t  fRap;                   // user defined value for rapidity cut
+  Bool_t    fRapCutV0;                 // use rapidity cut for V0 yes/no
+  Double_t  fRap;                      // user defined value for rapidity cut
 
   //eta and pt
-  Double_t  fEtaCutMCDaughters;     // eta cut for MC daughters on/off
-  Double_t  fEtaCutMCDaughtersVal;  // eta cut value for MC daughters
-  Double_t  fMinPt;                 // pt min cut value 
+  Double_t  fEtaCutMCDaughters;        // eta cut for MC daughters on/off
+  Double_t  fEtaCutMCDaughtersVal;     // eta cut value for MC daughters
+  // Double_t  fEtaSignCut;            // eta cutsign daughters
+  Double_t  fMinPt;                    // pt min cut value 
 
   //armenteros
-  Double_t  fAlfaCut;               // set alpha armenteros cut value
-  Double_t  fQtCut;                 // set ptmax for qt armenteros cut 
-  Double_t  fQtCutPtLow;             // set ptmin for  qt armenteros cut
-  Bool_t    fArmCutK0;              // set armenteros cut on/off for K0s
-  Bool_t    fArmCutL;               // set armenteros cut on/off for Lambda
-
+  Double_t  fAlfaCut;                  // set alpha armenteros cut value
+  Double_t  fQtCut;                    // set ptmax for qt armenteros cut 
+  Double_t  fQtCutPtLow;               // set ptmin for  qt armenteros cut
+  Bool_t    fArmCutK0;                 // set armenteros cut on/off for K0s
+  Bool_t    fArmCutL;                  // set armenteros cut on/off for Lambda
+  Double_t  fArmQtSlope;               // slope for armenteros K0s cut: qt = alpha*slope
   //others
-  Double_t  fDCAToVertexK0;         // dca of V0 to vertex cut value K0s
-  Double_t  fDCAToVertexL;          // dca of V0 to vertex cut value L/AL
-  Double_t  fDCAXK;                 // dca in x of K0s to vertex cut value
-  Double_t  fDCAYK;                 // dca in y of K0s to vertex cut value
-  Double_t  fDCAXL;                 // dca in x of Lambda to vertex cut value
-  Double_t  fDCAYL;                 // dca in y of Lambda to vertex cut value
-  Double_t  fDCAZ;                  // dca in z of V0 to vertex cut value
+  Double_t  fExcludeLambdaFromK0s;     // exlude Lambda mass from K0s throuh mass difference below this value
+  Double_t  fExcludeK0sFromLambda;     // exlude K0s mass from Lambda throuh mass difference below this value
+  Double_t  fDCAToVertexK0;            // dca of V0 to vertex cut value K0s
+  Double_t  fDCAToVertexL;             // dca of V0 to vertex cut value L/AL
+  Double_t  fDCAXK;                    // dca in x of K0s to vertex cut value
+  Double_t  fDCAYK;                    // dca in y of K0s to vertex cut value
+  Double_t  fDCAXL;                    // dca in x of Lambda to vertex cut value
+  Double_t  fDCAYL;                    // dca in y of Lambda to vertex cut value
+  Double_t  fDCAZ;                     // dca in z of V0 to vertex cut value
   
-  Double_t  fDCADaughtersL;         // dca between Lambda daughters cut value
-  Double_t  fDCADaughtersAL;        // dca between ALambda daughters cut value
-  Double_t  fDCADaughtersK0;        // dca between K0s daughters cut value
+  Double_t  fDCADaughtersL;            // dca between Lambda daughters cut value
+  Double_t  fDCADaughtersAL;           // dca between ALambda daughters cut value
+  Double_t  fDCADaughtersK0;           // dca between K0s daughters cut value
   
-  Double_t  fDCADaughtersToVtxLarge;// dca large between V0 daughters and vertex cut value
-  Double_t  fDCADaughtersToVtxSmall;// dca small between V0 daughters and vertex cut value
+  Double_t  fDCADaughtersToVtxLarge;   // dca large between V0 daughters and vertex cut value
+  Double_t  fDCADaughtersToVtxSmall;   // dca small between V0 daughters and vertex cut value
   
-  Double_t  fDecayRadXYMin;         // minmal decay radius in x-y cut value
-  Double_t  fDecayRadXYMax;         // maximal decay radius in x-y cut value
+  Double_t  fDecayRadXYMin;            // minmal decay radius in x-y cut value
+  Double_t  fDecayRadXYMax;            // maximal decay radius in x-y cut value
   
-  Double_t  fCosPointAngL;          // cosine of pointing angle cut value for Lambda and ALambda
-  Double_t  fCosPointAngK;          // cosine of pointing angle cut value for K0s
-  Double_t  fCPAPtCutK0;            // pt max for cosine of pointing angle cut K0s
-  Double_t  fCPAPtCutL;             // pt max for cosine of pointing angle cut Lambda
-  Double_t  fOpengAngleDaughters;   // cut on opening angle between V0 daughters
-  Double_t  fOpAngPtCut;            // max pt for using the  opening angle between V0 daughters cut
+  Double_t  fCosPointAngL;             // cosine of pointing angle cut value for Lambda and ALambda
+  Double_t  fCosPointAngK;             // cosine of pointing angle cut value for K0s
+  Double_t  fCPAPtCutK0;               // pt max for cosine of pointing angle cut K0s
+  Double_t  fCPAPtCutL;                // pt max for cosine of pointing angle cut Lambda
+  Double_t  fOpengAngleDaughters;      // cut on opening angle between V0 daughters
+  Double_t  fOpAngPtCut;               // max pt for using the  opening angle between V0 daughters cut
     
-  Double_t  fDecayLengthMax;        // maximal decay length in x-y-z cut value
-  Double_t  fDecayLengthMin;        // minimal decay length in x-y-z cut value
+  Double_t  fDecayLengthMax;           // maximal decay length in x-y-z cut value
+  Double_t  fDecayLengthMin;           // minimal decay length in x-y-z cut value
 
   //ctau
-  Double_t  fCtauK0s;               // multiple of ctau cut value for K0s
-  Double_t  fCtauL;                 // multiple of ctau cut value for Lambda
-  Double_t  fCtauPtCutK0;           // pt max for ctau cut usage for K0s
-  Double_t  fCtauPtCutL;            // pt max for ctau cut usage for Lambda
+  Double_t  fCtauK0s;                  // multiple of ctau cut value for K0s
+  Double_t  fCtauL;                    // multiple of ctau cut value for Lambda
+  Double_t  fCtauPtCutK0;              // pt max for ctau cut usage for K0s
+  Double_t  fCtauPtCutL;               // pt max for ctau cut usage for Lambda
 
   //KF particle chi cut
-  //   Double_t  fChiCutKf;         //cut value of chi2 of AliKFParticle
-  Bool_t  fChiCutKf;                //cut value of chi2 of AliKFParticle
+  //   Double_t  fChiCutKf;            // cut value of chi2 of AliKFParticle
+  Bool_t  fChiCutKf;                   // cut value of chi2 of AliKFParticle
 
   
   /*
@@ -366,6 +434,6 @@ class AliAnalysisTaskV0ForRAA : public AliAnalysisTaskSE {
   AliAnalysisTaskV0ForRAA(const AliAnalysisTaskV0ForRAA&);
   AliAnalysisTaskV0ForRAA&operator=(const AliAnalysisTaskV0ForRAA&);
    
-  ClassDef(AliAnalysisTaskV0ForRAA, 1); 
+  ClassDef(AliAnalysisTaskV0ForRAA, 0); 
 };
 #endif