File indexing completed on 2025-01-18 10:06:35
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Pythia8_VinciaISR_H
0010 #define Pythia8_VinciaISR_H
0011
0012 #include "Pythia8/SpaceShower.h"
0013 #include "Pythia8/VinciaAntennaFunctions.h"
0014 #include "Pythia8/VinciaCommon.h"
0015 #include "Pythia8/VinciaDiagnostics.h"
0016 #include "Pythia8/VinciaQED.h"
0017 #include "Pythia8/VinciaEW.h"
0018 #include "Pythia8/VinciaWeights.h"
0019
0020 namespace Pythia8 {
0021
0022
0023 class VinciaFSR;
0024
0025
0026
0027
0028
0029
0030 class TrialGeneratorISR {
0031
0032 public:
0033
0034
0035 TrialGeneratorISR() : isInit(false) {;}
0036 virtual ~TrialGeneratorISR() {;}
0037
0038
0039 void initPtr(Info* infoPtrIn);
0040
0041
0042 virtual string name() {return "TrialGeneratorISR";}
0043
0044
0045 virtual void init(double mcIn, double mbIn);
0046
0047
0048
0049
0050
0051 virtual double aTrial(double saj, double sjb, double sAB);
0052
0053
0054 virtual double getQ2(double saj, double sjb, double sAB) {
0055 return (saj*sjb/(saj + sjb + sAB));}
0056 virtual double getQ2max(double sAB, double, double) {
0057 return (0.25*pow2(shhSav - sAB)/shhSav);}
0058
0059
0060 virtual double genQ2run(double q2old, double sAB, double zMin, double zMax,
0061 double colFac, double PDFratio, double b0, double kR, double Lambda,
0062 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0);
0063
0064
0065 virtual double genQ2(double q2old, double sAB, double zMin, double zMax,
0066 double colFac, double alphaSvalue, double PDFratio, double eA, double eB,
0067 double headroomFac = 1.0, double enhanceFac = 1.0);
0068
0069
0070
0071 virtual double genQ2thres(double q2old, double sAB, double zMin,
0072 double zMax, double colFac, double alphaSvalue, double PDFratio, int idA,
0073 int idB, double eA, double eB, bool useMpdf, double headroomFac = 1.0,
0074 double enhanceFac = 1.0);
0075
0076
0077 virtual double genZ(double zMin, double zMax);
0078
0079
0080 virtual double getIz(double zMin, double zMax);
0081
0082
0083 virtual double getZmin(double Qt2, double sAB, double eA, double eBeamUsed);
0084 virtual double getZmax(double Qt2, double sAB, double eA, double eBeamUsed);
0085
0086
0087 virtual double getS1j(double Qt2, double zeta, double sAB);
0088 virtual double getSj2(double Qt2, double zeta, double sAB);
0089
0090
0091 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0092 int iSys, int idA, int idB, double eA, double eB,
0093 double Qt2A, double Qt2B);
0094
0095
0096 virtual double getTrialPDFratio() {return trialPDFratioSav;}
0097
0098
0099 bool checkInit();
0100
0101
0102 int trialFlav() {return trialFlavSav;}
0103
0104 protected:
0105
0106
0107 Info* infoPtr{};
0108 Rndm* rndmPtr{};
0109 Settings* settingsPtr{};
0110 Logger* loggerPtr{};
0111
0112
0113 bool useMevolSav;
0114
0115
0116 double shhSav;
0117
0118
0119 int trialFlavSav;
0120 int nGtoQISRSav;
0121
0122
0123 double mbSav;
0124 double mcSav;
0125
0126
0127 bool sectorShower;
0128
0129
0130 double trialPDFratioSav;
0131 double TINYPDFtrial;
0132
0133 private:
0134
0135
0136 bool isInit;
0137
0138
0139 int verbose;
0140
0141 };
0142
0143
0144
0145
0146
0147
0148 class TrialIISoft : public TrialGeneratorISR {
0149
0150 public:
0151
0152
0153 virtual string name() override {return "TrialIISoft";}
0154
0155 };
0156
0157
0158
0159
0160
0161 class TrialIIGCollA : public TrialGeneratorISR {
0162
0163 public:
0164
0165
0166 virtual string name() override {return "TrialIIGCollA";}
0167
0168
0169
0170 virtual double aTrial(double saj, double sjb, double sAB) override;
0171
0172
0173 virtual double getQ2(double saj, double sjb, double sAB) override {
0174 return (saj*sjb/(saj + sjb + sAB));}
0175 virtual double getQ2max(double sAB, double, double) override {
0176 return (0.25*pow2(shhSav - sAB)/shhSav);}
0177
0178
0179 virtual double genQ2run(double q2old, double sAB, double zMin, double zMax,
0180 double colFac, double PDFratio, double b0, double kR, double Lambda,
0181 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0182 override;
0183
0184
0185 virtual double genQ2(double q2old, double sAB, double zMin, double zMax,
0186 double colFac, double alphaSvalue, double PDFratio,
0187 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0188 override;
0189
0190
0191 virtual double genZ(double zMin, double zMax) override;
0192
0193
0194 virtual double getIz(double zMin, double zMax) override;
0195
0196
0197 virtual double getZmin(double Qt2, double sAB, double eA, double eBeamUsed)
0198 override;
0199 virtual double getZmax(double Qt2, double sAB, double eA, double eBeamUsed)
0200 override;
0201
0202
0203 virtual double getS1j(double Qt2, double zeta, double sAB) override;
0204 virtual double getSj2(double Qt2, double zeta, double sAB) override;
0205
0206 };
0207
0208
0209
0210
0211
0212 class TrialIIGCollB : public TrialIIGCollA {
0213
0214 public:
0215
0216
0217 virtual string name() override {return "TrialIIGCollB";}
0218
0219
0220 virtual double aTrial(double saj, double sjb, double sAB) override {
0221
0222 return TrialIIGCollA::aTrial(sjb, saj, sAB);}
0223
0224
0225 virtual double getS1j(double Qt2, double zeta, double sAB) override {
0226 return TrialIIGCollA::getSj2(Qt2, zeta, sAB);}
0227 virtual double getSj2(double Qt2, double zeta, double sAB) override {
0228 return TrialIIGCollA::getS1j(Qt2, zeta, sAB);}
0229
0230
0231 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0232 int iSys, int idA, int idB, double eA, double eB,
0233 double Qt2A, double Qt2B) override {
0234
0235 return TrialIIGCollA::trialPDFratio(
0236 beamBPtr, beamAPtr, iSys, idB, idA, eB, eA, Qt2B, Qt2A);}
0237
0238 };
0239
0240
0241
0242
0243
0244 class TrialIISplitA : public TrialGeneratorISR {
0245
0246 public:
0247
0248
0249 virtual string name() override {return "TrialIISplitA";}
0250
0251
0252
0253 virtual double aTrial(double saj, double sjb, double sAB) override;
0254
0255
0256 virtual double getQ2(double saj, double sjb, double sAB) override {
0257 return ((useMevolSav) ? saj : saj*sjb/(saj + sjb + sAB));}
0258 virtual double getQ2max(double sAB, double, double) override {
0259 return ((useMevolSav) ? shhSav-sAB : 0.25*pow2(shhSav-sAB)/shhSav);}
0260
0261
0262
0263 virtual double genQ2run(double q2old, double sAB, double zMin, double zMax,
0264 double colFac, double PDFratio, double b0, double kR, double Lambda,
0265 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0266 override;
0267
0268
0269 virtual double genQ2(double q2old, double sAB, double zMin, double zMax,
0270 double colFac, double alphaSvalue, double PDFratio,
0271 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0272 override;
0273
0274
0275
0276 virtual double genQ2thres(double q2old, double sAB,
0277 double zMin, double zMax, double colFac, double alphaSvalue,
0278 double PDFratio, int idA, int idB, double eA, double eB, bool useMpdf,
0279 double headroomFac = 1.0, double enhanceFac = 1.0) override;
0280
0281
0282
0283 virtual double genZ(double zMin, double zMax) override;
0284
0285
0286
0287 virtual double getIz(double zMin, double zMax) override;
0288
0289
0290 virtual double getZmin(double Qt2, double sAB, double eA, double eBeamUsed)
0291 override;
0292 virtual double getZmax(double Qt2, double sAB, double eA, double eBeamUsed)
0293 override;
0294
0295
0296 virtual double getS1j(double Qt2, double zeta, double sAB) override;
0297 virtual double getSj2(double Qt2, double zeta, double sAB) override;
0298
0299
0300 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0301 int iSys, int idA, int idB, double eA, double eB,
0302 double Qt2A, double Qt2B) override;
0303
0304 };
0305
0306
0307
0308
0309
0310 class TrialIISplitB : public TrialIISplitA {
0311
0312 public:
0313
0314
0315 virtual string name() override {return "TrialIISplitB";}
0316
0317
0318 virtual double aTrial(double saj, double sjb, double sAB) override {
0319
0320 return TrialIISplitA::aTrial(sjb, saj, sAB);}
0321
0322
0323 virtual double getQ2(double saj, double sjb, double sAB) override {
0324
0325 return TrialIISplitA::getQ2(sjb, saj, sAB);}
0326
0327
0328 virtual double genQ2run(double q2old, double sAB, double zMin, double zMax,
0329 double colFac, double PDFratio, double b0, double kR, double Lambda,
0330 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0331 override {return TrialIISplitA::genQ2run(q2old, sAB, zMin, zMax, colFac,
0332 PDFratio, b0, kR, Lambda, eB, eA, headroomFac, enhanceFac);}
0333
0334
0335 virtual double genQ2(double q2old, double sAB, double zMin, double zMax,
0336 double colFac, double alphaSvalue, double PDFratio,
0337 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0338 override {return TrialIISplitA::genQ2(q2old, sAB, zMin, zMax, colFac,
0339 alphaSvalue, PDFratio, eB, eA, headroomFac, enhanceFac);}
0340
0341
0342
0343 virtual double genQ2thres(double q2old, double sAB,
0344 double zMin, double zMax, double colFac, double alphaSvalue,
0345 double PDFratio, int idA, int idB, double eA, double eB, bool useMpdf,
0346 double headroomFac = 1.0, double enhanceFac = 1.0) override {
0347 return TrialIISplitA::genQ2thres(q2old, sAB, zMin, zMax, colFac,
0348 alphaSvalue, PDFratio, idB, idA, eB, eA, useMpdf, headroomFac,
0349 enhanceFac);}
0350
0351
0352 virtual double getS1j(double Qt2, double zeta, double sAB) override {
0353 return TrialIISplitA::getSj2(Qt2, zeta, sAB);}
0354 virtual double getSj2(double Qt2, double zeta, double sAB) override {
0355 return TrialIISplitA::getS1j(Qt2, zeta, sAB);}
0356
0357
0358 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0359 int iSys, int idA, int idB, double eA, double eB, double Qt2A, double Qt2B)
0360 override {
0361
0362 return TrialIISplitA::trialPDFratio(beamBPtr, beamAPtr, iSys,
0363 idB, idA, eB, eA, Qt2B, Qt2A);}
0364
0365 };
0366
0367
0368
0369
0370
0371 class TrialIIConvA : public TrialGeneratorISR {
0372
0373 public:
0374
0375
0376 virtual string name() override {return "TrialIIConvA";}
0377
0378
0379
0380 virtual double aTrial(double saj, double sjb, double sAB) override;
0381
0382
0383 virtual double getQ2(double saj, double sjb, double sAB) override {
0384 return ((useMevolSav) ? saj : (saj*sjb/(saj + sjb + sAB)));}
0385 virtual double getQ2max(double sAB, double, double) override {
0386 return ((useMevolSav) ? (shhSav - sAB) : 0.25*pow2(shhSav - sAB)/shhSav);}
0387
0388
0389 virtual double genQ2run(double q2old, double sAB, double zMin, double zMax,
0390 double colFac, double PDFratio, double b0, double kR, double Lambda,
0391 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0392 override;
0393
0394
0395
0396 virtual double genQ2(double q2old, double sAB, double zMin, double zMax,
0397 double colFac, double alphaSvalue, double PDFratio,
0398 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0399 override;
0400
0401
0402 virtual double genZ(double zMin, double zMax) override;
0403
0404
0405 virtual double getIz(double zMin, double zMax) override;
0406
0407
0408 virtual double getZmin(double Qt2, double sAB, double eA, double eBeamUsed)
0409 override;
0410 virtual double getZmax(double Qt2, double sAB, double eA, double eBeamUsed)
0411 override;
0412
0413
0414 virtual double getS1j(double Qt2, double zeta, double sAB) override;
0415 virtual double getSj2(double Qt2, double zeta, double sAB) override;
0416
0417
0418 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0419 int iSys, int idA, int idB, double eA, double eB,
0420 double Qt2A, double Qt2B) override;
0421
0422 };
0423
0424
0425
0426
0427
0428 class TrialIIConvB : public TrialIIConvA {
0429
0430 public:
0431
0432
0433 virtual string name() override {return "TrialIIConvB";}
0434
0435
0436 virtual double aTrial(double saj, double sjb, double sAB) override {
0437
0438 return TrialIIConvA::aTrial(sjb, saj, sAB);}
0439
0440
0441 virtual double getQ2(double saj, double sjb, double sAB) override {
0442
0443 return TrialIIConvA::getQ2(sjb, saj, sAB);}
0444
0445
0446 virtual double genQ2run(double q2old, double sAB, double zMin, double zMax,
0447 double colFac, double PDFratio, double b0, double kR, double Lambda,
0448 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0449 override {return TrialIIConvA::genQ2run(q2old, sAB, zMin, zMax, colFac,
0450 PDFratio, b0, kR, Lambda, eB, eA, headroomFac, enhanceFac);}
0451
0452
0453 virtual double genQ2(double q2old, double sAB, double zMin, double zMax,
0454 double colFac, double alphaSvalue, double PDFratio,
0455 double eA, double eB, double headroomFac = 1.0, double enhanceFac = 1.0)
0456 override {return TrialIIConvA::genQ2(q2old, sAB, zMin, zMax, colFac,
0457 alphaSvalue, PDFratio, eB, eA, headroomFac, enhanceFac);}
0458
0459
0460 virtual double getS1j(double Qt2, double zeta, double sAB) override {
0461 return TrialIIConvA::getSj2(Qt2, zeta, sAB);}
0462 virtual double getSj2(double Qt2, double zeta, double sAB) override {
0463 return TrialIIConvA::getS1j(Qt2, zeta, sAB);}
0464
0465
0466 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0467 int iSys, int idA, int idB, double eA, double eB,
0468 double Qt2A, double Qt2B) override {
0469
0470 return TrialIIConvA::trialPDFratio(
0471 beamBPtr, beamAPtr, iSys, idB, idA, eB, eA, Qt2B, Qt2A);}
0472
0473 };
0474
0475
0476
0477
0478
0479 class TrialIFSoft : public TrialGeneratorISR {
0480
0481 public:
0482
0483
0484 virtual string name() override {return "TrialIFSoft";}
0485
0486
0487
0488 virtual double aTrial(double saj, double sjk, double sAK) override;
0489
0490
0491 virtual double getQ2(double saj, double sjk, double sAK) override {
0492 return (saj*sjk/(sAK+sjk));}
0493 virtual double getQ2max(double sAK, double eA, double eBeamUsed) override {
0494 double eAmax = ((sqrt(shhSav)/2.0) - (eBeamUsed-eA));
0495 return (sAK*(eAmax-eA)/eA);}
0496
0497
0498 virtual double genQ2run(double q2old, double sAK, double zMin, double zMax,
0499 double colFac, double PDFratio, double b0, double kR, double Lambda,
0500 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0501 override;
0502
0503
0504 virtual double genQ2(double q2old, double sAK, double zMin, double zMax,
0505 double colFac, double alphaSvalue, double PDFratio,
0506 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0507 override;
0508
0509
0510 virtual double genZ(double zMin, double zMax) override;
0511
0512
0513 virtual double getIz(double zMin, double zMax) override;
0514
0515
0516 virtual double getZmin(double Qt2, double sAK, double eA, double eBeamUsed)
0517 override;
0518 virtual double getZmax(double Qt2, double sAK, double eA, double eBeamUsed)
0519 override;
0520
0521
0522 virtual double getS1j(double Qt2, double zeta, double sAK) override;
0523 virtual double getSj2(double Qt2, double zeta, double sAK) override;
0524
0525
0526 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0527 int iSys, int idA, int idK, double eA, double eK,
0528 double Qt2A, double Qt2B) override;
0529
0530 };
0531
0532
0533
0534
0535
0536
0537 class TrialVFSoft : public TrialIFSoft {
0538
0539 public:
0540
0541
0542 virtual string name() override {return "TrialVFSoft";}
0543
0544
0545
0546 virtual double aTrial(double saj, double sjk, double sAK) override;
0547
0548
0549 virtual double genZ(double zMin, double zMax) override;
0550
0551
0552 virtual double getIz(double zMin, double zMax) override;
0553
0554 };
0555
0556
0557
0558
0559
0560 class TrialIFGCollA : public TrialGeneratorISR {
0561
0562 public:
0563
0564
0565 virtual string name() override {return "TrialIFGCollA";}
0566
0567
0568
0569
0570 virtual double aTrial(double saj, double sjk, double sAK) override;
0571
0572
0573 virtual double getQ2(double saj, double sjk, double sAK) override {
0574 return (saj*sjk/(sAK+sjk));}
0575 virtual double getQ2max(double sAK, double eA, double eBeamUsed) override {
0576 double eAmax = ( (sqrt(shhSav)/2.0) - (eBeamUsed-eA) );
0577 return (sAK*(eAmax-eA)/eA);}
0578
0579
0580 virtual double genQ2run(double q2old, double sAK, double zMin, double zMax,
0581 double colFac, double PDFratio, double b0, double kR, double Lambda,
0582 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0583 override;
0584
0585
0586 virtual double genQ2(double q2old, double sAK, double zMin, double zMax,
0587 double colFac, double alphaSvalue, double PDFratio,
0588 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0589 override;
0590
0591
0592 virtual double genZ(double zMin, double zMax) override;
0593
0594
0595 virtual double getIz(double zMin, double zMax) override;
0596
0597
0598 virtual double getZmin(double Qt2, double sAK, double eA, double eBeamUsed)
0599 override;
0600 virtual double getZmax(double Qt2, double sAK, double eA, double eBeamUsed)
0601 override;
0602
0603
0604 virtual double getS1j(double Qt2, double zeta, double sAK) override;
0605 virtual double getSj2(double Qt2, double zeta, double sAK) override;
0606
0607
0608 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0609 int iSys, int idA, int idK, double eA, double eK,
0610 double Qt2A, double Qt2B) override;
0611
0612 };
0613
0614
0615
0616
0617
0618 class TrialIFGCollK : public TrialGeneratorISR {
0619
0620 public:
0621
0622
0623 virtual string name() override {return "TrialIFGCollK";}
0624
0625
0626 virtual double aTrial(double saj, double sjk, double sAK) override;
0627
0628
0629 virtual double getQ2(double saj, double sjk, double sAK) override {
0630 return (saj*sjk/(sAK+sjk));
0631 }
0632 virtual double getQ2max(double sAK, double eA, double eAused) override {
0633 double eAmax = ( (sqrt(shhSav)/2.0) - (eAused-eA) );
0634 return (sAK*(eAmax-eA)/eA);}
0635
0636
0637 virtual double genQ2run(double q2old, double sAK, double zMin, double zMax,
0638 double colFac, double PDFratio, double b0, double kR, double Lambda,
0639 double eA, double eK, double headroomFac=1.0, double enhanceFac=1.0)
0640 override;
0641
0642
0643 virtual double genQ2(double q2old, double sAK, double zMin, double zMax,
0644 double colFac, double alphaSvalue, double PDFratio,
0645 double eA, double eK, double headroomFac=1.0, double enhanceFac=1.0)
0646 override;
0647
0648
0649 virtual double genZ(double zMin, double zMax) override;
0650
0651
0652 virtual double getIz(double zMin, double zMax) override;
0653
0654
0655 virtual double getZmin(double Qt2, double sAK, double eA, double eAused)
0656 override;
0657 virtual double getZmax(double Qt2, double sAK, double eA, double eAused)
0658 override;
0659
0660
0661 virtual double getS1j(double Qt2, double zeta, double sAK) override;
0662 virtual double getSj2(double Qt2, double zeta, double sAK) override;
0663
0664
0665 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0666 int iSys, int idA, int idK, double eA, double eK,
0667 double Qt2A, double Qt2B) override;
0668 };
0669
0670
0671
0672
0673
0674 class TrialIFSplitA : public TrialGeneratorISR {
0675
0676 public:
0677
0678
0679 virtual string name() override {return "TrialIFSplitA";}
0680
0681
0682
0683 virtual double aTrial(double saj, double sjk, double sAK) override;
0684
0685
0686 virtual double getQ2(double saj, double sjk, double sAK) override {
0687 return ((useMevolSav) ? saj : saj*sjk/(sAK + sjk));}
0688 virtual double getQ2max(double sAK, double eA, double eBeamUsed) override {
0689 double xA = eA/(sqrt(shhSav)/2.0);
0690 double eAmax = ((sqrt(shhSav)/2.0) - (eBeamUsed - eA));
0691 return ((useMevolSav) ? sAK/xA : sAK*(eAmax - eA)/eA);}
0692
0693
0694 virtual double genQ2run(double q2old, double sAK, double zMin, double zMax,
0695 double colFac, double PDFratio, double b0, double kR, double Lambda,
0696 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0697 override;
0698
0699
0700 virtual double genQ2(double q2old, double sAK, double zMin, double zMax,
0701 double colFac, double alphaSvalue, double PDFratio,
0702 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0703 override;
0704
0705
0706
0707 virtual double genQ2thres(double q2old, double sAK,
0708 double zMin, double zMax, double colFac, double alphaSvalue,
0709 double PDFratio, int idA, int idK, double eA, double eK, bool useMpdf,
0710 double headroomFac = 1.0, double enhanceFac = 1.0) override;
0711
0712
0713 virtual double genZ(double zMin, double zMax) override;
0714
0715
0716 virtual double getIz(double zMin, double zMax) override;
0717
0718
0719 virtual double getZmin(double Qt2, double sAK, double eA, double eBeamUsed)
0720 override;
0721 virtual double getZmax(double Qt2, double sAK, double eA, double eBeamUsed)
0722 override;
0723
0724
0725 virtual double getS1j(double Qt2, double zeta, double sAK) override;
0726 virtual double getSj2(double Qt2, double zeta, double sAK) override;
0727
0728
0729 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0730 int iSys, int idA, int idK, double eA, double eK,
0731 double Qt2A, double Qt2B) override;
0732
0733 };
0734
0735
0736
0737
0738
0739 class TrialIFSplitK : public TrialGeneratorISR {
0740
0741 public:
0742
0743
0744 virtual string name() override {return "TrialIFSplitK";}
0745
0746
0747
0748 virtual double aTrial(double saj, double sjk, double sAK) override;
0749
0750
0751 virtual double getQ2(double saj, double sjk, double sAK) override {
0752 return ((useMevolSav) ? sjk : saj*sjk/(sAK + sjk));}
0753 virtual double getQ2max(double sAK, double eA, double eBeamUsed) override {
0754 double xA = eA/(sqrt(shhSav)/2.0);
0755 double eAmax = ((sqrt(shhSav)/2.0) - (eBeamUsed - eA));
0756 return ((useMevolSav) ? sAK*(1.0 - xA)/xA : sAK*(eAmax - eA)/eA);}
0757
0758
0759 virtual double genQ2run(double q2old, double sAK, double zMin, double zMax,
0760 double colFac, double PDFratio, double b0, double kR, double Lambda,
0761 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0762 override;
0763
0764
0765 virtual double genQ2(double q2old, double sAK, double zMin, double zMax,
0766 double colFac, double alphaSvalue, double PDFratio,
0767 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0768 override;
0769
0770
0771 virtual double genZ(double zMin, double zMax) override;
0772
0773
0774 virtual double getIz(double zMin, double zMax) override;
0775
0776
0777 virtual double getZmin(double Qt2, double sAK, double eA, double eBeamUsed)
0778 override;
0779 virtual double getZmax(double Qt2, double sAK, double eA, double eBeamUsed)
0780 override;
0781
0782
0783 virtual double getS1j(double Qt2, double zeta, double sAK) override;
0784 virtual double getSj2(double Qt2, double zeta, double sAK) override;
0785
0786
0787 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0788 int iSys, int idA, int idK, double eA, double eK,
0789 double Qt2A, double Qt2B) override;
0790
0791 };
0792
0793
0794
0795
0796
0797 class TrialIFConvA : public TrialGeneratorISR {
0798
0799 public:
0800
0801
0802 virtual string name() override {return "TrialIFConvA";}
0803
0804
0805
0806
0807
0808 virtual double aTrial(double saj, double sjk, double sAK) override;
0809
0810
0811 virtual double getQ2(double saj, double sjk, double sAK) override {
0812 return ((useMevolSav) ? saj : saj*sjk/(sAK + sjk));}
0813 virtual double getQ2max(double sAK, double eA, double eBeamUsed) override {
0814 double xA = eA/(sqrt(shhSav)/2.0);
0815 double eAmax = ((sqrt(shhSav)/2.0) - (eBeamUsed - eA));
0816 return ((useMevolSav) ? sAK/xA : sAK*(eAmax-eA)/eA);}
0817
0818
0819 virtual double genQ2run(double q2old, double sAK, double zMin, double zMax,
0820 double colFac, double PDFratio, double b0, double kR, double Lambda,
0821 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0822 override;
0823
0824
0825 virtual double genQ2(double q2old, double sAK, double zMin, double zMax,
0826 double colFac, double alphaSvalue, double PDFratio,
0827 double eA, double eK, double headroomFac = 1.0, double enhanceFac = 1.0)
0828 override;
0829
0830
0831 virtual double genZ(double zMin, double zMax) override;
0832
0833
0834 virtual double getIz(double zMin, double zMax) override;
0835
0836
0837 virtual double getZmin(double Qt2, double sAK, double eA, double eBeamUsed)
0838 override;
0839 virtual double getZmax(double Qt2, double sAK, double eA, double eBeamUsed)
0840 override;
0841
0842
0843 virtual double getS1j(double Qt2, double zeta, double sAK) override;
0844 virtual double getSj2(double Qt2, double zeta, double sAK) override;
0845
0846
0847 virtual double trialPDFratio(BeamParticle* beamAPtr, BeamParticle* beamBPtr,
0848 int iSys, int idA, int idK, double eA, double eK,
0849 double Qt2A, double Qt2B) override;
0850
0851 };
0852
0853
0854
0855
0856
0857
0858
0859
0860
0861
0862
0863
0864
0865
0866
0867
0868
0869
0870
0871
0872
0873
0874
0875 class BranchElementalISR {
0876
0877 public:
0878
0879
0880 BranchElementalISR() = default;
0881 BranchElementalISR(int iSysIn, Event& event, int iOld1In,
0882 int iOld2In, int colIn, bool isVal1In, bool isVal2In) {
0883 reset(iSysIn, event, iOld1In, iOld2In, colIn, isVal1In, isVal2In);}
0884
0885
0886 void reset(int iSysIn, Event& event, int i1In, int i2In, int colIn,
0887 bool isVal1In, bool isVal2In);
0888
0889
0890 double mAnt() const {return mAntSav;}
0891 double m2Ant() const {return m2AntSav;}
0892 double sAnt() const {return sAntSav;}
0893
0894 double s12() const {return 2*new1.p()*new2.p();}
0895 double s23() const {return 2*new2.p()*new3.p();}
0896 double s13() const {return 2*new1.p()*new3.p();}
0897
0898
0899 bool isII() const {return isIIsav;}
0900
0901 bool is1A() const {return is1Asav;}
0902
0903 bool isVal1() const {return isVal1sav;}
0904 bool isVal2() const {return isVal2sav;}
0905 int colType1() const {return colType1sav;}
0906 int colType2() const {return colType2sav;}
0907 int col() const {return colSav;}
0908 int geti1() {return i1sav;}
0909 int geti2() {return i2sav;}
0910 int getId1() {return id1sav;}
0911 int getId2() {return id2sav;}
0912 int getSystem() {return system;}
0913
0914
0915 void clearTrialGenerators();
0916
0917
0918 void addTrialGenerator(enum AntFunType antFunTypeIn, bool swapIn,
0919 TrialGeneratorISR* trialGenPtrIn);
0920
0921
0922 void addRescue(int iTrial) {nShouldRescue[iTrial]++;}
0923 int getNshouldRescue(int iTrial) {return nShouldRescue[iTrial];}
0924 void resetRescue() {
0925 for (int i=0; i<(int)nShouldRescue.size(); i++) nShouldRescue[i] = 0;}
0926
0927
0928 int nTrialGenerators() const {return trialGenPtrsSav.size();}
0929
0930
0931 void saveTrial(int iTrial, double qOld, double qTrial, double zMin=0.,
0932 double zMax=0., double colFac=0.,double alphaEff=0., double pdfRatio=0.,
0933 int trialFlav=0, double extraMpdf=0., double headroom = 1.0,
0934 double enhanceFac = 1.0);
0935
0936
0937 void addPDF(int iTrial,double pdfRatio) {physPDFratioSav[iTrial] = pdfRatio;}
0938
0939
0940 bool genTrialInvariants(double& s1j, double& sj2,
0941 double eBeamUsed, int iTrial = -1);
0942
0943
0944 int getTrialIndex() const;
0945
0946
0947 bool hasTrial(int iTrial) const {
0948 if (iTrial < int(hasSavedTrial.size())) return hasSavedTrial[iTrial];
0949 else return false;}
0950
0951
0952 bool getIsSwapped(int iTrial = -1) const {
0953 if (iTrial <= -1) iTrial = getTrialIndex();
0954 return isSwappedSav[iTrial];}
0955
0956
0957 enum AntFunType antFunTypePhys(int iTrial = -1) const {
0958 if (iTrial <= -1) iTrial = getTrialIndex();
0959 return antFunTypePhysSav[iTrial];}
0960
0961
0962 double getTrialScale(int iTrial) const {
0963 if (iTrial < int(scaleSav.size())) return scaleSav[iTrial];
0964 else return -1.0;}
0965
0966
0967 double getTrialScale() const;
0968
0969
0970 double getColFac(int iTrial = -1) {
0971 if (iTrial <= -1) iTrial = getTrialIndex();
0972 return colFacSav[iTrial];}
0973
0974
0975 double getHeadroomFac(int iTrial = -1) {
0976 if (iTrial <= -1) iTrial = getTrialIndex();
0977 return headroomSav[iTrial];}
0978
0979
0980 double getEnhanceFac(int iTrial = -1) {
0981 if (iTrial <= -1) iTrial = getTrialIndex();
0982 return enhanceFacSav[iTrial];}
0983
0984
0985 double getAlphaTrial(int iTrial = -1) {
0986 if (iTrial <= -1) iTrial = getTrialIndex();
0987 return alphaSav[iTrial];}
0988
0989
0990 double getPDFratioTrial(int iTrial = -1) {
0991 if (iTrial <= -1) iTrial = getTrialIndex();
0992 return trialPDFratioSav[iTrial];}
0993
0994
0995 int getTrialFlav(int iTrial = -1) {
0996 if (iTrial <= -1) iTrial = getTrialIndex();
0997 return trialFlavSav[iTrial];}
0998
0999
1000 double getPDFratioPhys(int iTrial = -1) {
1001 if (iTrial <= -1) iTrial = getTrialIndex();
1002 return physPDFratioSav[iTrial];}
1003
1004
1005 double getExtraMassPDFfactor(int iTrial = -1) {
1006 if (iTrial <= -1) iTrial = getTrialIndex();
1007 return extraMassPDFfactorSav[iTrial];}
1008
1009
1010
1011 void renewTrial(int iTrial = -1) {
1012 if (iTrial >= 0) hasSavedTrial[iTrial] = false;
1013 else for (iTrial = 0; iTrial < int(hasSavedTrial.size()); ++iTrial)
1014 hasSavedTrial[iTrial] = false;}
1015
1016
1017 void list(bool header = false, bool footer = false) const;
1018
1019
1020 int i1sav{}, i2sav{}, id1sav{}, id2sav{}, colType1sav{}, colType2sav{},
1021 h1sav{}, h2sav{};
1022 double e1sav{}, e2sav{};
1023 bool isVal1sav{}, isVal2sav{}, isIIsav{}, is1Asav{};
1024 Particle new1{}, new2{}, new3{};
1025
1026 int colSav{};
1027
1028 int system{0}, nVeto{}, nHull{}, nHadr{};
1029
1030 bool forceSplittingSav{};
1031
1032
1033 vector<TrialGeneratorISR*> trialGenPtrsSav{};
1034 vector<double> zMinSav{}, zMaxSav{}, colFacSav{}, alphaSav{};
1035 vector<double> physPDFratioSav{}, trialPDFratioSav{};
1036 vector<double> extraMassPDFfactorSav{};
1037 vector<double> scaleSav{}, scaleOldSav{}, headroomSav{}, enhanceFacSav{};
1038 vector<bool> hasSavedTrial{}, isSwappedSav{};
1039 vector<enum AntFunType> antFunTypePhysSav{};
1040 vector<int> nShouldRescue{}, trialFlavSav{};
1041
1042
1043
1044
1045 private:
1046
1047
1048 double m2AntSav{}, mAntSav{}, sAntSav{};
1049
1050 };
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060 class VinciaISR : public SpaceShower {
1061
1062
1063 friend class VinciaFSR;
1064 friend class VinciaHistory;
1065
1066 public:
1067
1068
1069 VinciaISR() : isInit(false) {;}
1070
1071
1072 virtual ~VinciaISR() {;}
1073
1074
1075 void init(BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn) override;
1076
1077
1078 void onBeginEvent() override { isPrepared = false; }
1079
1080
1081 bool limitPTmax(Event& event, double Q2Fac = 0., double Q2Ren = 0.) override;
1082
1083
1084 void prepare(int iSys, Event& event, bool limitPTmaxIn = false) override;
1085
1086
1087 void update( int iSys, Event& event, bool hasWeakRad = false) override;
1088
1089
1090 double pTnext(Event& event, double pTbegAll, double pTendAll,
1091 int nRadIn = -1, bool doTrialIn = false) override;
1092
1093
1094
1095 bool branch(Event& event) override;
1096
1097
1098 void list() const override;
1099
1100
1101
1102 bool initUncertainties() override {return false;}
1103
1104
1105
1106
1107
1108 bool doRestart() const override {return false;}
1109
1110
1111
1112 bool wasGamma2qqbar() override {return false;}
1113
1114
1115 bool getHasWeaklyRadiated() override {return false;}
1116
1117
1118 int system() const override {return iSysWin;}
1119
1120
1121
1122 double enhancePTmax() const override {return pTmaxFudge;}
1123
1124
1125 void initVinciaPtrs(VinciaColour* colourPtrIn,
1126 shared_ptr<VinciaFSR> fsrPtrIn, MECs* mecsPtrIn,
1127 Resolution* resolutionPtrIn, VinciaCommon* vinComPtrIn,
1128 VinciaWeights* vinWeightsPtrIn);
1129
1130
1131 void setDiagnosticsPtr(shared_ptr<VinciaDiagnostics> diagnosticsPtrIn) {
1132 diagnosticsPtr = diagnosticsPtrIn;
1133 }
1134
1135
1136 void setEWShowerPtr(VinciaModulePtr ewShowerPtrIn) {
1137 ewShowerPtr = ewShowerPtrIn;
1138 }
1139
1140
1141 void setQEDShowerHardPtr(VinciaModulePtr qedShowerPtrIn) {
1142 qedShowerHardPtr = qedShowerPtrIn;
1143 }
1144
1145
1146 void setQEDShowerSoftPtr(VinciaModulePtr qedShowerPtrIn) {
1147 qedShowerSoftPtr = qedShowerPtrIn;
1148 }
1149
1150
1151 void clearContainers();
1152
1153
1154 void initAntPtr(AntennaSetISR* antSetIn) {antSetPtr = antSetIn;}
1155
1156
1157 bool prepared(int iSys) {
1158 if (hasPrepared.find(iSys) != hasPrepared.end()) return hasPrepared[iSys];
1159 else return false;}
1160
1161
1162 AntennaFunctionIX* getAntFunPtr(enum AntFunType antFunType) {
1163 return antSetPtr->getAntFunPtr(antFunType);}
1164
1165
1166 int getRegion(double q) {
1167 for (int i=1; i<(int)regMinScalesSav.size(); i++)
1168 if (q < regMinScalesSav[i]) return i-1;
1169 return (int)regMinScalesSav.size() - 1;}
1170
1171
1172 double getQmin(int iRegion) {
1173 iRegion = max(0,iRegion);
1174 iRegion = min(iRegion,(int)regMinScalesSav.size()-1);
1175 return regMinScalesSav[iRegion];}
1176
1177
1178 int getNf(int iRegion) {
1179 if (iRegion <= 1) return 3;
1180 else if (iRegion <= 2) return 4;
1181 else if (iRegion <= 4) return 5;
1182 else return 6;}
1183
1184
1185 double getLambda(int nFin) {
1186 if (nFin <= 3) return alphaSptr->Lambda3();
1187 else if (nFin <= 4) return alphaSptr->Lambda4();
1188 else if (nFin <= 5) return alphaSptr->Lambda5();
1189 else return alphaSptr->Lambda6();}
1190
1191
1192 void resetTrialGenerators(shared_ptr<BranchElementalISR> trial);
1193
1194
1195
1196
1197 bool checkHeavyQuarkPhaseSpace(vector<Particle> parts, int iSyst);
1198
1199
1200 bool heavyQuarkLeft(double qTrial);
1201
1202
1203 bool isSysHard(int iSys) {
1204 if (!isInit) return false;
1205 if ((int)isHardSys.size() <= iSys) return false;
1206 return isHardSys[iSys];}
1207
1208
1209 vector<double> getMasses() {return vector<double> {mt, mtb, mb, mc, ms};}
1210
1211
1212 int getNsys() {return nBranchISR.size();}
1213
1214 int getNbranch(int iSys = -1) {
1215 int n = 0;
1216 if (iSys < 0) for (int i = 0; i < (int)nBranchISR.size(); ++i)
1217 n += nBranchISR[iSys];
1218 else if (iSys < (int)nBranchISR.size()) n = nBranchISR[iSys];
1219 else n = -1;
1220 return n;}
1221
1222
1223 void setIsTrialShower(bool isTrialIn){ isTrialShower = isTrialIn; }
1224 void setIsTrialShowerRes(bool isTrialIn){ isTrialShowerRes = isTrialIn; }
1225
1226
1227
1228 void saveBornState(Event& born, int iSys);
1229
1230 void saveBornForTrialShower(Event& born);
1231
1232
1233 void setVerbose(int verboseIn) {verbose = verboseIn;}
1234
1235
1236 bool checkAntennae(const Event& event);
1237
1238
1239 AlphaStrong* alphaSptr;
1240
1241 private:
1242
1243
1244 void setStartScale(int iSys, Event& event);
1245
1246
1247 double getHeadroomFac(int iSys, enum AntFunType antFunTypePhysIn,
1248 double qMinNow);
1249
1250
1251 bool generateKinematics(Event& event,
1252 shared_ptr<BranchElementalISR> trialPtr, vector<Vec4>& pRec) {
1253 return ( trialPtr->isII()
1254 ? generateKinematicsII(event, trialPtr, pRec)
1255 : generateKinematicsIF(event, trialPtr, pRec) ); }
1256
1257
1258 bool generateKinematicsII(Event& event,
1259 shared_ptr<BranchElementalISR> trialPtr, vector<Vec4>& pRec);
1260
1261
1262 bool generateKinematicsIF(Event& event,
1263 shared_ptr<BranchElementalISR> trialPtr, vector<Vec4>& pRec);
1264
1265
1266 bool acceptTrial(const Event& event,
1267 shared_ptr<BranchElementalISR> winnerPtr);
1268
1269
1270 bool assignColourFlow(Event& event, shared_ptr<BranchElementalISR> trialPtr);
1271
1272
1273 bool isInit;
1274 bool isPrepared;
1275
1276
1277 bool hasUserHooks, canVetoEmission;
1278
1279
1280 int beamFrameType;
1281 double eBeamA, eBeamB, eCMBeamsSav, m2BeamsSav;
1282 double TINYPDF;
1283
1284
1285 bool doII, doIF, doQED;
1286
1287
1288 map<int, bool> hasPrepared;
1289
1290
1291 bool helicityShower, sectorShower, convGluonToQuarkI, convQuarkToGluonI;
1292 bool kineMapIFretry;
1293 int nGluonToQuark;
1294 double cutoffScaleII, cutoffScaleIF;
1295 int nFlavZeroMass;
1296
1297
1298 int pTmaxMatch{}, pTdampMatch{};
1299 double pTmaxFudge{}, pT2maxFudge{}, pT2maxFudgeMPI{}, pTdampFudge{};
1300
1301
1302 bool useCMW;
1303 int alphaSorder;
1304 double alphaSvalue, alphaSmax, alphaSmuFreeze, alphaSmuMin;
1305 double aSkMu2EmitI, aSkMu2SplitI, aSkMu2SplitF, aSkMu2Conv;
1306 double mt, mtb, ms, mb, mc;
1307
1308 double mu2freeze, mu2min;
1309
1310
1311 TrialIISoft trialIISoft;
1312 TrialIIGCollA trialIIGCollA;
1313 TrialIIGCollB trialIIGCollB;
1314 TrialIISplitA trialIISplitA;
1315 TrialIISplitB trialIISplitB;
1316 TrialIIConvA trialIIConvA;
1317 TrialIIConvB trialIIConvB;
1318 TrialIFSoft trialIFSoft;
1319 TrialVFSoft trialVFSoft;
1320 TrialIFGCollA trialIFGCollA;
1321 TrialIFSplitA trialIFSplitA;
1322 TrialIFSplitK trialIFSplitK;
1323 TrialIFConvA trialIFConvA;
1324
1325
1326 TrialIFGCollK trialIFGCollK;
1327
1328
1329 bool enhanceInHard, enhanceInResDec, enhanceInMPI;
1330 double enhanceAll, enhanceBottom, enhanceCharm, enhanceCutoff;
1331
1332
1333 AntennaSetISR* antSetPtr{};
1334 MECs* mecsPtr{};
1335 VinciaColour* colourPtr{};
1336 Resolution* resolutionPtr{};
1337 shared_ptr<VinciaFSR> fsrPtr{};
1338 VinciaCommon* vinComPtr{};
1339 VinciaWeights* weightsPtr{};
1340
1341
1342 shared_ptr<VinciaDiagnostics> diagnosticsPtr;
1343
1344
1345 VinciaModulePtr ewShowerPtr;
1346 VinciaModulePtr qedShowerHardPtr;
1347 VinciaModulePtr qedShowerSoftPtr;
1348
1349
1350 vector<double> Paccept;
1351
1352
1353 vector<double> regMinScalesMtSav;
1354 vector<double> regMinScalesSav;
1355 vector<double> regMinScalesNow;
1356
1357
1358 vector<shared_ptr<BranchElementalISR> > branchElementals;
1359
1360
1361 shared_ptr<BranchElementalISR> winnerPtr{};
1362 int indxWin;
1363 int iSysWin;
1364 vector<Particle> stateNew;
1365 VinciaClustering minClus;
1366
1367
1368 map<int, bool> isHardSys{}, isResonanceSys{}, polarisedSys{}, doMECsSys{};
1369
1370
1371 map<int, vector< Particle > > partsSav{};
1372 map<int, vector< int > > indexSav{};
1373
1374
1375 map<int, double> q2Hat{};
1376 vector<bool> doPTlimit{}, doPTdamp{};
1377 map<int, double> pT2damp{};
1378
1379
1380 map<int, int> nBranch, nBranchISR;
1381
1382
1383 map<int, Particle> initialA;
1384 map<int, Particle> initialB;
1385 double eBeamAUsed, eBeamBUsed;
1386
1387
1388 map<int, int> nG, nQQ;
1389
1390
1391 map<int, bool> savedBorn;
1392 map<int, bool> resolveBorn;
1393 map<int, map<int, int>> nFlavsBorn;
1394
1395
1396 bool doMerging, isTrialShower, isTrialShowerRes;
1397
1398
1399 bool doRescue;
1400 int nRescue;
1401 double rescueMin;
1402
1403
1404 int verbose;
1405
1406 };
1407
1408
1409
1410 }
1411
1412 #endif