]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliAODRecoDecayHF3Prong.cxx
Update (Zaida)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoDecayHF3Prong.cxx
index ab6eeb0541103a7d4dca83724ce393292766e217..f5ae964d713a510014b7ff147d2167ff5d34fa91 100644 (file)
@@ -23,6 +23,7 @@
 #include <TDatabasePDG.h>
 #include "AliAODRecoDecayHF.h"
 #include "AliAODRecoDecayHF3Prong.h"
+#include "AliAODTrack.h"
 
 ClassImp(AliAODRecoDecayHF3Prong)
 
@@ -86,45 +87,21 @@ AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDeca
   // assignment operator
   //
   if(&source == this) return *this;
-  fOwnPrimaryVtx = source.fOwnPrimaryVtx;
-  fSecondaryVtx = source.fSecondaryVtx;
-  fCharge = source.fCharge;
-  fNProngs = source.fNProngs;
-  fNDCA = source.fNDCA;
-  fNPID = source.fNPID;
-  fEventNumber = source.fEventNumber;
-  fRunNumber = source.fRunNumber;
+
+  AliAODRecoDecayHF::operator=(source);
+
   fDist12toPrim= source.fDist12toPrim;
   fDist23toPrim= source.fDist23toPrim;
   fSigmaVert= source.fSigmaVert;
-  if(source.GetNProngs()>0) {
-    fd0 = new Double_t[GetNProngs()];
-    fd0err = new Double_t[GetNProngs()];
-    memcpy(fd0,source.fd0,GetNProngs()*sizeof(Double_t));
-    memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
-    if(source.fPx) {
-      fPx = new Double_t[GetNProngs()];
-      fPy = new Double_t[GetNProngs()];
-      fPz = new Double_t[GetNProngs()];
-      memcpy(fPx,source.fPx,GetNProngs()*sizeof(Double_t));
-      memcpy(fPy,source.fPy,GetNProngs()*sizeof(Double_t));
-      memcpy(fPz,source.fPz,GetNProngs()*sizeof(Double_t));
-    }
-    if(source.fPID) {
-      fPID = new Double_t[5*GetNProngs()];
-      memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
-    }
-    if(source.fDCA) {
-      fDCA = new Double32_t[GetNProngs()*(GetNProngs()-1)/2];
-      memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
-    }
-    if(source.fProngID) {
-      fProngID = new UShort_t[GetNProngs()];
-      memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
-    }
-  }
+
   return *this;
 }
+//-------------Temporary fix: overload AliAODRecoDecay::Charge()-----------
+Short_t AliAODRecoDecayHF3Prong::Charge() const {
+  Short_t charge=0;
+  for(Int_t daught=0;daught<=2;daught++)charge=charge+((AliAODTrack*)GetDaughter(daught))->Charge();
+  return charge;
+}
 //--------------------------------------------------------------------------
 Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
   const {
@@ -156,7 +133,7 @@ Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
   if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion2
 
   //DCA
-  for(Int_t i=0;i<3;i++) if(cuts[11]>0 && GetDCA(i)>cuts[11])return kFALSE;
+  for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
 
   //2track cuts
   if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
@@ -174,17 +151,32 @@ Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
   return kTRUE;
 }
 //--------------------------------------------------------------------------
-Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK)
+Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
   const {
 //
-// This function compares the Ds with a set of cuts (only mass at the moment)
+// This function compares the Ds with a set of cuts 
+// (same variables as D+, for now)
 //
 // cuts[0] = inv. mass half width [GeV]   
+// cuts[1] = pTK [GeV/c]
+// cuts[2] = pTPi [GeV/c]
+// cuts[3] = d0K [cm]   lower limit!
+// cuts[4] = d0Pi [cm]  lower limit!
+// cuts[5] = dist12 (cm)
+// cuts[6] = sigmavert (cm)
+// cuts[7] = dist prim-sec (cm)
+// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
+// cuts[9] = cosThetaPoint
+// cuts[10] = Sum d0^2 (cm^2)
+// cuts[11] = dca cut (cm)
+// cuts[12] = max. inv. mass difference(Mphi-MKK) [GeV] 
+// cuts[13] = max. inv. mass difference(MK0*-MKpi) [GeV] 
 //
 // If candidate Ds does not pass the cuts return kFALSE
 //
   Double_t mDsKKpi,mDspiKK;
   okDsKKpi=1; okDspiKK=1;
+  okMassPhi=0; okMassK0star=0;
 
   Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
 
@@ -195,15 +187,70 @@ Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,In
   if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
   if(!okDsKKpi && !okDspiKK) return kFALSE;
 
+  //single track
+  if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
+  if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
+  if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
+
+  // cuts on resonant decays (via Phi or K0*)
+  Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
+  Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
+  if(okDsKKpi){
+    Double_t mass01phi=InvMass2Prongs(0,1,321,321);
+    Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
+    if(TMath::Abs(mass01phi-mPhiPDG)<cuts[12]) okMassPhi=1;
+    if(TMath::Abs(mass12K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
+    if(!okMassPhi && !okMassK0star) okDsKKpi=kFALSE;
+  }
+  if(okDspiKK){
+    Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
+    Double_t mass12phi=InvMass2Prongs(1,2,321,321);
+    if(TMath::Abs(mass01K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
+    if(TMath::Abs(mass12phi-mPhiPDG)<cuts[12]) okMassPhi=1;
+    if(!okMassPhi && !okMassK0star) okDspiKK=kFALSE;
+  }
+  if(!okDsKKpi && !okDspiKK) return kFALSE;
+
+
+
+  
+  //DCA
+  for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
+
+  //2track cuts
+  if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
+
+  //sec vert
+  if(fSigmaVert>cuts[6])return kFALSE;
+
+  if(DecayLength()<cuts[7])return kFALSE;
+
+  if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
+  if(CosPointingAngle()   < cuts[9])return kFALSE;
+  Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
+  if(sum2<cuts[10])return kFALSE;
+
   return kTRUE;
 }
 //--------------------------------------------------------------------------
 Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
   const {
 //
-// This function compares the Lc with a set of cuts (only mass at the moment)
+// This function compares the Lc with a set of cuts 
+// (same variables as D+, for now)
 //
 // cuts[0] = inv. mass half width [GeV]   
+// cuts[1] = pTP [GeV/c]
+// cuts[2] = pTPi and pTK [GeV/c]
+// cuts[3] = d0P [cm]   lower limit!
+// cuts[4] = d0Pi and d0K [cm]  lower limit!
+// cuts[5] = dist12 (cm)
+// cuts[6] = sigmavert (cm)
+// cuts[7] = dist prim-sec (cm)
+// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
+// cuts[9] = cosThetaPoint
+// cuts[10] = Sum d0^2 (cm^2)
+// cuts[11] = dca cut (cm)
 //
 // If candidate Lc does not pass the cuts return kFALSE
 //
@@ -219,5 +266,27 @@ Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,In
   if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
   if(!okLcpKpi && !okLcpiKp) return kFALSE;
 
+  //single track
+  if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
+  if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
+  if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
+
+  //DCA
+  for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
+
+  //2track cuts
+  if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
+  if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
+
+  //sec vert
+  if(fSigmaVert>cuts[6])return kFALSE;
+
+  if(DecayLength()<cuts[7])return kFALSE;
+
+  if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
+  if(CosPointingAngle()   < cuts[9])return kFALSE;
+  Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
+  if(sum2<cuts[10])return kFALSE;
+
   return kTRUE;
 }