Updates to the analysis code (Peter K)
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Apr 2011 08:14:04 +0000 (08:14 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Apr 2011 08:14:04 +0000 (08:14 +0000)
19 files changed:
PWG2/SPECTRA/LambdaK0PbPb/AddTaskLambdaK0PbPb.C
PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisCentralitySelector.cxx
PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisCentralitySelector.h
PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisTaskPerformanceStrange.cxx
PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisTaskPerformanceStrange.h
PWG2/SPECTRA/LambdaK0PbPb/AliMassFitControl.h
PWG2/SPECTRA/LambdaK0PbPb/AnalysisStrange.C
PWG2/SPECTRA/LambdaK0PbPb/CreateAlienHandler.C
PWG2/SPECTRA/LambdaK0PbPb/FitSpectrum.C
PWG2/SPECTRA/LambdaK0PbPb/MultYields2.C
PWG2/SPECTRA/LambdaK0PbPb/MultYields2QA.C [new file with mode: 0644]
PWG2/SPECTRA/LambdaK0PbPb/PtMassAna2.C
PWG2/SPECTRA/LambdaK0PbPb/clean_files [new file with mode: 0755]
PWG2/SPECTRA/LambdaK0PbPb/run.C
PWG2/SPECTRA/LambdaK0PbPb/run.sh
PWG2/SPECTRA/LambdaK0PbPb/runAll.sh [new file with mode: 0644]
PWG2/SPECTRA/LambdaK0PbPb/runAllGrid.sh [new file with mode: 0644]
PWG2/SPECTRA/LambdaK0PbPb/runFit.sh [new file with mode: 0644]
PWG2/SPECTRA/LambdaK0PbPb/runQA.C [new file with mode: 0644]

index e66e729..90eaf6f 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskPerformanceStrange ** AddTaskLambdaK0PbPb(const char * outfilename, AliAnalysisCentralitySelector * centr, Int_t &nbin) {
+AliAnalysisTaskPerformanceStrange ** AddTaskLambdaK0PbPb(const char * outfilename, AliAnalysisCentralitySelector * centr, Int_t &nbin, Int_t binMin, Int_t binMax, Int_t iMCAnalysis = 0) {
 
 
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -21,10 +21,18 @@ AliAnalysisTaskPerformanceStrange ** AddTaskLambdaK0PbPb(const char * outfilenam
 
   // Configure analysis
   //===========================================================================
-    
-  Int_t binMin = 0; // FIXME: settable? different percentiles?
-  Int_t binMax = 10;
-  nbin = binMax - binMin + 1;
+    Int_t nbMinTPCclusters = 80;
+    Int_t lCollidingSystems = 1; 
+    TString fAnalysisType = "ESD";
+    TString lAnalysisPidMode  = "withoutPID";
+    TString lAnalysisCut      = "no";    
+    //Int_t iMCAnalysis = 0;
+     
+    AliESDtrackCuts * myTracksCuts = new AliESDtrackCuts();
+     myTracksCuts->SetRequireTPCRefit(kTRUE);
+     myTracksCuts->SetMinNClustersTPC(nbMinTPCclusters);
+     nbin = binMax - binMin + 1;
 
   AliAnalysisTaskPerformanceStrange ** task = new AliAnalysisTaskPerformanceStrange*[nbin];
   Int_t itask = -1;
@@ -33,7 +41,14 @@ AliAnalysisTaskPerformanceStrange ** AddTaskLambdaK0PbPb(const char * outfilenam
 
     task[itask] = new AliAnalysisTaskPerformanceStrange("TaskLambdaK0");
     cout << "Booking " << ibin << "  "<< itask << " " << task[itask] <<endl;
-    
+    task[itask]->SetCollidingSystems(lCollidingSystems);
+    task[itask]->SetAnalysisType(fAnalysisType);
+    task[itask]->SetAnalysisMC(iMCAnalysis);
+    task[itask]->SetAnalysisCut(lAnalysisCut);
+    task[itask]->SetUsePID(lAnalysisPidMode);
+    task[itask]->SetTrackCuts(myTracksCuts);
+   
     mgr->AddTask(task[itask]);
   
     // // Set Cuts
@@ -46,19 +61,63 @@ AliAnalysisTaskPerformanceStrange ** AddTaskLambdaK0PbPb(const char * outfilenam
     
     // set centrality
     AliAnalysisCentralitySelector * centrBin = (AliAnalysisCentralitySelector*) centr->Clone();
-    centrBin->SetCentralityBin(ibin);
+    //centrBin->SetCentralityBin(ibin);
+    if(ibin == 0){
+    centrBin->SetCentralityBin(0,5);
     task[itask]->SetCentralitySelector(centrBin);
-
+    }
+    if(ibin == 1){
+    centrBin->SetCentralityBin(5,10);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 2){
+    centrBin->SetCentralityBin(10,20);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 3){
+    centrBin->SetCentralityBin(20,30);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 4){
+    centrBin->SetCentralityBin(30,40);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 5){
+    centrBin->SetCentralityBin(40,50);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 6){
+    centrBin->SetCentralityBin(50,60);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 7){
+    centrBin->SetCentralityBin(60,70);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 8){
+    centrBin->SetCentralityBin(70,80);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 9){
+    centrBin->SetCentralityBin(80,90);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
+    if(ibin == 10){
+    centrBin->SetCentralityBin(0,90);
+    task[itask]->SetCentralitySelector(centrBin);
+    }
     TString outfilenameCentr = outfilename;
     outfilenameCentr.ReplaceAll(".root",Form("_%2.2d.root",ibin));
 
     AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
     AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("clambdak0Histo_%2.2d",ibin), TList::Class(),AliAnalysisManager::kOutputContainer, outfilenameCentr.Data());
     AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(Form("clambdak0Centr_%2.2d",ibin), AliAnalysisCentralitySelector::Class(),AliAnalysisManager::kOutputContainer, outfilenameCentr.Data());
-
+    AliAnalysisDataContainer *output_cuts = mgr->CreateContainer(Form("cuts_%2.2d",ibin), AliESDtrackCuts::Class(), AliAnalysisManager::kOutputContainer, outfilenameCentr.Data()); 
     mgr->ConnectInput (task[itask], 0, mgr->GetCommonInputContainer());
     mgr->ConnectOutput(task[itask],1,coutput1);
     mgr->ConnectOutput(task[itask],2,coutput2);
+    mgr->ConnectOutput(task[itask],3,output_cuts);
+    
 
   }
   // TODO:
index 7a47e70..4ea079a 100644 (file)
@@ -35,7 +35,7 @@ Bool_t AliAnalysisCentralitySelector::IsCentralityBinSelected(AliESDEvent* aEsd,
   if (fUseV0CutRange) {
 
     Float_t multV0=0;
-    AliESDVZERO* esdV0 = aEsd->GetVZEROData();
+        AliESDVZERO* esdV0 = aEsd->GetVZEROData();
     Float_t multV0A=esdV0->GetMTotV0A();
     Float_t multV0C=esdV0->GetMTotV0C();
     multV0 = multV0A+multV0C;
@@ -68,8 +68,7 @@ Bool_t AliAnalysisCentralitySelector::IsCentralityBinSelected(AliESDEvent* aEsd,
   } 
   else if(fUsePercentile) {
     AliCentrality *centrality = (AliCentrality*) aEsd->GetCentrality(); 
-    return centrality->IsEventInCentralityClass(fMultMin, fMultMax, fCentrEstimator.Data()) ;
-
+   return centrality->IsEventInCentralityClass(fMultMin, fMultMax, fCentrEstimator.Data()) ;
   }
   
   else {
index fcb5020..c3c67f9 100644 (file)
@@ -37,8 +37,8 @@ public:
   virtual UInt_t GetSelectionMask(const TObject* obj) { return (UInt_t) IsCentralityBinSelected((AliESDEvent*) obj, NULL); }
   virtual Bool_t IsSelected(TList*) { AliFatal("Not implemented"); return kFALSE; }
   virtual Bool_t IsSelected(TObject* obj)  {return (UInt_t) IsCentralityBinSelected ( (AliESDEvent*) obj, NULL);}
-    
-  Bool_t IsCentralityBinSelected(AliESDEvent* aEsd, AliESDtrackCuts * trackCuts);
+      
+   Bool_t IsCentralityBinSelected(AliESDEvent* aEsd, AliESDtrackCuts * trackCuts);
     
   void SetIsMC(Bool_t flag = kTRUE, Int_t multMin = 0, Int_t multMax=10000) { fIsMC = flag; fMultMin = multMin; fMultMax = multMax; }
   void SetMultRange(Int_t multMin = 0, Int_t multMax=10000) { fMultMin = multMin; fMultMax = multMax; }
@@ -47,7 +47,8 @@ public:
   void SetUseSPDOuterRange(Bool_t flag = kTRUE) {fUseSPDOuterRange = flag;}
   void SetCentralityEstimator(const char * estimator) { fCentrEstimator = estimator; }
   void SetCentralityBin(Int_t bin) { fCentrBin = bin; } // uses 10% percentiles
-  void SetCentralityBin(Float_t min, Float_t max) { fMultMin = min; fMultMax = max; fUsePercentile=kTRUE;}
+  void SetCentralityBin(Float_t min, Float_t max) { fMultMin = min; fMultMax = max; fUsePercentile=kTRUE;}//  maybe don't need this
+//  void SetPercentile(Bool_t flag = kTRUE){fUsePercentile = flag;}
   virtual void Print(Option_t* option = "") const ;
   virtual Long64_t Merge(TCollection* list){list->GetEntries();return 0;}
   
index 68c2739..7f36b13 100644 (file)
@@ -1,5 +1,5 @@
-/**************************************************************************
- * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
+
+/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
@@ -28,6 +28,7 @@
 #include "TTree.h"
 #include "TH1F.h"
 #include "TH2F.h"
+//#include "TH3F.h"
 #include "TF1.h"
 #include "TList.h"
 #include "TMath.h"
@@ -54,6 +55,8 @@
 #include "AliAODMCHeader.h"
 #include "AliAODInputHandler.h"
 
+//#include "AliV0vertexer.h"
+
 #include "AliAODMCParticle.h"
 
 #include "AliMCEventHandler.h"
@@ -68,6 +71,8 @@
 
 #include "AliAnalysisTaskPerformanceStrange.h"
 #include "AliAnalysisCentralitySelector.h"
+#include "AliCentrality.h"
+
 
 
 ClassImp(AliAnalysisTaskPerformanceStrange)
@@ -75,257 +80,243 @@ ClassImp(AliAnalysisTaskPerformanceStrange)
 
 //________________________________________________________________________
 AliAnalysisTaskPerformanceStrange::AliAnalysisTaskPerformanceStrange()
-  : AliAnalysisTaskSE("TaskStrange"), fAnalysisMC(0), fAnalysisType("infoType"),  fCollidingSystems(0), fUsePID("infoPID"), fUseCut("infoCut"), fUseOnTheFly(0), fESD(0), fListHist(0), fCentrSelector(0),
-
-    // MC histograms  ---------------------------------------
-    fHistMCPrimaryVertexX(0),
-    fHistMCPrimaryVertexY(0),
-    fHistMCPrimaryVertexZ(0),
-
-    fHistMCMultiplicityPrimary(0),
-    fHistMCMultiplicityTracks(0),
-
-    fHistMCtracksProdRadiusK0s(0),
-    fHistMCtracksProdRadiusLambda(0),
-    fHistMCtracksProdRadiusAntiLambda(0),
-
-    fHistMCtracksDecayRadiusK0s(0),
-    fHistMCtracksDecayRadiusLambda(0),
-    fHistMCtracksDecayRadiusAntiLambda(0),
-
-    fHistMCPtAllK0s(0),
-    fHistMCPtAllLambda(0),
-    fHistMCPtAllAntiLambda(0),
-
-    fHistMCProdRadiusK0s(0),
-    fHistMCProdRadiusLambda(0),
-    fHistMCProdRadiusAntiLambda(0),
-
-    fHistMCRapK0s(0),
-    fHistMCRapInPtRangeK0s(0),
-    fHistMCRapLambda(0),
-    fHistMCRapInPtRangeLambda(0),
-    fHistMCRapAntiLambda(0),
-    fHistMCRapInPtRangeAntiLambda(0),
-    fHistMCRapXi(0),
-    fHistMCRapInPtRangeXi(0),
-    fHistMCRapPhi(0),
-    fHistMCRapInPtRangePhi(0),
-
-    fHistMCPtK0s(0),
-    fHistMCPtLambda(0),
-
-    fHistMCPtLambdaFromSigma(0),
-    fHistMCPtAntiLambdaFromSigma(0),
-
-    fHistNTimesRecK0s(0),
-    fHistNTimesRecLambda(0),
-    fHistNTimesRecAntiLambda(0),
-    fHistNTimesRecK0sVsPt(0),
-    fHistNTimesRecLambdaVsPt(0),
-    fHistNTimesRecAntiLambdaVsPt(0),
-    // ------------------------------------------------------
-
-    // Reconstructed particle histograms  -------------------
-    fHistNumberEvents(0),
-    fHistTrackPerEvent(0),
-    fHistTrackletPerEvent(0),
-    fHistMCDaughterTrack(0),
-
-    fHistSPDPrimaryVertexZ(0),
-
-    fHistPrimaryVertexX(0),
-    fHistPrimaryVertexY(0),
-    fHistPrimaryVertexZ(0),
-
-    fHistPrimaryVertexResX(0),
-    fHistPrimaryVertexResY(0),
-    fHistPrimaryVertexResZ(0),
-
-    fHistPrimaryVertexPosXV0events(0), 
-    fHistPrimaryVertexPosYV0events(0), 
-    fHistPrimaryVertexPosZV0events(0),
-
-    fHistDaughterPt(0),
-
-    fHistDcaPosToPrimVertex(0),
-    fHistDcaNegToPrimVertex(0),
-    fHistDcaPosToPrimVertexZoom(0),
-    fHistDcaNegToPrimVertexZoom(0),
-    fHistRadiusV0(0),
-    fHistDecayLengthV0(0),
-    fHistDcaV0Daughters(0),
-    fHistChi2(0),
-    fHistCosPointAngle(0),
-    fHistCosPointAngleZoom(0),
-    fHistProdRadius(0),
-
-    fHistV0Multiplicity(0),
-
-    fHistChi2KFBeforeCutK0s(0), 
-    fHistChi2KFBeforeCutLambda(0), 
-    fHistChi2KFBeforeCutAntiLambda(0),
-    fHistChi2KFAfterCutK0s(0), 
-    fHistChi2KFAfterCutLambda(0), 
-    fHistChi2KFAfterCutAntiLambda(0),
-
-    fHistMassK0(0),
-    fHistMassLambda(0),
-    fHistMassAntiLambda(0),
-    fHistMassVsRadiusK0(0),
-    fHistMassVsRadiusLambda(0),
-    fHistMassVsRadiusAntiLambda(0),
-
-    fHistPtVsMassK0(0),
-    fHistPtVsMassLambda(0),
-    fHistArmenterosPodolanski(0),
-    // ------------------------------------------------------
-
-
-    // PID histograms  --------------------------------------
-    fHistNsigmaPosPionAntiLambda(0),
-    fHistNsigmaNegProtonAntiLambda(0),
-    fHistNsigmaPosProtonLambda(0),
-    fHistNsigmaNegPionLambda(0),
-    fHistNsigmaPosPionK0(0),
-    fHistNsigmaNegPionK0(0),
-    // ------------------------------------------------------
-
-    // Associated particles ---------------------------------
-    fHistAsMcRapK0(0),
-    fHistAsMcRapLambda(0),
-    fHistAsMcRapAntiLambda(0),
-
-    fHistAsMcPtK0(0),
-    fHistAsMcPtLambda(0),
-
-    fHistAsMcPtZoomK0(0),
-    fHistAsMcPtZoomLambda(0),
-
-    fHistAsMcProdRadiusK0(0),
-    fHistAsMcProdRadiusLambda(0),
-    fHistAsMcProdRadiusAntiLambda(0),
-
-    fHistAsMcProdRadiusXvsYK0s(0),
-    fHistAsMcProdRadiusXvsYLambda(0),
-    fHistAsMcProdRadiusXvsYAntiLambda(0),
-
-    fHistPidMcMassK0(0),
-    fHistPidMcMassLambda(0),
-    fHistPidMcMassAntiLambda(0),
-    fHistAsMcMassK0(0),
-    fHistAsMcMassLambda(0),
-    fHistAsMcMassAntiLambda(0),
-
-    fHistAsMcPtVsMassK0(0),
-    fHistAsMcPtVsMassLambda(0),
-    fHistAsMcPtVsMassAntiLambda(0),
-
-    fHistAsMcMassVsRadiusK0(0),
-    fHistAsMcMassVsRadiusLambda(0),
-    fHistAsMcMassVsRadiusAntiLambda(0),
-
-    fHistAsMcResxK0(0),
-    fHistAsMcResyK0(0),
-    fHistAsMcReszK0(0),
-
-    fHistAsMcResrVsRadiusK0(0),
-    fHistAsMcReszVsRadiusK0(0),
-
-    fHistAsMcResxLambda(0),
-    fHistAsMcResyLambda(0),
-    fHistAsMcReszLambda(0),
-
-    fHistAsMcResrVsRadiusLambda(0),
-    fHistAsMcReszVsRadiusLambda(0),
-
-    fHistAsMcResxAntiLambda(0),
-    fHistAsMcResyAntiLambda(0),
-    fHistAsMcReszAntiLambda(0),
-
-    fHistAsMcResrVsRadiusAntiLambda(0),
-    fHistAsMcReszVsRadiusAntiLambda(0),
-
-    fHistAsMcResPtK0(0),
-    fHistAsMcResPtLambda(0),
-    fHistAsMcResPtAntiLambda(0),
-
-    fHistAsMcResPtVsRapK0(0),
-    fHistAsMcResPtVsRapLambda(0),
-    fHistAsMcResPtVsRapAntiLambda(0),
-    fHistAsMcResPtVsPtK0(0),
-    fHistAsMcResPtVsPtLambda(0),
-    fHistAsMcResPtVsPtAntiLambda(0),
-
-    fHistAsMcMotherPdgCodeK0s(0),
-    fHistAsMcMotherPdgCodeLambda(0),
-    fHistAsMcMotherPdgCodeAntiLambda(0),
-
-    fHistAsMcPtLambdaFromSigma(0),
-    fHistAsMcPtAntiLambdaFromSigma(0),
-    // ------------------------------------------------------
-
-    // Associated secondary particle histograms -------------
-    fHistAsMcSecondaryPtVsRapK0s(0),
-    fHistAsMcSecondaryPtVsRapLambda(0),
-    fHistAsMcSecondaryPtVsRapAntiLambda(0),
-
-    fHistAsMcSecondaryProdRadiusK0s(0),
-    fHistAsMcSecondaryProdRadiusLambda(0),
-    fHistAsMcSecondaryProdRadiusAntiLambda(0),
+: AliAnalysisTaskSE(), fAnalysisMC(0), fAnalysisType("infoType"),  fCollidingSystems(0), fUsePID("infoPID"), fUseCut("infoCut"),fDown(0),fUp(0), fESD(0), fListHist(0),fCentrSelector(0),fTracksCuts(0), 
+
+  fHistMCPrimaryVertexX(0),
+  fHistMCPrimaryVertexY(0),
+  fHistMCPrimaryVertexZ(0),
+  fHistMCMultiplicityPrimary(0),
+  fHistMCMultiplicityTracks(0),
+  fHistTPCTracks(0),
+  fHistMCtracksProdRadiusK0s(0),
+  fHistMCtracksProdRadiusLambda(0),
+  fHistMCtracksProdRadiusAntiLambda(0),
+  fHistMCtracksDecayRadiusK0s(0),
+  fHistMCtracksDecayRadiusLambda(0),
+  fHistMCtracksDecayRadiusAntiLambda(0),
+  fHistMCPtAllK0s(0),
+  fHistMCPtAllLambda(0),
+  fHistMCPtAllAntiLambda(0),
+  fHistMCProdRadiusK0s(0),
+  fHistMCProdRadiusLambda(0),
+  fHistMCProdRadiusAntiLambda(0),
+  fHistMCRapK0s(0),
+  fHistMCRapInPtRangeK0s(0),
+  fHistMCRapLambda(0),
+  fHistMCRapInPtRangeLambda(0),
+  fHistMCRapAntiLambda(0),
+  fHistMCRapInPtRangeAntiLambda(0),
+  fHistMCRapXi(0),
+  fHistMCRapInPtRangeXi(0),
+  fHistMCRapPhi(0),
+  fHistMCRapInPtRangePhi(0),
+////////////////////////////////////////
+  fHistMCPtK0s(0),
+
+
+  fHistMCPtLambda(0),
+///////////////////////////////////////////
+
+  fHistMCPtLambdaFromSigma(0),
+  fHistMCPtAntiLambdaFromSigma(0),
+  fHistNTimesRecK0s(0),
+  fHistNTimesRecLambda(0),
+  fHistNTimesRecAntiLambda(0),
+  fHistNTimesRecK0sVsPt(0),
+  fHistNTimesRecLambdaVsPt(0),
+  fHistNTimesRecAntiLambdaVsPt(0),
+  fHistNumberEvents(0),
+  fHistTrackPerEvent(0),
+  fHistTPCMult(0),
+  fHistTrackletPerEvent(0),
+  fHistMCDaughterTrack(0),
+  fHistSPDPrimaryVertexZ(0),
+  fHistPrimaryVertexX(0),
+  fHistPrimaryVertexY(0),
+  fHistPrimaryVertexZ(0),
+  fHistPrimaryVertexResX(0),
+  fHistPrimaryVertexResY(0),
+  fHistPrimaryVertexResZ(0),
+  fHistPrimaryVertexPosXV0events(0), 
+  fHistPrimaryVertexPosYV0events(0), 
+  fHistPrimaryVertexPosZV0events(0),
+  fHistDaughterPt(0),
+////////////////////////////////////////
+
+  fHistDcaPosToPrimVertexK0(0),
+  fHistDcaNegToPrimVertexK0(0),
+  fHistRadiusV0K0(0),
+  fHistDecayLengthV0K0(0),
+  fHistDcaV0DaughtersK0(0),
+  fHistChi2K0(0),
+  fHistCosPointAngleK0(0),
+
+  fHistDcaPosToPrimVertexK0vsMassK0(0),
+  fHistDcaNegToPrimVertexK0vsMassK0(0),
+  fHistRadiusV0K0vsMassK0(0),
+  fHistDecayLengthV0K0vsMassK0(0),
+  fHistDcaV0DaughtersK0vsMassK0(0),
+  fHistCosPointAngleK0vsMassK0(0),
+   fHistDcaPosToPrimVertexK0vsMassK0pt1(0),
+   fHistDcaNegToPrimVertexK0vsMassK0pt1(0),
+   fHistRadiusV0K0vsMassK0pt1(0),
+   fHistDecayLengthV0K0vsMassK0pt1(0),
+   fHistDcaV0DaughtersK0vsMassK0pt1(0),
+   fHistCosPointAngleK0vsMassK0pt1(0),
+
+   fHistDcaPosToPrimVertexK0vsMassK0pt2(0),
+   fHistDcaNegToPrimVertexK0vsMassK0pt2(0),
+   fHistRadiusV0K0vsMassK0pt2(0),
+   fHistDecayLengthV0K0vsMassK0pt2(0),
+   fHistDcaV0DaughtersK0vsMassK0pt2(0),
+   fHistCosPointAngleK0vsMassK0pt2(0),
+
+   fHistDcaPosToPrimVertexK0vsMassK0pt3(0),
+   fHistDcaNegToPrimVertexK0vsMassK0pt3(0),
+   fHistRadiusV0K0vsMassK0pt3(0),
+   fHistDecayLengthV0K0vsMassK0pt3(0),
+   fHistDcaV0DaughtersK0vsMassK0pt3(0),
+   fHistCosPointAngleK0vsMassK0pt3(0),
+
+/////////////////////////////////////////
+
+  fHistDcaPosToPrimVertexL(0),
+  fHistDcaNegToPrimVertexL(0),
+  fHistRadiusV0L(0),
+  fHistDecayLengthV0L(0),
+  fHistDcaV0DaughtersL(0),
+  fHistChi2L(0),
+  fHistCosPointAngleL(0),
+
+  fHistDcaPosToPrimVertexLvsMassL(0),
+  fHistDcaNegToPrimVertexLvsMassL(0),
+  fHistRadiusV0LvsMassL(0),
+  fHistDecayLengthV0LvsMassL(0),
+  fHistDcaV0DaughtersLvsMassL(0),
+  fHistCosPointAngleLvsMassL(0),
+
+/////////////////////////////////////////
+  fHistV0Multiplicity(0),
+  fHistMassK0(0),
+  fHistMassLambda(0),
+  fHistMassAntiLambda(0),
+  fHistMassVsRadiusK0(0),
+  fHistMassVsRadiusLambda(0),
+  fHistMassVsRadiusAntiLambda(0),
+
+///////////////////////////////////////
+  fHistPtVsMassK0(0),
+  fHistPtVsMassLambda(0),
+////////////////////////////////////////
+
+  fHistArmenterosPodolanski(0),
+  fHistK0sMassVsLambdaMass(0),
+  fHistNsigmaPosPionAntiLambda(0),
+  fHistNsigmaNegProtonAntiLambda(0),
+  fHistNsigmaPosProtonLambda(0),
+  fHistNsigmaNegPionLambda(0),
+  fHistNsigmaPosPionK0(0),
+  fHistNsigmaNegPionK0(0),
+  fHistAsMcRapK0(0),
+  fHistAsMcRapLambda(0),
+  fHistAsMcRapAntiLambda(0),
+  fHistAsMcPtK0(0),
+  fHistAsMcPtLambda(0),
+  fHistAsMcPtZoomK0(0),
+  fHistAsMcPtZoomLambda(0),
+  fHistAsMcProdRadiusK0(0),
+  fHistAsMcProdRadiusLambda(0),
+  fHistAsMcProdRadiusAntiLambda(0),
+  fHistAsMcProdRadiusXvsYK0s(0),
+  fHistAsMcProdRadiusXvsYLambda(0),
+  fHistAsMcProdRadiusXvsYAntiLambda(0),
+  fHistPidMcMassK0(0),
+  fHistPidMcMassLambda(0),
+  fHistPidMcMassAntiLambda(0),
+  fHistAsMcMassK0(0),
+  fHistAsMcMassLambda(0),
+  fHistAsMcMassAntiLambda(0),
+  fHistAsMcPtVsMassK0(0),
+  fHistAsMcPtVsMassLambda(0),
+  fHistAsMcPtVsMassAntiLambda(0),
+  fHistAsMcMassVsRadiusK0(0),
+  fHistAsMcMassVsRadiusLambda(0),
+  fHistAsMcMassVsRadiusAntiLambda(0),
+  fHistAsMcResxK0(0),
+  fHistAsMcResyK0(0),
+  fHistAsMcReszK0(0),
+  fHistAsMcResrVsRadiusK0(0),
+  fHistAsMcReszVsRadiusK0(0),
+  fHistAsMcResxLambda(0),
+  fHistAsMcResyLambda(0),
+  fHistAsMcReszLambda(0),
+  fHistAsMcResrVsRadiusLambda(0),
+  fHistAsMcReszVsRadiusLambda(0),
+  fHistAsMcResxAntiLambda(0),
+  fHistAsMcResyAntiLambda(0),
+  fHistAsMcReszAntiLambda(0),
+  fHistAsMcResrVsRadiusAntiLambda(0),
+  fHistAsMcReszVsRadiusAntiLambda(0),
+  fHistAsMcResPtK0(0),
+  fHistAsMcResPtLambda(0),
+  fHistAsMcResPtAntiLambda(0),
+  fHistAsMcResPtVsRapK0(0),
+  fHistAsMcResPtVsRapLambda(0),
+  fHistAsMcResPtVsRapAntiLambda(0),
+  fHistAsMcResPtVsPtK0(0),
+  fHistAsMcResPtVsPtLambda(0),
+  fHistAsMcResPtVsPtAntiLambda(0),
+  fHistAsMcMotherPdgCodeK0s(0),
+  fHistAsMcMotherPdgCodeLambda(0),
+  fHistAsMcMotherPdgCodeAntiLambda(0),
+  fHistAsMcPtLambdaFromSigma(0),
+  fHistAsMcPtAntiLambdaFromSigma(0),
+  fHistAsMcSecondaryPtVsRapK0s(0),
+  fHistAsMcSecondaryPtVsRapLambda(0),
+  fHistAsMcSecondaryPtVsRapAntiLambda(0),
+  fHistAsMcSecondaryProdRadiusK0s(0),
+  fHistAsMcSecondaryProdRadiusLambda(0),
+  fHistAsMcSecondaryProdRadiusAntiLambda(0),
+  fHistAsMcSecondaryProdRadiusXvsYK0s(0),
+  fHistAsMcSecondaryProdRadiusXvsYLambda(0),
+  fHistAsMcSecondaryProdRadiusXvsYAntiLambda(0),
+  fHistAsMcSecondaryMotherPdgCodeK0s(0),
+  fHistAsMcSecondaryMotherPdgCodeLambda(0),
+  fHistAsMcSecondaryMotherPdgCodeAntiLambda(0),
+  fHistAsMcSecondaryPtLambdaFromSigma(0),
+  fHistAsMcSecondaryPtAntiLambdaFromSigma(0)
+    
+{
+  // Constructor
+}
 
-    fHistAsMcSecondaryProdRadiusXvsYK0s(0),
-    fHistAsMcSecondaryProdRadiusXvsYLambda(0),
-    fHistAsMcSecondaryProdRadiusXvsYAntiLambda(0),
 
-    fHistAsMcSecondaryMotherPdgCodeK0s(0),
-    fHistAsMcSecondaryMotherPdgCodeLambda(0),
-    fHistAsMcSecondaryMotherPdgCodeAntiLambda(0),
 
-    fHistAsMcSecondaryPtLambdaFromSigma(0),
-    fHistAsMcSecondaryPtAntiLambdaFromSigma(0)
-{
-  // Constructor
 
-  // New V0 cuts
-/*  fCuts[0]=33;    // max allowed chi2
-  fCuts[1]=0.05;  // min allowed impact parameter for the 1st daughter
-  fCuts[2]=0.05;  // min allowed impact parameter for the 2nd daughter
-  fCuts[3]=0.5;   // max allowed DCA between the daughter tracks
-  fCuts[4]=0.00;  // max allowed cosine of V0's pointing angle
-  fCuts[5]=0.2;   // min radius of the fiducial volume
-  fCuts[6]=100;   // max radius of the fiducial volume
-*/
-}
 
 //________________________________________________________________________
 AliAnalysisTaskPerformanceStrange::AliAnalysisTaskPerformanceStrange(const char *name)
-  : AliAnalysisTaskSE(name), fAnalysisMC(0), fAnalysisType("infoType"), fCollidingSystems(0), fUsePID("infoPID"), fUseCut("infoCut"), fUseOnTheFly(0), fESD(0), fListHist(),fCentrSelector(0),
+  : AliAnalysisTaskSE(name), fAnalysisMC(0), fAnalysisType("infoType"), fCollidingSystems(0), fUsePID("infoPID"), fUseCut("infocut"),fDown(0),fUp(0), fESD(0), fListHist(),fCentrSelector(0), fTracksCuts(0),
 
-    // MC histograms  ---------------------------------------
     fHistMCPrimaryVertexX(0),
     fHistMCPrimaryVertexY(0),
     fHistMCPrimaryVertexZ(0),
-
     fHistMCMultiplicityPrimary(0),
     fHistMCMultiplicityTracks(0),
-
+    fHistTPCTracks(0),
     fHistMCtracksProdRadiusK0s(0),
     fHistMCtracksProdRadiusLambda(0),
     fHistMCtracksProdRadiusAntiLambda(0),
-
     fHistMCtracksDecayRadiusK0s(0),
     fHistMCtracksDecayRadiusLambda(0),
     fHistMCtracksDecayRadiusAntiLambda(0),
-
     fHistMCPtAllK0s(0),
     fHistMCPtAllLambda(0),
     fHistMCPtAllAntiLambda(0),
-
     fHistMCProdRadiusK0s(0),
     fHistMCProdRadiusLambda(0),
     fHistMCProdRadiusAntiLambda(0),
-
     fHistMCRapK0s(0),
     fHistMCRapInPtRangeK0s(0),
     fHistMCRapLambda(0),
@@ -336,206 +327,212 @@ AliAnalysisTaskPerformanceStrange::AliAnalysisTaskPerformanceStrange(const char
     fHistMCRapInPtRangeXi(0),
     fHistMCRapPhi(0),
     fHistMCRapInPtRangePhi(0),
-
+    ////////////////////////////////////////////////
     fHistMCPtK0s(0),
     fHistMCPtLambda(0),
-
+    /////////////////////////////////////////////////
     fHistMCPtLambdaFromSigma(0),
     fHistMCPtAntiLambdaFromSigma(0),
-
     fHistNTimesRecK0s(0),
     fHistNTimesRecLambda(0),
     fHistNTimesRecAntiLambda(0),
     fHistNTimesRecK0sVsPt(0),
     fHistNTimesRecLambdaVsPt(0),
     fHistNTimesRecAntiLambdaVsPt(0),
-    // ------------------------------------------------------
-
-    // Reconstructed particle histograms  -------------------
     fHistNumberEvents(0),
     fHistTrackPerEvent(0),
+    fHistTPCMult(0),
     fHistTrackletPerEvent(0),
     fHistMCDaughterTrack(0),
-
     fHistSPDPrimaryVertexZ(0),
-
     fHistPrimaryVertexX(0),
     fHistPrimaryVertexY(0),
     fHistPrimaryVertexZ(0),
-
     fHistPrimaryVertexResX(0),
     fHistPrimaryVertexResY(0),
     fHistPrimaryVertexResZ(0),
-
     fHistPrimaryVertexPosXV0events(0), 
     fHistPrimaryVertexPosYV0events(0), 
     fHistPrimaryVertexPosZV0events(0),
-
     fHistDaughterPt(0),
+    ////////////////////////////////////////
+
+    fHistDcaPosToPrimVertexK0(0),
+    fHistDcaNegToPrimVertexK0(0),
+    fHistRadiusV0K0(0),
+    fHistDecayLengthV0K0(0),
+    fHistDcaV0DaughtersK0(0),
+    fHistChi2K0(0),
+    fHistCosPointAngleK0(0),
+
+    fHistDcaPosToPrimVertexK0vsMassK0(0),
+    fHistDcaNegToPrimVertexK0vsMassK0(0),
+    fHistRadiusV0K0vsMassK0(0),
+    fHistDecayLengthV0K0vsMassK0(0),
+    fHistDcaV0DaughtersK0vsMassK0(0),
+    fHistCosPointAngleK0vsMassK0(0),
 
-    fHistDcaPosToPrimVertex(0),
-    fHistDcaNegToPrimVertex(0),
-    fHistDcaPosToPrimVertexZoom(0),
-    fHistDcaNegToPrimVertexZoom(0),
-    fHistRadiusV0(0),
-    fHistDecayLengthV0(0),
-    fHistDcaV0Daughters(0),
-    fHistChi2(0),
-    fHistCosPointAngle(0),
-    fHistCosPointAngleZoom(0),
-    fHistProdRadius(0),
+    
+      fHistDcaPosToPrimVertexK0vsMassK0pt1(0),
+      fHistDcaNegToPrimVertexK0vsMassK0pt1(0),
+      fHistRadiusV0K0vsMassK0pt1(0),
+      fHistDecayLengthV0K0vsMassK0pt1(0),
+      fHistDcaV0DaughtersK0vsMassK0pt1(0),
+      fHistCosPointAngleK0vsMassK0pt1(0),
+
+      fHistDcaPosToPrimVertexK0vsMassK0pt2(0),
+      fHistDcaNegToPrimVertexK0vsMassK0pt2(0),
+      fHistRadiusV0K0vsMassK0pt2(0),
+      fHistDecayLengthV0K0vsMassK0pt2(0),
+      fHistDcaV0DaughtersK0vsMassK0pt2(0),
+      fHistCosPointAngleK0vsMassK0pt2(0),
+
+      fHistDcaPosToPrimVertexK0vsMassK0pt3(0),
+      fHistDcaNegToPrimVertexK0vsMassK0pt3(0),
+      fHistRadiusV0K0vsMassK0pt3(0),
+      fHistDecayLengthV0K0vsMassK0pt3(0),
+      fHistDcaV0DaughtersK0vsMassK0pt3(0),
+      fHistCosPointAngleK0vsMassK0pt3(0),
+    
+    /////////////////////////////////////////
 
-    fHistV0Multiplicity(0),
+    fHistDcaPosToPrimVertexL(0),
+    fHistDcaNegToPrimVertexL(0),
+    fHistRadiusV0L(0),
+    fHistDecayLengthV0L(0),
+    fHistDcaV0DaughtersL(0),
+    fHistChi2L(0),
+    fHistCosPointAngleL(0),
 
-    fHistChi2KFBeforeCutK0s(0), 
-    fHistChi2KFBeforeCutLambda(0), 
-    fHistChi2KFBeforeCutAntiLambda(0),
-    fHistChi2KFAfterCutK0s(0), 
-    fHistChi2KFAfterCutLambda(0), 
-    fHistChi2KFAfterCutAntiLambda(0),
+    fHistDcaPosToPrimVertexLvsMassL(0),
+    fHistDcaNegToPrimVertexLvsMassL(0),
+    fHistRadiusV0LvsMassL(0),
+    fHistDecayLengthV0LvsMassL(0),
+    fHistDcaV0DaughtersLvsMassL(0),
+    fHistCosPointAngleLvsMassL(0),
 
+    /////////////////////////////////////////
+
+    fHistV0Multiplicity(0),
     fHistMassK0(0),
     fHistMassLambda(0),
     fHistMassAntiLambda(0),
     fHistMassVsRadiusK0(0),
     fHistMassVsRadiusLambda(0),
     fHistMassVsRadiusAntiLambda(0),
-
+    /////////////////////////////////////////////
     fHistPtVsMassK0(0),
     fHistPtVsMassLambda(0),
+    ///////////////////////////////////////////////////
     fHistArmenterosPodolanski(0),
-    // ------------------------------------------------------
-
-
-    // PID histograms  --------------------------------------
+    fHistK0sMassVsLambdaMass(0),
     fHistNsigmaPosPionAntiLambda(0),
     fHistNsigmaNegProtonAntiLambda(0),
     fHistNsigmaPosProtonLambda(0),
     fHistNsigmaNegPionLambda(0),
     fHistNsigmaPosPionK0(0),
     fHistNsigmaNegPionK0(0),
-    // ------------------------------------------------------
-
-    // Associated particles ---------------------------------
     fHistAsMcRapK0(0),
     fHistAsMcRapLambda(0),
     fHistAsMcRapAntiLambda(0),
-
+    ///////////////////////////////////
     fHistAsMcPtK0(0),
     fHistAsMcPtLambda(0),
-
+    /////////////////////////////////////
     fHistAsMcPtZoomK0(0),
     fHistAsMcPtZoomLambda(0),
-
     fHistAsMcProdRadiusK0(0),
     fHistAsMcProdRadiusLambda(0),
     fHistAsMcProdRadiusAntiLambda(0),
-
     fHistAsMcProdRadiusXvsYK0s(0),
     fHistAsMcProdRadiusXvsYLambda(0),
     fHistAsMcProdRadiusXvsYAntiLambda(0),
-
     fHistPidMcMassK0(0),
     fHistPidMcMassLambda(0),
     fHistPidMcMassAntiLambda(0),
     fHistAsMcMassK0(0),
     fHistAsMcMassLambda(0),
     fHistAsMcMassAntiLambda(0),
-
     fHistAsMcPtVsMassK0(0),
     fHistAsMcPtVsMassLambda(0),
     fHistAsMcPtVsMassAntiLambda(0),
-
     fHistAsMcMassVsRadiusK0(0),
     fHistAsMcMassVsRadiusLambda(0),
     fHistAsMcMassVsRadiusAntiLambda(0),
-
     fHistAsMcResxK0(0),
     fHistAsMcResyK0(0),
     fHistAsMcReszK0(0),
-
     fHistAsMcResrVsRadiusK0(0),
     fHistAsMcReszVsRadiusK0(0),
-
     fHistAsMcResxLambda(0),
     fHistAsMcResyLambda(0),
     fHistAsMcReszLambda(0),
-
     fHistAsMcResrVsRadiusLambda(0),
     fHistAsMcReszVsRadiusLambda(0),
-
     fHistAsMcResxAntiLambda(0),
     fHistAsMcResyAntiLambda(0),
     fHistAsMcReszAntiLambda(0),
-
     fHistAsMcResrVsRadiusAntiLambda(0),
     fHistAsMcReszVsRadiusAntiLambda(0),
-
     fHistAsMcResPtK0(0),
     fHistAsMcResPtLambda(0),
     fHistAsMcResPtAntiLambda(0),
-
     fHistAsMcResPtVsRapK0(0),
     fHistAsMcResPtVsRapLambda(0),
     fHistAsMcResPtVsRapAntiLambda(0),
     fHistAsMcResPtVsPtK0(0),
     fHistAsMcResPtVsPtLambda(0),
     fHistAsMcResPtVsPtAntiLambda(0),
-
     fHistAsMcMotherPdgCodeK0s(0),
     fHistAsMcMotherPdgCodeLambda(0),
     fHistAsMcMotherPdgCodeAntiLambda(0),
-
     fHistAsMcPtLambdaFromSigma(0),
     fHistAsMcPtAntiLambdaFromSigma(0),
-    // ------------------------------------------------------
-
-    // Associated secondary particle histograms -------------
     fHistAsMcSecondaryPtVsRapK0s(0),
     fHistAsMcSecondaryPtVsRapLambda(0),
     fHistAsMcSecondaryPtVsRapAntiLambda(0),
-
     fHistAsMcSecondaryProdRadiusK0s(0),
     fHistAsMcSecondaryProdRadiusLambda(0),
     fHistAsMcSecondaryProdRadiusAntiLambda(0),
-
     fHistAsMcSecondaryProdRadiusXvsYK0s(0),
     fHistAsMcSecondaryProdRadiusXvsYLambda(0),
     fHistAsMcSecondaryProdRadiusXvsYAntiLambda(0),
-
     fHistAsMcSecondaryMotherPdgCodeK0s(0),
     fHistAsMcSecondaryMotherPdgCodeLambda(0),
     fHistAsMcSecondaryMotherPdgCodeAntiLambda(0),
-
     fHistAsMcSecondaryPtLambdaFromSigma(0),
     fHistAsMcSecondaryPtAntiLambdaFromSigma(0)
+    
 {
   // Constructor
 
-  //New V0 cuts
-/*  fCuts[0]=33;    // max allowed chi2
-  fCuts[1]=0.05;  // min allowed impact parameter for the 1st daughter
-  fCuts[2]=0.05;  // min allowed impact parameter for the 2nd daughter
-  fCuts[3]=0.5;   // max allowed DCA between the daughter tracks
-  fCuts[4]=0.00;  // max allowed cosine of V0's pointing angle
-  fCuts[5]=0.2;   // min radius of the fiducial volume
-  fCuts[6]=100;   // max radius of the fiducial volume
-*/
   // Define output slots only here
   // Output slot #1 writes into a TList container
   DefineOutput(1, TList::Class());
   DefineOutput(2, AliAnalysisCentralitySelector::Class());
-
+  DefineOutput(3, AliESDtrackCuts::Class());
 }
+AliAnalysisTaskPerformanceStrange::~AliAnalysisTaskPerformanceStrange() {
+  //
+  // Destructor
+  //
+  if (fListHist && !AliAnalysisManager::GetAnalysisManager()->IsProofMode())  { delete fListHist;     fListHist = 0x0;    }
+  if (fCentrSelector && !AliAnalysisManager::GetAnalysisManager()->IsProofMode())  { delete fCentrSelector;    fCentrSelector = 0x0;    }
+  if (fTracksCuts && !AliAnalysisManager::GetAnalysisManager()->IsProofMode())  { delete fTracksCuts;     fTracksCuts = 0x0;    }
+
 
+}
 //________________________________________________________________________
 void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects() 
 {
+
   //******************
   // Create histograms
   //*******************
   fListHist = new TList();
   fListHist->SetOwner();
+  //fListHistCuts = new TList();
+  //fListHistCuts->SetOwner();
 
   // Bo: tbd: condition before allocation (i.e. if (!fHistMCMultiplicityPrimary){...} for each histo...
 
@@ -543,7 +540,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   // MC histograms
   //***************
  
-  // Primary Vertex X,Y,Z:
+  // Primary Vertex:
   fHistMCPrimaryVertexX          = new TH1F("h1MCPrimaryVertexX", "MC Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5);
   fListHist->Add(fHistMCPrimaryVertexX);
 
@@ -553,7 +550,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistMCPrimaryVertexZ          = new TH1F("h1MCPrimaryVertexZ", "MC Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-20,20);
   fListHist->Add(fHistMCPrimaryVertexZ);
   
-  // Multiplicity:
+  // Multiplicity
   fHistMCMultiplicityPrimary           = new TH1F("h1MCMultiplicityPrimary", "MC Primary Particles;NPrimary;Count", 201, -0.5, 200.5);
   fListHist->Add(fHistMCMultiplicityPrimary);
 
@@ -597,10 +594,9 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistMCProdRadiusLambda              = new TH1F("h1MCProdRadiusLambda", "MC #Lambda^{0} Production Radius;r (cm);Count", 400, -2, 2);
   fListHist->Add(fHistMCProdRadiusLambda);
 
-   fHistMCProdRadiusAntiLambda         = new TH1F("h1MCProdRadiusAntiLambda", "MC #bar{#Lambda}^{0} Production Radius;r (cm);Count", 400, -2, 2);
+  fHistMCProdRadiusAntiLambda         = new TH1F("h1MCProdRadiusAntiLambda", "MC #bar{#Lambda}^{0} Production Radius;r (cm);Count", 400, -2, 2);
   fListHist->Add(fHistMCProdRadiusAntiLambda);
 
-
   // Rapidity distribution:
   fHistMCRapK0s                 = new TH1F("h1MCRapK0s", "K^{0};y",160,-4,4);
   fListHist->Add(fHistMCRapK0s);
@@ -620,19 +616,18 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistMCRapInPtRangeAntiLambda = new TH1F("h1MCRapInPtRangeAntiLambda", "#bar{#Lambda};y",160,-4,4);
   fListHist->Add(fHistMCRapInPtRangeAntiLambda);
 
-  fHistMCRapXi                  = new TH1F("h1MCRapXi", "#Xi;y",160,-4,4);
+  fHistMCRapXi                  = new TH1F("h1MCRapXi", "Xi;y",160,-4,4);
   fListHist->Add(fHistMCRapXi);
 
-  fHistMCRapInPtRangeXi         = new TH1F("h1MCRapInPtRangeXi", "#Xi;y",160,-4,4);
+  fHistMCRapInPtRangeXi         = new TH1F("h1MCRapInPtRangeXi", "Xi;y",160,-4,4);
   fListHist->Add(fHistMCRapInPtRangeXi);
 
-  fHistMCRapPhi                  = new TH1F("h1MCRapPhi", "#phi;y",160,-4,4);
+  fHistMCRapPhi                  = new TH1F("h1MCRapPhi", "Phi;y",160,-4,4);
   fListHist->Add(fHistMCRapPhi);
 
-  fHistMCRapInPtRangePhi         = new TH1F("h1MCRapInPtRangePhi", "#phi;y",160,-4,4);
+  fHistMCRapInPtRangePhi         = new TH1F("h1MCRapInPtRangePhi", "Phi;y",160,-4,4);
   fListHist->Add(fHistMCRapInPtRangePhi);
 
-
   // Pt distribution:
   fHistMCPtK0s               = new TH1F("h1MCPtK0s", "K^{0};p_{t} (GeV/c)",240,0,12);
   fListHist->Add(fHistMCPtK0s);
@@ -640,14 +635,14 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistMCPtLambda            = new TH1F("h1MCPtLambda", "#Lambda^{0};p_{t} (GeV/c)",240,0,12);
   fListHist->Add(fHistMCPtLambda);
 
-  // Pt distribution of Lambda coming from Sigma decay:
+  // Pt distribution of Lambda coming from Sigma decay
   fHistMCPtLambdaFromSigma      = new TH1F("h1MCPtLambdaFromSigma", "#Lambda^{0};p_{t} (GeV/c)",240,0,12);
   fListHist->Add(fHistMCPtLambdaFromSigma);
 
   fHistMCPtAntiLambdaFromSigma  = new TH1F("h1MCPtAntiLambdaFromSigma", "#Lambda^{0};p_{t} (GeV/c)",240,0,12);
   fListHist->Add(fHistMCPtAntiLambdaFromSigma);
  
-  // Multiple reconstruction studies:
+  // Multiple reconstruction studies
   fHistNTimesRecK0s             = new TH1F("h1NTimesRecK0s","number of times a K0s is reconstructed in -1<y<1;number of times;counts",500,-0.5,4.5);
   fListHist->Add(fHistNTimesRecK0s);
 
@@ -670,20 +665,27 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   // Reconstructed particles histograms
   //***********************************
 
-  // Number of events:
+  // Number of events;
   fHistNumberEvents           = new TH1F("h1NumberEvents", "Number of events; index;Number of Events",10,0,10);
   fListHist->Add(fHistNumberEvents);
 
-  // Multiplicity:
-  fHistTrackPerEvent           = new TH1F("h1TrackPerEvent", "Tracks per event;Number of Tracks;Number of Events",20000,0,20000);
+  // multiplicity
+  fHistTrackPerEvent           = new TH1F("h1TrackPerEvent", "Tracks per event;Number of Tracks;Number of Events",10000,0,10000);
   fListHist->Add(fHistTrackPerEvent);
 
+  fHistTPCMult           = new TH1F("h1HistTPCMult", "TPC tracks per event;Number of Tracks;Number of Events",10000,0,10000);
+  fListHist->Add(fHistTPCMult);
+
+
   fHistTrackletPerEvent       = new TH1F("h1TrackletPerEvent", "Number of tracklets;Number of tracklets per events;Number of events",1000,0,1000);
   fListHist->Add(fHistTrackletPerEvent);
 
   fHistMCDaughterTrack         = new TH1F("h1MCDaughterTrack","Distribution of mc id for daughters;id tags;Counts",15,0,15);
   fListHist->Add(fHistMCDaughterTrack);
 
+   fHistTPCTracks               = new TH1F("h1TPCTracks","Distribution of TPC tracks;Number of TPC tracks:Number of events",1000,0,10000);
+  fListHist->Add(fHistTPCTracks);
+
   // Primary Vertex:
   fHistSPDPrimaryVertexZ          = new TH1F("h1SPDPrimaryVertexZ", "SPD Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-20,20);
   fListHist->Add(fHistSPDPrimaryVertexZ);
@@ -698,7 +700,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fListHist->Add(fHistPrimaryVertexZ);
 
 
-  // Primary vertex resolution:
+  // Primary vertex resolution
   fHistPrimaryVertexResX          = new TH1F("h1PrimaryVertexResX", "Primary Vertex Resolution X;Primary Vertex Resolution X (cm);Events",100,-0.25,0.25);
   fListHist->Add(fHistPrimaryVertexResX);
 
@@ -721,41 +723,157 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistDaughterPt              = new TH2F("h2DaughterPt", "Daughter Pt;Positive Daughter Pt; Negative Daughter Pt",200,0,2,200,0,2);
   fListHist->Add(fHistDaughterPt);
 
-  // Cut checks:
-  fHistDcaPosToPrimVertex      = new TH2F("h2DcaPosToPrimVertex", "Positive V0 daughter;dca(cm);Status",500,0,5,2,-0.5,1.5);
-  fListHist->Add(fHistDcaPosToPrimVertex);
+  //////K0s///////////////// 2D histos: cut vs on fly status////
+
+  fHistDcaPosToPrimVertexK0      = new TH2F("h2DcaPosToPrimVertexK0", "Positive V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
+  fListHist->Add(fHistDcaPosToPrimVertexK0);
+
+  fHistDcaNegToPrimVertexK0      = new TH2F("h2DcaNegToPrimVertexK0", "Negative V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
+  fListHist->Add(fHistDcaNegToPrimVertexK0);
+
+
+  fHistRadiusV0K0                = new TH2F("h2RadiusV0K0", "Radius;Radius(cm);Status",500,0,500,2,-0.5,1.5);
+  fListHist->Add(fHistRadiusV0K0);
+
+  fHistDecayLengthV0K0           = new TH2F("h2DecayLengthV0K0", "V0s decay Length;decay length(cm);Status", 500, 0, 500,2,-0.5,1.5);
+  fListHist->Add(fHistDecayLengthV0K0);
+
+  fHistDcaV0DaughtersK0          = new TH2F("h2DcaV0DaughtersK0", "DCA between daughters;dca(cm);Status", 300, 0, 3.0,2,-0.5,1.5);
+  fListHist->Add(fHistDcaV0DaughtersK0);
+
+  fHistChi2K0                    = new TH2F("h2Chi2K0", "V0s chi2;chi2;Status", 1000, 0, 0.1,2,-0.5,1.5);
+  fListHist->Add(fHistChi2K0);
+
+  fHistCosPointAngleK0           = new TH2F("h2CosPointAngleK0", "Cosine of V0's pointing angle", 200,0.99,1.01,2,-0.5,1.5);
+  fListHist->Add(fHistCosPointAngleK0);
+
+
+  ////////////K0s///////////////// 2D histos: cut vs mass////
+
+
+  fHistDcaPosToPrimVertexK0vsMassK0 = new TH2F("h2DcaPosToPrimVertexK0vsMassK0", "Positive V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+  fListHist->Add(fHistDcaPosToPrimVertexK0vsMassK0);
+
+  fHistDcaNegToPrimVertexK0vsMassK0 = new TH2F("h2DcaNegToPrimVertexK0vsMassK0", "Negative V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+  fListHist->Add(fHistDcaNegToPrimVertexK0vsMassK0);
+
+
+  fHistRadiusV0K0vsMassK0           = new TH2F("h2RadiusV0K0vsMassK0", "Radius;Radius(cm);K0s inv. mass",110,0,110,200,0.4,0.6);
+  fListHist->Add(fHistRadiusV0K0vsMassK0);
+
+  fHistDecayLengthV0K0vsMassK0      = new TH2F("h2DecayLengthV0K0vsMassK0", "V0s decay Length;decay length(cm);K0s inv. mass", 100, 0, 100,200,0.4,0.6);
+  fListHist->Add(fHistDecayLengthV0K0vsMassK0);
+
+  fHistDcaV0DaughtersK0vsMassK0     = new TH2F("h2DcaV0DaughtersK0vsMassK0", "DCA between daughters;dca(cm);K0s inv. mass", 110, 0, 1.1,200,0.4,0.6);
+  fListHist->Add(fHistDcaV0DaughtersK0vsMassK0);
+
+
+  fHistCosPointAngleK0vsMassK0      = new TH2F("h2CosPointAngleK0vsMassK0", "Cosine of V0's pointing angle", 200,0.997,1.007,200,0.4,0.6);
+  fListHist->Add(fHistCosPointAngleK0vsMassK0);
+    //// pt1
+      fHistDcaPosToPrimVertexK0vsMassK0pt1 = new TH2F("h2DcaPosToPrimVertexK0vsMassK0pt1", "Positive V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+      fListHist->Add(fHistDcaPosToPrimVertexK0vsMassK0pt1);
+
+      fHistDcaNegToPrimVertexK0vsMassK0pt1 = new TH2F("h2DcaNegToPrimVertexK0vsMassK0pt1", "Negative V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+      fListHist->Add(fHistDcaNegToPrimVertexK0vsMassK0pt1);
+
+      fHistRadiusV0K0vsMassK0pt1           = new TH2F("h2RadiusV0K0vsMassK0pt1", "Radius;Radius(cm);K0s inv. mass",110,0,110,200,0.4,0.6);
+      fListHist->Add(fHistRadiusV0K0vsMassK0pt1);
+
+      fHistDecayLengthV0K0vsMassK0pt1      = new TH2F("h2DecayLengthV0K0vsMassK0pt1", "V0s decay Length;decay length(cm);K0s inv. mass",100,0,100,200,0.4,0.6);
+      fListHist->Add(fHistDecayLengthV0K0vsMassK0pt1);
+
+      fHistDcaV0DaughtersK0vsMassK0pt1     = new TH2F("h2DcaV0DaughtersK0vsMassK0pt1", "DCA between daughters;dca(cm);K0s inv. mass", 110, 0, 1.1,200,0.4,0.6);
+      fListHist->Add(fHistDcaV0DaughtersK0vsMassK0pt1);
+
+      fHistCosPointAngleK0vsMassK0pt1      = new TH2F("h2CosPointAngleK0vsMassK0pt1", "Cosine of V0's pointing angle", 200,0.997,1.007,200,0.4,0.6);
+      fListHist->Add(fHistCosPointAngleK0vsMassK0pt1);
+
+      /// pt2
+      fHistDcaPosToPrimVertexK0vsMassK0pt2 = new TH2F("h2DcaPosToPrimVertexK0vsMassK0pt2", "Positive V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+      fListHist->Add(fHistDcaPosToPrimVertexK0vsMassK0pt2);
+
+      fHistDcaNegToPrimVertexK0vsMassK0pt2 = new TH2F("h2DcaNegToPrimVertexK0vsMassK0pt2", "Negative V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+      fListHist->Add(fHistDcaNegToPrimVertexK0vsMassK0pt2);
+
+      fHistRadiusV0K0vsMassK0pt2           = new TH2F("h2RadiusV0K0vsMassK0pt2", "Radius;Radius(cm);K0s inv. mass",110,0,110,200,0.4,0.6);
+      fListHist->Add(fHistRadiusV0K0vsMassK0pt2);
+
+      fHistDecayLengthV0K0vsMassK0pt2      = new TH2F("h2DecayLengthV0K0vsMassK0pt2", "V0s decay Length;decay length(cm);K0s inv. mass", 100, 0, 100,200,0.4,0.6);
+      fListHist->Add(fHistDecayLengthV0K0vsMassK0pt2);
+
+      fHistDcaV0DaughtersK0vsMassK0pt2     = new TH2F("h2DcaV0DaughtersK0vsMassK0pt2", "DCA between daughters;dca(cm);K0s inv. mass", 110, 0, 1.1,200,0.4,0.6);
+      fListHist->Add(fHistDcaV0DaughtersK0vsMassK0pt2);
+  
+      fHistCosPointAngleK0vsMassK0pt2      = new TH2F("h2CosPointAngleK0vsMassK0pt2", "Cosine of V0's pointing angle", 200,0.997,1.007,200,0.4,0.6);
+      fListHist->Add(fHistCosPointAngleK0vsMassK0pt2);
+
+      /// pt3
+      fHistDcaPosToPrimVertexK0vsMassK0pt3 = new TH2F("h2DcaPosToPrimVertexK0vsMassK0pt3", "Positive V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+      fListHist->Add(fHistDcaPosToPrimVertexK0vsMassK0pt3);
+
+      fHistDcaNegToPrimVertexK0vsMassK0pt3 = new TH2F("h2DcaNegToPrimVertexK0vsMassK0pt3", "Negative V0 daughter;dca(cm);K0s inv. mass",500,0,10,200,0.4,0.6);
+      fListHist->Add(fHistDcaNegToPrimVertexK0vsMassK0pt3);
+
+      fHistRadiusV0K0vsMassK0pt3           = new TH2F("h2RadiusV0K0vsMassK0pt3", "Radius;Radius(cm);K0s inv. mass",110,0,110,200,0.4,0.6);
+      fListHist->Add(fHistRadiusV0K0vsMassK0pt3);
+
+      fHistDecayLengthV0K0vsMassK0pt3      = new TH2F("h2DecayLengthV0K0vsMassK0pt3", "V0s decay Length;decay length(cm);K0s inv. mass", 100, 0, 100,200,0.4,0.6);
+      fListHist->Add(fHistDecayLengthV0K0vsMassK0pt3);
+
+      fHistDcaV0DaughtersK0vsMassK0pt3     = new TH2F("h2DcaV0DaughtersK0vsMassK0pt3", "DCA between daughters;dca(cm);K0s inv. mass", 110, 0, 1.1,200,0.4,0.6);
+      fListHist->Add(fHistDcaV0DaughtersK0vsMassK0pt3);
+  
+      fHistCosPointAngleK0vsMassK0pt3      = new TH2F("h2CosPointAngleK0vsMassK0pt3", "Cosine of V0's pointing angle", 200,0.997,1.007,200,0.4,0.6);
+      fListHist->Add(fHistCosPointAngleK0vsMassK0pt3);
+  
+  //////////Lambda////////////// 2D histos: cut vs on fly status////
+
+  fHistDcaPosToPrimVertexL      = new TH2F("h2DcaPosToPrimVertexL", "Positive V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
+  fListHist->Add(fHistDcaPosToPrimVertexL);
+
+  fHistDcaNegToPrimVertexL      = new TH2F("h2DcaNegToPrimVertexL", "Negative V0 daughter;dca(cm);Status",100,0,10,2,-0.5,1.5);
+  fListHist->Add(fHistDcaNegToPrimVertexL);
 
-  fHistDcaNegToPrimVertex      = new TH2F("h2DcaNegToPrimVertex", "Negative V0 daughter;dca(cm);Status",500,0,5,2,-0.5,1.5);
-  fListHist->Add(fHistDcaNegToPrimVertex);
 
-  fHistDcaPosToPrimVertexZoom  = new TH2F("h2DcaPosToPrimVertexZoom", "Positive V0 daughter;dca(cm);Status",100,0,0.1,2,-0.5,1.5);
-  fListHist->Add(fHistDcaPosToPrimVertexZoom);
+  fHistRadiusV0L                = new TH2F("h2RadiusV0L", "Radius;Radius(cm);Status",100,0,110,2,-0.5,1.5);
+  fListHist->Add(fHistRadiusV0L);
 
-  fHistDcaNegToPrimVertexZoom  = new TH2F("h2DcaNegToPrimVertexZoom", "Negative V0 daughter;dca(cm);Status",100,0,0.1,2,-0.5,1.5);
-  fListHist->Add(fHistDcaNegToPrimVertexZoom);
+  fHistDecayLengthV0L           = new TH2F("h2DecayLengthV0L", "V0s decay Length;decay length(cm);Status", 500, 0, 500,2,-0.5,1.5);
+  fListHist->Add(fHistDecayLengthV0L);
 
-  fHistRadiusV0                = new TH2F("h2RadiusV0", "Radius;Radius(cm);Status",5000,0,500,2,-0.5,1.5);
-  fListHist->Add(fHistRadiusV0);
+  fHistDcaV0DaughtersL          = new TH2F("h2DcaV0DaughtersL", "DCA between daughters;dca(cm);Status", 300, 0, 3.0,2,-0.5,1.5);
+  fListHist->Add(fHistDcaV0DaughtersL);
 
-  fHistDecayLengthV0           = new TH2F("h2DecayLengthV0", "V0s decay Length;decay length(cm);Status", 240, 0, 120,2,-0.5,1.5);
-  fListHist->Add(fHistDecayLengthV0);
+  fHistChi2L                    = new TH2F("h2Chi2L", "V0s chi2;chi2;Status", 100, 0, 0.10,2,-0.5,1.5);
+  fListHist->Add(fHistChi2L);
 
-  fHistDcaV0Daughters          = new TH2F("h2DcaV0Daughters", "DCA between daughters;dca(cm);Status", 400, 0, 4,2,-0.5,1.5);
-  fListHist->Add(fHistDcaV0Daughters);
+  fHistCosPointAngleL           = new TH2F("h2CosPointAngleL", "Cosine of V0's pointing angle", 200,0.99,1.01,2,-0.5,1.5);
+  fListHist->Add(fHistCosPointAngleL);
 
-  fHistChi2                    = new TH2F("h2Chi2", "V0s chi2;chi2;Status", 33, 0, 33,2,-0.5,1.5);
-  fListHist->Add(fHistChi2);
+  //////////Lambda////////////// 2D histos: cut vs mass////
 
-  fHistCosPointAngle           = new TH2F("h2CosPointAngle", "Cosine of V0's pointing angle", 100,0,1,2,-0.5,1.5);
-  fListHist->Add(fHistCosPointAngle);
+  fHistDcaPosToPrimVertexLvsMassL      = new TH2F("h2DcaPosToPrimVertexLvsMassL", "Positive V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
+  fListHist->Add(fHistDcaPosToPrimVertexLvsMassL);
 
-  fHistCosPointAngleZoom       = new TH2F("h2CosPointAngleZoom", "Cosine of V0's pointing angle", 1000,0.9,1,2,-0.5,1.5);
-  fListHist->Add(fHistCosPointAngleZoom);
+  fHistDcaNegToPrimVertexLvsMassL      = new TH2F("h2DcaNegToPrimVertexLvsMassL", "Negative V0 daughter;dca(cm);Status",100,0,10,140, 1.06, 1.2);
+  fListHist->Add(fHistDcaNegToPrimVertexLvsMassL);
 
-  fHistProdRadius              = new TH2F("h2ProdRadius", "Production position;x (cm);y (cm)", 100,-50,50,100,-50,50);
-  fListHist->Add(fHistProdRadius);
 
-  // V0 Multiplicity:
+  fHistRadiusV0LvsMassL                = new TH2F("h2RadiusV0LvsMassL", "Radius;Radius(cm);Status",110,0,110,140, 1.06, 1.2);
+  fListHist->Add(fHistRadiusV0LvsMassL);
+
+  fHistDecayLengthV0LvsMassL           = new TH2F("h2DecayLengthV0LvsMassL", "V0s decay Length;decay length(cm);Status", 120, 0, 120,140, 1.06, 1.2);
+  fListHist->Add(fHistDecayLengthV0LvsMassL);
+
+  fHistDcaV0DaughtersLvsMassL          = new TH2F("h2DcaV0DaughtersLvsMassL", "DCA between daughters;dca(cm);Status", 110, 0, 1.1,140, 1.06, 1.2);
+  fListHist->Add(fHistDcaV0DaughtersLvsMassL);
+
+  fHistCosPointAngleLvsMassL           = new TH2F("h2CosPointAngleLvsMassL", "Cosine of V0's pointing angle", 200,0.997,1.007,140, 1.06, 1.2);
+  fListHist->Add(fHistCosPointAngleLvsMassL);
+
+
+  // V0 Multiplicity
   if (!fHistV0Multiplicity) {
     if (fCollidingSystems)
       fHistV0Multiplicity = new TH1F("fHistV0Multiplicity", "Multiplicity distribution;Number of Offline V0s;Events", 200, 0, 40000);
@@ -764,22 +882,8 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
     fListHist->Add(fHistV0Multiplicity);
   }
 
-  // Kalman Filter Chi2:
-  fHistChi2KFBeforeCutK0s               = new TH2F("h1Chi2KFBeforeCutK0s", "K^{0}  candidates;#Chi^{2});Counts", 250, 0, 50, 2,-0.5,1.5);
-  fListHist->Add(fHistChi2KFBeforeCutK0s);
-  fHistChi2KFBeforeCutLambda            = new TH2F("h1Chi2KFBeforeCutLambda", "#Lambda^{0}  candidates;#Chi^{2};Counts", 250, 0, 50, 2,-0.5,1.5);
-  fListHist->Add(fHistChi2KFBeforeCutLambda);
-  fHistChi2KFBeforeCutAntiLambda        = new TH2F("h1Chi2KFBeforeCutAntiLambda", "#bar{#Lambda}^{0}  candidates;#Chi^{2};Counts", 250, 0, 50, 2,-0.5,1.5);
-  fListHist->Add(fHistChi2KFBeforeCutAntiLambda);
-
-  fHistChi2KFAfterCutK0s               = new TH2F("h1Chi2KFAfterCutK0s", "K^{0}  candidates;#Chi^{2});Counts", 250, 0, 50, 2,-0.5,1.5);
-  fListHist->Add(fHistChi2KFAfterCutK0s);
-  fHistChi2KFAfterCutLambda            = new TH2F("h1Chi2KFAfterCutLambda", "#Lambda^{0}  candidates;#Chi^{2};Counts", 250, 0, 50, 2,-0.5,1.5);
-  fListHist->Add(fHistChi2KFAfterCutLambda);
-  fHistChi2KFAfterCutAntiLambda        = new TH2F("h1Chi2KFAfterCutAntiLambda", "#bar{#Lambda}^{0} candidates;#Chi^{2};Counts", 250, 0, 50, 2,-0.5,1.5);
-  fListHist->Add(fHistChi2KFAfterCutAntiLambda);
-
-  // Invariant mass:
+
+  // Mass:
   fHistMassK0                   = new TH1F("h1MassK0", "K^{0} candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6);
   fListHist->Add(fHistMassK0);
 
@@ -789,32 +893,41 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistMassAntiLambda           = new TH1F("h1MassAntiLambda", "#bar{#Lambda}^{0} candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
   fListHist->Add(fHistMassAntiLambda);
 
-  // Invariant mass vs. radius:
-  const Double_t radius[10] = {0.0,2.5,2.9,3.9,7.6,15.0,23.9,37.8,42.8,100.0};
-  Int_t lNbinRadius        = 9;
-  Int_t lNbinInvMassLambda = 300;
-
-  fHistMassVsRadiusK0           = new TH2F("h2MassVsRadiusK0", "K^{0} candidates;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, 200, 0.4, 0.6);
+  /*  // invariant mass vs radius
+      const Double_t radius[10] = {0.0,2.5,2.9,3.9,7.6,15.0,23.9,37.8,42.8,100.0};
+      Int_t lNbinRadius        = 9;
+      Int_t lNbinInvMassLambda = 300;
+  */
+  fHistMassVsRadiusK0           = new TH2F("h2MassVsRadiusK0", "K^{0} candidates;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",200,0,200, 200, 0.4, 0.6);
   fListHist->Add(fHistMassVsRadiusK0);
-  
-  fHistMassVsRadiusLambda       = new TH2F("h2MassVsRadiusLambda", "#Lambda candidates;radius (cm);M(p#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, 140, 1.06, 1.2);
+
+  //fHistMassVsRadiusLambda       = new TH2F("h2MassVsRadiusLambda", "#Lambda candidates;radius (cm);M(p#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, 140, 1.06, 1.2);
+  fHistMassVsRadiusLambda       = new TH2F("h2MassVsRadiusLambda", "#Lambda candidates;radius (cm);M(p#pi^{-}) (GeV/c^{2})",200,0,200, 140, 1.06, 1.2);
   fListHist->Add(fHistMassVsRadiusLambda);
 
-  fHistMassVsRadiusAntiLambda   = new TH2F("h2MassVsRadiusAntiLambda", "#bar{#Lambda} candidates;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",lNbinRadius,radius, 140, 1.06, 1.2);
+
+  //fHistMassVsRadiusAntiLambda   = new TH2F("h2MassVsRadiusAntiLambda", "#bar{#Lambda} candidates;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",lNbinRadius,radius, 140, 1.06, 1.2);
+  fHistMassVsRadiusAntiLambda   = new TH2F("h2MassVsRadiusAntiLambda", "#bar{#Lambda} candidates;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",200,0,200, 140, 1.06, 1.2);
   fListHist->Add(fHistMassVsRadiusAntiLambda);
 
-  // Pt vs. mass:
+
+  // Pt Vs Mass
   fHistPtVsMassK0               = new TH2F("h2PtVsMassK0","K^{0} candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",200, 0.4, 0.6,240,0,12);
   fListHist->Add(fHistPtVsMassK0);
 
   fHistPtVsMassLambda           = new TH2F("h2PtVsMassLambda","#Lambda^{0} candidates;M(p#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",140, 1.06, 1.2,240,0,12);
   fListHist->Add(fHistPtVsMassLambda);
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+  ///Armenteros Podolansky
   fHistArmenterosPodolanski     = new TH2F("h2ArmenterosPodolanski","Armenteros-Podolanski phase space;#alpha;p_{t} arm",100,-1.0,1.0,50,0,0.5);
   fListHist->Add(fHistArmenterosPodolanski);
 
+  ///Inv. Mass K0s vs Inv. Mass. Lambda
+  fHistK0sMassVsLambdaMass      = new TH2F("h2HistK0sMassVsLambdaMass","K^{0} vs #Lambda^{0} candidates; M(#pi^{+}#pi^{-}) (GeV/c^{2}); M(p#pi^{-}) (GeV/c^{2})",200, 0.4, 0.6,140, 1.06, 1.2);
+  fListHist->Add(fHistK0sMassVsLambdaMass);
 
-  // PID histograms:
+  //PID
   fHistNsigmaPosPionAntiLambda   = new TH1F("h1NsigmaPosPionAntiLambda", "Positive daughter of Antilambda;NsigmaPion;Counts",25,0,5);
   fListHist->Add(fHistNsigmaPosPionAntiLambda);
 
@@ -833,11 +946,12 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistNsigmaNegPionK0           = new TH1F("h1NsigmaNegPionK0", "Negative daughter of K0s;NsigmaPion;Counts",25,0,5);
   fListHist->Add(fHistNsigmaNegPionK0);
 
+
   //********************************
-  // Associated particle histograms
+  // Associated particles histograms
   //********************************
 
-  // Rapidity distribution:
+  // Rap distribution
   fHistAsMcRapK0                = new TH1F("h1AsMcRapK0", "K^{0} associated;eta;Counts", 60, -1.5, 1.5);
   fListHist->Add(fHistAsMcRapK0);
 
@@ -847,7 +961,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistAsMcRapAntiLambda        = new TH1F("h1AsMcRapAntiLambda", "#bar{#Lambda}^{0} associated;eta;Counts", 60, -1.5, 1.5);
   fListHist->Add(fHistAsMcRapAntiLambda);
 
-  //Pt distribution:
+  //Pt distribution
   fHistAsMcPtK0                = new TH1F("h1AsMcPtK0", "K^{0} associated;p_{t} (GeV/c);Counts", 240,0,12);
   fListHist->Add(fHistAsMcPtK0);
 
@@ -860,7 +974,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistAsMcPtZoomLambda        = new TH1F("h1AsMcPtZoomLambda", "#Lambda^{0} candidates in -1 <y<1;p_{t} (GeV/c);Counts",20,0,1);
   fListHist->Add(fHistAsMcPtZoomLambda);
 
-  // Radius distribution:
+  // Radius distribution
   fHistAsMcProdRadiusK0               = new TH1F("h1AsMcProdRadiusK0", "K^{0} associated;r (cm);Counts", 500, 0, 100);
   fListHist->Add(fHistAsMcProdRadiusK0);
 
@@ -870,7 +984,6 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistAsMcProdRadiusAntiLambda       = new TH1F("h1AsMcProdRadiusAntiLambda", "#bar{#Lambda}^{0} associated;r (cm);Counts", 500, 0, 100);
   fListHist->Add(fHistAsMcProdRadiusAntiLambda);
 
-  // Radius distribution vs. rapidity:
   fHistAsMcProdRadiusXvsYK0s          = new TH2F("h2AsMcProdRadiusXvsYK0s","Associated Secondary K^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
   fListHist->Add(fHistAsMcProdRadiusXvsYK0s);
 
@@ -880,7 +993,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistAsMcProdRadiusXvsYAntiLambda   = new TH2F("h2AsMcProdRadiusXvsYAntiLambda","Associated Secondary #bar{#Lambda}^{0} Production Radius;x (cm); y (cm)",200,-50,50,200,-50,50);
   fListHist->Add(fHistAsMcProdRadiusXvsYAntiLambda);
 
-  // Invariant mass distribution with PID checked:
+  // Mass
   fHistPidMcMassK0             = new TH1F("h1PidMcMassK0", "K^{0} MC PId checked;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6);
   fListHist->Add(fHistPidMcMassK0);
 
@@ -890,7 +1003,6 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistPidMcMassAntiLambda     = new TH1F("h1PidMcMassAntiLambda", "#bar{#Lambda}^{0} MC PId checked;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
   fListHist->Add(fHistPidMcMassAntiLambda);
 
-  // Invariant mass distribution:
   fHistAsMcMassK0              = new TH1F("h1AsMcMassK0", "K^{0} associated;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6);
   fListHist->Add(fHistAsMcMassK0);
   
@@ -900,7 +1012,7 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistAsMcMassAntiLambda      = new TH1F("h1AsMcMassAntiLambda", "#bar{#Lambda}^{0} associated;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2);
   fListHist->Add(fHistAsMcMassAntiLambda);
 
-  // Pt vs. invariant mass:
+  //Pt versus Mass
   fHistAsMcPtVsMassK0               = new TH2F("h2AsMcPtVsMassK0","K^{0} associated;M(#pi^{+}#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",200, 0.4, 0.6,240,0,12);
   fListHist->Add(fHistAsMcPtVsMassK0);
 
@@ -911,103 +1023,104 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fListHist->Add(fHistAsMcPtVsMassAntiLambda);
 
 
-  // Invariant mass vs. radius:
-  fHistAsMcMassVsRadiusK0             = new TH2F("h2AsMcMassVsRadiusK0", "K^{0} associated;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, 500, 0.47, 0.52);
+  // invariant mass vs radius
+  //fHistAsMcMassVsRadiusK0             = new TH2F("h2AsMcMassVsRadiusK0", "K^{0} associated;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, 500, 0.47, 0.52);
+  fHistAsMcMassVsRadiusK0             = new TH2F("h2AsMcMassVsRadiusK0", "K^{0} associated;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",200,0,200, 500, 0.47, 0.52);
   fListHist->Add(fHistAsMcMassVsRadiusK0);
-  
-  fHistAsMcMassVsRadiusLambda         = new TH2F("h2AsMcMassVsRadiusLambda", "#Lambda associated;radius (cm);M(p#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, lNbinInvMassLambda, 1.10, 1.13);
+
+  //fHistAsMcMassVsRadiusLambda         = new TH2F("h2AsMcMassVsRadiusLambda", "#Lambda associated;radius (cm);M(p#pi^{-}) (GeV/c^{2})",lNbinRadius,radius, lNbinInvMassLambda, 1.10, 1.13);
+  fHistAsMcMassVsRadiusLambda         = new TH2F("h2AsMcMassVsRadiusLambda", "#Lambda associated;radius (cm);M(p#pi^{-}) (GeV/c^{2})",200,0,200, 1.10, 1.13);
   fListHist->Add(fHistAsMcMassVsRadiusLambda);
 
-  fHistAsMcMassVsRadiusAntiLambda     = new TH2F("h2AsMcMassVsRadiusAntiLambda", "#bar{#Lambda} associated;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",lNbinRadius,radius,lNbinInvMassLambda , 1.10, 1.13);
+  //fHistAsMcMassVsRadiusAntiLambda     = new TH2F("h2AsMcMassVsRadiusAntiLambda", "#bar{#Lambda} associated;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",lNbinRadius,radius,lNbinInvMassLambda , 1.10, 1.13);
+  fHistAsMcMassVsRadiusAntiLambda     = new TH2F("h2AsMcMassVsRadiusAntiLambda", "#bar{#Lambda} associated;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",200,0,200 , 1.10, 1.13);
   fListHist->Add(fHistAsMcMassVsRadiusAntiLambda);
   
-  // Position resolution for K0s:
+  // Position Resolution
   fHistAsMcResxK0                     = new TH1F("h1AsMcResxK0", "K^{0} associated;#Delta x (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResxK0);
   fHistAsMcResyK0                     = new TH1F("h1AsMcResyK0", "K^{0} associated;#Delta y (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResyK0);
   fHistAsMcReszK0                     = new TH1F("h1AsMcReszK0", "K^{0} associated;#Delta z (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcReszK0);
-
-  // Position resolution vs. radius for K0s:
   fHistAsMcResrVsRadiusK0             = new TH2F("h2AsMcResrVsRadiusK0", "K^{0} associated;Radius (cm);#Delta r (cm)",200,0.0,50., 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResrVsRadiusK0);
   fHistAsMcReszVsRadiusK0             = new TH2F("h2AsMcReszVsRadiusK0", "K^{0} associated;Radius (cm);#Delta z (cm)",200,0.0,50.0, 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcReszVsRadiusK0);
 
-  // Position resolution for Lambda:
   fHistAsMcResxLambda                 = new TH1F("h1AsMcResxLambda", "#Lambda^{0} associated;#Delta x (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResxLambda);
   fHistAsMcResyLambda                 = new TH1F("h1AsMcResyLambda", "#Lambda^{0} associated;#Delta y (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResyLambda);
   fHistAsMcReszLambda                 = new TH1F("h1AsMcReszLambda", "#Lambda^{0} associated;#Delta z (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcReszLambda);
-
-  // Position resolution vs. radius for Lambda:
   fHistAsMcResrVsRadiusLambda         = new TH2F("h2AsMcResrVsRadiusLambda", "#Lambda^{0} associated;Radius (cm);#Delta r (cm)",200,0.0,50.0, 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResrVsRadiusLambda);
   fHistAsMcReszVsRadiusLambda         = new TH2F("h2AsMcReszVsRadiusLambda", "#Lambda^{0} associated;Radius (cm);#Delta z (cm)",200,0.0,50.0, 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcReszVsRadiusLambda);
 
-  // Position resolution for anti-Lambda:
   fHistAsMcResxAntiLambda             = new TH1F("h1AsMcResxAntiLambda", "#bar{#Lambda}^{0} associated;#Delta x (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResxAntiLambda);
   fHistAsMcResyAntiLambda             = new TH1F("h1AsMcResyAntiLambda", "#bar{#Lambda}^{0} associated;#Delta y (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResyAntiLambda);
   fHistAsMcReszAntiLambda             = new TH1F("h1AsMcReszAntiLambda", "#bar{#Lambda}^{0} associated;#Delta z (cm);Counts", 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcReszAntiLambda);
-
-  // Position resolution vs. radius for anti-Lambda:
   fHistAsMcResrVsRadiusAntiLambda     = new TH2F("h2AsMcResrVsRadiusAntiLambda", "#bar{#Lambda}^{0} associated;Radius (cm);#Delta r (cm)",200,0.0,50.0, 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcResrVsRadiusAntiLambda);
   fHistAsMcReszVsRadiusAntiLambda     = new TH2F("h2AsMcReszVsRadiusAntiLambda", "#bar{#Lambda}^{0} associated;Radius (cm);#Delta z (cm)",200,0.0,50.0, 50, -0.25, 0.25);
   fListHist->Add(fHistAsMcReszVsRadiusAntiLambda);
 
-  // Pt Resolution:
+  // Pt Resolution
   fHistAsMcResPtK0                   = new TH1F("h1AsMcResPtK0","Pt Resolution K^{0};#Delta Pt;Counts",200,-1,1);
   fListHist->Add(fHistAsMcResPtK0);
+  
   fHistAsMcResPtLambda               = new TH1F("h1AsMcResPtLambda","Pt Resolution #Lambda^{0};#Delta Pt;Counts",200,-1,1);
   fListHist->Add(fHistAsMcResPtLambda);
+
   fHistAsMcResPtAntiLambda           = new TH1F("h1AsMcResPtAntiLambda","Pt Resolution #bar{#Lambda}^{0};#Delta Pt;Counts",200,-1,1);
   fListHist->Add(fHistAsMcResPtAntiLambda);
 
-  // Pt Resolution vs. rapidity:
+
   fHistAsMcResPtVsRapK0              = new TH2F("h2AsMcResPtVsRapK0","Pt Resolution K^{0};#Delta Pt;Rap",200,-1,1,20,-1,1);
   fListHist->Add(fHistAsMcResPtVsRapK0);
+  
   fHistAsMcResPtVsRapLambda          = new TH2F("h2AsMcResPtVsRapLambda","Pt Resolution #Lambda^{0};#Delta Pt;Rap",200,-1,1,20,-1,1);
   fListHist->Add(fHistAsMcResPtVsRapLambda);
+
   fHistAsMcResPtVsRapAntiLambda      = new TH2F("h2AsMcResPtVsRapAntiLambda","Pt Resolution #bar{#Lambda}^{0};#Delta Pt;Rap",200,-1,1,20,-1,1);
   fListHist->Add(fHistAsMcResPtVsRapAntiLambda);
 
-  // Pt Resolution vs. Pt:
   fHistAsMcResPtVsPtK0               = new TH2F("h2AsMcResPtVsPtK0","Pt Resolution K^{0};#Delta Pt;Pt",600,-0.15,0.15,240,0,12);
   fListHist->Add(fHistAsMcResPtVsPtK0);
+    
   fHistAsMcResPtVsPtLambda           = new TH2F("h2AsMcResPtVsPtLambda","Pt Resolution #Lambda^{0};#Delta Pt;Pt",600,-0.15,0.15,240,0,12);
   fListHist->Add(fHistAsMcResPtVsPtLambda);
+
   fHistAsMcResPtVsPtAntiLambda       = new TH2F("h2AsMcResPtVsPtAntiLambda","Pt Resolution #bar{#Lambda}^{0};#Delta Pt;Pt",300,-0.15,0.15,240,0,12);
   fListHist->Add(fHistAsMcResPtVsPtAntiLambda);
 
-  // Pdg code of mother particle:
+  // pdgcode of mother
   fHistAsMcMotherPdgCodeK0s           = new TH1F("h1AsMcMotherPdgCodeK0s","Mother of Associated K^{0};mother;counts",11,0,11);
   fListHist->Add(fHistAsMcMotherPdgCodeK0s);
+
   fHistAsMcMotherPdgCodeLambda        = new TH1F("h1AsMcMotherPdgCodeLambda","Mother of Associated #Lambda^{0};mother;counts",11,0,11);
   fListHist->Add(fHistAsMcMotherPdgCodeLambda);
+
   fHistAsMcMotherPdgCodeAntiLambda    = new TH1F("h1AsMcMotherPdgCodeAntiLambda","Mother of Associated #bar{#Lambda}^{0};mother;counts",11,0,11);
   fListHist->Add(fHistAsMcMotherPdgCodeAntiLambda);
 
-  // Pt distribution of Lambda <- Sigma decay
+  // Pt distribution Lambda from Sigma
   fHistAsMcPtLambdaFromSigma          = new TH1F("h1AsMcPtLambdaFromSigma","#Lambda}^{0} associated from Sigma;p_{t} (GeV/c);Count",240,0,12);
   fListHist->Add(fHistAsMcPtLambdaFromSigma);
+
   fHistAsMcPtAntiLambdaFromSigma      = new TH1F("h1AsMcPtAntiLambdaFromSigma","#bar{#Lambda}^{0} associated from Sigma;p_{t} (GeV/c);Count",240,0,12);
   fListHist->Add(fHistAsMcPtAntiLambdaFromSigma);
 
-  //*******************************************
-  // Associated secondary particles histograms
-  //*******************************************
-
-  // Pt vs. rapidity distribution:
+  // Associated secondary particles:
+  // Pt and rapidity distribution
   fHistAsMcSecondaryPtVsRapK0s          = new TH2F("h2AsMcSecondaryPtVsRapK0s", "K^{0} associated secondary;p_{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
   fListHist->Add(fHistAsMcSecondaryPtVsRapK0s);
+
   fHistAsMcSecondaryPtVsRapLambda       = new TH2F("h2AsMcSecondaryPtVsRapLambda", "#Lambda^{0} associated secondary;p_{t} (GeV/c);rapidity",240,0,12,30,-1.5,1.5);
   fListHist->Add(fHistAsMcSecondaryPtVsRapLambda);
 
@@ -1024,30 +1137,33 @@ void AliAnalysisTaskPerformanceStrange::UserCreateOutputObjects()
   fHistAsMcSecondaryProdRadiusAntiLambda       = new TH1F("h1AsMcSecondaryProdRadiusAntiLambda", "#bar{#Lambda}^{0} Production Radius;r (cm);Count", 170, -2, 15);
   fListHist->Add(fHistAsMcSecondaryProdRadiusAntiLambda);  
 
-  // Production radius vs. rapidity:
   fHistAsMcSecondaryProdRadiusXvsYK0s          = new TH2F("h2AsMcSecondaryProdRadiusXvsYK0s","Associated Secondary K^{0} Production Radius;x (cm); y (cm)",200,-20,20,200,-20,20);
   fListHist->Add(fHistAsMcSecondaryProdRadiusXvsYK0s);
+
   fHistAsMcSecondaryProdRadiusXvsYLambda       = new TH2F("h2AsMcSecondaryProdRadiusXvsYLambda","Associated Secondary #Lambda^{0} Production Radius;x (cm); y (cm)",200,-20,20,200,-20,20);
   fListHist->Add(fHistAsMcSecondaryProdRadiusXvsYLambda);
+
   fHistAsMcSecondaryProdRadiusXvsYAntiLambda   = new TH2F("h2AsMcSecondaryProdRadiusXvsYAntiLambda","Associated Secondary #bar{#Lambda}^{0} Production Radius;x (cm); y (cm)",200,-20,20,200,-20,20);
   fListHist->Add(fHistAsMcSecondaryProdRadiusXvsYAntiLambda);
 
-  // Pdg code of mother particle for secondary V0s:
   fHistAsMcSecondaryMotherPdgCodeK0s           = new TH1F("h1AsMcSecondaryMotherPdgCodeK0s","Mother of Associated Secondary K^{0};mother;counts",11,0,11);
   fListHist->Add(fHistAsMcSecondaryMotherPdgCodeK0s);
+
   fHistAsMcSecondaryMotherPdgCodeLambda        = new TH1F("h1AsMcSecondaryMotherPdgCodeLambda","Mother of Associated Secondary #Lambda^{0};mother;counts",11,0,11);
   fListHist->Add(fHistAsMcSecondaryMotherPdgCodeLambda);
+
   fHistAsMcSecondaryMotherPdgCodeAntiLambda    = new TH1F("h1AsMcSecondaryMotherPdgCodeAntiLambda","Mother of Associated Secondary #bar{#Lambda}^{0};mother;counts",11,0,11);
   fListHist->Add(fHistAsMcSecondaryMotherPdgCodeAntiLambda);
 
-  // Pt distribution of secondary Lambda <- Sigma decay:
+  // Pt distribution Lambda from Sigma
   fHistAsMcSecondaryPtLambdaFromSigma          = new TH1F("h1AsMcSecondaryPtLambdaFromSigma","#Lambda}^{0} associated from Sigma;p_{t} (GeV/c);Count",240,0,12);
   fListHist->Add(fHistAsMcSecondaryPtLambdaFromSigma);
+
   fHistAsMcSecondaryPtAntiLambdaFromSigma      = new TH1F("h1AsMcSecondaryPtAntiLambdaFromSigma","#bar{#Lambda}^{0} associated from Sigma;p_{t} (GeV/c);Count",240,0,12);
   fListHist->Add(fHistAsMcSecondaryPtAntiLambdaFromSigma);
-
   PostData(1, fListHist);
   PostData(2, fCentrSelector);
+  PostData(3, fTracksCuts);
 }
 
 //________________________________________________________________________
@@ -1057,7 +1173,7 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   // Called for each event
 
   AliStack* stack = NULL;
-  TClonesArray *mcArray = NULL;
+  //  TClonesArray *mcArray = NULL;
   TArrayF mcPrimaryVtx;
 
   fESD=(AliESDEvent *)InputEvent();
@@ -1069,54 +1185,52 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
 
   // FIXME: levent not used. Can I remove it?
   AliVEvent* lEvent = InputEvent();
-  
+
   if (!lEvent) {
     Printf("ERROR: Event not available");
     return;
   }
 
-  fHistNumberEvents->Fill(0.5);
-
   //******************
   // Trigger Selection ! Warning Works only for ESD, add protection in case of AOD loop
   //******************
 
-  Bool_t isSelected = 
-    (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() 
+  Bool_t isSelected =
+    (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()
      & AliVEvent::kMB);
   if (!isSelected) return;
-  
+
   // Centrality selection
   static AliESDtrackCuts * trackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(); // FIXME: make it a data member
-  Bool_t isCentralitySelected = fCentrSelector->IsCentralityBinSelected(fESD,trackCuts); 
+  //   printf("%x, %x", fCentrSelector, trackCuts);
+  Bool_t isCentralitySelected = fCentrSelector->IsCentralityBinSelected(fESD,trackCuts);
   if(!isCentralitySelected) return;
   // FIXME: add to hist number events another entry for centrality.
 
- // Done by the AliPhysicsSelection Task ! Only the selected events are passed to this task
+  // Done by the AliPhysicsSelection Task ! Only the selected events are passed to this task
 
-  fHistNumberEvents->Fill(1.5); // FIXME: use enum here
 
+  fHistNumberEvents->Fill(1.5);  // FIXME: use enum here
 
   //*************************
   //End track multiplicity
   //*************************
 
-
   // Remove Events with no tracks
   //if (!(fESD->GetNumberOfTracks()))  return;
 
   fHistNumberEvents->Fill(2.5);
-  fHistTrackPerEvent->Fill(fESD->GetNumberOfTracks());
+  //  fHistTrackPerEvent->Fill(fESD->GetNumberOfTracks());
 
   //*************************************
   // Cut used:
   //*************************************
-  // FIXME: Create a cut object, to be configured in the steering macro and to be streamed in the output to reference those cuts
+      
   // Cut Rapidity:
   Double_t lCutRap  = 0.75;
 
   // Cut AliKF Chi2 for Reconstructed particles
-  Double_t cutChi2KF  = 1E3;
+  //  Double_t cutChi2KF  = 1E3;
 
   // If PID is used:
   Double_t lLimitPPID    = 0.7;
@@ -1135,12 +1249,12 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   Double_t cutPrimVertex = 10.0;
 
   // Min number of TPC clusters:
-  Int_t nbMinTPCclusters = 80;
+  // Int_t nbMinTPCclusters = 80;
 
   //*******************
   // PID parameters:
   //*******************
-  // FIXME: OADB or momber TFormula?
+      
   Double_t fAlephParameters[5] = {0,0,0,0,0,};
 
   fAlephParameters[0] = 0.0283086;
@@ -1153,7 +1267,6 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   //*******************
   // Access MC:
   //*******************
-  // FIXME:: move this two branches directly in the loops below
   if (fAnalysisMC) {
     if(fAnalysisType == "ESD") {
       AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
@@ -1178,26 +1291,8 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
       
     }
     
-    else if(fAnalysisType == "AOD") {
-      
-      // load MC particles
-      mcArray = (TClonesArray*)fESD->GetList()->FindObject(AliAODMCParticle::StdBranchName());
-      if(!mcArray) {
-       Printf("strange analysis::UserExec: MC particles branch not found!\n");
-       return;
-      }
-      
-      // load MC header
-      AliAODMCHeader *mcHeader = 
-       (AliAODMCHeader*)fESD->GetList()->FindObject(AliAODMCHeader::StdBranchName());
-      if(!mcHeader) {
-       Printf("strange analysis::UserExec: MC header branch not found!\n");
-       return;
-      }
-    }
 
     // PID parameters for MC simulations:
-    // FIXME: set above, with the others
     fAlephParameters[0] = 2.15898e+00/50.;
     fAlephParameters[1] = 1.75295e+01;
     fAlephParameters[2] = 3.40030e-09;
@@ -1231,7 +1326,7 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
 
   // current mc particle 's mother
   Int_t iCurrentMother  = 0, lPdgCurrentMother    = 0;
-  Bool_t lCurrentMotherIsPrimary;
+  //  Bool_t lCurrentMotherIsPrimary;
 
   // current mc particles 's daughter:
   Int_t lPdgCurrentDaughter0 = 0, lPdgCurrentDaughter1 = 0; 
@@ -1242,7 +1337,7 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   //Int_t lPartNMother  = 0, lPartPMother = 0;
   //Int_t lPartPMotherPDGcode      = 0;
   Int_t lNtimesReconstructedK0s   = 0, lNtimesReconstructedLambda   = 0, lNtimesReconstructedAntiLambda   = 0;
- // Int_t lNtimesReconstructedK0sMI = 0, lNtimesReconstructedLambdaMI = 0, lNtimesReconstructedAntiLambdaMI = 0;
+  // Int_t lNtimesReconstructedK0sMI = 0, lNtimesReconstructedLambdaMI = 0, lNtimesReconstructedAntiLambdaMI = 0;
 
   //****************************
   // Start loop over MC particles
@@ -1255,10 +1350,10 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
     
     lmcPrimVtxR = TMath::Sqrt(mcPrimaryVtx.At(0)*mcPrimaryVtx.At(0)+mcPrimaryVtx.At(1)*mcPrimaryVtx.At(1));
   
-    // FIXME: move these loops to other functions, for better readibility?
+
     if(fAnalysisType == "ESD") {
       
-      lNbMCPrimary = stack->GetNprimary(); // FIXME: This does not correspond to our definition of primaries, but maybe it is ok for strange particles
+      lNbMCPrimary = stack->GetNprimary();
       lNbMCPart    = stack->GetNtrack();
       
       fHistMCMultiplicityPrimary->Fill(lNbMCPrimary);
@@ -1279,10 +1374,9 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
        lRapCurrentPart   = MyRapidity(p0->Energy(),p0->Pz());
        //lEtaCurrentPart   = p0->Eta();
        lPtCurrentPart    = p0->Pt();
-
        iCurrentMother    = p0->GetFirstMother();
 
-//     lPdgCurrentMother = stack->Particle(iCurrentMother)->GetPdgCode();
+       //      lPdgCurrentMother = stack->Particle(iCurrentMother)->GetPdgCode();
        if (iCurrentMother == -1){lPdgCurrentMother=0; } else {lPdgCurrentMother = stack->Particle(iCurrentMother)->GetPdgCode();}      
 
        mcPosX = p0->Vx();
@@ -1293,7 +1387,7 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
        id0  = p0->GetDaughter(0);
        id1  = p0->GetDaughter(1);
 
-       // Decay Radius
+       // Decay Radius and Production Radius
        if ( id0 <= lNbMCPart && id0 > 0 && id1 <= lNbMCPart && id1 > 0) {
          TParticle *pDaughter0 = stack->Particle(id0);
          TParticle *pDaughter1 = stack->Particle(id1);
@@ -1305,12 +1399,10 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
          mcDecayPosR = TMath::Sqrt(mcDecayPosX*mcDecayPosX+mcDecayPosY*mcDecayPosY);
        }
        else  {
-         //FIXME: shouldn't this be a fatal?
          //Printf("ERROR: particle with label %d and/or %d not found in stack (mc loop)", id0,id1);
          mcDecayPosR = -1.0;
        }
-       // FIXME using array of histos and conversion PDGCode -> enum would make this much easier to read
-       // We could also have a function FillMcHistos (pos, radius, rap...) which we call from both the AOD and ESD loops
+       
        if (lPdgcodeCurrentPart==310)   {
          fHistMCtracksProdRadiusK0s->Fill(mcPosX,mcPosY);
          fHistMCtracksDecayRadiusK0s->Fill(mcDecayPosR);
@@ -1327,7 +1419,6 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
          if (TMath::Abs(lRapCurrentPart) < lCutRap) fHistMCPtAllAntiLambda->Fill(lPtCurrentPart);
        }
        
-         // FIXME: not sure if I understand this: is it correct? (definition of primaries)
        if ( ( ( TMath::Abs(lPdgCurrentMother) == 3212)  ||
               ( TMath::Abs(lPdgCurrentMother) == 3224)  ||
               ( TMath::Abs(lPdgCurrentMother) == 3214)  ||
@@ -1341,51 +1432,10 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
        if ( ( iMc > lNbMCPrimary ) && (!lComeFromSigma) ) continue;
 
        //********************************************
-       //check if V0 is reconstructed several times  
      
        lNtimesReconstructedK0s   = 0; lNtimesReconstructedLambda   = 0; lNtimesReconstructedAntiLambda   = 0;
 
-       //for (Int_t jV0 = 0; jV0 < fESD->GetNumberOfV0s(); jV0++) {
-       
-       //lLabelTrackN  = 0; lLabelTrackP = 0;
-       //lPartNMother  = 0; lPartPMother = 0;
-       
-       //AliESDv0    *vertexESD = ((AliESDEvent*)fESD)->GetV0(jV0);
-       //if (!vertexESD) continue;
-       
-       //AliESDtrack *trackNESD = ((AliESDEvent*)fESD)->GetTrack(TMath::Abs(vertexESD->GetNindex()));
-       //lLabelTrackN = (UInt_t)TMath::Abs(trackNESD->GetLabel());
-       //if (lLabelTrackN!=id0 && lLabelTrackN!=id1) continue;
-       
-       //AliESDtrack *trackPESD = ((AliESDEvent*)fESD)->GetTrack(TMath::Abs(vertexESD->GetPindex()));
-       //lLabelTrackP = (UInt_t)TMath::Abs(trackPESD->GetLabel());
-       //if (lLabelTrackP!=id0 && lLabelTrackP!=id1) continue;
-       
-       //TParticle   *lPartNESD = stack->Particle(lLabelTrackN);
-       //TParticle   *lPartPESD = stack->Particle(lLabelTrackP);
-       //lPartNMother = lPartNESD->GetFirstMother();
-       //lPartPMother = lPartPESD->GetFirstMother();
-       
-       //lPartPMotherPDGcode = stack->Particle(lPartPMother)->GetPdgCode();
-       
-       //switch (vertexESD->GetOnFlyStatus()){
-       
-       //case 0 : 
-       //if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==310) ) lNtimesReconstructedK0s++;
-       //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==3122) ) lNtimesReconstructedLambda++;
-       //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==-3122) ) lNtimesReconstructedAntiLambda++;
-       //break;
-       
-       //case 1 :
-       //if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==310) ) lNtimesReconstructedK0sMI++;
-       //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==3122) ) lNtimesReconstructedLambdaMI++;
-       //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==-3122) ) lNtimesReconstructedAntiLambdaMI++;
-       //break;
-       
-       //}     
-       //} // end loop over reconstructed V0s inside MC loop
-       
-       // FIXME: same comemtn for array of histos
         // Rap distribution
         if (lPdgcodeCurrentPart==310) {
          fHistMCRapK0s->Fill(lRapCurrentPart);
@@ -1425,204 +1475,48 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
 
          fHistMCPtK0s->Fill(lPtCurrentPart);
 
+
+
          fHistNTimesRecK0s->Fill(lNtimesReconstructedK0s);
          fHistNTimesRecK0sVsPt->Fill(lPtCurrentPart,lNtimesReconstructedK0s);
        }
        else 
-       if (lPdgcodeCurrentPart==3122) {
-         fHistMCProdRadiusLambda->Fill(mcPosR);
+         if (lPdgcodeCurrentPart==3122) {
+           fHistMCProdRadiusLambda->Fill(mcPosR);
+
+           fHistMCPtLambda->Fill(lPtCurrentPart);        
 
-         fHistMCPtLambda->Fill(lPtCurrentPart);          
 
+           fHistNTimesRecLambda->Fill(lNtimesReconstructedLambda);
+           fHistNTimesRecLambdaVsPt->Fill(lPtCurrentPart,lNtimesReconstructedLambda);
+           if (lComeFromSigma) fHistMCPtLambdaFromSigma->Fill(lPtCurrentPart);
 
-         fHistNTimesRecLambda->Fill(lNtimesReconstructedLambda);
-         fHistNTimesRecLambdaVsPt->Fill(lPtCurrentPart,lNtimesReconstructedLambda);
-         if (lComeFromSigma) fHistMCPtLambdaFromSigma->Fill(lPtCurrentPart);
-         //printf("found Lambda MC pT=%e\n",lPtCurrentPart);
-         //printf("found Lambda MC Plabel=%d PPDGcode=%d Nlabel=%d NPDGcode=%d\n\n",id0,lPdgCurrentDaughter0,id1,lPdgCurrentDaughter1); 
+           //printf("found Lambda MC pT=%e\n",lPtCurrentPart);
+           //printf("found Lambda MC Plabel=%d PPDGcode=%d Nlabel=%d NPDGcode=%d\n\n",id0,lPdgCurrentDaughter0,id1,lPdgCurrentDaughter1); 
          
-       }
+         }
+
        
       } // end loop ESD MC
       
     } // end ESD condition
 
-    // FIXME: I skipped the AOD loop
-    else if(fAnalysisType == "AOD") {
-      lNbMCPart = mcArray->GetEntriesFast();
-      lNbMCPrimary = 0;
-      
-      fHistMCMultiplicityTracks->Fill(lNbMCPart);
-      
-      for (Int_t iMc = 0; iMc < lNbMCPart; iMc++) {  
-       
-       // Primary vertex TO DO !!
-       //
-       
-       AliAODMCParticle *mcAODPart = (AliAODMCParticle*)mcArray->At(iMc);
-       if (!mcAODPart) {
-         //Printf("Strange analysis task (mc loop): particle with label %d not found", iMc);
-         continue;
-       }
-       lPdgcodeCurrentPart = mcAODPart->GetPdgCode();
-       if (mcAODPart->IsPhysicalPrimary()) {lNbMCPrimary = lNbMCPrimary +1;}
-       
-       // Keep only K0s, Lambda and AntiLambda:
-       if ( (lPdgcodeCurrentPart != 310 ) && (lPdgcodeCurrentPart != 3122 ) && (lPdgcodeCurrentPart != -3122 ) ) continue;
-       
-       //lEtaCurrentPart   = mcAODPart->Eta();
-       lRapCurrentPart   = mcAODPart->Y();
-       lPtCurrentPart    = mcAODPart->Pt();
-       iCurrentMother    = mcAODPart->GetMother();
-       lPdgCurrentMother = ((AliAODMCParticle*)mcArray->At(iCurrentMother))->GetPdgCode();
-       lCurrentMotherIsPrimary = ((AliAODMCParticle*)mcArray->At(iCurrentMother))->IsPhysicalPrimary();
-       
-       mcPosX = mcAODPart->Xv();
-       mcPosY = mcAODPart->Yv();
-       mcPosZ = mcAODPart->Zv();
-       mcPosR = TMath::Sqrt(mcPosX*mcPosX+mcPosY*mcPosY);
-       
-       id0  = mcAODPart->GetDaughter(0);
-       id1  = mcAODPart->GetDaughter(1);
-       
-       // Decay Radius and Production Radius
-       if ( id0 <= lNbMCPart && id0 > 0 && id1 <= lNbMCPart && id1 > 0) {
-         AliAODMCParticle *mcAODDaughter1 = (AliAODMCParticle*)mcArray->At(id1);
-         if (!mcAODPart) {
-           //Printf("Strange analysis task (mc loop): daughter not found");
-           continue;
-         }
-         mcDecayPosX = mcAODDaughter1->Xv();
-         mcDecayPosY = mcAODDaughter1->Yv();
-         mcDecayPosR = TMath::Sqrt(mcDecayPosX*mcDecayPosX+mcDecayPosY*mcDecayPosY);
-       }
-       else  {
-         //Printf("ERROR: particle with label %d and/or %d not found in stack (mc loop)", id0,id1);
-         mcDecayPosR = -1.0;
-       }
-       
-       if (lPdgcodeCurrentPart==310)   {
-         fHistMCtracksProdRadiusK0s->Fill(mcPosX,mcPosY);
-         fHistMCtracksDecayRadiusK0s->Fill(mcDecayPosR);
-         if (TMath::Abs(lRapCurrentPart) < lCutRap) fHistMCPtAllK0s->Fill(lPtCurrentPart);
-       }
-       else if (lPdgcodeCurrentPart==3122)  {
-         fHistMCtracksProdRadiusLambda->Fill(mcPosX,mcPosY);
-         fHistMCtracksDecayRadiusLambda->Fill(mcDecayPosR);
-         if (TMath::Abs(lRapCurrentPart) < lCutRap) fHistMCPtAllLambda->Fill(lPtCurrentPart);
-       }
-       else if (lPdgcodeCurrentPart==-3122) {
-         fHistMCtracksProdRadiusAntiLambda->Fill(mcPosX,mcPosY);
-         fHistMCtracksDecayRadiusAntiLambda->Fill(mcDecayPosR);
-         if (TMath::Abs(lRapCurrentPart) < lCutRap) fHistMCPtAllAntiLambda->Fill(lPtCurrentPart);
-       }
-       
-       if ( ( ( TMath::Abs(lPdgCurrentMother) == 3212)  ||
-              ( TMath::Abs(lPdgCurrentMother) == 3224)  ||
-              ( TMath::Abs(lPdgCurrentMother) == 3214)  ||
-              ( TMath::Abs(lPdgCurrentMother) == 3114) )
-            && (lCurrentMotherIsPrimary)
-            ) lComeFromSigma = 1;
-       else lComeFromSigma = 0;
-      
-       //*********************************************
-        // Now keep only primary particles 
-        
-       // FIX IT !!!!    iMC is not defined !!!! FIX IT also in ESD/AOD loop !!
-       if ( ( iMc > lNbMCPrimary ) && (!lComeFromSigma) ) continue;
-
-       //********************************************
-       // check if V0 is reconstructed several times  
-       
-       //lNtimesReconstructedK0s   = 0; lNtimesReconstructedLambda   = 0; lNtimesReconstructedAntiLambda   = 0;
-        //lNtimesReconstructedK0sMI = 0; lNtimesReconstructedLambdaMI = 0; lNtimesReconstructedAntiLambdaMI = 0;
-           
-        //for (Int_t jV0 = 0; jV0 < fESD->GetNumberOfV0s(); jV0++) {
-       
-       //lLabelTrackN  = 0; lLabelTrackP = 0;
-       //lPartNMother  = 0; lPartPMother = 0;
-
-       //AliAODv0    *vertexAOD= ((AliAODEvent*)fESD)->GetV0(jV0);
-       //if (!vertexAOD) continue;
-       //printf("enter!!");
-       //AliVParticle  *trackP  = ((AliVEvent*)fESD)->GetTrack(vertexAOD->GetPosID());
-       //if (!trackP) continue;
-       //lLabelTrackP = TMath::Abs(trackP->GetLabel());
-       //if (lLabelTrackP!=id0 && lLabelTrackP!=id1) continue;
-       
-       //AliVParticle  *trackN  = ((AliVEvent*)fESD)->GetTrack(vertexAOD->GetNegID());
-       //if (!trackN) continue;
-       //lLabelTrackN = TMath::Abs(trackN->GetLabel());
-       //if (lLabelTrackN!=id0 && lLabelTrackN!=id1) continue;
-       
-       //AliAODMCParticle *lPartNAOD = (AliAODMCParticle*)mcArray->At(lLabelTrackN);
-       //if (!lPartNAOD) continue;
-       //AliAODMCParticle *lPartPAOD = (AliAODMCParticle*)mcArray->At(lLabelTrackP);
-       //if (!lPartPAOD) continue;
-       
-       //lPartNMother = lPartNAOD->GetMother();
-       //lPartPMother = lPartPAOD->GetMother();
-
-       //lPartPMotherPDGcode = ((AliAODMCParticle*)mcArray->At(lPartPMother))->GetPdgCode();
-       
-       //switch (vertexAOD->GetOnFlyStatus()){
-         
-       //case 0 : 
-         //if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==310) ) lNtimesReconstructedK0s++;
-         //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==3122) ) lNtimesReconstructedLambda++;
-         //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==-3122) ) lNtimesReconstructedAntiLambda++;
-         //break;
-         
-       //case 1 :
-         //if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==310) ) lNtimesReconstructedK0sMI++;
-         //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==3122) ) lNtimesReconstructedLambdaMI++;
-         //else if ( (lPartPMother==lPartNMother) && (lPartPMotherPDGcode==-3122) ) lNtimesReconstructedAntiLambdaMI++;
-         //break;
-         
-       ///}    
-      //} // end loop over reconstructed V0s inside MC loop
-    
-       if (TMath::Abs(lRapCurrentPart) > lCutRap) continue;
-       if (lPdgcodeCurrentPart==310) {
-         fHistMCProdRadiusK0s->Fill(mcPosR);
-         fHistMCPtK0s->Fill(lPtCurrentPart);
-         fHistNTimesRecK0s->Fill(lNtimesReconstructedK0s);
-         fHistNTimesRecK0sVsPt->Fill(lPtCurrentPart,lNtimesReconstructedK0s);
-       }
-       else if (lPdgcodeCurrentPart==3122) {
-         fHistMCProdRadiusLambda->Fill(mcPosR);
-         fHistMCPtLambda->Fill(lPtCurrentPart);
-         fHistNTimesRecLambda->Fill(lNtimesReconstructedLambda);
-         fHistNTimesRecLambdaVsPt->Fill(lPtCurrentPart,lNtimesReconstructedLambda);
-         if (lComeFromSigma) fHistMCPtLambdaFromSigma->Fill(lPtCurrentPart);
-       }
-       else if (lPdgcodeCurrentPart==-3122) {
-         fHistMCProdRadiusAntiLambda->Fill(mcPosR);
-         fHistNTimesRecAntiLambda->Fill(lNtimesReconstructedAntiLambda);
-         fHistNTimesRecAntiLambdaVsPt->Fill(lPtCurrentPart,lNtimesReconstructedAntiLambda);
-         if (lComeFromSigma) fHistMCPtAntiLambdaFromSigma->Fill(lPtCurrentPart);
-       }
-
-      } // end loop over AODMC particles 
-      fHistMCMultiplicityPrimary->Fill(lNbMCPrimary);
-      
-    } // end AOD condition
 
   } // End Loop over MC condition
 
   
 
 
+
   //************************************
-  // ESD or AOD loop 
+  // ESD loop 
   //************************************
 
   Double_t lMagneticField = 999;
 
   //Multiplcity:
   Int_t    nv0sTot= 0, nv0s = 0;
-//  Int_t nv0sMI =0;   
+  //  Int_t nv0sMI =0;   
   // Variables:
   Double_t  lV0Position[3];
  
@@ -1641,13 +1535,13 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
 
   
 
-  Double_t lInvMassK0s = 0, lInvMassLambda = 0, lInvMassAntiLambda = 0;
-  Double_t lPtK0s      = 0, lPtLambda      = 0, lPtAntiLambda      = 0;
+  Double_t lInvMassK0s = 0, lInvMassLambda = 0;// lInvMassAntiLambda = 0;
+  Double_t lPtK0s      = 0, lPtLambda      = 0;// lPtAntiLambda      = 0;
   Double_t lRapK0s     = 0, lRapLambda     = 0, lRapAntiLambda     = 0;
-  Double_t lEtaK0s     = 0, lEtaLambda     = 0, lEtaAntiLambda     = 0;
+  //  Double_t lEtaK0s     = 0, lEtaLambda     = 0, lEtaAntiLambda     = 0;
   Double_t lAlphaV0      = 0, lPtArmV0       = 0;
 
-  Double_t lPzK0s      = 0, lPzLambda      = 0, lPzAntiLambda      = 0;
+  Double_t lPzK0s      = 0, lPzLambda      = 0;// lPzAntiLambda      = 0;
 
 
   Double_t lV0Eta = 999;
@@ -1677,17 +1571,17 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   Double_t rcPosRK0s        = 0;
   Double_t rcPosXLambda     = 0,  rcPosYLambda     = 0, rcPosZLambda     = 0;
   Double_t rcPosRLambda     = 0;
-  Double_t rcPosXAntiLambda = 0,  rcPosYAntiLambda = 0, rcPosZAntiLambda = 0;
-  Double_t rcPosRAntiLambda = 0;
+  //  Double_t rcPosXAntiLambda = 0,  rcPosYAntiLambda = 0, rcPosZAntiLambda = 0;
+  // Double_t rcPosRAntiLambda = 0;
 
   // Pt resolution
-  Double_t deltaPtK0s  = 0, deltaPtLambda  = 0, deltaPtAntiLambda  = 0;
+  Double_t deltaPtK0s  = 0, deltaPtLambda  = 0;// deltaPtAntiLambda  = 0;
 
   // Daughters
   AliESDtrack  *myTrackPos  = NULL;
   AliESDtrack  *myTrackNeg  = NULL;
-  AliVParticle *lVPartPos   = NULL;
-  AliVParticle *lVPartNeg   = NULL;
+  //  AliVParticle *lVPartPos   = NULL;
+  // AliVParticle *lVPartNeg   = NULL;
 
   // Daughters' momentum:
   Double_t  lMomPos[3] = {999,999,999};
@@ -1699,10 +1593,10 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   Double_t  lMomInnerWallPos =999, lMomInnerWallNeg = 999;
 
   // AliKF Chi2 and Armenteros variables
-  Double_t lChi2KFK0s  = 0, lChi2KFLambda = 0,  lChi2KFAntiLambda = 0;
-  Double_t lAlphaV0K0s = 0, lAlphaV0Lambda = 0,  lAlphaV0AntiLambda = 0;
-  Double_t lPtArmV0K0s = 0, lPtArmV0Lambda = 0,  lPtArmV0AntiLambda = 0;
-  Double_t lQlPos   = 0, lQlNeg   = 0;
+  //  Double_t lChi2KFK0s  = 0, lChi2KFLambda = 0,  lChi2KFAntiLambda = 0;
+  //  Double_t lAlphaV0K0s = 0, lAlphaV0Lambda = 0,  lAlphaV0AntiLambda = 0;
+  //Double_t lPtArmV0K0s = 0, lPtArmV0Lambda = 0,  lPtArmV0AntiLambda = 0;
+  //  Double_t lQlPos   = 0, lQlNeg   = 0;
 
 
   // PID
@@ -1732,7 +1626,6 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   AliAODVertex *myPrimaryVertex = NULL;
   //const AliVVertex *mySPDPrimaryVertex = NULL;
 
-  AliESDtrackCuts *myTracksCuts = NULL;
      
   const AliMultiplicity *myMultiplicty = ((AliESDEvent*)fESD)->GetMultiplicity();
 
@@ -1762,44 +1655,41 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
     if (!mySPDPrimaryVertex->GetStatus() && !myPrimaryVertexTracking->GetStatus() ) return;
     fHistNumberEvents->Fill(5.5);
 
-    
+    fHistTrackPerEvent->Fill(fESD->GetNumberOfTracks());   
     myPrimaryVertex = new AliAODVertex(lPrimaryVtxPosition, lPrimaryVtxCov, lPrimaryVtxChi2, NULL, -1, AliAODVertex::kPrimary);
     if (!myPrimaryVertex) return;
 
 
-     // Number of Tracklets:
+    // Number of Tracklets:
     //const AliMultiplicity *myMultiplicty = ((AliESDEvent*)fESD)->GetMultiplicity();
     //if (myMultiplicty->GetNumberOfTracklets() < 10) return;
     fHistTrackletPerEvent->Fill(myMultiplicty->GetNumberOfTracklets());
 
     lMagneticField = ((AliESDEvent*)fESD)->GetMagneticField();
 
-    myTracksCuts = new AliESDtrackCuts();
-    // require TPC refit
-    myTracksCuts->SetRequireTPCRefit(kTRUE);
-    // minimum number of clusters in TPC
-    myTracksCuts->SetMinNClustersTPC(nbMinTPCclusters);
+        fHistTPCTracks->Fill(AliESDtrackCuts::GetReferenceMultiplicity((AliESDEvent*)fESD, kTRUE));
 
-  }
-  
-  else if(fAnalysisType == "AOD") {
-    printf("enter AOD!!");
-    myPrimaryVertex = ((AliAODEvent*)fESD)->GetPrimaryVertex();
-    if (!myPrimaryVertex) return;
+    ////////////////////////////////////////////////////////////////////////////////////////
+    Int_t i =0;
 
-    lPrimaryVtxPosition[0] = myPrimaryVertex->GetX();
-    lPrimaryVtxPosition[1] = myPrimaryVertex->GetY();
-    lPrimaryVtxPosition[2] = myPrimaryVertex->GetZ();
 
-    // Cut on SPD vertex and fill histo Nevents: FIX it !
+    for (Int_t jTracks=0;jTracks<fESD->GetNumberOfTracks();jTracks++){
+               
+      AliESDtrack* TPCtrack=fESD->GetTrack(jTracks);
+      Float_t xy=0;
+      Float_t z=0;
+      TPCtrack->GetImpactParameters(xy,z);
+      if ((fTracksCuts->IsSelected(TPCtrack))&&(xy<1.0)&&(z<1.0)) {i=i+1;}
+                       
+    }
 
-     // Tracks cuts FIX IT !
+    fHistTPCMult->Fill(i);
 
-    // FIX it !!!
-    lMagneticField = 999;   
+    /////////////////////////////////////////////////////////////////////////////////////////
 
+    // minimum number of clusters in TPC
+    // fTracksCuts->SetMinNClustersTPC(nbMinTPCclusters);
   }
-
  
   fHistPrimaryVertexX->Fill(lPrimaryVtxPosition[0]);
   fHistPrimaryVertexY->Fill(lPrimaryVtxPosition[1]);
@@ -1810,7 +1700,6 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   fHistPrimaryVertexResY->Fill(lResPrimaryVtxY);
   fHistPrimaryVertexResZ->Fill(lResPrimaryVtxZ);
 
-
   //***********************
   // AliKF Primary Vertex
 
@@ -1821,17 +1710,17 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
   //************************************
   // PID
 
-  AliESDpid *fESDpid = new AliESDpid(); // FIXME delete
+  AliESDpid *fESDpid = new AliESDpid();
   fESDpid->GetTPCResponse().SetBetheBlochParameters(fAlephParameters[0],fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]); 
       
 
 
   //***Rerun the V0 finder
 
-//  fESD->ResetV0s();
-//  AliV0vertexer v0Vertexer;
-//  v0Vertexer.SetCuts(fCuts);
-//  v0Vertexer.Tracks2V0vertices(fESD);
+  //  fESD->ResetV0s();
+  //  AliV0vertexer v0Vertexer;
+  //  v0Vertexer.SetCuts(fCuts);
+  //  v0Vertexer.Tracks2V0vertices(fESD);
   
   //*************************
   // V0 loop
@@ -1852,7 +1741,7 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
     lCheckPIdK0Short    = 0; lCheckMcK0Short     = 0; lCheckSecondaryK0s         = 0;
     lCheckPIdLambda     = 0; lCheckMcLambda      = 0; lCheckSecondaryLambda      = 0;
     lCheckPIdAntiLambda = 0; lCheckMcAntiLambda  = 0; lCheckSecondaryAntiLambda  = 0;       
-    lComeFromSigma      = -1;
+    lComeFromSigma      = -1;lCheckGamma = 0;
     
     
     if(fAnalysisType == "ESD") {
@@ -1860,6 +1749,8 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
 
       AliESDv0 *v0 = ((AliESDEvent*)fESD)->GetV0(iV0);
       if (!v0) continue;
+
+      //      if ((v0->Pt())<0.6) continue;
       
       // Primary vertex:
       fHistPrimaryVertexPosXV0events->Fill(lPrimaryVtxPosition[0]);
@@ -1872,17 +1763,14 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
       AliESDtrack *myTrackPosTest = ((AliESDEvent*)fESD)->GetTrack(lIndexTrackPos);
       AliESDtrack *myTrackNegTest = ((AliESDEvent*)fESD)->GetTrack(lIndexTrackNeg);
       if (!myTrackPosTest || !myTrackNegTest) {
-       // FIXME: shouldn't this be fatal?
        Printf("strange analysis::UserExec:: Error:Could not retreive one of the daughter track\n");
        continue;
       }
       // Remove like-sign
       if ( myTrackPosTest->GetSign() == myTrackNegTest->GetSign()){
-       // FIXME: how can this happen?
        continue;
       } 
      
-      //    FIXME: are the GetParamN/GetParamP reliable? If so, why do you need to check the sign below?
       // VO's main characteristics to check the reconstruction cuts
       lOnFlyStatus       = v0->GetOnFlyStatus();
       lChi2V0            = v0->GetChi2V0();
@@ -1950,7 +1838,7 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
       lPPos = TMath::Sqrt(lMomPos[0]*lMomPos[0] + lMomPos[1]*lMomPos[1] + lMomPos[2]*lMomPos[2]);
       lPNeg = TMath::Sqrt(lMomNeg[0]*lMomNeg[0] + lMomNeg[1]*lMomNeg[1] + lMomNeg[2]*lMomNeg[2]);
 
-      // Inner Wall parameter (used for pid):
+      // Inner Wall parameter:
       const AliExternalTrackParam *myInnerWallTrackPos = myTrackPos->GetInnerParam(); 
       if(myInnerWallTrackPos) lMomInnerWallPos = myInnerWallTrackPos->GetP(); 
       const AliExternalTrackParam *myInnerWallTrackNeg = myTrackNeg->GetInnerParam(); 
@@ -1962,20 +1850,56 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
       if (myTrackNeg) lDcaNegToPrimVertex = TMath::Abs(myTrackNeg->GetD(lPrimaryVtxPosition[0],lPrimaryVtxPosition[1],lMagneticField) );
       
       // Quality tracks cuts:
-      if ( !(myTracksCuts->IsSelected(myTrackPos)) || !(myTracksCuts->IsSelected(myTrackNeg)) ) {
-       if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
-      }
+      if ( !(fTracksCuts->IsSelected(myTrackPos)) || !(fTracksCuts->IsSelected(myTrackNeg)) ) 
+
+
+       {
+         if (negPiKF) delete negPiKF; negPiKF=NULL;
+         if (posPiKF) delete posPiKF; posPiKF=NULL;
+         if (posPKF)  delete posPKF;  posPKF=NULL;
+         if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+         continue;}
+
       // Armenteros variables:
       lAlphaV0      =  v0->AlphaV0();
       lPtArmV0      =  v0->PtArmV0();
 
       // Pseudorapidity:
       lV0Eta = v0->Eta();
-      
+      //////////////////////////////////////////////////////////////////////////
+      // Invariant mass
+      v0->ChangeMassHypothesis(310);
+      lInvMassK0s = v0->GetEffMass();
+      lPtK0s = v0->Pt();
+      lPzK0s = v0->Pz();
+
+      v0->ChangeMassHypothesis(3122);
+      lInvMassLambda = v0->GetEffMass();
+      lPtLambda = v0->Pt();
+      lPzLambda = v0->Pz();
+  
+
+      // Rapidity:
+      lRapK0s    = v0->Y(310);
+      lRapLambda = v0->Y(3122);
+       
+      if (lPtK0s==0)   {
+       if (negPiKF) delete negPiKF; negPiKF=NULL;
+       if (posPiKF) delete posPiKF; posPiKF=NULL;
+       if (posPKF)  delete posPKF;  posPKF=NULL;
+       if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+       continue;}
+      if (lPtLambda==0)        {
+       if (negPiKF) delete negPiKF; negPiKF=NULL;
+       if (posPiKF) delete posPiKF; posPiKF=NULL;
+       if (posPKF)  delete posPKF;  posPKF=NULL;
+       if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+       continue;}
+      ///////////////////////////////////////////////////////////////////////      
+
       // PID
       if (fUsePID.Contains("withPID")) {
        nSigmaPosPion   = TMath::Abs(fESDpid->NumberOfSigmasTPC(myTrackPos,AliPID::kPion));
@@ -1990,254 +1914,120 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
        nSigmaPosPion = 0; nSigmaNegPion =0; nSigmaPosProton = 0; nSigmaNegProton= 0;
       }
       
+      
+      
       // Monte-Carlo particle associated to reconstructed particles: 
       if (fAnalysisMC) {
        //if (lLabelTrackPos < 0 || lLabelTrackNeg < 0) continue;
        TParticle  *lMCESDPartPos  = stack->Particle(lLabelTrackPos);
        if(!lMCESDPartPos) { 
-         Printf("no MC particle for positive and/or negative daughter\n");
-         
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
-    
+         //  Printf("no MC particle for positive and/or negative daughter\n");
+               
+         if (negPiKF) delete negPiKF; negPiKF=NULL;
+         if (posPiKF) delete posPiKF; posPiKF=NULL;
+         if (posPKF)  delete posPKF;  posPKF=NULL;
+         if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+         continue;
        }
        TParticle  *lMCESDPartNeg  = stack->Particle(lLabelTrackNeg);
-       if (!lMCESDPartNeg) {
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
-    }
+       if (!lMCESDPartNeg)     {
+         if (negPiKF) delete negPiKF; negPiKF=NULL;
+         if (posPiKF) delete posPiKF; posPiKF=NULL;
+         if (posPKF)  delete posPKF;  posPKF=NULL;
+         if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+         continue;}
        lPDGCodePosDaughter = lMCESDPartPos->GetPdgCode();
        lPDGCodeNegDaughter = lMCESDPartNeg->GetPdgCode();
        lIndexPosMother = lMCESDPartPos->GetFirstMother();
        lIndexNegMother = lMCESDPartNeg->GetFirstMother();
-       
-       if (lIndexPosMother == -1) {
-
-
-                                       lPdgcodeMother = 0;
-                                       lIndexMotherOfMother = 0;
-                                       mcPosX = 0;
-                                       mcPosY = 0;
-                                       mcPosZ = 0;
-                                       mcPosR = 0;
-                                       mcPosMotherX = 0;
-                                       mcPosMotherY = 0;
-                                       mcPosMotherZ = 0;
-                                       mcPosMotherR = 0;
-                                       mcMotherPt = 1;
-                                       }
-
-               else {
-
-       TParticle  *lMCESDMother    = stack->Particle(lIndexPosMother);
-       if (!lMCESDMother) {
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
-    }
-       lPdgcodeMother         = lMCESDMother->GetPdgCode();
-       lIndexMotherOfMother   = lMCESDMother->GetFirstMother();
-       if (lIndexMotherOfMother ==-1) lPdgcodeMotherOfMother = 0;
-       else {
-         TParticle  *lMCESDMotherOfMother    = stack->Particle(lIndexMotherOfMother);
-         if (!lMCESDMotherOfMother) {
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
-    }
-         lPdgcodeMotherOfMother = lMCESDMotherOfMother->GetPdgCode();
-       }
-       
-       mcPosX = lMCESDPartPos->Vx();
-       mcPosY = lMCESDPartPos->Vy();
-       mcPosZ = lMCESDPartPos->Vz();
-       mcPosR = TMath::Sqrt(mcPosX*mcPosX+mcPosY*mcPosY);
-       mcPosMotherX = lMCESDMother->Vx();
-       mcPosMotherY = lMCESDMother->Vy();
-       mcPosMotherZ = lMCESDMother->Vz();
-       mcPosMotherR = TMath::Sqrt(mcPosMotherX*mcPosMotherX+mcPosMotherY*mcPosMotherY);
-       
-       mcMotherPt   = lMCESDMother->Pt();
-      }
-     }
-    } // end ESD condition
-
 
-    
-    else if(fAnalysisType == "AOD") { 
+       //////////////////////////////
+       //      if (lIndexPosMother == -1)      {
+       //      if (negPiKF) delete negPiKF; negPiKF=NULL;
+       //      if (posPiKF) delete posPiKF; posPiKF=NULL;
+       //      if (posPKF)  delete posPKF;  posPKF=NULL;
+       //      if (negAPKF) delete negAPKF; negAPKF=NULL;
 
-      AliAODv0     *myAODv0 = ((AliAODEvent*)fESD)->GetV0(iV0);
-      if (!myAODv0) continue;
+       //      continue;}
 
-      // Primary vertex:
-      fHistPrimaryVertexPosXV0events->Fill(lPrimaryVtxPosition[0]);
-      fHistPrimaryVertexPosYV0events->Fill(lPrimaryVtxPosition[1]);
-      fHistPrimaryVertexPosZV0events->Fill(lPrimaryVtxPosition[2]);
-      
+       if (lIndexPosMother == -1) {
 
-      //Multiplicity:
-      if(lOnFlyStatus == fUseOnTheFly) nv0s++;
 
-      // V0's Daughters
-      lIndexTrackPos = TMath::Abs(myAODv0->GetPosID());
-      lIndexTrackNeg = TMath::Abs(myAODv0->GetNegID());
-      
-      AliVParticle  *lVPartPosTest  = ((AliVEvent*)fESD)->GetTrack(lIndexTrackPos);
-      AliVParticle  *lVPartNegTest  = ((AliVEvent*)fESD)->GetTrack(lIndexTrackNeg);
-      //AliAODTrack  *lVPartPos  = ((AliAODEvent*)fESD)->GetTrack(lIndexTrackPos);
-      //AliAODTrack  *lVPartNeg  = ((AliAODEvent*)fESD)->GetTrack(lIndexTrackNeg);
+         lPdgcodeMother = 0;
+         lIndexMotherOfMother = 0;
+         mcPosX = 0;
+         mcPosY = 0;
+         mcPosZ = 0;
+         mcPosR = 0;
+         mcPosMotherX = 0;
+         mcPosMotherY = 0;
+         mcPosMotherZ = 0;
+         mcPosMotherR = 0;
+         mcMotherPt = 1;
+       }
 
-      if (!lVPartPosTest ||(!lVPartNegTest )) {
-       Printf("strange analysis::UserExec:: Could not retreive one of the daughter track\n");
-       continue;
-      }
+       else {
 
-      // Quality cuts:
-      // TO DO !!!!!!!
 
-      // TPC refit condition (done during reconstruction for Offline but not for On-the-fly)
-      //if( !(lVPartPosTest->GetStatus() & AliAODTrack::kTPCrefit)) continue;      
-      //if( !(lVPartNegTest->GetStatus() & AliAODTrack::kTPCrefit)) continue;
-      
 
-      lDcaPosToPrimVertex = myAODv0->DcaPosToPrimVertex();     
-      lDcaNegToPrimVertex = myAODv0->DcaNegToPrimVertex();
-      lOnFlyStatus        = myAODv0->GetOnFlyStatus();
-      lChi2V0             = myAODv0->Chi2V0();
-      lDcaV0Daughters     = myAODv0->DcaV0Daughters();
-      lDcaV0ToPrimVertex  = myAODv0->DcaV0ToPrimVertex();
-      lV0DecayLength      = myAODv0->DecayLengthV0(lPrimaryVtxPosition);
-      lV0cosPointAngle    = myAODv0->CosPointingAngle(lPrimaryVtxPosition);
-      lV0Radius           = myAODv0->RadiusV0();
-
-      if( lVPartPosTest->Charge() ==1){
-       
-       lVPartPos = ((AliVEvent*)fESD)->GetTrack(lIndexTrackPos);
-       lVPartNeg = ((AliVEvent*)fESD)->GetTrack(lIndexTrackNeg);
-       
-       
-       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( *(myAODv0->GetParamN()) ,-211);
-       //posPiKF = new AliKFParticle( *(myAODv0->GetParamP()) ,211);
-       //posPKF  = new AliKFParticle( *(myAODv0->GetParamP()) ,2212);
-       //negAPKF = new AliKFParticle( *(myAODv0->GetParamN()) ,-2212);
-       // TO DO !!!!!!
-       negPiKF = NULL;
-       posPiKF = NULL;
-       posPKF  = NULL;
-       negAPKF = NULL;
-       
-      }
-           
-      if( lVPartPosTest->Charge() ==-1){
+         TParticle  *lMCESDMother    = stack->Particle(lIndexPosMother);
+         if (!lMCESDMother)    {
+           if (negPiKF) delete negPiKF; negPiKF=NULL;
+           if (posPiKF) delete posPiKF; posPiKF=NULL;
+           if (posPKF)  delete posPKF;  posPKF=NULL;
+           if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+           continue;}
+         lPdgcodeMother         = lMCESDMother->GetPdgCode();
+         lIndexMotherOfMother   = lMCESDMother->GetFirstMother();
+         if (lIndexMotherOfMother ==-1) lPdgcodeMotherOfMother = 0;
+         else {
+           TParticle  *lMCESDMotherOfMother    = stack->Particle(lIndexMotherOfMother);
+           if (!lMCESDMotherOfMother)  {
+             if (negPiKF) delete negPiKF; negPiKF=NULL;
+             if (posPiKF) delete posPiKF; posPiKF=NULL;
+             if (posPKF)  delete posPKF;  posPKF=NULL;
+             if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+             continue;}
+           lPdgcodeMotherOfMother = lMCESDMotherOfMother->GetPdgCode();
+         }
        
-       lVPartPos = ((AliVEvent*)fESD)->GetTrack(lIndexTrackNeg);
-       lVPartNeg = ((AliVEvent*)fESD)->GetTrack(lIndexTrackPos);
+         mcPosX = lMCESDPartPos->Vx();
+         mcPosY = lMCESDPartPos->Vy();
+         mcPosZ = lMCESDPartPos->Vz();
+         mcPosR = TMath::Sqrt(mcPosX*mcPosX+mcPosY*mcPosY);
+         mcPosMotherX = lMCESDMother->Vx();
+         mcPosMotherY = lMCESDMother->Vy();
+         mcPosMotherZ = lMCESDMother->Vz();
+         mcPosMotherR = TMath::Sqrt(mcPosMotherX*mcPosMotherX+mcPosMotherY*mcPosMotherY);
        
-       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( *(myAODv0->GetParamP()) ,-211);
-       //posPiKF = new AliKFParticle( *(myAODv0->GetParamN()) ,211);
-       //posPKF  = new AliKFParticle( *(myAODv0->GetParamN()) ,2212);
-       //negAPKF = new AliKFParticle( *(myAODv0->GetParamP()) ,-2212);
-       negPiKF = NULL;
-       posPiKF = NULL;
-       posPKF  = NULL;
-       negAPKF = NULL;
+         mcMotherPt   = lMCESDMother->Pt();
+       }
       }
+    } // end ESD condition
 
-      lLabelTrackPos  = TMath::Abs(lVPartPos->GetLabel());
-      lLabelTrackNeg  = TMath::Abs(lVPartNeg->GetLabel());
-      
-      // Armenteros variables:
-      lAlphaV0   = myAODv0->AlphaV0();
-      lPtArmV0   = myAODv0->PtArmV0();
-
-      // Pseudorapidity:
-      lV0Eta = myAODv0->PseudoRapV0();
-      
-      // PID not accessible with AOD !
-      nSigmaPosPion = 0; nSigmaNegPion =0; nSigmaPosProton = 0; nSigmaNegProton= 0;
 
-      
-      // Monte-Carlo particle associated to reconstructed particles:  
-      if (fAnalysisMC) {
-       AliAODMCParticle *lMCAODPartPos = (AliAODMCParticle*)mcArray->At(lLabelTrackPos);
-       if (!lMCAODPartPos) {
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
-    }
-       AliAODMCParticle *lMCAODPartNeg = (AliAODMCParticle*)mcArray->At(lLabelTrackNeg);
-       if(!lMCAODPartNeg)  
-        // Printf("strange analysis::UserExec:no MC particle for negative daughter\n");
-         {
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       continue;
     
-       }
-       lPDGCodePosDaughter = lMCAODPartPos->GetPdgCode();
-       lPDGCodeNegDaughter = lMCAODPartNeg->GetPdgCode();
-       lIndexPosMother = lMCAODPartPos->GetMother();
-       lIndexNegMother = lMCAODPartNeg->GetMother();
-       
-       AliAODMCParticle *lMCAODMother = (AliAODMCParticle*)mcArray->At(lIndexPosMother);
-       lPdgcodeMother = lMCAODMother->GetPdgCode();
-       lIndexMotherOfMother  = lMCAODMother->GetMother();
-       if (lIndexMotherOfMother ==-1) lPdgcodeMotherOfMother = 0;
-       else {
-         lPdgcodeMotherOfMother   = ((AliAODMCParticle*)mcArray->At(lIndexMotherOfMother))->GetPdgCode();
-       }
-       
-       mcPosX = lMCAODPartPos->Xv();
-       mcPosY = lMCAODPartPos->Yv();
-       mcPosZ = lMCAODPartPos->Zv();
-       mcPosR = TMath::Sqrt(mcPosX*mcPosX+mcPosY*mcPosY);
-       mcPosMotherX = lMCAODMother->Xv();
-       mcPosMotherY = lMCAODMother->Yv();
-       mcPosMotherZ = lMCAODMother->Zv();
-       mcPosMotherR = TMath::Sqrt(mcPosMotherX*mcPosMotherX+mcPosMotherY*mcPosMotherY);
-       mcMotherPt   = lMCAODMother->Pt();
-      }
-            
-    } // end AOD condition
+
     
     
     // Multiplicity:
-    if(lOnFlyStatus == fUseOnTheFly) nv0s++;
+    if(!lOnFlyStatus) nv0s++;
+    //    else  if(lOnFlyStatus) nv0sMI++;
 
     // Daughter momentum cut: ! FIX it in case of AOD !
     if ( (lPtPos  < cutMinPtDaughter ) ||
          (lPtNeg  < cutMinPtDaughter )
-        ) {
+        )      {
       if (negPiKF) delete negPiKF; negPiKF=NULL;
       if (posPiKF) delete posPiKF; posPiKF=NULL;
       if (posPKF)  delete posPKF;  posPKF=NULL;
-      if (negAPKF) delete negAPKF; negAPKF=NULL;        
-      continue;
-    }
+      if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+      continue;}
     
     AliKFParticle v0K0sKF;
     v0K0sKF+=(*negPiKF);
@@ -2253,93 +2043,6 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
     v0AntiLambdaKF+=(*posPiKF);
     v0AntiLambdaKF+=(*negAPKF);
     v0AntiLambdaKF.SetProductionVertex(primaryVtxKF);
-    
-    // Invariant mass
-    lInvMassK0s        = v0K0sKF.GetMass();
-    lInvMassLambda     = v0LambdaKF.GetMass();
-    lInvMassAntiLambda = v0AntiLambdaKF.GetMass();
-    
-    // Rapidity:
-    lRapK0s        = 0.5*TMath::Log((v0K0sKF.GetE()+v0K0sKF.GetPz())/(v0K0sKF.GetE()-v0K0sKF.GetPz()+1.e-13));
-    lRapLambda     = 0.5*TMath::Log((v0LambdaKF.GetE()+v0LambdaKF.GetPz())/(v0LambdaKF.GetE()-v0LambdaKF.GetPz()+1.e-13));
-    lRapAntiLambda = 0.5*TMath::Log((v0AntiLambdaKF.GetE()+v0AntiLambdaKF.GetPz())/(v0AntiLambdaKF.GetE()-v0AntiLambdaKF.GetPz()+1.e-13));
-
-    // Pseudo-rapidity
-    lEtaK0s     = v0K0sKF.GetEta();
-    lEtaLambda  = v0LambdaKF.GetEta();
-    lEtaAntiLambda  = v0AntiLambdaKF.GetEta();
-
-    // Pz:
-    lPzK0s        = v0K0sKF.GetPz();
-    lPzLambda     = v0LambdaKF.GetPz();
-    lPzAntiLambda = v0AntiLambdaKF.GetPz();
-    
-    // Pt:
-    lPtK0s        = v0K0sKF.GetPt();
-    lPtLambda     = v0LambdaKF.GetPt();
-    lPtAntiLambda = v0AntiLambdaKF.GetPt();
-
-    if (lPtK0s==0) {
-        if (negPiKF) delete negPiKF; negPiKF=NULL;
-       if (posPiKF) delete posPiKF; posPiKF=NULL;
-       if (posPKF)  delete posPKF;  posPKF=NULL;
-       if (negAPKF) delete negAPKF; negAPKF=NULL;  
-       // FIXME: should you really continue here and below?
-       continue;
-    }
-    if (lPtLambda==0) {
-      if (negPiKF) delete negPiKF; negPiKF=NULL;
-      if (posPiKF) delete posPiKF; posPiKF=NULL;
-      if (posPKF)  delete posPKF;  posPKF=NULL;
-      if (negAPKF) delete negAPKF; negAPKF=NULL;  
-      continue;
-    }
-    // Pt Resolution
-    deltaPtK0s        = (lPtK0s - mcMotherPt)/mcMotherPt;
-    deltaPtLambda     = (lPtLambda - mcMotherPt)/mcMotherPt;
-    deltaPtAntiLambda = (lPtAntiLambda - mcMotherPt)/mcMotherPt;
-
-    // KF Chi2
-    lChi2KFK0s        = v0K0sKF.GetChi2();
-    lChi2KFLambda     = v0LambdaKF.GetChi2();
-    lChi2KFAntiLambda = v0AntiLambdaKF.GetChi2();
-    
-    // Reconstructed Position
-    rcPosXK0s = v0K0sKF.GetX();
-    rcPosYK0s = v0K0sKF.GetY(); 
-    rcPosZK0s = v0K0sKF.GetZ();
-    rcPosRK0s = TMath::Sqrt(rcPosXK0s*rcPosXK0s+rcPosYK0s*rcPosYK0s);
-
-    rcPosXLambda = v0LambdaKF.GetX(); 
-    rcPosYLambda = v0LambdaKF.GetY(); 
-    rcPosZLambda = v0LambdaKF.GetZ();
-    rcPosRLambda = TMath::Sqrt(rcPosXLambda*rcPosXLambda+rcPosYLambda*rcPosYLambda); 
-
-    rcPosXAntiLambda = v0AntiLambdaKF.GetX();
-    rcPosYAntiLambda = v0AntiLambdaKF.GetY(); 
-    rcPosZAntiLambda = v0AntiLambdaKF.GetZ();
-    rcPosRAntiLambda = TMath::Sqrt(rcPosXAntiLambda*rcPosXAntiLambda+rcPosYAntiLambda*rcPosYAntiLambda); 
-
-    TVector3 momPos(lMomPos[0],lMomPos[1],lMomPos[2]);
-    TVector3 momNeg(lMomNeg[0],lMomNeg[1],lMomNeg[2]);
-    TVector3 momTotK0s(v0K0sKF.GetPx(),v0K0sKF.GetPy(),v0K0sKF.GetPz());
-    TVector3 momTotLambda(v0LambdaKF.GetPx(),v0LambdaKF.GetPy(),v0LambdaKF.GetPz());
-    TVector3 momTotAntiLambda(v0AntiLambdaKF.GetPx(),v0AntiLambdaKF.GetPy(),v0AntiLambdaKF.GetPz());
-    
-    lQlPos = momPos.Dot(momTotK0s)/momTotK0s.Mag();
-    lQlNeg = momNeg.Dot(momTotK0s)/momTotK0s.Mag();
-    lAlphaV0K0s = 1.-2./(1.+lQlPos/lQlNeg);
-    lQlPos = momPos.Dot(momTotLambda)/momTotLambda.Mag();
-    lQlNeg = momNeg.Dot(momTotLambda)/momTotLambda.Mag();
-    lAlphaV0Lambda = 1.-2./(1.+lQlPos/lQlNeg);
-    lQlPos = momPos.Dot(momTotAntiLambda)/momTotAntiLambda.Mag();
-    lQlNeg = momNeg.Dot(momTotAntiLambda)/momTotAntiLambda.Mag();
-    lAlphaV0AntiLambda = 1.-2./(1.+lQlPos/lQlNeg);
-    
-    lPtArmV0K0s = momPos.Perp(momTotK0s);
-    lPtArmV0Lambda = momPos.Perp(momTotLambda);
-    lPtArmV0AntiLambda = momPos.Perp(momTotAntiLambda);
-    
     // Look for associated particles:
     if (fAnalysisMC) {
       if( (lIndexPosMother==-1) || (lIndexNegMother==-1) ) {
@@ -2369,8 +2072,8 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
               ) lComeFromSigma = 1;
          else lComeFromSigma = 0; 
          if ( (lIndexPosMother <= lNbMCPrimary) || 
-            ( ( lIndexPosMother > lNbMCPrimary) && (lComeFromSigma) )
-            ) lCheckMcLambda  = 1; 
+              ( ( lIndexPosMother > lNbMCPrimary) && (lComeFromSigma) )
+              ) lCheckMcLambda  = 1; 
          else lCheckSecondaryLambda    = 1;
        }
       }
@@ -2387,37 +2090,20 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
               ) lComeFromSigma = 1;
          else lComeFromSigma = 0;  
          if ( (lIndexPosMother <= lNbMCPrimary) || 
-            ( ( lIndexPosMother > lNbMCPrimary) && (lComeFromSigma) )
-            ) lCheckMcAntiLambda  = 1;
+              ( ( lIndexPosMother > lNbMCPrimary) && (lComeFromSigma) )
+              ) lCheckMcAntiLambda  = 1;
          else lCheckSecondaryAntiLambda = 1;
        }
       }
       
       // Gamma conversion
-      else if ( (lPDGCodePosDaughter==11) &&
-               (lPDGCodeNegDaughter==-11) &&
+      else if ( (lPDGCodePosDaughter==-11) &&
+               (lPDGCodeNegDaughter==11) &&
                (lPdgcodeMother==22 ) )
        lCheckGamma = 1;
     } // end "look for associated particles  
    
     
-    // Cuts:
-/*    if (fUseCut.Contains("yes")) {
-      if ( (lDcaPosToPrimVertex < 0.036 ) ||
-          (lDcaNegToPrimVertex < 0.036 ) ||
-          (lDcaV0Daughters     > 0.5   ) ||
-          (lV0cosPointAngle    < 0.999 ) 
-          )    
-       continue;
-    }
-*/
-
-/*
-      if ( (lDcaV0Daughters     > 0.3   ) ||
-          (lV0cosPointAngle    < 0.998 )
-
-          )    continue;
-*/
     // PID condition:
     lCheckPIDK0sPosDaughter        = 0, lCheckPIDK0sNegDaughter        = 0;
     lCheckPIDLambdaPosDaughter     = 0, lCheckPIDLambdaNegDaughter     = 0;
@@ -2458,175 +2144,249 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
     
     //*****************************
     // filling histograms
+    //*****************************
+
+    ///////////////values for cuts/////////////////////////////////////////////////////////////////////////////////////////
+    if ((lDcaPosToPrimVertex<=0.1) || (lDcaNegToPrimVertex<=0.1) || (lDcaV0Daughters>=1.00) || 
+       (lV0cosPointAngle<=0.998) || (lV0Radius<=0.9) || (lV0Radius>=100) ) 
+       
+      {
+       if (negPiKF) delete negPiKF; negPiKF=NULL;
+       if (posPiKF) delete posPiKF; posPiKF=NULL;
+       if (posPKF)  delete posPKF;  posPKF=NULL;
+       if (negAPKF) delete negAPKF; negAPKF=NULL;
+
+       continue;}
+    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    if (TMath::Abs(lRapK0s) < lCutRap) {
+
+      //////2D histos: cut vs on fly status/////////////////////
+
+      fHistDcaPosToPrimVertexK0->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
+      fHistDcaNegToPrimVertexK0->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
+      fHistRadiusV0K0->Fill(lV0Radius,lOnFlyStatus);
+      fHistDecayLengthV0K0->Fill(lV0DecayLength,lOnFlyStatus);
+      fHistDcaV0DaughtersK0->Fill(lDcaV0Daughters,lOnFlyStatus);
+      fHistChi2K0->Fill(lChi2V0,lOnFlyStatus);
+      fHistCosPointAngleK0->Fill(lV0cosPointAngle,lOnFlyStatus);
+
+      //////2D histos: cut vs mass///////////////////// 
+
+      if (lOnFlyStatus==0){
+
+       fHistDcaPosToPrimVertexK0vsMassK0->Fill(lDcaPosToPrimVertex,lInvMassK0s);
+       fHistDcaNegToPrimVertexK0vsMassK0->Fill(lDcaNegToPrimVertex,lInvMassK0s);
+       fHistRadiusV0K0vsMassK0->Fill(lV0Radius,lInvMassK0s);
+       fHistDecayLengthV0K0vsMassK0->Fill(lV0DecayLength,lInvMassK0s);
+       fHistDcaV0DaughtersK0vsMassK0->Fill(lDcaV0Daughters,lInvMassK0s);
+       fHistCosPointAngleK0vsMassK0->Fill(lV0cosPointAngle,lInvMassK0s);
+
+          if (lPtK0s>1 && lPtK0s <2){ 
+            fHistDcaPosToPrimVertexK0vsMassK0pt1->Fill(lDcaPosToPrimVertex,lInvMassK0s);
+            fHistDcaNegToPrimVertexK0vsMassK0pt1->Fill(lDcaNegToPrimVertex,lInvMassK0s);
+            fHistRadiusV0K0vsMassK0pt1->Fill(lV0Radius,lInvMassK0s);
+            fHistDecayLengthV0K0vsMassK0pt1->Fill(lV0DecayLength,lInvMassK0s);
+            fHistDcaV0DaughtersK0vsMassK0pt1->Fill(lDcaV0Daughters,lInvMassK0s);
+            fHistCosPointAngleK0vsMassK0pt1->Fill(lV0cosPointAngle,lInvMassK0s);
+            }   
+            if (lPtK0s > 2 && lPtK0s < 3){ 
+            fHistDcaPosToPrimVertexK0vsMassK0pt2->Fill(lDcaPosToPrimVertex,lInvMassK0s);
+            fHistDcaNegToPrimVertexK0vsMassK0pt2->Fill(lDcaNegToPrimVertex,lInvMassK0s);
+            fHistRadiusV0K0vsMassK0pt2->Fill(lV0Radius,lInvMassK0s);
+            fHistDecayLengthV0K0vsMassK0pt2->Fill(lV0DecayLength,lInvMassK0s);
+            fHistDcaV0DaughtersK0vsMassK0pt2->Fill(lDcaV0Daughters,lInvMassK0s);
+            fHistCosPointAngleK0vsMassK0pt2->Fill(lV0cosPointAngle,lInvMassK0s);
+            }   
+            if (lPtK0s > 3 && lPtK0s < 4){ 
+            fHistDcaPosToPrimVertexK0vsMassK0pt3->Fill(lDcaPosToPrimVertex,lInvMassK0s);
+            fHistDcaNegToPrimVertexK0vsMassK0pt3->Fill(lDcaNegToPrimVertex,lInvMassK0s);
+            fHistRadiusV0K0vsMassK0pt3->Fill(lV0Radius,lInvMassK0s);
+            fHistDecayLengthV0K0vsMassK0pt3->Fill(lV0DecayLength,lInvMassK0s);
+            fHistDcaV0DaughtersK0vsMassK0pt3->Fill(lDcaV0Daughters,lInvMassK0s);
+            fHistCosPointAngleK0vsMassK0pt3->Fill(lV0cosPointAngle,lInvMassK0s);
+            }   
+      }
+
+    }
 
-    fHistDcaPosToPrimVertex->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
-    fHistDcaNegToPrimVertex->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
-    fHistDcaPosToPrimVertexZoom->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
-    fHistDcaNegToPrimVertexZoom->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
-    fHistRadiusV0->Fill(lV0Radius,lOnFlyStatus);
-    fHistDecayLengthV0->Fill(lV0DecayLength,lOnFlyStatus);
-    fHistDcaV0Daughters->Fill(lDcaV0Daughters,lOnFlyStatus);
-    fHistChi2->Fill(lChi2V0,lOnFlyStatus);
-    fHistCosPointAngle->Fill(lV0cosPointAngle,lOnFlyStatus);
-    if (lV0cosPointAngle >= 0.9) fHistCosPointAngleZoom->Fill(lV0cosPointAngle,lOnFlyStatus);
-    fHistChi2KFBeforeCutK0s->Fill(lChi2KFK0s,lOnFlyStatus); 
-    fHistChi2KFBeforeCutLambda->Fill(lChi2KFLambda,lOnFlyStatus);
-    fHistChi2KFBeforeCutAntiLambda->Fill(lChi2KFAntiLambda,lOnFlyStatus);
+    if (TMath::Abs(lRapLambda) < lCutRap) {
+
+      //////2D histos: cut vs on fly status/////////////////////
+
+      fHistDcaPosToPrimVertexL->Fill(lDcaPosToPrimVertex,lOnFlyStatus);
+      fHistDcaNegToPrimVertexL->Fill(lDcaNegToPrimVertex,lOnFlyStatus);
+      fHistRadiusV0L->Fill(lV0Radius,lOnFlyStatus);
+      fHistDecayLengthV0L->Fill(lV0DecayLength,lOnFlyStatus);
+      fHistDcaV0DaughtersL->Fill(lDcaV0Daughters,lOnFlyStatus);
+      fHistChi2L->Fill(lChi2V0,lOnFlyStatus);
+      fHistCosPointAngleL->Fill(lV0cosPointAngle,lOnFlyStatus);
+
+      //////2D histos: cut vs mass/////////////////////
+
+      if (lOnFlyStatus==0){
+
+       fHistDcaPosToPrimVertexLvsMassL->Fill(lDcaPosToPrimVertex,lInvMassLambda);
+       fHistDcaNegToPrimVertexLvsMassL->Fill(lDcaNegToPrimVertex,lInvMassLambda);
+       fHistRadiusV0LvsMassL->Fill(lV0Radius,lInvMassLambda);
+       fHistDecayLengthV0LvsMassL->Fill(lV0DecayLength,lInvMassLambda);
+       fHistDcaV0DaughtersLvsMassL->Fill(lDcaV0Daughters,lInvMassLambda);
+       fHistCosPointAngleLvsMassL->Fill(lV0cosPointAngle,lInvMassLambda);
+      }
+
+    }
+    ///////////////values for cuts end////////////////////////////////////////////////////////////////////////
 
 
     // Histo versus Rap and armenteros plot
-    if (lOnFlyStatus == fUseOnTheFly){
+    if (!lOnFlyStatus){
       if (lCheckMcK0Short) fHistAsMcRapK0->Fill(lRapK0s);
       if (lCheckMcLambda) fHistAsMcRapLambda->Fill(lRapLambda);
       if (lCheckMcAntiLambda) fHistAsMcRapLambda->Fill(lRapAntiLambda);
-//      fHistArmenterosPodolanski->Fill(lAlphaV0,lPtArmV0);
-//      fHistDaughterPt->Fill(lPtPos,lPtNeg);
+      fHistArmenterosPodolanski->Fill(lAlphaV0,lPtArmV0);
+      if ((TMath::Abs(lRapK0s) < lCutRap)&&(TMath::Abs(lRapLambda) < lCutRap)) fHistK0sMassVsLambdaMass->Fill(lInvMassK0s,lInvMassLambda);
     }
-    
-    // FIXME: associated histos, what are they used for?
-
-    // K0s associated histograms in |rap| < lCutRap:
 
 
-    if ( lCheckPIDK0sPosDaughter && lCheckPIDK0sNegDaughter
-        && (lChi2KFK0s < cutChi2KF) && (TMath::Abs(lPzK0s/lPtK0s)<0.7) )     {
+    
+    // K0s associated histograms in |rap| < lCutRap:
 
-      
-      fHistChi2KFAfterCutK0s->Fill(lChi2KFK0s,lOnFlyStatus);
 
-      if (TMath::Abs(lRapK0s) < lCutRap) {
+    if (TMath::Abs(lRapK0s) < lCutRap) {
 
-       fHistNsigmaPosPionK0->Fill(nSigmaPosPion);
-       fHistNsigmaNegPionK0->Fill(nSigmaNegPion);
+      fHistNsigmaPosPionK0->Fill(nSigmaPosPion);
+      fHistNsigmaNegPionK0->Fill(nSigmaNegPion);
        
-       if (lOnFlyStatus == fUseOnTheFly){
-         fHistMassK0->Fill(lInvMassK0s);
-         fHistMassVsRadiusK0->Fill(rcPosRK0s,lInvMassK0s);
-         fHistPtVsMassK0->Fill(lInvMassK0s,lPtK0s);
-
-
-//       fHistMultVsPtVsMassK0->Fill(multiplicity ,lInvMassK0s,lPtK0s);
-         if(lCheckPIdK0Short) fHistPidMcMassK0->Fill(lInvMassK0s);
-         if(lCheckMcK0Short) {
-           fHistAsMcMassK0->Fill(lInvMassK0s);
-           fHistAsMcPtK0->Fill(lPtK0s);
-
-
-           fHistAsMcPtVsMassK0->Fill(lInvMassK0s,lPtK0s);
-           if (lPtK0s <= 1) fHistAsMcPtZoomK0->Fill(lPtK0s);
-           fHistAsMcMassVsRadiusK0->Fill(rcPosRK0s,lInvMassK0s);
-           fHistAsMcResxK0->Fill(rcPosXK0s-mcPosX);
-           fHistAsMcResyK0->Fill(rcPosYK0s-mcPosY);
-           fHistAsMcReszK0->Fill(rcPosZK0s-mcPosZ);
-           fHistAsMcResrVsRadiusK0->Fill(rcPosRK0s,rcPosRK0s-mcPosR);
-           fHistAsMcReszVsRadiusK0->Fill(rcPosZK0s,rcPosZK0s-mcPosZ);
-           fHistAsMcProdRadiusK0->Fill(mcPosMotherR);
-           fHistAsMcProdRadiusXvsYK0s->Fill(mcPosMotherX,mcPosMotherY);
-           fHistAsMcResPtK0->Fill(deltaPtK0s);
-           fHistAsMcResPtVsRapK0->Fill(deltaPtK0s,lRapK0s);
-           fHistAsMcResPtVsPtK0->Fill(deltaPtK0s,lPtK0s);
-         }
-         else if (lCheckSecondaryK0s) {
-           fHistAsMcSecondaryPtVsRapK0s->Fill(lPtK0s,lRapK0s);
-           fHistAsMcSecondaryProdRadiusK0s->Fill(mcPosMotherR);
-           fHistAsMcSecondaryProdRadiusXvsYK0s->Fill(mcPosMotherX,mcPosMotherY);
-           switch (lPdgcodeMotherOfMother) {
-           case 130   : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(0.5);break; // K0L
-           case 321   : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(1.5);break; // K+
-           case -321  : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(2.5);break; // K-
-           case -3122 : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(3.5);break; //AntiLambda
-           default    : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(6.5);break;
-           }
+      switch (lOnFlyStatus){
+      case 0 : 
+       fHistMassK0->Fill(lInvMassK0s);
+       fHistMassVsRadiusK0->Fill(rcPosRK0s,lInvMassK0s);
+       fHistPtVsMassK0->Fill(lInvMassK0s,lPtK0s);
+
+
+       //        fHistMultVsPtVsMassK0->Fill(multiplicity ,lInvMassK0s,lPtK0s);
+       if(lCheckPIdK0Short) fHistPidMcMassK0->Fill(lInvMassK0s);
+       if(lCheckMcK0Short) {
+         fHistAsMcMassK0->Fill(lInvMassK0s);
+         fHistAsMcPtK0->Fill(lPtK0s);
+
+
+         fHistAsMcPtVsMassK0->Fill(lInvMassK0s,lPtK0s);
+         if (lPtK0s <= 1) fHistAsMcPtZoomK0->Fill(lPtK0s);
+         fHistAsMcMassVsRadiusK0->Fill(rcPosRK0s,lInvMassK0s);
+         fHistAsMcResxK0->Fill(rcPosXK0s-mcPosX);
+         fHistAsMcResyK0->Fill(rcPosYK0s-mcPosY);
+         fHistAsMcReszK0->Fill(rcPosZK0s-mcPosZ);
+         fHistAsMcResrVsRadiusK0->Fill(rcPosRK0s,rcPosRK0s-mcPosR);
+         fHistAsMcReszVsRadiusK0->Fill(rcPosZK0s,rcPosZK0s-mcPosZ);
+         fHistAsMcProdRadiusK0->Fill(mcPosMotherR);
+         fHistAsMcProdRadiusXvsYK0s->Fill(mcPosMotherX,mcPosMotherY);
+         fHistAsMcResPtK0->Fill(deltaPtK0s);
+         fHistAsMcResPtVsRapK0->Fill(deltaPtK0s,lRapK0s);
+         fHistAsMcResPtVsPtK0->Fill(deltaPtK0s,lPtK0s);
+       }
+       else if (lCheckSecondaryK0s) {
+         fHistAsMcSecondaryPtVsRapK0s->Fill(lPtK0s,lRapK0s);
+         fHistAsMcSecondaryProdRadiusK0s->Fill(mcPosMotherR);
+         fHistAsMcSecondaryProdRadiusXvsYK0s->Fill(mcPosMotherX,mcPosMotherY);
+         switch (lPdgcodeMotherOfMother) {
+         case 130   : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(0.5);break; // K0L
+         case 321   : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(1.5);break; // K+
+         case -321  : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(2.5);break; // K-
+         case -3122 : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(3.5);break; //AntiLambda
+         default    : fHistAsMcSecondaryMotherPdgCodeK0s->Fill(6.5);break;
          }
        }
-      } // end rapidity condition
-    } // end nsigma condition
+       break;
+         
+      }
+    } // end rapidity condition
+
     
 
     // Associated Lambda histograms in |rap| < lCutRap
 
 
-    if ( lCheckPIDLambdaPosDaughter && lCheckPIDLambdaNegDaughter
-        && (lChi2KFLambda < cutChi2KF) && (TMath::Abs(lPzLambda/lPtLambda)<0.7) )  {
+    if (TMath::Abs(lRapLambda) < lCutRap) {
 
-    
+      fHistNsigmaPosProtonLambda->Fill(nSigmaPosProton);
+      fHistNsigmaNegPionLambda->Fill(nSigmaNegPion);
+      switch (lOnFlyStatus){
+      case 0 : 
+       fHistMassLambda->Fill(lInvMassLambda);
+       fHistMassVsRadiusLambda->Fill(rcPosRLambda,lInvMassLambda);
+       fHistPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
 
-      fHistChi2KFAfterCutLambda->Fill(lChi2KFLambda,lOnFlyStatus);
 
-      if (TMath::Abs(lRapLambda) < lCutRap) {
 
-       fHistNsigmaPosProtonLambda->Fill(nSigmaPosProton);
-       fHistNsigmaNegPionLambda->Fill(nSigmaNegPion);
-       if (lOnFlyStatus == fUseOnTheFly){
-         fHistMassLambda->Fill(lInvMassLambda);
-         fHistMassVsRadiusLambda->Fill(rcPosRLambda,lInvMassLambda);
-         fHistPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
 
-//          fHistMultVsPtVsMassLambda->Fill(multiplicity ,lInvMassLambda,lPtLambda);
-         if(lCheckPIdLambda) fHistPidMcMassLambda->Fill(lInvMassLambda);
+       //          fHistMultVsPtVsMassLambda->Fill(multiplicity ,lInvMassLambda,lPtLambda);
+       if(lCheckPIdLambda) fHistPidMcMassLambda->Fill(lInvMassLambda);
          
-         if(lCheckMcLambda) {
-           fHistAsMcMassLambda->Fill(lInvMassLambda);
-           fHistAsMcPtLambda->Fill(lPtLambda);
-
-
-           fHistAsMcPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
-           if (lPtLambda <= 1) fHistAsMcPtZoomLambda->Fill(lPtLambda);
-           fHistAsMcMassVsRadiusLambda->Fill(rcPosRLambda,lInvMassLambda);
-           fHistAsMcResxLambda->Fill(rcPosXLambda-mcPosX);
-           fHistAsMcResyLambda->Fill(rcPosYLambda-mcPosY);
-           fHistAsMcReszLambda->Fill(rcPosZLambda-mcPosZ);
-           fHistAsMcResrVsRadiusLambda->Fill(rcPosRLambda,rcPosRLambda-mcPosR);
-           fHistAsMcReszVsRadiusLambda->Fill(rcPosZLambda,rcPosZLambda-mcPosZ);
-           fHistAsMcProdRadiusLambda->Fill(mcPosMotherR);
-           fHistAsMcProdRadiusXvsYLambda->Fill(mcPosMotherX,mcPosMotherY);
-           fHistAsMcResPtLambda->Fill(deltaPtLambda);
-           fHistAsMcResPtVsRapLambda->Fill(deltaPtLambda,lRapLambda);
-           fHistAsMcResPtVsPtLambda->Fill(deltaPtLambda,lPtLambda);
-           if (lComeFromSigma) fHistAsMcPtLambdaFromSigma->Fill(lPtLambda);
-           switch (lPdgcodeMotherOfMother) {
-           case 3222 : fHistAsMcMotherPdgCodeLambda->Fill(0.5); break; // Sigma +
-           case 3212 : fHistAsMcMotherPdgCodeLambda->Fill(1.5); break; // Sigma 0
-           case 3112 : fHistAsMcMotherPdgCodeLambda->Fill(2.5); break;// Sigma -
-           case 3224 : fHistAsMcMotherPdgCodeLambda->Fill(3.5); break;// Sigma(1385) +
-           case 3214 : fHistAsMcMotherPdgCodeLambda->Fill(4.5); break;// Sigma(1385) 0
-           case 3114 : fHistAsMcMotherPdgCodeLambda->Fill(5.5); break;// Sigma(1385) -
-           case 3322 : fHistAsMcMotherPdgCodeLambda->Fill(6.5); break; // Xi 0
-           case 3312 : fHistAsMcMotherPdgCodeLambda->Fill(7.5); break; // Xi -
-           case 3334 : fHistAsMcMotherPdgCodeLambda->Fill(8.5); break; // Omega
-           case -1   : fHistAsMcMotherPdgCodeLambda->Fill(9.5); break;
-           default   : fHistAsMcMotherPdgCodeLambda->Fill(10.5);break; 
-           }
+       if(lCheckMcLambda) {
+         fHistAsMcMassLambda->Fill(lInvMassLambda);
+         fHistAsMcPtLambda->Fill(lPtLambda);
+
+
+         fHistAsMcPtVsMassLambda->Fill(lInvMassLambda,lPtLambda);
+         if (lPtLambda <= 1) fHistAsMcPtZoomLambda->Fill(lPtLambda);
+         fHistAsMcMassVsRadiusLambda->Fill(rcPosRLambda,lInvMassLambda);
+         fHistAsMcResxLambda->Fill(rcPosXLambda-mcPosX);
+         fHistAsMcResyLambda->Fill(rcPosYLambda-mcPosY);
+         fHistAsMcReszLambda->Fill(rcPosZLambda-mcPosZ);
+         fHistAsMcResrVsRadiusLambda->Fill(rcPosRLambda,rcPosRLambda-mcPosR);
+         fHistAsMcReszVsRadiusLambda->Fill(rcPosZLambda,rcPosZLambda-mcPosZ);
+         fHistAsMcProdRadiusLambda->Fill(mcPosMotherR);
+         fHistAsMcProdRadiusXvsYLambda->Fill(mcPosMotherX,mcPosMotherY);
+         fHistAsMcResPtLambda->Fill(deltaPtLambda);
+         fHistAsMcResPtVsRapLambda->Fill(deltaPtLambda,lRapLambda);
+         fHistAsMcResPtVsPtLambda->Fill(deltaPtLambda,lPtLambda);
+         if (lComeFromSigma) fHistAsMcPtLambdaFromSigma->Fill(lPtLambda);
+         switch (lPdgcodeMotherOfMother) {
+         case 3222 : fHistAsMcMotherPdgCodeLambda->Fill(0.5); break; // Sigma +
+         case 3212 : fHistAsMcMotherPdgCodeLambda->Fill(1.5); break; // Sigma 0
+         case 3112 : fHistAsMcMotherPdgCodeLambda->Fill(2.5); break;// Sigma -
+         case 3224 : fHistAsMcMotherPdgCodeLambda->Fill(3.5); break;// Sigma(1385) +
+         case 3214 : fHistAsMcMotherPdgCodeLambda->Fill(4.5); break;// Sigma(1385) 0
+         case 3114 : fHistAsMcMotherPdgCodeLambda->Fill(5.5); break;// Sigma(1385) -
+         case 3322 : fHistAsMcMotherPdgCodeLambda->Fill(6.5); break; // Xi 0
+         case 3312 : fHistAsMcMotherPdgCodeLambda->Fill(7.5); break; // Xi -
+         case 3334 : fHistAsMcMotherPdgCodeLambda->Fill(8.5); break; // Omega
+         case -1   : fHistAsMcMotherPdgCodeLambda->Fill(9.5); break;
+         default   : fHistAsMcMotherPdgCodeLambda->Fill(10.5);break; 
+         }
 
            
-           //printf("found Lambda RC dcaPos=%e dcaNeg=%e dcaDau=%e cosP=%e pT=%e mass=%e\n",lDcaPosToPrimVertex ,lDcaNegToPrimVertex ,lDcaV0Daughters,lV0cosPointAngle,lPtLambda,lInvMassLambda);
-           //printf("found Lambda RC Pindex=%d  Nindex=%d  Plabel=%d  Nlabel=%d\n\n",lIndexTrackPos,lIndexTrackNeg,lLabelTrackPos,lLabelTrackNeg);
+         //printf("found Lambda RC dcaPos=%e dcaNeg=%e dcaDau=%e cosP=%e pT=%e mass=%e\n",lDcaPosToPrimVertex ,lDcaNegToPrimVertex ,lDcaV0Daughters,lV0cosPointAngle,lPtLambda,lInvMassLambda);
+         //printf("found Lambda RC Pindex=%d  Nindex=%d  Plabel=%d  Nlabel=%d\n\n",lIndexTrackPos,lIndexTrackNeg,lLabelTrackPos,lLabelTrackNeg);
            
-         }
+       }
          
-         else if (lCheckSecondaryLambda) {
-           fHistAsMcSecondaryPtVsRapLambda->Fill(lPtLambda,lRapLambda);
-           fHistAsMcSecondaryProdRadiusLambda->Fill(mcPosMotherR); 
-           fHistAsMcSecondaryProdRadiusXvsYLambda->Fill(mcPosMotherX,mcPosMotherY);
-           if (lComeFromSigma) fHistAsMcSecondaryPtLambdaFromSigma->Fill(lPtLambda);
-           printf(" lPdgcodeMotherOfMother= %d",lPdgcodeMotherOfMother);
-           switch (lPdgcodeMotherOfMother) {
-           case 3222 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(0.5); break;// Sigma +
-           case 3212 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(1.5); break;// Sigma 0
-           case 3112 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(2.5); break;// Sigma -
-           case 3224 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(3.5); break;// Sigma(1385) +
-           case 3214 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(4.5); break;// Sigma(1385) 0
-           case 3114 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(5.5); break;// Sigma(1385) -
-           case 3322 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(6.5); break; // Xi 0
-           case 3312 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(7.5); break; // Xi -
-           case 3334 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(8.5); break; // Omega
-           case -1   : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(9.5); break;
-           default   : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(10.5);break;
-           }
+       else if (lCheckSecondaryLambda) {
+         fHistAsMcSecondaryPtVsRapLambda->Fill(lPtLambda,lRapLambda);
+         fHistAsMcSecondaryProdRadiusLambda->Fill(mcPosMotherR); 
+         fHistAsMcSecondaryProdRadiusXvsYLambda->Fill(mcPosMotherX,mcPosMotherY);
+         if (lComeFromSigma) fHistAsMcSecondaryPtLambdaFromSigma->Fill(lPtLambda);
+         printf(" lPdgcodeMotherOfMother= %d",lPdgcodeMotherOfMother);
+         switch (lPdgcodeMotherOfMother) {
+         case 3222 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(0.5); break;// Sigma +
+         case 3212 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(1.5); break;// Sigma 0
+         case 3112 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(2.5); break;// Sigma -
+         case 3224 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(3.5); break;// Sigma(1385) +
+         case 3214 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(4.5); break;// Sigma(1385) 0
+         case 3114 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(5.5); break;// Sigma(1385) -
+         case 3322 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(6.5); break; // Xi 0
+         case 3312 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(7.5); break; // Xi -
+         case 3334 : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(8.5); break; // Omega
+         case -1   : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(9.5); break;
+         default   : fHistAsMcSecondaryMotherPdgCodeLambda->Fill(10.5);break;
          }
        }
-      } // end rapidity condition
-    } //end nsigma condition - lambda
+       break;
+         
+      }
+    } // end rapidity condition
+
 
 
     if (negPiKF) delete negPiKF; negPiKF= NULL;
@@ -2636,53 +2396,55 @@ void AliAnalysisTaskPerformanceStrange::UserExec(Option_t *)
     
   } // end V0 loop
 
+  //  if (primaryVtxKF) delete primaryVtxKF;primaryVtxKF=NULL ;
+
+
   fHistV0Multiplicity->Fill(nv0s);
+  //  fHistV0MultiplicityMI->Fill(nv0sMI);
+
   if (fAnalysisType == "ESD") { if(myPrimaryVertex) delete myPrimaryVertex; }
 
-  if(myTracksCuts) delete myTracksCuts;
   
   // Post output data
-  PostData(1, fListHist);
-  PostData(2, fCentrSelector);
 }      
 
 //________________________________________________________________________
 void AliAnalysisTaskPerformanceStrange::Terminate(Option_t *) 
 {/*
-  // Draw result to the screen
-  // Called once at the end of the query
+ // Draw result to the screen
+ // Called once at the end of the query
 
-  TList *cRetrievedList = 0x0;
-  cRetrievedList = (TList*)GetOutputData(1);
+ TList *cRetrievedList = 0x0;
+ cRetrievedList = (TList*)GetOutputData(1);
   
-  if(!cRetrievedList){
-    AliWarning("ERROR - AliAnalysisTaskPerformanceStrange: output data container list not available\n"); return;
-  }
+ if(!cRetrievedList){
+ AliWarning("ERROR - AliAnalysisTaskPerformanceStrange: output data container list not available\n"); return;
+ }
   
   
-  fHistV0Multiplicity = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0Multiplicity"));
-  if (!fHistV0Multiplicity) {
-    Printf("ERROR: fHistV0Multiplicity not available");
-    return;
-  }
-
-  fHistV0MultiplicityMI = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityMI"));
-  if (!fHistV0MultiplicityMI) {
-    Printf("ERROR: fHistV0MultiplicityMI not available");
-    return;
-  }
-
-  TCanvas *canPerformanceStrange = new TCanvas("AliAnalysisTaskCheckV0","Multiplicity",10,10,510,510);
-  canPerformanceStrange->Divide(2,1);
-  if (fHistV0Multiplicity->GetMaximum() > 0.) canPerformanceStrange->cd(1)->SetLogy();
-  fHistV0Multiplicity->SetMarkerStyle(25);
-  fHistV0Multiplicity->DrawCopy("E");
-  if (fHistV0MultiplicityMI->GetMaximum() > 0.) canPerformanceStrange->cd(2)->SetLogy();
-  fHistV0MultiplicityMI->SetMarkerStyle(24);
-  fHistV0MultiplicityMI->DrawCopy("E");
+ fHistV0Multiplicity = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0Multiplicity"));
+ if (!fHistV0Multiplicity) {
+ Printf("ERROR: fHistV0Multiplicity not available");
+ return;
+ }
+
+ fHistV0MultiplicityMI = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityMI"));
+ if (!fHistV0MultiplicityMI) {
+ Printf("ERROR: fHistV0MultiplicityMI not available");
+ return;
+ }
+
+ TCanvas *canPerformanceStrange = new TCanvas("AliAnalysisTaskCheckV0","Multiplicity",10,10,510,510);
+ canPerformanceStrange->Divide(2,1);
+ if (fHistV0Multiplicity->GetMaximum() > 0.) canPerformanceStrange->cd(1)->SetLogy();
+ fHistV0Multiplicity->SetMarkerStyle(25);
+ fHistV0Multiplicity->DrawCopy("E");
+ if (fHistV0MultiplicityMI->GetMaximum() > 0.) canPerformanceStrange->cd(2)->SetLogy();
+ fHistV0MultiplicityMI->SetMarkerStyle(24);
+ fHistV0MultiplicityMI->DrawCopy("E");
   
 
-*/ 
+ */ 
 }
 
 //----------------------------------------------------------------------------
index 6d9af01..84f839c 100644 (file)
@@ -14,15 +14,15 @@ class TString;
 class TList;
 class TH1F;
 class TH2F;
-class AliAnalysisCentralitySelector;
 //class TH3F;
+class AliAnalysisCentralitySelector;
 #include "AliAnalysisTaskSE.h"
 
 class AliAnalysisTaskPerformanceStrange : public AliAnalysisTaskSE {
  public:
   AliAnalysisTaskPerformanceStrange();
   AliAnalysisTaskPerformanceStrange(const char *name);
-  virtual ~AliAnalysisTaskPerformanceStrange() {}
+  virtual ~AliAnalysisTaskPerformanceStrange(); // Destructor implemented by Kalinak  
   
   virtual void   UserCreateOutputObjects();
   virtual void   UserExec(Option_t *option);
@@ -33,236 +33,398 @@ class AliAnalysisTaskPerformanceStrange : public AliAnalysisTaskSE {
   void   SetAnalysisType(const char* analysisType) {fAnalysisType = analysisType;}
   void   SetUsePID(const char* usePID) {fUsePID = usePID;}
   void   SetAnalysisCut(const char* useCut) {fUseCut = useCut;}
-  void   UseOnTheFly(Bool_t useOnTheFly) {fUseOnTheFly = useOnTheFly;}
+  void   SetCentralityRange(Int_t down, Int_t up) {fDown=down; fUp = up;}
+  void   SetTrackCuts(AliESDtrackCuts * myTracksCuts) { fTracksCuts = myTracksCuts;}
   void   SetCentralitySelector(AliAnalysisCentralitySelector * centr) { fCentrSelector = centr;}
   Double_t MyRapidity(Double_t rE, Double_t rPz) const;
  
  private:
-  Double_t fCuts[7];                              //! V0 finding cuts
-  Bool_t       fAnalysisMC;                       //  0->No MC or 1->MC analysis
-  TString      fAnalysisType;                     //  "ESD" or "AOD"
-  Bool_t       fCollidingSystems;                 //  Colliding systems 0/1 for pp/PbPb  
-  TString      fUsePID;                           //  "withPID" or "noPID"
-  TString      fUseCut;                           //  "yes" or "no"
-  Bool_t       fUseOnTheFly;                      //  0->Offline V0s or 1->Onthefly V0s
-
-  AliESDEvent *fESD;                              //! ESD object
-
-  TList       *fListHist;                        //! Output List
+  Double_t fCuts[7];                            //! V0 finding cuts
+  Bool_t       fAnalysisMC;                     //  0->No MC or 1->MC analysis
+  TString      fAnalysisType;                   //  "ESD" or "AOD"
+  Bool_t       fCollidingSystems;               //  Colliding systems 0/1 for pp/PbPb  
+  TString      fUsePID;                         //  "withPID" or "noPID"
+  TString      fUseCut;                         //  "yes" or "no"
+  Int_t                fDown;                          //centrality range 
+  Int_t                fUp;
+  AliESDEvent *fESD;                            //! ESD object
+  TList       *fListHist;              //! Output List
 
   AliAnalysisCentralitySelector * fCentrSelector; // Centrality selector, used to 
+  AliESDtrackCuts * fTracksCuts;               // track cuts
 
-  // MC histograms  ---------------------------------------
-  TH1F        *fHistMCPrimaryVertexX;             //! Primary Vertex X
-  TH1F        *fHistMCPrimaryVertexY;             //! Primary Vertex Y
-  TH1F        *fHistMCPrimaryVertexZ;             //! Primary Vertex Z
+  // MC histograms
+  TH1F        *fHistMCPrimaryVertexX;      //! Histo
+  TH1F        *fHistMCPrimaryVertexY;      //! Histo
+  TH1F        *fHistMCPrimaryVertexZ;      //! Histo
 
-  TH1F        *fHistMCMultiplicityPrimary;        //! Multiplicity Primaries
-  TH1F        *fHistMCMultiplicityTracks;         //! Multiplicity Tracks
+  TH1F        *fHistMCMultiplicityPrimary;       //! Histo
+  TH1F        *fHistMCMultiplicityTracks;       //! Histo
+  TH1F        *fHistTPCTracks;                  //! Histo
+  
+  TH2F        *fHistMCtracksProdRadiusK0s;       //! Histo
+  TH2F        *fHistMCtracksProdRadiusLambda;       //! Histo
+  TH2F        *fHistMCtracksProdRadiusAntiLambda;       //! Histo
+
+  TH1F        *fHistMCtracksDecayRadiusK0s;       //! Histo
+  TH1F        *fHistMCtracksDecayRadiusLambda;       //! Histo
+  TH1F        *fHistMCtracksDecayRadiusAntiLambda;       //! Histo
+
+  TH1F        *fHistMCPtAllK0s;       //! Histo
+  TH1F        *fHistMCPtAllLambda;       //! Histo
+  TH1F        *fHistMCPtAllAntiLambda;       //! Histo
+
+  TH1F        *fHistMCProdRadiusK0s;       //! Histo
+  TH1F        *fHistMCProdRadiusLambda;       //! Histo
+  TH1F        *fHistMCProdRadiusAntiLambda;       //! Histo
+
+  TH1F        *fHistMCRapK0s;                 //! Histo
+  TH1F        *fHistMCRapInPtRangeK0s;        //! Histo
+  TH1F        *fHistMCRapLambda;              //! Histo
+  TH1F        *fHistMCRapInPtRangeLambda;     //! Histo
+  TH1F        *fHistMCRapAntiLambda;          //! Histo
+  TH1F        *fHistMCRapInPtRangeAntiLambda; //! Histo
+  TH1F        *fHistMCRapXi;                  //! Histo
+  TH1F        *fHistMCRapInPtRangeXi;         //! Histo
+  TH1F        *fHistMCRapPhi;                 //! Histo
+  TH1F        *fHistMCRapInPtRangePhi;        //! Histo
+////////////////////////////////////////////////////////// 
+  TH1F        *fHistMCPtK0s;       //! Histo
+
+
+  TH1F        *fHistMCPtLambda;       //! Histo
+//////////////////////////////////////////////////////////
+
+  TH1F        *fHistMCPtLambdaFromSigma;       //! Histo
+  TH1F        *fHistMCPtAntiLambdaFromSigma;       //! Histo
+
+  TH1F        *fHistNTimesRecK0s;       //! Histo
+//  TH1F        *fHistNTimesRecK0sMI;       //! Histo
+  TH1F        *fHistNTimesRecLambda;       //! Histo
+//  TH1F        *fHistNTimesRecLambdaMI;       //! Histo
+  TH1F        *fHistNTimesRecAntiLambda;       //! Histo
+//  TH1F        *fHistNTimesRecAntiLambdaMI;       //! Histo
+
+  TH2F        *fHistNTimesRecK0sVsPt;       //! Histo
+//  TH2F        *fHistNTimesRecK0sVsPtMI;       //! Histo
+  TH2F        *fHistNTimesRecLambdaVsPt;       //! Histo
+//  TH2F        *fHistNTimesRecLambdaVsPtMI;       //! Histo
+  TH2F        *fHistNTimesRecAntiLambdaVsPt;       //! Histo
+//  TH2F        *fHistNTimesRecAntiLambdaVsPtMI;       //! Histo
+
+  // ESD histograms
+  TH1F        *fHistNumberEvents;        //! Histo
+  TH1F        *fHistTrackPerEvent;       //! Histo
+
+  TH1F        *fHistTPCMult;
+
+  TH1F        *fHistTrackletPerEvent;   //! Histo
+  TH1F        *fHistMCDaughterTrack;       //! Histo
+
+  TH1F        *fHistSPDPrimaryVertexZ;       //! Histo
+
+  TH1F        *fHistPrimaryVertexX;       //! Histo
+  TH1F        *fHistPrimaryVertexY;       //! Histo
+  TH1F        *fHistPrimaryVertexZ;       //! Histo
+
+  TH1F        *fHistPrimaryVertexResX;       //! Histo
+  TH1F        *fHistPrimaryVertexResY;       //! Histo
+  TH1F        *fHistPrimaryVertexResZ;       //! Histo
+
+  TH1F        *fHistPrimaryVertexPosXV0events;  //! Primary vertex position in X in events with V0 candidates
+  TH1F        *fHistPrimaryVertexPosYV0events;  //! Primary vertex position in Y in events with V0 candidates
+  TH1F        *fHistPrimaryVertexPosZV0events;  //! Primary vertex position in Z in events with V0 candidates
+
+  TH2F        *fHistDaughterPt;               //! Histo
+
+///////////////////////////K0s 2D histos: cut vs on fly status/////////////////
+
+  TH2F        *fHistDcaPosToPrimVertexK0;       //! Histo
+  TH2F        *fHistDcaNegToPrimVertexK0;       //! Histo
+//  TH2F        *fHistDcaPosToPrimVertexZoomK0;       //! Histo
+//  TH2F        *fHistDcaNegToPrimVertexZoomK0;       //! Histo
+  TH2F        *fHistRadiusV0K0;       //! Histo
+  TH2F        *fHistDecayLengthV0K0;       //! Histo
+  TH2F        *fHistDcaV0DaughtersK0;       //! Histo
+  TH2F        *fHistChi2K0;       //! Histo
+  TH2F        *fHistCosPointAngleK0;       //! Histo
+//  TH2F        *fHistCosPointAngleZoomK0;       //! Histo
+//  TH2F        *fHistProdRadiusK0;       //! Histo
+
+///////////////////////////K0s 2D histos: cut vs mass//////////////
+  TH2F        *fHistDcaPosToPrimVertexK0vsMassK0;
+  TH2F        *fHistDcaNegToPrimVertexK0vsMassK0;
+  TH2F        *fHistRadiusV0K0vsMassK0;
+  TH2F        *fHistDecayLengthV0K0vsMassK0;
+  TH2F        *fHistDcaV0DaughtersK0vsMassK0;
+  TH2F        *fHistCosPointAngleK0vsMassK0;
+  
+  // pt1
+  TH2F        *fHistDcaPosToPrimVertexK0vsMassK0pt1;
+  TH2F        *fHistDcaNegToPrimVertexK0vsMassK0pt1;
+  TH2F        *fHistRadiusV0K0vsMassK0pt1;
+  TH2F        *fHistDecayLengthV0K0vsMassK0pt1;
+  TH2F        *fHistDcaV0DaughtersK0vsMassK0pt1;
+  TH2F        *fHistCosPointAngleK0vsMassK0pt1;
+  
+  // pt2
+  TH2F        *fHistDcaPosToPrimVertexK0vsMassK0pt2;
+  TH2F        *fHistDcaNegToPrimVertexK0vsMassK0pt2;
+  TH2F        *fHistRadiusV0K0vsMassK0pt2;
+  TH2F        *fHistDecayLengthV0K0vsMassK0pt2;
+  TH2F        *fHistDcaV0DaughtersK0vsMassK0pt2;
+  TH2F        *fHistCosPointAngleK0vsMassK0pt2;
+
+  // pt3
+  TH2F        *fHistDcaPosToPrimVertexK0vsMassK0pt3;
+  TH2F        *fHistDcaNegToPrimVertexK0vsMassK0pt3;
+  TH2F        *fHistRadiusV0K0vsMassK0pt3;
+  TH2F        *fHistDecayLengthV0K0vsMassK0pt3;
+  TH2F        *fHistDcaV0DaughtersK0vsMassK0pt3;
+  TH2F        *fHistCosPointAngleK0vsMassK0pt3;
+
+//////////////////////////Lambda 2D histos: cut vs on fly status////////////////////
+
+  TH2F        *fHistDcaPosToPrimVertexL;       //! Histo
+  TH2F        *fHistDcaNegToPrimVertexL;       //! Histo
+//  TH2F        *fHistDcaPosToPrimVertexZoomL;       //! Histo
+//  TH2F        *fHistDcaNegToPrimVertexZoomL;       //! Histo
+  TH2F        *fHistRadiusV0L;       //! Histo
+  TH2F        *fHistDecayLengthV0L;       //! Histo
+  TH2F        *fHistDcaV0DaughtersL;       //! Histo
+  TH2F        *fHistChi2L;       //! Histo
+  TH2F        *fHistCosPointAngleL;       //! Histo
+//  TH2F        *fHistCosPointAngleZoomL;       //! Histo
+//  TH2F        *fHistProdRadiusL;       //! Histo    
+
+//////////////////////////Lambda 2D histos: cut vs mass////////////////
+  TH2F        *fHistDcaPosToPrimVertexLvsMassL;
+  TH2F        *fHistDcaNegToPrimVertexLvsMassL;
+  TH2F        *fHistRadiusV0LvsMassL;
+  TH2F        *fHistDecayLengthV0LvsMassL;
+  TH2F        *fHistDcaV0DaughtersLvsMassL;
+  TH2F        *fHistCosPointAngleLvsMassL;
+
+//////////////////////////////////////////////////////////////////////
+
+//  TH2F        *fHistProdRadiusMI;       //! Histo
+
+  TH1F        *fHistV0Multiplicity;  //! Histo
+//  TH1F        *fHistV0MultiplicityMI; //! Histo
+
+
+  TH1F        *fHistMassK0;       //! Histo
+//  TH1F        *fHistMassK0MI;       //! Histo
+  TH1F        *fHistMassLambda;       //! Histo
+//  TH1F        *fHistMassLambdaMI;       //! Histo
+  TH1F        *fHistMassAntiLambda;       //! Histo
+//  TH1F        *fHistMassAntiLambdaMI;       //! Histo
+
+  TH2F        *fHistMassVsRadiusK0;       //! Histo
+//  TH2F        *fHistMassVsRadiusK0MI;       //! Histo
+  TH2F        *fHistMassVsRadiusLambda;       //! Histo
+//  TH2F        *fHistMassVsRadiusLambdaMI;       //! Histo
+  TH2F        *fHistMassVsRadiusAntiLambda;       //! Histo
+//  TH2F        *fHistMassVsRadiusAntiLambdaMI;       //! Histo
+
+////////////////////////////////////////////////////////////////////////////
+  TH2F        *fHistPtVsMassK0;       //! Histo
+//  TH2F        *fHistPtVsMassK0MI;       //! Histo
+  TH2F        *fHistPtVsMassLambda;       //! Histo
+
+
+//  TH2F        *fHistPtVsMassLambdaMI;       //! Histo
+//  TH2F        *fHistPtVsMassAntiLambda;       //! Histo
+//  TH2F        *fHistPtVsMassAntiLambdaMI;       //! Histo
+
+
+/////////////////////////////////////////////
+
+  TH2F        *fHistArmenterosPodolanski;       //! Histo
+  TH2F        *fHistK0sMassVsLambdaMass;       //! Histo
+
+//  TH2F        *fHistArmenterosPodolanskiMI;       //! Histo
+
+  //PID
+  TH1F        *fHistNsigmaPosPionAntiLambda;    //! Histo
+  TH1F        *fHistNsigmaNegProtonAntiLambda;   //! Histo
+  TH1F        *fHistNsigmaPosProtonLambda;        //! Histo
+  TH1F        *fHistNsigmaNegPionLambda;           //! Histo
+  TH1F        *fHistNsigmaPosPionK0;                //! Histo
+  TH1F        *fHistNsigmaNegPionK0;                 //! Histo
+
+  // Associated particles histograms
+  TH1F        *fHistAsMcRapK0;       //! Histo
+//  TH1F        *fHistAsMcRapK0MI;       //! Histo
+  TH1F        *fHistAsMcRapLambda;       //! Histo
+//  TH1F        *fHistAsMcRapLambdaMI;       //! Histo
+  TH1F        *fHistAsMcRapAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcRapAntiLambdaMI;       //! Histo
+
+////////////////////////////////////////////////////////////////////
+  TH1F        *fHistAsMcPtK0;       //! Histo
+
+
+//  TH1F        *fHistAsMcPtK0MI;       //! Histo
+  TH1F        *fHistAsMcPtLambda;       //! Histo
+/////////////////////////////////////////////////////////////////////
+
+//  TH1F        *fHistAsMcPtAntiLambdaMI;       //! Histo
+  TH1F        *fHistAsMcPtZoomK0;       //! Histo
+//  TH1F        *fHistAsMcPtZoomK0MI;       //! Histo
+  TH1F        *fHistAsMcPtZoomLambda;       //! Histo
+//    TH1F        *fHistAsMcPtZoomLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcProdRadiusK0;       //! Histo
+//  TH1F        *fHistAsMcProdRadiusK0MI;       //! Histo
+  TH1F        *fHistAsMcProdRadiusLambda;       //! Histo
+//  TH1F        *fHistAsMcProdRadiusLambdaMI;       //! Histo
+  TH1F        *fHistAsMcProdRadiusAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcProdRadiusAntiLambdaMI;       //! Histo
+
+  TH2F        *fHistAsMcProdRadiusXvsYK0s;       //! Histo
+//  TH2F        *fHistAsMcProdRadiusXvsYK0sMI;       //! Histo
+  TH2F        *fHistAsMcProdRadiusXvsYLambda;       //! Histo
+//  TH2F        *fHistAsMcProdRadiusXvsYLambdaMI;       //! Histo
+  TH2F        *fHistAsMcProdRadiusXvsYAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcProdRadiusXvsYAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistPidMcMassK0;       //! Histo
+//  TH1F        *fHistPidMcMassK0MI;       //! Histo
+  TH1F        *fHistPidMcMassLambda;       //! Histo
+//  TH1F        *fHistPidMcMassLambdaMI;       //! Histo
+  TH1F        *fHistPidMcMassAntiLambda;       //! Histo
+//  TH1F        *fHistPidMcMassAntiLambdaMI;       //! Histo
+  TH1F        *fHistAsMcMassK0;       //! Histo
+//  TH1F        *fHistAsMcMassK0MI;       //! Histo
+  TH1F        *fHistAsMcMassLambda;       //! Histo
+//  TH1F        *fHistAsMcMassLambdaMI;       //! Histo
+  TH1F        *fHistAsMcMassAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcMassAntiLambdaMI;       //! Histo
+
+  TH2F        *fHistAsMcPtVsMassK0;       //! Histo
+//  TH2F        *fHistAsMcPtVsMassK0MI;       //! Histo
+  TH2F        *fHistAsMcPtVsMassLambda;       //! Histo
+//  TH2F        *fHistAsMcPtVsMassLambdaMI;       //! Histo
+  TH2F        *fHistAsMcPtVsMassAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcPtVsMassAntiLambdaMI;       //! Histo
+
+
+  TH2F        *fHistAsMcMassVsRadiusK0;       //! Histo
+//  TH2F        *fHistAsMcMassVsRadiusK0MI;       //! Histo
+  TH2F        *fHistAsMcMassVsRadiusLambda;       //! Histo
+//  TH2F        *fHistAsMcMassVsRadiusLambdaMI;       //! Histo
+  TH2F        *fHistAsMcMassVsRadiusAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcMassVsRadiusAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcResxK0;       //! Histo
+  TH1F        *fHistAsMcResyK0;       //! Histo
+  TH1F        *fHistAsMcReszK0;       //! Histo
+
+  TH2F        *fHistAsMcResrVsRadiusK0;       //! Histo
+  TH2F        *fHistAsMcReszVsRadiusK0;       //! Histo
+
+//  TH1F        *fHistAsMcResxK0MI;       //! Histo
+//  TH1F        *fHistAsMcResyK0MI;       //! Histo
+//  TH1F        *fHistAsMcReszK0MI;       //! Histo
+
+//  TH2F        *fHistAsMcResrVsRadiusK0MI;       //! Histo
+//  TH2F        *fHistAsMcReszVsRadiusK0MI;       //! Histo
+
+  TH1F        *fHistAsMcResxLambda;       //! Histo
+  TH1F        *fHistAsMcResyLambda;       //! Histo
+  TH1F        *fHistAsMcReszLambda;       //! Histo
+
+  TH2F        *fHistAsMcResrVsRadiusLambda;       //! Histo
+  TH2F        *fHistAsMcReszVsRadiusLambda;       //! Histo
+    
+//  TH1F        *fHistAsMcResxLambdaMI;       //! Histo
+//  TH1F        *fHistAsMcResyLambdaMI;       //! Histo
+//  TH1F        *fHistAsMcReszLambdaMI;       //! Histo
+
+//  TH2F        *fHistAsMcResrVsRadiusLambdaMI;       //! Histo
+//  TH2F        *fHistAsMcReszVsRadiusLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcResxAntiLambda;       //! Histo
+  TH1F        *fHistAsMcResyAntiLambda;       //! Histo
+  TH1F        *fHistAsMcReszAntiLambda;       //! Histo
+
+  TH2F        *fHistAsMcResrVsRadiusAntiLambda;       //! Histo
+  TH2F        *fHistAsMcReszVsRadiusAntiLambda;       //! Histo
+    
+//  TH1F        *fHistAsMcResxAntiLambdaMI;       //! Histo
+//  TH1F        *fHistAsMcResyAntiLambdaMI;       //! Histo
+//  TH1F        *fHistAsMcReszAntiLambdaMI;       //! Histo
+
+//  TH2F        *fHistAsMcResrVsRadiusAntiLambdaMI;       //! Histo
+//  TH2F        *fHistAsMcReszVsRadiusAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcResPtK0;       //! Histo
+//  TH1F        *fHistAsMcResPtK0MI;       //! Histo
+  TH1F        *fHistAsMcResPtLambda;       //! Histo
+//  TH1F        *fHistAsMcResPtLambdaMI;       //! Histo
+  TH1F        *fHistAsMcResPtAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcResPtAntiLambdaMI;       //! Histo
+
+  TH2F        *fHistAsMcResPtVsRapK0;       //! Histo
+//  TH2F        *fHistAsMcResPtVsRapK0MI;       //! Histo
+  TH2F        *fHistAsMcResPtVsRapLambda;       //! Histo
+//  TH2F        *fHistAsMcResPtVsRapLambdaMI;       //! Histo
+  TH2F        *fHistAsMcResPtVsRapAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcResPtVsRapAntiLambdaMI;       //! Histo
+  TH2F        *fHistAsMcResPtVsPtK0;       //! Histo
+ // TH2F        *fHistAsMcResPtVsPtK0MI;       //! Histo
+  TH2F        *fHistAsMcResPtVsPtLambda;       //! Histo
+//  TH2F        *fHistAsMcResPtVsPtLambdaMI;       //! Histo
+  TH2F        *fHistAsMcResPtVsPtAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcResPtVsPtAntiLambdaMI;       //! Histo
   
-  TH2F        *fHistMCtracksProdRadiusK0s;        //! Production Radius vs. tracks
-  TH2F        *fHistMCtracksProdRadiusLambda;     //! Production Radius vs. tracks
-  TH2F        *fHistMCtracksProdRadiusAntiLambda; //! Production Radius vs. tracks
-
-  TH1F        *fHistMCtracksDecayRadiusK0s;       //! Decay Radius
-  TH1F        *fHistMCtracksDecayRadiusLambda;    //! Decay Radius
-  TH1F        *fHistMCtracksDecayRadiusAntiLambda;//! Decay Radius
-
-  TH1F        *fHistMCPtAllK0s;                   //! Pt Distribution
-  TH1F        *fHistMCPtAllLambda;                //! Pt Distribution
-  TH1F        *fHistMCPtAllAntiLambda;            //! Pt Distribution
-
-  TH1F        *fHistMCProdRadiusK0s;              //! Production Radius
-  TH1F        *fHistMCProdRadiusLambda;           //! Production Radius
-  TH1F        *fHistMCProdRadiusAntiLambda;       //! Production Radius
-
-  TH1F        *fHistMCRapK0s;                     //! Rapidity distribution
-  TH1F        *fHistMCRapInPtRangeK0s;            //! Rapidity distribution
-  TH1F        *fHistMCRapLambda;                  //! Rapidity distribution
-  TH1F        *fHistMCRapInPtRangeLambda;         //! Rapidity distribution
-  TH1F        *fHistMCRapAntiLambda;              //! Rapidity distribution
-  TH1F        *fHistMCRapInPtRangeAntiLambda;     //! Rapidity distribution
-  TH1F        *fHistMCRapXi;                      //! Rapidity distribution
-  TH1F        *fHistMCRapInPtRangeXi;             //! Rapidity distribution
-  TH1F        *fHistMCRapPhi;                     //! Rapidity distribution
-  TH1F        *fHistMCRapInPtRangePhi;            //! Rapidity distribution
-
-  TH1F        *fHistMCPtK0s;                      //! Pt distribution K0s
-  TH1F        *fHistMCPtLambda;                   //! Pt distribution Lambda
-
-  TH1F        *fHistMCPtLambdaFromSigma;          //! Pt distribution of Lambda <- Sigma decay
-  TH1F        *fHistMCPtAntiLambdaFromSigma;      //! Pt distribution of anti-Lambda <- Sigma decay
-
-  TH1F        *fHistNTimesRecK0s;                 //! Multiple reconstruction studies
-  TH1F        *fHistNTimesRecLambda;              //! Multiple reconstruction studies
-  TH1F        *fHistNTimesRecAntiLambda;          //! Multiple reconstruction studies
-
-  TH2F        *fHistNTimesRecK0sVsPt;             //! Multiple reconstruction studies
-  TH2F        *fHistNTimesRecLambdaVsPt;          //! Multiple reconstruction studies
-  TH2F        *fHistNTimesRecAntiLambdaVsPt;      //! Multiple reconstruction studies
-  // ------------------------------------------------------
-
-  // Reconstructed particle histograms  -------------------
-  TH1F        *fHistNumberEvents;                 //! Number of events
-  TH1F        *fHistTrackPerEvent;                //! Multiplicity
-  TH1F        *fHistTrackletPerEvent;             //! Multiplicity
-  TH1F        *fHistMCDaughterTrack;              //! Multiplicity
-
-  TH1F        *fHistSPDPrimaryVertexZ;            //! Primary vertex
-
-  TH1F        *fHistPrimaryVertexX;               //! Primary vertex
-  TH1F        *fHistPrimaryVertexY;               //! Primary vertex
-  TH1F        *fHistPrimaryVertexZ;               //! Primary vertex
-
-  TH1F        *fHistPrimaryVertexResX;            //! Primary vertex resolution
-  TH1F        *fHistPrimaryVertexResY;            //! Primary vertex resolution
-  TH1F        *fHistPrimaryVertexResZ;            //! Primary vertex resolution
-
-  TH1F        *fHistPrimaryVertexPosXV0events;    //! Primary vertex position in X in events with V0 candidates
-  TH1F        *fHistPrimaryVertexPosYV0events;    //! Primary vertex position in Y in events with V0 candidates
-  TH1F        *fHistPrimaryVertexPosZV0events;    //! Primary vertex position in Z in events with V0 candidates
-
-  TH2F        *fHistDaughterPt;                   //! Daughters Pt
-
-  TH2F        *fHistDcaPosToPrimVertex;           //! Cut checks
-  TH2F        *fHistDcaNegToPrimVertex;           //! Cut checks
-  TH2F        *fHistDcaPosToPrimVertexZoom;       //! Cut checks
-  TH2F        *fHistDcaNegToPrimVertexZoom;       //! Cut checks
-  TH2F        *fHistRadiusV0;                     //! Cut checks
-  TH2F        *fHistDecayLengthV0;                //! Cut checks
-  TH2F        *fHistDcaV0Daughters;               //! Cut checks
-  TH2F        *fHistChi2;                         //! Cut checks
-  TH2F        *fHistCosPointAngle;                //! Cut checks
-  TH2F        *fHistCosPointAngleZoom;            //! Cut checks
-  TH2F        *fHistProdRadius;                   //! Cut checks
-
-  TH1F        *fHistV0Multiplicity;               //! V0 Multiplicity
-
-  TH2F        *fHistChi2KFBeforeCutK0s;           //! Kalman filter Chi2
-  TH2F        *fHistChi2KFBeforeCutLambda;        //! Kalman filter Chi2
-  TH2F        *fHistChi2KFBeforeCutAntiLambda;    //! Kalman filter Chi2
-  TH2F        *fHistChi2KFAfterCutK0s;            //! Kalman filter Chi2
-  TH2F        *fHistChi2KFAfterCutLambda;         //! Kalman filter Chi2
-  TH2F        *fHistChi2KFAfterCutAntiLambda;     //! Kalman filter Chi2
-
-  TH1F        *fHistMassK0;                       //! Invariant mass
-  TH1F        *fHistMassLambda;                   //! Invariant mass
-  TH1F        *fHistMassAntiLambda;               //! Invariant mass
-
-  TH2F        *fHistMassVsRadiusK0;               //! Invariant mass vs. radius
-  TH2F        *fHistMassVsRadiusLambda;           //! Invariant mass vs. radius
-  TH2F        *fHistMassVsRadiusAntiLambda;       //! Invariant mass vs. radius
-
-  TH2F        *fHistPtVsMassK0;                   //! Pt vs. mass
-  TH2F        *fHistPtVsMassLambda;               //! Pt vs. mass
-  TH2F        *fHistArmenterosPodolanski;         //! Armenteros-Podolanski
-  // ------------------------------------------------------
-
-
-  // PID histograms  --------------------------------------
-  TH1F        *fHistNsigmaPosPionAntiLambda;      //! Sigma positive pion
-  TH1F        *fHistNsigmaNegProtonAntiLambda;    //! Sigma anti-proton
-  TH1F        *fHistNsigmaPosProtonLambda;        //! Sigma proton
-  TH1F        *fHistNsigmaNegPionLambda;          //! Sigma negative pion
-  TH1F        *fHistNsigmaPosPionK0;              //! Sigma positive pion K0s
-  TH1F        *fHistNsigmaNegPionK0;              //! Sigma negative pion K0s
-  // ------------------------------------------------------
-
-  // Associated particles ---------------------------------
-  TH1F        *fHistAsMcRapK0;                    //! Rapidity distribution
-  TH1F        *fHistAsMcRapLambda;                //! Rapidity distribution
-  TH1F        *fHistAsMcRapAntiLambda;            //! Rapidity distribution
-
-  TH1F        *fHistAsMcPtK0;                     //! Pt distribution
-  TH1F        *fHistAsMcPtLambda;                 //! Pt distribution
-
-  TH1F        *fHistAsMcPtZoomK0;                 //! Pt distribution
-  TH1F        *fHistAsMcPtZoomLambda;             //! Pt distribution
-
-  TH1F        *fHistAsMcProdRadiusK0;             //! Radius distribution
-  TH1F        *fHistAsMcProdRadiusLambda;         //! Radius distribution
-  TH1F        *fHistAsMcProdRadiusAntiLambda;     //! Radius distribution
-
-  TH2F        *fHistAsMcProdRadiusXvsYK0s;        //! Radius distribution vs. rapidity
-  TH2F        *fHistAsMcProdRadiusXvsYLambda;     //! Radius distribution vs. rapidity
-  TH2F        *fHistAsMcProdRadiusXvsYAntiLambda; //! Radius distribution vs. rapidity
-
-  TH1F        *fHistPidMcMassK0;                  //! Invariant mass distribution with PID checked
-  TH1F        *fHistPidMcMassLambda;              //! Invariant mass distribution with PID checked
-  TH1F        *fHistPidMcMassAntiLambda;          //! Invariant mass distribution with PID checked
-
-  TH1F        *fHistAsMcMassK0;                   //! Invariant mass distribution
-  TH1F        *fHistAsMcMassLambda;               //! Invariant mass distribution
-  TH1F        *fHistAsMcMassAntiLambda;           //! Invariant mass distribution
-
-  TH2F        *fHistAsMcPtVsMassK0;               //! Pt vs. invariant mass
-  TH2F        *fHistAsMcPtVsMassLambda;           //! Pt vs. invariant mass
-  TH2F        *fHistAsMcPtVsMassAntiLambda;       //! Pt vs. invariant mass
-
-  TH2F        *fHistAsMcMassVsRadiusK0;           //! Invariant mass vs. radius
-  TH2F        *fHistAsMcMassVsRadiusLambda;       //! Invariant mass vs. radius
-  TH2F        *fHistAsMcMassVsRadiusAntiLambda;   //! Invariant mass vs. radius
-
-  TH1F        *fHistAsMcResxK0;                   //! Position resolution for K0s
-  TH1F        *fHistAsMcResyK0;                   //! Position resolution for K0s
-  TH1F        *fHistAsMcReszK0;                   //! Position resolution for K0s
-
-  TH2F        *fHistAsMcResrVsRadiusK0;           //! Position resolution vs. radius for K0s
-  TH2F        *fHistAsMcReszVsRadiusK0;           //! Position resolution vs. radius for K0s
-
-  TH1F        *fHistAsMcResxLambda;               //! Position resolution for Lambda
-  TH1F        *fHistAsMcResyLambda;               //! Position resolution for Lambda
-  TH1F        *fHistAsMcReszLambda;               //! Position resolution for Lambda
-
-  TH2F        *fHistAsMcResrVsRadiusLambda;       //! Position resolution vs. radius for Lambda
-  TH2F        *fHistAsMcReszVsRadiusLambda;       //! Position resolution vs. radius for Lambda
-
-  TH1F        *fHistAsMcResxAntiLambda;           //! Position resolution for anti-Lambda
-  TH1F        *fHistAsMcResyAntiLambda;           //! Position resolution for anti-Lambda
-  TH1F        *fHistAsMcReszAntiLambda;           //! Position resolution for anti-Lambda
-
-  TH2F        *fHistAsMcResrVsRadiusAntiLambda;   //! Position resolution vs. radius for anti-Lambda
-  TH2F        *fHistAsMcReszVsRadiusAntiLambda;   //! Position resolution vs. radius for anti-Lambda
-
-  TH1F        *fHistAsMcResPtK0;                  //! Pt resolution for K0s
-  TH1F        *fHistAsMcResPtLambda;              //! Pt resolution for Lambda
-  TH1F        *fHistAsMcResPtAntiLambda;          //! Pt resolution for anti-Lambda
-
-  TH2F        *fHistAsMcResPtVsRapK0;             //! Pt resolution vs. rapidity for K0s
-  TH2F        *fHistAsMcResPtVsRapLambda;         //! Pt resolution vs. rapidity for Lambda
-  TH2F        *fHistAsMcResPtVsRapAntiLambda;     //! Pt resolution vs. rapidity for anti-Lambda
-
-  TH2F        *fHistAsMcResPtVsPtK0;              //! Pt resolution vs. Pt for K0s     
-  TH2F        *fHistAsMcResPtVsPtLambda;          //! Pt resolution vs. Pt for Lambda  
-  TH2F        *fHistAsMcResPtVsPtAntiLambda;      //! Pt resolution vs. Pt for anti-Lambda
-
-  TH1F        *fHistAsMcMotherPdgCodeK0s;         //! Pdg code of mother particle for K0s
-  TH1F        *fHistAsMcMotherPdgCodeLambda;      //! Pdg code of mother particle for Lambda
-  TH1F        *fHistAsMcMotherPdgCodeAntiLambda;  //! Pdg code of mother particle for anti-Lambda
-
-  TH1F        *fHistAsMcPtLambdaFromSigma;        //! Pt distribution of Lambda <- Sigma decay
-  TH1F        *fHistAsMcPtAntiLambdaFromSigma;    //! Pt distribution of anti-Lambda <- Sigma decay
-  // ------------------------------------------------------
-
-  // Associated secondary particle histograms -------------
-  TH2F        *fHistAsMcSecondaryPtVsRapK0s;       //! Pt vs. rapidity distribution for K0s
-  TH2F        *fHistAsMcSecondaryPtVsRapLambda;    //! Pt vs. rapidity distribution for Lambda
-  TH2F        *fHistAsMcSecondaryPtVsRapAntiLambda;//! Pt vs. rapidity distribution for anti-Lambda
-
-  TH1F        *fHistAsMcSecondaryProdRadiusK0s;       //! Production radius for K0s
-  TH1F        *fHistAsMcSecondaryProdRadiusLambda;    //! Production radius for Lambda
-  TH1F        *fHistAsMcSecondaryProdRadiusAntiLambda;//! Production radius for anti-Lambda
-
-  TH2F        *fHistAsMcSecondaryProdRadiusXvsYK0s;       //! Production radius vs. rapidity for K0s
-  TH2F        *fHistAsMcSecondaryProdRadiusXvsYLambda;    //! Production radius vs. rapidity for Lambda
-  TH2F        *fHistAsMcSecondaryProdRadiusXvsYAntiLambda;//! Production radius vs. rapidity for anti-Lambda
-
-  TH1F        *fHistAsMcSecondaryMotherPdgCodeK0s; //! Pdg code of mother particle for secondary K0s
-  TH1F        *fHistAsMcSecondaryMotherPdgCodeLambda;//! Pdg code of mother particle for secondary for Lambda
-  TH1F        *fHistAsMcSecondaryMotherPdgCodeAntiLambda;//! Pdg code of mother particle for secondary for anti-Lambda
 
-  TH1F        *fHistAsMcSecondaryPtLambdaFromSigma;//! Pt distribution of secondary Lambda <- Sigma decay
-  TH1F        *fHistAsMcSecondaryPtAntiLambdaFromSigma;//! Pt distribution of secondary anti-Lambda <- Sigma decay
+  TH1F        *fHistAsMcMotherPdgCodeK0s;       //! Histo
+//  TH1F        *fHistAsMcMotherPdgCodeK0sMI;       //! Histo
+  TH1F        *fHistAsMcMotherPdgCodeLambda;       //! Histo
+//  TH1F        *fHistAsMcMotherPdgCodeLambdaMI;       //! Histo
+  TH1F        *fHistAsMcMotherPdgCodeAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcMotherPdgCodeAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcPtLambdaFromSigma;       //! Histo
+//  TH1F        *fHistAsMcPtLambdaFromSigmaMI;       //! Histo
+  TH1F        *fHistAsMcPtAntiLambdaFromSigma;       //! Histo
+//  TH1F        *fHistAsMcPtAntiLambdaFromSigmaMI;       //! Histo
+
+  // Associated secondary particles:
+  TH2F        *fHistAsMcSecondaryPtVsRapK0s;       //! Histo
+//  TH2F        *fHistAsMcSecondaryPtVsRapK0sMI;       //! Histo
+  TH2F        *fHistAsMcSecondaryPtVsRapLambda;       //! Histo
+//  TH2F        *fHistAsMcSecondaryPtVsRapLambdaMI;       //! Histo
+  TH2F        *fHistAsMcSecondaryPtVsRapAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcSecondaryPtVsRapAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcSecondaryProdRadiusK0s;       //! Histo
+//  TH1F        *fHistAsMcSecondaryProdRadiusK0sMI;       //! Histo
+  TH1F        *fHistAsMcSecondaryProdRadiusLambda;       //! Histo
+//  TH1F        *fHistAsMcSecondaryProdRadiusLambdaMI;       //! Histo
+  TH1F        *fHistAsMcSecondaryProdRadiusAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcSecondaryProdRadiusAntiLambdaMI;       //! Histo
+
+  TH2F        *fHistAsMcSecondaryProdRadiusXvsYK0s;       //! Histo
+//  TH2F        *fHistAsMcSecondaryProdRadiusXvsYK0sMI;       //! Histo
+  TH2F        *fHistAsMcSecondaryProdRadiusXvsYLambda;       //! Histo
+//  TH2F        *fHistAsMcSecondaryProdRadiusXvsYLambdaMI;       //! Histo
+  TH2F        *fHistAsMcSecondaryProdRadiusXvsYAntiLambda;       //! Histo
+//  TH2F        *fHistAsMcSecondaryProdRadiusXvsYAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcSecondaryMotherPdgCodeK0s;       //! Histo
+//  TH1F        *fHistAsMcSecondaryMotherPdgCodeK0sMI;       //! Histo
+  TH1F        *fHistAsMcSecondaryMotherPdgCodeLambda;       //! Histo
+//  TH1F        *fHistAsMcSecondaryMotherPdgCodeLambdaMI;       //! Histo
+  TH1F        *fHistAsMcSecondaryMotherPdgCodeAntiLambda;       //! Histo
+//  TH1F        *fHistAsMcSecondaryMotherPdgCodeAntiLambdaMI;       //! Histo
+
+  TH1F        *fHistAsMcSecondaryPtLambdaFromSigma;       //! Histo
+//  TH1F        *fHistAsMcSecondaryPtLambdaFromSigmaMI;       //! Histo
+  TH1F        *fHistAsMcSecondaryPtAntiLambdaFromSigma;       //! Histo
+//  TH1F        *fHistAsMcSecondaryPtAntiLambdaFromSigmaMI;       //! Histo
 
   AliAnalysisTaskPerformanceStrange(const AliAnalysisTaskPerformanceStrange&); 
   AliAnalysisTaskPerformanceStrange& operator=(const AliAnalysisTaskPerformanceStrange&); 
index f494225..cd42d66 100644 (file)
@@ -23,8 +23,15 @@ class AliMassFitControl : public TObject {
     fMinMass=1.085; fMaxMass=1.17;
     fBinLower=0;fBinUpper=0;
   };
+  ///// the minimum value of parameter have to be zero with this constructor
   AliMassFitControl(Double_t ptLo, Double_t ptUp, Int_t polyO, Int_t RBF, Double_t m1, Double_t m2){
     fPtUpper=ptUp; fPtLower=ptLo; fPolyOrder = polyO; fRebinFactor = RBF;
+    fMinMass=m1; fMaxMass=m2; fhistMin = 0;
+    fBinLower=0;fBinUpper=0;
+  };
+  ///// the minimum value of (QA) parameter don't have to be zero. can by arbitrary value "histMin"
+  AliMassFitControl(Double_t histMin, Double_t ptLo, Double_t ptUp, Int_t polyO, Int_t RBF, Double_t m1, Double_t m2){
+    fhistMin = histMin; fPtUpper=ptUp; fPtLower=ptLo; fPolyOrder = polyO; fRebinFactor = RBF;
     fMinMass=m1; fMaxMass=m2;
     fBinLower=0;fBinUpper=0;
   };
@@ -61,11 +68,13 @@ class AliMassFitControl : public TObject {
   };
   Double_t DPt() const {return fPtUpper-fPtLower;};
   void CalcBinLimits(Int_t BinsPerGeV){
-    fBinLower = TMath::Nint(1.+fPtLower*BinsPerGeV);
-    fBinUpper = TMath::Nint(fPtUpper*BinsPerGeV);
+//    fBinLower = TMath::Nint(1.+fPtLower*BinsPerGeV); //this assumes that histogram allways start from zero. not true for QA
+    fBinLower = TMath::Nint(1.+(fPtLower-fhistMin)*BinsPerGeV); //this is valid if hist. doesn't start from zero but from number: histMin
+    fBinUpper = TMath::Nint((fPtUpper-fhistMin)*BinsPerGeV); //this is valid if hist. doesn't start from zero but from number: histMin    
   };
 
 protected:
+  Double_t fhistMin; //value of the first bin for QA parameter
   Double_t fPtUpper; // Upper pt limit
   Double_t fPtLower; // Lower pt limit. This was previously public due to use in sorting functions but it seems OK here.
   Int_t fBinUpper; // Upper bin limit
index 815194b..ff4e147 100644 (file)
@@ -11,6 +11,9 @@ void AnalysisStrange()
 // Set temporary merging directory to current one
    gSystem->Setenv("TMPDIR", gSystem->pwd());
 
+// Set temporary compilation directory to current one
+   gSystem->SetBuildDir(gSystem->pwd(), kTRUE);
+
 // Reset existing include path and add current directory first in the search
    gSystem->SetIncludePath("-I.");
 // load base root libraries
@@ -22,15 +25,13 @@ void AnalysisStrange()
    gSystem->Load("libMinuit");
 
 // Load analysis framework libraries
-   if (!SetupPar("STEERBase")) return;
-   if (!SetupPar("ESD")) return;
-   if (!SetupPar("AOD")) return;
-   if (!SetupPar("ANALYSIS")) return;
-   if (!SetupPar("ANALYSISalice")) return;
-   if (!SetupPar("CORRFW")) return;
+   gSystem->Load("libSTEERBase");
+   gSystem->Load("libESD");
+   gSystem->Load("libAOD");
+   gSystem->Load("libANALYSIS");
+   gSystem->Load("libANALYSISalice");
+   gSystem->Load("libCORRFW");
 
-// Compile other par packages
-   if (!SetupPar("OADB.par")) return;
 // include path
    TString intPath = gInterpreter->GetIncludePath();
    TObjArray *listpaths = intPath.Tokenize(" ");
@@ -48,6 +49,7 @@ void AnalysisStrange()
 // Add aditional AliRoot libraries
 
 // analysis source to be compiled at runtime (if any)
+   gROOT->ProcessLine(".L AliAnalysisCentralitySelector.cxx+g");
    gROOT->ProcessLine(".L AliAnalysisTaskPerformanceStrange.cxx+g");
 
 // connect to AliEn and make the chain
@@ -115,41 +117,3 @@ TChain* CreateChain(const char *xmlfile, const char *type="ESD")
    return chain;
 }
 
-//________________________________________________________________________________
-Bool_t SetupPar(const char *package) {
-// Compile the package and set it up.
-   TString pkgdir = package;
-   pkgdir.ReplaceAll(".par","");
-   gSystem->Exec(TString::Format("tar xvzf %s.par", pkgdir.Data()));
-   TString cdir = gSystem->WorkingDirectory();
-   gSystem->ChangeDirectory(pkgdir);
-   // Check for BUILD.sh and execute
-   if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
-      printf("*******************************\n");
-      printf("*** Building PAR archive    ***\n");
-      printf("*******************************\n");
-      if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
-         ::Error("SetupPar", "Cannot build par archive %s", pkgdir.Data());
-         gSystem->ChangeDirectory(cdir);
-         return kFALSE;
-      }
-   } else {
-      ::Error("SetupPar","Cannot access PROOF-INF/BUILD.sh for package %s", pkgdir.Data());
-      gSystem->ChangeDirectory(cdir);
-      return kFALSE;
-   }
-   // Check for SETUP.C and execute
-   if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
-      printf("*******************************\n");
-      printf("***    Setup PAR archive    ***\n");
-      printf("*******************************\n");
-      gROOT->Macro("PROOF-INF/SETUP.C");
-   } else {
-      ::Error("SetupPar","Cannot access PROOF-INF/SETUP.C for package %s", pkgdir.Data());
-      gSystem->ChangeDirectory(cdir);
-      return kFALSE;
-   }
-   // Restore original workdir
-   gSystem->ChangeDirectory(cdir);
-   return kTRUE;
-}
index 89c0c12..7ffa6c2 100644 (file)
@@ -5,7 +5,7 @@ AliAnalysisGrid* CreateAlienHandler(const char * runlist, TList * listCode, cons
   // Check if user has a valid token, otherwise make one. This has limitations.
   // One can always follow the standard procedure of calling alien-token-init then
   //   source /tmp/gclient_env_$UID in the current shell.
-  if (!AliAnalysisGrid::CreateToken()) return NULL;
+//  if (!AliAnalysisGrid::CreateToken()) return NULL;
   AliAnalysisAlien *plugin = new AliAnalysisAlien(); 
   plugin->SetOverwriteMode();
   // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
@@ -13,29 +13,33 @@ AliAnalysisGrid* CreateAlienHandler(const char * runlist, TList * listCode, cons
   // Set versions of used packages
   // FIXME: PAR FILES OPTIONAL?
   plugin->SetAPIVersion("V1.1x");
-  plugin->SetROOTVersion("v5-27-06b");
-  //  plugin->SetAliROOTVersion("v4-21-09-AN");
+  plugin->SetROOTVersion("v5-28-00a");
+    plugin->SetAliROOTVersion("v4-21-20-AN");
 // PAR files: I'm using a modified ANALYSISalice package, so I need to load par files for everything
-   plugin->EnablePackage("STEERBase");
+/*   plugin->EnablePackage("STEERBase");
    plugin->EnablePackage("ESD");
    plugin->EnablePackage("AOD");
    plugin->EnablePackage("CORRFW");
    plugin->EnablePackage("ANALYSIS");
    plugin->EnablePackage("ANALYSISalice");
    plugin->EnablePackage("OADB");
-
+*/
 
   // Declare input data to be processed.
   // Method 1: Create automatically XML collections using alien 'find' command.
   // Define production directory LFN
    if(!isMC) 
-     plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
+     //plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
+     plugin->SetGridDataDir("/alice/sim/LHC11a10a/");
    else
-     plugin->SetGridDataDir("/alice/sim/LHC10h8/");
+     //plugin->SetGridDataDir("/alice/sim/LHC10h8/");
+     plugin->SetGridDataDir("/alice/sim/LHC11a10a/");
 
    // Set data search pattern
    if(!isMC)
-     plugin->SetDataPattern("*/pass1/*AliESDs.root");
+     //plugin->SetDataPattern("*/pass1/*AliESDs.root");
+     //plugin->SetDataPattern("*/pass2/*AliESDs.root");
+     plugin->SetDataPattern("*AliESDs.root");
    else
      plugin->SetDataPattern("AliESDs.root");
 
@@ -45,7 +49,8 @@ AliAnalysisGrid* CreateAlienHandler(const char * runlist, TList * listCode, cons
    plugin->AddRunNumber(runlist);
 
 
-   plugin->SetGridWorkingDir("LambdaK0/");
+   //plugin->SetGridWorkingDir("LambdaK0/");
+   plugin->SetGridWorkingDir("LambdaK0MC/");
    plugin->SetGridOutputDir("out");
 
    // plugin->SetDefaultOutputs(kFALSE);
index 3c0ca8b..3175184 100644 (file)
@@ -1,35 +1,90 @@
-void FitSpectrum(const char* filename, const char * listName = "clambdak0Histo_00", const char* suffix = "test", Int_t iparticle) {
+void FitSpectrum(const char* filename, const char * listName = "clambdak0Histo_00", const char* suffix = "test",Int_t ihist = 0, Int_t iparticle) {
   
   // load basic libs, needed to 
-  gROOT->LoadMacro("run.C");
+  //gROOT->LoadMacro("run.C");
+  gROOT->LoadMacro("runQA.C");
   InitAndLoadLibs();
 
   // Load Lee's Macro
   gROOT->LoadMacro("AliMassFitControl.h+g");
   gROOT->LoadMacro("PtMassAna2.C");
-  gROOT->LoadMacro("MultYields2.C");
+  gROOT->LoadMacro("MultYields2QA.C");
 
   char* histName = 0;
   switch (iparticle) {
   case 0:
-    histName = "h2PtVsMassK0";
+    switch (ihist){
+          case 0:
+               histName = "h2PtVsMassK0";
+                break;
+          case 1:
+               histName = "h2DcaPosToPrimVertexK0vsMassK0";
+               break;
+          case 2:
+               histName = "h2DcaNegToPrimVertexK0vsMassK0";
+               break;
+          case 3:
+               histName = "h2RadiusV0K0vsMassK0";
+               break;
+          case 4:
+               histName = "h2DecayLengthV0K0vsMassK0";   
+               break;
+          case 5:
+               histName = "h2DcaV0DaughtersK0vsMassK0";
+               break;
+          case 6:
+               histName = "h2CosPointAngleK0vsMassK0";
+               break;
+          default;
+          cout << "histogram " << histName << endl;
+          }
+    cout << "Particle "<< iparticle << " to be implemented" << endl;  
     break;
   case 1:
-    histName = "h2PtVsMassLambda";
-    break;
-  default:
-    cout << "Particle "<< iparticle << " to be implemented" << endl;  
+    switch (ihist){
+          case 0:
+               histName = "h2PtVsMassLambda";   
+               break;
+          case 1:
+               histName = "h2DcaPosToPrimVertexLvsMassL";   
+               break;
+          case 2:
+               histName = "h2DcaNegToPrimVertexLvsMassL";   
+               break;
+          case 3:
+               histName = "h2RadiusV0LvsMassL";   
+               break;
+          case 4:
+               histName = "h2DecayLengthV0LvsMassL";   
+               break;
+          case 5:
+               histName = "h2DcaV0DaughtersLvsMassL";
+               break;
+          case 6:
+               histName = "h2CosPointAngleLvsMassL";
+               break;
+          default;
+          cout << "histogram " << histName << endl;
+          }
+    cout << "Particle "<< iparticle << " to be implemented" << endl; 
+    break; 
   }
 
   TFile *file = new TFile(filename);
   TList *list = file->Get(listName); 
 
   TH2F * h2 = (TH2F*) list->FindObject(histName);
+  h2->Draw();
+  
+  ///// iNorm is used by MultYields2QA to normalize the distributions
+  TH1F * h1 = (TH1F*) list->FindObject("h1PrimaryVertexZ");
+  Int_t iNorm = h1->GetEntries();
+  cout << "number of entries with Zvertex < |10cm|: " << iNorm;
 
   TString suffixFull = histName;
   if(strlen(suffix)) suffixFull = suffixFull + "_" + suffix;
   //MultYields3((TH3F*)h2,iparticle,0,suffixFull); // FIXME: modify MultYields2 to handle 1D histos
-  MultYields2(h2,iparticle,0,suffixFull); // FIXME: modify MultYields2 to handle 1D histos
+  MultYields2QA(h2,iparticle,ihist,iNorm,0,suffixFull); // FIXME: modify MultYields2 to handle 1D histos
 
   
 }
index f992d45..0846782 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "AliMassFitControl.h"
 
 // Two functions now.
diff --git a/PWG2/SPECTRA/LambdaK0PbPb/MultYields2QA.C b/PWG2/SPECTRA/LambdaK0PbPb/MultYields2QA.C
new file mode 100644 (file)
index 0000000..e349788
--- /dev/null
@@ -0,0 +1,357 @@
+#include "AliMassFitControl.h"
+
+// Two functions now.
+// MultYields3 takes a 3D histogram and calls the 2D function MultYields2
+// MultYields2 could be called directly if we only have a 2D histogram
+
+void MultYields3(TH3F *PtMassMult, Int_t particleMode, Int_t MultBin, Char_t* label){
+
+  // Leave open possibility to choose different values depending on MultBin - LSB
+  Float_t MultLo[1] = {0};
+  Float_t MultHi[1] = {300};
+
+  //Make 2D projections from the 3D histogram
+  PtMassMult->GetZaxis()->SetRange(MultLo[MultBin],MultHi[MultBin]);
+  TH2F* hParMass = (TH2F*)PtMassMult->Project3D("XY");// FIX:MF
+  hParMass->SetTitle("PtMass");
+  
+  //hParMass->Draw(); // Drawing invokes default c1 canvas making it inaccessible in MultYields2 - TO FIX
+  MultYields2(hParMass, particleMode,MultBin,label);
+  
+}
+
+void MultYields2QA(TH2F *hParMass, Int_t particleMode, Int_t ihist,Int_t Nev = 1, Int_t MultBin, Char_t* label){
+
+  hParMass->Draw();
+  ////////////////////////// minhist is needed by AliMassFitControl.h (in case the minimum on the parameter's axis is arbitrary value); 
+  Double_t minhist = 0;
+  minhist = hParMass->GetBinLowEdge(1);
+  cout<<" value of the first bin of parameter : " <<minhist << endl;
+
+  // Do .L on command line first
+  //gROOT->LoadMacro("macros/PtMassAna2.C");
+  /* Modifications to produce a single uncorrected spectrum in a particular mult. bin for K0 or Lambda
+     Old ratio code preserved in MultYieldsRatio.C
+     Dec 2003 */
+  Char_t* part; //for name of particle
+  Float_t BR; //branching ratio - check them
+  if (particleMode==0){
+    part = "K0";
+    BR=0.686;
+  } else if (particleMode==1){
+    part = "Lambda";
+    BR=0.639;
+  } else if (particleMode==2){
+    part = "AntiLambda";
+    BR=0.639;
+  } else if (particleMode==3){
+    part = "Lambda+antiLambda";
+    BR=0.639;
+  } else if (particleMode==4){
+    part = "Xi";
+    BR=1.0; // Should be Lam ->p pi Br
+  } else if (particleMode ==6){
+    part = "Omega";
+    BR=1.0; // Should be Lam->p pi  * Om -> K Lam
+  }
+  
+
+
+  TString title[1]={"MinimumBias"};
+  //Make 2D projections from the 3D histogram
+  //Minbias (i.e. everything)
+  
+  TObjArray *controllerArray = new TObjArray(40,1); // 2nd arg means can count from 1!
+
+  //Here probably need switch-case, depending on mult bin and particle
+  // LoPt, HiPt, polynomial order, rebinning factor
+
+  /////  LAMBDA and LAMBDA+ANTILAMBDA (Combination)
+
+
+
+  if(particleMode == 1 || particleMode == 3){ // Lambda or Lambda+Anti-Lambda
+    if(ihist ==0){
+      /*     controllerArray->AddLast(new AliMassFitControl(0.2,0.3, 2,2, 1.095,1.17)); //1
+            controllerArray->AddLast(new AliMassFitControl(0.3,0.4, 2,2, 1.095,1.17)); //2
+            controllerArray->AddLast(new AliMassFitControl(0.4,0.5, 2,2, 1.095,1.17)); //3
+            controllerArray->AddLast(new AliMassFitControl(0.5,0.6, 2,2, 1.095,1.17)); //4
+            controllerArray->AddLast(new AliMassFitControl(0.6,0.7, 2,2, 1.095,1.17)); //5
+            controllerArray->AddLast(new AliMassFitControl(0.7,0.8, 2,2, 1.1,1.17)); //6
+      */      controllerArray->AddLast(new AliMassFitControl(0.8,0.9, 2,2, 1.1,1.17)); //7
+      controllerArray->AddLast(new AliMassFitControl(0.9,1.0, 2,2, 1.1,1.18)); //8
+      controllerArray->AddLast(new AliMassFitControl(1.0,1.1, 2,2, 1.1,1.17)); //9
+      controllerArray->AddLast(new AliMassFitControl(1.1,1.2, 2,2, 1.1,1.14)); //10
+      controllerArray->AddLast(new AliMassFitControl(1.2,1.3, 2,2, 1.1,1.14)); //11 
+      controllerArray->AddLast(new AliMassFitControl(1.3,1.4, 2,2, 1.1,1.17)); //12
+      controllerArray->AddLast(new AliMassFitControl(1.4,1.5, 2,2, 1.095,1.17)); //13
+      controllerArray->AddLast(new AliMassFitControl(1.5,1.6, 2,2, 1.095,1.17)); //14
+      controllerArray->AddLast(new AliMassFitControl(1.6,1.7, 2,2, 1.095,1.17)); //15
+      controllerArray->AddLast(new AliMassFitControl(1.7,1.8, 2,2, 1.095,1.18)); //16
+      controllerArray->AddLast(new AliMassFitControl(1.8,1.9, 2,2, 1.095,1.17)); //17
+      controllerArray->AddLast(new AliMassFitControl(1.9,2.0, 2,2, 1.095,1.17)); //18
+      controllerArray->AddLast(new AliMassFitControl(2.0,2.2, 2,2, 1.095,1.17)); //19
+      controllerArray->AddLast(new AliMassFitControl(2.2,2.4, 2,2, 1.095,1.17)); //20
+      controllerArray->AddLast(new AliMassFitControl(2.4,2.6, 2,2, 1.095,1.17)); //21
+      controllerArray->AddLast(new AliMassFitControl(2.6,2.8, 2,2, 1.095,1.17)); //22
+      controllerArray->AddLast(new AliMassFitControl(2.8,3.0, 2,2, 1.095,1.17)); //23
+      controllerArray->AddLast(new AliMassFitControl(3.0,3.2, 2,2, 1.095,1.17)); //24
+      controllerArray->AddLast(new AliMassFitControl(3.2,3.4, 2,2, 1.095,1.17)); //25
+      controllerArray->AddLast(new AliMassFitControl(3.4,3.6, 2,2, 1.095,1.17)); //26
+      controllerArray->AddLast(new AliMassFitControl(3.6,3.8, 2,2, 1.095,1.17)); //27
+      controllerArray->AddLast(new AliMassFitControl(3.8,4.0, 2,2, 1.095,1.167)); //28
+      controllerArray->AddLast(new AliMassFitControl(4.0,4.5, 2,2, 1.095,1.17)); //29
+      controllerArray->AddLast(new AliMassFitControl(4.5,5.0, 2,2, 1.095,1.17)); //30
+      controllerArray->AddLast(new AliMassFitControl(5.0,5.5, 2,2, 1.095,1.17)); //31  bin05
+      controllerArray->AddLast(new AliMassFitControl(5.5,6.5, 2,2, 1.095,1.17)); //32
+      controllerArray->AddLast(new AliMassFitControl(6.5,8.0, 2,2, 1.095,1.17)); //33
+      //controllerArray->AddLast(new AliMassFitControl(8.0,12.0, 2,2, 1.095,1.17));//34
+      
+
+    }
+    if(ihist == 1){
+      cout << "histogram : " <<1<<endl;
+      for(int i = 0; i<49; i++)
+       //     for(int i = 0; i<33; i++) //for 05 centrality
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,0.1+i*0.2,0.1+(i+1.0)*0.2, 2,1, 1.095,1.15));
+    }
+    if(ihist == 2){
+      cout << "histogram : " <<2<<endl;
+      for(int i = 0; i<49; i++)
+       //      for(int i = 0; i<33; i++) //for 05 centrality
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,0.1+i*0.2,0.1+(i+1.0)*0.2, 2,1, 1.095,1.17));
+    }
+    if(ihist == 3){
+      cout << "histogram : " <<3<<endl;
+      for(int i = 0; i<=40; i++)
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 1.095,1.17));
+    }
+    if(ihist == 4){
+      cout << "histogram : " <<4<<endl;
+      for(int i = 0; i<=40; i++)
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 1.095,1.17));
+    }
+    if(ihist == 5){
+      cout << "histogram : " <<5<<endl;
+      for(int i = 0; i<=33; i++)
+       //      if(i==11 || i==15 || i==16)
+       //        controllerArray->AddLast(new AliMassFitControl(minhist,0+i*0.03,(i+1)*0.03, 2,1, 0.43,0.57));
+       //        else
+       //controllerArray->AddLast(new AliMassFitControl(minhist,0+i*0.03,(i+1)*0.03, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,0+i*0.03,(i+1)*0.03, 2,1, 1.095,1.17));   //00
+    }
+    if(ihist == 6){
+      cout << "histogram : " <<6<<endl;
+      for(int i = 1; i<40; i++){
+       //   if(i==23) 
+       controllerArray->AddLast(new AliMassFitControl(minhist,0.998 +i*0.00005,0.998 +(i+1)*0.00005, 2,1, 1.095,1.17));
+       /*        if(  i==17 || i==18 || i==23) 
+                 controllerArray->AddLast(new AliMassFitControl(minhist,0.998 +i*0.00005,0.998 +(i+1)*0.00005, 2,1, 0.446,0.55));
+                 else
+                 controllerArray->AddLast(new AliMassFitControl(minhist,0.998 +i*0.00005,0.998 +(i+1)*0.00005, 2,1, 0.44,0.56));
+       */        }
+    }
+  }
+  /// ANTI LAMBDA ---->
+  else if (particleMode == 2){ // Anti-Lambdas
+    controllerArray->AddLast(new AliMassFitControl(5.0,5.5, 0,4, 1.095,1.17));
+    controllerArray->AddLast(new AliMassFitControl(5.5,6.0, 0,6, 1.085,1.17));
+  } // end if anti-Lambda
+  else if (particleMode == 0){ // K0s case
+    if(ihist == 0){
+      /*      controllerArray->AddLast(new AliMassFitControl(0.2,0.3, 2,2, 0.428,0.56)); //1
+             controllerArray->AddLast(new AliMassFitControl(0.3,0.4, 2,2, 0.428,0.56)); //2
+             controllerArray->AddLast(new AliMassFitControl(0.4,0.5, 2,2, 0.428,0.56)); //3
+             controllerArray->AddLast(new AliMassFitControl(0.5,0.6, 2,2, 0.428,0.46)); //4
+             controllerArray->AddLast(new AliMassFitControl(0.6,0.7, 2,2, 0.428,0.56)); //5
+             controllerArray->AddLast(new AliMassFitControl(0.7,0.8, 2,2, 0.438,0.56)); //6
+      */      controllerArray->AddLast(new AliMassFitControl(0.8,0.9, 2,2, 0.438,0.56)); //7
+      controllerArray->AddLast(new AliMassFitControl(0.9,1.0, 2,2, 0.438,0.56)); //8
+      controllerArray->AddLast(new AliMassFitControl(1.0,1.1, 2,2, 0.438,0.56)); //9
+      controllerArray->AddLast(new AliMassFitControl(1.1,1.2, 2,2, 0.438,0.56)); //10
+      controllerArray->AddLast(new AliMassFitControl(1.2,1.3, 2,2, 0.438,0.56)); //11 
+      controllerArray->AddLast(new AliMassFitControl(1.3,1.4, 2,2, 0.438,0.56)); //12
+      controllerArray->AddLast(new AliMassFitControl(1.4,1.5, 2,2, 0.438,0.56)); //13
+      controllerArray->AddLast(new AliMassFitControl(1.5,1.6, 2,2, 0.438,0.56)); //14
+      controllerArray->AddLast(new AliMassFitControl(1.6,1.7, 2,2, 0.438,0.56)); //15
+      controllerArray->AddLast(new AliMassFitControl(1.7,1.8, 2,2, 0.438,0.56)); //16
+      controllerArray->AddLast(new AliMassFitControl(1.8,1.9, 2,2, 0.438,0.56)); //17
+      controllerArray->AddLast(new AliMassFitControl(1.9,2.0, 2,2, 0.438,0.56)); //18
+      controllerArray->AddLast(new AliMassFitControl(2.0,2.2, 2,2, 0.4385,0.535)); //19
+      controllerArray->AddLast(new AliMassFitControl(2.2,2.4, 2,2, 0.438,0.56)); //20
+      controllerArray->AddLast(new AliMassFitControl(2.4,2.6, 2,2, 0.438,0.56)); //21
+      controllerArray->AddLast(new AliMassFitControl(2.6,2.8, 2,2, 0.428,0.56)); //22
+      controllerArray->AddLast(new AliMassFitControl(2.8,3.0, 2,2, 0.428,0.56)); //23
+      controllerArray->AddLast(new AliMassFitControl(3.0,3.2, 2,2, 0.428,0.56)); //24
+      controllerArray->AddLast(new AliMassFitControl(3.2,3.4, 2,2, 0.428,0.56)); //25
+      controllerArray->AddLast(new AliMassFitControl(3.4,3.6, 2,2, 0.428,0.56)); //26
+      controllerArray->AddLast(new AliMassFitControl(3.6,3.8, 2,2, 0.428,0.56)); //27
+      controllerArray->AddLast(new AliMassFitControl(3.8,4.0, 2,2, 0.428,0.56)); //28
+      controllerArray->AddLast(new AliMassFitControl(4.0,4.5, 2,2, 0.428,0.56)); //29
+      controllerArray->AddLast(new AliMassFitControl(4.5,5.0, 2,2, 0.428,0.56)); //30
+      controllerArray->AddLast(new AliMassFitControl(5.0,5.5, 2,2, 0.428,0.56)); //31
+      controllerArray->AddLast(new AliMassFitControl(5.5,6.5, 2,2, 0.428,0.56)); //32
+      controllerArray->AddLast(new AliMassFitControl(6.5,8.0, 2,2, 0.428,0.56)); //33
+      controllerArray->AddLast(new AliMassFitControl(8.0,12.0, 2,2, 0.428,0.56));//34
+      
+    }
+    if(ihist == 1){
+      cout << "histogram : " <<1<<endl;
+      for(int i = 0; i<49; i++)
+       //     for(int i = 0; i<33; i++) //for 05 centrality
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,0.1+i*0.2,0.1+(i+1.0)*0.2, 2,1, 0.445,0.56));
+    }
+    if(ihist == 2){
+      cout << "histogram : " <<2<<endl;
+      for(int i = 0; i<42; i++){
+       //      for(int i = 0; i<33; i++) //for 05 centrality
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+        if(i==2)controllerArray->AddLast(new AliMassFitControl(minhist,0.1+i*0.2,0.1+(i+1.0)*0.2, 1,1, 0.445,0.56));
+        else
+         controllerArray->AddLast(new AliMassFitControl(minhist,0.1+i*0.2,0.1+(i+1.0)*0.2, 2,1, 0.445,0.56));
+      }
+    }
+    if(ihist == 3){
+      cout << "histogram : " <<3<<endl;
+      //for(int i = 0; i<=28; i++) //bin05
+      for(int i = 0; i<=40; i++)
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.445,0.56));
+    }
+    if(ihist == 4){
+      cout << "histogram : " <<4<<endl;
+      for(int i = 0; i<=40; i++)
+       //      controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,i,i+1.0, 2,1, 0.445,0.56));
+    }
+    if(ihist == 5){
+      cout << "histogram : " <<5<<endl;
+      for(int i = 0; i<=33; i++)
+       //      if(i==11 || i==15 || i==16)
+       //        controllerArray->AddLast(new AliMassFitControl(minhist,0+i*0.03,(i+1)*0.03, 2,1, 0.43,0.57));
+       //        else
+       //controllerArray->AddLast(new AliMassFitControl(minhist,0+i*0.03,(i+1)*0.03, 2,1, 0.44,0.56));
+       controllerArray->AddLast(new AliMassFitControl(minhist,0+i*0.03,(i+1)*0.03, 2,1, 0.43,0.56));   //00
+    }
+    if(ihist == 6){
+      cout << "histogram : " <<6<<endl;
+      for(int i = 1; i<40; i++){
+       //   if(i==23) 
+       controllerArray->AddLast(new AliMassFitControl(minhist,0.998 +i*0.00005,0.998 +(i+1)*0.00005, 2,1, 0.445,0.55));
+       /*        if(  i==17 || i==18 || i==23) 
+                 controllerArray->AddLast(new AliMassFitControl(minhist,0.998 +i*0.00005,0.998 +(i+1)*0.00005, 2,1, 0.446,0.55));
+                 else
+                 controllerArray->AddLast(new AliMassFitControl(minhist,0.998 +i*0.00005,0.998 +(i+1)*0.00005, 2,1, 0.44,0.56));
+       */        }
+    }
+  }  else if (particleMode == 4) { //Xi case
+    //controllerArray->AddLast(new AliMassFitControl(0.5,0.7, 1,1, 1.28,1.45)); //signal not visible with 
+    controllerArray->AddLast(new AliMassFitControl(0.7,0.9, 1,1, 1.285,1.45));
+    controllerArray->AddLast(new AliMassFitControl(0.9,1.1, 1,1, 1.285,1.45));
+    controllerArray->AddLast(new AliMassFitControl(1.1,1.3, 1,1, 1.27,1.45));
+    controllerArray->AddLast(new AliMassFitControl(1.3,1.5, 1,1, 1.27,1.45));
+    controllerArray->AddLast(new AliMassFitControl(1.5,1.7, 1,1, 1.27,1.45));
+    controllerArray->AddLast(new AliMassFitControl(1.7,2.0, 1,1, 1.27,1.45));
+    controllerArray->AddLast(new AliMassFitControl(2.0,2.5, 1,1, 1.27,1.44));
+    controllerArray->AddLast(new AliMassFitControl(2.5,3.0, 1,1, 1.27,1.45));
+    controllerArray->AddLast(new AliMassFitControl(3.0,3.5, 1,1, 1.27,1.44));
+    controllerArray->AddLast(new AliMassFitControl(3.5,4.0, 1,1, 1.27,1.45));
+    controllerArray->AddLast(new AliMassFitControl(4.0,4.5, 2,1, 1.27,1.44));
+    controllerArray->AddLast(new AliMassFitControl(4.5,5.0, 2,1, 1.27,1.45));
+  }
+  controllerArray->Sort();
+
+  // Make the proper label to pass in for use in labelling the diagnostics
+  // saved canvas files and histos
+  Char_t fulllabel[80];
+  //sprintf(fulllabel,"%s%s",title[MultBin].Data(),label);
+  sprintf(fulllabel,"%s",label);
+
+  //Slice up projection into mass histograms to extract yield
+  TH1F* hYield = (TH1F*)PtMassAna2(hParMass,particleMode,ihist,controllerArray->GetEntries(),controllerArray,fulllabel);
+
+
+  // CORRECTIONS Nev -comming from "FitSpectrum.C" (events with Zvertex < |10cm|) 
+  hYield->Scale(1.0/Nev); //Divide by the number of events
+
+  //hYield->Scale(Veff[MultBin]); //Multiply by the vertex efficiency effectively increaing number of events 
+  //(since Veff<1) therefore decreases yield
+  //hYield->Scale(1.0/BR);  //Divide by branching ratio (again increases yield since BR<1)
+  //hYield->Scale(1.0/(2*TMath::Pi())); // Always plot 1/2pi ...
+
+  Char_t yieldTitle[80];
+  //sprintf(yieldTitle,"Uncorrected %s yield: %s",part,title[MultBin].Data());
+  sprintf(yieldTitle,"Uncorrected %s yield",part);
+  hYield->SetTitle(yieldTitle);
+  if(ihist == 0)hYield->SetXTitle("p_{t} / [GeV/c]");
+  if(ihist == 1)hYield->SetXTitle("DCA / [cm]");
+  if(ihist == 2)hYield->SetXTitle("DCA / [cm]");
+  if(ihist == 3)hYield->SetXTitle("Radius / [cm]");
+  if(ihist == 4)hYield->SetXTitle("Decay Lenght / [cm]");
+  if(ihist == 5)hYield->SetXTitle("V0 Daughters / [cm]");
+  if(ihist == 6)hYield->SetXTitle("Cos of pointing angle");
+  hYield->SetYTitle("1/Nev.dN/dp_{t}");
+
+  // Create plots
+
+  Char_t fileNameBase[80];
+  if(ihist == 0)sprintf(fileNameBase,"Masses%s",part);
+  else sprintf(fileNameBase,"Masses%s",label);
+  Char_t fileNamePng[80];
+  sprintf(fileNamePng,"%s.png",fileNameBase);
+  Char_t fileNameEps[80];
+  sprintf(fileNameEps,"%s.eps",fileNameBase);
+  Char_t fileNamePdf[80];
+  sprintf(fileNamePdf,"%s.pdf",fileNameBase);
+
+  c1->SaveAs(fileNamePng);
+  c1->SaveAs(fileNameEps);
+  c1->SaveAs(fileNamePdf);
+
+  //c1->Clear();
+
+  //c1->SetLogy();
+  TCanvas *cYield = new TCanvas("Yield","Corrected Yield",600,400);
+  cYield->cd();
+  //cYield->SetLogy();
+  hYield->SetStats(kFALSE);
+  hYield->Draw();
+  // cYield->SetLogy();
+  cYield->Update();
+
+  //  hRC_MB->SetMarkerStyle(20);
+  //  hRC_MB->SetMarkerColor(4);
+  //  hRC_MB->Scale(NBinMB/NBin3);
+  Char_t fnametext[80];
+  if(ihist == 0)sprintf(fnametext,"Yield%s",part);
+  else sprintf(fnametext,"Yield%s",label);
+  Char_t fnamePng[80];
+  sprintf(fnamePng,"%s.png",fnametext);
+  c1->SaveAs(fnamePng);
+  Char_t fnameEps[80];
+  sprintf(fnameEps,"%s.eps",fnametext);
+  c1->SaveAs(fnameEps);
+
+  // This section for yield scaled by number of binary collisions.
+  // Could add array of values and do scaling according to 'MultBin' index
+  TH1F* hScYield = hYield->Clone("ScYield");
+  Char_t scYieldTitle[80];
+  //sprintf(scYieldTitle,"<N_{bin}> Scaled %s",hYield->GetTitle());
+  //hScYield->SetTitle(scYieldTitle);
+  //SCALING for scaled yield only  divide by mean Nbin (scaled yield is therefore smaller)
+  //hScYield->Scale(1/NBin[MultBin]);
+
+  Char_t fnameRoot[80];
+  sprintf(fnameRoot,"%s.root",fnametext);
+  TFile *YieldFile = new TFile(fnameRoot,"RECREATE");
+  hYield->Write();
+  hScYield->Write();
+  YieldFile->Close();
+
+  controllerArray->Delete();
+}
index 9aded65..5ab5efb 100644 (file)
@@ -9,7 +9,7 @@ Float_t quad(Double_t *x, Double_t *par){
   return par[0] + par[1]*x[0] + par[2]*x[0]*x[0]; //a+bx+cx**2
 }
 
-TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *ControlArray,Char_t* fulllabel){
+TH1F* PtMassAna2(TH2F *PtMass, Int_t mode,Int_t ihist, const Int_t NControl, TObjArray *ControlArray,Char_t* fulllabel){
 
   //TString *tLabel = new TString(fulllabel); //not reqd
 
@@ -123,6 +123,7 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
   c1->SetWindowSize(1024,768);
   Int_t NDraw = NControl;
   if(NDraw==16){c1->Divide(4,4);}
+  elseif(NDraw<=36 && NDraw>25){ c1->Divide(6,6);}
   elseif(NDraw<=25 && NDraw>20){ c1->Divide(5,5);}
   elseif(NDraw<=20 && NDraw>16){  c1->Divide(5,4);}
   elseif(NDraw<=15 && NDraw>12){ c1->Divide(5,3);}
@@ -132,7 +133,7 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
   elseif(NDraw<=4 && NDraw>2){c1->Divide(2,2);}
   elseif(NDraw==2){c1->Divide(2,1);}
   elseif(NDraw==1){/*do nothing*/;}
-  else{c1->Divide(6,5);}
+  else{c1->Divide(7,6);}
 
   //
   // Project out the histograms from 2D into 1D 'slices'
@@ -140,7 +141,6 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
   Char_t id[20], title[80];
   //cout << "NControl: " << NControl << endl;
   TH1D* hMassSlice[NControl];
-
   //Arrays to store various quantities which can later be histogrammed.
   //  const Int_t NBinsArrays = NBins+1-NFirst; // array of 1D projection histograms is counted from 0 but other arrays are used for histograms contents and therefore N+1 are need because element zero is left empty
   const Int_t NBinsArrays = NControl+1;
@@ -170,10 +170,17 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
 
   Int_t BinLo, BinHi; //For pt bins
   // **** Main loop over the AliMassFitControllers ****
   TIter controlIter(ControlArray);
   AliMassFitControl *controller;
   while (controller=(AliMassFitControl*)controlIter.Next()) { 
-    controller->CalcBinLimits(20); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 0)controller->CalcBinLimits(20); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 1)controller->CalcBinLimits(50); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 2)controller->CalcBinLimits(50); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 3)controller->CalcBinLimits(1); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 4)controller->CalcBinLimits(1); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 6)controller->CalcBinLimits(20000); //This BinsPerGeV argument should be calculated from the data
+    if(ihist == 5)controller->CalcBinLimits(100); //This BinsPerGeV argument should be calculated from the data
     //Had to introduce this Nint fn otherwise got inconsistencies after type implicit conversion
     //    BinLo=TMath::Nint(1.+BinPtEdges[N]*20.); //cout << "BinLo: " << BinLo << ", " << 1+BinPtEdges[N]*20. << endl;
     //    BinHi=TMath::Nint(BinPtEdges[N+1]*20.); //cout << "BinHi: " << BinHi << ", " << BinPtEdges[N+1]*20. << endl;
@@ -183,7 +190,8 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
     sprintf(id,"Mass%d",N);
     cout << "Mass histo:" << N << " Firstbin: " << BinLo << " Last bin:" << BinHi << " " << controller->PtLower() << "-" << controller->PtUpper() << " GeV" << endl; 
     //cout << "About to create mass projection " << N << endl;
-    hMassSlice[N] = PtMass->ProjectionX(id,BinLo,BinHi);
+    if(ihist == 0) hMassSlice[N] = PtMass->ProjectionX(id,BinLo,BinHi);
+    if(ihist != 0) hMassSlice[N] = PtMass->ProjectionY(id,BinLo,BinHi);
     //cout << "Mass projection " << N << " created." << endl;
    sprintf(title,"%s Mass, %.2f < p_{t} < %.2f",partName,controller->PtLower(),controller->PtUpper());
     hMassSlice[N]->SetTitle(title);
@@ -237,7 +245,7 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
     hMassSlice[N]->Fit(gausQuad,"LR");
     hMassSlice[N]->Draw("E,SAME");
     gausQuad->DrawCopy("SAME");
-
+    hMassSlice[N]->Clone("hMySlice");
     //Fit the background:
     xxlo=gausQuad->GetParameter(0)-NSigmaEx*gausQuad->GetParameter(2);
     xxhi=gausQuad->GetParameter(0)+NSigmaEx*gausQuad->GetParameter(2);
@@ -270,6 +278,20 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
     qback->SetParameter(1,quad->GetParameter(1));
     qback->SetParameter(2,quad->GetParameter(2));
     qback->DrawCopy("SAME");
+    if(N==28){
+TCanvas *myCan = new TCanvas();
+TPad *mypad = new TPad();
+myCan->cd();
+mypad->Draw();
+hMassSlice[N]->Draw();
+quad->SetRange(xmin,xxlo);
+quad->DrawCopy("SAME");
+quad->SetRange(xxhi,xmax);
+quad->DrawCopy("SAME");
+qback->DrawCopy("SAME");
+
+}
+   
 
     //Integrate the signal+background (i.e. original histo)
     sigBkgd[NArray]=hMassSlice[N]->Integral(massBinLo,massBinHi);
@@ -382,7 +404,8 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
 
   cDiag->cd(2);
   if (part=="K0"){
-    hSigmas->SetMaximum(0.012);
+    //hSigmas->SetMaximum(0.012);
+    hSigmas->SetMaximum(0.112);
   }else{
     hSigmas->SetMaximum(0.006);}
   hSigmas->SetMinimum(0.0);
@@ -404,7 +427,7 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
 
   cDiag->cd(6);
   hChi2PerDOF2->SetMinimum(0);
-  hChi2PerDOF2->SetMaximum(6);
+  hChi2PerDOF2->SetMaximum(60);
   hChi2PerDOF2->Draw();
 
   Char_t fileNameBase[80];
@@ -427,8 +450,8 @@ TH1F* PtMassAna2(TH2F *PtMass, Int_t mode, const Int_t NControl, TObjArray *Cont
     ey = hYields->GetBinError(j)/hYields->GetBinWidth(j);
     hYields->SetBinContent(j,y);
     hYields->SetBinError(j,ey);
-    y = hYields->GetBinContent(j)/hYields->GetBinCenter(j);
-    ey = hYields->GetBinError(j)/hYields->GetBinCenter(j);
+//    y = hYields->GetBinContent(j)/hYields->GetBinCenter(j);
+//    ey = hYields->GetBinError(j)/hYields->GetBinCenter(j);
     hYields->SetBinContent(j,y);
     hYields->SetBinError(j,ey);
   }
diff --git a/PWG2/SPECTRA/LambdaK0PbPb/clean_files b/PWG2/SPECTRA/LambdaK0PbPb/clean_files
new file mode 100755 (executable)
index 0000000..d2c70bb
--- /dev/null
@@ -0,0 +1 @@
+rm -rf *.so *.d *.xml *.root  std* log* *.jdl 
index 3a08b16..e05bc2f 100644 (file)
@@ -27,7 +27,7 @@ TList * listToLoad = new TList(); // Additional classes to be loaded, see InitAn
 TChain * GetAnalysisChain(const char * incollection);
 void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug=0) ;
 
-void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0, Bool_t usePID = kTRUE, const char* option = "",TString customSuffix = "", Int_t workers = -1, const char * gridMode="full")
+void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 1, Bool_t usePID = kTRUE, const char* option = "",TString customSuffix = "", Int_t workers = -1, const char * gridMode="full", Int_t binMin=0, Int_t binMax = 6)
 {
   // runMode:
   //
@@ -76,6 +76,7 @@ void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t
   // Centrality
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
   AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
+  //taskCentrality->SetPass(2);
   if(isMC) taskCentrality->SetMCInput();
 
   AliAnalysisCentralitySelector * centrSelector = new AliAnalysisCentralitySelector();
@@ -104,7 +105,7 @@ void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t
   
   gROOT->ProcessLine(".L AddTaskLambdaK0PbPb.C");
   Int_t nbin = 0; // will contain the number of centrality bins
-  AliAnalysisTaskPerformanceStrange ** task = AddTaskLambdaK0PbPb("lambdak0.root", centrSelector, nbin); // FIXME also pass cuts, centrality bin type selection(5,10% percentiles, ranges...)
+  AliAnalysisTaskPerformanceStrange ** task = AddTaskLambdaK0PbPb("lambdak0.root", centrSelector, nbin, binMin, binMax,isMC); // FIXME also pass cuts, centrality bin type selection(5,10% percentiles, ranges...)
   // configure task
   //  else if (iAODanalysis) task->SetAnalysisType("AOD");
   // FIXME: add options to macro
@@ -141,7 +142,7 @@ void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t
     //    chain->Print();
     mgr->StartAnalysis("local",chain,nev);
   } else if (runMode == kMyRunModeCAF) {
-    mgr->StartAnalysis("proof",TString(passOrPath)+"#esdTree",nev);
+    mgr->StartAnalysis("proof",TString(passOrPath)+data+"#esdTree",nev);
   } else if (runMode == kMyRunModeGRID) {
     mgr->StartAnalysis("grid");
   } else {
@@ -157,7 +158,7 @@ void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t
 
 void MoveOutput(const char * data, const char * suffix = ""){
 
-  TString path("output/");
+  TString path("output10bins/");
   path = path + TString(data).Tokenize("/")->Last()->GetName() + suffix;
   
   TString fileName = "lambdak0.root";
@@ -222,8 +223,10 @@ void InitAndLoadLibs(Int_t runMode, Int_t workers,Bool_t debug) {
       Char_t* alienuser = gSystem->Getenv("alien_API_USER");
       TProof * p = TProof::Open(alienuser!=0 ? Form("%s@alice-caf.cern.ch",alienuser) : "alice-caf.cern.ch", workers>0 ? Form("workers=%d",workers) : "");
       //TProof * p = TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");    
-      p->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\"); gEnv->GetTable()->Remove(o);", kTRUE); // avoid submerging
-      gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-18-AN");
+      //p->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\"); gEnv->GetTable()->Remove(o);", kTRUE); // avoid submerging
+      //gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-18-AN");
+      //gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-20-AN");
+      gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-21-AN");
 
 
       // Enable the needed package
index 25f13b2..8f37be5 100755 (executable)
@@ -1,14 +1,15 @@
 #!/bin/bash
 
-run=000137161
-pass=pass1_5plus
+run=
+#pass=/alice/data/LHC10h_000139172_p2
+pass=
 mc=0
 mode="full"
 nev=1234566789
 workers=26
 ROPT=""
 listfile=""
-offset=0
+offset=500000
 debug=kTRUE
 option="SAVE" #FIXME:set option
 suffix=""
@@ -18,7 +19,9 @@ partID=1
 task=no
 fit=no
 usePID=kTRUE
-
+binMin=0
+binMax=6
+ihist=0
 give_help() {
 
 cat <<ENDOFGUIDE
@@ -42,6 +45,8 @@ Available options:
                                must have the same path
   -x <suffix>                  Add extra suffix to files 
   -i                           Disable PID cuts
+  -c min,max                   First and last centrality bins to process 
+                               (As defined in AddTaskLambdaK0PbPb)
  Grid only options
   -g <gridmode>                Plugin Mode [default=$mode]
   -p <recopass>                Reconstruction pass [default=$pass]       
@@ -65,8 +70,16 @@ ENDOFGUIDE
 
 }
 
-while getopts "r:hd:mg:p:n:w:t:l:f:b:x:i" opt; do
+while getopts "r:hd:mg:p:n:w:t:l:f:b:x:ic:s:" opt; do
   case $opt in
+    s)
+    ihist=$OPTARG     
+    ;;
+    c)
+      bins=$OPTARG
+      binMax=${bins#*,}
+      binMin=${bins%,*}
+      ;;
     r)
       runMode=$OPTARG
       task=yes
@@ -97,6 +110,7 @@ while getopts "r:hd:mg:p:n:w:t:l:f:b:x:i" opt; do
       workers=$OPTARG
       ;;
     m)
+    #Int_t Nev =
       mc=kTRUE
       ;;
     g) 
@@ -144,18 +158,18 @@ if [ "$task" = "yes" ]
 
     if [ "$runMode" = "2" ]
     then
-       echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,$suffix,$workers,\"$mode\"\)
-       root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\"\)
+       echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,$suffix,$workers,\"$mode\",$binMin,$binMax\)
+       root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
     else
        for run in $runlist 
        do
-           echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,$suffix,$workers,\"$mode\"\)
-           root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\"\)
+           echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
+           root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
        done
     fi
 elif [ "$fit" = "yes" ]
 then    
-    root FitSpectrum.C\(\"./output/$fitFolder/lambdak0_${fitBin}.root\",\"clambdak0Histo_${fitBin}\",\"$suffix\",$partID\)
+    root FitSpectrum.C\(\"./output/$fitFolder/lambdak0_${fitBin}.root\",\"clambdak0Histo_${fitBin}\",\"$suffix\",${ihist},$partID\)
 else
     give_help
 fi
diff --git a/PWG2/SPECTRA/LambdaK0PbPb/runAll.sh b/PWG2/SPECTRA/LambdaK0PbPb/runAll.sh
new file mode 100644 (file)
index 0000000..6c5293d
--- /dev/null
@@ -0,0 +1,82 @@
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "0,0" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "1,1" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "2,2" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "3,3" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "4,4" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "5,5" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "6,6" -t "-b -q" -w 50
+
+
+#MC LHC11a10b
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "0,0" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "1,1" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "2,2" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "3,3" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "4,4" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "5,5" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "6,6" -t "-b -q" -w 50 -m
+
+#MC LHC11a10a
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139503 -c "0,0" -t "-b -q" -w 50 -m  small dataset for testing
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "0,0" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "1,1" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "2,2" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "3,3" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "4,4" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "5,5" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "6,6" -t "-b -q" -w 50 -m
+
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "0,0" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "1,1" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "2,2" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "3,3" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "4,4" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "5,5" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "6,6" -t "-b -q" -w 50 -m
+
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "0,0" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "1,1" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "2,2" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "3,3" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "4,4" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "5,5" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "6,6" -t "-b -q" -w 50 -m
+
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "0,0" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "1,1" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "2,2" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "3,3" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "4,4" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "5,5" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "6,6" -t "-b -q" -w 50 -m
+
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "0,0" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "1,1" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "2,2" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "3,3" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "4,4" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "5,5" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "10,10" -t "-b -q" -w 50 -m
+
+#MC alll caf datasets:
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139466 -c "10,10" -t "-b -q" -w 50 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139467 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139470 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139471 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139503 -c "0,10" -t "-b -q" -w 70 -m
+./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139505 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139507 -c "10,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139510 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139511 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139513 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139514 -c "0,10" -t "-b -q" -w 70 -m
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10a_000139517 -c "0,0" -t "-b -q" -w 50 -m
+
+#Real all caf datasets:
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "0,0" -t "-b -q" -w 50
+
+
+#Local
+
+#./run.sh -r 0 -d /data/work/AliceData2011/LHC11a10a/139507/999/AliESDs.root -c "0,10" -t "-b -q" -w 50 -m
+
diff --git a/PWG2/SPECTRA/LambdaK0PbPb/runAllGrid.sh b/PWG2/SPECTRA/LambdaK0PbPb/runAllGrid.sh
new file mode 100644 (file)
index 0000000..0530a97
--- /dev/null
@@ -0,0 +1,21 @@
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "0,0" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "1,1" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "2,2" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "3,3" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "4,4" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "5,5" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/data/ -d LHC10h_000139172_p2 -c "6,6" -t "-b -q" -w 50
+
+
+#MC
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "0,0" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "1,1" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "2,2" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "3,3" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "4,4" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "5,5" -t "-b -q" -w 50
+#./run.sh -r 1 -p /alice/sim/ -d LHC11a10b_000139507 -c "6,6" -t "-b -q" -w 50
+
+#Grid
+./run.sh -r 2   -d 139110 139172 139173 139309 139310 139314 139328 139329 139360 139437 139438 139440 139441 139465 139466 139467 139470 139471 139503 139505 139507 139510 139511 139513 139514 139517  -c "0,6" -t "-b -q" -w 50
+
diff --git a/PWG2/SPECTRA/LambdaK0PbPb/runFit.sh b/PWG2/SPECTRA/LambdaK0PbPb/runFit.sh
new file mode 100644 (file)
index 0000000..dee3852
--- /dev/null
@@ -0,0 +1,27 @@
+
+cent=04
+hist=2
+suffix=K0MC
+#suffix=K0Real
+#suffix=LMC
+#suffix=LReal
+partID=0
+#data=LHC10h_000139172_p2
+#data=LHC10h_pass2
+data=LHC11a10a_final
+out=results
+#out=resultsPt
+
+#./run.sh -f LHC10h_000139172_p2 -b 00 -s 4 -x K0cent00MC -m -p 0
+./run.sh -f ${data} -b ${cent} -s ${hist} -x ${suffix} -m -p ${partID}
+
+mkdir ./${out}
+mkdir ./${out}/${suffix}/
+mkdir ./${out}/${suffix}/${cent}
+outfold=./${out}/${suffix}/${cent}
+mv Yield* ${outfold}
+mv Diag* ${outfold}
+mv Masses* ${outfold}
+
+echo "//////////////////////////////////////"
+echo "output directory is: " ${out fold}
diff --git a/PWG2/SPECTRA/LambdaK0PbPb/runQA.C b/PWG2/SPECTRA/LambdaK0PbPb/runQA.C
new file mode 100644 (file)
index 0000000..be8e87d
--- /dev/null
@@ -0,0 +1,282 @@
+// #include <iostream>
+// #include "AliAnalysisManager.h"
+// #include "AliESDInputHandler.h"
+// #include "AliMCEventHandler.h"
+// #include "AliAnalysisGrid.h"
+// #include "AliCentralitySelectionTask.h"
+// #include "AliAnalysisCentralitySelector.h"
+// #include "AliAnalysisTaskPerformanceStrange.h"
+// #include "TString.h"
+// #include "TChain.h"
+// #include "TAlienCollection.h"
+// #include <fstream>
+// #include "TObjString.h"
+// #include "TIterator.h"
+// #include "TGrid.h"
+// #include "TROOT.h"
+
+// #include "CreateAlienHandler.C"
+// #include 
+
+using namespace std;
+
+enum { kMyRunModeLocal = 0, kMyRunModeCAF, kMyRunModeGRID};
+
+TList * listToLoad = new TList(); // Additional classes to be loaded, see InitAndLoadLibs
+
+TChain * GetAnalysisChain(const char * incollection);
+void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug=0) ;
+
+void run(const char * data, const char * passOrPath, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0, Bool_t usePID = kTRUE, const char* option = "",TString customSuffix = "", Int_t workers = -1, const char * gridMode="full", Int_t binMin=0, Int_t binMax = 6)
+{
+  // runMode:
+  //
+  // 0 local 
+  // 1 proof
+  // 2 grid
+
+  if (nev < 0)
+    nev = 1234567890;
+  InitAndLoadLibs(runMode,workers,debug);
+
+  // Create the analysis manager
+  AliAnalysisManager * mgr = new AliAnalysisManager;
+
+  // Add ESD handler
+  AliESDInputHandler* esdH = new AliESDInputHandler;
+  // Do I need any of this? 
+  // esdH->SetInactiveBranches("AliESDACORDE FMD ALIESDTZERO ALIESDZDC AliRawDataErrorLogs CaloClusters Cascades EMCALCells EMCALTrigger ESDfriend Kinks AliESDTZERO ALIESDACORDE MuonTracks TrdTracks");
+  mgr->SetInputEventHandler(esdH);
+
+  if(isMC) {
+    AliMCEventHandler* handler = new AliMCEventHandler;
+    handler->SetPreReadMode(AliMCEventHandler::kLmPreRead);
+    mgr->SetMCtruthEventHandler(handler);
+  }
+
+
+  // If we are running on grid, we need the alien handler
+  if (runMode == kMyRunModeGRID) {
+    // Create and configure the alien handler plugin
+    TGrid::Connect("alien://");// Why do I need this? Without a get a bus error...
+        gROOT->LoadMacro("CreateAlienHandler.C");
+    AliAnalysisGrid *alienHandler = CreateAlienHandler(data, listToLoad, gridMode, isMC);  
+    if (!alienHandler) {
+      cout << "Cannot create alien handler" << endl;    
+      exit(1);
+    }
+    mgr->SetGridHandler(alienHandler);  
+  }
+  
+
+  // Physics selection
+  gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
+  AliPhysicsSelectionTask * physicsSelectionTask = AddTaskPhysicsSelection(isMC);
+
+  // Centrality
+  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
+  AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
+  taskCentrality->SetPass(2);
+  if(isMC) taskCentrality->SetMCInput();
+
+  AliAnalysisCentralitySelector * centrSelector = new AliAnalysisCentralitySelector();
+  centrSelector->SetIsMC(isMC);
+  centrSelector->SetCentralityEstimator("V0M"); // Todo: add parameter to macro?
+
+  // Parse option strings
+  TString optionStr(option);
+  
+  // remove SAVE option if set
+  Bool_t doSave = kFALSE;
+
+  if (optionStr.Contains("SAVE"))
+    {
+      optionStr = optionStr(0,optionStr.Index("SAVE")) + optionStr(optionStr.Index("SAVE")+4, optionStr.Length());
+      doSave = kTRUE;
+    }
+  TString pathsuffix = "";
+  // Not used, but may be useful
+  Bool_t useMCKinematics = isMC;
+  if (optionStr.Contains("NOMCKIN")) {
+    cout << ">>>> Ignoring MC kinematics" << endl;
+    useMCKinematics=kFALSE;
+    pathsuffix+="_NOMCKIN";
+  }
+  
+  gROOT->ProcessLine(".L AddTaskLambdaK0PbPb.C");
+  Int_t nbin = 0; // will contain the number of centrality bins
+  AliAnalysisTaskPerformanceStrange ** task = AddTaskLambdaK0PbPb("lambdak0.root", centrSelector, nbin, binMin, binMax); // FIXME also pass cuts, centrality bin type selection(5,10% percentiles, ranges...)
+  // configure task
+  //  else if (iAODanalysis) task->SetAnalysisType("AOD");
+  // FIXME: add options to macro
+  // FIXME: put physics selection inside the task
+  cout << nbin << endl;
+  
+  for(Int_t ibin = 0; ibin < nbin; ibin++){
+    cout << "ibin " << ibin << "  "<< endl;//task[ibin] << endl;
+    
+    task[ibin]->SetAnalysisType("ESD");
+    cout << "1" << endl;
+    task[ibin]->SetAnalysisMC(isMC); // 0 or 1
+    cout << "2" << endl;
+    task[ibin]->SetCollidingSystems(1); // 0 =pp, 1=AA
+    cout << "3" << endl;
+    task[ibin]->SetAnalysisCut("no");
+    cout << "4" << endl;
+    if(usePID) 
+      task[ibin]->SetUsePID("withPID"); // withPID or withoutPID
+    else
+      task[ibin]->SetUsePID("withoutPID"); // withPID or withoutPID
+    cout << "5" << endl;
+  }
+
+  // Init and run the analy
+  if (!mgr->InitAnalysis()) return;
+
+  mgr->PrintStatus();
+  
+  if (runMode == kMyRunModeLocal ) {
+    // If running in local mode, create chain of ESD files
+    cout << "RUNNING LOCAL, CHAIN" << endl;    
+    TChain * chain = GetAnalysisChain(data);
+    //    chain->Print();
+    mgr->StartAnalysis("local",chain,nev);
+  } else if (runMode == kMyRunModeCAF) {
+    mgr->StartAnalysis("proof",TString(passOrPath)+data+"#esdTree",nev);
+  } else if (runMode == kMyRunModeGRID) {
+    mgr->StartAnalysis("grid");
+  } else {
+    cout << "ERROR: unknown run mode" << endl;        
+  }
+
+  pathsuffix += customSuffix;
+
+  if (doSave) MoveOutput(data, pathsuffix.Data());
+
+  
+}
+
+void MoveOutput(const char * data, const char * suffix = ""){
+
+  TString path("output/");
+  path = path + TString(data).Tokenize("/")->Last()->GetName() + suffix;
+  
+  TString fileName = "lambdak0.root";
+  gSystem->mkdir(path, kTRUE);
+  gSystem->Rename(fileName, path + "/" + fileName);
+  for(Int_t ibin = 0; ibin < 20; ibin++){
+    TString fileBin = fileName;
+    fileBin.ReplaceAll(".root",Form("_%2.2d.root",ibin));
+    gSystem->Rename(fileBin, path + "/" + fileBin);    
+  }
+  
+  gSystem->Rename("event_stat.root", path + "/event_stat.root");      
+  gSystem->Rename("EventStat_temp.root", path + "/EventStat_temp.root");      
+  Printf(">>>>> Moved files to %s", path.Data());
+}  
+
+
+
+TChain * GetAnalysisChain(const char * incollection){
+  // Builds a chain of esd files
+  // incollection can be
+  // - a single root file
+  // - an xml collection of files on alien
+  // - a ASCII containing a list of local root files
+
+  TChain* analysisChain = 0;
+  // chain
+  analysisChain = new TChain("esdTree");
+  if (TString(incollection).Contains(".root")){
+    analysisChain->Add(incollection);
+  }
+  else if (TString(incollection).Contains("xml")){
+    TGrid::Connect("alien://");
+    TGridCollection * coll = TAlienCollection::Open (incollection);
+    while(coll->Next()){
+      analysisChain->Add(TString("alien://")+coll->GetLFN());
+    }
+  } else {
+    ifstream file_collect(incollection);
+    TString line;
+    while (line.ReadLine(file_collect) ) {
+      analysisChain->Add(line.Data());
+    }
+  }
+  analysisChain->GetListOfFiles()->Print();
+
+  return analysisChain;
+}
+
+
+void InitAndLoadLibs(Int_t runMode, Int_t workers,Bool_t debug) {
+  // Loads libs and par files + custom task and classes (the order is important)
+  // listToLoad->Add(new TObjString("$ALICE_ROOT/STEER/AliCentrality.cxx")); // FIXME: why do I have to load it?!?
+  listToLoad->Add(new TObjString("AliAnalysisCentralitySelector.cxx"));
+  listToLoad->Add(new TObjString("AliAnalysisTaskPerformanceStrange.cxx"));
+
+  if (runMode == kMyRunModeCAF)
+    {
+      cout << "Init in CAF mode" << endl;
+    
+      gEnv->SetValue("XSec.GSI.DelegProxy", "2");
+      Char_t* alienuser = gSystem->Getenv("alien_API_USER");
+      TProof * p = TProof::Open(alienuser!=0 ? Form("%s@alice-caf.cern.ch",alienuser) : "alice-caf.cern.ch", workers>0 ? Form("workers=%d",workers) : "");
+      //TProof * p = TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");    
+      p->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\"); gEnv->GetTable()->Remove(o);", kTRUE); // avoid submerging
+      //gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-18-AN");
+      gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-20-AN");
+
+
+      // Enable the needed package
+      // FIXME: what if I don't want to use par files?
+      gSystem->AddIncludePath("-I${ALICE_ROOT}/include/");
+      gSystem->AddIncludePath("-I${ALICE_ROOT}/STEER/");
+      // gProof->UploadPackage("$ALICE_ROOT/obj/STEERBase");
+      // gProof->EnablePackage("$ALICE_ROOT/obj/STEERBase");
+      // gProof->UploadPackage("$ALICE_ROOT/obj/ESD");
+      // gProof->EnablePackage("$ALICE_ROOT/obj/ESD");
+      // gProof->UploadPackage("$ALICE_ROOT/obj/AOD");
+      // gProof->EnablePackage("$ALICE_ROOT/obj/AOD");
+      // gProof->UploadPackage("$ALICE_ROOT/obj/ANALYSIS");
+      // gProof->EnablePackage("$ALICE_ROOT/obj/ANALYSIS");
+      // gProof->UploadPackage("$ALICE_ROOT/obj/ANALYSISalice");
+      // gProof->EnablePackage("$ALICE_ROOT/obj/ANALYSISalice");
+      // gProof->UploadPackage("$ALICE_ROOT/obj/CORRFW");
+      // gProof->EnablePackage("$ALICE_ROOT/obj/CORRFW");
+      // gProof->UploadPackage("~/Desktop/OADB");//FIXME
+      // gProof->EnablePackage("~/Desktop/OADB");//FIXME
+      
+    }
+  else
+    {
+      cout << "Init in Local or Grid mode" << endl;
+      gSystem->Load("libCore.so");  
+      gSystem->Load("libTree.so");
+      gSystem->Load("libGeom.so");
+      gSystem->Load("libVMC.so");
+      gSystem->Load("libPhysics.so");
+      gSystem->Load("libSTEERBase");
+      gSystem->Load("libESD");
+      gSystem->Load("libAOD");
+      gSystem->Load("libANALYSIS");
+      gSystem->Load("libANALYSISalice");   
+
+      // gSystem->Load("libVMC");
+      gROOT->ProcessLine(".include $ALICE_ROOT/include");
+      gROOT->ProcessLine(".include $ALICE_ROOT/STEER");
+    }
+  // Load helper classes
+  TIterator * iter = listToLoad->MakeIterator();
+  TObjString * name = 0;
+  while ((name = (TObjString *)iter->Next())) {
+    gSystem->ExpandPathName(name->String());
+    cout << name->String().Data() << endl;
+    if (runMode == kMyRunModeCAF) {
+      gProof->Load(name->String()+(debug?"++g":"+"));   
+    } else {
+      gROOT->LoadMacro(name->String()+(debug?"++g":"+"));   
+    }
+  }
+
+}