]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenSlowNucleons.cxx
Add possibility to change proton direction.
[u/mrichter/AliRoot.git] / EVGEN / AliGenSlowNucleons.cxx
index 1e4568424a72c4476b0054142e2fe702eec60b9c..0c5d7a82f70b094fe9c07405ea22b7e714cadd0a 100644 (file)
@@ -73,6 +73,10 @@ AliGenSlowNucleons::~AliGenSlowNucleons()
     delete  fSlowNucleonModel;
 }
 
     delete  fSlowNucleonModel;
 }
 
+void AliGenSlowNucleons::SetProtonDirection(Float_t dir) {
+// Set direction of the proton to change between pA (1) and Ap (-1)
+  fProtonDirection = dir / TMath::Abs(dir);
+}
 
 void AliGenSlowNucleons::Init()
 {
 
 void AliGenSlowNucleons::Init()
 {
@@ -236,6 +240,7 @@ void AliGenSlowNucleons::GenerateSlow(Int_t charge, Double_t T, Double_t beta, F
 
  /* Transform to laboratory system */
  Lorentz(m, fBeta, q);
 
  /* Transform to laboratory system */
  Lorentz(m, fBeta, q);
+ q[2] *= fProtonDirection; 
 }
 
 Double_t AliGenSlowNucleons::Maxwell(Double_t m, Double_t p, Double_t T)
 }
 
 Double_t AliGenSlowNucleons::Maxwell(Double_t m, Double_t p, Double_t T)