LCOV - code coverage report
Current view: top level - EVGEN - AliSlowNucleonModelExp.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 95 1.1 %
Date: 2016-06-14 17:26:59 Functions: 1 7 14.3 %

          Line data    Source code
       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             : 
      16             : /* $Id$ */
      17             : 
      18             : //
      19             : // Experimental data inspired Gray Particle Model for p-Pb collisions
      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             : // Author: A.Morsch
      24             : //
      25             : 
      26             : #include "AliSlowNucleonModelExp.h"
      27             : #include "AliCollisionGeometry.h"
      28             : #include <TRandom.h>
      29             : #include <TMath.h>
      30             : 
      31           6 : ClassImp(AliSlowNucleonModelExp)
      32             : 
      33             : 
      34           0 : AliSlowNucleonModelExp::AliSlowNucleonModelExp():
      35           0 :     fP(82),
      36           0 :     fN (126),
      37           0 :     fAlphaGray(2.3),
      38           0 :     fAlphaBlack(3.6),
      39           0 :     fApplySaturation(kTRUE),
      40           0 :     fnGraySaturation(15),
      41           0 :     fnBlackSaturation(28),
      42           0 :     fLCPparam(0.585),
      43           0 :     fSigmaSmear(0.25)
      44           0 : {
      45             :   //
      46             :   // Default constructor
      47             :   //
      48             :   //
      49           0 :   fSlownparam[0] = 60.;
      50           0 :   fSlownparam[1] = 469.2;
      51           0 :   fSlownparam[2] = 8.762;
      52             :   /*printf("\n\n ******** Initializing slow nucleon model with parameters:\n");
      53             :   printf(" \t alpha_{gray} %1.2f  alpha_{black} %1.2f\n",fAlphaGray, fAlphaBlack);
      54             :   printf(" \t SATURATION %d w. %d (gray) %d (black) \n\n",fApplySaturation,fnGraySaturation,fnBlackSaturation);
      55             :   printf(" \t LCP parameter %f   Slown parameters = {%f, %f,
      56             :   %f}\n\n",fLCPparam,fSlownparam[0],fSlownparam[1],fSlownparam[2]); */
      57           0 : }
      58             : 
      59             : 
      60             : void AliSlowNucleonModelExp::GetNumberOfSlowNucleons(AliCollisionGeometry* geo, 
      61             :                                                       Int_t& ngp, Int_t& ngn, Int_t & nbp, Int_t & nbn) const
      62             : {
      63             : //
      64             : // Return the number of black and gray nucleons
      65             : //
      66             : // Number of collisions
      67             : 
      68           0 :     Float_t nu = geo->NN() + geo->NwN() + geo->NNw(); 
      69             : 
      70             : // Mean number of gray nucleons 
      71             : 
      72           0 :     Float_t nGray         = fAlphaGray * nu;
      73           0 :     Float_t nGrayNeutrons = nGray * fN / (fN + fP);
      74           0 :     Float_t nGrayProtons  = nGray - nGrayNeutrons;
      75             : 
      76             : // Mean number of black nucleons 
      77             :     Float_t nBlack  = 0.;
      78           0 :     if(!fApplySaturation || (fApplySaturation && nGray<fnGraySaturation)) nBlack = fAlphaBlack * nu;
      79           0 :     else if(fApplySaturation && nGray>=fnGraySaturation) nBlack = fnBlackSaturation;
      80           0 :     Float_t nBlackNeutrons = nBlack * 0.84;
      81           0 :     Float_t nBlackProtons  = nBlack - nBlackNeutrons;
      82             : 
      83             : // Actual number (including fluctuations) from binomial distribution
      84             :     Double_t p;
      85             : 
      86             : //  gray neutrons
      87           0 :     p =  nGrayNeutrons/fN;
      88           0 :     ngn = gRandom->Binomial((Int_t) fN, p);
      89             :     
      90             : //  gray protons
      91           0 :     p =  nGrayProtons/fP;
      92           0 :     ngp = gRandom->Binomial((Int_t) fP, p);
      93             : 
      94             : //  black neutrons
      95           0 :     p =  nBlackNeutrons/fN;
      96           0 :     nbn = gRandom->Binomial((Int_t) fN, p);
      97             :     
      98             : //  black protons
      99           0 :     p =  nBlackProtons/fP;
     100           0 :     nbp = gRandom->Binomial((Int_t) fP, p);
     101             : 
     102           0 : }
     103             : 
     104             : void AliSlowNucleonModelExp::GetNumberOfSlowNucleons2(AliCollisionGeometry* geo, 
     105             :                                                       Int_t& ngp, Int_t& ngn, Int_t & nbp, Int_t & nbn) const
     106             : {
     107             : //
     108             : // Return the number of black and gray nucleons
     109             : //
     110             : // Number of collisions
     111             : 
     112             :    // based on E910 model ================================================================
     113             : 
     114           0 :    Float_t nu = (Float_t) (geo->NN() + geo->NwN() + geo->NNw()); 
     115             :    //
     116             :    //nu = nu+1.*gRandom->Rndm();
     117           0 :    nu = gRandom->Gaus(nu, 0.5);
     118           0 :    if(nu<0.) nu=0.;
     119             :    //
     120             :    Float_t  poverpd = 0.843; 
     121             :    Float_t  zAu2zPb = 82./79.;
     122           0 :    Float_t  nGrayp = (-0.27 + 0.63 * nu - 0.0008 *nu *nu)*poverpd*zAu2zPb;
     123             : 
     124             : //  gray protons
     125             :     Double_t p;
     126           0 :     p =  nGrayp/fP;
     127           0 :     ngp = gRandom->Binomial((Int_t) fP, p);
     128             :     //ngp = gRandom->Gaus(nGrayp, TMath::Sqrt(fP*p*(1-p)));
     129           0 :     if(nGrayp<0.) ngp=0;
     130             :     
     131             :     //Float_t blackovergray = 3./7.;// from spallation
     132             :     Float_t blackovergray = 0.65; // from COSY
     133           0 :     Float_t nBlackp  = blackovergray*nGrayp; 
     134             : 
     135             : //  black protons
     136           0 :     p =  nBlackp/fP;
     137           0 :     nbp = gRandom->Binomial((Int_t) fP, p);
     138             :     //nbp = gRandom->Gaus(nBlackp, TMath::Sqrt(fP*p*(1-p)));
     139           0 :     if(nBlackp<0.) nbp=0;
     140             :     
     141           0 :     if(nu<3.){
     142           0 :       nGrayp = -0.836 + 0.9112 *nu - 0.05381 *nu *nu;
     143           0 :       nBlackp  = blackovergray*nGrayp; 
     144           0 :     }
     145             :     
     146             :     //printf(" \t Using LCP parameter %f   Slown parameters = {%f, %f, %f}\n\n",fLCPparam,fSlownparam[0],fSlownparam[1],fSlownparam[2]); 
     147             :     Float_t nGrayNeutrons = 0.;
     148             :     Float_t nBlackNeutrons = 0.;
     149           0 :     Float_t cp = (nGrayp+nBlackp)/fLCPparam;
     150             :     
     151           0 :     if(cp>0.){
     152           0 :       Float_t nSlow      = fSlownparam[0]+fSlownparam[1]/(-fSlownparam[2]-cp);
     153           0 :       Float_t paramRetta = fSlownparam[0]+fSlownparam[1]/(-fSlownparam[2]-3);
     154           0 :       if(cp<3.) nSlow = 0.+(paramRetta-0.)/(3.-0.)*(cp-0.);
     155             :     
     156           0 :       nGrayNeutrons = nSlow * 0.1; 
     157           0 :       nBlackNeutrons = nSlow - nGrayNeutrons;
     158           0 :     }
     159             :     else{
     160             :       // Sikler "pasturato" (qui non entra mai!!!!)
     161           0 :       nGrayNeutrons = 0.47 * fAlphaGray *  nu; 
     162           0 :       nBlackNeutrons = 0.88 * fAlphaBlack * nu;      
     163             :       //printf("nslowp=0 -> ncoll = %1.0f -> ngrayn = %1.0f  nblackn = %1.0f \n", nu, nGrayNeutrons, nBlackNeutrons);
     164             :     }
     165             :     
     166             : //  gray neutrons
     167           0 :     p =  nGrayNeutrons/fN;
     168             : //    ngn = gRandom->Binomial((Int_t) fN, p);
     169           0 :     ngn = gRandom->Gaus(nGrayNeutrons, TMath::Sqrt(fN*p*(1-p)));
     170             : 
     171             : //  black neutrons
     172           0 :     p =  nBlackNeutrons/fN;
     173             : //    nbn = gRandom->Binomial((Int_t) fN, p);
     174           0 :     nbn = gRandom->Gaus(nBlackNeutrons, TMath::Sqrt(fN*p*(1-p)));
     175             :     
     176             :     
     177           0 : }
     178             : 
     179             : void AliSlowNucleonModelExp::GetNumberOfSlowNucleons2s(AliCollisionGeometry* geo, 
     180             :                                                       Int_t& ngp, Int_t& ngn, Int_t & nbp, Int_t & nbn) const
     181             : {
     182             : //
     183             : // Return the number of black and gray nucleons
     184             : //
     185             : // Number of collisions
     186             : 
     187             :    // based on E910 model ================================================================
     188             : 
     189           0 :    Float_t nu = (Float_t) (geo->NN() + geo->NwN() + geo->NNw()); 
     190             :    //
     191             :    Float_t  poverpd = 0.843; 
     192             :    Float_t  zAu2zPb = 82./79.;
     193           0 :    Float_t  grayp = (-0.27 + 0.63 * nu - 0.0008 *nu *nu)*poverpd*zAu2zPb;
     194           0 :    Float_t  nGrayp = gRandom->Gaus(grayp, fSigmaSmear);
     195           0 :    if(nGrayp<0.) nGrayp=0.;
     196             : 
     197             : //  gray protons
     198             :     Double_t p=0.;
     199           0 :     p = nGrayp/fP;
     200           0 :     ngp = gRandom->Binomial((Int_t) fP, p);
     201             :     //ngp = gRandom->Gaus(nGrayp, TMath::Sqrt(fP*p*(1-p)));
     202           0 :     if(nGrayp<0.) ngp=0;
     203             :     
     204             :     //Float_t blackovergray = 3./7.;// from spallation
     205             :     Float_t blackovergray = 0.65; // from COSY
     206             :     //Float_t blackp  = blackovergray*grayp; 
     207             :     //Float_t nBlackp = gRandom->Gaus(nblackp, fSigmaSmear);
     208           0 :     Float_t nBlackp = blackovergray*nGrayp;
     209           0 :     if(nBlackp<0.) nBlackp=0.;
     210             : 
     211             : //  black protons
     212           0 :     p =  nBlackp/fP;
     213           0 :     nbp = gRandom->Binomial((Int_t) fP, p);
     214             :     //nbp = gRandom->Gaus(nBlackp, TMath::Sqrt(fP*p*(1-p)));
     215           0 :     if(nBlackp<0.) nbp=0;
     216             :     
     217             :     Float_t nGrayNeutrons = 0.;
     218             :     Float_t nBlackNeutrons = 0.;
     219           0 :     Float_t cp = (nGrayp+nBlackp)/fLCPparam;
     220             :     
     221           0 :     if(cp>0.){
     222           0 :       Float_t nSlow = fSlownparam[0]+fSlownparam[1]/(-fSlownparam[2]-cp);
     223             :       
     224           0 :       nGrayNeutrons = nSlow * 0.1; 
     225           0 :       nBlackNeutrons = nSlow - nGrayNeutrons;
     226           0 :     }
     227             :     else{
     228             :       // Sikler "pasturato" (qui non entra mai!!!!)
     229           0 :       nGrayNeutrons = 0.47 * fAlphaGray *  nu; 
     230           0 :       nBlackNeutrons = 0.88 * fAlphaBlack * nu;      
     231             :       //printf("nslowp=0 -> ncoll = %1.0f -> ngrayn = %1.0f  nblackn = %1.0f \n", nu, nGrayNeutrons, nBlackNeutrons);
     232             :     }
     233             :     //
     234           0 :     if(nGrayNeutrons<0.) nGrayNeutrons=0.;
     235           0 :     if(nBlackNeutrons<0.) nBlackNeutrons=0.;
     236             :     
     237             : //  gray neutrons
     238           0 :     p =  nGrayNeutrons/fN;
     239             : //    ngn = gRandom->Binomial((Int_t) fN, p);
     240           0 :     ngn = gRandom->Gaus(nGrayNeutrons, TMath::Sqrt(fN*p*(1-p)));
     241           0 :     if(nGrayNeutrons<0.) ngn=0;
     242             : 
     243             : //  black neutrons
     244           0 :     p =  nBlackNeutrons/fN;
     245             : //    nbn = gRandom->Binomial((Int_t) fN, p);
     246           0 :     nbn = gRandom->Gaus(nBlackNeutrons, TMath::Sqrt(fN*p*(1-p)));
     247           0 :     if(nBlackNeutrons<0.) nbn=0;
     248             :     
     249           0 : }
     250             : 
     251             : void AliSlowNucleonModelExp::SetParameters(Float_t alpha1, Float_t alpha2)
     252             : {
     253             :     // Set the model parameters
     254           0 :     fAlphaGray  = alpha1;
     255           0 :     fAlphaBlack = alpha2;
     256           0 : }
     257             : 

Generated by: LCOV version 1.11