Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:42

0001 /*
0002     <one line to give the library's name and an idea of what it does.>
0003     Copyright (C) 2011  Oystein Djuvsland <oystein.djuvsland@gmail.com>
0004 
0005     This library is free software; you can redistribute it and/or
0006     modify it under the terms of the GNU Lesser General Public
0007     License as published by the Free Software Foundation; either
0008     version 2.1 of the License, or (at your option) any later version.
0009 
0010     This library is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013     Lesser General Public License for more details.
0014 
0015     You should have received a copy of the GNU Lesser General Public
0016     License along with this library; if not, write to the Free Software
0017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0018 */
0019 
0020 #include <cmath>
0021 #include "spectrumprotonnucleus.h"
0022 #include "beambeamsystem.h"
0023 #include "beam.h"
0024 #include <iostream>
0025 
0026 spectrumProtonNucleus::spectrumProtonNucleus(const randomGenerator &randy, beamBeamSystem *b) : spectrum(randy,b)
0027 {
0028       _bMin = 4.0;
0029 }
0030 
0031 bool spectrumProtonNucleus::generateBreakupProbabilities()
0032 {
0033     int nbbins = _nBbins;
0034 
0035     double b_min = _bMin;
0036 
0037     double binc = exp((log(_bMax/_bMin))/(double)_nBbins);
0038 
0039     double b = b_min;
0040 
0041     _probOfBreakup.resize(nbbins);
0042 
0043     for (int i = 0; i < nbbins; i++)
0044     {
0045     _beamBeamSystem->beam1().Z() > 1 ? _probOfBreakup[i] = exp(-getNucleonNucleonSigma()*_beamBeamSystem->beam1().thickness(b)) :
0046     _beamBeamSystem->beam2().Z() > 1 ? _probOfBreakup[i] = exp(-getNucleonNucleonSigma()*_beamBeamSystem->beam2().thickness(b)) :
0047     b < 7.76 ? _probOfBreakup[i] = 0 : _probOfBreakup[i] = 1; // Should always be true though
0048     
0049         b = b*binc;
0050     }
0051 
0052     return true;
0053 }
0054 
0055 double spectrumProtonNucleus::getSigma(double ) const
0056 {
0057     return 0.11;
0058 }
0059 
0060