]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliOmegaDalitz.cxx
Options for D+ and Ds decays in channels with K0s
[u/mrichter/AliRoot.git] / EVGEN / AliOmegaDalitz.cxx
index 3e28cd860daf6f8f918f84b48bf76bd92a33b8ea..7d59b45e6c05cbb0ad2873f8179bead075c1dc5a 100644 (file)
@@ -49,7 +49,8 @@ ClassImp(AliOmegaDalitz)
 AliOmegaDalitz::AliOmegaDalitz():
        AliDecayer(),
         fEPMass(0),
-       fMPMass(0)
+       fMPMass(0),
+       fInit(0)
 {
     // Constructor
 }
@@ -130,9 +131,13 @@ void AliOmegaDalitz::Decay(Int_t idlepton, TLorentzVector* pparent)
 //
 //-----------------------------------------------------------------------------
 
+    if (!fInit) {
+       Init();
+       fInit=1;
+    }
+    
   Double_t pmass, lmass, omass, lpmass;
   Double_t e1, p1, e3, p3;
-  Double_t betaSquare, lambda;
   Double_t costheta, sintheta, cosphi, sinphi, phi;
   
   // Get the particle masses
@@ -156,8 +161,8 @@ void AliOmegaDalitz::Decay(Int_t idlepton, TLorentzVector* pparent)
   // lepton pair kinematics in virtual photon rest frame
   e1 = lpmass / 2.;
   p1 = TMath::Sqrt((e1 + lmass) * (e1 - lmass));
-  betaSquare = 1.0 - 4.0 * (lmass * lmass) / (lpmass * lpmass);
-  lambda      = betaSquare / (2.0 - betaSquare);
+  // betaSquare = 1.0 - 4.0 * (lmass * lmass) / (lpmass * lpmass);
+  // lambda      = betaSquare / (2.0 - betaSquare);
   costheta = (2.0 * gRandom->Rndm()) - 1.;
   sintheta = TMath::Sqrt((1. + costheta) * (1. - costheta));
   phi      = 2.0 * TMath::ACos(-1.) * gRandom->Rndm();
@@ -249,8 +254,9 @@ Int_t AliOmegaDalitz::ImportParticles(TClonesArray *particles)
 
 void AliOmegaDalitz::
 Rot(Double_t pin[3], Double_t pout[3], Double_t costheta, Double_t sintheta,
-    Double_t cosphi, Double_t sinphi)
+    Double_t cosphi, Double_t sinphi) const
 {
+// Perform rotation
   pout[0] = pin[0]*costheta*cosphi-pin[1]*sinphi+pin[2]*sintheta*cosphi;
   pout[1] = pin[0]*costheta*sinphi+pin[1]*cosphi+pin[2]*sintheta*sinphi;
   pout[2] = -1.0  * pin[0] * sintheta + pin[2] * costheta;
@@ -314,7 +320,8 @@ void AliOmegaDalitz::Copy(TObject&) const
 AliOmegaDalitz::AliOmegaDalitz(const AliOmegaDalitz &dalitz)
   : AliDecayer(),
     fEPMass(0),
-    fMPMass(0)
+    fMPMass(0),
+    fInit(0)
 {
   // Copy constructor
   dalitz.Copy(*this);