]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliAODRecoCascadeHF.cxx
Disable physics selection in Config files used for filtering AODs
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoCascadeHF.cxx
index 1a355e9ba09d54394ae48c34db65a2495c5befd6..a4fd6fbd338abbd5a56c3709a9abe2826d7e28f2 100644 (file)
@@ -13,6 +13,8 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 /////////////////////////////////////////////////////////////
 //
 // Class for AOD reconstructed heavy-flavour cascades
@@ -93,30 +95,20 @@ Double_t AliAODRecoCascadeHF::InvMassDstarKpipi() const
   //
   // 3 prong invariant mass of the D0 daughters and the soft pion
   //
+  Double_t e[3];
+  if (Charge()>0){
+    e[0]=Get2Prong()->EProng(0,211);
+    e[1]=Get2Prong()->EProng(1,321);
+  }else{
+    e[0]=Get2Prong()->EProng(0,321);
+    e[1]=Get2Prong()->EProng(1,211);
+  }
+  e[2]=EProng(0,211);
 
-  Double_t px[3],py[3],pz[3];
-  UInt_t pdg[3]={321,211,211};
-  pdg[0] = (Charge()>0 ? 211 : 321); // positive daughter of D0
-  px[0] = Get2Prong()->PxProng(0);
-  py[0] = Get2Prong()->PyProng(0);
-  pz[0] = Get2Prong()->PzProng(0);
-  pdg[1] = (Charge()>0 ? 321 : 211); // negative daughter of D0
-  px[1] = Get2Prong()->PxProng(1);
-  py[1] = Get2Prong()->PyProng(1);
-  pz[1] = Get2Prong()->PzProng(1);
-  pdg[2] = 211; // soft pion
-  px[2] = PxProng(0);
-  py[2] = PyProng(0);
-  pz[2] = PzProng(0);
-  Short_t dummycharge=0;
-  Double_t dummyd0[3]={0,0,0};
-  AliAODRecoDecay *rd = new AliAODRecoDecay(0x0,3,dummycharge,px,py,pz,dummyd0);
-
-  Double_t minv = rd->InvMass(3,pdg);
-
-  delete rd; rd=NULL;
-
-  return minv;
+  Double_t esum = e[0]+e[1]+e[2];
+  Double_t minv = TMath::Sqrt(esum*esum-P()*P());
+
+  return minv; 
 }
 //----------------------------------------------------------------------------
 Int_t AliAODRecoCascadeHF::MatchToMC(Int_t pdgabs,Int_t pdgabs2prong,
@@ -140,7 +132,7 @@ Int_t AliAODRecoCascadeHF::MatchToMC(Int_t pdgabs,Int_t pdgabs2prong,
 
   if(lab2Prong<0) return -1;
 
-  Int_t dgLabels[10];
+  Int_t dgLabels[10]={0,0,0,0,0,0,0,0,0,0};
 
   // loop on daughters and write labels
   for(Int_t i=0; i<ndg; i++) {
@@ -199,33 +191,11 @@ Bool_t AliAODRecoCascadeHF::SelectDstar(const Double_t *cutsDstar,
   Double_t mD0 = TDatabasePDG::Instance()->GetParticle(421)->Mass();
   if(TMath::Abs((mDstar-mD0)-DeltaInvMass())>cutsDstar[1]) return kFALSE;
 
-  TVector3 p3Trk0(Get2Prong()->PxProng(0),Get2Prong()->PyProng(0),Get2Prong()->PzProng(0)); // from D0
-  TVector3 p3Trk1(Get2Prong()->PxProng(1),Get2Prong()->PyProng(1),Get2Prong()->PzProng(1)); // from D0
-  TVector3 p3Trk2(PxProng(0),PyProng(0),PzProng(0)); // pi_s
-
-  TVector3 perp = p3Trk0.Cross(p3Trk1);
-  Double_t theta = p3Trk2.Angle(perp);
-  if(theta>(TMath::Pi()-theta)) theta = TMath::Pi() - theta;
-  theta = TMath::Pi()/2. - theta;
-
+  Double_t theta = AngleD0dkpPisoft(); 
   if(theta>cutsDstar[4]) return kFALSE;
-
-  Double_t alpha = p3Trk0.Angle(p3Trk2);
-  Double_t belta = p3Trk1.Angle(p3Trk2);
-
-  Double_t cosphi01 = TMath::Cos(alpha) / TMath::Cos(theta);
-  Double_t cosphi02 = TMath::Cos(belta) / TMath::Cos(theta);
-
-  Double_t phi01 = TMath::ACos(cosphi01);
-  Double_t phi02 = TMath::ACos(cosphi02);
-  Double_t phi00 = p3Trk0.Angle(p3Trk1);
-
-  if((phi01>phi00) || (phi02>phi00)) return kFALSE;
   
   return kTRUE;
 }
-//-----------------------------------------------------------------------------
-
 //-----------------------------------------------------------------------------
 Bool_t AliAODRecoCascadeHF::SelectLctoV0(const Double_t *cutsLctoV0, 
                                         Bool_t okLck0sp, Bool_t okLcLpi) const 
@@ -291,3 +261,41 @@ Bool_t AliAODRecoCascadeHF::SelectLctoV0(const Double_t *cutsLctoV0,
 
 }
 //-----------------------------------------------------------------------------
+Double_t AliAODRecoCascadeHF::AngleD0dkpPisoft() const {
+  //
+  // Angle of soft pion to D0 decay plane
+  // 
+
+  TVector3 p3Trk0(Get2Prong()->PxProng(0),Get2Prong()->PyProng(0),Get2Prong()->PzProng(0)); // from D0
+  TVector3 p3Trk1(Get2Prong()->PxProng(1),Get2Prong()->PyProng(1),Get2Prong()->PzProng(1)); // from D0
+  TVector3 p3Trk2(PxProng(0),PyProng(0),PzProng(0)); // pi_s
+
+  TVector3 perp = p3Trk0.Cross(p3Trk1);
+  Double_t theta = p3Trk2.Angle(perp);
+  if(theta>(TMath::Pi()-theta)) theta = TMath::Pi() - theta;
+  theta = TMath::Pi()/2. - theta;
+
+  return theta;
+}
+//-----------------------------------------------------------------------------
+Bool_t AliAODRecoCascadeHF::TrigonometricalCut() const {
+  //  
+  // Trigonometrical constraint
+  //
+  TVector3 p3Trk0(Get2Prong()->PxProng(0),Get2Prong()->PyProng(0),Get2Prong()->PzProng(0)); // from D0
+  TVector3 p3Trk1(Get2Prong()->PxProng(1),Get2Prong()->PyProng(1),Get2Prong()->PzProng(1)); // from D0
+  TVector3 p3Trk2(PxProng(0),PyProng(0),PzProng(0)); // pi_s
+
+  Double_t alpha = p3Trk0.Angle(p3Trk2);
+  Double_t beta = p3Trk1.Angle(p3Trk2);
+
+  Double_t cosphi01 = TMath::Cos(alpha) / TMath::Cos(AngleD0dkpPisoft());
+  Double_t cosphi02 = TMath::Cos(beta) / TMath::Cos(AngleD0dkpPisoft());
+
+  Double_t phi01 = TMath::ACos(cosphi01);
+  Double_t phi02 = TMath::ACos(cosphi02);
+  Double_t phi00 = p3Trk0.Angle(p3Trk1);
+
+  if((phi01>phi00) || (phi02>phi00)) return kFALSE;
+  return kTRUE;
+}