File indexing completed on 2026-06-02 08:17:14
0001
0002
0003
0004
0005
0006
0007 #include "apfel/apfelxx.h"
0008
0009 #include <algorithm>
0010
0011 namespace apfel
0012 {
0013
0014
0015
0016
0017 struct SidisObjects
0018 {
0019 DoubleObject<Operator> C20qq;
0020 DoubleObject<Operator> C21qq;
0021 DoubleObject<Operator> C21gq;
0022 DoubleObject<Operator> C21qg;
0023 DoubleObject<Operator> CL1qq;
0024 DoubleObject<Operator> CL1gq;
0025 DoubleObject<Operator> CL1qg;
0026 std::map<int, DoubleObject<Operator>> C22qq;
0027 };
0028
0029
0030 class one: public Expression
0031 {
0032 public:
0033 one(): Expression() {}
0034 double Regular(double const&) const { return 1; }
0035 };
0036
0037 class delta: public Expression
0038 {
0039 public:
0040 delta(): Expression() {}
0041 double Local(double const&) const { return 1; }
0042 };
0043
0044 class DDn: public Expression
0045 {
0046 public:
0047 DDn(int const& n): Expression(), _n(n) {}
0048 double Singular(double const& x) const { return pow(log( 1 - x ), _n) / ( 1 - x ); }
0049 double Local(double const& x) const { return pow(log( 1 - x ), _n + 1) / ( _n + 1 ); }
0050 private:
0051 int const _n;
0052 };
0053
0054 class ln: public Expression
0055 {
0056 public:
0057 ln(int const& n): Expression(), _n(n) {}
0058 double Regular(double const& x) const { return pow(log( 1 - x ), _n); }
0059 private:
0060 int const _n;
0061 };
0062
0063
0064
0065 class lrqq: public Expression
0066 {
0067 public:
0068 lrqq(): Expression() {}
0069 double Regular(double const& x) const
0070 {
0071 const double expr = ( 1 + x * x ) * log(x) / ( 1 - x ) + 1 - x - ( 1 + x ) * log( 1 - x );
0072 return 2 * CF * expr;
0073 }
0074 };
0075
0076 class srqq: public Expression
0077 {
0078 public:
0079 srqq(): Expression() {}
0080 double Regular(double const& x) const { return - 2 * CF * ( 1 + x ); }
0081 };
0082
0083 class rlqq: public Expression
0084 {
0085 public:
0086 rlqq(): Expression() {}
0087 double Regular(double const& x) const
0088 {
0089 const double expr = - ( 1 + x * x ) * log(x) / ( 1 - x ) + 1 - x - ( 1 + x ) * log( 1 - x );
0090 return 2 * CF * expr;
0091 }
0092 };
0093
0094 class rsqq: public Expression
0095 {
0096 public:
0097 rsqq(): Expression() {}
0098 double Regular(double const& x) const { return - 2 * CF * ( 1 + x ); }
0099 };
0100
0101 class r11qq: public Expression
0102 {
0103 public:
0104 r11qq(): Expression() {}
0105 double Regular(double const&) const { return 1; }
0106 };
0107
0108 class r12qq: public Expression
0109 {
0110 public:
0111 r12qq(): Expression() {}
0112 double Regular(double const&) const { return 1; }
0113 };
0114
0115 class r21qq: public Expression
0116 {
0117 public:
0118 r21qq(): Expression() {}
0119 double Regular(double const& x) const { return x; }
0120 };
0121
0122 class r22qq: public Expression
0123 {
0124 public:
0125 r22qq(): Expression() {}
0126 double Regular(double const& x) const { return x; }
0127 };
0128
0129 class lrgq: public Expression
0130 {
0131 public:
0132 lrgq(): Expression() {}
0133 double Regular(double const& x) const
0134 {
0135 const double omx = ( 1 - x );
0136 const double expr = ( 1 + omx * omx ) * log( x * omx ) / x + x;
0137 return 2 * CF * expr;
0138 }
0139 };
0140
0141 class srgq: public Expression
0142 {
0143 public:
0144 srgq(): Expression() {}
0145 double Regular(double const& x) const
0146 {
0147 const double omx = ( 1 - x );
0148 const double expr = ( 1 + omx * omx ) / x;
0149 return 2 * CF * expr;
0150 }
0151 };
0152
0153 class r11gq: public Expression
0154 {
0155 public:
0156 r11gq(): Expression() {}
0157 double Regular(double const& x) const { return 1 + 3 * x; }
0158 };
0159
0160 class r12gq: public Expression
0161 {
0162 public:
0163 r12gq(): Expression() {}
0164 double Regular(double const&) const { return 1; }
0165 };
0166
0167 class r21gq: public Expression
0168 {
0169 public:
0170 r21gq(): Expression() {}
0171 double Regular(double const& x) const { return x; }
0172 };
0173
0174 class r22gq: public Expression
0175 {
0176 public:
0177 r22gq(): Expression() {}
0178 double Regular(double const& x) const { return x; }
0179 };
0180
0181 class r31gq: public Expression
0182 {
0183 public:
0184 r31gq(): Expression() {}
0185 double Regular(double const& x) const { return 1 + x; }
0186 };
0187
0188 class r32gq: public Expression
0189 {
0190 public:
0191 r32gq(): Expression() {}
0192 double Regular(double const& x) const { return 1 / x; }
0193 };
0194
0195 class rlqg: public Expression
0196 {
0197 public:
0198 rlqg(): Expression() {}
0199 double Regular(double const& x) const
0200 {
0201 const double omx = ( 1 - x );
0202 const double expr = ( x * x + omx * omx ) * log( omx / x ) + 2 * x * omx;
0203 return expr;
0204 }
0205 };
0206
0207 class rsqg: public Expression
0208 {
0209 public:
0210 rsqg(): Expression() {}
0211 double Regular(double const& x) const
0212 {
0213 const double omx = ( 1 - x );
0214 const double expr = ( x * x + omx * omx );
0215 return expr;
0216 }
0217 };
0218
0219 class r11qg: public Expression
0220 {
0221 public:
0222 r11qg(): Expression() {}
0223 double Regular(double const& x) const { return - 1 + 6 * x - 6 * x * x; }
0224 };
0225
0226 class r12qg: public Expression
0227 {
0228 public:
0229 r12qg(): Expression() {}
0230 double Regular(double const&) const { return 1; }
0231 };
0232
0233 class r21qg: public Expression
0234 {
0235 public:
0236 r21qg(): Expression() {}
0237 double Regular(double const& x) const { return x * x + ( 1 - x ) * ( 1 - x ); }
0238 };
0239
0240 class r22qg: public Expression
0241 {
0242 public:
0243 r22qg(): Expression() {}
0244 double Regular(double const& x) const { return 1 / x; }
0245 };
0246
0247
0248 class r11Lqq: public Expression
0249 {
0250 public:
0251 r11Lqq(): Expression() {}
0252 double Regular(double const& x) const { return x; }
0253 };
0254
0255 class r12Lqq: public Expression
0256 {
0257 public:
0258 r12Lqq(): Expression() {}
0259 double Regular(double const& x) const { return x; }
0260 };
0261
0262 class r11Lgq: public Expression
0263 {
0264 public:
0265 r11Lgq(): Expression() {}
0266 double Regular(double const& x) const { return x; }
0267 };
0268
0269 class r12Lgq: public Expression
0270 {
0271 public:
0272 r12Lgq(): Expression() {}
0273 double Regular(double const& x) const { return 1 - x; }
0274 };
0275
0276 class r11Lqg: public Expression
0277 {
0278 public:
0279 r11Lqg(): Expression() {}
0280 double Regular(double const& x) const { return x * ( 1 - x ); }
0281 };
0282
0283 class r12Lqg: public Expression
0284 {
0285 public:
0286 r12Lqg(): Expression() {}
0287 double Regular(double const&) const { return 1; }
0288 };
0289
0290
0291
0292 SidisObjects InitializeSIDIS(Grid const& gx, Grid const& gz, std::vector<double> const& Thresholds, std::vector<int> exclude = {})
0293 {
0294 report("Initializing SIDIS hard cross sections... ");
0295 Timer t;
0296
0297
0298
0299
0300 int nfi = 0;
0301 int nff = Thresholds.size();
0302 for (auto const& v : Thresholds)
0303 if (v <= 0)
0304 nfi++;
0305
0306
0307 SidisObjects SidisObj;
0308
0309
0310
0311
0312
0313
0314 const Operator odeltax{gx, delta{}};
0315 const Operator odeltaz{gz, delta{}};
0316
0317 if (std::find(exclude.begin(), exclude.end(), 0) == exclude.end()) SidisObj.C20qq.AddTerm({1, odeltax, odeltaz});
0318
0319
0320
0321 const Operator oD0x{gx, DDn{0}};
0322 const Operator oD1x{gx, DDn{1}};
0323 const Operator oD0z{gz, DDn{0}};
0324 const Operator oD1z{gz, DDn{1}};
0325
0326 const double LLqq = - 16 * CF;
0327 const double LSqq = 4 * CF;
0328 const double SLqq = 4 * CF;
0329 const double SSqq = 4 * CF;
0330 const double K1qq = 4 * CF;
0331 const double K2qq = 12 * CF;
0332
0333 const Operator orlqqx{gx, rlqq{}};
0334 const Operator orsqqx{gx, rsqq{}};
0335 const Operator or11qqx{gx, r11qq{}};
0336 const Operator or21qqx{gx, r21qq{}};
0337 const Operator olrqqz{gz, lrqq{}};
0338 const Operator osrqqz{gz, srqq{}};
0339 const Operator or12qqz{gz, r12qq{}};
0340 const Operator or22qqz{gz, r22qq{}};
0341
0342 if (std::find(exclude.begin(), exclude.end(), 1) == exclude.end()) SidisObj.C21qq.AddTerm({LLqq, odeltax, odeltaz});
0343 if (std::find(exclude.begin(), exclude.end(), 2) == exclude.end()) SidisObj.C21qq.AddTerm({LSqq, odeltax, oD1z });
0344 if (std::find(exclude.begin(), exclude.end(), 3) == exclude.end()) SidisObj.C21qq.AddTerm({1, odeltax, olrqqz });
0345 if (std::find(exclude.begin(), exclude.end(), 4) == exclude.end()) SidisObj.C21qq.AddTerm({SLqq, oD1x, odeltaz});
0346 if (std::find(exclude.begin(), exclude.end(), 5) == exclude.end()) SidisObj.C21qq.AddTerm({SSqq, oD0x, oD0z });
0347 if (std::find(exclude.begin(), exclude.end(), 6) == exclude.end()) SidisObj.C21qq.AddTerm({1, oD0x, osrqqz });
0348 if (std::find(exclude.begin(), exclude.end(), 7) == exclude.end()) SidisObj.C21qq.AddTerm({1, orlqqx, odeltaz});
0349 if (std::find(exclude.begin(), exclude.end(), 8) == exclude.end()) SidisObj.C21qq.AddTerm({1, orsqqx, oD0z });
0350 if (std::find(exclude.begin(), exclude.end(), 9) == exclude.end()) SidisObj.C21qq.AddTerm({K1qq, or11qqx, or12qqz});
0351 if (std::find(exclude.begin(), exclude.end(), 10) == exclude.end()) SidisObj.C21qq.AddTerm({K2qq, or21qqx, or22qqz});
0352
0353 const double K1gq = 4 * CF;
0354 const double K2gq = - 12 * CF;
0355 const double K3gq = - 2 * CF;
0356
0357 const Operator olrgqz{gz, lrgq{}};
0358 const Operator osrgqz{gz, srgq{}};
0359 const Operator or11gqx{gx, r11gq{}};
0360 const Operator or12gqz{gz, r12gq{}};
0361 const Operator or21gqx{gx, r21gq{}};
0362 const Operator or22gqz{gz, r22gq{}};
0363 const Operator or31gqx{gx, r31gq{}};
0364 const Operator or32gqz{gz, r32gq{}};
0365
0366 if (std::find(exclude.begin(), exclude.end(), 11) == exclude.end()) SidisObj.C21gq.AddTerm({1, odeltax, olrgqz });
0367 if (std::find(exclude.begin(), exclude.end(), 12) == exclude.end()) SidisObj.C21gq.AddTerm({1, oD0x, osrgqz });
0368 if (std::find(exclude.begin(), exclude.end(), 13) == exclude.end()) SidisObj.C21gq.AddTerm({K1gq, or11gqx, or12gqz});
0369 if (std::find(exclude.begin(), exclude.end(), 14) == exclude.end()) SidisObj.C21gq.AddTerm({K2gq, or21gqx, or22gqz});
0370 if (std::find(exclude.begin(), exclude.end(), 15) == exclude.end()) SidisObj.C21gq.AddTerm({K3gq, or31gqx, or32gqz});
0371
0372 const double K1qg = 2;
0373 const double K2qg = 1;
0374
0375 const Operator orlqgx{gx, rlqg{}};
0376 const Operator orsqgx{gx, rsqg{}};
0377 const Operator or11qgx{gx, r11qg{}};
0378 const Operator or12qgz{gz, r12qg{}};
0379 const Operator or21qgx{gx, r21qg{}};
0380 const Operator or22qgz{gz, r22qg{}};
0381
0382 if (std::find(exclude.begin(), exclude.end(), 16) == exclude.end()) SidisObj.C21qg.AddTerm({1, orlqgx, odeltaz});
0383 if (std::find(exclude.begin(), exclude.end(), 17) == exclude.end()) SidisObj.C21qg.AddTerm({1, orsqgx, oD0z });
0384 if (std::find(exclude.begin(), exclude.end(), 18) == exclude.end()) SidisObj.C21qg.AddTerm({K1qg, or11qgx, or12qgz});
0385 if (std::find(exclude.begin(), exclude.end(), 19) == exclude.end()) SidisObj.C21qg.AddTerm({K2qg, or21qgx, or22qgz});
0386
0387
0388 const double K1Lqq = 8 * CF;
0389
0390 const Operator or11Lqqx{gx, r11Lqq{}};
0391 const Operator or12Lqqz{gz, r12Lqq{}};
0392
0393 if (std::find(exclude.begin(), exclude.end(), 20) == exclude.end()) SidisObj.CL1qq.AddTerm({K1Lqq, or11Lqqx, or12Lqqz});
0394
0395 const double K1Lgq = 8 * CF;
0396
0397 const Operator or11Lgqx{gx, r11Lgq{}};
0398 const Operator or12Lgqz{gz, r12Lgq{}};
0399
0400 if (std::find(exclude.begin(), exclude.end(), 21) == exclude.end()) SidisObj.CL1gq.AddTerm({K1Lgq, or11Lgqx, or12Lgqz});
0401
0402 const double K1Lqg = 8;
0403
0404 const Operator or11Lqgx{gx, r11Lqg{}};
0405 const Operator or12Lqgz{gz, r12Lqg{}};
0406
0407 if (std::find(exclude.begin(), exclude.end(), 22) == exclude.end()) SidisObj.CL1qg.AddTerm({K1Lqg, or11Lqgx, or12Lqgz});
0408
0409
0410
0411
0412
0413
0414
0415 const Operator oD2x{gx, DDn{2}};
0416 const Operator oD3x{gx, DDn{3}};
0417 const Operator oD2z{gz, DDn{2}};
0418 const Operator oD3z{gz, DDn{3}};
0419
0420
0421 const Operator ol1x{gx, ln{1}};
0422 const Operator ol2x{gx, ln{2}};
0423 const Operator ol3x{gx, ln{3}};
0424 const Operator ol1z{gz, ln{1}};
0425 const Operator ol2z{gz, ln{2}};
0426 const Operator ol3z{gz, ln{3}};
0427
0428
0429 const Operator oonex{gx, one{}};
0430 const Operator oonez{gz, one{}};
0431
0432
0433
0434 const double ovc = 16. * CF;
0435
0436
0437 for (int nf = nfi; nf <= nff; nf++)
0438 {
0439 DoubleObject<Operator> cnf{};
0440
0441
0442 const double c1 = ovc * CF / 2.;
0443 if (std::find(exclude.begin(), exclude.end(), 23) == exclude.end()) cnf.AddTerm({c1, odeltax, oD3z});
0444 if (std::find(exclude.begin(), exclude.end(), 24) == exclude.end()) cnf.AddTerm({c1, oD3x, odeltaz});
0445
0446 const double c2 = ovc * CF * 3. / 2.;
0447 if (std::find(exclude.begin(), exclude.end(), 25) == exclude.end()) cnf.AddTerm({c2, oD0x, oD2z});
0448 if (std::find(exclude.begin(), exclude.end(), 26) == exclude.end()) cnf.AddTerm({c2, oD2x, oD0z});
0449 if (std::find(exclude.begin(), exclude.end(), 27) == exclude.end()) cnf.AddTerm({2 * c2, oD1x, oD1z});
0450
0451 const double c3 = - ovc * CF * ( 4. + Pi2 / 3. );
0452 if (std::find(exclude.begin(), exclude.end(), 28) == exclude.end()) cnf.AddTerm({c3, oD0x, oD0z});
0453 if (std::find(exclude.begin(), exclude.end(), 29) == exclude.end()) cnf.AddTerm({c3, odeltax, oD1z});
0454 if (std::find(exclude.begin(), exclude.end(), 30) == exclude.end()) cnf.AddTerm({c3, oD1x, odeltaz});
0455
0456 const double c4 = ovc * CF * 2. * zeta3;
0457 if (std::find(exclude.begin(), exclude.end(), 31) == exclude.end()) cnf.AddTerm({c4, odeltax, oD0z});
0458 if (std::find(exclude.begin(), exclude.end(), 32) == exclude.end()) cnf.AddTerm({c4, oD0x, odeltaz});
0459
0460 const double c5 = ovc * CF * ( 511. / 64. - 15. * zeta3 / 4. + 29. * Pi2 / 48. - 7. * Pi2 * Pi2 / 360. );
0461 if (std::find(exclude.begin(), exclude.end(), 33) == exclude.end()) cnf.AddTerm({c5, odeltax, odeltaz});
0462
0463
0464 const double c6 = - ovc * CF * 3. / 2.;
0465 if (std::find(exclude.begin(), exclude.end(), 34) == exclude.end()) cnf.AddTerm({c6, oD2x, oonez});
0466 if (std::find(exclude.begin(), exclude.end(), 35) == exclude.end()) cnf.AddTerm({c6, oonex, oD2z});
0467 if (std::find(exclude.begin(), exclude.end(), 36) == exclude.end()) cnf.AddTerm({2 * c6, oD1x, ol1z});
0468 if (std::find(exclude.begin(), exclude.end(), 37) == exclude.end()) cnf.AddTerm({2 * c6, ol1x, oD1z});
0469 if (std::find(exclude.begin(), exclude.end(), 38) == exclude.end()) cnf.AddTerm({c6, oD0x, ol2z});
0470 if (std::find(exclude.begin(), exclude.end(), 39) == exclude.end()) cnf.AddTerm({c6, ol2x, oD0z});
0471
0472 const double c7 = - ovc * CF / 2.;
0473 if (std::find(exclude.begin(), exclude.end(), 40) == exclude.end()) cnf.AddTerm({c7, odeltax, ol3z});
0474 if (std::find(exclude.begin(), exclude.end(), 41) == exclude.end()) cnf.AddTerm({c7, ol3x, odeltaz});
0475
0476
0477 const double c8 = - ovc * CA * 11. / 24.;
0478 if (std::find(exclude.begin(), exclude.end(), 42) == exclude.end()) cnf.AddTerm({c8, odeltax, oD2z});
0479 if (std::find(exclude.begin(), exclude.end(), 43) == exclude.end()) cnf.AddTerm({c8, oD2x, odeltaz});
0480 if (std::find(exclude.begin(), exclude.end(), 44) == exclude.end()) cnf.AddTerm({2 * c8, oD0x, oD1z});
0481 if (std::find(exclude.begin(), exclude.end(), 45) == exclude.end()) cnf.AddTerm({2 * c8, oD1x, oD0z});
0482
0483 const double c9 = ovc * CA * ( 67. / 36. - Pi2 / 12. );
0484 if (std::find(exclude.begin(), exclude.end(), 46) == exclude.end()) cnf.AddTerm({c9, oD0x, oD0z});
0485 if (std::find(exclude.begin(), exclude.end(), 47) == exclude.end()) cnf.AddTerm({c9, odeltax, oD1z});
0486 if (std::find(exclude.begin(), exclude.end(), 48) == exclude.end()) cnf.AddTerm({c9, oD1x, odeltaz});
0487
0488 const double c10 = ovc * CA * ( 7. * zeta3 / 4. + 11. * Pi2 / 72. - 101. / 54. );
0489 if (std::find(exclude.begin(), exclude.end(), 49) == exclude.end()) cnf.AddTerm({c10, odeltax, oD0z});
0490 if (std::find(exclude.begin(), exclude.end(), 50) == exclude.end()) cnf.AddTerm({c10, oD0x, odeltaz});
0491
0492 const double c11 = ovc * CA * ( 43. * zeta3 / 12. + 17. * Pi2 * Pi2 / 720. - 1535. / 192. - 269. * Pi2 / 432. );
0493 if (std::find(exclude.begin(), exclude.end(), 51) == exclude.end()) cnf.AddTerm({c11, odeltax, odeltaz});
0494
0495
0496 const double c12 = ovc * nf / 12.;
0497 if (std::find(exclude.begin(), exclude.end(), 52) == exclude.end()) cnf.AddTerm({c12, odeltax, oD2z});
0498 if (std::find(exclude.begin(), exclude.end(), 53) == exclude.end()) cnf.AddTerm({c12, oD2x, odeltaz});
0499 if (std::find(exclude.begin(), exclude.end(), 54) == exclude.end()) cnf.AddTerm({2 * c12, oD0x, oD1z});
0500 if (std::find(exclude.begin(), exclude.end(), 55) == exclude.end()) cnf.AddTerm({2 * c12, oD1x, oD0z});
0501
0502 const double c13 = - ovc * nf * 5. / 18.;
0503 if (std::find(exclude.begin(), exclude.end(), 56) == exclude.end()) cnf.AddTerm({c13, oD0x, oD0z});
0504 if (std::find(exclude.begin(), exclude.end(), 57) == exclude.end()) cnf.AddTerm({c13, odeltax, oD1z});
0505 if (std::find(exclude.begin(), exclude.end(), 58) == exclude.end()) cnf.AddTerm({c13, oD1x, odeltaz});
0506
0507 const double c14 = ovc * nf * ( 7. / 27. - Pi2 / 36. );
0508 if (std::find(exclude.begin(), exclude.end(), 59) == exclude.end()) cnf.AddTerm({c14, odeltax, oD0z});
0509 if (std::find(exclude.begin(), exclude.end(), 60) == exclude.end()) cnf.AddTerm({c14, oD0x, odeltaz});
0510
0511 const double c15 = ovc * nf * ( zeta3 / 6. + 19. * Pi2 / 216. + 127. / 96. );
0512 if (std::find(exclude.begin(), exclude.end(), 61) == exclude.end()) cnf.AddTerm({c15, odeltax, odeltaz});
0513
0514 SidisObj.C22qq.insert({nf, cnf});
0515 }
0516 t.stop();
0517
0518 return SidisObj;
0519 }
0520
0521
0522
0523 SidisObjects InitializeSIDIS(Grid const& gx, std::vector<double> const& Thresholds, std::vector<int> exclude = {})
0524 {
0525 return InitializeSIDIS(gx, gx, Thresholds, exclude);
0526 }
0527 }