EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
narrowResonanceCrossSection.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file narrowResonanceCrossSection.cpp
1 
2 //
3 // Copyright 2010
4 //
5 // This file is part of starlight.
6 //
7 // starlight is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // starlight is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with starlight. If not, see <http://www.gnu.org/licenses/>.
19 //
21 //
22 // File and Version Information:
23 // $Rev:: 264 $: revision of last commit
24 // $Author:: jseger $: author of last commit
25 // $Date:: 2016-06-06 21:05:12 +0100 #$: date of last commit
26 //
27 // Description:
28 //
29 //
30 //
32 
33 
34 #include <iostream>
35 #include <iomanip>
36 #include <fstream>
37 #include <cmath>
38 
39 #include "starlightconstants.h"
41 
42 
43 using namespace std;
44 using namespace starlightConstants;
45 
46 
47 //______________________________________________________________________________
49  :photonNucleusCrossSection(inputParametersInstance, bbsystem)
50 {
51  _narrowYmax = inputParametersInstance.maxRapidity();
52  _narrowYmin = -1.0*_narrowYmax;
53  _narrowNumY = inputParametersInstance.nmbRapidityBins();
54  _Ep = inputParametersInstance.protonEnergy();
55 }
56 
57 
58 //______________________________________________________________________________
60 { }
61 
62 
63 //______________________________________________________________________________
64 void
65 narrowResonanceCrossSection::crossSectionCalculation(const double) // _bwnormsave (unused)
66 {
67  // This subroutine calculates the vector meson cross section assuming
68  // a narrow resonance. For reference, see STAR Note 386.
69 
70  double W,dY;
71  double y1,y2,y12,ega1,ega2,ega12;
72  double csgA1,csgA2,csgA12,int_r,dR;
73  double Eth;
74  int J,NY,beam;
75 
76  NY = _narrowNumY;
77  dY = (_narrowYmax-_narrowYmin)/double(NY);
78 
79  cout<<" Using Narrow Resonance ..."<<endl;
80 
81  W = getChannelMass();
82  Eth=0.5*(((W+protonMass)*(W+protonMass)-
84 
85  // cout<<" gamma+nuclexon Threshold: "<<Eth<<endl;
86  printf(" gamma+nucleon threshold: %e GeV \n", Eth);
87 
88  int A_1 = getbbs().electronBeam().A();
89  int A_2 = getbbs().targetBeam().A();
90 
91  int_r=0.;
92 
93  // Do this first for the case when the first beam is the photon emitter
94  // Treat pA separately with defined beams
95  // The variable beam (=1,2) defines which nucleus is the target
96  for(J=0;J<=(NY-1);J++){
97 
98  y1 = _narrowYmin + double(J)*dY;
99  y2 = _narrowYmin + double(J+1)*dY;
100  y12 = 0.5*(y1+y2);
101 
102  if( A_2 == 1 && A_1 != 1 ){
103  // pA, first beam is the nucleus and is in this case the target
104  ega1 = 0.5*W*exp(-y1);
105  ega2 = 0.5*W*exp(-y2);
106  ega12 = 0.5*W*exp(-y12);
107  beam = 1;
108  } else if( A_1 ==1 && A_2 != 1){
109  // pA, second beam is the nucleus and is in this case the target
110  ega1 = 0.5*W*exp(y1);
111  ega2 = 0.5*W*exp(y2);
112  ega12 = 0.5*W*exp(y12);
113  beam = 2;
114  } else {
115  ega1 = 0.5*W*exp(y1);
116  ega2 = 0.5*W*exp(y2);
117  ega12 = 0.5*W*exp(y12);
118  beam = 2;
119  }
120 
121  if(ega1 < Eth || ega2 < Eth)
122  continue;
123  if(ega2 > maxPhotonEnergy() || ega1 > maxPhotonEnergy() )
124  continue;
125 
126  csgA1=getcsgA(ega1,W,beam);
127 
128  // Middle Point =====>>>
129  csgA12=getcsgA(ega12,W,beam);
130 
131  // Second Point =====>>>
132  csgA2=getcsgA(ega2,W,beam);
133 
134  // Sum the contribution for this W,Y.
135  dR = ega1*photonFlux(ega1,beam)*csgA1;
136  dR = dR + 4.*ega12*photonFlux(ega12,beam)*csgA12;
137  dR = dR + ega2*photonFlux(ega2,beam)*csgA2;
138  dR = dR*(dY/6.);
139 
140  // cout<<" y: "<<y12<<" egamma: "<<ega12<<" flux: "<<photonFlux(ega12,beam)<<" sigma_gA: "<<10000000.*csgA12<<" dsig/dy (microb): "<<10000.*dR/dY<<endl;
141 
142  int_r = int_r+dR;
143  }
144 
145  // Repeat the loop for the case when the second beam is the photon emitter.
146  // Don't repeat for pA
147  if( !( (A_2 == 1 && A_1 != 1) || (A_1 == 1 && A_2 != 1) ) ){
148  for(J=0;J<=(NY-1);J++){
149 
150  y1 = _narrowYmin + double(J)*dY;
151  y2 = _narrowYmin + double(J+1)*dY;
152  y12 = 0.5*(y1+y2);
153 
154  beam = 1;
155  ega1 = 0.5*W*exp(-y1);
156  ega2 = 0.5*W*exp(-y2);
157  ega12 = 0.5*W*exp(-y12);
158 
159  if(ega2 < Eth || ega1 < Eth)
160  continue;
161  if(ega1 > maxPhotonEnergy() || ega2 > maxPhotonEnergy() )
162  continue;
163 
164  csgA1=getcsgA(ega1,W,beam);
165 
166  // Middle Point =====>>>
167  csgA12=getcsgA(ega12,W,beam);
168 
169  // Second Point =====>>>
170  csgA2=getcsgA(ega2,W,beam);
171 
172  // Sum the contribution for this W,Y.
173  dR = ega1*photonFlux(ega1,beam)*csgA1;
174  dR = dR + 4.*ega12*photonFlux(ega12,beam)*csgA12;
175  dR = dR + ega2*photonFlux(ega2,beam)*csgA2;
176  dR = dR*(dY/6.);
177 
178  // cout<<" y: "<<y12<<" egamma: "<<ega12<<" flux: "<<photonFlux(ega12,beam)<<" sigma_gA: "<<10000000.*csgA12<<" dsig/dy (microb): "<<10000.*dR/dY<<endl;
179 
180  int_r = int_r+dR;
181  }
182  }
183 
184  cout<<endl;
185  if (0.01*int_r > 1.){
186  cout<< " Total cross section: "<<0.01*int_r<<" barn."<<endl;
187  } else if (10.*int_r > 1.){
188  cout<< " Total cross section: " <<10.*int_r<<" mb."<<endl;
189  } else if (10000.*int_r > 1.){
190  cout<< " Total cross section: " <<10000.*int_r<<" microb."<<endl;
191  } else if (10000000.*int_r > 1.){
192  cout<< " Total cross section: " <<10000000.*int_r<<" nanob."<<endl;
193  } else if (1.E10*int_r > 1.){
194  cout<< " Total cross section: "<<1.E10*int_r<<" picob."<<endl;
195  } else {
196  cout<< " Total cross section: " <<1.E13*int_r<<" femtob."<<endl;
197  }
198  cout<<endl;
199  setPhotonNucleusSigma(0.01*int_r);
200 }