Changes needed in PHOS (Y.Schutz)
[u/mrichter/AliRoot.git] / EVGEN / AliSlowNucleonModelExp.cxx
CommitLineData
c9a8628a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
803d1ab0 16/* $Id$ */
c9a8628a 17
18// Experimental data inspired Gray Particle Model for p-Pb collisions
19//
20// The number of gray nucleons is proportional to the number of collisions.
21// The number of black nucleons is proportional to the number of collisions
22// Fluctuations are calculated from a binomial distribution.
23//
24
25#include "AliSlowNucleonModelExp.h"
26#include "AliCollisionGeometry.h"
27#include <TRandom.h>
28
29ClassImp(AliSlowNucleonModelExp)
30
31AliSlowNucleonModelExp::AliSlowNucleonModelExp()
32{
33// Default constructor
34 fP = 82;
35 fN = 208 - 82;
36 fAlphaGray = 2.;
37 fAlphaBlack = 4.;
38}
39
40
41void AliSlowNucleonModelExp::GetNumberOfSlowNucleons(AliCollisionGeometry* geo,
42 Int_t& ngp, Int_t& ngn, Int_t & nbp, Int_t & nbn)
43{
44//
45// Return the number of black and gray nucleons
46//
47// Number of collisions
48
49 Int_t nu = geo->NwN() + geo->NNw();
50
51// Mean number of gray nucleons
52
53 Float_t nGray = fAlphaGray * nu;
54 Float_t nGrayNeutrons = nGray * fN / (fN + fP);
55 Float_t nGrayProtons = nGray - nGrayNeutrons;
56
57// Mean number of black nucleons
58 Float_t nBlack = fAlphaBlack * nu;
59 Float_t nBlackNeutrons = nBlack * fN / (fN + fP);
60 Float_t nBlackProtons = nBlack - nBlackNeutrons;
61
62// Actual number (including fluctuations) from binomial distribution
63 Double_t p;
64
65// gray neutrons
66 p = nGrayNeutrons/fN;
67 ngn = gRandom->Binomial((Int_t) fN, p);
68
69// gray protons
70 p = nGrayProtons/fP;
71 ngp = gRandom->Binomial((Int_t) fP, p);
72
73// black neutrons
74 p = nBlackNeutrons/fN;
75 nbn = gRandom->Binomial((Int_t) fN, p);
76
77// black protons
78 p = nBlackProtons/fP;
79 nbp = gRandom->Binomial((Int_t) fP, p);
80
81}
82
83void AliSlowNucleonModelExp::SetParameters(Float_t alpha1, Float_t alpha2)
84{
85 // Set the model parameters
86 fAlphaGray = alpha1;
87 fAlphaBlack = alpha2;
88}