]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliSlowNucleonModelExp.cxx
Possibility to compile with Root v5-11-04/06
[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
c9a8628a 18//
ac3faee4 19// Experimental data inspired Gray Particle Model for p-Pb collisions
c9a8628a 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.
ac3faee4 23// Author: A.Morsch
c9a8628a 24//
25
26#include "AliSlowNucleonModelExp.h"
27#include "AliCollisionGeometry.h"
28#include <TRandom.h>
29
30ClassImp(AliSlowNucleonModelExp)
31
32AliSlowNucleonModelExp::AliSlowNucleonModelExp()
33{
ac3faee4 34 //
35 // Default constructor
36 //
c9a8628a 37 fP = 82;
38 fN = 208 - 82;
39 fAlphaGray = 2.;
40 fAlphaBlack = 4.;
41}
42
43
44void AliSlowNucleonModelExp::GetNumberOfSlowNucleons(AliCollisionGeometry* geo,
ac3faee4 45 Int_t& ngp, Int_t& ngn, Int_t & nbp, Int_t & nbn) const
c9a8628a 46{
47//
48// Return the number of black and gray nucleons
49//
50// Number of collisions
51
52 Int_t nu = geo->NwN() + geo->NNw();
53
54// Mean number of gray nucleons
55
56 Float_t nGray = fAlphaGray * nu;
57 Float_t nGrayNeutrons = nGray * fN / (fN + fP);
58 Float_t nGrayProtons = nGray - nGrayNeutrons;
59
60// Mean number of black nucleons
61 Float_t nBlack = fAlphaBlack * nu;
62 Float_t nBlackNeutrons = nBlack * fN / (fN + fP);
63 Float_t nBlackProtons = nBlack - nBlackNeutrons;
64
65// Actual number (including fluctuations) from binomial distribution
66 Double_t p;
67
68// gray neutrons
69 p = nGrayNeutrons/fN;
70 ngn = gRandom->Binomial((Int_t) fN, p);
71
72// gray protons
73 p = nGrayProtons/fP;
74 ngp = gRandom->Binomial((Int_t) fP, p);
75
76// black neutrons
77 p = nBlackNeutrons/fN;
78 nbn = gRandom->Binomial((Int_t) fN, p);
79
80// black protons
81 p = nBlackProtons/fP;
82 nbp = gRandom->Binomial((Int_t) fP, p);
83
84}
85
86void AliSlowNucleonModelExp::SetParameters(Float_t alpha1, Float_t alpha2)
87{
88 // Set the model parameters
89 fAlphaGray = alpha1;
90 fAlphaBlack = alpha2;
91}