]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenSlowNucleons.cxx
Fix for coverity 19211
[u/mrichter/AliRoot.git] / EVGEN / AliGenSlowNucleons.cxx
index 6edf90b279eefbbc9836222876815bc642db953a..569f5f2a5012d209fb0eb7a4a1cf43c751e6dac8 100644 (file)
@@ -35,7 +35,7 @@
 #include "AliGenSlowNucleons.h"
 #include "AliSlowNucleonModel.h"
 
-ClassImp(AliGenSlowNucleons);
+ClassImp(AliGenSlowNucleons)
 
     
 AliGenSlowNucleons::AliGenSlowNucleons()
@@ -47,7 +47,7 @@ AliGenSlowNucleons::AliGenSlowNucleons()
      fATarget (0.),
      fZTarget (0.),
      fCharge(0),
-     fProtonDirection(0.),
+     fProtonDirection(1.),
      fTemperatureG(0.), 
      fBetaSourceG(0.),
      fTemperatureB(0.),
@@ -77,7 +77,7 @@ AliGenSlowNucleons::AliGenSlowNucleons(Int_t npart)
      fATarget (208.),
      fZTarget (82.),
      fCharge(1),
-     fProtonDirection(0.),
+     fProtonDirection(1.),
      fTemperatureG(0.04), 
      fBetaSourceG(0.05),
      fTemperatureB(0.004),
@@ -100,37 +100,6 @@ AliGenSlowNucleons::AliGenSlowNucleons(Int_t npart)
     fCollisionGeometry = 0;
 }
 
-//____________________________________________________________
-AliGenSlowNucleons::AliGenSlowNucleons(const AliGenSlowNucleons & sn):
-    AliGenerator(sn),
-    fCMS(0.),
-    fMomentum(0.),
-    fBeta(0.),
-    fPmax (0.),
-    fATarget (0.),
-    fZTarget (0.),
-    fCharge(0),
-    fProtonDirection(0.),
-    fTemperatureG(0.), 
-    fBetaSourceG(0.),
-    fTemperatureB(0.),
-    fBetaSourceB(0.),
-    fNgp(0),
-    fNgn(0),
-    fNbp(0),
-    fNbn(0),
-    fDebug(0),
-    fDebugHist1(0),
-    fDebugHist2(0),
-    fThetaDistribution(),
-    fCosThetaGrayHist(),
-    fCosTheta(),
-    fSlowNucleonModel(0)
-{
-// Copy constructor
-    sn.Copy(*this);
-}
-
 //____________________________________________________________
 AliGenSlowNucleons::~AliGenSlowNucleons()
 {
@@ -211,6 +180,7 @@ void AliGenSlowNucleons::Generate()
    //
     Float_t p[3], theta=0;
     Float_t origin[3] = {0., 0., 0.};
+    Float_t time = 0.;
     Float_t polar [3] = {0., 0., 0.};    
     Int_t nt, i, j;
     Int_t kf;
@@ -218,6 +188,7 @@ void AliGenSlowNucleons::Generate()
     if(fVertexSmear == kPerEvent) {
        Vertex();
        for (j=0; j < 3; j++) origin[j] = fVertex[j];
+       time = fTime;
     } // if kPerEvent
 //
 //  Gray protons
@@ -228,7 +199,7 @@ void AliGenSlowNucleons::Generate()
        GenerateSlow(fCharge, fTemperatureG, fBetaSourceG, p, theta);
        if (fDebug) fCosThetaGrayHist->Fill(TMath::Cos(theta));
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
-                0., kPNoProcess, nt, 1.);
+                time, kPNoProcess, nt, 1.);
        KeepTrack(nt);
     }
 //
@@ -240,7 +211,7 @@ void AliGenSlowNucleons::Generate()
        GenerateSlow(fCharge, fTemperatureG, fBetaSourceG, p, theta);
        if (fDebug) fCosThetaGrayHist->Fill(TMath::Cos(theta));
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
-                0., kPNoProcess, nt, 1.);
+                time, kPNoProcess, nt, 1.);
        KeepTrack(nt);
     }
 //
@@ -251,7 +222,7 @@ void AliGenSlowNucleons::Generate()
     for(i = 0; i < fNbp; i++) {
        GenerateSlow(fCharge, fTemperatureB, fBetaSourceB, p, theta);
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
-                0., kPNoProcess, nt, 1.);
+                time, kPNoProcess, nt, 1.);
        KeepTrack(nt);
     }
 //
@@ -262,7 +233,7 @@ void AliGenSlowNucleons::Generate()
     for(i = 0; i < fNbn; i++) {
        GenerateSlow(fCharge, fTemperatureB, fBetaSourceB, p, theta);
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
-                0., kPNoProcess, nt, 1.);
+                time, kPNoProcess, nt, 1.);
        KeepTrack(nt);
     }
 }
@@ -341,30 +312,7 @@ void AliGenSlowNucleons::Lorentz(Double_t m, Double_t beta, Float_t* q)
 {
 /* Lorentz transform in the direction of q[2] */
  
-    Double_t gamma  = 1/sqrt(1-beta*beta); 
+    Double_t gamma  = 1./sqrt((1.-beta)*(1.+beta)); 
     Double_t energy = sqrt(m*m + q[0]*q[0] + q[1]*q[1] + q[2]*q[2]);
     q[2] = gamma * (q[2] + beta*energy);
 }
-
-         
-AliGenSlowNucleons& AliGenSlowNucleons::operator=(const  AliGenSlowNucleons& rhs)
-{
-// Assignment operator
-    rhs.Copy(*this);
-    return *this;
-}
-
-void AliGenSlowNucleons::Copy(TObject&) const
-{
-    //
-    // Copy 
-    //
-    Fatal("Copy","Not implemented!\n");
-}
-
-
-
-
-
-
-