X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=FASTSIM%2FAliFastGlauber.cxx;h=77abdcde1de4527a3a6a0f528892fe00f20b4e12;hp=3efc6d2f014f8376f8f859cadfa0fcb2390a3951;hb=c2140715d75ba09019bc2373b20c7e2e077062c0;hpb=ac3a95cf42a54085343c4372c25191563af08b3b;ds=sidebyside diff --git a/FASTSIM/AliFastGlauber.cxx b/FASTSIM/AliFastGlauber.cxx index 3efc6d2f014..77abdcde1de 100644 --- a/FASTSIM/AliFastGlauber.cxx +++ b/FASTSIM/AliFastGlauber.cxx @@ -15,6 +15,9 @@ /* \$Log\$ +Revision 1.3 2003/04/21 09:35:53 morsch +Protection against division by 0 in Binaries(). + Revision 1.2 2003/04/14 14:23:44 morsch Correction in Binaries(). @@ -319,7 +322,7 @@ Double_t AliFastGlauber::WSgeo(Double_t* x, Double_t* par) Double_t AliFastGlauber::WSbinary(Double_t* x, Double_t* par) { // -// Geometrical Cross-Section +// Number of binary collisions // Double_t b = x[0]; Double_t sigma = par[0]; @@ -332,7 +335,7 @@ Double_t AliFastGlauber::WSbinary(Double_t* x, Double_t* par) Double_t AliFastGlauber::WSN(Double_t* x, Double_t* par) { // -// Geometrical Cross-Section +// Number of hard processes per event // Double_t b = x[0]; Double_t y; @@ -401,6 +404,34 @@ void AliFastGlauber::GetRandom(Float_t& b, Float_t& p, Float_t& mult) mult = 6000./fWSN->Eval(0.) * mu; } +void AliFastGlauber::GetRandom(Int_t& bin, Bool_t& hard) +{ + // + // Gives back a random impact parameter bin, and hard trigger decission + // + Float_t b = fWSgeo->GetRandom(); + Float_t mu = fWSN->Eval(b) * fSigmaHard; + Float_t p = 1.-TMath::Exp(-mu); + if (b < 5.) { + bin = 1; + } else if (b < 8.6) { + bin = 2; + } else if (b < 11.2) { + bin = 3; + } else if (b < 13.2) { + bin = 4; + } else { + bin = 5; + } + + hard = kFALSE; + + Float_t r = gRandom->Rndm(); + + if (r < p) hard = kTRUE; +} + + Float_t AliFastGlauber::GetRandomImpactParameter(Float_t bmin, Float_t bmax) { //