Major update of cuts classes; now they are used in AliAnalysisVertexingHF and stored...
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Apr 2010 17:24:47 +0000 (17:24 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Apr 2010 17:24:47 +0000 (17:24 +0000)
23 files changed:
PWG3/vertexingHF/AddTaskVertexingHF.C
PWG3/vertexingHF/AliAODRecoDecayHF.cxx
PWG3/vertexingHF/AliAODRecoDecayHF.h
PWG3/vertexingHF/AliAnalysisTaskSEVertexingHF.cxx
PWG3/vertexingHF/AliAnalysisTaskSEVertexingHF.h
PWG3/vertexingHF/AliAnalysisTaskSEVertexingHFTest.C
PWG3/vertexingHF/AliAnalysisVertexingHF.cxx
PWG3/vertexingHF/AliAnalysisVertexingHF.h
PWG3/vertexingHF/AliRDHFCutsD0toKpi.cxx
PWG3/vertexingHF/AliRDHFCutsD0toKpi.h
PWG3/vertexingHF/AliRDHFCutsD0toKpipipi.cxx
PWG3/vertexingHF/AliRDHFCutsD0toKpipipi.h
PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx
PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.h
PWG3/vertexingHF/AliRDHFCutsDstoKKpi.cxx
PWG3/vertexingHF/AliRDHFCutsDstoKKpi.h
PWG3/vertexingHF/AliRDHFCutsJpsitoee.cxx
PWG3/vertexingHF/AliRDHFCutsJpsitoee.h
PWG3/vertexingHF/AliRDHFCutsLctopKpi.cxx
PWG3/vertexingHF/AliRDHFCutsLctopKpi.h
PWG3/vertexingHF/ConfigVertexingHF.C
PWG3/vertexingHF/ConfigVertexingHF_highmult.C
PWG3/vertexingHF/ConfigVertexingHF_pp2009.C

index 80771fb..4ea51b6 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskSEVertexingHF *AddTaskVertexingHF() {
+AliAnalysisTaskSEVertexingHF *AddTaskVertexingHF(const char* fname="AliAOD.VertexingHF.root") {
   //
   // Creates a task for heavy flavour vertexing and adds it to the analysis manager.
   // andrea.dainese@lnl.infn.it
@@ -30,12 +30,16 @@ AliAnalysisTaskSEVertexingHF *AddTaskVertexingHF() {
   // Create the task, add it to the manager and configure it.
   //===========================================================================
   AliAnalysisTaskSEVertexingHF *hfTask = new AliAnalysisTaskSEVertexingHF("vertexing HF");
+  hfTask->SetDeltaAODFileName(fname);
   mgr->AddTask(hfTask);
 
   //
   // Create containers for input/output
+  AliAnalysisDataContainer *coutputListOfCuts = mgr->CreateContainer("ListOfCuts",TList::Class(),AliAnalysisManager::kOutputContainer,hfTask->GetDeltaAODFileName()); //cuts
+
   mgr->ConnectInput(hfTask,0,mgr->GetCommonInputContainer());
   mgr->ConnectOutput(hfTask,0,mgr->GetCommonOutputContainer());
+  mgr->ConnectOutput(hfTask,1,coutputListOfCuts);
 
   return hfTask;
 }
index 51fdbcb..10d12bf 100644 (file)
@@ -35,6 +35,7 @@ AliAODRecoDecayHF::AliAODRecoDecayHF() :
   AliAODRecoDecay(),
   fOwnPrimaryVtx(0x0),
   fEventPrimaryVtx(),
+  fListOfCuts(),
   fd0err(0x0), 
   fProngID(0x0) 
 {
@@ -49,6 +50,7 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t ch
   AliAODRecoDecay(vtx2,nprongs,charge,px,py,pz,d0),
   fOwnPrimaryVtx(0x0),
   fEventPrimaryVtx(),
+  fListOfCuts(),
   fd0err(0x0),
   fProngID(0x0) 
 {
@@ -64,6 +66,7 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t ch
   AliAODRecoDecay(vtx2,nprongs,charge,d0),
   fOwnPrimaryVtx(0x0),
   fEventPrimaryVtx(),
+  fListOfCuts(),
   fd0err(0x0),
   fProngID(0x0) 
 {
@@ -81,6 +84,7 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
   AliAODRecoDecay(0x0,nprongs,charge,px,py,pz,d0),
   fOwnPrimaryVtx(0x0),
   fEventPrimaryVtx(),
+  fListOfCuts(),
   fd0err(0x0),
   fProngID(0x0) 
 {
@@ -99,6 +103,7 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
   AliAODRecoDecay(source),
   fOwnPrimaryVtx(0x0),
   fEventPrimaryVtx(source.fEventPrimaryVtx),
+  fListOfCuts(source.fListOfCuts),
   fd0err(0x0),
   fProngID(0x0)
 {
@@ -127,6 +132,7 @@ AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
   AliAODRecoDecay::operator=(source);
 
   fEventPrimaryVtx = source.fEventPrimaryVtx;
+  fListOfCuts = source.fListOfCuts;
 
   if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
 
index c93254a..49dab5a 100644 (file)
 //***********************************************************
 
 #include <TRef.h>
+#include <TList.h>
 #include "AliAODRecoDecay.h"
 
+class AliRDHFCuts;
 class AliKFParticle;
 
 class AliAODRecoDecayHF : public AliAODRecoDecay {
@@ -83,6 +85,10 @@ class AliAODRecoDecayHF : public AliAODRecoDecay {
   // check if it is like-sign
   Bool_t IsLikeSign() const;
 
+  // list of cuts
+  void SetListOfCutsRef(TObject *obj) {fListOfCuts=obj;}
+  TList *GetListOfCuts() const {return (TList*)(fListOfCuts.GetObject());}
+  AliRDHFCuts *GetCuts(const char* name) const;
 
   // vertexing KF:
   AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
@@ -93,11 +99,11 @@ class AliAODRecoDecayHF : public AliAODRecoDecay {
 
   AliAODVertex *fOwnPrimaryVtx; // primary vertex for this candidate
   TRef          fEventPrimaryVtx; // ref to primary vertex of the event
+  TRef          fListOfCuts;  // ref to the list of analysis cuts
   Double_t     *fd0err;  //[fNProngs] error on prongs rphi impact param [cm]
   UShort_t     *fProngID;  //[fNProngs] track ID of daughters
 
-  ClassDef(AliAODRecoDecayHF,3)  // base class for AOD reconstructed 
-                                 // heavy-flavour decays
+  ClassDef(AliAODRecoDecayHF,4)  // base class for AOD reconstructed heavy-flavour decays
 };
 
 inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id) 
@@ -131,5 +137,16 @@ inline Bool_t AliAODRecoDecayHF::IsLikeSign() const
   return kTRUE;
 }
 
+inline AliRDHFCuts *AliAODRecoDecayHF::GetCuts(const char* name) const
+{ 
+  // returns the analysis cuts
+
+  TList *list = GetListOfCuts();
+  if(!list) return 0;
+
+
+  return (AliRDHFCuts*)list->FindObject(name);
+}
+
 #endif
 
index 90152e1..70aa711 100644 (file)
@@ -24,6 +24,8 @@
 #include <TROOT.h>
 #include <TSystem.h>
 #include <TClonesArray.h>
+#include <TList.h>
+#include <TString.h>
 
 #include "AliVEvent.h"
 #include "AliAODEvent.h"
@@ -40,6 +42,8 @@ ClassImp(AliAnalysisTaskSEVertexingHF)
 AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF():
 AliAnalysisTaskSE(),
 fVHF(0),
+fListOfCuts(0),
+fDeltaAODFileName("AliAOD.VertexingHF.root"),
 fVerticesHFTClArr(0),
 fD0toKpiTClArr(0),
 fJPSItoEleTClArr(0),
@@ -56,6 +60,8 @@ fLikeSign3ProngTClArr(0)
 AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF(const char *name):
 AliAnalysisTaskSE(name),
 fVHF(0),
+fListOfCuts(0),
+fDeltaAODFileName("AliAOD.VertexingHF.root"),
 fVerticesHFTClArr(0),
 fD0toKpiTClArr(0),
 fJPSItoEleTClArr(0),
@@ -65,13 +71,21 @@ fDstarTClArr(0),
 fLikeSign2ProngTClArr(0),
 fLikeSign3ProngTClArr(0)
 {
-  // Default constructor
+  // Standard constructor
+
+  DefineOutput(1,TList::Class()); // analysis cuts
 }
 
 //________________________________________________________________________
 AliAnalysisTaskSEVertexingHF::~AliAnalysisTaskSEVertexingHF()
 {
   // Destructor
+
+  if(fListOfCuts) {
+    delete fListOfCuts;
+    fListOfCuts=NULL;
+  }
+
 }  
 
 //________________________________________________________________________
@@ -89,7 +103,15 @@ void AliAnalysisTaskSEVertexingHF::Init()
 
   fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()");  
   fVHF->PrintStatus();
-  AliAnalysisManager::GetAnalysisManager()->RegisterExtraFile("AliAOD.VertexingHF.root");
+
+
+  // write the objects AliRDHFCuts to a list to store in the output
+
+  fListOfCuts = fVHF->FillListOfCuts();
+
+  PostData(1,fListOfCuts);
+
+  AliAnalysisManager::GetAnalysisManager()->RegisterExtraFile(fDeltaAODFileName.Data());
 
   return;
 }
@@ -106,7 +128,7 @@ void AliAnalysisTaskSEVertexingHF::UserCreateOutputObjects()
     Fatal("UserCreateOutputObjects", "This task needs an AOD handler");
     return;
   }   
-  TString filename = "AliAOD.VertexingHF.root";
+  TString filename = fDeltaAODFileName;
   // When running on standard AOD to produce deltas, IsStandardAOD is never set,
   // If AODEvent is NULL, new branches have to be added to the new file(s) (A.G. 15/01/10)
   if(!IsStandardAOD() && AODEvent()) filename = "";
index 2480027..4d6bb5e 100644 (file)
 // Author: A.Dainese, andrea.dainese@lnl.infn.it
 //*************************************************************************
 
-
 #include <TClonesArray.h>
 
 #include "AliAnalysisTaskSE.h"
 #include "AliAnalysisVertexingHF.h"
 
+class TList;
+class TString;
 
 class AliAnalysisTaskSEVertexingHF : public AliAnalysisTaskSE
 {
@@ -31,6 +32,9 @@ class AliAnalysisTaskSEVertexingHF : public AliAnalysisTaskSE
   virtual void LocalInit() {Init();}
   virtual void UserExec(Option_t *option);
   virtual void Terminate(Option_t *option);
+  void SetDeltaAODFileName(const char* name) {fDeltaAODFileName=name;}
+  const char* GetDeltaAODFileName() const {return fDeltaAODFileName.Data();}
+  AliAnalysisVertexingHF *GetVertexingHF() const {return fVHF;}
   
  private:
 
@@ -38,6 +42,8 @@ class AliAnalysisTaskSEVertexingHF : public AliAnalysisTaskSE
   AliAnalysisTaskSEVertexingHF& operator=(const AliAnalysisTaskSEVertexingHF& source); 
 
   AliAnalysisVertexingHF *fVHF;        // Vertexer heavy flavour
+  TList        *fListOfCuts;           //! List of analysis cuts
+  TString       fDeltaAODFileName;     // Name of output file
   TClonesArray *fVerticesHFTClArr;     // Array of heavy-flavour vertices
   TClonesArray *fD0toKpiTClArr;        // Array of D0->Kpi
   TClonesArray *fJPSItoEleTClArr;      // Array of Jpsi->ee
@@ -47,7 +53,7 @@ class AliAnalysisTaskSEVertexingHF : public AliAnalysisTaskSE
   TClonesArray *fLikeSign2ProngTClArr; // Array of LikeSign2Prong
   TClonesArray *fLikeSign3ProngTClArr; // Array of LikeSign3Prong 
   
-  ClassDef(AliAnalysisTaskSEVertexingHF,4); // AliAnalysisTaskSE for the reconstruction of heavy-flavour decay candidates
+  ClassDef(AliAnalysisTaskSEVertexingHF,5); // AliAnalysisTaskSE for the reconstruction of heavy-flavour decay candidates
 };
 
 #endif
index 35f4993..eb0db8a 100644 (file)
@@ -75,15 +75,16 @@ void AliAnalysisTaskSEVertexingHFTest()
   \r
   // Output \r
   AliAODHandler *aodHandler = new AliAODHandler();\r
+  const char* deltaAODfname="AliAOD.VertexingHF.root";\r
   if(createAOD) {\r
     aodHandler->SetOutputFileName("AliAOD.root");\r
   } else {\r
     aodHandler->SetFillAOD(kFALSE);\r
-    aodHandler->SetOutputFileName("AliAOD.VertexingHF.root");\r
+    aodHandler->SetOutputFileName(deltaAODfname);\r
     aodHandler->SetCreateNonStandardAOD();\r
   }\r
   mgr->SetOutputEventHandler(aodHandler);\r
-  mgr->RegisterExtraFile("AliAOD.VertexingHF.root");  \r
+  mgr->RegisterExtraFile(deltaAODfname);  \r
 \r
   if(!inputAOD && createAOD) {\r
     // MC Truth\r
@@ -115,7 +116,7 @@ void AliAnalysisTaskSEVertexingHFTest()
 \r
   // Vertexing analysis task    \r
   gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/AddTaskVertexingHF.C");\r
-  AliAnalysisTaskSEVertexingHF *hfTask = AddTaskVertexingHF();\r
+  AliAnalysisTaskSEVertexingHF *hfTask = AddTaskVertexingHF(deltaAODfname);\r
   \r
   \r
   //\r
index 790033d..b1ad221 100644 (file)
 //  Contributors: E.Bruna, G.E.Bruno, A.Dainese, C.Di Gliglio,
 //                F.Prino, R.Romita, X.M.Zhang
 //----------------------------------------------------------------------------
+#include <Riostream.h>
 #include <TFile.h>
 #include <TDatabasePDG.h>
 #include <TString.h>
+#include <TList.h>
 #include "AliLog.h"
 #include "AliVEvent.h"
 #include "AliVVertex.h"
@@ -84,6 +86,7 @@ fCutsDstoKKpi(0x0),
 fCutsLctopKpi(0x0),
 fCutsD0toKpipipi(0x0),
 fCutsD0fromDstar(0x0),
+fListOfCuts(0x0),
 fFindVertexForDstar(kTRUE)
 {
   // Default constructor
@@ -123,6 +126,7 @@ fCutsDstoKKpi(source.fCutsDstoKKpi),
 fCutsLctopKpi(source.fCutsLctopKpi),
 fCutsD0toKpipipi(source.fCutsD0toKpipipi),
 fCutsD0fromDstar(source.fCutsD0fromDstar),
+fListOfCuts(source.fListOfCuts),
 fFindVertexForDstar(source.fFindVertexForDstar)
 {
   //
@@ -166,6 +170,7 @@ AliAnalysisVertexingHF &AliAnalysisVertexingHF::operator=(const AliAnalysisVerte
   fCutsLctopKpi = source.fCutsLctopKpi;
   fCutsD0toKpipipi = source.fCutsD0toKpipipi;
   fCutsD0fromDstar = source.fCutsD0fromDstar;
+  fListOfCuts = source.fListOfCuts;
   fFindVertexForDstar = source.fFindVertexForDstar;
 
   for(Int_t i=0; i<9; i++)  fD0toKpiCuts[i]=source.fD0toKpiCuts[i];
@@ -194,6 +199,48 @@ AliAnalysisVertexingHF::~AliAnalysisVertexingHF() {
   if(fAODMap) { delete fAODMap; fAODMap=0; }
 }
 //----------------------------------------------------------------------------
+TList *AliAnalysisVertexingHF::FillListOfCuts() {
+  // Fill list of analysis cuts
+
+  TList *list = new TList();
+  list->SetOwner();
+  list->SetName("ListOfCuts");
+  
+  if(fCutsD0toKpi) {
+    AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi(*fCutsD0toKpi);
+    list->Add(cutsD0toKpi);
+  }
+  if(fCutsJpsitoee) {
+    AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee(*fCutsJpsitoee);
+    list->Add(cutsJpsitoee);
+  }
+  if(fCutsDplustoKpipi) {
+    AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi(*fCutsDplustoKpipi);
+    list->Add(cutsDplustoKpipi);
+  }
+  if(fCutsDstoKKpi) {
+    AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi(*fCutsDstoKKpi);
+    list->Add(cutsDstoKKpi);
+  }
+  if(fCutsLctopKpi) {
+    AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi(*fCutsLctopKpi);
+    list->Add(cutsLctopKpi);
+  }
+  if(fCutsD0toKpipipi) {
+    AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi(*fCutsD0toKpipipi);
+    list->Add(cutsD0toKpipipi);
+  }
+  if(fCutsD0fromDstar) {
+    AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi(*fCutsD0fromDstar);
+    list->Add(cutsD0fromDstar);
+  }
+  
+  // keep a pointer to the list
+  fListOfCuts = list;
+
+  return list;
+}
+//----------------------------------------------------------------------------
 void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
                                            TClonesArray *aodVerticesHFTClArr,
                                            TClonesArray *aodD0toKpiTClArr,
@@ -309,18 +356,19 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
   AliESDtrack *negtrack1 = 0;
   AliESDtrack *negtrack2 = 0;
   AliESDtrack *trackPi   = 0;
+  /*
   Double_t dcaMax = fD0toKpiCuts[1];
   if(dcaMax < fBtoJPSICuts[1]) dcaMax=fBtoJPSICuts[1];
   if(dcaMax < fDplusCuts[11])  dcaMax=fDplusCuts[11];
   if(dcaMax < fD0to4ProngsCuts[1])  dcaMax=fD0to4ProngsCuts[1];
-  /*
-  Double_t dcaMax = fCutsD0toKpi->GetDCACut();
+  */
+  Float_t dcaMax = fCutsD0toKpi->GetDCACut();
   if(fCutsJpsitoee) dcaMax=TMath::Max(dcaMax,fCutsJpsitoee->GetDCACut());
   if(fCutsDplustoKpipi) dcaMax=TMath::Max(dcaMax,fCutsDplustoKpipi->GetDCACut());
   if(fCutsDstoKKpi) dcaMax=TMath::Max(dcaMax,fCutsDstoKKpi->GetDCACut());
   if(fCutsLctopKpi) dcaMax=TMath::Max(dcaMax,fCutsLctopKpi->GetDCACut());
   if(fCutsD0toKpipipi) dcaMax=TMath::Max(dcaMax,fCutsD0toKpipipi->GetDCACut());
-  */
+  
   AliDebug(2,Form(" dca cut set to %f cm",dcaMax));
 
 
@@ -336,20 +384,7 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
   }
     
   // event selection
-  //if(!fCutsD0toKpi->IsEventSelected(event)) return;
-  const AliVVertex *primary = event->GetPrimaryVertex();
-  if(!primary) {
-    AliDebug(1," No primary vertex from tracks");
-    return;
-  }
-
-  TString primTitle=primary->GetTitle();
-  if(!primTitle.Contains("VertexerTracks") ||
-     primary->GetNContributors()<=0) {
-    AliDebug(1," No primary vertex from tracks");
-    return;
-  }
-  
+  if(!fCutsD0toKpi->IsEventSelected(event)) return;
 
   // call function that applies sigle-track selection,
   // for displaced tracks and soft pions (both charges) for D*,
@@ -443,25 +478,23 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
        if((fD0toKpi && okD0) || (fJPSItoEle && okJPSI) || (isLikeSign2Prong && (okD0 || okJPSI))) {
          // add the vertex and the decay to the AOD
          AliAODVertex *v2Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexp1n1);
-         if(fInputAOD) AddDaughterRefs(v2Prong,event,twoTrackArray1);
          if(!isLikeSign2Prong) {
            if(okD0) {  
              rd = new(aodD0toKpiRef[iD0toKpi++])AliAODRecoDecayHF2Prong(*io2Prong);
              rd->SetSecondaryVtx(v2Prong);
              v2Prong->SetParent(rd);
-             if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+             AddRefs(v2Prong,rd,event,twoTrackArray1);
            }
            if(okJPSI) {
              rd = new(aodJPSItoEleRef[iJPSItoEle++])AliAODRecoDecayHF2Prong(*io2Prong);
              rd->SetSecondaryVtx(v2Prong);
              if(!okD0) v2Prong->SetParent(rd); // it cannot have two mothers ...
-             if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+             AddRefs(v2Prong,rd,event,twoTrackArray1);
            }
          } else { // isLikeSign2Prong
            rd = new(aodLikeSign2ProngRef[iLikeSign2Prong++])AliAODRecoDecayHF2Prong(*io2Prong);
            rd->SetSecondaryVtx(v2Prong);
            v2Prong->SetParent(rd);
-           if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
          }
        }
        // D* candidates
@@ -530,25 +563,20 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              // add the D0 to the AOD (if not already done)
              if(!okD0) {
                AliAODVertex *v2Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexp1n1);
-               if(fInputAOD) AddDaughterRefs(v2Prong,event,twoTrackArray1);
                rd = new(aodD0toKpiRef[iD0toKpi++])AliAODRecoDecayHF2Prong(*io2Prong);
                rd->SetSecondaryVtx(v2Prong);
                v2Prong->SetParent(rd);
-               if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+               AddRefs(v2Prong,rd,event,twoTrackArray1);
                okD0=kTRUE; // this is done to add it only once
              }
              // add the vertex and the cascade to the AOD
              AliAODVertex *vCasc = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexCasc); 
-             if(fInputAOD) {
-               AddDaughterRefs(vCasc,event,twoTrackArrayCasc); // add the pion
-             } else {
-               vCasc->AddDaughter(rd); // just to fill ref #0 
-             }
-             vCasc->AddDaughter(rd); // add the D0 (in ref #1)
              rc = new(aodDstarRef[iDstar++])AliAODRecoCascadeHF(*ioCascade);
              rc->SetSecondaryVtx(vCasc);
              vCasc->SetParent(rc);
-             if(fInputAOD) rc->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+             if(!fInputAOD) vCasc->AddDaughter(rd); // just to fill ref #0 
+             AddRefs(vCasc,rc,event,twoTrackArrayCasc);
+             vCasc->AddDaughter(rd); // add the D0 (in ref #1)
            }
            twoTrackArrayCasc->Clear();
            trackPi=0; 
@@ -643,16 +671,16 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
          io3Prong = Make3Prong(threeTrackArray,event,secVert3PrAOD,dispersion,vertexp1n1,vertexp2n1,dcap1n1,dcap2n1,dcap1p2,ok3Prong);
          if(ok3Prong) {
            AliAODVertex *v3Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*secVert3PrAOD);
-           if(fInputAOD) AddDaughterRefs(v3Prong,event,threeTrackArray);
            if(!isLikeSign3Prong) {
              rd = new(aodCharm3ProngRef[i3Prong++])AliAODRecoDecayHF3Prong(*io3Prong);
              rd->SetSecondaryVtx(v3Prong);
              v3Prong->SetParent(rd);
+             AddRefs(v3Prong,rd,event,threeTrackArray);
            } else { // isLikeSign3Prong
              rd = new(aodLikeSign3ProngRef[iLikeSign3Prong++])AliAODRecoDecayHF3Prong(*io3Prong);
              rd->SetSecondaryVtx(v3Prong);
              v3Prong->SetParent(rd);
-             if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+             AddRefs(v3Prong,rd,event,threeTrackArray);
            }
          }
          if(io3Prong) {delete io3Prong; io3Prong=NULL;} 
@@ -719,11 +747,10 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
            io4Prong = Make4Prong(fourTrackArray,event,secVert4PrAOD,vertexp1n1,vertexp1n1p2,dcap1n1,dcap1n2,dcap2n1,dcap2n2,ok4Prong);
            if(ok4Prong) {
              AliAODVertex *v4Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*secVert4PrAOD);
-             if(fInputAOD) AddDaughterRefs(v4Prong,event,fourTrackArray);
              rd = new(aodCharm4ProngRef[i4Prong++])AliAODRecoDecayHF4Prong(*io4Prong);
              rd->SetSecondaryVtx(v4Prong);
              v4Prong->SetParent(rd);
-             if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+             AddRefs(v4Prong,rd,event,fourTrackArray);
            }
 
            if(io4Prong) {delete io4Prong; io4Prong=NULL;} 
@@ -805,16 +832,16 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
          io3Prong = Make3Prong(threeTrackArray,event,secVert3PrAOD,dispersion,vertexp1n1,vertexp1n2,dcap1n1,dcap1n2,dcan1n2,ok3Prong);
          if(ok3Prong) {
            AliAODVertex *v3Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*secVert3PrAOD);
-           if(fInputAOD) AddDaughterRefs(v3Prong,event,threeTrackArray);
            if(!isLikeSign3Prong) {
              rd = new(aodCharm3ProngRef[i3Prong++])AliAODRecoDecayHF3Prong(*io3Prong);
              rd->SetSecondaryVtx(v3Prong);
              v3Prong->SetParent(rd);
+             AddRefs(v3Prong,rd,event,threeTrackArray);
            } else { // isLikeSign3Prong
              rd = new(aodLikeSign3ProngRef[iLikeSign3Prong++])AliAODRecoDecayHF3Prong(*io3Prong);
              rd->SetSecondaryVtx(v3Prong);
              v3Prong->SetParent(rd);
-             if(fInputAOD) rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+             AddRefs(v3Prong,rd,event,threeTrackArray);
            }
          }
          if(io3Prong) {delete io3Prong; io3Prong=NULL;} 
@@ -885,12 +912,38 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
   return;
 }
 //----------------------------------------------------------------------------
+void AliAnalysisVertexingHF::AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd,
+                                    const AliVEvent *event,
+                                    const TObjArray *trkArray) const
+{
+  // Add the AOD tracks as daughters of the vertex (TRef)
+  // Also add the references to the primary vertex and to the cuts
+
+  if(fInputAOD) {
+    AddDaughterRefs(v,event,trkArray);
+    rd->SetPrimaryVtxRef((AliAODVertex*)event->GetPrimaryVertex());
+  }
+
+  /*
+  rd->SetListOfCutsRef((TList*)fListOfCuts);
+  //fListOfCuts->Print();
+  cout<<fListOfCuts<<endl;
+  TList *l=(TList*)rd->GetListOfCuts();
+  cout<<l<<endl;
+  if(l) {l->Print(); }else{printf("error\n");}
+  */
+
+  return;
+}      
+//----------------------------------------------------------------------------
 void AliAnalysisVertexingHF::AddDaughterRefs(AliAODVertex *v,
                                             const AliVEvent *event,
                                             const TObjArray *trkArray) const
 {
   // Add the AOD tracks as daughters of the vertex (TRef)
 
+  if(v->GetNDaughters()) return; // already done
+
   Int_t nTrks = trkArray->GetEntriesFast();
 
   AliExternalTrackParam *track = 0;
@@ -1022,18 +1075,18 @@ AliAODRecoDecayHF2Prong *AliAnalysisVertexingHF::Make2Prong(
  
   if(postrack->Charge()!=0 && negtrack->Charge()!=0) { // don't apply these cuts if it's a Dstar 
     // select D0->Kpi
-    Int_t checkD0,checkD0bar;
-    if(fD0toKpi)   okD0 = the2Prong->SelectD0(fD0toKpiCuts,checkD0,checkD0bar);
-    //if(fD0toKpi)   okD0 = (Bool_t)fCutsD0toKpi->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+    //Int_t checkD0,checkD0bar;
+    //if(fD0toKpi)   okD0 = the2Prong->SelectD0(fD0toKpiCuts,checkD0,checkD0bar);
+    if(fD0toKpi)   okD0 = (Bool_t)fCutsD0toKpi->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
     //if(fDebug && fD0toKpi) printf("   %d\n",(Int_t)okD0);
     // select J/psi from B
-    Int_t checkJPSI;
-    if(fJPSItoEle) okJPSI        = the2Prong->SelectBtoJPSI(fBtoJPSICuts,checkJPSI);
-    //if(fJPSItpEle)   okJPSI = (Bool_t)fCutsJpsitoee->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+    //Int_t checkJPSI;
+    //if(fJPSItoEle) okJPSI        = the2Prong->SelectBtoJPSI(fBtoJPSICuts,checkJPSI);
+    if(fJPSItoEle)   okJPSI = (Bool_t)fCutsJpsitoee->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
     //if(fDebug && fJPSItoEle) printf("   %d\n",(Int_t)okJPSI);
     // select D0->Kpi from Dstar
-    if(fDstar)     okD0fromDstar = the2Prong->SelectD0(fD0fromDstarCuts,checkD0,checkD0bar);
-    //if(fDstar)   okD0fromDstar = (Bool_t)fCutsD0fromDstar->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+    //if(fDstar)     okD0fromDstar = the2Prong->SelectD0(fD0fromDstarCuts,checkD0,checkD0bar);
+    if(fDstar)   okD0fromDstar = (Bool_t)fCutsD0fromDstar->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
     //if(fDebug && fDstar) printf("   %d\n",(Int_t)okD0fromDstar);
   }
 
@@ -1131,16 +1184,16 @@ AliAODRecoDecayHF3Prong* AliAnalysisVertexingHF::Make3Prong(
   // select D+->Kpipi, Ds->KKpi, Lc->pKpi
   if(f3Prong) {
     ok3Prong = kFALSE;
-    Int_t ok1,ok2;
-    Int_t dum1,dum2;
-    if(the3Prong->SelectDplus(fDplusCuts))   ok3Prong = kTRUE;
-    if(the3Prong->SelectDs(fDsCuts,ok1,ok2,dum1,dum2)) ok3Prong = kTRUE;
-    if(the3Prong->SelectLc(fLcCuts,ok1,ok2)) ok3Prong = kTRUE;
-    /*
+    //Int_t ok1,ok2;
+    //Int_t dum1,dum2;
+    //if(the3Prong->SelectDplus(fDplusCuts))   ok3Prong = kTRUE;
+    //if(the3Prong->SelectDs(fDsCuts,ok1,ok2,dum1,dum2)) ok3Prong = kTRUE;
+    //if(the3Prong->SelectLc(fLcCuts,ok1,ok2)) ok3Prong = kTRUE;
+    
     if(fCutsDplustoKpipi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) ok3Prong = kTRUE;
     if(fCutsDstoKKpi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) ok3Prong = kTRUE;
     if(fCutsLctopKpi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) ok3Prong = kTRUE;
-    */
+    
   }
   //if(fDebug) printf("ok3Prong: %d\n",(Int_t)ok3Prong);
 
@@ -1249,9 +1302,9 @@ AliAODRecoDecayHF4Prong* AliAnalysisVertexingHF::Make4Prong(
 
   delete primVertexAOD; primVertexAOD=NULL;
 
-  Int_t checkD0,checkD0bar;
-  ok4Prong=the4Prong->SelectD0(fD0to4ProngsCuts,checkD0,checkD0bar);
-  //ok4Prong=(Bool_t)fCutsD0toKpipipi->IsSelected(the4Prong,AliRDHFCuts::kCandidate);
+  //Int_t checkD0,checkD0bar;
+  //ok4Prong=the4Prong->SelectD0(fD0to4ProngsCuts,checkD0,checkD0bar);
+  ok4Prong=(Bool_t)fCutsD0toKpipipi->IsSelected(the4Prong,AliRDHFCuts::kCandidate);
 
 
   if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx && !fMixEvent) {
@@ -1403,6 +1456,7 @@ void AliAnalysisVertexingHF::PrintStatus() const {
   if(fD0toKpi) {
     printf("Reconstruct D0->Kpi candidates with cuts:\n");
     if(fCutsD0toKpi) fCutsD0toKpi->PrintAll();
+    /*
     printf("    |M-MD0| [GeV]    < %f\n",fD0toKpiCuts[0]);
     printf("    dca    [cm]  < %f\n",fD0toKpiCuts[1]);
     printf("    cosThetaStar     < %f\n",fD0toKpiCuts[2]);
@@ -1412,6 +1466,7 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("    |d0pi| [cm]  < %f\n",fD0toKpiCuts[6]);
     printf("    d0d0  [cm^2] < %f\n",fD0toKpiCuts[7]);
     printf("    cosThetaPoint    > %f\n",fD0toKpiCuts[8]);
+    */
   }
   if(fDstar) {
     if(fFindVertexForDstar) {
@@ -1427,6 +1482,7 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("Reconstruct D*->D0pi candidates with cuts:\n");
     printf("   D0 from D* cuts:\n");
     if(fCutsD0fromDstar) fCutsD0fromDstar->PrintAll();
+    /*
     printf("    |M-MD0| [GeV]    < %f\n",fD0fromDstarCuts[0]);
     printf("    dca    [cm]  < %f\n",fD0fromDstarCuts[1]);
     printf("    cosThetaStar     < %f\n",fD0fromDstarCuts[2]);
@@ -1436,10 +1492,12 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("    |d0pi| [cm]  < %f\n",fD0fromDstarCuts[6]);
     printf("    d0d0  [cm^2] < %f\n",fD0fromDstarCuts[7]);
     printf("    cosThetaPoint    > %f\n",fD0fromDstarCuts[8]);
+    */
   }
   if(fJPSItoEle) {
     printf("Reconstruct J/psi from B candidates with cuts:\n");
     if(fCutsJpsitoee) fCutsJpsitoee->PrintAll();
+    /*
     printf("    |M-MJPSI| [GeV]    < %f\n",fBtoJPSICuts[0]);
     printf("    dca    [cm]  < %f\n",fBtoJPSICuts[1]);
     printf("    cosThetaStar     < %f\n",fBtoJPSICuts[2]);
@@ -1449,11 +1507,13 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("    |d0N| [cm]  < %f\n",fBtoJPSICuts[6]);
     printf("    d0d0  [cm^2] < %f\n",fBtoJPSICuts[7]);
     printf("    cosThetaPoint    > %f\n",fBtoJPSICuts[8]);
+    */
   }
   if(f3Prong) {
     printf("Reconstruct 3 prong candidates.\n");
     printf("  D+->Kpipi cuts:\n");
     if(fCutsDplustoKpipi) fCutsDplustoKpipi->PrintAll();
+    /*
     printf("    |M-MD+| [GeV]    < %f\n",fDplusCuts[0]);
     printf("    pTK     [GeV/c]    > %f\n",fDplusCuts[1]);
     printf("    pTPi    [GeV/c]    > %f\n",fDplusCuts[2]);
@@ -1466,8 +1526,10 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("    cosThetaPoint    > %f\n",fDplusCuts[9]);
     printf("    Sum d0^2 [cm^2]  > %f\n",fDplusCuts[10]);
     printf("    dca cut [cm]  < %f\n",fDplusCuts[11]);
+    */
     printf("  Ds->KKpi cuts:\n");
     if(fCutsDstoKKpi) fCutsDstoKKpi->PrintAll();
+    /*
     printf("    |M-MDs| [GeV]    < %f\n",fDsCuts[0]);
     printf("    pTK     [GeV/c]    > %f\n",fDsCuts[1]);
     printf("    pTPi    [GeV/c]    > %f\n",fDsCuts[2]);
@@ -1482,8 +1544,10 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("    dca cut [cm]  < %f\n",fDsCuts[11]);
     printf("    Inv. Mass  phi [GeV]  < %f\n",fDsCuts[12]);
     printf("    Inv. Mass  K0* [GeV]  < %f\n",fDsCuts[13]);
+    */
     printf("  Lc->pKpi cuts:\n");
     if(fCutsLctopKpi) fCutsLctopKpi->PrintAll();
+    /*
     printf("    |M-MLc| [GeV]    < %f\n",fLcCuts[0]);
     printf("    pTP     [GeV/c]    > %f\n",fLcCuts[1]);
     printf("    pTPi and pTK [GeV/c]    > %f\n",fLcCuts[2]);
@@ -1496,6 +1560,7 @@ void AliAnalysisVertexingHF::PrintStatus() const {
     printf("    cosThetaPoint    > %f\n",fLcCuts[9]);
     printf("    Sum d0^2 [cm^2]  > %f\n",fLcCuts[10]);
     printf("    dca cut [cm]  < %f\n",fLcCuts[11]);
+    */
   }
   if(f4Prong) {
     printf("Reconstruct 4 prong candidates.\n");
@@ -1585,46 +1650,46 @@ Bool_t AliAnalysisVertexingHF::SelectInvMass(Int_t decay,
       pdg2[0]=211; pdg2[1]=321;
       mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
       minv = rd->InvMass(nprongs,pdg2);
-      if(TMath::Abs(minv-mPDG)<fD0toKpiCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsD0toKpi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fD0toKpiCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsD0toKpi->GetMassCut()) retval=kTRUE;
       pdg2[0]=321; pdg2[1]=211;
       minv = rd->InvMass(nprongs,pdg2);
-      if(TMath::Abs(minv-mPDG)<fD0toKpiCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsD0toKpi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fD0toKpiCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsD0toKpi->GetMassCut()) retval=kTRUE;
       break;
     case 1:                  // JPSI->ee
       pdg2[0]=11; pdg2[1]=11;
       mPDG=TDatabasePDG::Instance()->GetParticle(443)->Mass();
       minv = rd->InvMass(nprongs,pdg2);
-      if(TMath::Abs(minv-mPDG)<fBtoJPSICuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsJpsitoee->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fBtoJPSICuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsJpsitoee->GetMassCut()) retval=kTRUE;
       break;
     case 2:                  // D+->Kpipi
       pdg3[0]=211; pdg3[1]=321; pdg3[2]=211;
       mPDG=TDatabasePDG::Instance()->GetParticle(411)->Mass();
       minv = rd->InvMass(nprongs,pdg3);
-      if(TMath::Abs(minv-mPDG)<fDplusCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsDplustoKpipi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fDplusCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsDplustoKpipi->GetMassCut()) retval=kTRUE;
                             // Ds+->KKpi
       pdg3[0]=321; pdg3[1]=321; pdg3[2]=211;
       mPDG=TDatabasePDG::Instance()->GetParticle(431)->Mass();
       minv = rd->InvMass(nprongs,pdg3);
-      if(TMath::Abs(minv-mPDG)<fDsCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsDstoKKpi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fDsCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsDstoKKpi->GetMassCut()) retval=kTRUE;
       pdg3[0]=211; pdg3[1]=321; pdg3[2]=321;
       minv = rd->InvMass(nprongs,pdg3);
-      if(TMath::Abs(minv-mPDG)<fDsCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsDstoKKpi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fDsCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsDstoKKpi->GetMassCut()) retval=kTRUE;
                             // Lc->pKpi
       pdg3[0]=2212; pdg3[1]=321; pdg3[2]=211;
       mPDG=TDatabasePDG::Instance()->GetParticle(4122)->Mass();
       minv = rd->InvMass(nprongs,pdg3);
-      if(TMath::Abs(minv-mPDG)<fLcCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsLctopKpi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fLcCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsLctopKpi->GetMassCut()) retval=kTRUE;
       pdg3[0]=211; pdg3[1]=321; pdg3[2]=2212;
       minv = rd->InvMass(nprongs,pdg3);
-      if(TMath::Abs(minv-mPDG)<fLcCuts[0]) retval=kTRUE; 
-      //if(TMath::Abs(minv-mPDG)<fCutsLctopKpi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fLcCuts[0]) retval=kTRUE; 
+      if(TMath::Abs(minv-mPDG)<fCutsLctopKpi->GetMassCut()) retval=kTRUE;
       break;
     case 3:                  // D*->D0pi
       pdg2[0]=211; pdg2[1]=421; // in twoTrackArrayCasc we put the pion first
@@ -1636,23 +1701,23 @@ Bool_t AliAnalysisVertexingHF::SelectInvMass(Int_t decay,
       pdg4[0]=321; pdg4[1]=211; pdg4[2]=211; pdg4[3]=211;
       mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
       minv = rd->InvMass(nprongs,pdg4);
-      if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
       pdg4[0]=211; pdg4[1]=321; pdg4[2]=211; pdg4[3]=211;
       mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
       minv = rd->InvMass(nprongs,pdg4);
-      if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
       pdg4[0]=211; pdg4[1]=211; pdg4[2]=321; pdg4[3]=211;
       mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
       minv = rd->InvMass(nprongs,pdg4);
-      if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
       pdg4[0]=211; pdg4[1]=211; pdg4[2]=211; pdg4[3]=321;
       mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
       minv = rd->InvMass(nprongs,pdg4);
-      if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
-      //if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
+      //if(TMath::Abs(minv-mPDG)<fD0to4ProngsCuts[0]) retval=kTRUE;
+      if(TMath::Abs(minv-mPDG)<fCutsD0toKpipipi->GetMassCut()) retval=kTRUE;
       break;
     default:
       printf("SelectInvMass(): wrong decay selection\n");
index 9dd4bd1..9faf59c 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <TNamed.h>
 
+class TList;
 class AliESDVertex;
 class AliAODRecoDecayHF;
 class AliAODRecoDecayHF2Prong;
@@ -49,6 +50,7 @@ class AliAnalysisVertexingHF : public TNamed {
                      TClonesArray *aodLikeSign2ProngTClArr,
                      TClonesArray *aodLikeSign3ProngTClArr);
 
+  TList* FillListOfCuts();
   void PrintStatus() const;
   void SetSecVtxWithKF() { fSecVtxWithKF=kTRUE; }
   void SetD0toKpiOn() { fD0toKpi=kTRUE; }
@@ -294,8 +296,11 @@ class AliAnalysisVertexingHF : public TNamed {
                         // 7 = Mass Pi+Pi- = mass of the rho0
                         // 8 = PID cut (one K in the quadruplet)
 
+  TList *fListOfCuts;    // pointer to list of cuts for output file
   Bool_t fFindVertexForDstar; // reconstruct a secondary vertex or assume it's from the primary vertex
   //
+  void AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd,const AliVEvent *event,
+              const TObjArray *trkArray) const;
   void AddDaughterRefs(AliAODVertex *v,const AliVEvent *event,
                       const TObjArray *trkArray) const;
   AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray1,AliVEvent *event,
@@ -330,7 +335,7 @@ class AliAnalysisVertexingHF : public TNamed {
                                   UChar_t *seleFlags,Int_t *evtNumber);
   Bool_t SingleTrkCuts(AliESDtrack *trk,Bool_t &okDisplaced,Bool_t &okSoftPi) const;
   //
-  ClassDef(AliAnalysisVertexingHF,15);  // Reconstruction of HF decay candidates
+  ClassDef(AliAnalysisVertexingHF,16);  // Reconstruction of HF decay candidates
 };
 
 
index 86c3991..8e21fe1 100644 (file)
@@ -31,8 +31,8 @@
 ClassImp(AliRDHFCutsD0toKpi)
 
 //--------------------------------------------------------------------------
-AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi() : 
-AliRDHFCuts()
+AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const char* name) : 
+AliRDHFCuts(name)
 {
   //
   // Default Constructor
index 93985f5..bfcf845 100644 (file)
@@ -15,7 +15,7 @@ class AliRDHFCutsD0toKpi : public AliRDHFCuts
 {
  public:
 
-  AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi(const char* name="CutsD0toKpi");
   
   virtual ~AliRDHFCutsD0toKpi(){}
 
index 7c1ba45..b52dc24 100644 (file)
@@ -31,8 +31,8 @@
 ClassImp(AliRDHFCutsD0toKpipipi)\r
 \r
 //--------------------------------------------------------------------------\r
-AliRDHFCutsD0toKpipipi::AliRDHFCutsD0toKpipipi() : \r
-AliRDHFCuts()\r
+AliRDHFCutsD0toKpipipi::AliRDHFCutsD0toKpipipi(const char* name) : \r
+AliRDHFCuts(name)\r
 {\r
   //\r
   // Default Constructor\r
index 9c663e7..f3971ea 100644 (file)
@@ -15,7 +15,7 @@ class AliRDHFCutsD0toKpipipi : public AliRDHFCuts
 {\r
  public:\r
 \r
-  AliRDHFCutsD0toKpipipi();\r
+  AliRDHFCutsD0toKpipipi(const char* name="CutsD0toKpipipi");\r
   \r
   virtual ~AliRDHFCutsD0toKpipipi(){}\r
 \r
index 5f55cb6..cfc62ff 100644 (file)
@@ -32,8 +32,8 @@
 ClassImp(AliRDHFCutsDplustoKpipi)
 
 //--------------------------------------------------------------------------
-AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() : 
-  AliRDHFCuts()
+AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const char* name) : 
+  AliRDHFCuts(name)
 {
   //
   // Default Constructor
index d032656..82aaef9 100644 (file)
@@ -19,7 +19,7 @@ class AliRDHFCutsDplustoKpipi : public AliRDHFCuts
 {
  public:
 
-  AliRDHFCutsDplustoKpipi();
+  AliRDHFCutsDplustoKpipi(const char* name="CutsDplustoKpipi");
   
   virtual ~AliRDHFCutsDplustoKpipi(){}
 
index 0755479..2f24729 100644 (file)
 ClassImp(AliRDHFCutsDstoKKpi)
 
 //--------------------------------------------------------------------------
-AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi() : 
-AliRDHFCuts()
+AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const char* name) : 
+AliRDHFCuts(name)
 {
   //
   // Default Constructor
   //
-  const Int_t nvars=14;
+  Int_t nvars=14;
   SetNVars(nvars);
-  TString varNames[nvars]={"inv. mass [GeV]",   
+  TString varNames[14]={"inv. mass [GeV]",   
                        "pTK [GeV/c]",
                        "pTPi [GeV/c]",
                        "d0K [cm]",
@@ -52,9 +52,8 @@ AliRDHFCuts()
                        "Sum d0^2 (cm^2)",
                        "dca [cm]",
                        "inv. mass (Mphi-MKK) [GeV]",
-                       "inv. mass (MKo*-MKpi) [GeV]"
-};
-  Bool_t isUpperCut[nvars]={kTRUE,
+                       "inv. mass (MKo*-MKpi) [GeV]"};
+  Bool_t isUpperCut[14]={kTRUE,
                         kFALSE,
                         kFALSE,
                         kFALSE,
@@ -68,8 +67,8 @@ AliRDHFCuts()
                         kTRUE,
                         kTRUE,
                         kTRUE};
-  SetVarNames(nvars,varNames,isUpperCut);
-  Bool_t forOpt[nvars]={kFALSE,
+  SetVarNames(14,varNames,isUpperCut);
+  Bool_t forOpt[14]={kFALSE,
                    kFALSE,
                    kFALSE,
                    kFALSE,
index 14f929d..0db941d 100644 (file)
@@ -15,7 +15,7 @@ class AliRDHFCutsDstoKKpi : public AliRDHFCuts
 {
  public:
 
-  AliRDHFCutsDstoKKpi();
+  AliRDHFCutsDstoKKpi(const char* name="CutsDstoKKpi");
   
   virtual ~AliRDHFCutsDstoKKpi(){}
 
index 8cc1f7d..414986d 100644 (file)
@@ -31,8 +31,8 @@
 ClassImp(AliRDHFCutsJpsitoee)
 
 //--------------------------------------------------------------------------
-AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee() : 
-AliRDHFCuts()
+AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const char* name) : 
+AliRDHFCuts(name)
 {
   //
   // Default Constructor
index 4def265..204aee4 100644 (file)
@@ -15,7 +15,7 @@ class AliRDHFCutsJpsitoee : public AliRDHFCuts
 {
  public:
 
-  AliRDHFCutsJpsitoee();
+  AliRDHFCutsJpsitoee(const char* name="CutsJpsitoee");
   
   virtual ~AliRDHFCutsJpsitoee(){}
 
index 77a8155..b18dd58 100644 (file)
@@ -31,8 +31,8 @@
 ClassImp(AliRDHFCutsLctopKpi)
 
 //--------------------------------------------------------------------------
-AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi() : 
-AliRDHFCuts()
+AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const char* name) : 
+AliRDHFCuts(name)
 {
   //
   // Default Constructor
index 77020fb..20ea838 100644 (file)
@@ -15,7 +15,7 @@ class AliRDHFCutsLctopKpi : public AliRDHFCuts
 {
  public:
 
-  AliRDHFCutsLctopKpi();
+  AliRDHFCutsLctopKpi(const char* name="CutsLctopKpi");
   
   virtual ~AliRDHFCutsLctopKpi(){}
 
index 00c21ab..168028a 100644 (file)
@@ -19,9 +19,9 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
   esdTrackCuts->SetRequireTPCRefit(kTRUE);
   esdTrackCuts->SetRequireITSRefit(kTRUE);
-  esdTrackCuts->SetMinNClustersITS(5);
+  esdTrackCuts->SetMinNClustersITS(4);
   esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-                                        AliESDtrackCuts::kBoth);
+                                        AliESDtrackCuts::kAny);
   esdTrackCuts->SetMinDCAToVertexXY(0.);
   esdTrackCuts->SetPtRange(0.3,1.e10);
   AliAnalysisFilter *trkFilter = new AliAnalysisFilter("trackFilter");
@@ -34,47 +34,48 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   trkFilterSoftPi->AddCuts(esdTrackCutsSoftPi);
   vHF->SetTrackFilterSoftPi(trkFilterSoftPi);
   //--- set cuts for candidates selection
-  AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi("CutsD0toKpi");
   Float_t cutsArrayD0toKpi[9]={0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
   cutsD0toKpi->SetCuts(9,cutsArrayD0toKpi);
   cutsD0toKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpi(cutsD0toKpi);
-  AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee();
-  Float_t cutsArrayJpsitoee[9]={0.35,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
+  AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee("CutsJpsitoee");
+  Float_t cutsArrayJpsitoee[9]={0.350,100000.,1.1,0.,0.,100000.,100000.,100000000.,-1.1};
   cutsJpsitoee->SetCuts(9,cutsArrayJpsitoee);
   cutsJpsitoee->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsJpsitoee(cutsJpsitoee);
-  AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi();
-  Float_t cutsArrayDplustoKpipi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6};
+  AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi("CutsDplustoKpipi");
+  Float_t cutsArrayDplustoKpipi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
   cutsDplustoKpipi->SetCuts(12,cutsArrayDplustoKpipi);
   cutsDplustoKpipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDplustoKpipi(cutsDplustoKpipi);
-  AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi();
-  Float_t cutsArrayDstoKKpi[14]={0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,0.1};
+  AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi("CutsDstoKKpi");
+  Float_t cutsArrayDstoKKpi[14]={0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,1000.};
   cutsDstoKKpi->SetCuts(14,cutsArrayDstoKKpi);
   cutsDstoKKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDstoKKpi(cutsDstoKKpi);
-  AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi();
-  Float_t cutsArrayLctopKpi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6};
+  AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi("CutsLctopKpi");
+  Float_t cutsArrayLctopKpi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
   cutsLctopKpi->SetCuts(12,cutsArrayLctopKpi);
   cutsLctopKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsLctopKpi(cutsLctopKpi);
-  AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi();
+  AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi("CutsD0toKpipipi");
   Float_t cutsArrayD0toKpipipi[9]={0.2,0.04,0.00,0.01,0.02,0.8,0.,0.1,0.};
   cutsD0toKpipipi->SetCuts(9,cutsArrayD0toKpipipi);
   cutsD0toKpipipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpipipi(cutsD0toKpipipi);
-  AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi("CutsD0fromDstar");
   Float_t cutsArrayD0fromDstar[9]={0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
   cutsD0fromDstar->SetCuts(9,cutsArrayD0fromDstar);
   cutsD0fromDstar->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0fromDstar(cutsD0fromDstar);
   // 
+  // to be removed:
   vHF->SetD0toKpiCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
-  vHF->SetBtoJPSICuts(0.350);
-  vHF->SetDplusCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85);
+  vHF->SetBtoJPSICuts(0.350,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
+  vHF->SetDplusCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6);
   vHF->SetDsCuts(0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,0.1);
-  vHF->SetLcCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.,0.,0.85);
+  vHF->SetLcCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6);
   vHF->SetD0to4ProngsCuts(0.2,0.04,0.00,0.01,0.02,0.8,0.,0.1,0.);
   vHF->SetDstarCuts(0.3, 0.1, 0.05, 100000000000.0, 0.5);
   vHF->SetD0fromDstarCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
index 2415e18..db98aeb 100644 (file)
@@ -19,9 +19,9 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
   esdTrackCuts->SetRequireTPCRefit(kTRUE);
   esdTrackCuts->SetRequireITSRefit(kTRUE);
-  esdTrackCuts->SetMinNClustersITS(5);
+  esdTrackCuts->SetMinNClustersITS(4);
   esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-                                        AliESDtrackCuts::kBoth);
+                                        AliESDtrackCuts::kAny);
   esdTrackCuts->SetMinDCAToVertexXY(0.);
   esdTrackCuts->SetPtRange(0.3,1.e10);
   AliAnalysisFilter *trkFilter = new AliAnalysisFilter("trackFilter");
@@ -34,47 +34,48 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   trkFilterSoftPi->AddCuts(esdTrackCutsSoftPi);
   vHF->SetTrackFilterSoftPi(trkFilterSoftPi);
   //--- set cuts for candidates selection
-  AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi("CutsD0toKpi");
   Float_t cutsArrayD0toKpi[9]={0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
   cutsD0toKpi->SetCuts(9,cutsArrayD0toKpi);
   cutsD0toKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpi(cutsD0toKpi);
-  AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee();
-  Float_t cutsArrayJpsitoee[9]={0.35,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
+  AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee("CutsJpsitoee");
+  Float_t cutsArrayJpsitoee[9]={0.350,100000.,1.1,0.,0.,100000.,100000.,100000000.,-1.1};
   cutsJpsitoee->SetCuts(9,cutsArrayJpsitoee);
   cutsJpsitoee->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsJpsitoee(cutsJpsitoee);
-  AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi();
-  Float_t cutsArrayDplustoKpipi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6};
+  AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi("CutsDplustoKpipi");
+  Float_t cutsArrayDplustoKpipi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
   cutsDplustoKpipi->SetCuts(12,cutsArrayDplustoKpipi);
   cutsDplustoKpipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDplustoKpipi(cutsDplustoKpipi);
-  AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi();
-  Float_t cutsArrayDstoKKpi[14]={0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,0.1};
+  AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi("CutsDstoKKpi");
+  Float_t cutsArrayDstoKKpi[14]={0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,1000.};
   cutsDstoKKpi->SetCuts(14,cutsArrayDstoKKpi);
   cutsDstoKKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDstoKKpi(cutsDstoKKpi);
-  AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi();
-  Float_t cutsArrayLctopKpi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6};
+  AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi("CutsLctopKpi");
+  Float_t cutsArrayLctopKpi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
   cutsLctopKpi->SetCuts(12,cutsArrayLctopKpi);
   cutsLctopKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsLctopKpi(cutsLctopKpi);
-  AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi();
+  AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi("CutsD0toKpipipi");
   Float_t cutsArrayD0toKpipipi[9]={0.2,0.04,0.00,0.01,0.02,0.8,0.,0.1,0.};
   cutsD0toKpipipi->SetCuts(9,cutsArrayD0toKpipipi);
   cutsD0toKpipipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpipipi(cutsD0toKpipipi);
-  AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi("CutsD0fromDstar");
   Float_t cutsArrayD0fromDstar[9]={0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
   cutsD0fromDstar->SetCuts(9,cutsArrayD0fromDstar);
   cutsD0fromDstar->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0fromDstar(cutsD0fromDstar);
   // 
+  // to be removed:
   vHF->SetD0toKpiCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
-  vHF->SetBtoJPSICuts(0.350);
-  vHF->SetDplusCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85);
-  vHF->SetDsCuts(0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1);
-  vHF->SetLcCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.,0.,0.85);
+  vHF->SetBtoJPSICuts(0.350,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
+  vHF->SetDplusCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6);
+  vHF->SetDsCuts(0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,0.1);
+  vHF->SetLcCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6);
   vHF->SetD0to4ProngsCuts(0.2,0.04,0.00,0.01,0.02,0.8,0.,0.1,0.);
   vHF->SetDstarCuts(0.3, 0.1, 0.05, 100000000000.0, 0.5);
   vHF->SetD0fromDstarCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
index 8909e71..168028a 100644 (file)
@@ -19,9 +19,9 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
   esdTrackCuts->SetRequireTPCRefit(kTRUE);
   esdTrackCuts->SetRequireITSRefit(kTRUE);
-  esdTrackCuts->SetMinNClustersITS(4); // default is 5
+  esdTrackCuts->SetMinNClustersITS(4);
   esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-                                        AliESDtrackCuts::kAny); // default is kBoth
+                                        AliESDtrackCuts::kAny);
   esdTrackCuts->SetMinDCAToVertexXY(0.);
   esdTrackCuts->SetPtRange(0.3,1.e10);
   AliAnalysisFilter *trkFilter = new AliAnalysisFilter("trackFilter");
@@ -34,47 +34,48 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   trkFilterSoftPi->AddCuts(esdTrackCutsSoftPi);
   vHF->SetTrackFilterSoftPi(trkFilterSoftPi);
   //--- set cuts for candidates selection
-  AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi("CutsD0toKpi");
   Float_t cutsArrayD0toKpi[9]={0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
   cutsD0toKpi->SetCuts(9,cutsArrayD0toKpi);
   cutsD0toKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpi(cutsD0toKpi);
-  AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee();
-  Float_t cutsArrayJpsitoee[9]={0.35,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
+  AliRDHFCutsJpsitoee *cutsJpsitoee = new AliRDHFCutsJpsitoee("CutsJpsitoee");
+  Float_t cutsArrayJpsitoee[9]={0.350,100000.,1.1,0.,0.,100000.,100000.,100000000.,-1.1};
   cutsJpsitoee->SetCuts(9,cutsArrayJpsitoee);
   cutsJpsitoee->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsJpsitoee(cutsJpsitoee);
-  AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi();
-  Float_t cutsArrayDplustoKpipi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6};
+  AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi("CutsDplustoKpipi");
+  Float_t cutsArrayDplustoKpipi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
   cutsDplustoKpipi->SetCuts(12,cutsArrayDplustoKpipi);
   cutsDplustoKpipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDplustoKpipi(cutsDplustoKpipi);
-  AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi();
-  Float_t cutsArrayDstoKKpi[14]={0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,0.1};
+  AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi("CutsDstoKKpi");
+  Float_t cutsArrayDstoKKpi[14]={0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,1000.};
   cutsDstoKKpi->SetCuts(14,cutsArrayDstoKKpi);
   cutsDstoKKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDstoKKpi(cutsDstoKKpi);
-  AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi();
-  Float_t cutsArrayLctopKpi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6};
+  AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi("CutsLctopKpi");
+  Float_t cutsArrayLctopKpi[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
   cutsLctopKpi->SetCuts(12,cutsArrayLctopKpi);
   cutsLctopKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsLctopKpi(cutsLctopKpi);
-  AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi();
+  AliRDHFCutsD0toKpipipi *cutsD0toKpipipi = new AliRDHFCutsD0toKpipipi("CutsD0toKpipipi");
   Float_t cutsArrayD0toKpipipi[9]={0.2,0.04,0.00,0.01,0.02,0.8,0.,0.1,0.};
   cutsD0toKpipipi->SetCuts(9,cutsArrayD0toKpipipi);
   cutsD0toKpipipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpipipi(cutsD0toKpipipi);
-  AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi();
+  AliRDHFCutsD0toKpi *cutsD0fromDstar = new AliRDHFCutsD0toKpi("CutsD0fromDstar");
   Float_t cutsArrayD0fromDstar[9]={0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.};
   cutsD0fromDstar->SetCuts(9,cutsArrayD0fromDstar);
   cutsD0fromDstar->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0fromDstar(cutsD0fromDstar);
   // 
+  // to be removed:
   vHF->SetD0toKpiCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
-  vHF->SetBtoJPSICuts(0.350);
-  vHF->SetDplusCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85);
+  vHF->SetBtoJPSICuts(0.350,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);
+  vHF->SetDplusCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6);
   vHF->SetDsCuts(0.2,0.4,0.4,0.,0.,0.005,0.06,0.,0.,0.85,0.,0.1,0.1,0.1);
-  vHF->SetLcCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.,0.,0.85);
+  vHF->SetLcCuts(0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0,1e6);
   vHF->SetD0to4ProngsCuts(0.2,0.04,0.00,0.01,0.02,0.8,0.,0.1,0.);
   vHF->SetDstarCuts(0.3, 0.1, 0.05, 100000000000.0, 0.5);
   vHF->SetD0fromDstarCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.);