BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
minor.h
Go to the documentation of this file.
1/*
2 * minor.h - signed minors classes
3 *
4 * this file is part of PJFry library
5 * Copyright 2011 Valery Yundin
6 */
7
8#ifndef QUL_MINOR_H
9#define QUL_MINOR_H
10
11#include "common.h"
12#include "kinem.h"
13#include "pointer.h"
14#include <bitset>
15
16// one step of Wynn epsilon improvement
17#define stepWynn(n) \
18 sum[(2+n)%3]=sum1; \
19 { \
20 const ncomplex s2=sum[(2+n)%3]; \
21 const ncomplex s1=sum[(1+n)%3]; \
22 const ncomplex s10=s21; \
23 s21=s2-s1; \
24 if ( s21==s10 \
25 || ( fabs(s2.real()*heps)>=fabs(s21.real()) \
26 && fabs(s2.imag()*heps)>=fabs(s21.imag()) ) ) \
27 break; \
28 dv=sump; \
29 sump=s1+1./(1./s21-1./s10); \
30 } \
31 if ( fabs(sump.real()*teps)>=fabs(sump.real()-dv.real()) \
32 && fabs(sump.imag()*teps)>=fabs(sump.imag()-dv.imag()) ) \
33 break;
34// -------------
35
36#define tswap(x,y,t) \
37 if (x > y) { \
38 t=y; \
39 y=x; \
40 x=t; \
41 }
42
43#ifndef USE_ZERO_CHORD
44/* if zero chord is not used - calculate only 4 form factors for 5-point */
45# define CIDX (DCay-2)
46#else
47/* else calculate all (including coefficient of 0'th chord) */
48# define CIDX (DCay-1)
49#endif
50
51class MinorBase : public SRefCnt
52{
53 public:
55
56#ifdef USE_GOLEM_MODE
57#define EVALUNDEF return std::numeric_limits<double>::signaling_NaN();
58 virtual ncomplex A(int ep) { EVALUNDEF }
59 virtual ncomplex A(int ep, int i) { EVALUNDEF }
60 virtual ncomplex A(int ep, int i, int j) { EVALUNDEF }
61 virtual ncomplex A(int ep, int i, int j, int k) { EVALUNDEF }
62 virtual ncomplex A(int ep, int i, int j, int k, int l) { EVALUNDEF }
63 virtual ncomplex A(int ep, int i, int j, int k, int l, int m) { EVALUNDEF }
64 virtual ncomplex B(int ep) { EVALUNDEF }
65 virtual ncomplex B(int ep, int i) { EVALUNDEF; }
66 virtual ncomplex B(int ep, int i, int j) { EVALUNDEF }
67 virtual ncomplex B(int ep, int i, int j, int k) { EVALUNDEF }
68 virtual ncomplex C(int ep) { EVALUNDEF }
69 virtual ncomplex C(int ep, int i) { EVALUNDEF }
70#undef EVALUNDEF
71#endif /* USE_GOLEM_MODE */
72
73 // Symmetric index - start from 1
74 inline static int ns(int i, int j) CONST
75 {
76 return ( i<=j ? (i-1)+((j-1)*j)/2 : (j-1)+((i-1)*i)/2 );
77 }
78
79 inline static int nss(int i, int j) CONST // ordered
80 {
81 return (i-1)+((j-1)*j)/2;
82 }
83
84 // Symmetric index - generic
85 inline static int is(int i, int j) CONST
86 {
87 return ( i<=j ? i+j*(j+1)/2 : j+i*(i+1)/2 );
88 }
89
90 inline static int is(int i, int j, int k) CONST
91 {
92 if (i <= j) {
93 return (j <= k ? i+ti2[j]+ti3[k] : is(i,k)+ti3[j]);
94 }
95 else {
96 return (i > k ? is(j,k)+ti3[i] : j+ti2[i]+ti3[k]);
97 }
98 }
99
100 inline static int is(int i, int j, int k, int l) CONST
101 {
102 if (i <= j) {
103 if (j <= k) {
104 return (k <= l ? i+ti2[j]+ti3[k]+ti4[l]
105 : is(i,j,l)+ti4[k] );
106 }
107 else {
108 return (j > l ? is(i,k,l)+ti4[j]
109 : is(i,k)+ti3[j]+ti4[l] );
110 }
111 }
112 else {
113 if (i > k) {
114 return (i > l ? is(j,k,l)+ti4[i]
115 : is(j,k)+ti3[i]+ti4[l] );
116 }
117 else {
118 return (k <= l ? j+ti2[i]+ti3[k]+ti4[l]
119 : is(i,j,l)+ti4[k] );
120 }
121 }
122 }
123
124 inline static int iss(int i, int j) CONST // ordered
125 {
126 assert(i<=j);
127 return i+j*(j+1)/2;
128 }
129
130 inline static int iss(int i, int j, int k) CONST // ordered
131 {
132 assert(i <= j && j <= k);
133 return i+ti2[j]+ti3[k];
134 }
135
136 inline static int iss(int i, int j, int k, int l) CONST // ordered
137 {
138 assert(i <= j && j <= k && k <= l);
139 return i+ti2[j]+ti3[k]+ti4[l];
140 }
141
142 inline static int iss(int i, int j, int k, int l, int m) CONST // ordered
143 {
144 assert(i <= j && j <= k && k <= l && l <= m);
145 return i+ti2[j]+ti3[k]+ti4[l]+ti5[m];
146 }
147
148 inline static double getmeps()
149 {
150 return meps;
151 }
152
153 // Utility functions
154 static int im3(int i, int j, int k) CONST; // Antisymmetric index for "3 out of 6" minors
155 static int im2(int i, int j) CONST; // Antisymmetric index for "2 out of 6" minors
156 static int signM3ud(int i, int j, int k, int l, int m, int n) CONST; // Signature[{i,j,k}]*Signature[{l,m,n}]
157 static int signM2ud(int i, int j, int l, int m) CONST; // Signature[{i,j}]*Signature[{l,m}]
158
159 // fill 'free' array with indices which are not occupied by 'set' array
160 static void freeidxM3(int set[], int free[]);
161
162 static void Rescale(double factor);
163
164 private:
165 static const unsigned char ti2[8];
166 static const unsigned char ti3[8];
167 static const unsigned char ti4[8];
168 static const unsigned char ti5[8];
169
170 protected:
171 static const unsigned char idxtbl[64];
172
173 static const double teps; // expansion target accuracy
174 static const double heps; // near double precision eps
175
176 static const double ceps;
177
178 static const double deps1;
179 static const double deps2;
180 static const double deps3;
181
182 static const double seps1; // two-point cutoff
183 static const double seps2; // two-point cutoff
184
185 static const double epsir1; // 3-point IR cutoff
186 static const double epsir2; // 3-point IR cutoff
187
188 static double deps;
189 static double meps; // onshell cutoff
190 static double m3eps; // I3 IR cutoff
191};
192
193template <int N>
194class Minor : public MinorBase
195{
196 public:
197 Minor() {}
198
199 inline double Kay(int i, int j) PURE
200 {
201 if (i==0) {
202 return j==0 ? 0 : 1;
203 } else {
204 return j==0 ? 1 : Cay[ns(i,j)];
205 }
206 }
207
208 protected:
209 // Cayley matrix (symmetric)
210 static const int DCay=N+1;
211 double Cay[(DCay-1)*(DCay)/2];
212};
213
214class Minor5 : public Minor<5>
215{
216 public:
217 friend class SPtr<Minor5>;
219 static Ptr create(const Kinem5 &k) { return Ptr(new Minor5(k)); }
220 static Ptr create(const Kinem4 &k) { return Ptr(new Minor5(k)); }
221
222 ncomplex evalE(int ep);
223 ncomplex evalE(int ep, int i);
224 ncomplex evalE(int ep, int i, int j);
225 ncomplex evalE(int ep, int i, int j, int k);
226 ncomplex evalE(int ep, int i, int j, int k, int l);
227 ncomplex evalE(int ep, int i, int j, int k, int l, int m);
228
229#ifdef USE_GOLEM_MODE
230#ifdef USE_GOLEM_MODE_6
231 int psix;
232 #define ix(i) i<psix ? i : i-1
233#else
234 #define ix(i) i
235#endif
236 virtual ncomplex A(int ep) { return evalE(ep); }
237 virtual ncomplex A(int ep, int i) { return evalE(ep, ix(i)); }
238 virtual ncomplex A(int ep, int i, int j) { return evalE(ep, ix(i), ix(j)); }
239 virtual ncomplex A(int ep, int i, int j, int k) { return evalE(ep, ix(i), ix(j), ix(k)); }
240 virtual ncomplex A(int ep, int i, int j, int k, int l) { return evalE(ep, ix(i), ix(j), ix(k), ix(l)); }
241 virtual ncomplex A(int ep, int i, int j, int k, int l, int m) { return evalE(ep, ix(i), ix(j), ix(k), ix(l), ix(m)); }
242 virtual ncomplex B(int ep) { return evalE(ep, 0, 0); }
243 virtual ncomplex B(int ep, int i) { return evalE(ep, 0, 0, ix(i)); }
244 virtual ncomplex B(int ep, int i, int j) { return evalE(ep, 0, 0, ix(i), ix(j)); }
245 virtual ncomplex B(int ep, int i, int j, int k) { return evalE(ep, 0, 0, ix(i), ix(j), ix(k)); }
246 virtual ncomplex C(int ep) { return evalE(ep, 0, 0, 0, 0); }
247 virtual ncomplex C(int ep, int i) { return evalE(ep, 0, 0, 0, 0, ix(i)); }
248 #undef ix
249#endif /* USE_GOLEM_MODE */
250
251 ncomplex I4s(int ep, int s);
252
253 ncomplex I3st(int ep, int s, int t);
254 ncomplex I4Ds(int ep, int s);
255 ncomplex I4Dsi(int ep, int s, int i);
256
257 ncomplex I2stu(int ep, int s, int t, int u);
258 ncomplex I3Dst(int ep, int s, int t);
259 ncomplex I4D2s(int ep, int s);
260
261 ncomplex I4D2si(int ep, int s, int i);
262 ncomplex I3Dsti(int ep, int s, int t, int i);
263 ncomplex I3D2st(int ep, int s, int t);
264 ncomplex I4D3s(int ep, int s);
265 ncomplex I4D2sij(int ep, int s, int i, int j);
266
267 ncomplex I2Dstu(int ep, int s, int t, int u);
268 ncomplex I3D2sti(int ep, int s, int t, int i);
269 ncomplex I4D3si(int ep, int s, int i);
270 ncomplex I4D3sij(int ep, int s, int i, int j);
271
272 ncomplex I2Dstui(int ep, int s, int t, int u, int i);
273 ncomplex I3D2stij(int ep, int s, int t, int i, int j);
274 ncomplex I4D3sijk(int ep, int s, int i, int j, int k);
275
276 ncomplex I4D4s(int ep, int s);
277 ncomplex I4D4si(int ep, int s, int i);
278 ncomplex I3D3sti(int ep, int s, int t, int i);
279 ncomplex I4D4sij(int ep, int s, int i, int j);
280 ncomplex I2D2stui(int ep, int s, int t, int u, int i);
281 ncomplex I3D3stij(int ep, int s, int t, int i, int j);
282 ncomplex I4D4sijk(int ep, int s, int i, int j, int k);
283 ncomplex I2D2stuij(int ep, int s, int t, int u, int i, int j);
284 ncomplex I3D3stijk(int ep, int s, int t, int i, int j, int k);
285 ncomplex I4D4sijkl(int ep, int s, int i, int j, int k, int l);
286
287 // Gram4
288 ncomplex I2D2stu(int ep, int s, int t, int u);
289 ncomplex I3D3st(int ep, int s, int t);
290 ncomplex I2D3stu(int ep, int s, int t, int u);
291 ncomplex I3D4st(int ep, int s, int t);
292 ncomplex I2D4stu(int ep, int s, int t, int u);
293 ncomplex I3D5st(int ep, int s, int t);
294 ncomplex I2D5stu(int ep, int s, int t, int u);
295 ncomplex I3D6st(int ep, int s, int t);
296 ncomplex I2D6stu(int ep, int s, int t, int u);
297 ncomplex I3D7st(int ep, int s, int t);
298
299 //Aux
300
301 double M1(int i, int l) PURE;
302 double M2(int i, int j, int l, int m) PURE;
303 double M3(int i, int j, int k, int l, int m, int n) PURE;
304
305 double gram3(double p1, double p2, double p3) PURE;
306
307 private:
308 Minor5(const Kinem5 &k); // prevent direct creation
309 Minor5(const Kinem4 &k); // prevent direct creation
310 Minor5(const Minor5 &m) : smax(0) { assert(0); } // prevent copy-constructing
311 Minor5& operator= (const Minor5& m) { assert(0); } // prevent reassignment
312
313 Kinem5 kinem;
314 const int smax;
315
316 // Maximal elements of sub-Cayley's
317 double pmaxS4[DCay-1]; // s{1..5}
318
319 double pmaxS3[10]; // s,t - symm 5x5 w/o diag els
320 double pmaxT3[10]; // s,t - symm 5x5 w/o diag els
321 double pmaxU3[10]; // s,t - symm 5x5 w/o diag els
322 int imax3[10];
323
324 double pmaxM2[10]; // i,ip - symm 5x5 w/o diag els
325
326 // flags marking evuation steps
327 enum EvalM {E_None=0,
328 E_M1, E_M2, E_M3,
329 E_I4D4sijkl,
330 E_I4D4sijk=E_I4D4sijkl+3,
331 E_I3D3stij=E_I4D4sijk+3,
332 E_I4D4sij=E_I3D3stij+3,
333 E_I3D3sti=E_I4D4sij+3,
334 E_I4D4si=E_I3D3sti+3,
335 E_I4D4s=E_I4D4si+3,
336 E_I2D6stu=E_I4D4s+3,
337 E_I3D7st=E_I2D6stu+3,
338 E_I2D5stu=E_I3D7st+3,
339 E_I3D6st=E_I2D5stu+3,
340 E_I2D4stu=E_I3D6st+3,
341 E_I3D5st=E_I2D4stu+3,
342 E_I2D3stu=E_I3D5st+3,
343 E_I3D4st=E_I2D3stu+3,
344 E_I3D3stijk=E_I3D4st+3,
345 E_I2D2stui=E_I3D3stijk+3,
346 E_I2D2stuij=E_I2D2stui+3,
347 E_I2D2stu=E_I2D2stuij+3,
348 E_I3D3st=E_I2D2stu+3,
349 E_I4D3sijk=E_I3D3st+3,
350 E_I3D2stij=E_I4D3sijk+3,
351 E_I2Dstui=E_I3D2stij+3,
352 E_I3D2st=E_I2Dstui+2,
353 E_I4D3s=E_I3D2st+3,
354 E_I4D3sij=E_I4D3s+3,
355 E_I4D3si=E_I4D3sij+3,
356 E_I3D2sti=E_I4D3si+3,
357 E_I2Dstu=E_I3D2sti+3,
358 E_I3Dsti=E_I2Dstu+3,
359 E_I4D2sij=E_I3Dsti+3,
360 E_I2stu=E_I4D2sij+3,
361 E_I4D2s=E_I2stu+3,
362 E_I4D2si=E_I4D2s+3,
363 E_I3Dst=E_I4D2si+3,
364 E_I4Dsi=E_I3Dst+3,
365 E_I4Ds=E_I4Dsi+3,
366 E_I4s=E_I4Ds+3,
367 E_I3st=E_I4s+3,
368 E_DUM=E_I3st+3,
369 E_LEN};
370 std::bitset<E_LEN> fEval;
371
372 // number of unique ways you can scratch out 3 rows in 6x6 matrix
373 static const int DM3=20; // Binomial[6,3] = 6*5*4/3! = 20
374 double pM3[DM3*(DM3+1)/2];
375 static const int DM2=15; // Binomial[6,2] = 15
376 double pM2[DM2*(DM2+1)/2];
377 static const int DM1=6; // Binomial[6,1] = 6
378 double pM1[DM1*(DM1+1)/2];
379
380 // Integral values
381 ncomplex pI4s[3][DCay-1]; // s{1..5}
382
383 ncomplex pI3st[3][10]; // symm 5x5 w/o diag els
384 ncomplex pI4Ds[1][DCay-1]; // s{1..5} // finite
385 ncomplex pI4Dsi[3][CIDX][DCay-1]; // i{1..4}, s{1..5}
386
387 ncomplex pI2stu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
388 ncomplex pI3Dst[1][10]; // symm 5x5 w/o diag els 5*6-5=10 // finite part only
389 ncomplex pI4D2s[1][DCay-1]; // s{1..5} // finite part only
390
391 ncomplex pI4D2si[1][CIDX][DCay-1]; // i{1..4} s{1..5} // finite
392 ncomplex pI3Dsti[3][CIDX][10]; // i{1..4} + symm 5x5 w/o diag els
393 ncomplex pI4D2sij[3][CIDX*(CIDX+1)/2][DCay-1]; // symm 4x4, s{1..5}
394
395 ncomplex pI2Dstu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
396 ncomplex pI3D2st[2][10]; // symm 5x5 w/o diag els // (0,1) parts only
397 ncomplex pI4D3s[2][DCay-1]; // s{1..5} // (0,1) parts only
398 ncomplex pI3D2sti[2][CIDX][10]; // i{1..4} + symm 5x5 w/o diag els // (0,1) parts only
399 ncomplex pI4D3si[2][CIDX][DCay-1]; // i{1..4} s{1..5} // (0,1) parts only
400 ncomplex pI4D3sij[1][CIDX*(CIDX+1)/2][DCay-1]; // symm 4x4, s{1..5} // finite
401
402 ncomplex pI2Dstui[2][CIDX][DCay-1]; // ~~ 16 elements // finite part only
403 ncomplex pI3D2stij[3][CIDX*(CIDX+1)/2][10]; // 'symm 4x4' x 'symm 5x5 w/o diag els'
404 ncomplex pI4D3sijk[3][CIDX*(CIDX+1)*(CIDX+2)/6][DCay-1]; // 4x4x4 symm(20 els), s{1..5}
405
406 ncomplex pI2D2stu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
407 ncomplex pI3D3st[2][10]; // symm 5x5 w/o diag els // (0,1) parts only
408 ncomplex pI4D4s[2][DCay-1]; // s{1..5} // (0,1) parts only
409 ncomplex pI4D4si[2][CIDX][DCay-1]; // i{1..4} s{1..5} // (0,1) parts only
410 ncomplex pI3D3sti[2][CIDX][10]; // i{1..4} + symm 5x5 w/o diag els // (0,1) parts only
411 ncomplex pI4D4sij[2][CIDX*(CIDX+1)/2][DCay-1]; // symm 4x4, s{1..5} // (0,1) parts only
412 ncomplex pI2D2stui[2][CIDX][DCay-1]; // ~~ 16 elements // (0,1) parts only
413 ncomplex pI3D3stij[2][CIDX*(CIDX+1)/2][10]; // 'symm 4x4' x 'symm 5x5 w/o diag els' // (0,1) parts only
414 ncomplex pI4D4sijk[2][CIDX*(CIDX+1)*(CIDX+2)/6][DCay-1]; // 4x4x4 symm(20 els), s{1..5} // finite
415 ncomplex pI2D2stuij[2][CIDX][DCay-1][2]; // as stui but with 0:i==j and 1:i!=j
416 ncomplex pI3D3stijk[3][CIDX*(CIDX+1)*(CIDX+2)/6][10]; // 4x4x4 symm(20 els), x 'symm 5x5 w/o diag els'
417 ncomplex pI4D4sijkl[3][CIDX*(CIDX+1)*(CIDX+2)*(CIDX+3)/24][DCay-1]; // 4x4x4x4 symm(35 els), s{1..5} // ????
418
419 // Gram4
420 // TODO cleanup these funcs
421 ncomplex pI2D3stu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
422 ncomplex pI3D4st[2][10]; // symm 5x5 w/o diag els // (0,1) parts only
423 ncomplex pI2D4stu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
424 ncomplex pI3D5st[2][10]; // symm 5x5 w/o diag els // (0,1) parts only
425 ncomplex pI2D5stu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
426 ncomplex pI3D6st[2][10]; // symm 5x5 w/o diag els // (0,1) parts only
427 ncomplex pI2D6stu[2][10]; // symm 5x5x5 w/o diag els // (0,1) parts only
428 ncomplex pI3D7st[2][10]; // symm 5x5 w/o diag els // (0,1) parts only
429
430 // Aux
431
432 // evaluate and save for future use M1,M2,M3 minors
433 void evalM1();
434 void evalM2();
435 void evalM3();
436
437 // find and save maximal elements of subcayley matrices
438 void maxCay();
439
440 // evaluate and save for the future use scratched integrals
441 void I4sEval(int ep);
442
443 void I3stEval(int ep);
444 void I4DsEval(int ep);
445 void I4DsiEval(int ep);
446
447 void I2stuEval(int ep);
448 void I3DstEval(int ep);
449 void I4D2sEval(int ep);
450
451 void I4D2siEval(int ep);
452 void I3DstiEval(int ep);
453 void I3D2stEval(int ep);
454 void I4D3sEval(int ep);
455 void I4D2sijEval(int ep);
456
457 void I2DstuEval(int idx, int ep, int s, int t, int u, int m, int n, double qsq);
458 void I3D2stiEval(int ep);
459 void I4D3siEval(int ep);
460 void I4D3sijEval(int ep);
461
462 void I2DstuiEval(int ep, int s, int t, int u, int i, int ip, double qsq);
463 void I3D2stijEval(int ep);
464 void I4D3sijkEval(int ep);
465
466 void I4D4sEval(int ep);
467 void I4D4siEval(int ep);
468 void I3D3stiEval(int ep);
469 void I4D4sijEval(int ep);
470 void I2D2stuiEval(int ep, int s, int t, int u, int i, int ip, double qsq);
471 void I3D3stijEval(int ep);
472 void I4D4sijkEval(int ep);
473 void I2D2stuijEval(int ep, int s, int t, int u, int i, int ip, double qsq);
474 void I3D3stijkEval(int ep);
475 void I4D4sijklEval(int ep);
476
477 // Gram4
478 void I2D2stuEval(int idx, int ep, int s, int t, int u, int m, int n, double qsq);
479 void I3D3stEval(int ep);
480 void I2D3stuEval(int idx, int ep, int s, int t, int u, int m, int n, double qsq);
481 void I3D4stEval(int ep);
482 void I2D4stuEval(int idx, int ep, int s, int t, int u, int m, int n, double qsq);
483 void I3D5stEval(int ep);
484 void I2D5stuEval(int idx, int ep, int s, int t, int u, int m, int n, double qsq);
485 void I3D6stEval(int ep);
486 void I2D6stuEval(int idx, int ep, int s, int t, int u, int m, int n, double qsq);
487 void I3D7stEval(int ep);
488
489 // IR
490 ncomplex I2mDstu(int ep, int s, int t, int u, int m, int n);
491 ncomplex I2stui(int ep, int s, int t, int u, int i, int ip);
492
493 double M4ii(int u, int v, int i) PURE;
494 double M4ui(int u, int v, int i) PURE;
495 double M4vi(int u, int v, int i) PURE;
496 double M4uu(int u, int v, int i) PURE;
497 double M4vu(int u, int v, int i) PURE;
498 double M4vv(int u, int v, int i) PURE;
499};
500
501class Minor4 : public Minor<4>
502{
503 public:
504 friend class SPtr<Minor4>;
506 static Ptr create(const Kinem4 &k, Minor5::Ptr mptr5, int s, int is)
507 {
508 return Ptr(new Minor4(k, mptr5, s, is));
509 }
510
512 ncomplex evalD(int ep, int i);
513 ncomplex evalD(int ep, int i, int j);
514 ncomplex evalD(int ep, int i, int j, int k);
515 ncomplex evalD(int ep, int i, int j, int k, int l);
516
517#ifdef USE_GOLEM_MODE
518 virtual ncomplex A(int ep);
519 virtual ncomplex A(int ep, int i);
520 virtual ncomplex A(int ep, int i, int j);
521 virtual ncomplex A(int ep, int i, int j, int k);
522 virtual ncomplex A(int ep, int i, int j, int k, int l);
523 virtual ncomplex B(int ep);
524 virtual ncomplex B(int ep, int i);
525 virtual ncomplex B(int ep, int i, int j);
526 virtual ncomplex C(int ep);
527#endif /* USE_GOLEM_MODE */
528
529 private:
530 Minor4(const Kinem4 &k, Minor5::Ptr mptr, int s, int is);
531
532 Kinem4 kinem;
533
534 const Minor5::Ptr pm5;
535 const int ps, offs;
536};
537
538class Minor3 : public Minor<3>
539{
540 public:
541 friend class SPtr<Minor3>;
543 static Ptr create(const Kinem3 &k, Minor5::Ptr mptr5, int s, int t, int is)
544 {
545 return Ptr(new Minor3(k, mptr5, s, t, is));
546 }
547
549 ncomplex evalC(int ep, int i);
550 ncomplex evalC(int ep, int i, int j);
551 ncomplex evalC(int ep, int i, int j, int k);
552
553#ifdef USE_GOLEM_MODE
554 virtual ncomplex A(int ep);
555 virtual ncomplex A(int ep, int i);
556 virtual ncomplex A(int ep, int i, int j);
557 virtual ncomplex A(int ep, int i, int j, int k);
558 virtual ncomplex B(int ep);
559 virtual ncomplex B(int ep, int i);
560#endif /* USE_GOLEM_MODE */
561
562 private:
563 Minor3(const Kinem3 &k);
564 Minor3(const Kinem3 &k, Minor5::Ptr mptr5, int s, int t, int is);
565
566 Kinem3 kinem;
567
568 const Minor5::Ptr pm5;
569 const int ps, pt, offs;
570};
571
572class Minor2 : public Minor<2>
573{
574 public:
575 friend class SPtr<Minor2>;
577 static Ptr create(const Kinem2 &k, Minor5::Ptr mptr5, int s, int t, int u, int is)
578 {
579 return Ptr(new Minor2(k, mptr5, s, t, u, is));
580 }
581
583 ncomplex evalB(int ep, int i);
584 ncomplex evalB(int ep, int i, int j);
585
586#ifdef USE_GOLEM_MODE
587 virtual ncomplex A(int ep);
588 virtual ncomplex A(int ep, int i);
589 virtual ncomplex A(int ep, int i, int j);
590 virtual ncomplex B(int ep);
591#endif /* USE_GOLEM_MODE */
592
593 private:
594 Minor2(const Kinem2 &k);
595 Minor2(const Kinem2 &k, Minor5::Ptr mptr5, int s, int t, int u, int is);
596
597 Kinem2 kinem;
598
599 const Minor5::Ptr pm5;
600 const int ps, pt, pu, offs;
601};
602
603
604/* ===============================================
605 *
606 * Utility functions
607 *
608 * ===============================================
609 */
610
611// Completely antysymmetric i,j,k size 6 matrix index
612inline
613int MinorBase::im3(int i, int j, int k)
614{
615 return idxtbl[(1<<i)|(1<<j)|(1<<k)];
616}
617
618// Completely antysymmetric i,j size 6 matrix index
619inline
620int MinorBase::im2(int i, int j)
621{
622 return idxtbl[(1<<i)|(1<<j)];
623}
624
625// Signature[{i,j,k}]*Signature[{l,m,n}]
626inline
627int MinorBase::signM3ud(int i, int j, int k, int l, int m, int n)
628{
629 int t=(j-i)*(k-j)*(k-i)*(m-l)*(n-m)*(n-l);
630 return t==0 ? 0 : 2*(t>>(sizeof(int)*8-1))+1;
631}
632
633// Signature[{i,j}]*Signature[{l,m}]
634inline
635int MinorBase::signM2ud(int i, int j, int l, int m)
636{
637 int t=(j-i)*(m-l);
638 return t==0 ? 0 : 2*(t>>(sizeof(int)*8-1))+1;
639}
640
641#endif /* QUL_MINOR_H */
const Int_t n
XmlRpcServer s
Definition: HelloServer.cpp:11
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
Definition: RRes.h:29
Definition: kinem.h:105
Definition: kinem.h:123
Definition: kinem.h:147
Definition: kinem.h:180
Definition: minor.h:573
SPtr< Minor2 > Ptr
Definition: minor.h:576
static Ptr create(const Kinem2 &k, Minor5::Ptr mptr5, int s, int t, int u, int is)
Definition: minor.h:577
ncomplex evalB(int ep)
Definition: minor.h:539
SPtr< Minor3 > Ptr
Definition: minor.h:542
static Ptr create(const Kinem3 &k, Minor5::Ptr mptr5, int s, int t, int is)
Definition: minor.h:543
ncomplex evalC(int ep)
Definition: minor.h:502
SPtr< Minor4 > Ptr
Definition: minor.h:505
static Ptr create(const Kinem4 &k, Minor5::Ptr mptr5, int s, int is)
Definition: minor.h:506
ncomplex evalD(int ep)
Definition: minor.h:215
ncomplex I2stu(int ep, int s, int t, int u)
Definition: minor.cpp:898
double M2(int i, int j, int l, int m) PURE
Definition: minor.cpp:471
ncomplex I2D2stui(int ep, int s, int t, int u, int i)
Definition: minor.cpp:2776
ncomplex I4D3sijk(int ep, int s, int i, int j, int k)
Definition: minor.cpp:2180
ncomplex I4D3s(int ep, int s)
Definition: minor.cpp:1712
ncomplex I3st(int ep, int s, int t)
Definition: minor.cpp:849
ncomplex I2D6stu(int ep, int s, int t, int u)
Definition: minorex.cpp:547
ncomplex I2D3stu(int ep, int s, int t, int u)
Definition: minorex.cpp:142
ncomplex I4D2si(int ep, int s, int i)
Definition: minor.cpp:1302
ncomplex I3D3stijk(int ep, int s, int t, int i, int j, int k)
Definition: minor.cpp:3166
ncomplex I4D3sij(int ep, int s, int i, int j)
Definition: minor.cpp:1952
ncomplex I3Dsti(int ep, int s, int t, int i)
Definition: minor.cpp:1357
ncomplex I3D3sti(int ep, int s, int t, int i)
Definition: minor.cpp:2618
SPtr< Minor5 > Ptr
Definition: minor.h:218
static Ptr create(const Kinem5 &k)
Definition: minor.h:219
ncomplex evalE(int ep)
Definition: minoreval.cpp:24
ncomplex I3D2sti(int ep, int s, int t, int i)
Definition: minor.cpp:1810
ncomplex I3D2stij(int ep, int s, int t, int i, int j)
Definition: minor.cpp:2090
ncomplex I4D4sijk(int ep, int s, int i, int j, int k)
Definition: minor.cpp:3003
ncomplex I4s(int ep, int s)
Definition: minor.cpp:809
double M1(int i, int l) PURE
Definition: minor.cpp:462
double gram3(double p1, double p2, double p3) PURE
Definition: minor.cpp:546
ncomplex I3D6st(int ep, int s, int t)
Definition: minorex.cpp:500
ncomplex I4D3si(int ep, int s, int i)
Definition: minor.cpp:1907
ncomplex I3D3st(int ep, int s, int t)
Definition: minor.cpp:2323
ncomplex I4D2sij(int ep, int s, int i, int j)
Definition: minor.cpp:1460
ncomplex I4D4sij(int ep, int s, int i, int j)
Definition: minor.cpp:2726
ncomplex I2D5stu(int ep, int s, int t, int u)
Definition: minorex.cpp:412
ncomplex I2D2stuij(int ep, int s, int t, int u, int i, int j)
Definition: minor.cpp:3056
ncomplex I4D4si(int ep, int s, int i)
Definition: minor.cpp:2559
ncomplex I4Ds(int ep, int s)
Definition: minor.cpp:956
ncomplex I2D2stu(int ep, int s, int t, int u)
Definition: minor.cpp:2242
ncomplex I2Dstui(int ep, int s, int t, int u, int i)
Definition: minor.cpp:2001
ncomplex I4D4s(int ep, int s)
Definition: minor.cpp:2452
ncomplex I3D7st(int ep, int s, int t)
Definition: minorex.cpp:636
ncomplex I4D4sijkl(int ep, int s, int i, int j, int k, int l)
Definition: minor.cpp:3275
ncomplex I4Dsi(int ep, int s, int i)
Definition: minor.cpp:1046
ncomplex I2D4stu(int ep, int s, int t, int u)
Definition: minorex.cpp:275
ncomplex I2Dstu(int ep, int s, int t, int u)
Definition: minor.cpp:1514
static Ptr create(const Kinem4 &k)
Definition: minor.h:220
ncomplex I3D5st(int ep, int s, int t)
Definition: minorex.cpp:365
double M3(int i, int j, int k, int l, int m, int n) PURE
Definition: minor.cpp:486
ncomplex I3D4st(int ep, int s, int t)
Definition: minorex.cpp:227
ncomplex I3D2st(int ep, int s, int t)
Definition: minor.cpp:1593
ncomplex I3D3stij(int ep, int s, int t, int i, int j)
Definition: minor.cpp:2861
ncomplex I4D2s(int ep, int s)
Definition: minor.cpp:1208
ncomplex I3Dst(int ep, int s, int t)
Definition: minor.cpp:1096
static const double epsir1
Definition: minor.h:185
static int iss(int i, int j) CONST
Definition: minor.h:124
static void Rescale(double factor)
Definition: minor.cpp:35
static const double seps1
Definition: minor.h:182
static const unsigned char idxtbl[64]
Definition: minor.h:171
static double getmeps()
Definition: minor.h:148
static int is(int i, int j, int k, int l) CONST
Definition: minor.h:100
static void freeidxM3(int set[], int free[])
Definition: minor.cpp:109
static int is(int i, int j, int k) CONST
Definition: minor.h:90
static double deps
Definition: minor.h:188
static int ns(int i, int j) CONST
Definition: minor.h:74
static const double heps
Definition: minor.h:174
MinorBase()
Definition: minor.h:54
static int iss(int i, int j, int k, int l) CONST
Definition: minor.h:136
static int signM3ud(int i, int j, int k, int l, int m, int n) CONST
Definition: minor.h:627
static int iss(int i, int j, int k) CONST
Definition: minor.h:130
static int nss(int i, int j) CONST
Definition: minor.h:79
static const double deps2
Definition: minor.h:179
static const double ceps
Definition: minor.h:176
static int im2(int i, int j) CONST
Definition: minor.h:620
static const double epsir2
Definition: minor.h:186
static const double teps
Definition: minor.h:173
static const double seps2
Definition: minor.h:183
static int is(int i, int j) CONST
Definition: minor.h:85
static int iss(int i, int j, int k, int l, int m) CONST
Definition: minor.h:142
static int signM2ud(int i, int j, int l, int m) CONST
Definition: minor.h:635
static const double deps3
Definition: minor.h:180
static double m3eps
Definition: minor.h:190
static double meps
Definition: minor.h:189
static const double deps1
Definition: minor.h:178
static int im3(int i, int j, int k) CONST
Definition: minor.h:613
Definition: minor.h:195
static const int DCay
Definition: minor.h:210
Minor()
Definition: minor.h:197
double Cay[(DCay-1) *(DCay)/2]
Definition: minor.h:211
double Kay(int i, int j) PURE
Definition: minor.h:199
Definition: pointer.h:25
#define CONST
Definition: common.h:41
#define PURE
Definition: common.h:42
std::complex< double > ncomplex
Definition: common.h:25
#define CIDX
Definition: minor.h:45
#define ix(i)
Definition: minoreval.cpp:387
int t()
Definition: t.c:1
#define ns(x)
Definition: xmltok.c:1504