Opened V0 track cuts slightly, double counting removed
authorBenjaminDoenigus <doenigus@lxsub08.gsi.de>
Mon, 20 Jan 2014 13:31:04 +0000 (14:31 +0100)
committerBenjaminDoenigus <doenigus@lxsub08.gsi.de>
Mon, 20 Jan 2014 13:31:04 +0000 (14:31 +0100)
PWGLF/STRANGENESS/Hypernuclei/AddTask_doenigus_HdibaryonLPpi.C
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskHdibaryonLPpi.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskHdibaryonLPpi.h

index b3a9aad..8b05c55 100644 (file)
@@ -5,32 +5,70 @@ AliAnalysisTask *AddTask_doenigus_HdibaryonLPpi(){
     Error("AddTask_doenigus_HdibaryonLPpi", "No analysis manager found.");
     return 0;
   }
+  /*
+  //============= Set Task Name ===================
+  TString taskName=("AliAnalysisTaskHdibaryonLPpi.cxx+");
+  //===============================================
+  //            Load the task
+    
+  if (gProof){
+    TString taskSO=gSystem->pwd();
+    taskSO+="/";
+    taskSO+=taskName(0,taskName.First('.'))+"_cxx.so";
+    gProof->Exec(Form("gSystem->Load(\"%s\")",taskSO.Data()),kTRUE);
+  }
   
+  gROOT->LoadMacro("AliAnalysisTaskHdibaryonLPpi.cxx+");
+  gROOT->LoadMacro(taskName.Data());
+  */
+
+   Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
+
+   // gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+   //Bool_t isMC=kFALSE; // kTRUE in case of MC
+   //if (hasMC) isMC=kTRUE;
+   //AddTaskPIDResponse(isMC); 
+
+   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+   Bool_t isMC=kFALSE; // kTRUE in case of MC
+   if (hasMC) isMC=kTRUE;
+   Bool_t useTPCEtaCorrection = kFALSE;
+   AddTaskPIDResponse(isMC, kTRUE, kFALSE, 2, kFALSE, "", useTPCEtaCorrection);
+
   //========= Add task to the ANALYSIS manager =====
   AliAnalysisTaskSE *taskHdibaryonLPpi = new AliAnalysisTaskHdibaryonLPpi("doenigus_HdibaryonLPpi");
   
   Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
 
+  // taskHdibaryonLPpi->SelectCollisionCandidates(AliVEvent::kAny);
+  //  taskTest->SelectCollisionCandidates(AliVEvent::kMB);
+
   mgr->AddTask(taskHdibaryonLPpi);
 
   if (!hasMC){
+  //  taskLambda1520MC->SelectCollisionCandidates(AliVEvent::kMB);
   taskHdibaryonLPpi->SelectCollisionCandidates(AliVEvent::kAny);
   }
+  //  taskTest->SelectCollisionCandidates(AliVEvent::kMB);
+  //  mgr->AddTask(taskLambda1520MC);
 
   //================================================
   //              data containers
   //================================================
   //            find input container
+  //below the trunk version
   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
+  //this is the old way!!!
+  //AliAnalysisDataContainer *cinput  = (AliAnalysisDataContainer*)mgr->GetContainers()->FindObject("cAUTO_INPUT");
 
-  AliAnalysisDataContainer *coutput0_doenigusHdibaryonLPpi = mgr->CreateContainer("doenigus_tree_doenigusHdibaryonLPpi", TTree::Class(), AliAnalysisManager::kExchangeContainer, "doenigus_default_doenigusHdibaryonLPpi");  
+  //AliAnalysisDataContainer *coutput0_doenigusHdibaryonLPpi = mgr->CreateContainer("doenigus_tree_doenigusHdibaryonLPpi", TTree::Class(), AliAnalysisManager::kExchangeContainer, "doenigus_default_doenigusHdibaryonLPpi");  
 
   //            define output containers, please use 'username'_'somename'
   AliAnalysisDataContainer *coutput_doenigusHdibaryonLPpi = mgr->CreateContainer("doenigus_HdibaryonLPpi", TList::Class(), AliAnalysisManager::kOutputContainer,"doenigus_HdibaryonLPpi.root");
 
   //           connect containers
   mgr->ConnectInput  (taskHdibaryonLPpi,  0, cinput );
-  mgr->ConnectOutput  (taskHdibaryonLPpi,  0, coutput0_doenigusHdibaryonLPpi); 
+  //mgr->ConnectOutput (taskHdibaryonLPpi,  0, coutput0_doenigusHdibaryonLPpi); 
   mgr->ConnectOutput (taskHdibaryonLPpi,  1, coutput_doenigusHdibaryonLPpi);
 
   return taskHdibaryonLPpi;
index 953875f..88b460e 100644 (file)
-/**************************************************************************
- * Author : Benjamin Dönigus (benjamin.doenigus@cern.ch)                  *
- *                                                                        *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-//-----------------------------------------------------------------
-//                 AliAnalysisTaskHdibaryonLPpi class
-//          used to search for the H-Dibaryon in weak 
-//          (Lambda Proton Pion) and strong (Lambda Lambda) decays
-//-----------------------------------------------------------------
-
-#include "Riostream.h"
-#include "TROOT.h"
-#include "TChain.h"
-#include "TStyle.h"
-#include "TSystem.h"
-#include "TTree.h"
-#include "TH1F.h"
-#include "TH1.h"
-#include "TH2D.h"
-#include "TH3F.h"
-#include "TCanvas.h"
-#include "TParticle.h"
-#include "TNtuple.h"
-#include "TObjString.h"
-#include "TLorentzVector.h"
-#include "TDatabasePDG.h"
-
-#include "AliAnalysisTask.h"
-#include "AliAnalysisManager.h"
-#include "AliMCEventHandler.h"
-#include "AliMCEvent.h"
-
-#include "AliESD.h"
-#include "AliESDpid.h"
-#include "AliESDEvent.h"
-#include "AliGenEventHeader.h"
-#include "AliESDInputHandler.h"
-#include "AliLog.h"
-#include "AliStack.h"
-#include "AliHeader.h"
-
-#include "AliKFParticle.h"
-#include "AliKFVertex.h"
-#include "AliESDtrackCuts.h"
-#include "AliESDv0Cuts.h"
-#include "AliAnalysisTaskHdibaryonLPpi.h"
-
-#include "TFile.h"
-#include "TH2F.h"
-#include "TF1.h"
-#include "TCanvas.h"
-#include "TList.h"
-#include "TParallelCoord.h"
-
-#include "AliMCParticle.h"
-#include "AliGenPythiaEventHeader.h"
-
-#include "AliPID.h"
-#include "AliESDtrack.h"
-#include "AliCentrality.h"
-
-#include "THnSparse.h"
-
-#include "AliVertexerTracks.h"
-
-using namespace std;
-ClassImp(AliAnalysisTaskHdibaryonLPpi)
-//________________________________________________________________________
-AliAnalysisTaskHdibaryonLPpi::AliAnalysisTaskHdibaryonLPpi() : AliAnalysisTaskSE()/*AliAnalysisTask(name, ""), fMCEvent(0)*/, fESD(0),   fESDtrackCutsV0(0),
-  fESDCutsV0(0),
-  fEsdTrackCuts(0),
-  fBin(0),
-  fEvent(0x0),
-  fHistList(0),  
-  fHistMassDPi(0), 
-  fHistMassLPi(0),
-  fHistMassLambdaPi(0),
-  fHistMassLambda(0),
-  fHistMassLambdaPPi(0),
-  fHistMassLambdaP(0),
-  fHistMassLambdaK(0),
-  fHistMassK0onl(0),
-  fHistMassK0offl(0),
-  fHistMassK0onlC(0),
-  fHistMassK0offlC(0),
-  fHistMassPQonl(0), 
-  fHistMassPQoffl(0),
-  fHistDC(0),
-  fHistArmenterosPodolanski(0),
-  fHistArmenterosPodolanskiCut(0), 
-  fHistHDibaryonInvaMassGen(0),
-  fHistHDibaryonInvaMassGenRes(0),
-  fHistAntiHDibaryonInvaMassGen(0),
-  fHistHDibaryonInvaMassAso(0),
-  fHistHDibaryonInvaMassAsoReso(0),
-  fHistAntiHDibaryonInvaMassAso(0),
-  fHistCheck(0),
-  fHistHPointingAngle(0),
-  fHistMassH(0),
-  fHistMassLambdaFromH(0),
-  fHistMassLambdaFromHtLorentz(0),
-  fHistMassPpi(0),
-  fHistMassPpiReso(0),
-  fHistMassLpi(0),
-  fHistMassLP(0),
-  fHistProtonPIDBb(0),
-  fHistPionPIDBb(0),
-  fHistProtonPIDLambda(0),
-  fHistPionPIDLambda(0),
-  fHistMCdcaPvtxDvtx(0),
-  fHistMCdcaPvtxLvtx(0),
-  fHistMCdcaDvtxLvtx(0),
-  fHistMCangleLH(0),
-  fHistMCdecayAngle(0),
-  fHistMCpointingAngle(0),
-  fHistMCap(0),
-  fHistMCdcaPvtxDvtxReso(0),
-  fHistMCdcaPvtxLvtxReso(0),
-  fHistMCdcaDvtxLvtxReso(0),
-  fHistMCangleLHReso(0),
-  fHistMCdecayAngleReso(0),
-  fHistMCpointingAngleReso(0),
-  fHistMCapReso(0),
-  fHistCentrality(0),
-  fHistCentralityAC(0), 
-  fHistMultiplicity(0),
-  fHistHilf1(0),
-  fHistHilf2(0), 
-  fHistHilf3(0),
-  fHistHilf4(0),
-  fHistHilf5(0), 
-  fHistHilf6(0),
-  fHistPtvsEtaGen(0),
-  fHistPtvsEtaAso(0),
-  fHistPtvsYGen(0),
-  fHistPtvsYAso(0), 
-  fHistRap(0),
-  fHistCount(0),
-  fPIDtpcESD(0),
-  fHistTriggerStat(0),
-  fHistTriggerStatAfterEventSelection(0), 
-  fHistMassHcentMult(0),
-  fHistNdim(0)
-{
-  // DefaultConstructor
-
-}
-
-//________________________________________________________________________
-AliAnalysisTaskHdibaryonLPpi::AliAnalysisTaskHdibaryonLPpi(const char *name) : AliAnalysisTaskSE(name)/*AliAnalysisTask(name, ""), fMCEvent(0)*/, fESD(0),   fESDtrackCutsV0(0),
-  fESDCutsV0(0),
-  fEsdTrackCuts(0),
-  fBin(0),
-  fEvent(0x0),
-  fHistList(0),  
-  fHistMassDPi(0), 
-  fHistMassLPi(0),
-  fHistMassLambdaPi(0),
-  fHistMassLambda(0),
-  fHistMassLambdaPPi(0),
-  fHistMassLambdaP(0),
-  fHistMassLambdaK(0),
-  fHistMassK0onl(0),
-  fHistMassK0offl(0),
-  fHistMassK0onlC(0),
-  fHistMassK0offlC(0),
-  fHistMassPQonl(0), 
-  fHistMassPQoffl(0),
-  fHistDC(0),
-  fHistArmenterosPodolanski(0),
-  fHistArmenterosPodolanskiCut(0), 
-  fHistHDibaryonInvaMassGen(0),
-  fHistHDibaryonInvaMassGenRes(0),
-  fHistAntiHDibaryonInvaMassGen(0),
-  fHistHDibaryonInvaMassAso(0),
-  fHistHDibaryonInvaMassAsoReso(0),
-  fHistAntiHDibaryonInvaMassAso(0),
-  fHistCheck(0),
-  fHistHPointingAngle(0),
-  fHistMassH(0),
-  fHistMassLambdaFromH(0),
-  fHistMassLambdaFromHtLorentz(0),
-  fHistMassPpi(0),
-  fHistMassPpiReso(0),
-  fHistMassLpi(0),
-  fHistMassLP(0),
-  fHistProtonPIDBb(0),
-  fHistPionPIDBb(0),
-  fHistProtonPIDLambda(0),
-  fHistPionPIDLambda(0),
-  fHistMCdcaPvtxDvtx(0),
-  fHistMCdcaPvtxLvtx(0),
-  fHistMCdcaDvtxLvtx(0),
-  fHistMCangleLH(0),
-  fHistMCdecayAngle(0),
-  fHistMCpointingAngle(0),
-  fHistMCap(0),
-  fHistMCdcaPvtxDvtxReso(0),
-  fHistMCdcaPvtxLvtxReso(0),
-  fHistMCdcaDvtxLvtxReso(0),
-  fHistMCangleLHReso(0),
-  fHistMCdecayAngleReso(0),
-  fHistMCpointingAngleReso(0),
-  fHistMCapReso(0),
-  fHistCentrality(0),
-  fHistCentralityAC(0), 
-  fHistMultiplicity(0), 
-  fHistHilf1(0),
-  fHistHilf2(0), 
-  fHistHilf3(0),
-  fHistHilf4(0),
-  fHistHilf5(0), 
-  fHistHilf6(0),
-  fHistPtvsEtaGen(0),
-  fHistPtvsEtaAso(0),
-  fHistPtvsYGen(0),
-  fHistPtvsYAso(0), 
-  fHistRap(0),
-  fHistCount(0),
-  fPIDtpcESD(0),
-  fHistTriggerStat(0),
-  fHistTriggerStatAfterEventSelection(0),
-  fHistMassHcentMult(0),
-  fHistNdim(0)
-
-{
-  // Constructor
-
-  // Define input and output slots here
-  // Input from a TChain
-  DefineInput(0, TChain::Class());
-  // Output to TList container
-  DefineOutput(1, TList::Class()); //full
-
-  //MC info contol
-  if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())SetHasMC();
-
-  //V0 cuts
-
-  fESDtrackCutsV0 = new AliESDtrackCuts("AliESDtrackCutsV0","AliESDtrackCutsV0");
-  fESDtrackCutsV0->SetAcceptKinkDaughters(kFALSE);
-  fESDtrackCutsV0->SetMinNClustersTPC(80);
-  fESDtrackCutsV0->SetMaxChi2PerClusterTPC(5);
-  fESDtrackCutsV0->SetRequireTPCRefit(kTRUE);
+/**************************************************************************\r
+ * Author : Benjamin Dönigus (benjamin.doenigus@cern.ch)                  *\r
+ *                                                                        *\r
+ * Contributors are mentioned in the code where appropriate.              *\r
+ *                                                                        *\r
+ * Permission to use, copy, modify and distribute this software and its   *\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r
+ * without fee, provided that the above copyright notice appears in all   *\r
+ * copies and that both the copyright notice and this permission notice   *\r
+ * appear in the supporting documentation. The authors make no claims     *\r
+ * about the suitability of this software for any purpose. It is          *\r
+ * provided "as is" without express or implied warranty.                  *\r
+ **************************************************************************/\r
+\r
+//-----------------------------------------------------------------\r
+//                 AliAnalysisTaskHdibaryonLPpi class\r
+//          used to search for the H-Dibaryon in weak \r
+//          (Lambda Proton Pion) and strong (Lambda Lambda) decays\r
+//-----------------------------------------------------------------\r
+\r
+#include "Riostream.h"\r
+#include "TROOT.h"\r
+#include "TChain.h"\r
+#include "TStyle.h"\r
+#include "TSystem.h"\r
+#include "TTree.h"\r
+#include "TH1F.h"\r
+#include "TH1.h"\r
+#include "TH2D.h"\r
+#include "TH3F.h"\r
+#include "TCanvas.h"\r
+#include "TParticle.h"\r
+#include "TNtuple.h"\r
+#include "TObjString.h"\r
+#include "TLorentzVector.h"\r
+#include "TDatabasePDG.h"\r
+\r
+#include "AliAnalysisTask.h"\r
+#include "AliAnalysisManager.h"\r
+#include "AliMCEventHandler.h"\r
+#include "AliMCEvent.h"\r
+\r
+#include "AliESD.h"\r
+#include "AliESDpid.h"\r
+#include "AliESDEvent.h"\r
+#include "AliGenEventHeader.h"\r
+#include "AliESDInputHandler.h"\r
+#include "AliLog.h"\r
+#include "AliStack.h"\r
+#include "AliHeader.h"\r
+\r
+#include "AliKFParticle.h"\r
+#include "AliKFVertex.h"\r
+#include "AliESDtrackCuts.h"\r
+#include "AliESDv0Cuts.h"\r
+#include "AliAnalysisTaskHdibaryonLPpi.h"\r
+\r
+#include "TFile.h"\r
+#include "TH2F.h"\r
+#include "TF1.h"\r
+#include "TCanvas.h"\r
+#include "TList.h"\r
+#include "TParallelCoord.h"\r
+\r
+#include "AliMCParticle.h"\r
+#include "AliGenPythiaEventHeader.h"\r
+\r
+#include "AliPID.h"\r
+#include "AliESDtrack.h"\r
+#include "AliCentrality.h"\r
+\r
+#include "THnSparse.h"\r
+\r
+#include "AliVertexerTracks.h"\r
+\r
+using namespace std;\r
+ClassImp(AliAnalysisTaskHdibaryonLPpi)\r
+//________________________________________________________________________\r
+AliAnalysisTaskHdibaryonLPpi::AliAnalysisTaskHdibaryonLPpi() : AliAnalysisTaskSE()/*AliAnalysisTask(name, ""), fMCEvent(0)*/, fESD(0),   fESDtrackCutsV0(0),\r
+  fESDCutsV0(0),\r
+  fEsdTrackCuts(0),\r
+  fBin(0),\r
+  fEvent(0x0),\r
+  fHistList(0),  \r
+  fHistMassDPi(0), \r
+  fHistMassLPi(0),\r
+  fHistMassLambdaPi(0),\r
+  fHistMassLambda(0),\r
+  fHistMassLambdaPPi(0),\r
+  fHistMassLambdaP(0),\r
+  fHistMassLambdaK(0),\r
+  fHistMassK0onl(0),\r
+  fHistMassK0offl(0),\r
+  fHistMassK0onlC(0),\r
+  fHistMassK0offlC(0),\r
+  fHistMassPQonl(0), \r
+  fHistMassPQoffl(0),\r
+  fHistDC(0),\r
+  fHistArmenterosPodolanski(0),\r
+  fHistArmenterosPodolanskiCut(0), \r
+  fHistHDibaryonInvaMassGen(0),\r
+  fHistHDibaryonInvaMassGenRes(0),\r
+  fHistAntiHDibaryonInvaMassGen(0),\r
+  fHistHDibaryonInvaMassAso(0),\r
+  fHistHDibaryonInvaMassAsoReso(0),\r
+  fHistAntiHDibaryonInvaMassAso(0),\r
+  fHistCheck(0),\r
+  fHistHPointingAngle(0),\r
+  fHistMassH(0),\r
+  fHistMassLambdaFromH(0),\r
+  fHistMassLambdaFromHtLorentz(0),\r
+  fHistMassPpi(0),\r
+  fHistMassPpiReso(0),\r
+  fHistMassLpi(0),\r
+  fHistMassLP(0),\r
+  fHistProtonPIDBb(0),\r
+  fHistPionPIDBb(0),\r
+  fHistProtonPIDLambda(0),\r
+  fHistPionPIDLambda(0),\r
+  fHistMCdcaPvtxDvtx(0),\r
+  fHistMCdcaPvtxLvtx(0),\r
+  fHistMCdcaDvtxLvtx(0),\r
+  fHistMCangleLH(0),\r
+  fHistMCdecayAngle(0),\r
+  fHistMCpointingAngle(0),\r
+  fHistMCap(0),\r
+  fHistMCdcaPvtxDvtxReso(0),\r
+  fHistMCdcaPvtxLvtxReso(0),\r
+  fHistMCdcaDvtxLvtxReso(0),\r
+  fHistMCangleLHReso(0),\r
+  fHistMCdecayAngleReso(0),\r
+  fHistMCpointingAngleReso(0),\r
+  fHistMCapReso(0),\r
+  fHistCentrality(0),\r
+  fHistCentralityAC(0), \r
+  fHistMultiplicity(0),\r
+  fHistHilf1(0),\r
+  fHistHilf2(0), \r
+  fHistHilf3(0),\r
+  fHistHilf4(0),\r
+  fHistHilf5(0), \r
+  fHistHilf6(0),\r
+  fHistPtvsEtaGen(0),\r
+  fHistPtvsEtaAso(0),\r
+  fHistPtvsYGen(0),\r
+  fHistPtvsYAso(0), \r
+  fHistRap(0),\r
+  fHistCount(0),\r
+  fPIDtpcESD(0),\r
+  fHistTriggerStat(0),\r
+  fHistTriggerStatAfterEventSelection(0), \r
+  fHistMassHcentMult(0),\r
+  fHistNdim(0)\r
+{\r
+  // DefaultConstructor\r
+\r
+}\r
+\r
+//________________________________________________________________________\r
+AliAnalysisTaskHdibaryonLPpi::AliAnalysisTaskHdibaryonLPpi(const char *name) : AliAnalysisTaskSE(name)/*AliAnalysisTask(name, ""), fMCEvent(0)*/, fESD(0),   fESDtrackCutsV0(0),\r
+  fESDCutsV0(0),\r
+  fEsdTrackCuts(0),\r
+  fBin(0),\r
+  fEvent(0x0),\r
+  fHistList(0),  \r
+  fHistMassDPi(0), \r
+  fHistMassLPi(0),\r
+  fHistMassLambdaPi(0),\r
+  fHistMassLambda(0),\r
+  fHistMassLambdaPPi(0),\r
+  fHistMassLambdaP(0),\r
+  fHistMassLambdaK(0),\r
+  fHistMassK0onl(0),\r
+  fHistMassK0offl(0),\r
+  fHistMassK0onlC(0),\r
+  fHistMassK0offlC(0),\r
+  fHistMassPQonl(0), \r
+  fHistMassPQoffl(0),\r
+  fHistDC(0),\r
+  fHistArmenterosPodolanski(0),\r
+  fHistArmenterosPodolanskiCut(0), \r
+  fHistHDibaryonInvaMassGen(0),\r
+  fHistHDibaryonInvaMassGenRes(0),\r
+  fHistAntiHDibaryonInvaMassGen(0),\r
+  fHistHDibaryonInvaMassAso(0),\r
+  fHistHDibaryonInvaMassAsoReso(0),\r
+  fHistAntiHDibaryonInvaMassAso(0),\r
+  fHistCheck(0),\r
+  fHistHPointingAngle(0),\r
+  fHistMassH(0),\r
+  fHistMassLambdaFromH(0),\r
+  fHistMassLambdaFromHtLorentz(0),\r
+  fHistMassPpi(0),\r
+  fHistMassPpiReso(0),\r
+  fHistMassLpi(0),\r
+  fHistMassLP(0),\r
+  fHistProtonPIDBb(0),\r
+  fHistPionPIDBb(0),\r
+  fHistProtonPIDLambda(0),\r
+  fHistPionPIDLambda(0),\r
+  fHistMCdcaPvtxDvtx(0),\r
+  fHistMCdcaPvtxLvtx(0),\r
+  fHistMCdcaDvtxLvtx(0),\r
+  fHistMCangleLH(0),\r
+  fHistMCdecayAngle(0),\r
+  fHistMCpointingAngle(0),\r
+  fHistMCap(0),\r
+  fHistMCdcaPvtxDvtxReso(0),\r
+  fHistMCdcaPvtxLvtxReso(0),\r
+  fHistMCdcaDvtxLvtxReso(0),\r
+  fHistMCangleLHReso(0),\r
+  fHistMCdecayAngleReso(0),\r
+  fHistMCpointingAngleReso(0),\r
+  fHistMCapReso(0),\r
+  fHistCentrality(0),\r
+  fHistCentralityAC(0), \r
+  fHistMultiplicity(0), \r
+  fHistHilf1(0),\r
+  fHistHilf2(0), \r
+  fHistHilf3(0),\r
+  fHistHilf4(0),\r
+  fHistHilf5(0), \r
+  fHistHilf6(0),\r
+  fHistPtvsEtaGen(0),\r
+  fHistPtvsEtaAso(0),\r
+  fHistPtvsYGen(0),\r
+  fHistPtvsYAso(0), \r
+  fHistRap(0),\r
+  fHistCount(0),\r
+  fPIDtpcESD(0),\r
+  fHistTriggerStat(0),\r
+  fHistTriggerStatAfterEventSelection(0),\r
+  fHistMassHcentMult(0),\r
+  fHistNdim(0)\r
+\r
+{\r
+  // Constructor\r
+\r
+  // Define input and output slots here\r
+  // Input from a TChain\r
+  DefineInput(0, TChain::Class());\r
+  // Output to TList container\r
+  DefineOutput(1, TList::Class()); //full\r
+\r
+  //MC info contol\r
+  if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())SetHasMC();\r
+\r
+  //V0 cuts\r
+\r
+  fESDtrackCutsV0 = new AliESDtrackCuts("AliESDtrackCutsV0","AliESDtrackCutsV0");\r
+  fESDtrackCutsV0->SetAcceptKinkDaughters(kFALSE);\r
+  fESDtrackCutsV0->SetMinNClustersTPC(80);\r
+  fESDtrackCutsV0->SetMaxChi2PerClusterTPC(5);\r
+  fESDtrackCutsV0->SetRequireTPCRefit(kTRUE);\r
   fESDtrackCutsV0->SetEtaRange(-0.9,0.9);
-  fESDtrackCutsV0->SetPtRange(0.2,1.5);
-  fESDtrackCutsV0->SetMinDCAToVertexXY(3);
-  fESDtrackCutsV0->SetMinDCAToVertexZ(3);
-
-  fESDCutsV0 = new AliESDv0Cuts("AliESDCutsV0","AliESDCutsV0");
+  fESDtrackCutsV0->SetPtRange(0.2,1.5);\r
+  fESDtrackCutsV0->SetMinDCAToVertexXY(2);\r //war inzwischen 1 & 3
+  fESDtrackCutsV0->SetMinDCAToVertexZ(2);\r //war inzwischen 1 & 3
+\r
+  fESDCutsV0 = new AliESDv0Cuts("AliESDCutsV0","AliESDCutsV0");\r
   fESDCutsV0->SetMaxDcaV0Daughters(1.0);
-  fESDCutsV0->SetMinDcaNegToVertex(2.0);
-  fESDCutsV0->SetMinDcaPosToVertex(2.0);
-
-  //ESD Track cuts
-  fEsdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");    
-  fEsdTrackCuts->SetMinNClustersTPC(80);
-  fEsdTrackCuts->SetAcceptKinkDaughters(kFALSE);
-  fEsdTrackCuts->SetMaxChi2PerClusterTPC(5);
-  fEsdTrackCuts->SetRequireTPCRefit(kTRUE);
-  fEsdTrackCuts->SetEtaRange(-0.9,0.9);
-}
-
-//____________________________________________________________
-AliAnalysisTaskHdibaryonLPpi::~AliAnalysisTaskHdibaryonLPpi(){
-  //
-  // Destructor
-  //
-  if(fHistList){ 
-    fHistList->Clear();
-    delete fHistList;
-  }
-  if(fEsdTrackCuts) delete fEsdTrackCuts;
-  if(fESDtrackCutsV0) delete fESDtrackCutsV0;
-  if(fESDCutsV0) delete fESDCutsV0;
-
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskHdibaryonLPpi::UserCreateOutputObjects()
-{
-  // Create histograms
-  // Called once
-
- fHistList = new TList();
- fHistMassDPi = new TH1F("fHistMassDPi", "Invariant mass distribution p+#pi^{-} ", 500, 1.0, 1.25);
- fHistMassDPi->GetXaxis()->SetTitle("Invariant mass p+#pi^{-} (GeV/c^{2})");
- fHistMassDPi->GetYaxis()->SetTitle("Entries");
- fHistMassDPi->SetMarkerStyle(kFullCircle); 
-
- fHistMassLPi = new TH1F("fHistMassLPi", "Offline Invariant mass distribution p+#pi^{-} ", 500, 1.0, 1.25);
- fHistMassLPi->GetXaxis()->SetTitle("Invariant mass p+#pi^{-} (GeV/c^{2})");
- fHistMassLPi->GetYaxis()->SetTitle("Entries");
- fHistMassLPi->SetMarkerStyle(kFullCircle);
-
- fHistMassLambdaPi = new TH1F("fHistMassLambdaPi", "Invariant mass distribution #Lambda+#pi^{-} ", 500, 1.2, 1.5);
- fHistMassLambdaPi->GetXaxis()->SetTitle("Invariant mass #Lambda+#pi^{-} (GeV/c^{2})");
- fHistMassLambdaPi->GetYaxis()->SetTitle("Entries");
- fHistMassLambdaPi->SetMarkerStyle(kFullCircle);
- fHistMassLambda = new TH1F("fHistMassLambda", "Invariant mass distribution of #Lambda for further analyis", 500, 1.0, 1.2);
- fHistMassLambda->GetXaxis()->SetTitle("Invariant mass p+#pi^{+} (GeV/c^{2})");
- fHistMassLambda->GetYaxis()->SetTitle("Entries");
- fHistMassLambda->SetMarkerStyle(kFullCircle);
- fHistMassLambdaPPi = new TH1F("fHistMassLambdaPPi", "Invariant mass distribution #Lambdap#pi^{-} ", 300, 2.2, 2.5);
- fHistMassLambdaPPi->GetXaxis()->SetTitle("Invariant mass #Lambdap#pi^{-} (GeV/c^{2})");
- fHistMassLambdaPPi->GetYaxis()->SetTitle("Entries");
- fHistMassLambdaPPi->SetMarkerStyle(kFullCircle);
-
- fHistMassLambdaP = new TH1F("fHistMassLambdaP", "Invariant mass distribution #Lambdap ", 300, 2.2, 2.5);
- fHistMassLambdaP->GetXaxis()->SetTitle("Invariant mass #Lambdap (GeV/c^{2})");
- fHistMassLambdaP->GetYaxis()->SetTitle("Entries");
- fHistMassLambdaP->SetMarkerStyle(kFullCircle);
-
- fHistMassLambdaK = new TH1F("fHistMassLambdaK", "Invariant mass distribution #LambdaK^{-} ", 300, 1.6, 1.9);
- fHistMassLambdaK->GetXaxis()->SetTitle("Invariant mass #LambdaK^{-} (GeV/c^{2})");
- fHistMassLambdaK->GetYaxis()->SetTitle("Entries");
- fHistMassLambdaK->SetMarkerStyle(kFullCircle);
-
- fHistMassK0onl = new TH1F("fHistMassK0onl", "Invariant mass distribution K_{s}^{0} online V0 finder ", 400, 0.2, 1.0);
- fHistMassK0onl->GetXaxis()->SetTitle("Invariant mass #pi^{+}#pi^{-} (GeV/c^{2})");
- fHistMassK0onl->GetYaxis()->SetTitle("Entries");
- fHistMassK0onl->SetMarkerStyle(kFullCircle);
-
- fHistMassK0offl = new TH1F("fHistMassK0offl", "Invariant mass distribution  K_{s}^{0} offline V0 finder ", 400, 0.2, 1.0);
- fHistMassK0offl->GetXaxis()->SetTitle("Invariant mass  #pi^{+}#pi^{-} (GeV/c^{2})");
- fHistMassK0offl->GetYaxis()->SetTitle("Entries");
- fHistMassK0offl->SetMarkerStyle(kFullCircle);
- fHistMassK0onlC = new TH1F("fHistMassK0onlC", "Invariant mass distribution K_{s}^{0} online V0 finder ", 400, 0.2, 1.0);
- fHistMassK0onlC->GetXaxis()->SetTitle("Invariant mass #pi^{+}#pi^{-} (GeV/c^{2})");
- fHistMassK0onlC->GetYaxis()->SetTitle("Entries");
- fHistMassK0onlC->SetMarkerStyle(kFullCircle);
-
- fHistMassK0offlC = new TH1F("fHistMassK0offlC", "Invariant mass distribution  K_{s}^{0} offline V0 finder ", 400, 0.2, 1.0);
- fHistMassK0offlC->GetXaxis()->SetTitle("Invariant mass  #pi^{+}#pi^{-} (GeV/c^{2})");
- fHistMassK0offlC->GetYaxis()->SetTitle("Entries");
- fHistMassK0offlC->SetMarkerStyle(kFullCircle);
-
- fHistMassPQonl = new TH1F("fHistMassPQonl", "Invariant mass distribution K_{s}^{0}p using online V0 finder ", 500, 1.3, 2.3);
- fHistMassPQonl->GetXaxis()->SetTitle("Invariant mass K_{s}^{0}p (GeV/c^{2})");
- fHistMassPQonl->GetYaxis()->SetTitle("Entries");
- fHistMassPQonl->SetMarkerStyle(kFullCircle);
-
- fHistMassPQoffl = new TH1F("fHistMassPQoffl", "Invariant mass distribution  K_{s}^{0}p using offline V0 finder ", 500, 1.3, 2.3);
- fHistMassPQoffl->GetXaxis()->SetTitle("Invariant mass K_{s}^{0}p (GeV/c^{2})");
- fHistMassPQoffl->GetYaxis()->SetTitle("Entries");
- fHistMassPQoffl->SetMarkerStyle(kFullCircle);
-
- fHistDC = new TH1F("fHistDC", "Proper decay length", 500, 0.0, 25);
- fHistDC->GetXaxis()->SetTitle("c#tau (cm)");
- fHistDC->GetYaxis()->SetTitle("Entries");
- fHistDC->SetMarkerStyle(kFullCircle);
-  
- fHistArmenterosPodolanski = new TH2F("fHistArmenterosPodolanski", "Armenteros-Podolanski plot", 200,-1.0,1.0, 500,0,1);
- fHistArmenterosPodolanski->GetXaxis()->SetTitle("#alpha");
- fHistArmenterosPodolanski->GetYaxis()->SetTitle("q_{t}");
- fHistArmenterosPodolanski->SetMarkerStyle(kFullCircle);
-
- fHistArmenterosPodolanskiCut = new TH2F("fHistArmenterosPodolanskiCut", "Armenteros-Podolanski plot after cut", 200,-1.0,1.0, 500,0,1);
- fHistArmenterosPodolanskiCut->GetXaxis()->SetTitle("#alpha");
- fHistArmenterosPodolanskiCut->GetYaxis()->SetTitle("q_{t}");
- fHistArmenterosPodolanskiCut->SetMarkerStyle(kFullCircle);
-
- fHistHDibaryonInvaMassGen = new TH1F("fHistHDibaryonInvaMassGen", "Generated  #Lambda p #pi^{-}", 200, 2.1, 2.3);
- fHistHDibaryonInvaMassGen->GetYaxis()->SetTitle("Counts");
- fHistHDibaryonInvaMassGen->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");
-
- fHistHDibaryonInvaMassGenRes = new TH1F("fHistHDibaryonInvaMassGenRes", "Generated  #Lambda p #pi^{-} with particles in rapidity!!!", 200, 2.1, 2.3);
- fHistHDibaryonInvaMassGenRes->GetYaxis()->SetTitle("Counts");
- fHistHDibaryonInvaMassGenRes->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");
-
- fHistAntiHDibaryonInvaMassGen = new TH1F("fHistAntiHDibaryonInvaMassGen", "Generated  #bar{#Lambda} #bar{p} #pi^{+}", 200, 2.1, 2.3);
- fHistAntiHDibaryonInvaMassGen->GetYaxis()->SetTitle("Counts");
- fHistAntiHDibaryonInvaMassGen->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");
-
- fHistHDibaryonInvaMassAso = new TH1F("fHistHDibaryonInvaMassAso", "Associated  #Lambda p #pi^{-}", 200, 2.1, 2.3);
- fHistHDibaryonInvaMassAso->GetYaxis()->SetTitle("Counts");
- fHistHDibaryonInvaMassAso->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");
-
- fHistHDibaryonInvaMassAsoReso = new TH1F("fHistHDibaryonInvaMassAsoReso", "Associated  #Lambda p #pi^{-}", 200, 2.1, 2.3);
- fHistHDibaryonInvaMassAsoReso->GetYaxis()->SetTitle("Counts");
- fHistHDibaryonInvaMassAsoReso->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");
-
- fHistAntiHDibaryonInvaMassAso = new TH1F("fHistAntiHDibaryonInvaMassAso", "Associated  #bar{#Lambda} #bar{p} #pi^{+}", 200, 2.1, 2.3);
- fHistAntiHDibaryonInvaMassAso->GetYaxis()->SetTitle("Counts");
- fHistAntiHDibaryonInvaMassAso->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");
-
- fHistCheck = new TH2F("fHistCheck", "Check online/offline", 200, -0.5, 1.5, 200, -0.5, 1.5);
- fHistCheck->GetXaxis()->SetTitle("offline");
- fHistCheck->GetYaxis()->SetTitle("online");
- fHistCheck->SetMarkerStyle(kFullCircle);
-
- fHistHPointingAngle= new TH1F("fHistHPointingAngle", "Pointing angle distribution for #Lambdap#pi^{-}", 200, 0., 2*TMath::Pi());
- fHistHPointingAngle->GetXaxis()->SetTitle("Pointing angle distribution for #Lambdap#pi^{-}");
- fHistHPointingAngle->GetYaxis()->SetTitle("Entries");
- fHistHPointingAngle->SetMarkerStyle(kFullCircle);
-
- fHistMassH= new TH1F("fHistMassH", "Invariant mass distribution #Lambdap#pi^{-} (GeV/c^{2}) after pointing angle cut", 3000, 2.2, 2.5);
- fHistMassH->GetXaxis()->SetTitle("Invariant mass #Lambdap#pi^{-} (GeV/c^{2})");
- fHistMassH->GetYaxis()->SetTitle("Entries");
- fHistMassH->SetMarkerStyle(kFullCircle);
- fHistMassLambdaFromH= new TH1F("fHistMassLambdaFromH", "Invariant mass distribution #Lambda (GeV/c^{2}) asking for Mother to be H", 300, 1.0, 1.3);
- fHistMassLambdaFromH->GetXaxis()->SetTitle("Invariant mass #Lambda (GeV/c^{2})");
- fHistMassLambdaFromH->GetYaxis()->SetTitle("Entries");
- fHistMassLambdaFromH->SetMarkerStyle(kFullCircle);
-
- fHistMassLambdaFromHtLorentz= new TH1F("fHistMassLambdaFromHtLorentz", "Invariant mass distribution #Lambda (GeV/c^{2}) asking for Mother to be H", 300, 1.0, 1.3);
- fHistMassLambdaFromHtLorentz->GetXaxis()->SetTitle("Invariant mass #Lambda (GeV/c^{2})");
- fHistMassLambdaFromHtLorentz->GetYaxis()->SetTitle("Entries");
- fHistMassLambdaFromHtLorentz->SetMarkerStyle(kFullCircle);
- fHistMassPpi= new TH1F("fHistMassPpi", "Invariant mass distribution of the p#pi^{-} used for combing with Lambda", 300, 1.0, 1.6);
- fHistMassPpi->GetXaxis()->SetTitle("Invariant mass p#pi^{-} (GeV/c^{2})");
- fHistMassPpi->GetYaxis()->SetTitle("Entries");
- fHistMassPpi->SetMarkerStyle(kFullCircle);
-
- fHistMassPpiReso= new TH1F("fHistMassPpiReso", "Invariant mass distribution of the p#pi^{-} used for combing with Lambda", 300, 1.0, 1.6);
- fHistMassPpiReso->GetXaxis()->SetTitle("Invariant mass p#pi^{-} (GeV/c^{2})");
- fHistMassPpiReso->GetYaxis()->SetTitle("Entries");
- fHistMassPpiReso->SetMarkerStyle(kFullCircle);
-
- fHistMassLpi= new TH1F("fHistMassLpi", "Invariant mass distribution of the #Lambda#pi^{-} used for combing with p", 300, 1.1, 1.7);
- fHistMassLpi->GetXaxis()->SetTitle("Invariant mass #Lambda#pi^{-} (GeV/c^{2})");
- fHistMassLpi->GetYaxis()->SetTitle("Entries");
- fHistMassLpi->SetMarkerStyle(kFullCircle);
-
- fHistMassLP= new TH1F("fHistMassLP", "Invariant mass distribution of the #Lambda p used for combing with #pi^{-}", 300, 2.0, 2.3);
- fHistMassLP->GetXaxis()->SetTitle("Invariant mass #Lambda p (GeV/c^{2})");
- fHistMassLP->GetYaxis()->SetTitle("Entries");
- fHistMassLP->SetMarkerStyle(kFullCircle);
-
- fHistProtonPIDBb = new TH2F("fHistProtonPIDBb", "dE/dx after p PID", 100, 0., 10, 100, 0, 100);
- fHistProtonPIDBb->GetYaxis()->SetTitle("TPC Signal");
- fHistProtonPIDBb->GetXaxis()->SetTitle("P (GeV/c)");
- fHistProtonPIDBb->SetOption("scat");
- fHistProtonPIDBb->SetMarkerStyle(kFullCircle);
-
- fHistPionPIDBb = new TH2F("fHistPionPIDBb", "dE/dx after K PID", 100, 0., 10, 100, 0, 100);
- fHistPionPIDBb->GetYaxis()->SetTitle("TPC Signal");
- fHistPionPIDBb->GetXaxis()->SetTitle("P (GeV/c)");
- fHistPionPIDBb->SetOption("scat");
- fHistPionPIDBb->SetMarkerStyle(kFullCircle);
-
- fHistProtonPIDLambda = new TH2F("fHistProtonPIDLambda", "dE/dx after p PID from V0", 100, 0., 10, 100, 0, 100);
- fHistProtonPIDLambda->GetYaxis()->SetTitle("TPC Signal");
- fHistProtonPIDLambda->GetXaxis()->SetTitle("P (GeV/c)");
- fHistProtonPIDLambda->SetOption("scat");
- fHistProtonPIDLambda->SetMarkerStyle(kFullCircle);
-
- fHistPionPIDLambda = new TH2F("fHistPionPIDLambda", "dE/dx after #pi PID from V0", 100, 0, 10, 100, 0, 100);
- fHistPionPIDLambda->GetYaxis()->SetTitle("TPC Signal");
- fHistPionPIDLambda->GetXaxis()->SetTitle("P (GeV/c)");
- fHistPionPIDLambda->SetOption("scat");
- fHistPionPIDLambda->SetMarkerStyle(kFullCircle);
-
- fHistMCdcaPvtxDvtx= new TH1F("fHistMCdcaPvtxDvtx", "MC True DCA Primary Vertex - H Decay Vertex", 300, -0.1, 11.9);
- fHistMCdcaPvtxDvtx->GetXaxis()->SetTitle("dca prim. vtx- decay vtx (cm)");
- fHistMCdcaPvtxDvtx->GetYaxis()->SetTitle("Entries");
- fHistMCdcaPvtxDvtx->SetMarkerStyle(kFullCircle);
-
- fHistMCdcaPvtxLvtx= new TH1F("fHistMCdcaPvtxLvtx", "MC True DCA Primary Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);
- fHistMCdcaPvtxLvtx->GetXaxis()->SetTitle("dca prim. vtx-#Lambda decay vtx (cm)");
- fHistMCdcaPvtxLvtx->GetYaxis()->SetTitle("Entries");
- fHistMCdcaPvtxLvtx->SetMarkerStyle(kFullCircle);
-
- fHistMCdcaDvtxLvtx= new TH1F("fHistMCdcaDvtxLvtx", "MC True DCA H Decay Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);
- fHistMCdcaDvtxLvtx->GetXaxis()->SetTitle("dca H deacy vtx-#Lambda decay vtx (cm)");
- fHistMCdcaDvtxLvtx->GetYaxis()->SetTitle("Entries");
- fHistMCdcaDvtxLvtx->SetMarkerStyle(kFullCircle);
-
- fHistMCangleLH= new TH1F("fHistMCangleLH", "MC True Angle between #Lambda and H", 300, 0., 2*TMath::Pi());
- fHistMCangleLH->GetXaxis()->SetTitle("Angle (#Lambda-H)");
- fHistMCangleLH->GetYaxis()->SetTitle("Entries");
- fHistMCangleLH->SetMarkerStyle(kFullCircle);
-
- fHistMCdecayAngle= new TH1F("fHistMCdecayAngle", "MC True Angle between decay products", 300, 0., 2*TMath::Pi());
- fHistMCdecayAngle->GetXaxis()->SetTitle("Angle (#Lambda-p#pi)");
- fHistMCdecayAngle->GetYaxis()->SetTitle("Entries");
- fHistMCdecayAngle->SetMarkerStyle(kFullCircle);
-
- fHistMCpointingAngle= new TH1F("fHistMCpointingAngle", "MC True Pointing Angle", 3000, 0., 2*TMath::Pi());
- fHistMCpointingAngle->GetXaxis()->SetTitle("Pointing Angle");
- fHistMCpointingAngle->GetYaxis()->SetTitle("Entries");
- fHistMCpointingAngle->SetMarkerStyle(kFullCircle);
-
- fHistMCap = new TH2F("fHistMCap", "True MC Armenteros-Podolanski", 200,-1.0,1.0, 500,0,1);
- fHistMCap->GetYaxis()->SetTitle("#alpha");
- fHistMCap->GetXaxis()->SetTitle("q_{t}");
- fHistMCap->SetOption("scat");
- fHistMCap->SetMarkerStyle(kFullCircle);
-
- fHistMCdcaPvtxDvtxReso= new TH1F("fHistMCdcaPvtxDvtxReso", "MC True DCA Primary Vertex - H Decay Vertex", 300, -0.1, 11.9);
- fHistMCdcaPvtxDvtxReso->GetXaxis()->SetTitle("dca prim. vtx- decay vtx (cm)");
- fHistMCdcaPvtxDvtxReso->GetYaxis()->SetTitle("Entries");
- fHistMCdcaPvtxDvtxReso->SetMarkerStyle(kFullCircle);
-
- fHistMCdcaPvtxLvtxReso= new TH1F("fHistMCdcaPvtxLvtxReso", "MC True DCA Primary Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);
- fHistMCdcaPvtxLvtxReso->GetXaxis()->SetTitle("dca prim. vtx-#Lambda decay vtx (cm)");
- fHistMCdcaPvtxLvtxReso->GetYaxis()->SetTitle("Entries");
- fHistMCdcaPvtxLvtxReso->SetMarkerStyle(kFullCircle);
-
- fHistMCdcaDvtxLvtxReso= new TH1F("fHistMCdcaDvtxLvtxReso", "MC True DCA H Decay Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);
- fHistMCdcaDvtxLvtxReso->GetXaxis()->SetTitle("dca H deacy vtx-#Lambda decay vtx (cm)");
- fHistMCdcaDvtxLvtxReso->GetYaxis()->SetTitle("Entries");
- fHistMCdcaDvtxLvtxReso->SetMarkerStyle(kFullCircle);
-
- fHistMCangleLHReso= new TH1F("fHistMCangleLHReso", "MC True Angle between #Lambda and H", 300, 0., 2*TMath::Pi());
- fHistMCangleLHReso->GetXaxis()->SetTitle("Angle (#Lambda-H)");
- fHistMCangleLHReso->GetYaxis()->SetTitle("Entries");
- fHistMCangleLHReso->SetMarkerStyle(kFullCircle);
-
- fHistMCdecayAngleReso= new TH1F("fHistMCdecayAngleReso", "MC True Angle between decay products", 300, 0., 2*TMath::Pi());
- fHistMCdecayAngleReso->GetXaxis()->SetTitle("Angle (#Lambda-p#pi)");
- fHistMCdecayAngleReso->GetYaxis()->SetTitle("Entries");
- fHistMCdecayAngleReso->SetMarkerStyle(kFullCircle);
-
- fHistMCpointingAngleReso= new TH1F("fHistMCpointingAngleReso", "MC True Pointing Angle", 300, 0., 2*TMath::Pi());
- fHistMCpointingAngleReso->GetXaxis()->SetTitle("Pointing Angle");
- fHistMCpointingAngleReso->GetYaxis()->SetTitle("Entries");
- fHistMCpointingAngleReso->SetMarkerStyle(kFullCircle);
-
- fHistMCapReso = new TH2F("fHistMCapReso", "True MC Armenteros-Podolanski", 200,-1.0,1.0, 500,0,1);
- fHistMCapReso->GetYaxis()->SetTitle("#alpha");
- fHistMCapReso->GetXaxis()->SetTitle("q_{t}");
- fHistMCapReso->SetOption("scat");
- fHistMCapReso->SetMarkerStyle(kFullCircle);
-
- fHistCentrality = new TH1F("Centrality ", "Centrality", 11, -0.5, 10.5);
- fHistCentrality ->GetXaxis()->SetTitle("Centrality");
- fHistCentrality ->GetYaxis()->SetTitle("Entries");
-
- fHistCentralityAC = new TH1F("CentralityAC ", "CentralityAC", 11, -0.5, 10.5);
- fHistCentralityAC ->GetXaxis()->SetTitle("Centrality");
- fHistCentralityAC ->GetYaxis()->SetTitle("Entries");
-
- fHistMultiplicity = new TH1F("Multiplicity ", "Multiplicity", 100, 0, 20000);
- fHistMultiplicity ->GetXaxis()->SetTitle("Centrality");
- fHistMultiplicity ->GetYaxis()->SetTitle("Entries");
-
- fHistList->Add(fHistMassDPi);
- fHistList->Add(fHistMassLPi);
- fHistList->Add(fHistMassLambdaPi);
- fHistList->Add(fHistMassLambda);
- fHistList->Add(fHistMassLambdaPPi);
- fHistList->Add(fHistMassLambdaP);
- fHistList->Add(fHistMassLambdaK);
- fHistList->Add(fHistMassK0onl);
- fHistList->Add(fHistMassK0offl);
- fHistList->Add(fHistMassK0onlC);
- fHistList->Add(fHistMassK0offlC);
- fHistList->Add(fHistMassPQonl); 
- fHistList->Add(fHistMassPQoffl);
- fHistList->Add(fHistDC); 
- fHistList->Add(fHistArmenterosPodolanski);
- fHistList->Add(fHistArmenterosPodolanskiCut);
- fHistList->Add(fHistHDibaryonInvaMassGen);
- fHistList->Add(fHistHDibaryonInvaMassGenRes);
- fHistList->Add(fHistAntiHDibaryonInvaMassGen);
- fHistList->Add(fHistHDibaryonInvaMassAso);
- fHistList->Add(fHistHDibaryonInvaMassAsoReso);
- fHistList->Add(fHistAntiHDibaryonInvaMassAso);
- fHistList->Add(fHistCheck);
- fHistList->Add(fHistHPointingAngle);
- fHistList->Add(fHistMassH);
- fHistList->Add(fHistMassPpi);
- fHistList->Add(fHistMassPpiReso);
- fHistList->Add(fHistMassLpi);
- fHistList->Add(fHistMassLP);
- fHistList->Add(fHistMassLambdaFromH);
- fHistList->Add(fHistMassLambdaFromHtLorentz);
- fHistList->Add(fHistProtonPIDBb);
- fHistList->Add(fHistPionPIDBb);
- fHistList->Add(fHistProtonPIDLambda);
- fHistList->Add(fHistPionPIDLambda);
- fHistList->Add(fHistMCdcaPvtxDvtx);
- fHistList->Add(fHistMCdcaPvtxLvtx);
- fHistList->Add(fHistMCdcaDvtxLvtx);
- fHistList->Add(fHistMCangleLH);
- fHistList->Add(fHistMCdecayAngle);
- fHistList->Add(fHistMCpointingAngle);
- fHistList->Add(fHistMCap);
- fHistList->Add(fHistMCdcaPvtxDvtxReso);
- fHistList->Add(fHistMCdcaPvtxLvtxReso);
- fHistList->Add(fHistMCdcaDvtxLvtxReso);
- fHistList->Add(fHistMCangleLHReso);
- fHistList->Add(fHistMCdecayAngleReso);
- fHistList->Add(fHistMCpointingAngleReso);
- fHistList->Add(fHistMCapReso);
- fHistList->Add(fHistCentrality);
- fHistList->Add(fHistCentralityAC);
- fHistList->Add(fHistMultiplicity);
- fHistHilf1= new TH1F("fHistHilf1", "HD", 300, 0., 10);
- fHistHilf1->GetXaxis()->SetTitle("");
- fHistHilf1->GetYaxis()->SetTitle("Entries");
-
- fHistHilf2= new TH1F("fHistHilf2", "HD", 300, 0., 10);
- fHistHilf2->GetXaxis()->SetTitle("");
- fHistHilf2->GetYaxis()->SetTitle("Entries");
-
- fHistHilf3= new TH1F("fHistHilf3", "HD", 300, 0., 10);
- fHistHilf3->GetXaxis()->SetTitle("");
- fHistHilf3->GetYaxis()->SetTitle("Entries");
-
- fHistHilf4= new TH1F("fHistHilf4", "HD", 300, 0., 10);
- fHistHilf4->GetXaxis()->SetTitle("");
- fHistHilf4->GetYaxis()->SetTitle("Entries");
-
- fHistHilf5= new TH1F("fHistHilf5", "HD", 300, 0., 10);
- fHistHilf5->GetXaxis()->SetTitle("");
- fHistHilf5->GetYaxis()->SetTitle("Entries");
-
- fHistHilf6= new TH1F("fHistHilf6", "HD", 300, 0., 10);
- fHistHilf6->GetXaxis()->SetTitle("");
- fHistHilf6->GetYaxis()->SetTitle("Entries");
- fHistPtvsEtaGen = new TH2F("fHistPtvsEtaGen", "p_{t} vs #eta from generated H", 200,0.0,10.0, 200,-1,1);
- fHistPtvsEtaGen->GetXaxis()->SetTitle("p_{t} (GeV/c)");
- fHistPtvsEtaGen->GetYaxis()->SetTitle("#eta");
- fHistPtvsEtaGen->SetOption("scat");
- fHistPtvsEtaGen->SetMarkerStyle(kFullCircle);
-
- fHistPtvsEtaAso = new TH2F("fHistPtvsEtaAso", "p_{t} vs #eta from associated H", 200,0.0,10.0, 200,-1,1);
- fHistPtvsEtaAso->GetYaxis()->SetTitle("p_{t} (GeV/c)");
- fHistPtvsEtaAso->GetXaxis()->SetTitle("#eta");
- fHistPtvsEtaAso->SetOption("scat");
- fHistPtvsEtaAso->SetMarkerStyle(kFullCircle);
-
- fHistPtvsYGen = new TH2F("fHistPtvsYGen", "p_{t} vs rapidity from generated H", 200,0.0,10.0, 200,-1,1);
- fHistPtvsYGen->GetXaxis()->SetTitle("p_{t} (GeV/c)");
- fHistPtvsYGen->GetYaxis()->SetTitle("y");
- fHistPtvsYGen->SetOption("scat");
- fHistPtvsYGen->SetMarkerStyle(kFullCircle);
-
- fHistPtvsYAso = new TH2F("fHistPtvsYAso", "p_{t} vs rapidity from associated H", 200,0.0,10.0, 200,-1,1);
- fHistPtvsYAso->GetXaxis()->SetTitle("p_{t} (GeV/c)");
- fHistPtvsYAso->GetYaxis()->SetTitle("y");
- fHistPtvsYAso->SetOption("scat");
- fHistPtvsYAso->SetMarkerStyle(kFullCircle);
-
- fHistRap= new TH1F("fHistRap", "Rapidity", 400, -2., 2);
- fHistRap->GetXaxis()->SetTitle("Y");
- fHistRap->GetYaxis()->SetTitle("Entries");
- fHistPtvsEtaAso->SetMarkerStyle(kFullCircle);
-
- fHistList->Add(fHistHilf1);
- fHistList->Add(fHistHilf2); 
- fHistList->Add(fHistHilf3);
- fHistList->Add(fHistHilf4);
- fHistList->Add(fHistHilf5); 
- fHistList->Add(fHistHilf6);
- fHistList->Add(fHistPtvsEtaGen);
- fHistList->Add(fHistPtvsEtaAso);
- fHistList->Add(fHistPtvsYGen);
- fHistList->Add(fHistPtvsYAso);
- fHistList->Add(fHistRap);
-
- fHistCount = new TH1F("fHistCount","test",17,0,17);
- fHistCount->GetXaxis()->SetBinLabel(1,"Events");
- fHistCount->GetXaxis()->SetBinLabel(2,"MC All");
- fHistCount->GetXaxis()->SetBinLabel(3,"MC from Primary Vtx");
- fHistCount->GetXaxis()->SetBinLabel(4,"Horst");
- fHistCount->GetXaxis()->SetBinLabel(5,"Lambda Candidates");
- fHistCount->GetXaxis()->SetBinLabel(6,"Sigma Candidates");
- fHistCount->GetXaxis()->SetBinLabel(7,"Horst");
- fHistCount->GetXaxis()->SetBinLabel(8,"Horst");
- fHistCount->GetXaxis()->SetBinLabel(9,"Horst");
- fHistCount->GetXaxis()->SetBinLabel(10,"MC All #bar{Lambda}(1520)s");
- fHistCount->GetXaxis()->SetBinLabel(11,"");
- fHistCount->GetXaxis()->SetBinLabel(12,"H-Dibaryon");
- fHistCount->GetXaxis()->SetBinLabel(13,"Hypertriton 2-Body");
- fHistCount->GetXaxis()->SetBinLabel(14,"Hypertriton 3-Body");
- fHistCount->GetXaxis()->SetBinLabel(15,"");
- fHistCount->GetXaxis()->SetBinLabel(16,"");
- fHistCount->GetXaxis()->SetBinLabel(17,"Lambdas!!!");
- fHistCount->SetStats(0);
- fHistCount->SetFillColor(38);
- fHistList->Add(fHistCount);
-
- //trigger statistics histogram
-  fHistTriggerStat = new TH1F("fHistTriggerStat","Trigger statistics", 4,-0.5, 3.5);
-  const Char_t* aTriggerNames[] = { "kMB", "kCentral", "kSemiCentral" };
-  for ( Int_t ii=0; ii < 3; ii++ )
-    fHistTriggerStat->GetXaxis()->SetBinLabel(ii+1, aTriggerNames[ii]);
-
-  fHistTriggerStatAfterEventSelection = new TH1F("fHistTriggerStatAfterEventSelection","Trigger statistics after event selection", 4,-0.5, 3.5);
-  for ( Int_t ii=0; ii < 3; ii++ )
-    fHistTriggerStatAfterEventSelection->GetXaxis()->SetBinLabel(ii+1, aTriggerNames[ii]);
-  fHistList->Add(fHistTriggerStat);
-  fHistList->Add(fHistTriggerStatAfterEventSelection);
-
-  fHistMassHcentMult =  new TH3F("fHistMassHcentMult", "Inv. Mass vs. centrality vs. multiplicity", 100, 2.2, 2.3, 5, 0, 4, 300, 0, 6000);
-  fHistMassHcentMult->GetXaxis()->SetTitle("Invariant mass #Lambdap#pi^{-} (GeV/c^{2})"); // inv. mass
-  fHistMassHcentMult->GetYaxis()->SetTitle("Centrality"); // triggertype
-  fHistMassHcentMult->GetZaxis()->SetTitle("Multiplicity"); // refTPC
-  fHistList->Add(fHistMassHcentMult);
-
-  
-  const Double_t kz = 2*TMath::Pi();
-  Int_t binsD01[16]={  300, 200, 100, 100, 100, 100, 100, 100, 200, 200, 200, 200, 400, 200, 200, 3};
-  Double_t xminD01[16]={2.0, 1.0, 0., -1, 0., 0., 0., 0., 0., 0., 0., 0., -1, 0.,  0., 0};
-  Double_t xmaxD01[16]={2.3, 1.2, kz, 1, 1, 10, 10, 5, 5, 5, 5, 100, 1, 100,  4000, 1};
-  
-
-  fHistNdim = new THnSparseF("fHistNdim","THnS;InvMass, InvMassLambda, pointingAngle, armPoAlpha, armPoQt, pTL, pTH, d0p, d0n, dcaHd, dca, decayL, cosPA, centr, multi, mcinf;InvMassH", 16,binsD01,xminD01,xmaxD01);
-  fHistList->Add(fHistNdim);
-}
-
- //________________________________________________________________________
-void AliAnalysisTaskHdibaryonLPpi::UserExec(Option_t *) 
-{ 
-  // Main loop
-  // Called for each event
-
-  //define improtant masses
-  Double_t pionMass     = 0.13957;
-  Double_t protonMass   = 0.93827;
-
-  //define PDGCodes
-  Long_t pdgPionPlus          =         211;
-  Long_t pdgPionMinus         =        -211;
-  Long_t pdgProton            =        2212;
-  Long_t pdgAntiProton        =       -2212;
-  Long_t pdgLambda            =        3122;
-  Long_t pdgAntiLambda        =       -3122;
-  Long_t pdgHDibaryon         =  1020000020;
-  Long_t pdgAntiHDibaryon     = -1020000020;
-
-  AliStack* stack(NULL);
-  if(HasMC()){
-
-    if(!fMCEvent)return;
-
-    AliHeader *head = fMCEvent->Header();
-    if(!head)return;
-    AliGenPythiaEventHeader *pyheader = (AliGenPythiaEventHeader*)head->GenEventHeader();
-    if(!pyheader)return;
-    
-    if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()){
-      if(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()){
-       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->TreeK()))return;
-       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->TreeTR()))return;
-       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->Init("local")))return;
-       stack = static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()->Stack();
-       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()->Stack()->TreeK()))return;
-      }
-    }
-       
-    if(!stack)return;
-  }
-
-  // -------------------------------------------------------
-  // Loop for Inv. Mass via ESD tracks
-  // -------------------------------------------------------
-
-  fHistCount->Fill(0);
-  
-  fESD = dynamic_cast<AliESDEvent *>(fInputEvent);
-
-  const AliESDVertex *vertex = fESD->GetPrimaryVertexTracks();
-  if (vertex->GetNContributors()<1) 
-    {
-      // SPD vertex
-      vertex = fESD->GetPrimaryVertexSPD();
-       if(vertex->GetNContributors()<1) {
-        return;
-       }  
-    }
-  if (TMath::Abs(vertex->GetZv()) > 10) return;
-  
-  Int_t centrality = -5;
-  Double_t centrPerc = -5;
-
-  if (fESD->GetEventSpecie() == 4) 
-    { // PbPb
-      AliCentrality *esdCentrality = fESD->GetCentrality();
-      centrality = esdCentrality->GetCentralityClass10("V0M"); // centrality percentile determined with V0
-      centrPerc = esdCentrality->GetCentralityPercentile("V0M");
-      if (centrality < 0. || centrality > 8.) return; //0 bis 80 %
-      //  cout<<"Centrality: "<< centrality << endl;
-    }
-
-  fHistCentrality->Fill(centrality);   
-
-  //*****************//  
-  //*   Centrality  *//
-  //*****************//
-  //  Float_t percentile=centrality->GetCentralityPercentile("V0M");
-
-  Bool_t isSelectedCentral = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kCentral);
-  Bool_t isSelectedSemiCentral = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kSemiCentral);
-  Bool_t isSelectedMB = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
-  Int_t triggertype = 17;
-
-  if(isSelectedCentral){
-    fHistTriggerStat->Fill(1);
-    triggertype=1;
-  }
-
-  if(isSelectedSemiCentral){
-    fHistTriggerStat->Fill(2);
-    triggertype=2;
-  }
-
-  if(isSelectedMB){
-    fHistTriggerStat->Fill(0);
-    triggertype=3;
-  }
-
-  //  if(isSelectedCentral || isSelectedSemiCentral || isSelectedMB){
-
-  //*******************************
-
-  Int_t runNumber = 0;
-  //  itrk = 0;
-  runNumber = fESD->GetRunNumber();
-  
-  if (!fPIDtpcESD) fPIDtpcESD = ((AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetESDpid();
-  if (!fPIDtpcESD) {
-    fPIDtpcESD = new AliESDpid(); // HACK FOR MC PBPB --> PLEASE REMOVE AS SOON AS POSSIBLE
-    fPIDtpcESD->GetTPCResponse().SetBetheBlochParameters(1.28778e+00/50., 3.13539e+01, TMath::Exp(-3.16327e+01), 1.87901e+00, 6.41583e+00);
-  }
-
-  Double_t pionK=1;
-  Double_t pK=1;
-  TObjArray* listCrossV0   = fESDCutsV0->GetAcceptedV0s(fESD);  
-  Int_t nGoodV0s      = listCrossV0->GetEntries();
-
-  const AliESDVertex *esdVer = fESD->GetPrimaryVertex();
-  AliESDVertex *esdVer1 = new AliESDVertex(*esdVer);
-   
-  AliVertexerTracks *vertexer = new AliVertexerTracks(fESD->GetMagneticField());
-  TObjArray *trkArray = new TObjArray(2);
-  AliVertexerTracks *vertexer1 = new AliVertexerTracks(fESD->GetMagneticField());
-  TObjArray *trkArray1 = new TObjArray(2);
-
-  AliKFParticle::SetField(fESD->GetMagneticField());
-       
-  AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));
-
-  Int_t refMultTpc = AliESDtrackCuts::GetReferenceMultiplicity(fESD, kTRUE);
-  //cout<<"Multiplicity: "<< refMultTpc << endl;
-  fHistMultiplicity->Fill(refMultTpc);
-  
-  Double_t mn[3] = {0,0,0};
-  Double_t mp[3] = {0,0,0}; 
-  Double_t mm[3] = {0,0,0};
-  Double_t dd[3] = {0,0,0};
-  Double_t dd1[3] = {0,0,0};
-  const Double_t cProtonMass=TDatabasePDG::Instance()->GetParticle(2212)->Mass();
-  const Double_t cPionMass=TDatabasePDG::Instance()->GetParticle(211)->Mass();
-  const Double_t cElectronMass=TDatabasePDG::Instance()->GetParticle(11)->Mass();
-  const Double_t cLambdaMass=TDatabasePDG::Instance()->GetParticle(3122)->Mass();
-  Double_t decayLength=0;
-  Double_t decayLengthH=0;
-
-  //V0 Loop for Lambda and Anti-Lambda
-  for(Int_t iV0MI = 0; iV0MI < nGoodV0s ; iV0MI++) {
-    AliESDv0 * fV0MIs = fESD->GetV0(iV0MI);
-    Int_t    lOnFlyStatus = 0;
-
-    lOnFlyStatus = fV0MIs->GetOnFlyStatus();
-    Double_t lInvMassLambda=0;
-    Double_t lInvMassLambdaPi=0;
-    Double_t lPtLambda=0;
-    Double_t lPzLambda=0;
-    Double_t lPLambda=0;
-    Int_t onl=0;
-    Int_t offl=0;
-
-    TLorentzVector posE;
-    TLorentzVector negE;
-    TLorentzVector photon;
-
-    if (lOnFlyStatus){
-      onl=1; 
-      //      return;
-    }
-    if (!lOnFlyStatus){
-      offl=1;
-      //return;
-    }
-
-    //    fHistMultiplicity->Fill(refMultTpc); 
-    fHistCentralityAC->Fill(centrality);
-    fHistCheck->Fill(offl,onl);
-
-    AliESDtrack* trackPosTest = fESD->GetTrack(fV0MIs->GetPindex());
-    AliESDtrack* trackNegTest = fESD->GetTrack(fV0MIs->GetNindex());
-
-    //    if (!
-    if (!fEsdTrackCuts->AcceptTrack(trackPosTest)) continue;
-    if (!fESDtrackCutsV0->AcceptTrack(trackNegTest)) continue;
-
-
-      //PID via specific energy loss in the TPC
-      //define the arrays for the Bethe-Bloch-Parameters
-      Double_t parProton[5]   = {0,0,0,0,0};
-
-      if(runNumber < 166500) //LHC10h
-       {
-         parProton[0]   = 1.45802; // ALEPH parameters for protons (pass2)
-         parProton[1]   = 27.4992;
-         parProton[2]   = 4.00313e-15;
-         parProton[3]   = 2.48485;
-         parProton[4]   = 8.31768; 
-       }
-      
-      if(runNumber > 166500) //LHC11h
-       { 
-         parProton[0]   = 1.11243; // ALEPH parameters for protons (pass2)
-         parProton[1]   = 26.1144;
-         parProton[2]   = 4.00313e-15;
-         parProton[3]   = 2.72969;
-         parProton[4]   = 9.15038; 
-       }
-      //Get the total momentum for each track at the inner readout of the TPC
-      Double_t ptotN = trackNegTest->GetInnerParam()->GetP();
-      Double_t ptotP = trackPosTest->GetInnerParam()->GetP();
-
-      //define expected signals for the various species
-      Double_t expSignalPionP = 0;
-      Double_t expSignalPionN = 0;
-      Double_t expSignalProtonN = 0;
-      Double_t expSignalProtonP = 0;
-
-      //for data
-      if(!HasMC())
-       {
-         expSignalProtonN = AliExternalTrackParam::BetheBlochAleph(ptotN/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);
-         expSignalProtonP = AliExternalTrackParam::BetheBlochAleph(ptotP/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);
-       }
-    
-      //for MC
-      if(HasMC())
-       {
-         expSignalPionP = 0.7*AliExternalTrackParam::BetheBlochAleph(ptotP/(pionMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]); 
-         expSignalPionN = 0.7*AliExternalTrackParam::BetheBlochAleph(ptotN/(pionMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]); 
-
-         expSignalProtonN = 0.65*AliExternalTrackParam::BetheBlochAleph(ptotN/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);
-         expSignalProtonP = 0.65*AliExternalTrackParam::BetheBlochAleph(ptotP/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);   
-       }
-
-      // PID cut on the nuclei (proton, deuteron, triton, helium3)
-      Bool_t corrParticle = kFALSE;
-
-      Bool_t posProton = kFALSE;
-      //data
-      if(!HasMC())
-       {
-         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackPosTest, AliPID::kProton)) < 3)
-           {
-             posProton = kTRUE;
-             corrParticle = kTRUE;
-           }
-       }
-      //MC
-      if(HasMC())
-       {
-         if(//trackPosTest->GetTPCsignal() < 1200 && 
-            TMath::Abs(trackPosTest->GetTPCsignal() - expSignalProtonP)/expSignalProtonP < 0.4)
-           {
-             posProton = kTRUE;
-             corrParticle = kTRUE;
-           }
-       }
-
-      Bool_t negProton = kFALSE;
-      //data
-      if(!HasMC())
-       {
-         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackNegTest, AliPID::kProton)) < 3)
-           {
-             negProton = kTRUE;
-             corrParticle = kTRUE;
-           }
-       }
-     //MC
-      if(HasMC())
-       {
-         if(//trackNegTest->GetTPCsignal() < 1200 && 
-            TMath::Abs(trackNegTest->GetTPCsignal() - expSignalProtonN)/expSignalProtonN < 0.4)
-           {
-             negProton = kTRUE;
-             corrParticle = kTRUE;
-           }
-       }
-
-     //PID cut for pions
-      //data: 3sigma cut on the pions
-
-      Bool_t negPion = kFALSE;     
-      Bool_t posPion = kFALSE;
-
-      if (!HasMC())
-       {
-         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackPosTest, AliPID::kPion)) < 4) posPion=kTRUE; //pos daughter has to be a pion
-         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackNegTest, AliPID::kPion)) < 4) negPion=kTRUE; // negative daughter has to be a pion
-       }
-      
-      //MC: like the nuclei via the specific energyloss in the TPC
-      if (HasMC())
-       {
-         if (TMath::Abs(trackPosTest->GetTPCsignal() - expSignalPionP)/expSignalPionP < 0.4) posPion=kTRUE;
-         if (TMath::Abs(trackNegTest->GetTPCsignal() - expSignalPionN)/expSignalPionN < 0.4) negPion=kTRUE;
-       }
-
-      if (!(posProton==kTRUE)) continue;
-      if (!(negPion==kTRUE)) continue;
-
-    //To avoid ghosts
-
-    if( !(trackPosTest->GetStatus() & AliESDtrack::kTPCrefit)){
-      continue;
-    }
-
-    if( !(trackNegTest->GetStatus() & AliESDtrack::kTPCrefit)){
-      continue;
-    }
-
-    if( trackPosTest->GetSign() >0 && trackNegTest->GetSign() <0){
-      fV0MIs->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
-      fV0MIs->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter 
-    }
-
-    if( trackPosTest->GetSign() <0 && trackNegTest->GetSign() >0){
-      fV0MIs->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
-      fV0MIs->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
-    }
-
-    fV0MIs->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother
-
-    TVector3 vecN(mn[0],mn[1],mn[2]);
-    TVector3 vecP(mp[0],mp[1],mp[2]);
-    TVector3 vecM(mm[0],mm[1],mm[2]);
-    
-    Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));
-    Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));
-    
-    Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/
-      ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;
-    Double_t qt = vecP.Mag()*sin(thetaP);
-
-    fHistArmenterosPodolanski->Fill(alfa,qt);    //Armenteros-Podolanski calculation
-
-    TLorentzVector k0;
-    TLorentzVector k0daugh1;
-    TLorentzVector k0daugh2;
-    TLorentzVector proton;
-    TLorentzVector pq;
-
-    k0daugh1.SetXYZM(mn[0],mn[1],mn[2],cPionMass);
-    k0daugh2.SetXYZM(mp[0],mp[1],mp[2],cPionMass);
-    k0=k0daugh1+k0daugh2;
-
-    fV0MIs->ChangeMassHypothesis(3122);
-    lInvMassLambda = fV0MIs->GetEffMass();
-    lPtLambda = fV0MIs->Pt();
-    lPzLambda = fV0MIs->Pz();
-    lPLambda = fV0MIs->P();
-
-    trkArray->AddAt(trackPosTest,0);
-    trkArray->AddAt(trackNegTest,1);
-
-    vertexer->SetVtxStart(esdVer1);
-    AliESDVertex *decayVertex = (AliESDVertex*)vertexer->VertexForSelectedESDTracks(trkArray);
-
-    dd[0]=fESD->GetPrimaryVertexSPD()->GetX()-decayVertex->GetX();
-    dd[1]=fESD->GetPrimaryVertexSPD()->GetY()-decayVertex->GetY();
-    dd[2]=fESD->GetPrimaryVertexSPD()->GetZ()-decayVertex->GetZ();
-    
-    decayLength=sqrt(dd[0]*dd[0]+dd[1]*dd[1]+dd[2]*dd[2]);
-
-    if (decayVertex) delete decayVertex;
-
-    TLorentzVector negPio1;
-    TLorentzVector posProt1;        
-    TLorentzVector posP;
-    TLorentzVector posProt;
-    TLorentzVector negK;
-    TLorentzVector negPio;
-    TLorentzVector negPi;
-    TLorentzVector omega;
-    TLorentzVector threeSum;
-    TLorentzVector fourSum;
-    TLorentzVector ppK;
-    TLorentzVector posPiK;
-    TLorentzVector negPiK;
-    TLorentzVector kaon;
-    TLorentzVector lambda;
-    TLorentzVector lambdaH;
-    TLorentzVector hDibaryon;
-    TVector3 h;
-    TVector3 h1;
-
-    Int_t mcStatus=0;
-
-    h.SetXYZ(-dd[0],-dd[1],-dd[2]);
-
-    if (onl==1)fHistMassDPi->Fill(lInvMassLambda);
-
-    if (offl==1||onl==1){
-      fHistMassLPi->Fill(lInvMassLambda);
-      
-      negE.SetXYZM(mn[0],mn[1],mn[2],cElectronMass);
-      posE.SetXYZM(mp[0],mp[1],mp[2],cElectronMass);
-      photon=posE+negE;
-      
-      negPiK.SetXYZM(mn[0],mn[1],mn[2],cPionMass);
-      posPiK.SetXYZM(mp[0],mp[1],mp[2],cPionMass);
-      kaon=posPiK+negPiK;
-      
-      negPi.SetXYZM(mn[0],mn[1],mn[2],cPionMass);
-      posP.SetXYZM(mp[0],mp[1],mp[2],cProtonMass);
-      lambda=negPi+posP;
-      lambdaH.SetXYZM(mm[0],mm[1],mm[2],cLambdaMass);
-
-      if (lInvMassLambda>1.1113&&lInvMassLambda<1.1202){
-       
-       if (!HasMC()){
-         if (qt<-2.21*alfa*alfa+2.945*alfa-0.887) continue;
-         if (qt>-2.21*alfa*alfa+2.945*alfa-0.873) continue;
-         if (photon.M()<0.005) continue;
-         if (kaon.M()>0.495 && kaon.M()<0.500 ) continue;
-       }
-       
-
-       fHistMassLambda->Fill(lInvMassLambda);
-       //
-       Bool_t isCorrectlyAssociatedLambda = kFALSE;
-       Bool_t isPartialCorrectlyAssociatedLambda = kFALSE;
-       Int_t labelAssociatedH=-1; 
-       Int_t labelLambda=-1;
-       //
-       if (HasMC()) {
-         Int_t labelPosTest = trackPosTest->GetLabel();
-         TParticle *tparticleDaughter = stack->Particle(TMath::Abs(labelPosTest));
-         Int_t labelMother = tparticleDaughter->GetFirstMother();
-         TParticle *tparticleMother = stack->Particle(TMath::Abs(labelMother));
-         
-         Int_t labelOma = tparticleMother->GetFirstMother();
-         TParticle *tparticleOma = stack->Particle(TMath::Abs(labelOma));
-
-         if ((tparticleOma->GetPdgCode() < 0) && TMath::Abs(tparticleMother->GetPdgCode())==pdgLambda){// check mother to be Lambda 
-           Int_t labelFirstDaughter  = tparticleMother->GetDaughter(1);// Proton
-           Int_t labelThirdDaughter  = tparticleMother->GetDaughter(0);// Pion
-           
-           TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));
-           TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));
-           
-           if((tparticleFirstDaughter->GetPdgCode() == pdgProton && tparticleThirdDaughter->GetPdgCode()== pdgPionMinus) || 
-              (tparticleFirstDaughter->GetPdgCode() == pdgPionMinus && tparticleThirdDaughter->GetPdgCode()== pdgProton)){ //daughter PDGs
-             isPartialCorrectlyAssociatedLambda = kTRUE;
-             labelLambda=labelMother;
-           }
-         }
-         
-         //H-Dibaryon
-         if(tparticleOma->GetPdgCode() == pdgHDibaryon){ //check grandmother to be H PDG
-           if (TMath::Abs(tparticleMother->GetPdgCode())==pdgLambda){// check mother to be Lambda 
-             Int_t labelFirstDaughter  = tparticleMother->GetDaughter(1);// Proton
-             Int_t labelThirdDaughter  = tparticleMother->GetDaughter(0);// Pion
-                       
-             TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));
-             TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));
-             
-             if((tparticleFirstDaughter->GetPdgCode() == pdgProton && tparticleThirdDaughter->GetPdgCode()== pdgPionMinus) || 
-                (tparticleFirstDaughter->GetPdgCode() == pdgPionMinus && tparticleThirdDaughter->GetPdgCode()== pdgProton)){ //daughter PDGs
-               isCorrectlyAssociatedLambda = kTRUE;
-               labelAssociatedH=labelOma;
-               fHistMassLambdaFromH->Fill(lInvMassLambda);
-               fHistMassLambdaFromHtLorentz->Fill(lambda.M());
-             }
-           }
-         }
-       }
-
-       fHistProtonPIDLambda->Fill(trackPosTest->GetInnerParam()->GetP(), trackPosTest->GetTPCsignal());
-       fHistPionPIDLambda->Fill(trackNegTest->GetInnerParam()->GetP(), trackNegTest->GetTPCsignal());
-
-       //---------------------------------------------------------
-       // Proton track loop
-       //---------------------------------------------------------
-       fHistArmenterosPodolanskiCut->Fill(alfa,qt);
-
-       for (Int_t iTracksP = 0; iTracksP < fESD->GetNumberOfTracks(); iTracksP++) {
-         AliESDtrack* trackP = dynamic_cast<AliESDtrack*> (fESD->GetTrack(iTracksP));
-         if (trackP->GetSign()<0) continue;
-         
-         if (iTracksP==fV0MIs->GetPindex())continue;
-         if (iTracksP==fV0MIs->GetNindex())continue;
-               
-         if (!fEsdTrackCuts->AcceptTrack(trackP)) continue;
-               
-         AliKFParticle protonKF( *(trackP), 2212);
-
-         if (!trackP->GetInnerParam()) continue;
-         
-         if (HasMC()) {
-           pK=0.65;
+  fESDCutsV0->SetMinDcaNegToVertex(2);\r //1.5
+    fESDCutsV0->SetMinDcaPosToVertex(2); //1.5
+\r
+  //ESD Track cuts\r
+  fEsdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");    \r
+  fEsdTrackCuts->SetMinNClustersTPC(80);\r
+  fEsdTrackCuts->SetAcceptKinkDaughters(kFALSE);\r
+  fEsdTrackCuts->SetMaxChi2PerClusterTPC(5);\r
+  fEsdTrackCuts->SetRequireTPCRefit(kTRUE);\r
+  fEsdTrackCuts->SetEtaRange(-0.9,0.9);\r
+}\r
+\r
+//____________________________________________________________\r
+AliAnalysisTaskHdibaryonLPpi::~AliAnalysisTaskHdibaryonLPpi(){\r
+  //\r
+  // Destructor\r
+  //\r
+  if(fHistList){ \r
+    fHistList->Clear();\r
+    delete fHistList;\r
+  }\r
+  if(fEsdTrackCuts) delete fEsdTrackCuts;\r
+  if(fESDtrackCutsV0) delete fESDtrackCutsV0;\r
+  if(fESDCutsV0) delete fESDCutsV0;\r
+\r
+}\r
+\r
+//________________________________________________________________________\r
+void AliAnalysisTaskHdibaryonLPpi::UserCreateOutputObjects()\r
+{\r
+  // Create histograms\r
+  // Called once\r
+\r
+ fHistList = new TList();\r
+ fHistList->SetOwner();\r
+\r
+ fHistMassDPi = new TH1F("fHistMassDPi", "Invariant mass distribution p+#pi^{-} ", 500, 1.0, 1.25);\r
+ fHistMassDPi->GetXaxis()->SetTitle("Invariant mass p+#pi^{-} (GeV/c^{2})");\r
+ fHistMassDPi->GetYaxis()->SetTitle("Entries");\r
+ fHistMassDPi->SetMarkerStyle(kFullCircle); \r
+\r
+ fHistMassLPi = new TH1F("fHistMassLPi", "Offline Invariant mass distribution p+#pi^{-} ", 500, 1.0, 1.25);\r
+ fHistMassLPi->GetXaxis()->SetTitle("Invariant mass p+#pi^{-} (GeV/c^{2})");\r
+ fHistMassLPi->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLPi->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassLambdaPi = new TH1F("fHistMassLambdaPi", "Invariant mass distribution #Lambda+#pi^{-} ", 500, 1.2, 1.5);\r
+ fHistMassLambdaPi->GetXaxis()->SetTitle("Invariant mass #Lambda+#pi^{-} (GeV/c^{2})");\r
+ fHistMassLambdaPi->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambdaPi->SetMarkerStyle(kFullCircle);\r
\r
+ fHistMassLambda = new TH1F("fHistMassLambda", "Invariant mass distribution of #Lambda for further analyis", 500, 1.0, 1.2);\r
+ fHistMassLambda->GetXaxis()->SetTitle("Invariant mass p+#pi^{+} (GeV/c^{2})");\r
+ fHistMassLambda->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambda->SetMarkerStyle(kFullCircle);\r
\r
+ fHistMassLambdaPPi = new TH1F("fHistMassLambdaPPi", "Invariant mass distribution #Lambdap#pi^{-} ", 300, 2.2, 2.5);\r
+ fHistMassLambdaPPi->GetXaxis()->SetTitle("Invariant mass #Lambdap#pi^{-} (GeV/c^{2})");\r
+ fHistMassLambdaPPi->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambdaPPi->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassLambdaP = new TH1F("fHistMassLambdaP", "Invariant mass distribution #Lambdap ", 300, 2.2, 2.5);\r
+ fHistMassLambdaP->GetXaxis()->SetTitle("Invariant mass #Lambdap (GeV/c^{2})");\r
+ fHistMassLambdaP->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambdaP->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassLambdaK = new TH1F("fHistMassLambdaK", "Invariant mass distribution #LambdaK^{-} ", 300, 1.6, 1.9);\r
+ fHistMassLambdaK->GetXaxis()->SetTitle("Invariant mass #LambdaK^{-} (GeV/c^{2})");\r
+ fHistMassLambdaK->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambdaK->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassK0onl = new TH1F("fHistMassK0onl", "Invariant mass distribution K_{s}^{0} online V0 finder ", 400, 0.2, 1.0);\r
+ fHistMassK0onl->GetXaxis()->SetTitle("Invariant mass #pi^{+}#pi^{-} (GeV/c^{2})");\r
+ fHistMassK0onl->GetYaxis()->SetTitle("Entries");\r
+ fHistMassK0onl->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassK0offl = new TH1F("fHistMassK0offl", "Invariant mass distribution  K_{s}^{0} offline V0 finder ", 400, 0.2, 1.0);\r
+ fHistMassK0offl->GetXaxis()->SetTitle("Invariant mass  #pi^{+}#pi^{-} (GeV/c^{2})");\r
+ fHistMassK0offl->GetYaxis()->SetTitle("Entries");\r
+ fHistMassK0offl->SetMarkerStyle(kFullCircle);\r
\r
+ fHistMassK0onlC = new TH1F("fHistMassK0onlC", "Invariant mass distribution K_{s}^{0} online V0 finder ", 400, 0.2, 1.0);\r
+ fHistMassK0onlC->GetXaxis()->SetTitle("Invariant mass #pi^{+}#pi^{-} (GeV/c^{2})");\r
+ fHistMassK0onlC->GetYaxis()->SetTitle("Entries");\r
+ fHistMassK0onlC->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassK0offlC = new TH1F("fHistMassK0offlC", "Invariant mass distribution  K_{s}^{0} offline V0 finder ", 400, 0.2, 1.0);\r
+ fHistMassK0offlC->GetXaxis()->SetTitle("Invariant mass  #pi^{+}#pi^{-} (GeV/c^{2})");\r
+ fHistMassK0offlC->GetYaxis()->SetTitle("Entries");\r
+ fHistMassK0offlC->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassPQonl = new TH1F("fHistMassPQonl", "Invariant mass distribution K_{s}^{0}p using online V0 finder ", 500, 1.3, 2.3);\r
+ fHistMassPQonl->GetXaxis()->SetTitle("Invariant mass K_{s}^{0}p (GeV/c^{2})");\r
+ fHistMassPQonl->GetYaxis()->SetTitle("Entries");\r
+ fHistMassPQonl->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassPQoffl = new TH1F("fHistMassPQoffl", "Invariant mass distribution  K_{s}^{0}p using offline V0 finder ", 500, 1.3, 2.3);\r
+ fHistMassPQoffl->GetXaxis()->SetTitle("Invariant mass K_{s}^{0}p (GeV/c^{2})");\r
+ fHistMassPQoffl->GetYaxis()->SetTitle("Entries");\r
+ fHistMassPQoffl->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistDC = new TH1F("fHistDC", "Proper decay length", 500, 0.0, 25);\r
+ fHistDC->GetXaxis()->SetTitle("c#tau (cm)");\r
+ fHistDC->GetYaxis()->SetTitle("Entries");\r
+ fHistDC->SetMarkerStyle(kFullCircle);\r
+  \r
+ fHistArmenterosPodolanski = new TH2F("fHistArmenterosPodolanski", "Armenteros-Podolanski plot", 200,-1.0,1.0, 500,0,1);\r
+ fHistArmenterosPodolanski->GetXaxis()->SetTitle("#alpha");\r
+ fHistArmenterosPodolanski->GetYaxis()->SetTitle("q_{t}");\r
+ fHistArmenterosPodolanski->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistArmenterosPodolanskiCut = new TH2F("fHistArmenterosPodolanskiCut", "Armenteros-Podolanski plot after cut", 200,-1.0,1.0, 500,0,1);\r
+ fHistArmenterosPodolanskiCut->GetXaxis()->SetTitle("#alpha");\r
+ fHistArmenterosPodolanskiCut->GetYaxis()->SetTitle("q_{t}");\r
+ fHistArmenterosPodolanskiCut->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistHDibaryonInvaMassGen = new TH1F("fHistHDibaryonInvaMassGen", "Generated  #Lambda p #pi^{-}", 200, 2.1, 2.3);\r
+ fHistHDibaryonInvaMassGen->GetYaxis()->SetTitle("Counts");\r
+ fHistHDibaryonInvaMassGen->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");\r
+\r
+ fHistHDibaryonInvaMassGenRes = new TH1F("fHistHDibaryonInvaMassGenRes", "Generated  #Lambda p #pi^{-} with particles in rapidity!!!", 200, 2.1, 2.3);\r
+ fHistHDibaryonInvaMassGenRes->GetYaxis()->SetTitle("Counts");\r
+ fHistHDibaryonInvaMassGenRes->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");\r
+\r
+ fHistAntiHDibaryonInvaMassGen = new TH1F("fHistAntiHDibaryonInvaMassGen", "Generated  #bar{#Lambda} #bar{p} #pi^{+}", 200, 2.1, 2.3);\r
+ fHistAntiHDibaryonInvaMassGen->GetYaxis()->SetTitle("Counts");\r
+ fHistAntiHDibaryonInvaMassGen->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");\r
+\r
+ fHistHDibaryonInvaMassAso = new TH1F("fHistHDibaryonInvaMassAso", "Associated  #Lambda p #pi^{-}", 200, 2.1, 2.3);\r
+ fHistHDibaryonInvaMassAso->GetYaxis()->SetTitle("Counts");\r
+ fHistHDibaryonInvaMassAso->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");\r
+\r
+ fHistHDibaryonInvaMassAsoReso = new TH1F("fHistHDibaryonInvaMassAsoReso", "Associated  #Lambda p #pi^{-}", 200, 2.1, 2.3);\r
+ fHistHDibaryonInvaMassAsoReso->GetYaxis()->SetTitle("Counts");\r
+ fHistHDibaryonInvaMassAsoReso->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");\r
+\r
+ fHistAntiHDibaryonInvaMassAso = new TH1F("fHistAntiHDibaryonInvaMassAso", "Associated  #bar{#Lambda} #bar{p} #pi^{+}", 200, 2.1, 2.3);\r
+ fHistAntiHDibaryonInvaMassAso->GetYaxis()->SetTitle("Counts");\r
+ fHistAntiHDibaryonInvaMassAso->GetXaxis()->SetTitle("Invariant mass  (GeV/c^{2})");\r
+\r
+ fHistCheck = new TH2F("fHistCheck", "Check online/offline", 200, -0.5, 1.5, 200, -0.5, 1.5);\r
+ fHistCheck->GetXaxis()->SetTitle("offline");\r
+ fHistCheck->GetYaxis()->SetTitle("online");\r
+ fHistCheck->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistHPointingAngle= new TH1F("fHistHPointingAngle", "Pointing angle distribution for #Lambdap#pi^{-}", 200, 0., 2*TMath::Pi());\r
+ fHistHPointingAngle->GetXaxis()->SetTitle("Pointing angle distribution for #Lambdap#pi^{-}");\r
+ fHistHPointingAngle->GetYaxis()->SetTitle("Entries");\r
+ fHistHPointingAngle->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassH= new TH1F("fHistMassH", "Invariant mass distribution #Lambdap#pi^{-} (GeV/c^{2}) after pointing angle cut", 3000, 2.2, 2.5);\r
+ fHistMassH->GetXaxis()->SetTitle("Invariant mass #Lambdap#pi^{-} (GeV/c^{2})");\r
+ fHistMassH->GetYaxis()->SetTitle("Entries");\r
+ fHistMassH->SetMarkerStyle(kFullCircle);\r
\r
+ fHistMassLambdaFromH= new TH1F("fHistMassLambdaFromH", "Invariant mass distribution #Lambda (GeV/c^{2}) asking for Mother to be H", 300, 1.0, 1.3);\r
+ fHistMassLambdaFromH->GetXaxis()->SetTitle("Invariant mass #Lambda (GeV/c^{2})");\r
+ fHistMassLambdaFromH->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambdaFromH->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassLambdaFromHtLorentz= new TH1F("fHistMassLambdaFromHtLorentz", "Invariant mass distribution #Lambda (GeV/c^{2}) asking for Mother to be H", 300, 1.0, 1.3);\r
+ fHistMassLambdaFromHtLorentz->GetXaxis()->SetTitle("Invariant mass #Lambda (GeV/c^{2})");\r
+ fHistMassLambdaFromHtLorentz->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLambdaFromHtLorentz->SetMarkerStyle(kFullCircle);\r
\r
+ fHistMassPpi= new TH1F("fHistMassPpi", "Invariant mass distribution of the p#pi^{-} used for combing with Lambda", 300, 1.0, 1.6);\r
+ fHistMassPpi->GetXaxis()->SetTitle("Invariant mass p#pi^{-} (GeV/c^{2})");\r
+ fHistMassPpi->GetYaxis()->SetTitle("Entries");\r
+ fHistMassPpi->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassPpiReso= new TH1F("fHistMassPpiReso", "Invariant mass distribution of the p#pi^{-} used for combing with Lambda", 300, 1.0, 1.6);\r
+ fHistMassPpiReso->GetXaxis()->SetTitle("Invariant mass p#pi^{-} (GeV/c^{2})");\r
+ fHistMassPpiReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMassPpiReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassLpi= new TH1F("fHistMassLpi", "Invariant mass distribution of the #Lambda#pi^{-} used for combing with p", 300, 1.1, 1.7);\r
+ fHistMassLpi->GetXaxis()->SetTitle("Invariant mass #Lambda#pi^{-} (GeV/c^{2})");\r
+ fHistMassLpi->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLpi->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMassLP= new TH1F("fHistMassLP", "Invariant mass distribution of the #Lambda p used for combing with #pi^{-}", 300, 2.0, 2.3);\r
+ fHistMassLP->GetXaxis()->SetTitle("Invariant mass #Lambda p (GeV/c^{2})");\r
+ fHistMassLP->GetYaxis()->SetTitle("Entries");\r
+ fHistMassLP->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistProtonPIDBb = new TH2F("fHistProtonPIDBb", "dE/dx after p PID", 100, 0., 10, 100, 0, 100);\r
+ fHistProtonPIDBb->GetYaxis()->SetTitle("TPC Signal");\r
+ fHistProtonPIDBb->GetXaxis()->SetTitle("P (GeV/c)");\r
+ fHistProtonPIDBb->SetOption("scat");\r
+ fHistProtonPIDBb->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistPionPIDBb = new TH2F("fHistPionPIDBb", "dE/dx after K PID", 100, 0., 10, 100, 0, 100);\r
+ fHistPionPIDBb->GetYaxis()->SetTitle("TPC Signal");\r
+ fHistPionPIDBb->GetXaxis()->SetTitle("P (GeV/c)");\r
+ fHistPionPIDBb->SetOption("scat");\r
+ fHistPionPIDBb->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistProtonPIDLambda = new TH2F("fHistProtonPIDLambda", "dE/dx after p PID from V0", 100, 0., 10, 100, 0, 100);\r
+ fHistProtonPIDLambda->GetYaxis()->SetTitle("TPC Signal");\r
+ fHistProtonPIDLambda->GetXaxis()->SetTitle("P (GeV/c)");\r
+ fHistProtonPIDLambda->SetOption("scat");\r
+ fHistProtonPIDLambda->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistPionPIDLambda = new TH2F("fHistPionPIDLambda", "dE/dx after #pi PID from V0", 100, 0, 10, 100, 0, 100);\r
+ fHistPionPIDLambda->GetYaxis()->SetTitle("TPC Signal");\r
+ fHistPionPIDLambda->GetXaxis()->SetTitle("P (GeV/c)");\r
+ fHistPionPIDLambda->SetOption("scat");\r
+ fHistPionPIDLambda->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdcaPvtxDvtx= new TH1F("fHistMCdcaPvtxDvtx", "MC True DCA Primary Vertex - H Decay Vertex", 300, -0.1, 11.9);\r
+ fHistMCdcaPvtxDvtx->GetXaxis()->SetTitle("dca prim. vtx- decay vtx (cm)");\r
+ fHistMCdcaPvtxDvtx->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdcaPvtxDvtx->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdcaPvtxLvtx= new TH1F("fHistMCdcaPvtxLvtx", "MC True DCA Primary Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);\r
+ fHistMCdcaPvtxLvtx->GetXaxis()->SetTitle("dca prim. vtx-#Lambda decay vtx (cm)");\r
+ fHistMCdcaPvtxLvtx->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdcaPvtxLvtx->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdcaDvtxLvtx= new TH1F("fHistMCdcaDvtxLvtx", "MC True DCA H Decay Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);\r
+ fHistMCdcaDvtxLvtx->GetXaxis()->SetTitle("dca H deacy vtx-#Lambda decay vtx (cm)");\r
+ fHistMCdcaDvtxLvtx->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdcaDvtxLvtx->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCangleLH= new TH1F("fHistMCangleLH", "MC True Angle between #Lambda and H", 300, 0., 2*TMath::Pi());\r
+ fHistMCangleLH->GetXaxis()->SetTitle("Angle (#Lambda-H)");\r
+ fHistMCangleLH->GetYaxis()->SetTitle("Entries");\r
+ fHistMCangleLH->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdecayAngle= new TH1F("fHistMCdecayAngle", "MC True Angle between decay products", 300, 0., 2*TMath::Pi());\r
+ fHistMCdecayAngle->GetXaxis()->SetTitle("Angle (#Lambda-p#pi)");\r
+ fHistMCdecayAngle->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdecayAngle->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCpointingAngle= new TH1F("fHistMCpointingAngle", "MC True Pointing Angle", 3000, 0., 2*TMath::Pi());\r
+ fHistMCpointingAngle->GetXaxis()->SetTitle("Pointing Angle");\r
+ fHistMCpointingAngle->GetYaxis()->SetTitle("Entries");\r
+ fHistMCpointingAngle->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCap = new TH2F("fHistMCap", "True MC Armenteros-Podolanski", 200,-1.0,1.0, 500,0,1);\r
+ fHistMCap->GetYaxis()->SetTitle("#alpha");\r
+ fHistMCap->GetXaxis()->SetTitle("q_{t}");\r
+ fHistMCap->SetOption("scat");\r
+ fHistMCap->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdcaPvtxDvtxReso= new TH1F("fHistMCdcaPvtxDvtxReso", "MC True DCA Primary Vertex - H Decay Vertex", 300, -0.1, 11.9);\r
+ fHistMCdcaPvtxDvtxReso->GetXaxis()->SetTitle("dca prim. vtx- decay vtx (cm)");\r
+ fHistMCdcaPvtxDvtxReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdcaPvtxDvtxReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdcaPvtxLvtxReso= new TH1F("fHistMCdcaPvtxLvtxReso", "MC True DCA Primary Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);\r
+ fHistMCdcaPvtxLvtxReso->GetXaxis()->SetTitle("dca prim. vtx-#Lambda decay vtx (cm)");\r
+ fHistMCdcaPvtxLvtxReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdcaPvtxLvtxReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdcaDvtxLvtxReso= new TH1F("fHistMCdcaDvtxLvtxReso", "MC True DCA H Decay Vertex - Lambda Decay Vertex", 300, -0.1, 11.9);\r
+ fHistMCdcaDvtxLvtxReso->GetXaxis()->SetTitle("dca H deacy vtx-#Lambda decay vtx (cm)");\r
+ fHistMCdcaDvtxLvtxReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdcaDvtxLvtxReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCangleLHReso= new TH1F("fHistMCangleLHReso", "MC True Angle between #Lambda and H", 300, 0., 2*TMath::Pi());\r
+ fHistMCangleLHReso->GetXaxis()->SetTitle("Angle (#Lambda-H)");\r
+ fHistMCangleLHReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMCangleLHReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCdecayAngleReso= new TH1F("fHistMCdecayAngleReso", "MC True Angle between decay products", 300, 0., 2*TMath::Pi());\r
+ fHistMCdecayAngleReso->GetXaxis()->SetTitle("Angle (#Lambda-p#pi)");\r
+ fHistMCdecayAngleReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMCdecayAngleReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCpointingAngleReso= new TH1F("fHistMCpointingAngleReso", "MC True Pointing Angle", 300, 0., 2*TMath::Pi());\r
+ fHistMCpointingAngleReso->GetXaxis()->SetTitle("Pointing Angle");\r
+ fHistMCpointingAngleReso->GetYaxis()->SetTitle("Entries");\r
+ fHistMCpointingAngleReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistMCapReso = new TH2F("fHistMCapReso", "True MC Armenteros-Podolanski", 200,-1.0,1.0, 500,0,1);\r
+ fHistMCapReso->GetYaxis()->SetTitle("#alpha");\r
+ fHistMCapReso->GetXaxis()->SetTitle("q_{t}");\r
+ fHistMCapReso->SetOption("scat");\r
+ fHistMCapReso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistCentrality = new TH1F("Centrality ", "Centrality", 11, -0.5, 10.5);\r
+ fHistCentrality ->GetXaxis()->SetTitle("Centrality");\r
+ fHistCentrality ->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistCentralityAC = new TH1F("CentralityAC ", "CentralityAC", 11, -0.5, 10.5);\r
+ fHistCentralityAC ->GetXaxis()->SetTitle("Centrality");\r
+ fHistCentralityAC ->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistMultiplicity = new TH1F("Multiplicity ", "Multiplicity", 100, 0, 20000);\r
+ fHistMultiplicity ->GetXaxis()->SetTitle("Centrality");\r
+ fHistMultiplicity ->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistList->Add(fHistMassDPi);\r
+ fHistList->Add(fHistMassLPi);\r
+ fHistList->Add(fHistMassLambdaPi);\r
+ fHistList->Add(fHistMassLambda);\r
+ fHistList->Add(fHistMassLambdaPPi);\r
+ fHistList->Add(fHistMassLambdaP);\r
+ fHistList->Add(fHistMassLambdaK);\r
+ fHistList->Add(fHistMassK0onl);\r
+ fHistList->Add(fHistMassK0offl);\r
+ fHistList->Add(fHistMassK0onlC);\r
+ fHistList->Add(fHistMassK0offlC);\r
+ fHistList->Add(fHistMassPQonl); \r
+ fHistList->Add(fHistMassPQoffl);\r
+ fHistList->Add(fHistDC); \r
+ fHistList->Add(fHistArmenterosPodolanski);\r
+ fHistList->Add(fHistArmenterosPodolanskiCut);\r
+ fHistList->Add(fHistHDibaryonInvaMassGen);\r
+ fHistList->Add(fHistHDibaryonInvaMassGenRes);\r
+ fHistList->Add(fHistAntiHDibaryonInvaMassGen);\r
+ fHistList->Add(fHistHDibaryonInvaMassAso);\r
+ fHistList->Add(fHistHDibaryonInvaMassAsoReso);\r
+ fHistList->Add(fHistAntiHDibaryonInvaMassAso);\r
+ fHistList->Add(fHistCheck);\r
+ fHistList->Add(fHistHPointingAngle);\r
+ fHistList->Add(fHistMassH);\r
+ fHistList->Add(fHistMassPpi);\r
+ fHistList->Add(fHistMassPpiReso);\r
+ fHistList->Add(fHistMassLpi);\r
+ fHistList->Add(fHistMassLP);\r
+ fHistList->Add(fHistMassLambdaFromH);\r
+ fHistList->Add(fHistMassLambdaFromHtLorentz);\r
+ fHistList->Add(fHistProtonPIDBb);\r
+ fHistList->Add(fHistPionPIDBb);\r
+ fHistList->Add(fHistProtonPIDLambda);\r
+ fHistList->Add(fHistPionPIDLambda);\r
+ fHistList->Add(fHistMCdcaPvtxDvtx);\r
+ fHistList->Add(fHistMCdcaPvtxLvtx);\r
+ fHistList->Add(fHistMCdcaDvtxLvtx);\r
+ fHistList->Add(fHistMCangleLH);\r
+ fHistList->Add(fHistMCdecayAngle);\r
+ fHistList->Add(fHistMCpointingAngle);\r
+ fHistList->Add(fHistMCap);\r
+ fHistList->Add(fHistMCdcaPvtxDvtxReso);\r
+ fHistList->Add(fHistMCdcaPvtxLvtxReso);\r
+ fHistList->Add(fHistMCdcaDvtxLvtxReso);\r
+ fHistList->Add(fHistMCangleLHReso);\r
+ fHistList->Add(fHistMCdecayAngleReso);\r
+ fHistList->Add(fHistMCpointingAngleReso);\r
+ fHistList->Add(fHistMCapReso);\r
+ fHistList->Add(fHistCentrality);\r
+ fHistList->Add(fHistCentralityAC);\r
+ fHistList->Add(fHistMultiplicity);\r
\r
+ fHistHilf1= new TH1F("fHistHilf1", "HD", 300, 0., 10);\r
+ fHistHilf1->GetXaxis()->SetTitle("");\r
+ fHistHilf1->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistHilf2= new TH1F("fHistHilf2", "HD", 300, 0., 10);\r
+ fHistHilf2->GetXaxis()->SetTitle("");\r
+ fHistHilf2->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistHilf3= new TH1F("fHistHilf3", "HD", 300, 0., 10);\r
+ fHistHilf3->GetXaxis()->SetTitle("");\r
+ fHistHilf3->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistHilf4= new TH1F("fHistHilf4", "HD", 300, 0., 10);\r
+ fHistHilf4->GetXaxis()->SetTitle("");\r
+ fHistHilf4->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistHilf5= new TH1F("fHistHilf5", "HD", 300, 0., 10);\r
+ fHistHilf5->GetXaxis()->SetTitle("");\r
+ fHistHilf5->GetYaxis()->SetTitle("Entries");\r
+\r
+ fHistHilf6= new TH1F("fHistHilf6", "HD", 300, 0., 10);\r
+ fHistHilf6->GetXaxis()->SetTitle("");\r
+ fHistHilf6->GetYaxis()->SetTitle("Entries");\r
\r
+ fHistPtvsEtaGen = new TH2F("fHistPtvsEtaGen", "p_{t} vs #eta from generated H", 200,0.0,10.0, 200,-1,1);\r
+ fHistPtvsEtaGen->GetXaxis()->SetTitle("p_{t} (GeV/c)");\r
+ fHistPtvsEtaGen->GetYaxis()->SetTitle("#eta");\r
+ fHistPtvsEtaGen->SetOption("scat");\r
+ fHistPtvsEtaGen->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistPtvsEtaAso = new TH2F("fHistPtvsEtaAso", "p_{t} vs #eta from associated H", 200,0.0,10.0, 200,-1,1);\r
+ fHistPtvsEtaAso->GetYaxis()->SetTitle("p_{t} (GeV/c)");\r
+ fHistPtvsEtaAso->GetXaxis()->SetTitle("#eta");\r
+ fHistPtvsEtaAso->SetOption("scat");\r
+ fHistPtvsEtaAso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistPtvsYGen = new TH2F("fHistPtvsYGen", "p_{t} vs rapidity from generated H", 200,0.0,10.0, 200,-1,1);\r
+ fHistPtvsYGen->GetXaxis()->SetTitle("p_{t} (GeV/c)");\r
+ fHistPtvsYGen->GetYaxis()->SetTitle("y");\r
+ fHistPtvsYGen->SetOption("scat");\r
+ fHistPtvsYGen->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistPtvsYAso = new TH2F("fHistPtvsYAso", "p_{t} vs rapidity from associated H", 200,0.0,10.0, 200,-1,1);\r
+ fHistPtvsYAso->GetXaxis()->SetTitle("p_{t} (GeV/c)");\r
+ fHistPtvsYAso->GetYaxis()->SetTitle("y");\r
+ fHistPtvsYAso->SetOption("scat");\r
+ fHistPtvsYAso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistRap= new TH1F("fHistRap", "Rapidity", 400, -2., 2);\r
+ fHistRap->GetXaxis()->SetTitle("Y");\r
+ fHistRap->GetYaxis()->SetTitle("Entries");\r
+ fHistPtvsEtaAso->SetMarkerStyle(kFullCircle);\r
+\r
+ fHistList->Add(fHistHilf1);\r
+ fHistList->Add(fHistHilf2); \r
+ fHistList->Add(fHistHilf3);\r
+ fHistList->Add(fHistHilf4);\r
+ fHistList->Add(fHistHilf5); \r
+ fHistList->Add(fHistHilf6);\r
+ fHistList->Add(fHistPtvsEtaGen);\r
+ fHistList->Add(fHistPtvsEtaAso);\r
+ fHistList->Add(fHistPtvsYGen);\r
+ fHistList->Add(fHistPtvsYAso);\r
+ fHistList->Add(fHistRap);\r
+\r
+ fHistCount = new TH1F("fHistCount","test",17,0,17);\r
+ fHistCount->GetXaxis()->SetBinLabel(1,"Events");\r
+ fHistCount->GetXaxis()->SetBinLabel(2,"MC All");\r
+ fHistCount->GetXaxis()->SetBinLabel(3,"MC from Primary Vtx");\r
+ fHistCount->GetXaxis()->SetBinLabel(4,"Horst");\r
+ fHistCount->GetXaxis()->SetBinLabel(5,"Lambda Candidates");\r
+ fHistCount->GetXaxis()->SetBinLabel(6,"Sigma Candidates");\r
+ fHistCount->GetXaxis()->SetBinLabel(7,"Horst");\r
+ fHistCount->GetXaxis()->SetBinLabel(8,"Horst");\r
+ fHistCount->GetXaxis()->SetBinLabel(9,"Horst");\r
+ fHistCount->GetXaxis()->SetBinLabel(10,"MC All #bar{Lambda}(1520)s");\r
+ fHistCount->GetXaxis()->SetBinLabel(11,"");\r
+ fHistCount->GetXaxis()->SetBinLabel(12,"H-Dibaryon");\r
+ fHistCount->GetXaxis()->SetBinLabel(13,"Hypertriton 2-Body");\r
+ fHistCount->GetXaxis()->SetBinLabel(14,"Hypertriton 3-Body");\r
+ fHistCount->GetXaxis()->SetBinLabel(15,"");\r
+ fHistCount->GetXaxis()->SetBinLabel(16,"");\r
+ fHistCount->GetXaxis()->SetBinLabel(17,"Lambdas!!!");\r
+ fHistCount->SetStats(0);\r
+ fHistCount->SetFillColor(38);\r
+ fHistList->Add(fHistCount);\r
+\r
+ //trigger statistics histogram\r
+  fHistTriggerStat = new TH1F("fHistTriggerStat","Trigger statistics", 4,-0.5, 3.5);\r
+  const Char_t* aTriggerNames[] = { "kMB", "kCentral", "kSemiCentral" };\r
+  for ( Int_t ii=0; ii < 3; ii++ )\r
+    fHistTriggerStat->GetXaxis()->SetBinLabel(ii+1, aTriggerNames[ii]);\r
+\r
+  fHistTriggerStatAfterEventSelection = new TH1F("fHistTriggerStatAfterEventSelection","Trigger statistics after event selection", 4,-0.5, 3.5);\r
+  for ( Int_t ii=0; ii < 3; ii++ )\r
+    fHistTriggerStatAfterEventSelection->GetXaxis()->SetBinLabel(ii+1, aTriggerNames[ii]);\r
+  fHistList->Add(fHistTriggerStat);\r
+  fHistList->Add(fHistTriggerStatAfterEventSelection);\r
+\r
+  fHistMassHcentMult =  new TH3F("fHistMassHcentMult", "Inv. Mass vs. centrality vs. multiplicity", 100, 2.2, 2.3, 5, 0, 4, 300, 0, 6000);\r
+  fHistMassHcentMult->GetXaxis()->SetTitle("Invariant mass #Lambdap#pi^{-} (GeV/c^{2})"); // inv. mass\r
+  fHistMassHcentMult->GetYaxis()->SetTitle("Centrality"); // triggertype\r
+  fHistMassHcentMult->GetZaxis()->SetTitle("Multiplicity"); // refTPC\r
+  fHistList->Add(fHistMassHcentMult);\r
+\r
+  \r
+  const Double_t kz = 2*TMath::Pi();\r
+  Int_t binsD01[16]={  300, 200, 100, 100, 100, 100, 100, 100, 200, 200, 200, 200, 400, 200, 200, 3};\r
+  Double_t xminD01[16]={2.0, 1.0, 0., -1, 0., 0., 0., 0., 0., 0., 0., 0., -1, 0.,  0., 0};\r
+  Double_t xmaxD01[16]={2.3, 1.2, kz, 1, 1, 10, 10, 5, 5, 5, 5, 100, 1, 100,  4000, 1};\r
+  \r
+\r
+  fHistNdim = new THnSparseF("fHistNdim","THnS;InvMass, InvMassLambda, pointingAngle, armPoAlpha, armPoQt, pTL, pTH, d0p, d0n, dcaHd, dca, decayL, cosPA, centr, multi, mcinf;InvMassH", 16,binsD01,xminD01,xmaxD01);\r
+  fHistList->Add(fHistNdim);\r
+\r
+ AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
+ AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
+ fPIDtpcESD = inputHandler->GetPIDResponse();\r
+\r
+// Post output data (if histograms are not used later, PostData is at least called here)\r
+  PostData(1, fHistList);\r
+\r
+}\r
+\r
+ //________________________________________________________________________\r
+void AliAnalysisTaskHdibaryonLPpi::UserExec(Option_t *) \r
+{ \r
+  // Main loop\r
+  // Called for each event\r
+\r
+  //define improtant masses\r
+  Double_t pionMass     = 0.13957;\r
+  Double_t protonMass   = 0.93827;\r
+\r
+  //define PDGCodes\r
+  Long_t pdgPionPlus          =         211;\r
+  Long_t pdgPionMinus         =        -211;\r
+  Long_t pdgProton            =        2212;\r
+  Long_t pdgAntiProton        =       -2212;\r
+  Long_t pdgLambda            =        3122;\r
+  Long_t pdgAntiLambda        =       -3122;\r
+  Long_t pdgHDibaryon         =  1020000020;\r
+  Long_t pdgAntiHDibaryon     = -1020000020;\r
+\r
+  AliStack* stack(NULL);\r
+  if(HasMC()){\r
+\r
+    if(!fMCEvent)return;\r
+\r
+    AliHeader *head = fMCEvent->Header();\r
+    if(!head)return;\r
+    AliGenPythiaEventHeader *pyheader = (AliGenPythiaEventHeader*)head->GenEventHeader();\r
+    if(!pyheader)return;\r
+    \r
+    if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()){\r
+      if(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()){\r
+       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->TreeK()))return;\r
+       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->TreeTR()))return;\r
+       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->Init("local")))return;\r
+       stack = static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()->Stack();\r
+       if(!(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()->Stack()->TreeK()))return;\r
+      }\r
+    }\r
+       \r
+    if(!stack)return;\r
+  }\r
+\r
+  // -------------------------------------------------------\r
+  // Loop for Inv. Mass via ESD tracks\r
+  // -------------------------------------------------------\r
+\r
+  fHistCount->Fill(0);\r
+  \r
+  fESD = dynamic_cast<AliESDEvent *>(fInputEvent);\r
+\r
+  const AliESDVertex *vertex = fESD->GetPrimaryVertexTracks();\r
+  if (vertex->GetNContributors()<1) \r
+    {\r
+      // SPD vertex\r
+      vertex = fESD->GetPrimaryVertexSPD();\r
+       if(vertex->GetNContributors()<1) {\r
+        return;\r
+       }  \r
+    }\r
+  if (TMath::Abs(vertex->GetZv()) > 10) return;\r
+  \r
+  Int_t centrality = -5;\r
+  Double_t centrPerc = -5;\r
+\r
+  if (fESD->GetEventSpecie() == 4) \r
+    { // PbPb\r
+      AliCentrality *esdCentrality = fESD->GetCentrality();\r
+      centrality = esdCentrality->GetCentralityClass10("V0M"); // centrality percentile determined with V0\r
+      centrPerc = esdCentrality->GetCentralityPercentile("V0M");\r
+//      if (centrality < 0. || centrality > 8.) return; //0 bis 80 %\r
+      if (centrality > 8) return; //0 bis 80 %\r
+      //  cout<<"Centrality: "<< centrality << endl;\r
+    }\r
+\r
+\r
+  fHistCentrality->Fill(centrality);   \r
+\r
+  //*****************//  \r
+  //*   Centrality  *//\r
+  //*****************//\r
\r
+  //  Float_t percentile=centrality->GetCentralityPercentile("V0M");\r
+\r
+  Bool_t isSelectedCentral = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kCentral);\r
+  Bool_t isSelectedSemiCentral = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kSemiCentral);\r
+  Bool_t isSelectedMB = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);\r
\r
+  Int_t triggertype = 17;\r
+\r
+  if(isSelectedCentral){\r
+    fHistTriggerStat->Fill(1);\r
+    triggertype=1;\r
+  }\r
+\r
+  if(isSelectedSemiCentral){\r
+    fHistTriggerStat->Fill(2);\r
+    triggertype=2;\r
+  }\r
+\r
+  if(isSelectedMB){\r
+    fHistTriggerStat->Fill(0);\r
+    triggertype=3;\r
+  }\r
+\r
+  //  if(isSelectedCentral || isSelectedSemiCentral || isSelectedMB){\r
+\r
+  //*******************************\r
+\r
+  Int_t runNumber = 0;\r
+  //  itrk = 0;\r
+  runNumber = fESD->GetRunNumber();\r
+/*  \r
+  if (!fPIDtpcESD) fPIDtpcESD = ((AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetESDpid();\r
+  if (!fPIDtpcESD) {\r
+    fPIDtpcESD = new AliESDpid(); // HACK FOR MC PBPB --> PLEASE REMOVE AS SOON AS POSSIBLE\r
+    fPIDtpcESD->GetTPCResponse().SetBetheBlochParameters(1.28778e+00/50., 3.13539e+01, TMath::Exp(-3.16327e+01), 1.87901e+00, 6.41583e+00);\r
+  }\r
+*/\r
+  Double_t pionK=1;\r
+  Double_t pK=1;\r
\r
+  TObjArray* listCrossV0   = fESDCutsV0->GetAcceptedV0s(fESD);  \r
+  Int_t nGoodV0s      = listCrossV0->GetEntries();\r
+\r
+  const AliESDVertex *esdVer = fESD->GetPrimaryVertex();\r
+  AliESDVertex *esdVer1 = new AliESDVertex(*esdVer);\r
+   \r
+  AliVertexerTracks *vertexer = new AliVertexerTracks(fESD->GetMagneticField());\r
+  TObjArray *trkArray = new TObjArray(2);\r
+  AliVertexerTracks *vertexer1 = new AliVertexerTracks(fESD->GetMagneticField());\r
+  TObjArray *trkArray1 = new TObjArray(2);\r
+\r
+  AliKFParticle::SetField(fESD->GetMagneticField());\r
+       \r
+  AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));\r
+\r
+  Int_t refMultTpc = AliESDtrackCuts::GetReferenceMultiplicity(fESD, kTRUE);\r
+  //cout<<"Multiplicity: "<< refMultTpc << endl;\r
+  fHistMultiplicity->Fill(refMultTpc);\r
+  \r
+  Double_t mn[3] = {0,0,0};\r
+  Double_t mp[3] = {0,0,0}; \r
+  Double_t mm[3] = {0,0,0};\r
+  Double_t dd[3] = {0,0,0};\r
+  Double_t dd1[3] = {0,0,0};\r
+  const Double_t cProtonMass=TDatabasePDG::Instance()->GetParticle(2212)->Mass();\r
+  const Double_t cPionMass=TDatabasePDG::Instance()->GetParticle(211)->Mass();\r
+  const Double_t cElectronMass=TDatabasePDG::Instance()->GetParticle(11)->Mass();\r
+  const Double_t cLambdaMass=TDatabasePDG::Instance()->GetParticle(3122)->Mass();\r
+  Double_t decayLength=0;\r
+  Double_t decayLengthH=0;\r
+\r
+  //V0 Loop for Lambda and Anti-Lambda\r
+  for(Int_t iV0MI = 0; iV0MI < nGoodV0s ; iV0MI++) {\r
+    AliESDv0 * fV0MIs = fESD->GetV0(iV0MI);\r
+    Int_t    lOnFlyStatus = 0;\r
+\r
+    lOnFlyStatus = fV0MIs->GetOnFlyStatus();\r
+    Double_t lInvMassLambda=0;\r
+    Double_t lInvMassLambdaPi=0;\r
+    Double_t lPtLambda=0;\r
+    Double_t lPzLambda=0;\r
+    Double_t lPLambda=0;\r
+    Int_t onl=0;\r
+    Int_t offl=0;\r
+\r
+    TLorentzVector posE;\r
+    TLorentzVector negE;\r
+    TLorentzVector photon;\r
+\r
+    if (lOnFlyStatus){\r
+      onl=1; \r
+      //      return;\r
+    }\r
+    if (!lOnFlyStatus){\r
+      offl=1;\r
+      //return;\r
+    }\r
+\r
+    //    fHistMultiplicity->Fill(refMultTpc); \r
+    fHistCentralityAC->Fill(centrality);\r
+    fHistCheck->Fill(offl,onl);\r
+\r
+    AliESDtrack* trackPosTest = fESD->GetTrack(fV0MIs->GetPindex());\r
+    AliESDtrack* trackNegTest = fESD->GetTrack(fV0MIs->GetNindex());\r
+\r
+    //    if (!\r
+    if (!fEsdTrackCuts->AcceptTrack(trackPosTest)) continue;\r
+    if (!fESDtrackCutsV0->AcceptTrack(trackNegTest)) continue;\r
+\r
+\r
+      //PID via specific energy loss in the TPC\r
+      //define the arrays for the Bethe-Bloch-Parameters\r
+      Double_t parProton[5]   = {0,0,0,0,0};\r
+\r
+      if(runNumber < 166500) //LHC10h\r
+       {\r
+         parProton[0]   = 1.45802; // ALEPH parameters for protons (pass2)\r
+         parProton[1]   = 27.4992;\r
+         parProton[2]   = 4.00313e-15;\r
+         parProton[3]   = 2.48485;\r
+         parProton[4]   = 8.31768; \r
+       }\r
+      \r
+      if(runNumber > 166500) //LHC11h\r
+       { \r
+         parProton[0]   = 1.11243; // ALEPH parameters for protons (pass2)\r
+         parProton[1]   = 26.1144;\r
+         parProton[2]   = 4.00313e-15;\r
+         parProton[3]   = 2.72969;\r
+         parProton[4]   = 9.15038; \r
+       }\r
\r
+      //Get the total momentum for each track at the inner readout of the TPC\r
+      Double_t ptotN = trackNegTest->GetInnerParam()->GetP();\r
+      Double_t ptotP = trackPosTest->GetInnerParam()->GetP();\r
+\r
+      //define expected signals for the various species\r
+      Double_t expSignalPionP = 0;\r
+      Double_t expSignalPionN = 0;\r
+      Double_t expSignalProtonN = 0;\r
+      Double_t expSignalProtonP = 0;\r
+\r
+      //for data\r
+      if(!HasMC())\r
+       {\r
+         expSignalProtonN = AliExternalTrackParam::BetheBlochAleph(ptotN/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);\r
+         expSignalProtonP = AliExternalTrackParam::BetheBlochAleph(ptotP/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);\r
+       }\r
+    \r
+      //for MC\r
+      if(HasMC())\r
+       {\r
+         expSignalPionP = 0.7*AliExternalTrackParam::BetheBlochAleph(ptotP/(pionMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]); \r
+         expSignalPionN = 0.7*AliExternalTrackParam::BetheBlochAleph(ptotN/(pionMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]); \r
+\r
+         expSignalProtonN = 0.65*AliExternalTrackParam::BetheBlochAleph(ptotN/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);\r
+         expSignalProtonP = 0.65*AliExternalTrackParam::BetheBlochAleph(ptotP/(protonMass),parProton[0],parProton[1],parProton[2],parProton[3],parProton[4]);   \r
+       }\r
+\r
+      // PID cut on the nuclei (proton, deuteron, triton, helium3)\r
+      Bool_t corrParticle = kFALSE;\r
+\r
+      Bool_t posProton = kFALSE;\r
+      //data\r
+      if(!HasMC())\r
+       {\r
+         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackPosTest, AliPID::kProton)) < 3)\r
+           {\r
+             posProton = kTRUE;\r
+             corrParticle = kTRUE;\r
+           }\r
+       }\r
+      //MC\r
+      if(HasMC())\r
+       {\r
+         if(//trackPosTest->GetTPCsignal() < 1200 && \r
+            TMath::Abs(trackPosTest->GetTPCsignal() - expSignalProtonP)/expSignalProtonP < 0.4)\r
+           {\r
+             posProton = kTRUE;\r
+             corrParticle = kTRUE;\r
+           }\r
+       }\r
+\r
+      Bool_t negProton = kFALSE;\r
+      //data\r
+      if(!HasMC())\r
+       {\r
+         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackNegTest, AliPID::kProton)) < 3)\r
+           {\r
+             negProton = kTRUE;\r
+             corrParticle = kTRUE;\r
+           }\r
+       }\r
+     //MC\r
+      if(HasMC())\r
+       {\r
+         if(//trackNegTest->GetTPCsignal() < 1200 && \r
+            TMath::Abs(trackNegTest->GetTPCsignal() - expSignalProtonN)/expSignalProtonN < 0.4)\r
+           {\r
+             negProton = kTRUE;\r
+             corrParticle = kTRUE;\r
+           }\r
+       }\r
+\r
+     //PID cut for pions\r
+      //data: 3sigma cut on the pions\r
+\r
+      Bool_t negPion = kFALSE;     \r
+      Bool_t posPion = kFALSE;\r
+\r
+      if (!HasMC())\r
+       {\r
+         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackPosTest, AliPID::kPion)) < 4) posPion=kTRUE; //pos daughter has to be a pion\r
+         if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackNegTest, AliPID::kPion)) < 4) negPion=kTRUE; // negative daughter has to be a pion\r
+       }\r
+      \r
+      //MC: like the nuclei via the specific energyloss in the TPC\r
+      if (HasMC())\r
+       {\r
+         if (TMath::Abs(trackPosTest->GetTPCsignal() - expSignalPionP)/expSignalPionP < 0.4) posPion=kTRUE;\r
+         if (TMath::Abs(trackNegTest->GetTPCsignal() - expSignalPionN)/expSignalPionN < 0.4) negPion=kTRUE;\r
+       }\r
+\r
+      if (!(posProton==kTRUE)) continue;\r
+      if (!(negPion==kTRUE)) continue;\r
+\r
+    //To avoid ghosts\r
+\r
+    if( !(trackPosTest->GetStatus() & AliESDtrack::kTPCrefit)){\r
+      continue;\r
+    }\r
+\r
+    if( !(trackNegTest->GetStatus() & AliESDtrack::kTPCrefit)){\r
+      continue;\r
+    }\r
+\r
+    if( trackPosTest->GetSign() >0 && trackNegTest->GetSign() <0){\r
+      fV0MIs->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter\r
+      fV0MIs->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter \r
+    }\r
+\r
+    if( trackPosTest->GetSign() <0 && trackNegTest->GetSign() >0){\r
+      fV0MIs->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter\r
+      fV0MIs->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter\r
+    }\r
+\r
+    fV0MIs->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother\r
+\r
+    TVector3 vecN(mn[0],mn[1],mn[2]);\r
+    TVector3 vecP(mp[0],mp[1],mp[2]);\r
+    TVector3 vecM(mm[0],mm[1],mm[2]);\r
+    \r
+    Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));\r
+    Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));\r
+    \r
+    Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/\r
+      ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;\r
+    Double_t qt = vecP.Mag()*sin(thetaP);\r
+\r
+    fHistArmenterosPodolanski->Fill(alfa,qt);    //Armenteros-Podolanski calculation\r
+\r
+    TLorentzVector k0;\r
+    TLorentzVector k0daugh1;\r
+    TLorentzVector k0daugh2;\r
+    TLorentzVector proton;\r
+    TLorentzVector pq;\r
+\r
+    k0daugh1.SetXYZM(mn[0],mn[1],mn[2],cPionMass);\r
+    k0daugh2.SetXYZM(mp[0],mp[1],mp[2],cPionMass);\r
+    k0=k0daugh1+k0daugh2;\r
+\r
+    fV0MIs->ChangeMassHypothesis(3122);\r
+    lInvMassLambda = fV0MIs->GetEffMass();\r
+    lPtLambda = fV0MIs->Pt();\r
+    lPzLambda = fV0MIs->Pz();\r
+    lPLambda = fV0MIs->P();\r
+\r
+    trkArray->AddAt(trackPosTest,0);\r
+    trkArray->AddAt(trackNegTest,1);\r
+\r
+    vertexer->SetVtxStart(esdVer1);\r
+    AliESDVertex *decayVertex = (AliESDVertex*)vertexer->VertexForSelectedESDTracks(trkArray);\r
+\r
+    dd[0]=fESD->GetPrimaryVertexSPD()->GetX()-decayVertex->GetX();\r
+    dd[1]=fESD->GetPrimaryVertexSPD()->GetY()-decayVertex->GetY();\r
+    dd[2]=fESD->GetPrimaryVertexSPD()->GetZ()-decayVertex->GetZ();\r
+    \r
+    decayLength=sqrt(dd[0]*dd[0]+dd[1]*dd[1]+dd[2]*dd[2]);\r
+\r
+    if (decayVertex) delete decayVertex;\r
+\r
+    TLorentzVector negPio1;\r
+    TLorentzVector posProt1;        \r
+    TLorentzVector posP;\r
+    TLorentzVector posProt;\r
+    TLorentzVector negK;\r
+    TLorentzVector negPio;\r
+    TLorentzVector negPi;\r
+    TLorentzVector omega;\r
+    TLorentzVector threeSum;\r
+    TLorentzVector fourSum;\r
+    TLorentzVector ppK;\r
+    TLorentzVector posPiK;\r
+    TLorentzVector negPiK;\r
+    TLorentzVector kaon;\r
+    TLorentzVector lambda;\r
+    TLorentzVector lambdaH;\r
+    TLorentzVector hDibaryon;\r
+    TVector3 h;\r
+    TVector3 h1;\r
+\r
+    Int_t mcStatus=0;\r
+\r
+    h.SetXYZ(-dd[0],-dd[1],-dd[2]);\r
+\r
+\r
+    if (onl==1)fHistMassDPi->Fill(lInvMassLambda);\r
+\r
+    if (offl==1){\r
+      fHistMassLPi->Fill(lInvMassLambda);\r
+      \r
+      negE.SetXYZM(mn[0],mn[1],mn[2],cElectronMass);\r
+      posE.SetXYZM(mp[0],mp[1],mp[2],cElectronMass);\r
+      photon=posE+negE;\r
+      \r
+      negPiK.SetXYZM(mn[0],mn[1],mn[2],cPionMass);\r
+      posPiK.SetXYZM(mp[0],mp[1],mp[2],cPionMass);\r
+      kaon=posPiK+negPiK;\r
+      \r
+      negPi.SetXYZM(mn[0],mn[1],mn[2],cPionMass);\r
+      posP.SetXYZM(mp[0],mp[1],mp[2],cProtonMass);\r
+      lambda=negPi+posP;\r
+      lambdaH.SetXYZM(mm[0],mm[1],mm[2],cLambdaMass);\r
+\r
+      if (lInvMassLambda>1.1113&&lInvMassLambda<1.1202){\r
+       \r
+       if (!HasMC()){\r
+         if (qt<-2.21*alfa*alfa+2.945*alfa-0.887) continue;\r
+         if (qt>-2.21*alfa*alfa+2.945*alfa-0.873) continue;\r
+         if (photon.M()<0.005) continue;\r
+         if (kaon.M()>0.495 && kaon.M()<0.500 ) continue;\r
+       }\r
+       \r
+\r
+       fHistMassLambda->Fill(lInvMassLambda);\r
+       //\r
+       Bool_t isCorrectlyAssociatedLambda = kFALSE;\r
+       Bool_t isPartialCorrectlyAssociatedLambda = kFALSE;\r
+       Int_t labelAssociatedH=-1; \r
+       Int_t labelLambda=-1;\r
+       //\r
+       if (HasMC()) {\r
+         Int_t labelPosTest = trackPosTest->GetLabel();\r
+         TParticle *tparticleDaughter = stack->Particle(TMath::Abs(labelPosTest));\r
+         Int_t labelMother = tparticleDaughter->GetFirstMother();\r
+         TParticle *tparticleMother = stack->Particle(TMath::Abs(labelMother));\r
+         \r
+         Int_t labelOma = tparticleMother->GetFirstMother();\r
+         TParticle *tparticleOma = stack->Particle(TMath::Abs(labelOma));\r
+\r
+         if ((tparticleOma->GetPdgCode() < 0) && TMath::Abs(tparticleMother->GetPdgCode())==pdgLambda){// check mother to be Lambda \r
+           Int_t labelFirstDaughter  = tparticleMother->GetDaughter(1);// Proton\r
+           Int_t labelThirdDaughter  = tparticleMother->GetDaughter(0);// Pion\r
+           \r
+           TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));\r
+           TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));\r
+           \r
+           if((tparticleFirstDaughter->GetPdgCode() == pdgProton && tparticleThirdDaughter->GetPdgCode()== pdgPionMinus) || \r
+              (tparticleFirstDaughter->GetPdgCode() == pdgPionMinus && tparticleThirdDaughter->GetPdgCode()== pdgProton)){ //daughter PDGs\r
+             isPartialCorrectlyAssociatedLambda = kTRUE;\r
+             labelLambda=labelMother;\r
+           }\r
+         }\r
+         \r
+         //H-Dibaryon\r
+         if(tparticleOma->GetPdgCode() == pdgHDibaryon){ //check grandmother to be H PDG\r
+           if (TMath::Abs(tparticleMother->GetPdgCode())==pdgLambda){// check mother to be Lambda \r
+             Int_t labelFirstDaughter  = tparticleMother->GetDaughter(1);// Proton\r
+             Int_t labelThirdDaughter  = tparticleMother->GetDaughter(0);// Pion\r
+                       \r
+             TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));\r
+             TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));\r
+             \r
+             if((tparticleFirstDaughter->GetPdgCode() == pdgProton && tparticleThirdDaughter->GetPdgCode()== pdgPionMinus) || \r
+                (tparticleFirstDaughter->GetPdgCode() == pdgPionMinus && tparticleThirdDaughter->GetPdgCode()== pdgProton)){ //daughter PDGs\r
+               isCorrectlyAssociatedLambda = kTRUE;\r
+               labelAssociatedH=labelOma;\r
+               fHistMassLambdaFromH->Fill(lInvMassLambda);\r
+               fHistMassLambdaFromHtLorentz->Fill(lambda.M());\r
+             }\r
+           }\r
+         }\r
+       }\r
+\r
+       fHistProtonPIDLambda->Fill(trackPosTest->GetInnerParam()->GetP(), trackPosTest->GetTPCsignal());\r
+       fHistPionPIDLambda->Fill(trackNegTest->GetInnerParam()->GetP(), trackNegTest->GetTPCsignal());\r
+\r
+       //---------------------------------------------------------\r
+       // Proton track loop\r
+       //---------------------------------------------------------\r
+       fHistArmenterosPodolanskiCut->Fill(alfa,qt);\r
+\r
+       for (Int_t iTracksP = 0; iTracksP < fESD->GetNumberOfTracks(); iTracksP++) {\r
+         AliESDtrack* trackP = dynamic_cast<AliESDtrack*> (fESD->GetTrack(iTracksP));\r
+         if (trackP->GetSign()<0) continue;\r
+         \r
+         if (iTracksP==fV0MIs->GetPindex())continue;\r
+         if (iTracksP==fV0MIs->GetNindex())continue;\r
+               \r
+         if (!fEsdTrackCuts->AcceptTrack(trackP)) continue;\r
+               \r
+         AliKFParticle protonKF( *(trackP), 2212);\r
+\r
+         if (!trackP->GetInnerParam()) continue;\r
+         \r
+         if (HasMC()) {\r
+           pK=0.65;\r
          }
 
-         if (!HasMC()){
-           if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackP, AliPID::kProton)) > 3) continue;
-         }             
-         
-         fHistProtonPIDBb->Fill(trackP->GetInnerParam()->GetP(), trackP->GetTPCsignal());
-         
-         posProt.SetXYZM(trackP->Px(),trackP->Py(),trackP->Pz(),cProtonMass);
-
-         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-         //Pion Track loop!!!!!!!!!!!!!!!!!!!!!
-         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-         for (Int_t iTracksN = iTracksP+1; iTracksN < fESD->GetNumberOfTracks(); iTracksN++) {
-           AliESDtrack* trackN = dynamic_cast<AliESDtrack*> (fESD->GetTrack(iTracksN));
-
-           if (iTracksN==fV0MIs->GetPindex())continue;
-           if (iTracksN==fV0MIs->GetNindex())continue;
-           if (trackN->GetSign()>0) continue;
-         
-           if (!fEsdTrackCuts->AcceptTrack(trackN)) continue;
-           if (!fESDtrackCutsV0->AcceptTrack(trackN)) continue;
-           
-           negPi.SetXYZM(mn[0],mn[1],mn[2],cPionMass);
-           posP.SetXYZM(mp[0],mp[1],mp[2],cProtonMass);
-           negPio.SetXYZM(trackN->Px(),trackN->Py(),trackN->Pz(),cPionMass);
-             
-           threeSum=negPi+posP+negPio;
-           lInvMassLambdaPi=threeSum.M();         
-           
-           fHistDC->Fill(decayLength*lInvMassLambda/lPLambda);
-           
-           AliKFParticle posPionKF( *(trackN) ,-211);
-           
-           if (!trackN->GetInnerParam()) continue;
-           if (HasMC()) {
-             pionK=0.7;
-           }
-           
-           if (!HasMC()){
-             if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackN, AliPID::kPion)) > 3) continue;
-           }
-           fHistPionPIDBb->Fill(trackN->GetInnerParam()->GetP(), trackN->GetTPCsignal());
-
-           trkArray1->AddAt(trackP,0);
-           trkArray1->AddAt(trackN,1);
-           
-           vertexer1->SetVtxStart(esdVer1);
-           AliESDVertex *decayVertex1 = (AliESDVertex*)vertexer1->VertexForSelectedESDTracks(trkArray1);
-           
-           dd1[0]=fESD->GetPrimaryVertexSPD()->GetX()-decayVertex1->GetX();
-           dd1[1]=fESD->GetPrimaryVertexSPD()->GetY()-decayVertex1->GetY();
-           dd1[2]=fESD->GetPrimaryVertexSPD()->GetZ()-decayVertex1->GetZ();
-           
-           decayLengthH=sqrt(dd1[0]*dd1[0]+dd1[1]*dd1[1]+dd1[2]*dd1[2]);
-
-            Double_t bz = fESD->GetMagneticField();
-           
-           trackP->PropagateToDCA(decayVertex1, bz, 10);
-           trackN->PropagateToDCA(decayVertex1, bz, 10);
-
+         if (!HasMC()){\r
+           if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackP, AliPID::kProton)) > 3) continue;\r
+         }             \r
+         \r
+         fHistProtonPIDBb->Fill(trackP->GetInnerParam()->GetP(), trackP->GetTPCsignal());\r
+         \r
+         posProt.SetXYZM(trackP->Px(),trackP->Py(),trackP->Pz(),cProtonMass);\r
+\r
+         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+         //Pion Track loop!!!!!!!!!!!!!!!!!!!!!\r
+         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+         for (Int_t iTracksN = iTracksP+1; iTracksN < fESD->GetNumberOfTracks(); iTracksN++) {\r
+           AliESDtrack* trackN = dynamic_cast<AliESDtrack*> (fESD->GetTrack(iTracksN));\r
+\r
+           if (iTracksN==fV0MIs->GetPindex())continue;\r
+           if (iTracksN==fV0MIs->GetNindex())continue;\r
+           if (trackN->GetSign()>0) continue;\r
+         \r
+           if (!fEsdTrackCuts->AcceptTrack(trackN)) continue;\r
+           if (!fESDtrackCutsV0->AcceptTrack(trackN)) continue;\r
+
+           Double_t bz = fESD->GetMagneticField();
+          
            Double_t xthiss(0.0);
            Double_t xpp(0.0);
            Double_t dca = trackN->GetDCA(trackP,bz,xthiss,xpp);
-
-           if (decayVertex1) delete decayVertex1;
-           h1.SetXYZ(-dd1[0],-dd1[1],-dd1[2]);
-
-           //      if (dca>1) continue;
-           if (dca>0.1) continue;
-
-           fourSum=threeSum+posProt;
-
-           posProt1.SetXYZM(trackP->Px(),trackP->Py(),trackP->Pz(),cProtonMass);
-           negPio1.SetXYZM(trackN->Px(),trackN->Py(),trackN->Pz(),cPionMass);
-           hDibaryon=lambdaH+posProt1+negPio1;
-           Double_t hPointingAngle = hDibaryon.Angle(h);
-           Double_t pointingAngleH = hDibaryon.Angle(h1);
-           Double_t decayAngleH = h.Angle(h1);
-           TVector3 vecDist(dd[0]-dd1[0],dd[1]-dd1[1],dd[2]-dd1[2]);
-           fHistMassLambdaPPi->Fill(hDibaryon.M());
-           fHistHPointingAngle->Fill(pointingAngleH);
-
-            fHistMassHcentMult->Fill(hDibaryon.M(),triggertype,refMultTpc);
-
-           Double_t rapidity = hDibaryon.Rapidity();
-           if(rapidity > 1.0 || rapidity < -1.0) continue;
-
-           Double_t vec[16]={hDibaryon.M(), lInvMassLambda, pointingAngleH, alfa, qt, lPtLambda, hDibaryon.Pt(), posPionKF.GetDistanceFromVertex(primVtx), protonKF.GetDistanceFromVertex(primVtx), dca, protonKF.GetDistanceFromVertex(posPionKF), TMath::Cos(pointingAngleH), centrPerc, refMultTpc, mcStatus};
-            fHistNdim->Fill(vec);
-
-           fHistRap->Fill(rapidity);
-           //if (pointingAngleH > 0.1) continue;
-           if (pointingAngleH > 0.05) continue;
-
-           ///////////////////////////
-           //MC part for Associated H
-           ///////////////////////////
-
-           if (HasMC() && isCorrectlyAssociatedLambda) {
-             Int_t labelP = trackP->GetLabel();
-             TParticle *tparticleDaughter = stack->Particle(TMath::Abs(labelP));
-             Int_t labelMother = tparticleDaughter->GetFirstMother();
-             TParticle *tparticleMother = stack->Particle(TMath::Abs(labelMother));
-             
-             Int_t labelProton = trackP->GetLabel();
-             Int_t labelPion = trackN->GetLabel();
-             
-             //H-Dibaryon
-             if(tparticleMother->GetPdgCode() == pdgHDibaryon && labelAssociatedH==labelMother){ //check mother PDG
-               Int_t labelFirstDaughter  = tparticleMother->GetDaughter(0);
-               Int_t labelThirdDaughter  = tparticleMother->GetDaughter(1);
-               Int_t labelSecondDaughter = labelFirstDaughter +1;
-
-               TParticle *tparticleSecondDaughter = stack->Particle(TMath::Abs(labelSecondDaughter));
-               TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));
-               
-               TLorentzVector ppi;
-               TLorentzVector lpi;
-               TLorentzVector lP;
-               
-               ppi=posProt+negPio;
-               lpi=lambdaH+negPio;
-               lP=lambdaH+posProt;
-
-               if((tparticleThirdDaughter->GetPdgCode() == pdgPionMinus && labelPion==labelThirdDaughter)&&(tparticleSecondDaughter->GetPdgCode() == pdgProton||tparticleSecondDaughter->GetPdgCode() == pdgPionMinus) && labelProton==labelSecondDaughter) fHistMassPpi->Fill(ppi.M());
-               
-               if(tparticleThirdDaughter->GetPdgCode() == pdgPionMinus && labelPion==labelThirdDaughter) fHistMassLpi->Fill(lpi.M());
-               
-               if(tparticleSecondDaughter->GetPdgCode() == pdgProton && labelProton==labelSecondDaughter) fHistMassLP->Fill(lP.M());
-               
-               if(tparticleSecondDaughter->GetPdgCode() == pdgProton && labelProton==labelSecondDaughter){//check second daughter PDG
-                 if(tparticleThirdDaughter->GetPdgCode() == pdgPionMinus && labelPion==labelThirdDaughter){//check second daughter PDG
-
-                   fHistHDibaryonInvaMassAso->Fill(hDibaryon.M()); 
-                   
-                   Double_t distance01=vecDist.Mag();
-                   fHistMCdcaPvtxDvtx->Fill(decayLengthH);
-                   fHistMCdcaPvtxLvtx->Fill(decayLength);
-                   fHistMCdcaDvtxLvtx->Fill(distance01);
-                   fHistMCangleLH->Fill(hPointingAngle);
-                   fHistMCdecayAngle->Fill(decayAngleH);
-                   fHistMCpointingAngle->Fill(pointingAngleH);
-                   fHistMCap->Fill(alfa,qt);
-
-                   fHistHilf1->Fill(posPionKF.GetDistanceFromVertex(primVtx));
-                   fHistHilf2->Fill(protonKF.GetDistanceFromVertex(primVtx));
-                   fHistHilf3->Fill(protonKF.GetDistanceFromVertex(posPionKF));
-                   fHistHilf6->Fill(dca);
-                   fHistPtvsYAso->Fill(hDibaryon.Pt(),hDibaryon.Rapidity());
-                   fHistPtvsEtaAso->Fill(hDibaryon.Pt(),hDibaryon.Eta());
-                   mcStatus=1;
-                 }//end check for third daughter PDG
-               }//end check second daughter PDG
-             }//end H-Dibaryon
-           }//end MC
-           
-           //      cout<<"Trigger: "<<triggertype<<endl;
-           fHistMassH->Fill(hDibaryon.M());
-           fHistMassHcentMult->Fill(hDibaryon.M(),triggertype,refMultTpc);
-           ppK=lambdaH+posProt;
-           fHistMassLambdaP->Fill(ppK.M());
-
-           //  fHistNdim = new THnSparseF("fHistNdim","THnS;InvMass, InvMassLambda, pointingAngle, armPoAlpha, armPoQt, pTL, pTH, d0p, d0n, dcaHd, dca, decayL, cosPA, centr, multi, mcinf;InvMassH", 16,binsD01,xminD01,xmaxD01);
-
-           //      Double_t vec[16]={hDibaryon.M(), lInvMassLambda, pointingAngleH, alfa, qt, lPtLambda, hDibaryon.Pt(), posPionKF.GetDistanceFromVertex(primVtx), protonKF.GetDistanceFromVertex(primVtx), dca, protonKF.GetDistanceFromVertex(posPionKF), TMath::Cos(pointingAngleH), centrPerc, refMultTpc, mcStatus};
-           //      fHistNdim->Fill(vec);
-
-         }
-       }
-      }
-    }    
-  }
-  
-  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  //Pure MC Part!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-  // Monte Carlo for genenerated particles
-  if (HasMC()) //MC loop  
-    {
-
-      Int_t stackN = 0;
-
-      Double_t momentumPionGen[3]={0,0,0};
-      Double_t momentumNucleonGen[3]={0,0,0};
-      Double_t momentumLambdaGen[3]={0,0,0};
-
-      Double_t energyPionGen = 0;
-      Double_t energyNucleonGen = 0;
-      Double_t energyLambdaGen = 0;
-
-      Double_t transversMomentumMotherGen = 0;
-      Double_t longitudinalMomentumMotherGen = 0;
-      Double_t totalEnergyMotherGen = 0;
-      
-      Double_t rapidityGen = 2;
-
-      for(stackN = 0; stackN < stack->GetNtrack(); stackN++) //loop over stack
-       {
-
-         TParticle *tparticleMother = stack->Particle(stackN);
-
-         if(tparticleMother->GetPdgCode() == pdgLambda) fHistCount->Fill(16); 
-
-         //H-Dibaryon
-         if(tparticleMother->GetPdgCode() == pdgHDibaryon) //check mother PDG
-           {
-             Int_t labelFirstDaughter  = tparticleMother->GetDaughter(0);
-             Int_t labelThirdDaughter  = tparticleMother->GetDaughter(1);
-             Int_t labelSecondDaughter = labelFirstDaughter +1;
-
-             TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));
-             TParticle *tparticleSecondDaughter = stack->Particle(TMath::Abs(labelSecondDaughter));
-             TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));
-            
-             if(tparticleFirstDaughter->GetPdgCode() == pdgLambda) //check first daughter PDG
-               {
-                 if(tparticleSecondDaughter->GetPdgCode() == pdgProton)//check second daughter PDG
-                   {
-                     if(tparticleThirdDaughter->GetPdgCode() == pdgPionMinus)//check second daughter PDG
-                       {                                     
-                         momentumLambdaGen[0] = tparticleFirstDaughter->Px();
-                         momentumLambdaGen[1] = tparticleFirstDaughter->Py();
-                         momentumLambdaGen[2] = tparticleFirstDaughter->Pz();
-               
-                         momentumNucleonGen[0] = tparticleSecondDaughter->Px();
-                         momentumNucleonGen[1] = tparticleSecondDaughter->Py();
-                         momentumNucleonGen[2] = tparticleSecondDaughter->Pz();
-
-                         momentumPionGen[0] = tparticleThirdDaughter->Px();
-                         momentumPionGen[1] = tparticleThirdDaughter->Py();
-                         momentumPionGen[2] = tparticleThirdDaughter->Pz();
-
-                         TLorentzVector lorentzVectorLambda;
-                         TLorentzVector lorentzVectorProton;
-                         TLorentzVector lorentzVectorPion;
-                         TLorentzVector lorentzVectorHDibaryon;
-                         
-                         lorentzVectorLambda.SetXYZM(momentumLambdaGen[0],momentumLambdaGen[1],momentumLambdaGen[2],1.115);
-                         lorentzVectorProton.SetXYZM(momentumNucleonGen[0],momentumNucleonGen[1],momentumNucleonGen[2],protonMass);
-                         lorentzVectorPion.SetXYZM(momentumPionGen[0],momentumPionGen[1],momentumPionGen[2],pionMass);
-                         
-                         lorentzVectorHDibaryon = lorentzVectorLambda + lorentzVectorProton + lorentzVectorPion;
-                         rapidityGen=lorentzVectorHDibaryon.Rapidity();
-                         transversMomentumMotherGen = lorentzVectorHDibaryon.Pt();
-                         longitudinalMomentumMotherGen = lorentzVectorHDibaryon.Pz();
-                         totalEnergyMotherGen = lorentzVectorHDibaryon.Energy();
-
-                         if(rapidityGen > 1.0 || rapidityGen < -1 ) continue;
-                         //lorentzVectorLambda
-                         fHistHDibaryonInvaMassGen->Fill(lorentzVectorHDibaryon.M()); 
-                         if (lorentzVectorLambda.Rapidity()  > 1.0 || lorentzVectorLambda.Rapidity() < -1) continue;
-                         if (lorentzVectorProton.Rapidity()  > 1.0 ||      lorentzVectorProton.Rapidity() < -1) continue;
-
-                         if (lorentzVectorPion.Rapidity()  > 1.0 ||  lorentzVectorPion.Rapidity() < -1) continue;
-                         fHistHDibaryonInvaMassGenRes->Fill(lorentzVectorHDibaryon.M());
-                         fHistPtvsEtaGen->Fill(lorentzVectorHDibaryon.Pt(),lorentzVectorHDibaryon.Eta());
-                         fHistPtvsYGen->Fill(lorentzVectorHDibaryon.Pt(),lorentzVectorHDibaryon.Rapidity());
-                         fHistPtvsEtaGen->Fill(lorentzVectorHDibaryon.Pt(),lorentzVectorHDibaryon.Eta());
-                         fHistCount->Fill(11);
-                       }//end of check third daughter PDG
-                   }//end of check second daughter PDG
-               }//end of check first daughter PDG
-           }//end of H-Dibaryon
-
-         //Anti-H-Dibaryon
-         if(tparticleMother->GetPdgCode() == pdgAntiHDibaryon) //check mother PDG
-           {
-             Int_t labelFirstDaughter  = tparticleMother->GetDaughter(0);
-             Int_t labelThirdDaughter  = tparticleMother->GetDaughter(1);
-             Int_t labelSecondDaughter = labelFirstDaughter +1;
-
-             TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));
-             TParticle *tparticleSecondDaughter = stack->Particle(TMath::Abs(labelSecondDaughter));
-             TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));
-
-             if(tparticleFirstDaughter->GetPdgCode() == pdgAntiLambda) //check first daughter PDG
-               {
-                 if(tparticleSecondDaughter->GetPdgCode() == pdgAntiProton)//check second daughter PDG
-                   {
-                     if(tparticleThirdDaughter->GetPdgCode() == pdgPionPlus)//check second daughter PDG
-                       {                
-                         momentumLambdaGen[0] = tparticleFirstDaughter->Px();
-                         momentumLambdaGen[1] = tparticleFirstDaughter->Py();
-                         momentumLambdaGen[2] = tparticleFirstDaughter->Pz();
-               
-                         momentumNucleonGen[0] = tparticleSecondDaughter->Px();
-                         momentumNucleonGen[1] = tparticleSecondDaughter->Py();
-                         momentumNucleonGen[2] = tparticleSecondDaughter->Pz();
-
-                         momentumPionGen[0] = tparticleThirdDaughter->Px();
-                         momentumPionGen[1] = tparticleThirdDaughter->Py();
-                         momentumPionGen[2] = tparticleThirdDaughter->Pz();
-                         
-                         energyLambdaGen  = tparticleFirstDaughter->Energy();
-                         energyNucleonGen = tparticleSecondDaughter->Energy();
-                         energyPionGen    = tparticleThirdDaughter->Energy();
-                          
-                         TLorentzVector lorentzVectorLambda;
-                         TLorentzVector lorentzVectorProton;
-                         TLorentzVector lorentzVectorPion;
-                         TLorentzVector lorentzVectorHDibaryon;
-                         
-                         lorentzVectorLambda.SetXYZM(momentumLambdaGen[0],momentumLambdaGen[1],momentumLambdaGen[2],1.115);
-                         lorentzVectorProton.SetXYZM(momentumNucleonGen[0],momentumNucleonGen[1],momentumNucleonGen[2],protonMass);
-                         lorentzVectorPion.SetXYZM(momentumPionGen[0],momentumPionGen[1],momentumPionGen[2],pionMass);
-                         
-                         lorentzVectorHDibaryon = lorentzVectorLambda + lorentzVectorProton + lorentzVectorPion;
-
-                         rapidityGen=lorentzVectorHDibaryon.Rapidity();
-                         if(rapidityGen > 1.0 || rapidityGen < -1 ) continue;
-                         fHistAntiHDibaryonInvaMassGen->Fill(lorentzVectorHDibaryon.M()); 
-                       }//end of check third daughter PDG
-                   }//end of check second daughter PDG
-               }//end of check first daughter PDG
-           }//end of Anti-H-Dibaryon
-       }      
-    }//end MC
-
-  // Post output data.
-  PostData(1,fHistList);
-  //PostData(0,fHistList);
-
-  if (listCrossV0) delete listCrossV0;
-  if (esdVer1) delete esdVer1;
-  if (vertexer) delete vertexer;
-  if (vertexer1) delete vertexer1;
-  if (trkArray) delete trkArray;
-  if (trkArray1) delete trkArray1;
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskHdibaryonLPpi::Terminate(Option_t *) 
-{
-  // Draw result to the screen
-  // Called once at the end of the query
-
-}
-
+           if (dca>0.5) continue;
+
+           negPi.SetXYZM(mn[0],mn[1],mn[2],cPionMass);\r
+           posP.SetXYZM(mp[0],mp[1],mp[2],cProtonMass);\r
+           negPio.SetXYZM(trackN->Px(),trackN->Py(),trackN->Pz(),cPionMass);\r
+             \r
+           threeSum=negPi+posP+negPio;\r
+           lInvMassLambdaPi=threeSum.M();         \r
+           \r
+           fHistDC->Fill(decayLength*lInvMassLambda/lPLambda);\r
+           \r
+           AliKFParticle posPionKF( *(trackN) ,-211);\r
+           \r
+           if (!trackN->GetInnerParam()) continue;\r
+           if (HasMC()) {\r
+             pionK=0.7;\r
+           }\r
+           \r
+         //  if (!HasMC()){\r
+             if (TMath::Abs(fPIDtpcESD->NumberOfSigmasTPC(trackN, AliPID::kPion)) > 3) continue;\r
+         //  }\r
+           fHistPionPIDBb->Fill(trackN->GetInnerParam()->GetP(), trackN->GetTPCsignal());\r
+\r
+           trkArray1->AddAt(trackP,0);\r
+           trkArray1->AddAt(trackN,1);\r
+           \r
+           vertexer1->SetVtxStart(esdVer1);\r
+           AliESDVertex *decayVertex1 = (AliESDVertex*)vertexer1->VertexForSelectedESDTracks(trkArray1);\r
+           \r
+           dd1[0]=fESD->GetPrimaryVertexSPD()->GetX()-decayVertex1->GetX();\r
+           dd1[1]=fESD->GetPrimaryVertexSPD()->GetY()-decayVertex1->GetY();\r
+           dd1[2]=fESD->GetPrimaryVertexSPD()->GetZ()-decayVertex1->GetZ();\r
+           \r
+           decayLengthH=sqrt(dd1[0]*dd1[0]+dd1[1]*dd1[1]+dd1[2]*dd1[2]);\r
+\r
+             //            Double_t bz = fESD->GetMagneticField();\r
+           \r
+           trackP->PropagateToDCA(decayVertex1, bz, 10);\r
+           trackN->PropagateToDCA(decayVertex1, bz, 10);\r
+\r
+             //            Double_t xthiss(0.0);\r
+             //            Double_t xpp(0.0);\r
+             //            Double_t dca = trackN->GetDCA(trackP,bz,xthiss,xpp);\r
+\r
+           if (decayVertex1) delete decayVertex1;\r
+           h1.SetXYZ(-dd1[0],-dd1[1],-dd1[2]);\r
+\r
+           //      if (dca>1) continue;\r
+             //            if (dca>0.1) continue;\r
+\r
+           fourSum=threeSum+posProt;\r
+\r
+           posProt1.SetXYZM(trackP->Px(),trackP->Py(),trackP->Pz(),cProtonMass);\r
+           negPio1.SetXYZM(trackN->Px(),trackN->Py(),trackN->Pz(),cPionMass);\r
+           hDibaryon=lambdaH+posProt1+negPio1;\r
+           Double_t hPointingAngle = hDibaryon.Angle(h);\r
+           Double_t pointingAngleH = hDibaryon.Angle(h1);\r
+           Double_t decayAngleH = h.Angle(h1);\r
+           TVector3 vecDist(dd[0]-dd1[0],dd[1]-dd1[1],dd[2]-dd1[2]);\r
+           fHistMassLambdaPPi->Fill(hDibaryon.M());\r
+           fHistHPointingAngle->Fill(pointingAngleH);\r
+\r
+            fHistMassHcentMult->Fill(hDibaryon.M(),triggertype,refMultTpc);\r
+\r
+           Double_t rapidity = hDibaryon.Rapidity();\r
+           if(rapidity > 1.0 || rapidity < -1.0) continue;\r
+\r
+             //Double_t vec[16]={hDibaryon.M(), lInvMassLambda, pointingAngleH, alfa, qt, lPtLambda, hDibaryon.Pt(), posPionKF.GetDistanceFromVertex(primVtx), protonKF.GetDistanceFromVertex(primVtx), dca, protonKF.GetDistanceFromVertex(posPionKF), TMath::Cos(pointingAngleH), centrPerc, refMultTpc, mcStatus};\r
+             //fHistNdim->Fill(vec);\r
+\r
+           fHistRap->Fill(rapidity);\r
+           //if (pointingAngleH > 0.1) continue;\r
+           if (pointingAngleH > 0.05) continue;\r
+\r
+           ///////////////////////////\r
+           //MC part for Associated H\r
+           ///////////////////////////\r
+\r
+           if (HasMC() && isCorrectlyAssociatedLambda) {\r
+             Int_t labelP = trackP->GetLabel();\r
+             TParticle *tparticleDaughter = stack->Particle(TMath::Abs(labelP));\r
+             Int_t labelMother = tparticleDaughter->GetFirstMother();\r
+             TParticle *tparticleMother = stack->Particle(TMath::Abs(labelMother));\r
+             \r
+             Int_t labelProton = trackP->GetLabel();\r
+             Int_t labelPion = trackN->GetLabel();\r
+             \r
+             //H-Dibaryon\r
+             if(tparticleMother->GetPdgCode() == pdgHDibaryon && labelAssociatedH==labelMother){ //check mother PDG\r
+               Int_t labelFirstDaughter  = tparticleMother->GetDaughter(0);\r
+               Int_t labelThirdDaughter  = tparticleMother->GetDaughter(1);\r
+               Int_t labelSecondDaughter = labelFirstDaughter +1;\r
+\r
+               TParticle *tparticleSecondDaughter = stack->Particle(TMath::Abs(labelSecondDaughter));\r
+               TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));\r
+               \r
+               TLorentzVector ppi;\r
+               TLorentzVector lpi;\r
+               TLorentzVector lP;\r
+               \r
+               ppi=posProt+negPio;\r
+               lpi=lambdaH+negPio;\r
+               lP=lambdaH+posProt;\r
+\r
+               if((tparticleThirdDaughter->GetPdgCode() == pdgPionMinus && labelPion==labelThirdDaughter)&&(tparticleSecondDaughter->GetPdgCode() == pdgProton||tparticleSecondDaughter->GetPdgCode() == pdgPionMinus) && labelProton==labelSecondDaughter) fHistMassPpi->Fill(ppi.M());\r
+               \r
+               if(tparticleThirdDaughter->GetPdgCode() == pdgPionMinus && labelPion==labelThirdDaughter) fHistMassLpi->Fill(lpi.M());\r
+               \r
+               if(tparticleSecondDaughter->GetPdgCode() == pdgProton && labelProton==labelSecondDaughter) fHistMassLP->Fill(lP.M());\r
+               \r
+               if(tparticleSecondDaughter->GetPdgCode() == pdgProton && labelProton==labelSecondDaughter){//check second daughter PDG\r
+                 if(tparticleThirdDaughter->GetPdgCode() == pdgPionMinus && labelPion==labelThirdDaughter){//check second daughter PDG\r
+\r
+                   fHistHDibaryonInvaMassAso->Fill(hDibaryon.M()); \r
+                   \r
+                   Double_t distance01=vecDist.Mag();\r
+                   fHistMCdcaPvtxDvtx->Fill(decayLengthH);\r
+                   fHistMCdcaPvtxLvtx->Fill(decayLength);\r
+                   fHistMCdcaDvtxLvtx->Fill(distance01);\r
+                   fHistMCangleLH->Fill(hPointingAngle);\r
+                   fHistMCdecayAngle->Fill(decayAngleH);\r
+                   fHistMCpointingAngle->Fill(pointingAngleH);\r
+                   fHistMCap->Fill(alfa,qt);\r
+\r
+                   fHistHilf1->Fill(posPionKF.GetDistanceFromVertex(primVtx));\r
+                   fHistHilf2->Fill(protonKF.GetDistanceFromVertex(primVtx));\r
+                   fHistHilf3->Fill(protonKF.GetDistanceFromVertex(posPionKF));\r
+                   fHistHilf6->Fill(dca);\r
+                   fHistPtvsYAso->Fill(hDibaryon.Pt(),hDibaryon.Rapidity());\r
+                   fHistPtvsEtaAso->Fill(hDibaryon.Pt(),hDibaryon.Eta());\r
+                   mcStatus=1;\r
+                 }//end check for third daughter PDG\r
+               }//end check second daughter PDG\r
+             }//end H-Dibaryon\r
+           }//end MC\r
+           \r
+           //      cout<<"Trigger: "<<triggertype<<endl;\r
+           fHistMassH->Fill(hDibaryon.M());\r
+           fHistMassHcentMult->Fill(hDibaryon.M(),triggertype,refMultTpc);\r
+           ppK=lambdaH+posProt;\r
+           fHistMassLambdaP->Fill(ppK.M());\r
+\r
+             //fHistNdim = new THnSparseF("fHistNdim","THnS;InvMass, InvMassLambda, pointingAngle, armPoAlpha, armPoQt, pTL, pTH, d0p, d0n, dcaHd, dca, decayL, cosPA, centr, multi, mcinf;InvMassH", 16,binsD01,xminD01,xmaxD01);\r
+\r
+                   Double_t vec[16]={hDibaryon.M(), lInvMassLambda, pointingAngleH, alfa, qt, lPtLambda, hDibaryon.Pt(), posPionKF.GetDistanceFromVertex(primVtx), protonKF.GetDistanceFromVertex(primVtx), dca, protonKF.GetDistanceFromVertex(posPionKF), TMath::Cos(pointingAngleH), centrPerc, refMultTpc, mcStatus};\r
+                     //                    fHistNdim->Fill(vec);\r
+\r
+         }\r
+       }\r
+      }\r
+    }    \r
+  }\r
+  \r
+  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+  //Pure MC Part!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+\r
+  // Monte Carlo for genenerated particles\r
+  if (HasMC()) //MC loop  \r
+    {\r
+\r
+      Int_t stackN = 0;\r
+\r
+      Double_t momentumPionGen[3]={0,0,0};\r
+      Double_t momentumNucleonGen[3]={0,0,0};\r
+      Double_t momentumLambdaGen[3]={0,0,0};\r
+\r
+      Double_t energyPionGen = 0;\r
+      Double_t energyNucleonGen = 0;\r
+      Double_t energyLambdaGen = 0;\r
+\r
+      Double_t transversMomentumMotherGen = 0;\r
+      Double_t longitudinalMomentumMotherGen = 0;\r
+      Double_t totalEnergyMotherGen = 0;\r
+      \r
+      Double_t rapidityGen = 2;\r
+\r
+      for(stackN = 0; stackN < stack->GetNtrack(); stackN++) //loop over stack\r
+       {\r
+\r
+         TParticle *tparticleMother = stack->Particle(stackN);\r
+\r
+         if(tparticleMother->GetPdgCode() == pdgLambda) fHistCount->Fill(16); \r
+\r
+         //H-Dibaryon\r
+         if(tparticleMother->GetPdgCode() == pdgHDibaryon) //check mother PDG\r
+           {\r
+             Int_t labelFirstDaughter  = tparticleMother->GetDaughter(0);\r
+             Int_t labelThirdDaughter  = tparticleMother->GetDaughter(1);\r
+             Int_t labelSecondDaughter = labelFirstDaughter +1;\r
+\r
+             TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));\r
+             TParticle *tparticleSecondDaughter = stack->Particle(TMath::Abs(labelSecondDaughter));\r
+             TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));\r
+            \r
+             if(tparticleFirstDaughter->GetPdgCode() == pdgLambda) //check first daughter PDG\r
+               {\r
+                 if(tparticleSecondDaughter->GetPdgCode() == pdgProton)//check second daughter PDG\r
+                   {\r
+                     if(tparticleThirdDaughter->GetPdgCode() == pdgPionMinus)//check second daughter PDG\r
+                       {                                     \r
+                         momentumLambdaGen[0] = tparticleFirstDaughter->Px();\r
+                         momentumLambdaGen[1] = tparticleFirstDaughter->Py();\r
+                         momentumLambdaGen[2] = tparticleFirstDaughter->Pz();\r
+               \r
+                         momentumNucleonGen[0] = tparticleSecondDaughter->Px();\r
+                         momentumNucleonGen[1] = tparticleSecondDaughter->Py();\r
+                         momentumNucleonGen[2] = tparticleSecondDaughter->Pz();\r
+\r
+                         momentumPionGen[0] = tparticleThirdDaughter->Px();\r
+                         momentumPionGen[1] = tparticleThirdDaughter->Py();\r
+                         momentumPionGen[2] = tparticleThirdDaughter->Pz();\r
+\r
+                         TLorentzVector lorentzVectorLambda;\r
+                         TLorentzVector lorentzVectorProton;\r
+                         TLorentzVector lorentzVectorPion;\r
+                         TLorentzVector lorentzVectorHDibaryon;\r
+                         \r
+                         lorentzVectorLambda.SetXYZM(momentumLambdaGen[0],momentumLambdaGen[1],momentumLambdaGen[2],1.115);\r
+                         lorentzVectorProton.SetXYZM(momentumNucleonGen[0],momentumNucleonGen[1],momentumNucleonGen[2],protonMass);\r
+                         lorentzVectorPion.SetXYZM(momentumPionGen[0],momentumPionGen[1],momentumPionGen[2],pionMass);\r
+                         \r
+                         lorentzVectorHDibaryon = lorentzVectorLambda + lorentzVectorProton + lorentzVectorPion;\r
+                         rapidityGen=lorentzVectorHDibaryon.Rapidity();\r
+                         transversMomentumMotherGen = lorentzVectorHDibaryon.Pt();\r
+                         longitudinalMomentumMotherGen = lorentzVectorHDibaryon.Pz();\r
+                         totalEnergyMotherGen = lorentzVectorHDibaryon.Energy();\r
+\r
+                         if(rapidityGen > 1.0 || rapidityGen < -1 ) continue;\r
+                         //lorentzVectorLambda\r
+                         fHistHDibaryonInvaMassGen->Fill(lorentzVectorHDibaryon.M()); \r
+                         if (lorentzVectorLambda.Rapidity()  > 1.0 || lorentzVectorLambda.Rapidity() < -1) continue;\r
+                         if (lorentzVectorProton.Rapidity()  > 1.0 ||      lorentzVectorProton.Rapidity() < -1) continue;\r
+\r
+                         if (lorentzVectorPion.Rapidity()  > 1.0 ||  lorentzVectorPion.Rapidity() < -1) continue;\r
+                         fHistHDibaryonInvaMassGenRes->Fill(lorentzVectorHDibaryon.M());\r
+                         fHistPtvsEtaGen->Fill(lorentzVectorHDibaryon.Pt(),lorentzVectorHDibaryon.Eta());\r
+                         fHistPtvsYGen->Fill(lorentzVectorHDibaryon.Pt(),lorentzVectorHDibaryon.Rapidity());\r
+                         fHistPtvsEtaGen->Fill(lorentzVectorHDibaryon.Pt(),lorentzVectorHDibaryon.Eta());\r
+                         fHistCount->Fill(11);\r
+                       }//end of check third daughter PDG\r
+                   }//end of check second daughter PDG\r
+               }//end of check first daughter PDG\r
+           }//end of H-Dibaryon\r
+\r
+         //Anti-H-Dibaryon\r
+         if(tparticleMother->GetPdgCode() == pdgAntiHDibaryon) //check mother PDG\r
+           {\r
+             Int_t labelFirstDaughter  = tparticleMother->GetDaughter(0);\r
+             Int_t labelThirdDaughter  = tparticleMother->GetDaughter(1);\r
+             Int_t labelSecondDaughter = labelFirstDaughter +1;\r
+\r
+             TParticle *tparticleFirstDaughter  = stack->Particle(TMath::Abs(labelFirstDaughter));\r
+             TParticle *tparticleSecondDaughter = stack->Particle(TMath::Abs(labelSecondDaughter));\r
+             TParticle *tparticleThirdDaughter  = stack->Particle(TMath::Abs(labelThirdDaughter));\r
+\r
+             if(tparticleFirstDaughter->GetPdgCode() == pdgAntiLambda) //check first daughter PDG\r
+               {\r
+                 if(tparticleSecondDaughter->GetPdgCode() == pdgAntiProton)//check second daughter PDG\r
+                   {\r
+                     if(tparticleThirdDaughter->GetPdgCode() == pdgPionPlus)//check second daughter PDG\r
+                       {                \r
+                         momentumLambdaGen[0] = tparticleFirstDaughter->Px();\r
+                         momentumLambdaGen[1] = tparticleFirstDaughter->Py();\r
+                         momentumLambdaGen[2] = tparticleFirstDaughter->Pz();\r
+               \r
+                         momentumNucleonGen[0] = tparticleSecondDaughter->Px();\r
+                         momentumNucleonGen[1] = tparticleSecondDaughter->Py();\r
+                         momentumNucleonGen[2] = tparticleSecondDaughter->Pz();\r
+\r
+                         momentumPionGen[0] = tparticleThirdDaughter->Px();\r
+                         momentumPionGen[1] = tparticleThirdDaughter->Py();\r
+                         momentumPionGen[2] = tparticleThirdDaughter->Pz();\r
+                         \r
+                         energyLambdaGen  = tparticleFirstDaughter->Energy();\r
+                         energyNucleonGen = tparticleSecondDaughter->Energy();\r
+                         energyPionGen    = tparticleThirdDaughter->Energy();\r
+                          \r
+                         TLorentzVector lorentzVectorLambda;\r
+                         TLorentzVector lorentzVectorProton;\r
+                         TLorentzVector lorentzVectorPion;\r
+                         TLorentzVector lorentzVectorHDibaryon;\r
+                         \r
+                         lorentzVectorLambda.SetXYZM(momentumLambdaGen[0],momentumLambdaGen[1],momentumLambdaGen[2],1.115);\r
+                         lorentzVectorProton.SetXYZM(momentumNucleonGen[0],momentumNucleonGen[1],momentumNucleonGen[2],protonMass);\r
+                         lorentzVectorPion.SetXYZM(momentumPionGen[0],momentumPionGen[1],momentumPionGen[2],pionMass);\r
+                         \r
+                         lorentzVectorHDibaryon = lorentzVectorLambda + lorentzVectorProton + lorentzVectorPion;\r
+\r
+                         rapidityGen=lorentzVectorHDibaryon.Rapidity();\r
+                         if(rapidityGen > 1.0 || rapidityGen < -1 ) continue;\r
+                         fHistAntiHDibaryonInvaMassGen->Fill(lorentzVectorHDibaryon.M()); \r
+                       }//end of check third daughter PDG\r
+                   }//end of check second daughter PDG\r
+               }//end of check first daughter PDG\r
+           }//end of Anti-H-Dibaryon\r
+       }      \r
+    }//end MC\r
+\r
+  // Post output data.\r
+  PostData(1,fHistList);\r
+  //PostData(0,fHistList);\r
+\r
+  if (listCrossV0) delete listCrossV0;\r
+  if (esdVer1) delete esdVer1;\r
+  if (vertexer) delete vertexer;\r
+  if (vertexer1) delete vertexer1;\r
+  if (trkArray) delete trkArray;\r
+  if (trkArray1) delete trkArray1;\r
+}\r
+\r
+//________________________________________________________________________\r
+void AliAnalysisTaskHdibaryonLPpi::Terminate(Option_t *) \r
+{\r
+  // Draw result to the screen\r
+  // Called once at the end of the query\r
+\r
+}\r
+\r
index 2104344..54c527d 100644 (file)
@@ -154,7 +154,7 @@ private:
   
   TH1F        *fHistCount; //Counting of events and different decay parameters
   
-  AliESDpid   *fPIDtpcESD; //PID
+  AliPIDResponse *fPIDtpcESD;     //! PID response object 
   TH1F        *fHistTriggerStat;                         //! Trigger statistics
   TH1F        *fHistTriggerStatAfterEventSelection;      //! Trigger statistics
   TH3F        *fHistMassHcentMult; // Inv. mass vs. centrality vs. multiplicity