File indexing completed on 2026-08-06 09:24:25
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef HERWIG_DipoleShowerHandler_H
0010 #define HERWIG_DipoleShowerHandler_H
0011
0012
0013
0014
0015 #include "Herwig/Shower/ShowerHandler.h"
0016
0017 #include "Herwig/Shower/Dipole/DipoleShowerHandler.fh"
0018 #include "Herwig/Shower/Dipole/Base/DipoleSplittingInfo.h"
0019 #include "Herwig/Shower/Dipole/Base/DipoleSplittingReweight.h"
0020 #include "Herwig/Shower/Dipole/Kernels/DipoleSplittingKernel.h"
0021 #include "Herwig/Shower/Dipole/Base/DipoleSplittingGenerator.h"
0022 #include "Herwig/Shower/Dipole/Base/DipoleEventRecord.h"
0023 #include "Herwig/Shower/Dipole/Base/DipoleEvolutionOrdering.h"
0024 #include "Herwig/Shower/Dipole/Base/DipoleEventReweight.h"
0025 #include "Herwig/Shower/Dipole/Utility/ConstituentReshuffler.h"
0026 #include "Herwig/Shower/Dipole/Utility/IntrinsicPtGenerator.h"
0027 #include "Herwig/MatrixElement/Matchbox/Base/MergerBase.h"
0028 #include "Herwig/MatrixElement/Matchbox/Matching/ShowerApproximation.h"
0029
0030 #include "Herwig/Shower/Dipole/SpinCorrelations/DipoleVertexRecord.h"
0031 #include "Herwig/MatrixElement/Matchbox/Utility/DensityOperator.h"
0032
0033 #include <tuple>
0034
0035 namespace Herwig {
0036
0037 using namespace ThePEG;
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 class DipoleShowerHandler: public ShowerHandler {
0050
0051
0052 friend class Merger;
0053
0054 public:
0055
0056
0057
0058
0059 DipoleShowerHandler();
0060
0061 public:
0062
0063
0064 inline void colourPrint();
0065
0066
0067
0068
0069 struct RedoShower {};
0070
0071
0072
0073
0074 void addSplitting(Ptr<DipoleSplittingKernel>::ptr sp) {
0075 kernels.push_back(sp);
0076 }
0077
0078
0079
0080
0081 void resetAlphaS(Ptr<AlphaSBase>::tptr);
0082
0083
0084 virtual void cascade(tPVector);
0085
0086
0087
0088
0089 void resetReweight(Ptr<DipoleSplittingReweight>::tptr);
0090
0091
0092
0093
0094
0095 virtual bool canHandleMatchboxTrunc() const { return false; }
0096
0097
0098
0099
0100
0101 virtual bool isReshuffling() const { return false; }
0102
0103
0104
0105
0106 virtual Energy hardScale() const {
0107 return muPt;
0108 }
0109
0110
0111
0112
0113
0114 double as(Energy Q)const{return theGlobalAlphaS->value(sqr(Q));}
0115
0116
0117
0118
0119
0120
0121 double Nf(Energy Q)const{return theGlobalAlphaS->Nf(sqr(Q));}
0122
0123
0124
0125
0126 DipoleVertexRecord& vertexRecord() { return theVertexRecord; }
0127
0128
0129
0130
0131 const DipoleVertexRecord& vertexRecord() const { return theVertexRecord; }
0132
0133
0134
0135
0136
0137
0138 void setMerger(Ptr<MergerBase>::ptr mh){theMergingHelper=mh;}
0139
0140
0141
0142 public:
0143
0144
0145
0146
0147
0148 const map<PPtr,size_t>& particleIndices() const { return eventRecord().particleIndices(); }
0149
0150
0151
0152
0153
0154 const cPDVector& particlesAfter() const { return eventRecord().particlesAfter(); }
0155
0156
0157
0158
0159 DensityOperator& densityOperator() { return eventRecord().densityOperator(); }
0160
0161
0162
0163
0164
0165 const map<pair<vector<PDT::Colour>,pair<size_t,size_t> >,double>& correlatorMap() const {
0166 return eventRecord().densityOperator().correlatorMap();
0167 }
0168
0169
0170
0171
0172 Ptr<ColourBasis>::tptr colourBasis() {
0173 return eventRecord().densityOperator().colourBasis();
0174 }
0175
0176
0177
0178
0179 bool continueSubleadingNc() const { return eventRecord().getContinueSubleadingNc(); }
0180
0181 protected:
0182
0183
0184
0185
0186 void addCandidates(PPair particles, list<DipoleSplittingInfo>& clist) const;
0187
0188
0189
0190
0191 void getCandidates(list<DipoleSplittingInfo>& clist) const;
0192
0193
0194
0195
0196 void performSplitting(DipoleSplittingInfo&) const;
0197
0198
0199
0200
0201 Energy nextSubleadingSplitting(Energy hardPt,
0202 Energy optHardPt, Energy optCutoff,
0203 const bool decay);
0204
0205 protected:
0206
0207 typedef multimap<DipoleIndex,Ptr<DipoleSplittingGenerator>::ptr> GeneratorMap;
0208
0209
0210
0211
0212 virtual tPPair cascade(tSubProPtr sub, XCombPtr xcomb) {
0213 return cascade(sub,xcomb,ZERO,ZERO);
0214 }
0215
0216
0217
0218
0219 tPPair cascade(tSubProPtr sub, XCombPtr xcomb,
0220 Energy optHardPt, Energy optCutoff);
0221
0222
0223
0224
0225
0226 void getGenerators(const DipoleIndex&,
0227 Ptr<DipoleSplittingReweight>::tptr rw =
0228 Ptr<DipoleSplittingReweight>::tptr());
0229
0230
0231
0232
0233 void hardScales(Energy2 scale);
0234
0235
0236
0237
0238 void hardScalesSubleading(list<DipoleSplittingInfo> candidates,Energy hardPt);
0239
0240
0241
0242
0243 Ptr<DipoleEvolutionOrdering>::tptr evolutionOrdering() const { return theEvolutionOrdering; }
0244
0245
0246
0247
0248 void constituentReshuffle();
0249
0250
0251
0252
0253 void decayConstituentReshuffle( PerturbativeProcessPtr decayProc);
0254
0255
0256
0257
0258 GeneratorMap& generators() { return theGenerators; }
0259
0260
0261
0262
0263 DipoleEventRecord& eventRecord() { return theEventRecord; }
0264
0265
0266
0267
0268 const DipoleEventRecord& eventRecord() const { return theEventRecord; }
0269
0270
0271
0272
0273 const vector<Ptr<DipoleSplittingKernel>::ptr>& splittingKernels() const {
0274 return kernels;
0275 }
0276
0277
0278
0279
0280 const set<long>& offShellPartons() { return theColouredOffShellInShower; }
0281
0282
0283
0284
0285
0286 bool isMERegion(const Energy winnerScale,
0287 const DipoleSplittingInfo & winner,
0288 const list<Dipole>::iterator winnerDip);
0289
0290
0291
0292
0293
0294 bool realign();
0295
0296
0297
0298
0299 virtual int showerPhaseSpaceOption() const {
0300 return theZBoundaries;
0301 }
0302
0303 protected:
0304
0305
0306
0307
0308 void doCascade(unsigned int& emDone,
0309 Energy optHardPt = ZERO,
0310 Energy optCutoff = ZERO,
0311 const bool decay = false);
0312
0313
0314
0315 void setNEmissions(unsigned int n){nEmissions=n;}
0316
0317
0318
0319
0320
0321
0322 Energy getWinner(DipoleSplittingInfo& winner,
0323 const Dipole& dip,
0324 pair<bool,bool> conf,
0325 Energy optHardPt = ZERO,
0326 Energy optCutoff = ZERO);
0327
0328
0329
0330
0331
0332 Energy getWinner(DipoleSplittingInfo& winner,
0333 Energy optHardPt = ZERO,
0334 Energy optCutoff = ZERO);
0335
0336
0337
0338
0339
0340 Energy getWinner(SubleadingSplittingInfo& winner,
0341 Energy optHardPt = ZERO,
0342 Energy optCutoff = ZERO);
0343
0344
0345
0346
0347
0348 Energy getWinner(DipoleSplittingInfo& winner,
0349 const DipoleIndex& index,
0350 double emitterX, double spectatorX,
0351 pair<bool,bool> conf,
0352 tPPtr emitter, tPPtr spectator,
0353 Energy startScale,
0354 Energy optHardPt = ZERO,
0355 Energy optCutoff = ZERO);
0356
0357 public:
0358
0359
0360
0361
0362
0363
0364
0365 void persistentOutput(PersistentOStream & os) const;
0366
0367
0368
0369
0370
0371
0372 void persistentInput(PersistentIStream & is, int version);
0373
0374
0375
0376
0377
0378
0379
0380
0381 static void Init();
0382
0383 protected:
0384
0385
0386
0387
0388
0389
0390
0391 virtual IBPtr clone() const;
0392
0393
0394
0395
0396
0397 virtual IBPtr fullclone() const;
0398
0399
0400
0401
0402
0403
0404
0405 protected:
0406
0407
0408
0409
0410
0411
0412
0413
0414 virtual void doinit();
0415
0416
0417
0418
0419
0420 virtual void doinitrun();
0421
0422
0423
0424
0425
0426 virtual void dofinish();
0427
0428
0429
0430 private:
0431
0432
0433
0434
0435 vector<Ptr<DipoleSplittingKernel>::ptr> kernels;
0436
0437
0438
0439
0440 Ptr<DipoleEvolutionOrdering>::ptr theEvolutionOrdering;
0441
0442
0443
0444
0445 Ptr<ConstituentReshuffler>::ptr constituentReshuffler;
0446
0447
0448
0449
0450 Ptr<IntrinsicPtGenerator>::ptr intrinsicPtGenerator;
0451
0452
0453
0454
0455 Ptr<AlphaSBase>::ptr theGlobalAlphaS;
0456
0457
0458
0459
0460
0461 bool chainOrderVetoScales;
0462
0463
0464
0465
0466
0467 unsigned int nEmissions;
0468
0469
0470
0471
0472 bool discardNoEmissions;
0473
0474
0475
0476
0477 bool firstMCatNLOEmission;
0478
0479
0480
0481
0482 bool thePowhegDecayEmission;
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493 int realignmentScheme;
0494
0495
0496
0497
0498 bool doSubleadingNc;
0499
0500
0501
0502
0503 size_t subleadingNcEmissionsLimit;
0504
0505
0506
0507
0508
0509 int currentReferenceWeight;
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519 int densityOperatorEvolution;
0520
0521
0522
0523
0524
0525 Energy2 densityOperatorCutoff;
0526
0527
0528
0529
0530 bool doPartialUnweightingAtEmission;
0531
0532
0533
0534
0535 bool doPartialUnweighting;
0536
0537
0538
0539
0540 double referenceWeight;
0541
0542
0543
0544
0545 double cmecReweightFactor;
0546
0547
0548
0549
0550 double negCMECScaling;
0551
0552 private:
0553
0554
0555
0556
0557
0558
0559
0560
0561
0562
0563 int verbosity;
0564
0565
0566
0567
0568 int printEvent;
0569
0570 private:
0571
0572
0573
0574
0575
0576 GeneratorMap theGenerators;
0577
0578
0579
0580
0581 DipoleEventRecord theEventRecord;
0582
0583
0584
0585
0586 DipoleVertexRecord theVertexRecord;
0587
0588
0589
0590
0591 unsigned int nTries;
0592
0593
0594
0595
0596 bool didRadiate;
0597
0598
0599
0600
0601 bool didRealign;
0602
0603
0604
0605
0606
0607
0608 vector<vector<std::tuple<Energy,double,bool> > > theWeightsVector;
0609
0610
0611
0612
0613 size_t winnerIndex;
0614 size_t kernelIndex;
0615 size_t winningKernelIndex;
0616 vector<Energy> scales;
0617
0618 private:
0619
0620
0621
0622
0623 Energy theRenormalizationScaleFreeze;
0624
0625
0626
0627
0628 Energy theFactorizationScaleFreeze;
0629
0630
0631
0632
0633 Ptr<ShowerApproximation>::tptr theShowerApproximation;
0634
0635
0636
0637
0638 bool theDoCompensate;
0639
0640
0641
0642
0643
0644 unsigned long theFreezeGrid;
0645
0646
0647
0648
0649 double theDetuning;
0650
0651
0652
0653
0654 Ptr<DipoleEventReweight>::ptr theEventReweight;
0655
0656
0657
0658
0659 Ptr<DipoleSplittingReweight>::ptr theSplittingReweight;
0660
0661
0662
0663
0664 static bool firstWarn;
0665
0666
0667
0668
0669 Energy maxPt;
0670
0671
0672
0673
0674 Energy muPt;
0675
0676
0677
0678
0679
0680
0681
0682
0683 Ptr<MergerBase>::ptr theMergingHelper;
0684
0685
0686
0687
0688
0689
0690 set<long> theColouredOffShellInShower;
0691
0692
0693
0694
0695
0696 vector<long> theInputColouredOffShellInShower;
0697
0698
0699
0700
0701 int theZBoundaries;
0702
0703 private:
0704
0705
0706
0707
0708
0709 static ClassDescription<DipoleShowerHandler> initDipoleShowerHandler;
0710
0711
0712
0713
0714
0715 DipoleShowerHandler & operator=(const DipoleShowerHandler &) = delete;
0716
0717 };
0718
0719 }
0720
0721 #include "ThePEG/Utilities/ClassTraits.h"
0722
0723 namespace ThePEG {
0724
0725
0726
0727
0728
0729 template <>
0730 struct BaseClassTrait<Herwig::DipoleShowerHandler,1> {
0731
0732 typedef Herwig::ShowerHandler NthBase;
0733 };
0734
0735
0736
0737 template <>
0738 struct ClassTraits<Herwig::DipoleShowerHandler>
0739 : public ClassTraitsBase<Herwig::DipoleShowerHandler> {
0740
0741 static string className() { return "Herwig::DipoleShowerHandler"; }
0742
0743
0744
0745
0746
0747
0748
0749 static string library() { return "HwDipoleShower.so"; }
0750 };
0751
0752
0753
0754 }
0755
0756 #endif