27const long double d2r = 3.14159265358979323846/180.;
49 Fatal(
"IsNotRejected",
"Sampling not finished");
59 Warning(
"Init",
"beam or target not found");
75 tmp.Boost(-
target->BoostVector());
76 Double_t tlab = tmp.
KE();
78 return sample(
r, tlab);
92double PSaidLowEnergy::dsdw(
double th,
double tlab) {
96 double Tlab = tlab*1000;
98 long double a0 = 825.770315997777;
99 long double a1 = -36.1806390269961;
100 long double a2 = 0.736508337604257;
101 long double a3 = -0.00245475650713848;
102 long double a4 = -9.46167840068291e-05;
103 long double a5 = 1.18647782825118e-06;
104 long double a6 = -4.23920644982741e-09;
106 long double a01 = 158509949.824459;
107 long double a11 = -1.05462493339422;
108 long double a21 = 0.999464445523888;
109 long double a31 = -0.331696205972712;
110 long double a41 = -1.9817093971156;
111 long double a51 = 339.459572120675;
113 long double a02 = 7013162.6023937;
114 long double a12 = -2.60581893459221;
115 long double a22 = -1.17622988844922 ;
116 long double a32 = -0.0572294874172003;
117 long double a42 = -242.76957186148;
118 long double a52 = 4972.40753398661;
120 long double a03 = 7363793.10073931;
121 long double a13 = -2.78666712844778;
122 long double a23 = -1.19175331577741;
124 long double a43 = 2919.73115823142;
125 long double a53 = -11247.1848613229;
127 long double b0 = -1.11987335717749;
128 long double b1 = 0.0375681831247435;
129 long double b2 = -0.000806720177542215;
130 long double b3 = 7.31226869503504e-06;
131 long double b4 = -2.40772264489991e-08 ;
133 long double b01 = 5.49631512561751;
134 long double b11 = -1.41153243358003;
135 long double b21 = 0.0873325395997571;
136 long double b31 = -0.00210915057288232;
137 long double b41 = 1.78555710528402e-05;
139 long double b02 = -2.01651356175559;
140 long double b12 = 0.00952134681173633;
141 long double b22 = -0.00424259230244138;
142 long double b32 = 0.000815075673344715;
143 long double b42 = -6.09637287432679e-05;
144 long double b52 = 1.5439817446594e-06;
146 long double c0 = -0.0899947020336036;
147 long double c1 = 0.0165457502998486;
148 long double c2 = -0.00035225623300735;
149 long double c3 = 3.18377219079531e-06;
150 long double c4 = -1.04867548784599e-08;
152 long double c01 = 4.02283676522501;
153 long double c11 = -0.571280456418181;
154 long double c21 = 0.0286964703485152;
155 long double c31 = -0.000606564121973199;
156 long double c41 = 4.6543463351715e-06;
158 long double c02 = 0.000449138526079407;
159 long double c12 = -0.00323470722989942;
160 long double c22 = 0.00101229269064745;
161 long double c32 = -8.04320221005051e-05;
162 long double c42 = 1.38972236339651e-06;
163 long double c52 = 1.51442646510768e-08;
165 long double d0 = 0.14637558766108;
166 long double d1 = 0.242429384264589;
167 long double d2 = -0.00515619107849952;
168 long double d3 = 4.5272537785055e-05;
169 long double d4 = -1.42514150093272e-07;
171 long double d01 = 90.5702938678518;
172 long double d11 = -12.623103132398;
173 long double d21 = 0.63864747288047;
174 long double d31 = -0.0137296412910617;
175 long double d41 = 0.000107543327455007;
177 long double d03 = 95.4776480269654;
178 long double d13 = -2.46798492423323;
179 long double d23 = -1.27436869909584;
180 long double d33 = -0.478148940786103;
181 long double d43 = 11.6930721555554;
182 long double d53 = -64.5772975461858;
183 long double d63 = -0.702778910136937;
184 long double d73 = 0.014105237506306;
186 long double as=0, bs=0, cs=0, ds=0;
189 as = a0+a1*th+a2*pow(th,2)+a3*pow(th,3)+a4*pow(th,4)+a5*pow(th,5)+a6*pow(th,6);
190 bs = b0+b1*th+b2*pow(th,2)+b3*pow(th,3)+b4*pow(th,4);
191 cs = c0+
c1*th+
c2*pow(th,2)+
c3*pow(th,3)+
c4*pow(th,4);
192 ds = d0+
d1*th+
d2*pow(th,2)+d3*pow(th,3)+d4*pow(th,4);
195 if(th > 20 && th <= 40) {
196 as = a01*powl((
long double)th,a11)*pow(sin(th*
d2r),a21)*exp(a31*th)+a41*th+a51;
197 bs = b01+b11*th+b21*pow(th,2)+b31*pow(th,3)+b41*pow(th,4);
198 cs = c01+
c11*th+c21*pow(th,2)+c31*pow(th,3)+c41*pow(th,4);
199 ds = d01+d11*th+d21*pow(th,2)+d31*pow(th,3)+d41*pow(th,4);
202 if(th > 3.99 && th <= 20) {
203 as = a02*powl((
long double)th,a12)*pow(sin(th*
d2r),a22)*exp(a32*th)+a42*th+a52;
204 bs = b02+b12*th+b22*pow(th,2)+b32*pow(th,3)+b42*pow(th,4)+b52*pow(th,5);
205 cs = c02+c12*th+c22*pow(th,2)+c32*pow(th,3)+c42*pow(th,4)+c52*pow(th,5);
206 ds = d03*powl((
long double)th,d13)*pow(sin(th*
d2r),d23)*exp(d33*th)+d43*th+d53+d63*pow(th,2)+d73*pow(th,3);
209 if(th > 1 && th <= 3.99) {
210 as = a03*powl((
long double)th,a13)*pow(sin(th*
d2r),a23)*exp(a32*th)+a43*th+a53;
211 bs = b02+b12*th+b22*pow(th,2)+b32*pow(th,3)+b42*pow(th,4)+b52*pow(th,5);
212 cs = c02+c12*th+c22*pow(th,2)+c32*pow(th,3)+c42*pow(th,4)+c52*pow(th,5);
213 ds = d03*powl((
long double)th,d13)*pow(sin(th*
d2r),d23)*exp(d33*th)+d43*th+d53+d63*pow(th,2)+d73*pow(th,3);
217 as = (901707552-762)*th+762;
218 bs = (-2.01+0.628)*th-0.628;
219 cs = (-0.0024+0.229)*th-0.229;
220 ds = (10244.8+267.38)*th-267.38;
223 double sinth = sin(th*
d2r);
238 return sinth*(as*pow((
long double)Tlab,bs*pow((
long double)Tlab,cs)) + ds);
242double PSaidLowEnergy::sample(
double r,
double tlab) {
243 const double fac = 1.3;
250 for (i=0; i<=dim; ++i)
251 y[i] = fac * dsdw((
double)(i+1), tlab);
252 for (i=0; i<dim; ++i) {
253 sum += (y[i+1]>y[i]) ? y[i+1] : y[i] ;
260 double rr,
f, tf, r2, c0, r1 =
r;
264 rr = (2.*r1-i)*aa[dim-1];
265 for (j=0; j<dim; ++j) {
268 if (j) rr -= aa[j-1];
269 tf = (y[j+1]>y[j]) ? y[j+1]: y[j];
274 if (r2 >
f/tf)
goto fail;
275 if (
f <= tf)
return (1-2*i)*cos(c0*
d2r);
277 Warning(
"sample",
"sampling failed f=%lf, tf=%lf",
f, tf);
ClassImp(PBeamLineSimulation) PBeamLineSimulation
Bool_t direct_sampling_done
virtual Double_t KE() const
PDistribution * Clone(const char *delme=NULL) const
Bool_t IsNotRejected(void)
double SamplePolarAngle(double)
static Double_t sampleFlat()
PReaction r(c,"eta_dalitz", 3, 0, 0, 0, 1)