]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGDQ/dielectron/AliDielectronPair.cxx
including switch to set on/off iso-track core removal, cleaning and bug fix
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronPair.cxx
index aa2a30531c9457012c73d92ee5045e46c28abcb8..0452cccbecfb50129f6ddef5967c5db79128deab 100644 (file)
@@ -738,6 +738,65 @@ Double_t AliDielectronPair::GetPairPlaneAngle(Double_t v0rpH2, Int_t VariNum)con
 }
 
 
+//_______________________________________________
+Double_t AliDielectronPair::PairPlaneMagInnerProduct(Double_t ZDCrpH1) const
+{
+
+  // Calculate inner product of the strong magnetic field and electron pair plane
+
+  if(TMath::Abs(ZDCrpH1 - 999.) < 1e-10) return -9999.;
+
+  Double_t px1=-9999.,py1=-9999.,pz1=-9999.;
+  Double_t px2=-9999.,py2=-9999.,pz2=-9999.;
+
+  if(fD1.GetQ()<0){
+    px1 = fD1.GetPx();
+    py1 = fD1.GetPy();
+    pz1 = fD1.GetPz();
+
+    px2 = fD2.GetPx();
+    py2 = fD2.GetPy();
+    pz2 = fD2.GetPz();
+
+  }else{
+    px1 = fD2.GetPx();
+    py1 = fD2.GetPy();
+    pz1 = fD2.GetPz();
+
+    px2 = fD1.GetPx();
+    py2 = fD1.GetPy();
+    pz2 = fD1.GetPz();
+
+  }
+
+
+  // normal vector of ee plane
+  Double_t pnorx = py1*pz2 - pz1*py2;
+  Double_t pnory = pz1*px2 - px1*pz2;
+  Double_t pnorz = px1*py2 - py1*px2;
+  Double_t pnor  = TMath::Sqrt( pnorx*pnorx + pnory*pnory + pnorz*pnorz );
+
+  //unit vector
+  Double_t upnx = -9999.;
+  Double_t upny = -9999.;
+  //Double_t upnz = -9999.;
+
+  if (TMath::Abs(pnor) < 1e-10) return -9999.;
+
+  upnx= pnorx/pnor;
+  upny= pnory/pnor;
+  //upnz= pnorz/pnor;
+
+  //direction of strong magnetic field
+  Double_t magx = TMath::Cos(ZDCrpH1+(TMath::Pi()/2));
+  Double_t magy = TMath::Sin(ZDCrpH1+(TMath::Pi()/2));
+
+  //inner product of strong magnetic field and  ee plane
+  Double_t upnmag = upnx*magx + upny*magy;
+
+  return upnmag;
+}
+
 
 //______________________________________________
 void AliDielectronPair::SetBeamEnergy(AliVEvent *ev, Double_t beamEbyHand)