]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliOmegaDalitz.cxx
Moving required CMake version from 2.8.4 to 2.8.8
[u/mrichter/AliRoot.git] / EVGEN / AliOmegaDalitz.cxx
index a8fbdb358ea9df23cb72f2d9efe91b80441f5be0..dcf7944c445d3a6a6628bdf3dea6bb71931e4431 100644 (file)
@@ -49,7 +49,8 @@ ClassImp(AliOmegaDalitz)
 AliOmegaDalitz::AliOmegaDalitz():
        AliDecayer(),
         fEPMass(0),
-       fMPMass(0)
+       fMPMass(0),
+       fInit(0)
 {
     // Constructor
 }
@@ -104,10 +105,6 @@ void AliOmegaDalitz::Init()
       if ( kwHelp <= 0.0 )
       {
        AliFatal("Error in calculating Dalitz mass histogram binning!");
-       if ( idecay == 1 ) 
-         fEPMass = 0;
-       else
-         fMPMass = 0;
       }        
       krollWada = (2.0 / mLL) * TMath::Exp(1.5 * TMath::Log(kwHelp))
                               * TMath::Sqrt(1.0 - 4.0 * epsilon / q)   
@@ -134,6 +131,11 @@ 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;
@@ -253,8 +255,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;
@@ -318,7 +321,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);