]> 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 b962bf03507701af3f13d401a09a2f646b51275a..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,7 +254,7 @@ 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;
@@ -315,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);