EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spectrumprotonnucleus.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file spectrumprotonnucleus.cpp
1 /*
2  <one line to give the library's name and an idea of what it does.>
3  Copyright (C) 2011 Oystein Djuvsland <oystein.djuvsland@gmail.com>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #include <cmath>
21 #include "spectrumprotonnucleus.h"
22 #include "beambeamsystem.h"
23 #include "beam.h"
24 #include <iostream>
25 
27 {
28  _bMin = 4.0;
29 }
30 
32 {
33  int nbbins = _nBbins;
34 
35  double b_min = _bMin;
36 
37  double binc = exp((log(_bMax/_bMin))/(double)_nBbins);
38 
39  double b = b_min;
40 
41  _probOfBreakup.resize(nbbins);
42 
43  for (int i = 0; i < nbbins; i++)
44  {
45  _beamBeamSystem->beam1().Z() > 1 ? _probOfBreakup[i] = exp(-getNucleonNucleonSigma()*_beamBeamSystem->beam1().thickness(b)) :
46  _beamBeamSystem->beam2().Z() > 1 ? _probOfBreakup[i] = exp(-getNucleonNucleonSigma()*_beamBeamSystem->beam2().thickness(b)) :
47  b < 7.76 ? _probOfBreakup[i] = 0 : _probOfBreakup[i] = 1; // Should always be true though
48 
49  b = b*binc;
50  }
51 
52  return true;
53 }
54 
55 double spectrumProtonNucleus::getSigma(double ) const
56 {
57  return 0.11;
58 }
59 
60