File indexing completed on 2026-08-06 09:24:23
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef HERWIG_DipoleEventRecord_H
0010 #define HERWIG_DipoleEventRecord_H
0011
0012
0013
0014
0015 #include "Herwig/Shower/ShowerEventRecord.h"
0016 #include "Herwig/Shower/PerturbativeProcess.h"
0017 #include "ThePEG/PDF/PDF.h"
0018 #include "Dipole.h"
0019 #include "DipoleChain.h"
0020 #include "Herwig/MatrixElement/Matchbox/Utility/DensityOperator.h"
0021
0022 #include <tuple>
0023
0024 namespace Herwig {
0025
0026 using namespace ThePEG;
0027
0028
0029
0030
0031
0032
0033
0034
0035 class SubleadingSplittingInfo
0036 : public DipoleSplittingInfo {
0037
0038 public:
0039
0040
0041
0042
0043 SubleadingSplittingInfo()
0044 : DipoleSplittingInfo() {}
0045
0046
0047
0048
0049 list<DipoleChain>::iterator emitterChain() const { return theEmitterChain; }
0050
0051
0052
0053
0054 list<Dipole>::iterator emitterDipole() const { return theEmitterDipole; }
0055
0056
0057
0058
0059 list<DipoleChain>::iterator spectatorChain() const { return theSpectatorChain; }
0060
0061
0062
0063
0064 list<Dipole>::iterator spectatorDipole() const { return theSpectatorDipole; }
0065
0066
0067
0068
0069 Energy startScale() const { return theStartScale; }
0070
0071
0072
0073
0074 void emitterChain(list<DipoleChain>::iterator it) { theEmitterChain = it; }
0075
0076
0077
0078
0079 void emitterDipole(list<Dipole>::iterator it) { theEmitterDipole = it; }
0080
0081
0082
0083
0084 void spectatorChain(list<DipoleChain>::iterator it) { theSpectatorChain = it; }
0085
0086
0087
0088
0089 void spectatorDipole(list<Dipole>::iterator it) { theSpectatorDipole = it; }
0090
0091
0092
0093
0094 void startScale(Energy s) { theStartScale = s; }
0095
0096 private:
0097
0098
0099
0100
0101 list<DipoleChain>::iterator theEmitterChain;
0102
0103
0104
0105
0106 list<Dipole>::iterator theEmitterDipole;
0107
0108
0109
0110
0111 list<DipoleChain>::iterator theSpectatorChain;
0112
0113
0114
0115
0116 list<Dipole>::iterator theSpectatorDipole;
0117
0118
0119
0120
0121 Energy theStartScale;
0122
0123 };
0124
0125
0126
0127
0128
0129
0130
0131
0132 class DipoleEventRecord : public ShowerEventRecord {
0133
0134 public:
0135
0136
0137
0138
0139 DipoleEventRecord() {}
0140
0141
0142
0143
0144 ~DipoleEventRecord() { clear(); }
0145
0146 public:
0147
0148
0149
0150
0151
0152 PList& hard() { return theHard; }
0153
0154
0155
0156
0157
0158 const PList& hard() const { return theHard; }
0159
0160
0161
0162
0163 const Lorentz5Momentum& pX() const { return thePX; }
0164
0165
0166
0167
0168 cPDVector& particlesAfter() { return theParticlesAfter; }
0169
0170
0171
0172
0173 const cPDVector& particlesAfter() const { return theParticlesAfter; }
0174
0175
0176
0177
0178 cPDVector& particlesBefore() { return theParticlesBefore; }
0179
0180
0181
0182
0183 const cPDVector& particlesBefore() const { return theParticlesBefore; }
0184
0185
0186
0187
0188 vector<Lorentz5Momentum>& momentaAfter() { return theMomentaAfter; }
0189
0190
0191
0192
0193 const vector<Lorentz5Momentum>& momentaAfter() const { return theMomentaAfter; }
0194
0195
0196
0197
0198 map<PPtr,size_t>& particleIndices() { return theParticleIndices; }
0199
0200
0201
0202
0203 const map<PPtr,size_t>& particleIndices() const { return theParticleIndices; }
0204
0205
0206
0207
0208 DensityOperator& densityOperator() { return theDensityOperator; }
0209
0210
0211
0212
0213 const DensityOperator& densityOperator() const { return theDensityOperator; }
0214
0215
0216
0217
0218
0219 void setSubleadingNc( bool doSub, size_t emissionsLimit ) {
0220 doSubleadingNc = doSub;
0221 continueSubleadingNc = doSub;
0222 subleadingNcEmissionsLimit = emissionsLimit;
0223 }
0224
0225
0226
0227
0228 bool getContinueSubleadingNc() const { return continueSubleadingNc; }
0229
0230
0231
0232
0233 void setDensityOperatorEvolution( int scheme, Energy2 cutoff ) {
0234 densityOperatorEvolution = scheme;
0235 densityOperatorCutoff = cutoff;
0236 }
0237
0238
0239
0240
0241
0242 double dipoleKernelForEvolution(size_t em, size_t spec,
0243 Energy2 pEmitpSpec, Energy2 pEmitpEmis,
0244 Energy2 pEmispSpec);
0245
0246
0247
0248
0249
0250
0251 void transform(const LorentzRotation& rot);
0252
0253 public:
0254
0255
0256
0257
0258 const list<DipoleChain>& chains() const { return theChains; }
0259
0260
0261
0262
0263 list<DipoleChain>& chains() { return theChains; }
0264
0265
0266
0267
0268 const list<DipoleChain>& doneChains() const { return theDoneChains; }
0269
0270
0271
0272
0273 list<DipoleChain>& doneChains() { return theDoneChains; }
0274
0275
0276
0277
0278
0279 bool haveChain() const { return !theChains.empty(); }
0280
0281
0282
0283
0284 DipoleChain& currentChain() { assert(haveChain()); return theChains.front(); }
0285
0286
0287
0288
0289 void popChain();
0290
0291
0292
0293
0294 void popChain(list<DipoleChain>::iterator);
0295
0296
0297
0298
0299 void popChains(const list<list<DipoleChain>::iterator>&);
0300
0301
0302
0303
0304
0305 DipoleIndex
0306 mergeIndex(list<Dipole>::iterator firstDipole, const pair<bool,bool>& whichFirst,
0307 list<Dipole>::iterator secondDipole, const pair<bool,bool>& whichSecond) const;
0308
0309
0310
0311
0312
0313 SubleadingSplittingInfo
0314 mergeSplittingInfo(list<DipoleChain>::iterator firstChain, list<Dipole>::iterator firstDipole,
0315 const pair<bool,bool>& whichFirst,
0316 list<DipoleChain>::iterator secondChain, list<Dipole>::iterator secondDipole,
0317 const pair<bool,bool>& whichSecond) const;
0318
0319
0320
0321
0322 void getSubleadingSplittings(list<SubleadingSplittingInfo>&);
0323
0324 public:
0325
0326
0327
0328
0329
0330
0331
0332
0333 void split(list<Dipole>::iterator dip,
0334 DipoleSplittingInfo& dsplit,
0335 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
0336 DipoleChain*& firstChain, DipoleChain*& secondChain) {
0337 split(dip,theChains.begin(),dsplit,childIterators,firstChain,secondChain,false);
0338 }
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348 void split(list<Dipole>::iterator dip,
0349 list<DipoleChain>::iterator ch,
0350 DipoleSplittingInfo& dsplit,
0351 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
0352 DipoleChain*& firstChain, DipoleChain*& secondChain,
0353 bool colourSpectator = true);
0354
0355
0356
0357
0358
0359 pair<PVector,PVector> tmpsplit(list<Dipole>::iterator dip,
0360 DipoleSplittingInfo& dsplit,
0361 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
0362 DipoleChain*& firstChain, DipoleChain*& secondChain) {
0363 return tmpsplit(dip,theChains.begin(),dsplit,childIterators,firstChain,secondChain,false);
0364 }
0365
0366
0367
0368
0369 pair<PVector,PVector> tmpsplit(list<Dipole>::iterator dip,
0370 list<DipoleChain>::iterator ch,
0371 DipoleSplittingInfo& dsplit,
0372 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
0373 DipoleChain*& firstChain, DipoleChain*& secondChain,
0374 bool colourSpectator = true);
0375
0376
0377
0378
0379
0380
0381 void recoil(list<Dipole>::iterator dip,
0382 list<DipoleChain>::iterator ch,
0383 DipoleSplittingInfo& dsplit);
0384
0385
0386
0387
0388 void splitSubleading(SubleadingSplittingInfo& dsplit,
0389 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
0390 DipoleChain*& firstChain, DipoleChain*& secondChain);
0391
0392
0393
0394
0395
0396 void update(DipoleSplittingInfo& dsplit);
0397
0398
0399
0400
0401 pair<PVector,PVector> tmpupdate(DipoleSplittingInfo& dsplit);
0402
0403
0404
0405
0406
0407 void updateInverse(DipoleSplittingInfo& dsplit);
0408
0409
0410
0411
0412
0413
0414
0415 list<pair<list<Dipole>::iterator,list<DipoleChain>::iterator> >
0416 inDipoles();
0417
0418
0419
0420
0421 tPPair fillEventRecord(StepPtr step, bool firstInteraction, bool realigned);
0422
0423 public:
0424
0425
0426
0427
0428
0429 const map<PPtr,PPtr>& prepare(tSubProPtr subpro,
0430 tStdXCombPtr xc,
0431 StepPtr step,
0432 const pair<PDF,PDF>& pdf,
0433 tPPair beam,
0434 bool firstInteraction,
0435 const set<long>& offShellPartons,
0436 bool dipoles = true);
0437
0438
0439
0440
0441 void slimprepare(tSubProPtr subpro,
0442 tStdXCombPtr xc,
0443 const pair<PDF,PDF>& pdf,tPPair beam,
0444 const set<long>& offShellPartons,
0445 bool dipoles = true);
0446
0447
0448
0449
0450
0451 virtual void clear();
0452
0453
0454
0455
0456
0457 void prepareChainsSubleading(const bool decay) {
0458 static set<long> empty;
0459 continueSubleadingNc = false;
0460 PList cordered = colourOrdered(incoming(),outgoing());
0461 findChains(cordered,empty,decay);
0462 }
0463
0464 public:
0465
0466
0467
0468
0469 void debugLastEvent(ostream&) const;
0470
0471 public:
0472
0473
0474
0475
0476 map<PPtr,PerturbativeProcessPtr> & decays() {return theDecays;}
0477
0478
0479
0480
0481
0482
0483
0484 void fillFromDecays(PerturbativeProcessPtr decayProc, vector<PPtr>& original);
0485
0486
0487
0488
0489
0490
0491
0492
0493 void separateDecay(PerturbativeProcessPtr decayProc);
0494
0495
0496
0497
0498 Energy decay(PPtr incoming, bool& powhegEmission);
0499
0500
0501
0502
0503
0504 bool prepareDecay(PerturbativeProcessPtr decayProc,
0505 const set<long>& offShellPartons);
0506
0507
0508
0509
0510
0511 void updateDecayMom(PPtr decayParent, PerturbativeProcessPtr decayProc);
0512
0513
0514
0515
0516
0517
0518 void updateDecayChainMom(PPtr decayParent, PerturbativeProcessPtr decayProc);
0519
0520
0521
0522
0523
0524
0525
0526 void updateDecays(PerturbativeProcessPtr decayProc, bool iterate = true);
0527
0528
0529
0530
0531 PerturbativeProcessPtr currentDecay() {return theCurrentDecay;}
0532
0533
0534
0535
0536 void currentDecay(PerturbativeProcessPtr in) {theCurrentDecay=in;}
0537
0538
0539
0540
0541 PPtr nextDecay() {
0542 if ( !theNextDecays.empty() )
0543 return theNextDecays.back();
0544 else
0545 return PPtr();
0546 }
0547
0548
0549
0550 public:
0551
0552
0553
0554
0555
0556 void findChains(const PList& ordered,
0557 const set<long>& offShellpartons,
0558 const bool decay = false);
0559
0560
0561
0562
0563 PList colourOrdered(PPair & in,PList & out);
0564
0565
0566 private:
0567
0568 struct getMomentum {
0569 const Lorentz5Momentum& operator() (PPtr particle) const {
0570 return particle->momentum();
0571 }
0572 };
0573
0574
0575
0576
0577 Lorentz5Momentum thePX;
0578
0579
0580
0581
0582
0583 PList theHard;
0584
0585
0586
0587
0588 map<PPtr,PPtr> theOriginals;
0589
0590
0591
0592
0593 list<DipoleChain> theChains;
0594
0595
0596
0597
0598 list<DipoleChain> theDoneChains;
0599
0600
0601
0602
0603 cPDVector theParticlesAfter;
0604
0605
0606
0607
0608 cPDVector theParticlesBefore;
0609
0610
0611
0612
0613 vector<Lorentz5Momentum> theMomentaAfter;
0614
0615
0616
0617
0618
0619
0620 pair<size_t,pair<size_t,size_t> > theEmitterEmissionIndices;
0621
0622
0623
0624
0625 pair<size_t,size_t> theSpectatorIndices;
0626
0627
0628
0629
0630 DensityOperator theDensityOperator;
0631
0632
0633
0634
0635 bool doSubleadingNc;
0636
0637
0638
0639
0640
0641 bool continueSubleadingNc;
0642
0643
0644
0645
0646 size_t subleadingNcEmissionsLimit;
0647
0648
0649
0650
0651 size_t subEmDone;
0652
0653
0654
0655
0656
0657 map<PPtr,size_t> theParticleIndices;
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667 int densityOperatorEvolution;
0668
0669
0670
0671
0672
0673 Energy2 densityOperatorCutoff;
0674
0675
0676
0677
0678
0679
0680
0681
0682
0683 map<std::tuple<size_t,size_t,size_t>,map<size_t,size_t> > theEmissionsMap;
0684
0685
0686
0687
0688
0689
0690
0691
0692 private:
0693
0694
0695
0696
0697 map<PPtr,PerturbativeProcessPtr> theDecays;
0698
0699
0700
0701
0702 PerturbativeProcessPtr theCurrentDecay;
0703
0704
0705
0706
0707
0708
0709
0710
0711
0712 PList theNextDecays;
0713
0714 };
0715
0716
0717 }
0718
0719 #endif