]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add possibility to change proton direction.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 May 2005 12:24:22 +0000 (12:24 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 May 2005 12:24:22 +0000 (12:24 +0000)
EVGEN/AliGenSlowNucleons.cxx
EVGEN/AliGenSlowNucleons.h

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)
index 6500e3aac0298d77342f06bd7193e7c29fdc29f2..bec9e8ce4ea55a6dcc9944689c1d37565a587d53 100644 (file)
@@ -28,6 +28,7 @@ public:
     virtual void SetPmax(Float_t pmax = 10.) {fPmax = pmax;}
     virtual void SetNominalCmsEnergy(Float_t energy = 14000.) {fCMS = energy;}
     virtual void SetTarget(Float_t a=208, Float_t z=82) {fATarget = a; fZTarget = z;}
     virtual void SetPmax(Float_t pmax = 10.) {fPmax = pmax;}
     virtual void SetNominalCmsEnergy(Float_t energy = 14000.) {fCMS = energy;}
     virtual void SetTarget(Float_t a=208, Float_t z=82) {fATarget = a; fZTarget = z;}
+    virtual void SetProtonDirection(Float_t dir = 1.);
     virtual void SetCharge(Int_t c = 1) {fCharge = c;}
     virtual void SetTemperature(Double_t t1 = 0.04, Double_t t2 = 0.004)
        {fTemperatureG = t1; fTemperatureB = t2;}
     virtual void SetCharge(Int_t c = 1) {fCharge = c;}
     virtual void SetTemperature(Double_t t1 = 0.04, Double_t t2 = 0.004)
        {fTemperatureG = t1; fTemperatureB = t2;}
@@ -50,24 +51,25 @@ public:
     void Copy(TObject&) const;
     AliGenSlowNucleons & operator=(const AliGenSlowNucleons & rhs);
  protected:
     void Copy(TObject&) const;
     AliGenSlowNucleons & operator=(const AliGenSlowNucleons & rhs);
  protected:
-    Float_t  fCMS;          // Center of mass energy
-    Float_t  fMomentum;     // Target nucleus momentum
-    Float_t  fBeta;         // Target nucleus beta
-    Float_t  fPmax;         // Maximum slow nucleon momentum
-    Float_t  fATarget;      // Target nucleus mass number
-    Float_t  fZTarget;      // Target nucleus charge number
-    Int_t    fCharge;       // Slow nucleon charge
-    Float_t  fTemperatureG; // Source Temperature for gray nucleons
-    Float_t  fBetaSourceG;  // Source beta for gray nucleons
-    Float_t  fTemperatureB; // Source Temperature for black nucleons
-    Float_t  fBetaSourceB;  // Source beta for black nucleons
-    Int_t    fNgp;          // Number of gray  protons
-    Int_t    fNgn;          // Number of gray  neutrons
-    Int_t    fNbp;          // Number of black protons
-    Int_t    fNbn;          // Number of black neutrons
-    Int_t    fDebug;        // Debug flag
-    TH2F*    fDebugHist1;   // Histogram for debugging
-    TH2F*    fDebugHist2;   // Histogram for debugging
+    Float_t  fCMS;             // Center of mass energy
+    Float_t  fMomentum;        // Target nucleus momentum
+    Float_t  fBeta;            // Target nucleus beta
+    Float_t  fPmax;            // Maximum slow nucleon momentum
+    Float_t  fATarget;         // Target nucleus mass number
+    Float_t  fZTarget;         // Target nucleus charge number
+    Int_t    fCharge;          // Slow nucleon charge
+    Float_t  fProtonDirection; // Direction of the proton
+    Float_t  fTemperatureG;    // Source Temperature for gray nucleons
+    Float_t  fBetaSourceG;     // Source beta for gray nucleons
+    Float_t  fTemperatureB;    // Source Temperature for black nucleons
+    Float_t  fBetaSourceB;     // Source beta for black nucleons
+    Int_t    fNgp;             // Number of gray  protons
+    Int_t    fNgn;             // Number of gray  neutrons
+    Int_t    fNbp;             // Number of black protons
+    Int_t    fNbn;             // Number of black neutrons
+    Int_t    fDebug;           // Debug flag
+    TH2F*    fDebugHist1;      // Histogram for debugging
+    TH2F*    fDebugHist2;      // Histogram for debugging
     
     //
     AliSlowNucleonModel* fSlowNucleonModel; // The slow nucleon model
     
     //
     AliSlowNucleonModel* fSlowNucleonModel; // The slow nucleon model