Modification to classes to run on trains
authorlramona <ramona.lea@cern.ch>
Thu, 13 Feb 2014 14:48:28 +0000 (15:48 +0100)
committerlramona <ramona.lea@cern.ch>
Thu, 13 Feb 2014 14:48:28 +0000 (15:48 +0100)
PWGLF/CMakelibPWGLFSTRANGENESS.pkg
PWGLF/PWGLFSTRANGENESSLinkDef.h
PWGLF/STRANGENESS/Hypernuclei/AliAODNuclExReplicator.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAODNuclExReplicator.h
PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF.cxx [new file with mode: 0644]
PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF.h [new file with mode: 0644]
PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.cxx [new file with mode: 0644]
PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.h [new file with mode: 0644]
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskESDNuclExFilter.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskESDNuclExFilter.h

index 11e973c..fdc1cf6 100644 (file)
@@ -54,6 +54,12 @@ set ( SRCS
   STRANGENESS/Hypernuclei/AliAnalysisTaskHdibaryonLPpi.cxx
   STRANGENESS/Hypernuclei/AliAnalysisTaskHelium3Pi.cxx
   STRANGENESS/Hypernuclei/AliAnalysisTaskHelium3PiMC.cxx
+  STRANGENESS/Hypernuclei/AliAODRecoDecayLF.cxx
+  STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.cxx
+  STRANGENESS/Hypernuclei/AliAODNuclExReplicator.cxx
+  STRANGENESS/Hypernuclei/AliAnalysisTaskESDNuclExFilter.cxx
+
 )
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
@@ -62,7 +68,7 @@ set ( DHDR PWGLFSTRANGENESSLinkDef.h)
 
 set ( EXPORT )
 
-set ( EINCLUDE  PWGLF/STRANGENESS/Cascades PWGLF/STRANGENESS/LambdaK0 PWGLF/STRANGENESS/LambdaK0PbPb PWGLF/STRANGENESS/Correlations PWGLF/STRANGENESS/Hypernuclei STEER/ESD STEER/STEERBase ANALYSIS)
+set ( EINCLUDE  PWGLF/STRANGENESS/Cascades PWGLF/STRANGENESS/LambdaK0 PWGLF/STRANGENESS/LambdaK0PbPb PWGLF/STRANGENESS/Correlations PWGLF/STRANGENESS/Hypernuclei STEER/ESD STEER/AOD STEER/STEERBase ANALYSIS)
 
 #install (DIRECTORY PWGLF/STRANGENESS/Cascades/macros
 #         DESTINATION PWGLF/STRANGENESS 
index 2467e5a..76a05c7 100644 (file)
@@ -33,5 +33,9 @@
 #pragma link C++ class AliAnalysisTaskHdibaryonLPpi+;
 #pragma link C++ class AliAnalysisTaskHelium3Pi+;
 #pragma link C++ class AliAnalysisTaskHelium3PiMC+;
+#pragma link C++ class AliAODRecoDecayLF+;
+#pragma link C++ class AliAODRecoDecayLF2Prong+;
+#pragma link C++ class AliAODNuclExReplicator+;
+#pragma link C++ class AliAnalysisTaskESDNuclExFilter+;
 
 #endif
index 12e52cd..0ff7cd5 100644 (file)
 //
 // This replicator is in charge of replicating the nuclei primary vertices
 // tracks identified as nuclei with Z>=2, secondary vertices in form of 
-// AliAODRecoDecayHF2Prong and their daughter tracks.
+// AliAODRecoDecayLF2Prong and their daughter tracks.
 // These informations are stored into a reduced AODs (AliAOD.NuclEx.root) 
 // 
 // The vertices are filtered so that only the primary vertices make it
 // to the output aods.
 //
-// The secondary vertices are recreated here, as a AliAODRecoDecayHF2Prong
+// The secondary vertices are recreated here, as a AliAODRecoDecayLF2Prong
 // plus cuts that select secondary vericesoutside the primary vertex
 
 // Authors: S. Bufalino (stefania.bufalino@cern.ch)
@@ -45,7 +45,7 @@ class AliAODRecoDecay;
 #include "AliAODTZERO.h"
 #include "AliAODTrack.h"
 #include "AliAODVZERO.h"
-#include "AliAnalysisCuts.h"
+//#include "AliAnalysisCuts.h"
 #include "TF1.h"
 #include "AliExternalTrackParam.h"
 #include "AliESDv0.h"
@@ -57,8 +57,8 @@ class AliAODRecoDecay;
 #include "TObjArray.h"
 #include "AliAnalysisFilter.h"
 #include "AliAODRecoDecay.h"
-#include "AliAODRecoDecayHF.h"
-#include "AliAODRecoDecayHF2Prong.h"
+#include "AliAODRecoDecayLF.h"
+#include "AliAODRecoDecayLF2Prong.h"
 
 #include <TFile.h>
 #include <TDatabasePDG.h>
@@ -75,7 +75,7 @@ class AliAODRecoDecay;
 #include "AliESDtrackCuts.h"
 #include "AliAODEvent.h"
 #include "AliAnalysisFilter.h"
-#include "AliAnalysisVertexingHF.h"
+//#include "AliAnalysisVertexingLF.h"
 #include "AliAnalysisManager.h"
 #include "AliAODNuclExReplicator.h"
 #include "TH1.h"
@@ -89,8 +89,8 @@ ClassImp(AliAODNuclExReplicator)
 
 //_____________________________________________________________________________
 AliAODNuclExReplicator::AliAODNuclExReplicator(const char* name, const char* title,
-                                              AliAnalysisCuts* trackCut,
-                                              AliAnalysisCuts* vertexCut,
+                                              // AliAnalysisCuts* trackCut,
+                                              // AliAnalysisCuts* vertexCut,
                                               Int_t mcMode, 
                                               Int_t nsigmaTrk1, Int_t partType1,
                                               Int_t nsigmaTrk2, Int_t partType2
@@ -104,9 +104,11 @@ AliAODNuclExReplicator::AliAODNuclExReplicator(const char* name, const char* tit
   fDNmin(),
   fDPmin(), 
   fHeader(0x0),
-  fVertexCut(vertexCut), fVertices(0x0), 
+//fVertexCut(vertexCut), 
+  fVertices(0x0), 
   fNuclei(0x0),
-  fTrackCut(trackCut), fSecondaryVerices(0x0), 
+//  fTrackCut(trackCut), 
+  fSecondaryVerices(0x0), 
   fDaughterTracks(0x0),
   fList(0x0),
   fMCParticles(0x0),
@@ -133,8 +135,8 @@ AliAODNuclExReplicator::AliAODNuclExReplicator(const char* name, const char* tit
 AliAODNuclExReplicator::~AliAODNuclExReplicator()
 {
   // destructor
-  delete fTrackCut;
-  delete fVertexCut;
+  // delete fTrackCut;
+  // delete fVertexCut;
   delete fList;
 }
 
@@ -380,7 +382,7 @@ TList* AliAODNuclExReplicator::GetList() const
        }
       
       
-      fSecondaryVerices = new TClonesArray("AliAODRecoDecayHF2Prong",30);
+      fSecondaryVerices = new TClonesArray("AliAODRecoDecayLF2Prong",30);
       fSecondaryVerices->SetName("SecondaryVertices");    
     
       fVertices = new TClonesArray("AliAODVertex",2);
@@ -432,6 +434,8 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
 
   printf("Execute NuclEx Replicator\n");
 
+  //---------------------------------
+
   if (fReplicateHeader)
     {
       *fHeader = *(source.GetHeader());
@@ -444,6 +448,8 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
   fSecondaryVerices->Clear("C");
 
   fDaughterTracks->Clear("C");
+  
+  //----------------------------------
 
   //  cout<<"Centrality AOD source: "<<source.GetHeader()->GetCentrality()<<endl;
 
@@ -454,7 +460,7 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
   Int_t input(0);
   Double_t xdummy,ydummy;
 
-  AliAODRecoDecayHF2Prong *io2Prong  = 0;
+  AliAODRecoDecayLF2Prong *io2Prong  = 0;
 
   TObjArray *twoTrackArray    = new TObjArray(2);
   Double_t dispersion;
@@ -498,8 +504,8 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
   
   //-------------------------------------------------------------
 
-  //AliAODRecoDecayHF   *rd = 0;
-  AliAODRecoDecayHF2Prong*rd = 0;
+  //AliAODRecoDecayLF   *rd = 0;
+  AliAODRecoDecayLF2Prong*rd = 0;
   
 
   if(vtx->GetNContributors()<1) {
@@ -661,7 +667,7 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
       //      cout<<"if CPA \npr0: "<<io2Prong->GetProngID(0)<<" pr1: "<<io2Prong->GetProngID(1)<<" pr2"<<io2Prong->GetProngID(2)<<endl;
       // cout<<"pointing angle "<<io2Prong->CosPointingAngle()<<endl;
       
-      rd =  new((*fSecondaryVerices)[nsv++]) AliAODRecoDecayHF2Prong(*io2Prong);
+      rd =  new((*fSecondaryVerices)[nsv++]) AliAODRecoDecayLF2Prong(*io2Prong);
 
       cout<<"QUELLO CHE SALVo \npr0: "<<rd->GetProngID(0)<<" pr1: "<<rd->GetProngID(1)<<" pr2"<<rd->GetProngID(2)<<endl;
 
@@ -696,7 +702,11 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
   
   while ( ( v = static_cast<AliAODVertex*>(nextV()) ) )
     {
-      if ( !fVertexCut || fVertexCut->IsSelected(v) ) 
+      if (  v->GetType() == AliAODVertex::kPrimary     ||
+           v->GetType() == AliAODVertex::kMainSPD     ||
+           v->GetType() == AliAODVertex::kPileupSPD   ||
+           v->GetType() == AliAODVertex::kPileupTracks||
+           v->GetType() == AliAODVertex::kMainTPC  ) 
        {
          AliAODVertex* tmp = v->CloneWithoutRefs();
          AliAODVertex* copiedVertex = new((*fVertices)[nvertices++]) AliAODVertex(*tmp);
@@ -813,7 +823,7 @@ AliAODVertex *AliAODNuclExReplicator::ReconstructSecondaryVertex(TObjArray *trkA
 
 //-----------------------------------------------------------------------------
 
-AliAODRecoDecayHF2Prong* AliAODNuclExReplicator::Make2Prong(TObjArray *twoTrackArray,const AliAODEvent &evento,
+AliAODRecoDecayLF2Prong* AliAODNuclExReplicator::Make2Prong(TObjArray *twoTrackArray,const AliAODEvent &evento,
                                                           AliAODVertex *secVert,Double_t dca)
 
 
@@ -825,7 +835,7 @@ AliAODRecoDecayHF2Prong* AliAODNuclExReplicator::Make2Prong(TObjArray *twoTrackA
   charge[0]=1; //it was -1 //Ramona
   charge[1]=2;
       
-  // From AliAnalysisVertexingHF.cxx Method:Make2Prongs
+  // From AliAnalysisVertexingLF.cxx Method:Make2Prongs
   
   fBzkG = evento.GetMagneticField();
       
@@ -874,9 +884,9 @@ AliAODRecoDecayHF2Prong* AliAODNuclExReplicator::Make2Prong(TObjArray *twoTrackA
   d0[1] = d0z0[0];
   d0err[1] = TMath::Sqrt(TMath::Abs(covd0z0[0]));
   
-  // create the object AliAODRecoDecayHF2Prong
-  //  AliAODRecoDecayHF2Prong *the2Prong = new AliAODRecoDecayHF2Prong(secVert,px,py,pz,d0,d0err,dcap1n1);
-  AliAODRecoDecayHF2Prong *the2Prong = new AliAODRecoDecayHF2Prong(secVert,px,py,pz,d0,d0err,dca);
+  // create the object AliAODRecoDecayLF2Prong
+  //  AliAODRecoDecayLF2Prong *the2Prong = new AliAODRecoDecayLF2Prong(secVert,px,py,pz,d0,d0err,dcap1n1);
+  AliAODRecoDecayLF2Prong *the2Prong = new AliAODRecoDecayLF2Prong(secVert,px,py,pz,d0,d0err,dca);
   the2Prong->SetOwnPrimaryVtx(primVertexAOD);
   
   //  the2Prong->SetProngIDs(2,{-999,999});
@@ -939,7 +949,7 @@ void AliAODNuclExReplicator::AddDaughterRefs(AliAODVertex *v,
 }
 //----------------------------------------------------------------------------
        
-void AliAODNuclExReplicator::AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd,
+void AliAODNuclExReplicator::AddRefs(AliAODVertex *v,AliAODRecoDecayLF *rd,
                                    const AliAODEvent &event,
                                    const TObjArray *trkArray) const
 
index 431dd70..352b04a 100644 (file)
@@ -21,7 +21,7 @@
 //         
 // Based on AliAODMuonReplicator.h (L. Aphecetche (Subatech))
 
-class AliAnalysisCuts;
+//class AliAnalysisCuts;
 class TClonesArray;
 class AliAODMCHeader;
 class AliAODVZERO;
@@ -32,8 +32,8 @@ class TArrayI;
 class AliAODv0;  
 class TRefArray;
 class AliAODRecoDecay;
-class AliAODRecoDecayHF;
-class AliAODRecoDecayHF2Prong;
+class AliAODRecoDecayLF;
+class AliAODRecoDecayLF2Prong;
 class AliVertexerTracks;
 class AliAODHeader;
 
@@ -47,21 +47,20 @@ class AliAODv0;
 
 class TH1F;
 
-// TODO add new constructor for the 3 prong case (it will write an AliAODRecoDecayHF3Prong
+// TODO add new constructor for the 3 prong case (it will write an AliAODRecoDecayLF3Prong
 
 class AliAODNuclExReplicator : public AliAODBranchReplicator
 {
  public:
   
   AliAODNuclExReplicator(const char* name="AliAODNuclExReplicator", 
-                       const char* title="Branch Replicator for muon related branches",
-                       AliAnalysisCuts* trackCut=0x0,
-                       AliAnalysisCuts* vertexCut=0x0,
-                       Int_t mcMode=0,
-                       Int_t nsigmaTrk1=3, Int_t partType1 = 2,
-                       Int_t nsigmaTrk2=3, Int_t partType2 = 7
-                       );
-  
+                        const char* title="Branch Replicator for muon related branches",
+                        /* AliAnalysisCuts* trackCut=0x0, */
+                        /* AliAnalysisCuts* vertexCut=0x0, */
+                        Int_t mcMode=0,
+                        Int_t nsigmaTrk1=3, Int_t partType1 = 2,
+                        Int_t nsigmaTrk2=3, Int_t partType2 = 7
+                        ); 
   //  Int_t partType; // 0 = e; 1 = mu; 2 = pi; 3 = K; 4= p; 5 = d; 6 =t ; 7 = 3He; 8=4He;
 
   virtual ~AliAODNuclExReplicator();
@@ -95,12 +94,12 @@ class AliAODNuclExReplicator : public AliAODBranchReplicator
   
   mutable AliAODHeader* fHeader; //! internal header object
   
-  AliAnalysisCuts* fVertexCut; // decides which vertices to keep
+  //  AliAnalysisCuts* fVertexCut; // decides which vertices to keep
   mutable TClonesArray* fVertices; //! internal array of vertices
   
   mutable TClonesArray* fNuclei; //! internal array of nuclei tracks
   
-  AliAnalysisCuts* fTrackCut; // decides which tracks to keep
+  //  AliAnalysisCuts* fTrackCut; // decides which tracks to keep
   mutable TClonesArray* fSecondaryVerices; //! internal array of secondary vertices canditates
    
   mutable TClonesArray* fDaughterTracks; //! internal SV daughter tracks
@@ -134,17 +133,17 @@ class AliAODNuclExReplicator : public AliAODBranchReplicator
   
   AliAODVertex* ReconstructSecondaryVertex(TObjArray *trkArray,Double_t &dispersion,Bool_t useTRefArray=kTRUE) const;
   
-  AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray,const AliAODEvent &evento,
+  AliAODRecoDecayLF2Prong* Make2Prong(TObjArray *twoTrackArray,const AliAODEvent &evento,
                                      AliAODVertex *secVert,Double_t dca);
 
-  /* AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray,AliAODEvent *evento, */
+  /* AliAODRecoDecayLF2Prong* Make2Prong(TObjArray *twoTrackArray,AliAODEvent *evento, */
   /*                                 AliAODVertex *secVert,Double_t dca); */
   
 
   void AddDaughterRefs(AliAODVertex *v, const AliAODEvent &event, const TObjArray *trkArray) const;
   /* void AddDaughterRefs(AliAODVertex *v, AliAODEvent *event, const TObjArray *trkArray) const; */
-  void AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd, const AliAODEvent &event, const TObjArray *trkArray) const;
-  /* void AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd, AliAODEvent *event, const TObjArray *trkArray) const; */
+  void AddRefs(AliAODVertex *v,AliAODRecoDecayLF *rd, const AliAODEvent &event, const TObjArray *trkArray) const;
+  /* void AddRefs(AliAODVertex *v,AliAODRecoDecayLF *rd, AliAODEvent *event, const TObjArray *trkArray) const; */
 
  private:
 
diff --git a/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF.cxx b/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF.cxx
new file mode 100644 (file)
index 0000000..5afcec7
--- /dev/null
@@ -0,0 +1,441 @@
+/**************************************************************************
+ * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * 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.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+/////////////////////////////////////////////////////////////
+// 
+// Base class for AOD reconstructed light-flavour decays
+// strongly based on AOD reconstructed heavy-flavour decay by
+// A.Dainese, andrea.dainese@lnl.infn.it
+// Author:  Ramona Lea (ramona.lea@cern.ch)
+/////////////////////////////////////////////////////////////
+
+#include <TDatabasePDG.h>
+#include <TVector3.h>
+#include <TRandom.h>
+#include "AliAODRecoDecay.h"
+#include "AliAODRecoDecayLF.h"
+#include "AliAODEvent.h"
+#include "AliVertexerTracks.h"
+#include "AliExternalTrackParam.h"
+#include "AliKFVertex.h"
+#include "AliVVertex.h"
+#include "AliESDVertex.h"
+
+ClassImp(AliAODRecoDecayLF)
+
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF::AliAODRecoDecayLF() :
+  AliAODRecoDecay(),
+  fOwnPrimaryVtx(0x0),
+  fEventPrimaryVtx(),
+  fListOfCuts(),
+  fd0err(0x0), 
+  fProngID(0x0),
+  fSelectionMap(0)
+{
+  //
+  // Default Constructor
+  //
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF::AliAODRecoDecayLF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
+                                    Double_t *px,Double_t *py,Double_t *pz,
+                                    Double_t *d0,Double_t *d0err) :
+  AliAODRecoDecay(vtx2,nprongs,charge,px,py,pz,d0),
+  fOwnPrimaryVtx(0x0),
+  fEventPrimaryVtx(),
+  fListOfCuts(),
+  fd0err(0x0),
+  fProngID(0x0),
+  fSelectionMap(0)
+{
+  //
+  // Constructor with AliAODVertex for decay vertex
+  //
+  fd0err = new Double_t[GetNProngs()];
+  for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF::AliAODRecoDecayLF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
+                                    Double_t *d0,Double_t *d0err) :
+  AliAODRecoDecay(vtx2,nprongs,charge,d0),
+  fOwnPrimaryVtx(0x0),
+  fEventPrimaryVtx(),
+  fListOfCuts(),
+  fd0err(0x0),
+  fProngID(0x0),
+  fSelectionMap(0)
+{
+  //
+  // Constructor with AliAODVertex for decay vertex and without prongs momenta
+  //
+  fd0err = new Double_t[GetNProngs()];
+  for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF::AliAODRecoDecayLF(Double_t vtx1[3],Double_t vtx2[3],
+                                    Int_t nprongs,Short_t charge,
+                                    Double_t *px,Double_t *py,Double_t *pz,
+                                    Double_t *d0) :
+  AliAODRecoDecay(0x0,nprongs,charge,px,py,pz,d0),
+  fOwnPrimaryVtx(0x0),
+  fEventPrimaryVtx(),
+  fListOfCuts(),
+  fd0err(0x0),
+  fProngID(0x0), 
+  fSelectionMap(0)
+{
+  //
+  // Constructor that can used for a "MC" object
+  //
+
+  fOwnPrimaryVtx = new AliAODVertex(vtx1);
+
+  AliAODVertex *vtx = new AliAODVertex(vtx2);
+  SetOwnSecondaryVtx(vtx);
+
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF::AliAODRecoDecayLF(const AliAODRecoDecayLF &source) :
+  AliAODRecoDecay(source),
+  fOwnPrimaryVtx(0x0),
+  fEventPrimaryVtx(source.fEventPrimaryVtx),
+  fListOfCuts(source.fListOfCuts),
+  fd0err(0x0),
+  fProngID(0x0),
+  fSelectionMap(source.fSelectionMap)
+{
+  //
+  // Copy constructor
+  //
+  if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
+
+  if(source.GetNProngs()>0) {
+    fd0err = new Double_t[GetNProngs()];
+    memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
+    if(source.fProngID) {
+      fProngID = new UShort_t[GetNProngs()];
+      memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
+    }
+  }
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF &AliAODRecoDecayLF::operator=(const AliAODRecoDecayLF &source)
+{
+  //
+  // assignment operator
+  //
+  if(&source == this) return *this;
+
+  AliAODRecoDecay::operator=(source);
+
+  fEventPrimaryVtx = source.fEventPrimaryVtx;
+  fListOfCuts = source.fListOfCuts;
+  fSelectionMap = source.fSelectionMap;
+
+  if(source.GetOwnPrimaryVtx()) {
+    delete fOwnPrimaryVtx;
+    fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
+  }
+
+  if(source.GetNProngs()>0) {
+    if(source.fd0err) {
+      delete [] fd0err;
+      fd0err = new Double_t[GetNProngs()];
+      memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
+    }
+    if(source.fProngID) {
+      delete [] fProngID;
+      fProngID = new UShort_t[GetNProngs()];
+      memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
+    }
+  }
+  return *this;
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF::~AliAODRecoDecayLF() {
+  //  
+  // Default Destructor
+  //
+  if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
+  if(fd0err) delete [] fd0err;
+  if(fProngID) delete [] fProngID;
+}
+//---------------------------------------------------------------------------
+AliKFParticle *AliAODRecoDecayLF::ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,Bool_t topoCostraint, Double_t bzkG, Double_t *mass) const {
+  //
+  // Applies the KF vertexer 
+  // Int_t iprongs[nprongs] = indices of the prongs to be used from the vertexer
+  // Int_t pdgs[nprongs] = pdgs assigned to the prongs, needed to define the AliKFParticle
+  // Bool_t topoCostraint = if kTRUE, the topological constraint is applied
+  // Double_t bzkG = magnetic field
+  // Double_t mass[2] = {mass, sigma} for the mass constraint (if mass[0]>0 the constraint is applied).
+  //
+
+  AliKFParticle::SetField(bzkG);
+  AliKFParticle *vertexKF=0;
+  
+  AliKFVertex copyKF;
+  Int_t nt=0,ntcheck=0;
+
+  Double_t pos[3]={0.,0.,0.};
+  if(!fOwnPrimaryVtx) {
+    printf("AliAODRecoDecayLF::ApplyVertexingKF(): cannot apply because primary vertex is not found\n");
+    return vertexKF;
+  }
+  fOwnPrimaryVtx->GetXYZ(pos);
+  Int_t contr=fOwnPrimaryVtx->GetNContributors();
+  Double_t covmatrix[6]={0.,0.,0.,0.,0.,0.};
+  fOwnPrimaryVtx->GetCovarianceMatrix(covmatrix);
+  Double_t chi2=fOwnPrimaryVtx->GetChi2();
+  AliESDVertex primaryVtx2(pos,covmatrix,chi2,contr,"Vertex");
+
+  if(topoCostraint){
+   copyKF=AliKFVertex(primaryVtx2);
+   nt=primaryVtx2.GetNContributors();
+   ntcheck=nt;
+  }
+
+  vertexKF = new AliKFParticle();
+  for(Int_t i= 0;i<nprongs;i++){
+    Int_t ipr=iprongs[i];
+    AliAODTrack *aodTrack = (AliAODTrack*)GetDaughter(ipr);
+    if(!aodTrack) {
+      printf("AliAODRecoDecayLF::ApplyVertexingKF(): no daughters available\n");
+      delete vertexKF; vertexKF=NULL;
+      return vertexKF;
+    }
+    AliKFParticle daughterKF(*aodTrack,pdgs[i]);
+    vertexKF->AddDaughter(daughterKF);
+    
+    if(topoCostraint && nt>0){
+      //Int_t index=(Int_t)GetProngID(ipr);
+      if(!aodTrack->GetUsedForPrimVtxFit()) continue;
+      copyKF -= daughterKF;
+      ntcheck--;
+    }
+  }
+  
+  if(topoCostraint){
+    if(ntcheck>0) {
+      copyKF += (*vertexKF);
+      vertexKF->SetProductionVertex(copyKF);
+    }
+ }
+  
+  if(mass[0]>0.){
+    vertexKF->SetMassConstraint(mass[0],mass[1]);
+  }
+  
+  return vertexKF;
+}
+//---------------------------------------------------------------------------
+AliAODVertex* AliAODRecoDecayLF::RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod) {
+  //
+  // This method returns a primary vertex without the daughter tracks of the 
+  // candidate and it recalculates the impact parameters and errors.
+  // 
+  // The output vertex is created with "new". The user has to 
+  // set it to the candidate with SetOwnPrimaryVtx(), unset it at the end 
+  // of processing with UnsetOwnPrimaryVtx() and delete it.
+  // If a NULL pointer is returned, the removal failed (too few tracks left).
+  //
+  // For the moment, the primary vertex is recalculated from scratch without
+  // the daughter tracks.
+  //
+
+  AliAODVertex *vtxAOD = aod->GetPrimaryVertex();
+  if(!vtxAOD) return 0;
+  TString title=vtxAOD->GetTitle();
+  if(!title.Contains("VertexerTracks")) return 0;
+
+
+
+  AliVertexerTracks *vertexer = new AliVertexerTracks(aod->GetMagneticField());
+
+  Int_t ndg = GetNDaughters();
+
+  vertexer->SetITSMode();
+  vertexer->SetMinClusters(3);
+  vertexer->SetConstraintOff();
+
+  if(title.Contains("WithConstraint")) {
+    Float_t diamondcovxy[3];
+    aod->GetDiamondCovXY(diamondcovxy);
+    Double_t pos[3]={aod->GetDiamondX(),aod->GetDiamondY(),0.};
+    Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
+    AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
+    vertexer->SetVtxStart(diamond);
+    delete diamond; diamond=NULL;
+  }
+
+  Int_t skipped[10]; for(Int_t i=0;i<10;i++) skipped[i]=-1;
+  Int_t nTrksToSkip=0,id;
+  AliAODTrack *t = 0;
+  for(Int_t i=0; i<ndg; i++) {
+    t = (AliAODTrack*)GetDaughter(i);
+    id = (Int_t)t->GetID();
+    if(id<0) continue;
+    skipped[nTrksToSkip++] = id;
+  }
+
+  vertexer->SetSkipTracks(nTrksToSkip,skipped);
+  AliESDVertex *vtxESDNew = vertexer->FindPrimaryVertex(aod);
+
+  delete vertexer; vertexer=NULL;
+
+  if(!vtxESDNew) return 0;
+  if(vtxESDNew->GetNContributors()<=0) { 
+    delete vtxESDNew; vtxESDNew=NULL;
+    return 0;
+  }
+
+  // convert to AliAODVertex
+  Double_t pos[3],cov[6],chi2perNDF;
+  vtxESDNew->GetXYZ(pos); // position
+  vtxESDNew->GetCovMatrix(cov); //covariance matrix
+  chi2perNDF = vtxESDNew->GetChi2toNDF();
+  delete vtxESDNew; vtxESDNew=NULL;
+
+  AliAODVertex *vtxAODNew = new AliAODVertex(pos,cov,chi2perNDF);
+
+  RecalculateImpPars(vtxAODNew,aod);
+
+  return vtxAODNew;
+}
+//-----------------------------------------------------------------------------------
+void AliAODRecoDecayLF::RecalculateImpPars(AliAODVertex *vtxAODNew,AliAODEvent* aod) {
+  //
+  // now recalculate the daughters impact parameters
+  //
+  Double_t dz[2],covdz[3];
+  for(Int_t i=0; i<GetNDaughters(); i++) {
+    AliAODTrack *t = (AliAODTrack*)GetDaughter(i);
+    AliExternalTrackParam etp; etp.CopyFromVTrack(t);
+    if(etp.PropagateToDCA(vtxAODNew,aod->GetMagneticField(),3.,dz,covdz)) {
+      fd0[i]    = dz[0];
+      fd0err[i] = TMath::Sqrt(covdz[0]);
+    }
+  }
+
+  return;
+}
+//-----------------------------------------------------------------------------------
+void AliAODRecoDecayLF::Misalign(TString misal) {
+  //
+  // Method to smear the impact parameter of the duaghter tracks
+  // and the sec. vtx position accordinlgy 
+  // Useful to study effect of misalignment.
+  // The starting point are parameterisations of the impact parameter resolution
+  // from MC and data 
+  // Errors on d0 and vtx are not recalculated (to be done)
+  //
+  if(misal=="null")return;
+  Double_t pard0rphiMC[3]={36.7,36.,1.25};// d0(pt)=[0]+[1]/(pt^[2]); in micron, conversion to cm is done later
+  Double_t pard0rphimisal[3]={0,0,0};
+  Double_t pard0zMC[3]={85.,130.,0.7};// d0(pt)=[0]+[1]/(pt^[2]); in micron, conversion to cm is done later
+  Double_t pard0zmisal[3]={0,0,0};
+  if(misal=="data") {
+    //use this to reproduce data d0(pt) trend for pions
+    pard0rphimisal[0]=37.;
+    pard0rphimisal[1]=37.5;
+    pard0rphimisal[2]=1.25;
+    pard0zmisal[0]=96.;
+    pard0zmisal[1]=131.;
+    pard0zmisal[2]=0.7;
+  }
+  else if(misal=="resB") {
+    // temporary values: asymptotic value larger by a factor 1.2 w.r.t. MC
+    pard0rphimisal[0]=44.4;
+    pard0rphimisal[1]=37.5;
+    pard0rphimisal[2]=1.25;
+    pard0zmisal[0]=115.2;
+    pard0zmisal[1]=131.;
+    pard0zmisal[2]=0.7;
+  }
+  else if(misal=="resC") {
+    // temporary values: slightly larger asymptotic value, larger values at low pt
+    pard0rphimisal[0]=40.;
+    pard0rphimisal[1]=40.;
+    pard0rphimisal[2]=1.3;
+    pard0zmisal[0]=125.;
+    pard0zmisal[1]=131.;
+    pard0zmisal[2]=0.85;
+  }
+  else printf("AliAODRecoDecayLF::Misalign():  wrong misalign type specified \n");
+
+  AliAODVertex *evVtx=0x0,*secVtx=0x0;
+  Double_t evVtxPos[3]={-9999.,-9999.,-9999.},secVtxPos[3]={-9999.,9999.,9999.};
+  if(fOwnPrimaryVtx)fOwnPrimaryVtx->GetXYZ(evVtxPos);
+  else {
+    evVtx=(AliAODVertex*)(fEventPrimaryVtx.GetObject());
+    evVtx->GetXYZ(evVtxPos);
+  }
+  secVtx=(AliAODVertex*)GetSecondaryVtx();
+  secVtx->GetXYZ(secVtxPos);
+  
+  TVector3 v2v1(secVtxPos[0]-evVtxPos[0],secVtxPos[1]-evVtxPos[1],0.);
+
+  Double_t sigmarphinull,sigmarphimisal,sigmarphiadd;
+  Double_t sigmaznull,sigmazmisal,sigmazadd;
+  Double_t deltad0rphi[10],deltad0z[10];
+  
+  // loop on the two prongs
+  for(Int_t i=0; i<fNProngs; i++) { 
+    sigmarphinull = pard0rphiMC[0]+pard0rphiMC[1]/TMath::Power(PtProng(i),pard0rphiMC[2]);
+    sigmarphimisal = pard0rphimisal[0]+pard0rphimisal[1]/TMath::Power(PtProng(i),pard0rphimisal[2]);
+    if(sigmarphimisal>sigmarphinull) {
+      sigmarphiadd = TMath::Sqrt(sigmarphimisal*sigmarphimisal-
+                                sigmarphinull*sigmarphinull);
+      deltad0rphi[i] = gRandom->Gaus(0.,sigmarphiadd);
+    } else {
+      deltad0rphi[i] = 0.;
+    }
+
+    sigmaznull =  pard0zMC[0]+pard0zMC[1]/TMath::Power(PtProng(i),pard0zMC[2]);
+    sigmazmisal = pard0zmisal[0]+pard0zmisal[1]/TMath::Power(PtProng(i),pard0zmisal[2]);
+    if(sigmazmisal>sigmaznull) {
+      sigmazadd = TMath::Sqrt(sigmazmisal*sigmazmisal-
+                             sigmaznull*sigmaznull);
+      deltad0z[i] = gRandom->Gaus(0.,sigmazadd);
+    } else {
+      deltad0z[i] = 0.;
+    }
+
+    TVector3 pxy(fPx[i],fPy[i],0.);
+    TVector3 pxycrossv2v1=pxy.Cross(v2v1);
+    if( pxycrossv2v1.Z()*fd0[i] > 0 ) {
+      secVtxPos[0]+=1.e-4*deltad0rphi[i]*(-fPy[i])/PtProng(i);// e-4: conversion to cm
+      secVtxPos[1]+=1.e-4*deltad0rphi[i]*(+fPx[i])/PtProng(i);    
+    } else {
+      secVtxPos[0]+=1.e-4*deltad0rphi[i]*(+fPy[i])/PtProng(i);
+      secVtxPos[1]+=1.e-4*deltad0rphi[i]*(-fPx[i])/PtProng(i);    
+    }
+    
+    // change d0rphi
+    fd0[i] += 1.e-4*deltad0rphi[i]; // e-4: conversion to cm
+    // change secondary vertex z
+    secVtxPos[2]+=0.5e-4*deltad0z[i];
+  }
+  secVtx->SetX(secVtxPos[0]);
+  secVtx->SetY(secVtxPos[1]);
+  secVtx->SetZ(secVtxPos[2]);
+
+  return;
+}
diff --git a/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF.h b/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF.h
new file mode 100644 (file)
index 0000000..ed0b45e
--- /dev/null
@@ -0,0 +1,237 @@
+#ifndef ALIAODRECODECAYLF_H
+#define ALIAODRECODECAYLF_H
+/* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */ 
+
+//***********************************************************
+// Class AliAODRecoDecayLF
+// base class for AOD reconstructed light-flavour decays
+// strongly based on AliAODRecoDecayHF by A.Dainese, andrea.dainese@lnl.infn.it
+// Author: Ramona Lea (ramona.lea@cern.ch)
+//***********************************************************
+
+#include <TRef.h>
+#include <TList.h>
+#include "AliAODTrack.h"
+#include "AliAODRecoDecay.h"
+
+class AliAODEvent;
+class AliKFParticle;
+
+class AliAODRecoDecayLF : public AliAODRecoDecay {
+
+ public:
+
+  AliAODRecoDecayLF();
+  AliAODRecoDecayLF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
+                   Double_t *px,Double_t *py,Double_t *pz,
+                   Double_t *d0,Double_t *d0err);
+  AliAODRecoDecayLF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
+                   Double_t *d0,Double_t *d0err);
+  AliAODRecoDecayLF(Double_t vtx1[3],Double_t vtx2[3],
+                   Int_t nprongs,Short_t charge,
+                   Double_t *px,Double_t *py,Double_t *pz,Double_t *d0);
+  virtual ~AliAODRecoDecayLF();
+
+  AliAODRecoDecayLF(const AliAODRecoDecayLF& source);
+  AliAODRecoDecayLF& operator=(const AliAODRecoDecayLF& source); 
+   
+
+  // primary vertex
+  void SetPrimaryVtxRef(TObject *vtx) { fEventPrimaryVtx = vtx; }
+  AliAODVertex* GetPrimaryVtxRef() const { return (AliAODVertex*)(fEventPrimaryVtx.GetObject()); }
+  void SetOwnPrimaryVtx(const AliAODVertex *vtx) { UnsetOwnPrimaryVtx(); fOwnPrimaryVtx = new AliAODVertex(*vtx);}
+  void CheckOwnPrimaryVtx() const 
+    {if(!fOwnPrimaryVtx) printf("fOwnPrimaryVtx not set"); return;}
+  AliAODVertex* GetOwnPrimaryVtx() const {return fOwnPrimaryVtx;}
+  void GetOwnPrimaryVtx(Double_t vtx[3]) const 
+    {CheckOwnPrimaryVtx();fOwnPrimaryVtx->GetPosition(vtx);}
+  void UnsetOwnPrimaryVtx() {if(fOwnPrimaryVtx) {delete fOwnPrimaryVtx; fOwnPrimaryVtx=0;} return;}
+  AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); }
+  AliAODVertex* RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod);  
+  void          RecalculateImpPars(AliAODVertex *vtxAODNew,AliAODEvent *aod);
+
+
+  // kinematics & topology
+  Double_t DecayLength2() const 
+    { return AliAODRecoDecay::DecayLength2(GetPrimaryVtx());}
+  Double_t DecayLength() const 
+    { return AliAODRecoDecay::DecayLength(GetPrimaryVtx());}
+  Double_t DecayLengthError() const 
+    { return AliAODRecoDecay::DecayLengthError(GetPrimaryVtx());}
+  Double_t NormalizedDecayLength() const 
+    { return AliAODRecoDecay::NormalizedDecayLength(GetPrimaryVtx());}
+  Double_t NormalizedDecayLength2() const 
+    { return AliAODRecoDecay::NormalizedDecayLength2(GetPrimaryVtx());}
+  Double_t DecayLengthXY() const 
+    { return AliAODRecoDecay::DecayLengthXY(GetPrimaryVtx());}
+  Double_t DecayLengthXYError() const 
+    { return AliAODRecoDecay::DecayLengthXYError(GetPrimaryVtx());}
+  Double_t NormalizedDecayLengthXY() const 
+    { return AliAODRecoDecay::NormalizedDecayLengthXY(GetPrimaryVtx());}
+  Double_t Ct(UInt_t pdg) const 
+    { return AliAODRecoDecay::Ct(pdg,GetPrimaryVtx());}
+  Double_t CosPointingAngle() const 
+    { return AliAODRecoDecay::CosPointingAngle(GetPrimaryVtx());}
+  Double_t CosPointingAngleXY() const 
+    { return AliAODRecoDecay::CosPointingAngleXY(GetPrimaryVtx());}
+  Double_t ImpParXY() const 
+    { return AliAODRecoDecay::ImpParXY(GetPrimaryVtx());}
+  Double_t QtProngFlightLine(Int_t ip) const 
+    { return AliAODRecoDecay::QtProngFlightLine(ip,GetPrimaryVtx());}
+  Double_t QlProngFlightLine(Int_t ip) const 
+    { return AliAODRecoDecay::QlProngFlightLine(ip,GetPrimaryVtx());}
+
+  // prongs
+  Double_t Getd0errProng(Int_t ip) const {return fd0err[ip];}
+  void     Setd0errProngs(Int_t nprongs,Double_t *d0);
+  Double_t Normalizedd0Prong(Int_t ip) const 
+    {return Getd0Prong(ip)/Getd0errProng(ip);}
+  
+  void SetProngIDs(Int_t nIDs,UShort_t *id);
+  UShort_t GetProngID(Int_t ip) const 
+    {if(fProngID) {return fProngID[ip];} else {return 9999;}}
+
+  // ITS clustermap for daughters
+  Bool_t DaughterHasPointOnITSLayer(Int_t dg,Int_t l) const;
+
+  // 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());} */
+  /* AliRDLFCuts *GetCuts(const char* name) const; */
+
+  // vertexing KF:
+  AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
+                                Bool_t topoCostraint,Double_t bzkG,
+                                Double_t *mass) const;
+  
+  // misalign
+  void Misalign(TString misal="null");
+
+  // selection map
+  void    SetSelectionBit(Int_t i) {SETBIT(fSelectionMap,i); return;}
+  Bool_t  HasSelectionBit(Int_t i) const {return TESTBIT(fSelectionMap,i);}
+  ULong_t GetSelectionMap() const {return fSelectionMap;}
+
+  Int_t   NumberOfFakeDaughters() const;
+
+  Bool_t  HasBadDaughters() const; // TPC+ITS tracks not passing the StandardCuts2010 with loose DCA
+
+ protected:
+
+  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
+  ULong_t       fSelectionMap; // used to store outcome of selection in AliAnalysisVertexingLF
+
+  ClassDef(AliAODRecoDecayLF,5)  // base class for AOD reconstructed heavy-flavour decays
+};
+
+inline void AliAODRecoDecayLF::SetProngIDs(Int_t nIDs,UShort_t *id) 
+{
+  if(nIDs!=GetNProngs()) { 
+    printf("Wrong number of IDs, must be nProngs\n");
+    return;
+  }
+  if(fProngID) delete [] fProngID;
+  fProngID = new UShort_t[nIDs];
+  for(Int_t i=0;i<nIDs;i++) 
+    fProngID[i] = id[i]; 
+  return;
+}
+
+inline Bool_t AliAODRecoDecayLF::IsLikeSign() const
+{
+  // check if it is like-sign
+
+  Int_t ndg=GetNDaughters();
+  if(!ndg) {
+    printf("Daughters not available\n");
+    return kFALSE;
+  }
+  Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge();
+
+  for(Int_t i=1; i<ndg; i++) {
+    if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE;
+  }
+
+  return kTRUE;
+}
+
+inline Bool_t AliAODRecoDecayLF::DaughterHasPointOnITSLayer(Int_t dg,Int_t l) const
+{
+  // ITS clustermap for daughters
+
+  if(l<0 || l>5) {
+    printf("ERROR: layer has to be in the range 0-5\n");
+    return kFALSE;
+  }
+  AliAODTrack *t = (AliAODTrack*)GetDaughter(dg);
+  if(!t) return kFALSE;
+
+  return TESTBIT(t->GetITSClusterMap(),l);
+}
+
+inline Int_t AliAODRecoDecayLF::NumberOfFakeDaughters() const 
+{
+  // Count number of daughters with negative label
+
+  Int_t nfakes=0;
+  for(Int_t i=0; i<GetNDaughters(); i++) {
+    AliAODTrack *track=(AliAODTrack*)GetDaughter(i);
+
+    if(track->Charge()==0) { // this is a two prong decay
+      AliAODRecoDecay *rd=(AliAODRecoDecay*)GetDaughter(i);
+      for(Int_t j=0; j<rd->GetNDaughters(); j++) {
+       AliAODTrack *track2=(AliAODTrack*)GetDaughter(j);
+       if(track2->GetLabel()<0) nfakes++;
+      }
+      continue;
+    }
+
+    if(track->GetLabel()<0) nfakes++;
+  }
+  return nfakes;
+}
+
+inline void AliAODRecoDecayLF::Setd0errProngs(Int_t nprongs,Double_t *d0err) 
+{
+  if(nprongs!=GetNProngs()) { 
+    printf("Wrong number of momenta, must be nProngs");
+    return;
+  }
+  if(!fd0) {
+    fd0err = new Double32_t[nprongs];
+  }
+  for(Int_t i=0;i<nprongs;i++) {
+    fd0err[i] = d0err[i]; 
+  }
+
+  return;
+}
+
+inline Bool_t AliAODRecoDecayLF::HasBadDaughters() const {
+
+  // checks if at least one of ITS+TPC daughters didn't pass the StandardCuts2010 with loose DCA (ie doesn't have the BIT(4) set)
+
+  for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
+    if (GetDaughter(iDau)==NULL) continue;
+    AliAODTrack* at=dynamic_cast<AliAODTrack*>(GetDaughter(iDau));
+    if (!at) continue;
+    if(at->Charge()==0) continue;
+    if(at->GetTPCNcls()==0) continue;
+    if(!(at->TestFilterMask(BIT(4)))) return kTRUE;
+  }
+  return kFALSE;
+}
+
+
+#endif
+
diff --git a/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.cxx b/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.cxx
new file mode 100644 (file)
index 0000000..189979f
--- /dev/null
@@ -0,0 +1,79 @@
+/**************************************************************************
+ * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * 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.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+/////////////////////////////////////////////////////////////
+//
+// Base class for AOD reconstructed2-prong decay
+// strongly based on AliAODRecoDecayHF2Prong  
+// Author: Ramona Lea (ramona.lea@cern.ch)
+/////////////////////////////////////////////////////////////
+
+#include <TDatabasePDG.h>
+#include "AliAODRecoDecayLF.h"
+#include "AliAODRecoDecayLF2Prong.h"
+
+ClassImp(AliAODRecoDecayLF2Prong)
+
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF2Prong::AliAODRecoDecayLF2Prong() :
+  AliAODRecoDecayLF()
+{
+  //
+  // Default Constructor
+  //
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF2Prong::AliAODRecoDecayLF2Prong(AliAODVertex *vtx2,
+                                                Double_t *px,Double_t *py,Double_t *pz,
+                                                Double_t *d0,Double_t *d0err,Float_t dca) :
+  AliAODRecoDecayLF(vtx2,2,0,px,py,pz,d0,d0err)
+{
+  //
+  // Constructor with AliAODVertex for decay vertex
+  //
+  SetDCA(dca);
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF2Prong::AliAODRecoDecayLF2Prong(AliAODVertex *vtx2,
+                                                Double_t *d0,Double_t *d0err,Float_t dca) :
+  AliAODRecoDecayLF(vtx2,2,0,d0,d0err)
+{
+  //
+  // Constructor with AliAODVertex for decay vertex and without prongs momenta
+  //
+  SetDCA(dca);
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF2Prong::AliAODRecoDecayLF2Prong(const AliAODRecoDecayLF2Prong &source) :
+  AliAODRecoDecayLF(source)
+{
+  //
+  // Copy constructor
+  //
+}
+//--------------------------------------------------------------------------
+AliAODRecoDecayLF2Prong &AliAODRecoDecayLF2Prong::operator=(const AliAODRecoDecayLF2Prong &source)
+{
+  //
+  // assignment operator
+  //
+  if(&source == this) return *this;
+
+  AliAODRecoDecayLF::operator=(source);
+
+  return *this;
+}
diff --git a/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.h b/PWGLF/STRANGENESS/Hypernuclei/AliAODRecoDecayLF2Prong.h
new file mode 100644 (file)
index 0000000..932f6d6
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef ALIAODRECODECAYLF2PRONG_H
+#define ALIAODRECODECAYLF2PRONG_H
+/* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */ 
+
+//***********************************************************
+// Class AliAODRecoDecayLF2Prong
+// base class for AOD reconstructed 2-prong decays
+// (3LH->3Hepi, ...)
+//  strongly based on AliAODRecoDecayHF2Prong 
+//  by A.Dainese and G.E.Bruno
+//
+//  Author: Ramona Lea (ramona.lea@cern.ch) 
+// 
+//***********************************************************
+
+#include "AliAODRecoDecay.h"
+#include "AliAODRecoDecayLF.h"
+
+class AliAODRecoDecayLF2Prong : public AliAODRecoDecayLF {
+
+ public:
+
+  AliAODRecoDecayLF2Prong();
+  AliAODRecoDecayLF2Prong(AliAODVertex *vtx2,
+                         Double_t *px,Double_t *py,Double_t *pz,
+                         Double_t *d0,Double_t *d0err,Float_t dca);
+  AliAODRecoDecayLF2Prong(AliAODVertex *vtx2,
+                         Double_t *d0,Double_t *d0err,Float_t dca);    
+  AliAODRecoDecayLF2Prong(const AliAODRecoDecayLF2Prong& source);
+  AliAODRecoDecayLF2Prong& operator=(const AliAODRecoDecayLF2Prong& source); 
+
+  virtual ~AliAODRecoDecayLF2Prong() {}  
+  Double_t Prodd0d0() const {return AliAODRecoDecay::Prodd0d0(0,1);} 
+
+  
+
+ private:
+
+  ClassDef(AliAODRecoDecayLF2Prong,1)  // base class for AOD reconstructed 
+                                       // heavy-flavour 2-prong decays
+};
+
+#endif
index 46dbc33..399fbf0 100644 (file)
 using std::cout;
 using std::endl;
 ClassImp(AliAnalysisTaskESDNuclExFilter)
-ClassImp(AliAnalysisNonMuonTrackCuts)
+//ClassImp(AliAnalysisNonMuonTrackCuts)
 
 ////////////////////////////////////////////////////////////////////////
 
-AliAnalysisNonMuonTrackCuts::AliAnalysisNonMuonTrackCuts()
-{
-  // default ctor 
-}
+// AliAnalysisNonMuonTrackCuts::AliAnalysisNonMuonTrackCuts()
+// {
+//   // default ctor 
+// }
 
-Bool_t AliAnalysisNonMuonTrackCuts::IsSelected(TObject* obj)
-{
-  // Returns true if the object is a muon track
-  AliAODTrack* track = dynamic_cast<AliAODTrack*>(obj);
+// Bool_t AliAnalysisNonMuonTrackCuts::IsSelected(TObject* obj)
+// {
+//   // Returns true if the object is a muon track
+//   AliAODTrack* track = dynamic_cast<AliAODTrack*>(obj);
 
-  ULong_t  status;
+//   ULong_t  status;
 
-  if(track){
+//   if(track){
     
-    status  = (ULong_t)track->GetStatus();
-
-    if(track->GetTPCNcls() > 80 &&
-       track->Chi2perNDF() < 5  &&
-       track->IsOn(AliAODTrack::kTPCrefit) &&
-       track->IsOn(AliAODTrack::kTPCin)    &&
-       !track->IsOn(AliAODTrack::kITSpureSA))
-      {
-       return kTRUE;
-      }
-  } 
+//     status  = (ULong_t)track->GetStatus();
+
+//     if(track->GetTPCNcls() > 80 &&
+//        track->Chi2perNDF() < 5  &&
+//        track->IsOn(AliAODTrack::kTPCrefit) &&
+//        track->IsOn(AliAODTrack::kTPCin)    &&
+//        !track->IsOn(AliAODTrack::kITSpureSA))
+//       {
+//     return kTRUE;
+//       }
+//   } 
   
-  else 
-    return kFALSE;
+//   else 
+//     return kFALSE;
   
 
-}
+// }
 
-AliAnalysisNonPrimaryVertices::AliAnalysisNonPrimaryVertices()
-{
-  // default ctor   
-}
+// AliAnalysisNonPrimaryVertices::AliAnalysisNonPrimaryVertices()
+// {
+//   // default ctor   
+// }
 
-Bool_t AliAnalysisNonPrimaryVertices::IsSelected(TObject* obj)
-{
-  // Returns true if the object is a primary vertex
+// Bool_t AliAnalysisNonPrimaryVertices::IsSelected(TObject* obj)
+// {
+//   // Returns true if the object is a primary vertex
   
-  AliAODVertex* vertex = dynamic_cast<AliAODVertex*>(obj);
-  if (vertex)
-    {
-      if ( vertex->GetType() == AliAODVertex::kPrimary     ||
-          vertex->GetType() == AliAODVertex::kMainSPD     ||
-          vertex->GetType() == AliAODVertex::kPileupSPD   ||
-          vertex->GetType() == AliAODVertex::kPileupTracks||
-          vertex->GetType() == AliAODVertex::kMainTPC )
-       {
-         return kTRUE;
-       }
-    }
+//   AliAODVertex* vertex = dynamic_cast<AliAODVertex*>(obj);
+//   if (vertex)
+//     {
+//       if ( vertex->GetType() == AliAODVertex::kPrimary     ||
+//        vertex->GetType() == AliAODVertex::kMainSPD     ||
+//        vertex->GetType() == AliAODVertex::kPileupSPD   ||
+//        vertex->GetType() == AliAODVertex::kPileupTracks||
+//        vertex->GetType() == AliAODVertex::kMainTPC )
+//     {
+//       return kTRUE;
+//     }
+//     }
   
-  //  enum AODVtx_t {kUndef=-1, kPrimary, kKink, kV0, kCascade, kMulti, kMainSPD, kPileupSPD, kPileupTracks,kMainTPC};
+//   //  enum AODVtx_t {kUndef=-1, kPrimary, kKink, kV0, kCascade, kMulti, kMainSPD, kPileupSPD, kPileupTracks,kMainTPC};
 
-  return kFALSE;
+//   return kFALSE;
   
-}
+// }
+//-----------------------------------------------------------------------------------
 
 AliAnalysisTaskESDNuclExFilter::AliAnalysisTaskESDNuclExFilter(Bool_t onlyMuon, Bool_t keepAllEvents, Int_t mcMode, Int_t nsigmaTrk1,Int_t nsigmaTrk2, Int_t partType1,Int_t partType2):
   AliAnalysisTaskSE(),
@@ -235,8 +236,8 @@ void AliAnalysisTaskESDNuclExFilter::AddFilteredAOD(const char* aodfilename, con
 
       murep = new AliAODNuclExReplicator("NuclExReplicator",
                                         "remove non interesting tracks",
-                                        new AliAnalysisNonMuonTrackCuts,
-                                        new AliAnalysisNonPrimaryVertices,
+                                        // new AliAnalysisNonMuonTrackCuts,
+                                        // new AliAnalysisNonPrimaryVertices,
                                         fMCMode,fnSigmaTrk1,fnSigmaTrk2,fpartType1,fpartType2);
       
       //cout<<"murep: "<<murep<<endl;
@@ -367,10 +368,12 @@ void AliAnalysisTaskESDNuclExFilter::ConvertESDtoAOD()
 
     if ( extNuclEx ) {                         
      //   extNuclEx->Init("");
-     extNuclEx->SetEvent(lAODevent);
-     extNuclEx->SelectEvent();
-     extNuclEx->Print();
-     extNuclEx->FinishEvent();
+     
+      extNuclEx->SetEvent(lAODevent);
+      extNuclEx->SelectEvent();
+      // extNuclEx->IsFilteredAOD();
+      // extNuclEx->Print();
+      extNuclEx->FinishEvent();
      
      //cout<<"extMuons? "<<extMuons<<endl;
 
index 914b06c..19870dc 100644 (file)
@@ -75,26 +75,26 @@ class AliAnalysisTaskESDNuclExFilter : public AliAnalysisTaskSE
   ClassDef(AliAnalysisTaskESDNuclExFilter, 5); // Analysis task for standard ESD filtering
 };
  
-class AliAnalysisNonMuonTrackCuts : public AliAnalysisCuts
-{
-public:
-  AliAnalysisNonMuonTrackCuts();
-  virtual ~AliAnalysisNonMuonTrackCuts() {}
-  virtual Bool_t IsSelected(TObject* obj);
-  virtual Bool_t IsSelected(TList*   /* list */ ) { return kTRUE; }
-
-  ClassDef(AliAnalysisNonMuonTrackCuts,1); // Select muon spectrometer tracks
-};
-
-class AliAnalysisNonPrimaryVertices : public AliAnalysisCuts
-{
-public:
-  AliAnalysisNonPrimaryVertices();
-  virtual ~AliAnalysisNonPrimaryVertices() {}
-  virtual Bool_t IsSelected(TObject* obj);
-  virtual Bool_t IsSelected(TList*   /* list */ ) { return kTRUE; }
+/* class AliAnalysisNonMuonTrackCuts : public AliAnalysisCuts */
+/* { */
+/* public: */
+/*   AliAnalysisNonMuonTrackCuts(); */
+/*   virtual ~AliAnalysisNonMuonTrackCuts() {} */
+/*   /\* virtual Bool_t IsSelected(TObject* obj); *\/ */
+/*   /\* virtual Bool_t IsSelected(TList*   /\\* list *\\/ ) { return kTRUE; } *\/ */
+
+/*   ClassDef(AliAnalysisNonMuonTrackCuts,1); // Select muon spectrometer tracks */
+/* }; */
+
+/* class AliAnalysisNonPrimaryVertices : public AliAnalysisCuts */
+/* { */
+/* public: */
+/*   AliAnalysisNonPrimaryVertices(); */
+/*   virtual ~AliAnalysisNonPrimaryVertices() {} */
+/*   /\* virtual Bool_t IsSelected(TObject* obj); *\/ */
+/*   /\* virtual Bool_t IsSelected(TList*   /\\* list *\\/ ) { return kTRUE; } *\/ */
   
-  ClassDef(AliAnalysisNonPrimaryVertices,1); // Select primary vertices
-};
+/*   ClassDef(AliAnalysisNonPrimaryVertices,1); // Select primary vertices */
+/* }; */
 
 #endif