]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STARLIGHT/starlight/src/narrowResonanceCrossSection.cpp
STARLIGHT update:
[u/mrichter/AliRoot.git] / STARLIGHT / starlight / src / narrowResonanceCrossSection.cpp
CommitLineData
da32329d
AM
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//
20///////////////////////////////////////////////////////////////////////////
21//
22// File and Version Information:
75ce6a3a 23// $Rev:: 193 $: revision of last commit
24// $Author:: jnystrand $: author of last commit
25// $Date:: 2014-12-01 20:39:46 +0100 #$: date of last commit
da32329d
AM
26//
27// Description:
28//
29//
30//
31///////////////////////////////////////////////////////////////////////////
32
33
34#include <iostream>
35#include <fstream>
36#include <cmath>
37
38#include "starlightconstants.h"
39#include "narrowResonanceCrossSection.h"
40
41
42using namespace std;
43using namespace starlightConstants;
44
45
46//______________________________________________________________________________
47narrowResonanceCrossSection::narrowResonanceCrossSection(const beamBeamSystem& bbsystem)
48 :photonNucleusCrossSection(bbsystem)
49{
50 _narrowYmax = inputParametersInstance.maxRapidity();
51 _narrowYmin = -1.0*_narrowYmax;
52 _narrowNumY = inputParametersInstance.nmbRapidityBins();
53 _Ep = inputParametersInstance.protonEnergy();
54}
55
56
57//______________________________________________________________________________
58narrowResonanceCrossSection::~narrowResonanceCrossSection()
59{ }
60
61
62//______________________________________________________________________________
63void
64narrowResonanceCrossSection::crossSectionCalculation(const double) // _bwnormsave (unused)
65{
66 // This subroutine calculates the vector meson cross section assuming
67 // a narrow resonance. For reference, see STAR Note 386.
68
da32329d
AM
69 double W,dY;
70 double y1,y2,y12,ega1,ega2,ega12;
75ce6a3a 71 double csgA1,csgA2,csgA12,int_r,dR;
da32329d 72 double Eth;
75ce6a3a 73 int J,NY,beam;
da32329d
AM
74
75 NY = _narrowNumY;
76 dY = (_narrowYmax-_narrowYmin)/double(NY);
77
78 cout<<" Using Narrow Resonance ..."<<endl;
79
80 W = getChannelMass();
81 Eth=0.5*(((W+protonMass)*(W+protonMass)-
82 protonMass*protonMass)/(_Ep+sqrt(_Ep*_Ep-protonMass*protonMass)));
83
84 cout<<" gamma+nucleon Threshold: "<<Eth<<endl;
85 int_r=0.;
75ce6a3a 86
87 int A_1 = getbbs().beam1().A();
88 int A_2 = getbbs().beam2().A();
da32329d 89
75ce6a3a 90 // Do this first for the case when the first beam is the photon emitter
91 // Treat pA separately with defined beams
92 // The variable beam (=1,2) defines which nucleus is the target
da32329d
AM
93 for(J=0;J<=(NY-1);J++){
94
95 y1 = _narrowYmin + double(J)*dY;
96 y2 = _narrowYmin + double(J+1)*dY;
97 y12 = 0.5*(y1+y2);
98
75ce6a3a 99 if( A_2 == 1 && A_1 != 1 ){
100 // pA, first beam is the nucleus and is in this case the target
101 // Egamma = 0.5*W*exp(-Y);
102 ega1 = 0.5*W*exp(-y1);
103 ega2 = 0.5*W*exp(-y2);
104 ega12 = 0.5*W*exp(-y12);
105 beam = 1;
106 } else if( A_1 ==1 && A_2 != 1){
107 // pA, second beam is the nucleus and is in this case the target
108 // Egamma = 0.5*W*exp(Y);
109 ega1 = 0.5*W*exp(y1);
110 ega2 = 0.5*W*exp(y2);
111 ega12 = 0.5*W*exp(y12);
112 beam = 2;
113 } else {
114 // Egamma = 0.5*W*exp(Y);
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 // ega1 = 0.5*W*exp(y1);
122 // ega2 = 0.5*W*exp(y2);
123 // ega12 = 0.5*W*exp(y12);
da32329d
AM
124
125 if(ega1 < Eth)
126 continue;
127 if(ega2 > maxPhotonEnergy())
128 continue;
129
75ce6a3a 130 csgA1=getcsgA(ega1,W,beam);
da32329d
AM
131
132 // Middle Point =====>>>
75ce6a3a 133 csgA12=getcsgA(ega12,W,beam);
da32329d
AM
134
135 // Second Point =====>>>
75ce6a3a 136 csgA2=getcsgA(ega2,W,beam);
da32329d
AM
137
138 // Sum the contribution for this W,Y.
75ce6a3a 139 dR = ega1*photonFlux(ega1,beam)*csgA1;
140 dR = dR + 4.*ega12*photonFlux(ega12,beam)*csgA12;
141 dR = dR + ega2*photonFlux(ega2,beam)*csgA2;
da32329d
AM
142 dR = dR*(dY/6.);
143
75ce6a3a 144 // cout<<" y: "<<y12<<" egamma: "<<ega12<<" flux: "<<photonFlux(ega12,beam)<<" sigma_gA: "<<10000000.*csgA12<<" dsig/dy (microb): "<<10000.*dR/dY<<endl;
da32329d 145
da32329d
AM
146 int_r = int_r+dR;
147 }
75ce6a3a 148
149 // Repeat the loop for the case when the second beam is the photon emitter.
150 // Don't repeat for pA
151 if( !( (A_2 == 1 && A_1 != 1) || (A_1 == 1 && A_2 != 1) ) ){
152 for(J=0;J<=(NY-1);J++){
153
154 y1 = _narrowYmin + double(J)*dY;
155 y2 = _narrowYmin + double(J+1)*dY;
156 y12 = 0.5*(y1+y2);
157
158 beam = 1;
159 ega1 = 0.5*W*exp(-y1);
160 ega2 = 0.5*W*exp(-y2);
161 ega12 = 0.5*W*exp(-y12);
162
163 if(ega2 < Eth)
164 continue;
165 if(ega1 > maxPhotonEnergy())
166 continue;
167
168 csgA1=getcsgA(ega1,W,beam);
169
170 // Middle Point =====>>>
171 csgA12=getcsgA(ega12,W,beam);
172
173 // Second Point =====>>>
174 csgA2=getcsgA(ega2,W,beam);
175
176 // Sum the contribution for this W,Y.
177 dR = ega1*photonFlux(ega1,beam)*csgA1;
178 dR = dR + 4.*ega12*photonFlux(ega12,beam)*csgA12;
179 dR = dR + ega2*photonFlux(ega2,beam)*csgA2;
180 dR = dR*(dY/6.);
181
182 // cout<<" y: "<<y12<<" egamma: "<<ega12<<" flux: "<<photonFlux(ega12,beam)<<" sigma_gA: "<<10000000.*csgA12<<" dsig/dy (microb): "<<10000.*dR/dY<<endl;
183
184 int_r = int_r+dR;
185 }
186 }
da32329d
AM
187 cout<<" Cross section (mb): " <<10.*int_r<<endl;
188}