EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
wideResonanceCrossSection.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file wideResonanceCrossSection.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 <fstream>
36 #include <cmath>
37 
38 #include "starlightconstants.h"
40 
41 
42 using namespace std;
43 using namespace starlightConstants;
44 
45 
46 //______________________________________________________________________________
48  : photonNucleusCrossSection(inputParametersInstance, bbsystem)//hrm
49 {
50  _wideWmax = _wMax;
51  _wideWmin = _wMin;
52  _wideYmax = _yMax;
53  _wideYmin = -1.0 * _wideYmax;
54  _Ep = inputParametersInstance.protonEnergy();
55 }
56 
57 
58 //______________________________________________________________________________
60 {
61 
62 }
63 
64 
65 //______________________________________________________________________________
66 void
68 {
69  // This subroutine calculates the cross-section assuming a wide
70  // (Breit-Wigner) resonance.
71 
72  double W,dW,dY;
73  double y1,y2,y12,ega1,ega2,ega12;
74  double csgA1,csgA2,csgA12,int_r,dR;
75  double Eth;
76  int I,J,NW,NY,beam;
77 
78  double bwnorm = bwnormsave; //used to transfer the bwnorm from the luminosity tables
79 
80  //gamma+nucleon threshold.
83 
84  NW = 100;
85  dW = (_wideWmax-_wideWmin)/double(NW);
86 
87  NY = 1200;
88  dY = (_wideYmax-_wideYmin)/double(NY);
89 
90  if (getBNORM() == 0.){
91  cout<<" Using Breit-Wigner Resonance Profile."<<endl;
92  }
93  else{
94  cout<<" Using Breit-Wigner plus direct pi+pi- profile."<<endl;
95  }
96 
97  cout<<" Integrating over W from "<<_wideWmin<<" to "<<_wideWmax<<endl;
98 
99  int A_1 = getbbs().electronBeam().A();
100  int A_2 = getbbs().targetBeam().A();
101 
102  int_r=0.;
103 
104  // Do this first for the case when the first beam is the photon emitter
105  // Treat pA separately with defined beams
106  // The variable beam (=1,2) defines which nucleus is the target
107  for(I=0;I<=NW-1;I++){
108 
109  W = _wideWmin + double(I)*dW + 0.5*dW;
110 
111  for(J=0;J<=NY-1;J++){
112 
113  y1 = _wideYmin + double(J)*dY;
114  y2 = _wideYmin + double(J+1)*dY;
115  y12 = 0.5*(y1+y2);
116 
117  if( A_2 == 1 && A_1 != 1 ){
118  // pA, first beam is the nucleus and is in this case the target
119  // Egamma = 0.5*W*exp(-Y);
120  ega1 = 0.5*W*exp(-y1);
121  ega2 = 0.5*W*exp(-y2);
122  ega12 = 0.5*W*exp(-y12);
123  beam = 1;
124  } else if( A_1 ==1 && A_2 != 1){
125  // pA, second beam is the nucleus and is in this case the target
126  ega1 = 0.5*W*exp(y1);
127  ega2 = 0.5*W*exp(y2);
128  ega12 = 0.5*W*exp(y12);
129  beam = 2;
130  } else {
131  ega1 = 0.5*W*exp(y1);
132  ega2 = 0.5*W*exp(y2);
133  ega12 = 0.5*W*exp(y12);
134  beam = 2;
135  }
136 
137 
138  if(ega1 < Eth || ega2 < Eth) continue;
139  if(ega2 > maxPhotonEnergy()) continue;
140 
141  csgA1=getcsgA(ega1,W,beam);
142 
143  // >> Middle Point =====>>>
144  csgA12=getcsgA(ega12,W,beam);
145 
146  // >> Second Point =====>>>
147  csgA2=getcsgA(ega2,W,beam);
148 
149  //>> Sum the contribution for this W,Y. The 2 accounts for the 2 beams
150  dR = ega1*photonFlux(ega1,beam)*csgA1;
151  dR = dR + 4.*ega12*photonFlux(ega12,beam)*csgA12;
152  dR = dR + ega2*photonFlux(ega2,beam)*csgA2;
153  dR = dR*(dY/6.)*breitWigner(W,bwnorm)*dW;
154 
155  //For identical beams, we double. Either may emit photon/scatter
156  //For large differences in Z, we approx, that only electronBeam emits photon
157  //and targetBeam scatters, eg d-Au where electronBeam=au and targetBeam=d
158  //if(getbbs().electronBeam().A()==getbbs().targetBeam().A()){
159  // dR = 2.*dR;
160  //}
161  int_r = int_r+dR;
162  }
163  }
164 
165  // Repeat the loop for the case when the second beam is the photon emitter.
166  // Don't repeat for pA
167  if( !( (A_2 == 1 && A_1 != 1) || (A_1 == 1 && A_2 != 1) ) ){
168  for(I=0;I<=NW-1;I++){
169 
170  W = _wideWmin + double(I)*dW + 0.5*dW;
171 
172  for(J=0;J<=NY-1;J++){
173 
174  y1 = _wideYmin + double(J)*dY;
175  y2 = _wideYmin + double(J+1)*dY;
176  y12 = 0.5*(y1+y2);
177 
178  beam = 1;
179  ega1 = 0.5*W*exp(-y1);
180  ega2 = 0.5*W*exp(-y2);
181  ega12 = 0.5*W*exp(-y12);
182 
183  if(ega1< Eth || ega2 < Eth) continue;
184  if(ega1 > maxPhotonEnergy()) continue;
185 
186  csgA1=getcsgA(ega1,W,beam);
187 
188  // >> Middle Point =====>>>
189  csgA12=getcsgA(ega12,W,beam);
190 
191  // >> Second Point =====>>>
192  csgA2=getcsgA(ega2,W,beam);
193 
194  //>> Sum the contribution for this W,Y. The 2 accounts for the 2 beams
195  dR = ega1*photonFlux(ega1,beam)*csgA1;
196  dR = dR + 4.*ega12*photonFlux(ega12,beam)*csgA12;
197  dR = dR + ega2*photonFlux(ega2,beam)*csgA2;
198  dR = dR*(dY/6.)*breitWigner(W,bwnorm)*dW;
199 
200  //For identical beams, we double. Either may emit photon/scatter
201  //For large differences in Z, we approx, that only electronBeam emits photon
202  //and targetBeam scatters, eg d-Au where electronBeam=au and targetBeam=d
203  // if(getbbs().electronBeam().A()==getbbs().targetBeam().A()){
204  // dR = 2.*dR;
205  // }
206  int_r = int_r+dR;
207  }
208  }
209  }
210 
211  cout<<endl;
212  if (0.01*int_r > 1.){
213  cout<< " Total cross section: "<<0.01*int_r<<" barn."<<endl;
214  } else if (10.*int_r > 1.){
215  cout<< " Total cross section: " <<10.*int_r<<" mb."<<endl;
216  } else if (10000.*int_r > 1.){
217  cout<< " Total cross section: " <<10000.*int_r<<" microb."<<endl;
218  } else if (10000000.*int_r > 1.){
219  cout<< " Total cross section: " <<10000000.*int_r<<" nanob."<<endl;
220  } else if (1.E10*int_r > 1.){
221  cout<< " Total cross section: "<<1.E10*int_r<<" picob."<<endl;
222  } else {
223  cout<< " Total cross section: " <<1.E13*int_r<<" femtob."<<endl;
224  }
225  cout<<endl;
226  setPhotonNucleusSigma(0.01*int_r);
227 
228 }