]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenSlowNucleons.cxx
updates for train
[u/mrichter/AliRoot.git] / EVGEN / AliGenSlowNucleons.cxx
index 16cb40b0a71e1c54316af583b88e94e1baa00e66..037054b784f9a4a82e79e8119f4aba3ba0660345 100644 (file)
@@ -44,10 +44,8 @@ AliGenSlowNucleons::AliGenSlowNucleons()
      fMomentum(0.),
      fBeta(0.),
      fPmax (0.),
-     fATarget (0.),
-     fZTarget (0.),
      fCharge(0),
-     fProtonDirection(0.),
+     fProtonDirection(1.),
      fTemperatureG(0.), 
      fBetaSourceG(0.),
      fTemperatureB(0.),
@@ -74,13 +72,11 @@ AliGenSlowNucleons::AliGenSlowNucleons(Int_t npart)
      fMomentum(0.),
      fBeta(0.),
      fPmax (10.),
-     fATarget (208.),
-     fZTarget (82.),
      fCharge(1),
-     fProtonDirection(0.),
-     fTemperatureG(0.04), 
+     fProtonDirection(1.),
+     fTemperatureG(0.05), 
      fBetaSourceG(0.05),
-     fTemperatureB(0.004),
+     fTemperatureB(0.005),
      fBetaSourceB(0.),
      fNgp(0),
      fNgn(0),
@@ -118,7 +114,7 @@ void AliGenSlowNucleons::Init()
   // Initialization
   //
     Float_t kMass  = TDatabasePDG::Instance()->GetParticle(kProton)->Mass();
-    fMomentum = fCMS/2. * fZTarget / fATarget;
+    fMomentum = fCMS/2. * Float_t(fZTarget) / Float_t(fATarget);
     fBeta     = fMomentum / TMath::Sqrt(kMass * kMass + fMomentum * fMomentum);
     if (fDebug) {
        fDebugHist1 = new TH2F("DebugHist1", "nu vs N_slow", 100, 0., 100., 20, 0., 20.);
@@ -162,24 +158,24 @@ void AliGenSlowNucleons::Generate()
   // 
     if (fCollisionGeometry) {
        Float_t b   = fCollisionGeometry->ImpactParameter();
-       Int_t  nn   = fCollisionGeometry->NN();
-       Int_t  nwn  = fCollisionGeometry->NwN();
-       Int_t  nnw  = fCollisionGeometry->NNw();
-       Int_t  nwnw = fCollisionGeometry->NwNw();
+       //      Int_t  nn   = fCollisionGeometry->NN();
+       //      Int_t  nwn  = fCollisionGeometry->NwN();
+       //      Int_t  nnw  = fCollisionGeometry->NNw();
+       //      Int_t  nwnw = fCollisionGeometry->NwNw();
 
        fSlowNucleonModel->GetNumberOfSlowNucleons(fCollisionGeometry, fNgp, fNgn, fNbp, fNbn);
        if (fDebug) {
-           printf("Nucleons %d %d %d %d \n", fNgp, fNgn, fNbp, fNbn);
+           printf("Slow nucleons: %d grayp  %d grayn  %d blackp  %d blackn \n", fNgp, fNgn, fNbp, fNbn);
            fDebugHist1->Fill(Float_t(fNgp + fNgn + fNbp + fNbn), fCollisionGeometry->NwN(), 1.);
            fDebugHist2->Fill(Float_t(fNgp + fNgn + fNbp + fNbn), b, 1.);
-           printf("AliGenSlowNucleons: Impact parameter from Collision Geometry %f %d %d %d %d\n", 
-                  b, nn, nwn, nnw, nwnw);
+           //printf("AliGenSlowNucleons: Impact parameter from Collision Geometry %f %d %d %d %d\n", b, nn, nwn, nnw, nwnw);
        }
     }     
 
    //
     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;
@@ -187,6 +183,7 @@ void AliGenSlowNucleons::Generate()
     if(fVertexSmear == kPerEvent) {
        Vertex();
        for (j=0; j < 3; j++) origin[j] = fVertex[j];
+       time = fTime;
     } // if kPerEvent
 //
 //  Gray protons
@@ -197,7 +194,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);
     }
 //
@@ -209,7 +206,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);
     }
 //
@@ -220,7 +217,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);
     }
 //
@@ -231,7 +228,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);
     }
 }
@@ -249,6 +246,8 @@ void AliGenSlowNucleons::GenerateSlow(Int_t charge, Double_t T,
    Three-momentum [GeV/c] is given back in q[3]    
 */
 
+ //printf("Generating slow nuc. with: charge %d. temp. %1.3f, beta %1.2f\n",charge,T,beta);
  Double_t m, pmax, p, f, phi;
  TDatabasePDG * pdg = TDatabasePDG::Instance();
  const Double_t kMassProton  = pdg->GetParticle(kProton) ->Mass();
@@ -310,7 +309,8 @@ 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);
 }
+