File indexing completed on 2026-08-06 09:24:25
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef HERWIG_Merger_H
0010 #define HERWIG_Merger_H
0011
0012
0013
0014 #include "MergingFactory.fh"
0015 #include "Node.fh"
0016
0017
0018
0019 #include "ThePEG/Handlers/HandlerBase.h"
0020 #include "Herwig/Shower/Dipole/DipoleShowerHandler.h"
0021
0022 #include "Herwig/MatrixElement/Matchbox/Base/MergerBase.h"
0023
0024 #include "Herwig/MatrixElement/Matchbox/Phasespace/FFLightTildeKinematics.h"
0025 #include "Herwig/MatrixElement/Matchbox/Phasespace/IFLightTildeKinematics.h"
0026 #include "Herwig/MatrixElement/Matchbox/Phasespace/FFMassiveTildeKinematics.h"
0027 #include "Herwig/MatrixElement/Matchbox/Phasespace/IFMassiveTildeKinematics.h"
0028 #include "Herwig/MatrixElement/Matchbox/Phasespace/FILightTildeKinematics.h"
0029 #include "Herwig/MatrixElement/Matchbox/Phasespace/IILightTildeKinematics.h"
0030 #include "Herwig/MatrixElement/Matchbox/Phasespace/FIMassiveTildeKinematics.h"
0031
0032 #include "ThePEG/Cuts/JetFinder.h"
0033 #include "ThePEG/Cuts/Cuts.h"
0034
0035
0036
0037 namespace Herwig {
0038
0039 using namespace ThePEG;
0040
0041
0042 class Merger;
0043
0044 ThePEG_DECLARE_POINTERS(Merger , MergerPtr );
0045
0046 typedef vector<NodePtr> NodePtrVec;
0047
0048 struct HistoryStep {
0049
0050 NodePtr node;
0051
0052 double weight;
0053
0054 Energy scale;
0055 };
0056
0057 typedef vector< HistoryStep > History;
0058
0059 typedef multimap<DipoleIndex, Ptr<DipoleSplittingGenerator>::ptr> GeneratorMap2;
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095 class Merger: public MergerBase {
0096
0097 friend class MergingFactory;
0098 friend class Node;
0099
0100 public:
0101
0102
0103 bool matrixElementRegion(PVector incoming,
0104 PVector outgoing,
0105 Energy winnerScale = ZERO,
0106 Energy cutscale = ZERO)const;
0107
0108
0109 Energy mergingScale()const{return theMergePt;}
0110
0111 Energy mergePt()const {return theMergePt;}
0112
0113 int M()const;
0114
0115 int N()const;
0116
0117 int N0()const{return theN0;}
0118
0119 CrossSection MergingDSigDR();
0120
0121
0122 void setXComb( tStdXCombPtr );
0123
0124 void setKinematics();
0125
0126 void clearKinematics();
0127
0128 bool generateKinematics( const double * );
0129
0130 void flushCaches();
0131
0132 size_t maxLegs() const {return theCurrentMaxLegs;}
0133
0134 void setME(MatchboxMEBasePtr me){
0135 theCurrentME=me;
0136 assert(theFirstNodeMap.count(theCurrentME));
0137 theCurrentNode=theFirstNodeMap[theCurrentME];
0138 }
0139
0140 protected:
0141
0142 void N0(int n){ theN0=n;}
0143
0144 Ptr<ColourBasis>::ptr largeNBasis()const{return theLargeNBasis;}
0145
0146 void smearMergePt(){
0147 const double factor = 1. + (-1. + 2.*UseRandom::rnd() ) * smear();
0148 theMergePt = factor * centralMergePt();
0149 }
0150
0151 int openZBoundaries()const{return DSH()->showerPhaseSpaceOption();}
0152
0153 MatchboxMEBasePtr currentME() const { return theCurrentME; }
0154
0155 NodePtr currentNode() const { return theCurrentNode; }
0156
0157 private:
0158
0159 double singlesudakov(Dipole, Energy, Energy, pair<bool, bool>);
0160
0161
0162 bool dosudakov(NodePtr Born, Energy running, Energy next, double& sudakov0_n);
0163
0164 void cleanup(NodePtr);
0165
0166
0167 bool isProjectorStage( NodePtr , int )const;
0168
0169
0170
0171
0172
0173
0174 Energy CKKW_StartScale(NodePtr) const;
0175
0176 void CKKW_PrepareSudakov(NodePtr, Energy);
0177
0178 double Nf(Energy scale)const{return DSH()->Nf(scale);}
0179
0180 MergingFactoryPtr treefactory() const;
0181
0182 map<MatchboxMEBasePtr, NodePtr> firstNodeMap() const ;
0183
0184 void mergePt(Energy x) {theMergePt = x;}
0185
0186 Energy centralMergePt() const {return theCentralMergePt;}
0187
0188 private:
0189
0190 CrossSection MergingDSigDRBornStandard();
0191
0192 CrossSection MergingDSigDRVirtualStandard();
0193
0194
0195
0196
0197 CrossSection MergingDSigDRRealStandard();
0198
0199
0200
0201 CrossSection MergingDSigDRRealAllAbove();
0202
0203
0204
0205 CrossSection MergingDSigDRRealBelowSubReal();
0206
0207
0208
0209 CrossSection MergingDSigDRRealBelowSubInt();
0210
0211 size_t maxLegsLO() const {return N0()+N();}
0212
0213 CrossSection TreedSigDR(Energy startscale);
0214
0215 Energy fillProjector(int);
0216
0217 void fillHistory(Energy, NodePtr, NodePtr );
0218
0219 double pdfratio(NodePtr, Energy, Energy, int, bool fromIsME, bool toIsME);
0220
0221 double pdfReweight();
0222
0223 double alphaReweight(bool nocmw=false);
0224
0225 size_t maxLegsNLO()const {return N0()+M();}
0226
0227 CrossSection LoopdSigDR(Energy startscale );
0228
0229 double sumPdfReweightExpansion()const;
0230
0231 double sumAlphaSReweightExpansion()const;
0232
0233 double sumFillHistoryExpansion();
0234
0235 double alphasExpansion( Energy next, Energy fixedScale)const;
0236
0237 double pdfExpansion(NodePtr, int, Energy, Energy, double, int, Energy)const;
0238
0239 bool doHistExpansion(NodePtr Born, Energy running, Energy next, Energy fixedScale, double& HistExpansion);
0240
0241 double singleHistExpansion(Dipole, Energy, Energy, Energy, pair<bool, bool>);
0242
0243 double as(Energy q)const{return DSH()->as(q);}
0244
0245 void setFactory(MergingFactoryPtr f){theTreeFactory=f;}
0246
0247 void setDipoleShower(DipoleShowerHandlerPtr dsh){theDipoleShowerHandler=dsh;}
0248
0249 DipoleShowerHandlerPtr DSH(){return theDipoleShowerHandler;}
0250
0251 cDipoleShowerHandlerPtr DSH()const{return theDipoleShowerHandler;}
0252
0253 void firstNodeMap(MatchboxMEBasePtr, NodePtr);
0254
0255 int chooseHistory()const {return theChooseHistory;}
0256
0257 double smear()const{return theSmearing;}
0258
0259 void largeNBasis(Ptr<ColourBasis>::ptr x){theLargeNBasis=x;}
0260
0261 bool notOnlyMulti()const;
0262
0263 double cmwAlphaS(Energy q)const;
0264
0265 void debugVirt(double, double, double, double, CrossSection,
0266 double, double, double, NodePtr,CrossSection) const;
0267
0268 void debugReal( string, double, CrossSection, CrossSection) const;
0269
0270 private:
0271
0272
0273 unsigned int theShowerExpansionWeights = 2;
0274
0275 unsigned int theCMWScheme = 0;
0276
0277 bool projected = true;
0278
0279 bool isUnitarized = true;
0280
0281 bool isNLOUnitarized = true;
0282
0283 int theChooseHistory = 0;
0284
0285 int theN0 = 0;
0286
0287 int theOnlyN = -1;
0288
0289 int theCurrentMaxLegs = -1;
0290
0291 double theSmearing = 0.;
0292
0293 Energy theIRSafePT = 1_GeV;
0294
0295 Energy theMergePt = 4_GeV;
0296
0297 Energy theCentralMergePt = 4_GeV;
0298
0299
0300 double theRealSubtractionRatio=3.;
0301
0302 History history;
0303
0304 Ptr<ColourBasis>::ptr theLargeNBasis;
0305
0306 NodePtr theCurrentNode;
0307
0308 MatchboxMEBasePtr theCurrentME;
0309
0310 Ptr<FFLightTildeKinematics>::ptr FFLTK = new_ptr( FFLightTildeKinematics() );
0311 Ptr<FILightTildeKinematics>::ptr FILTK = new_ptr( FILightTildeKinematics() );
0312 Ptr<IFLightTildeKinematics>::ptr IFLTK = new_ptr( IFLightTildeKinematics() );
0313 Ptr<IILightTildeKinematics>::ptr IILTK = new_ptr( IILightTildeKinematics() );
0314 Ptr<FFMassiveTildeKinematics>::ptr FFMTK = new_ptr( FFMassiveTildeKinematics() );
0315 Ptr<FIMassiveTildeKinematics>::ptr FIMTK = new_ptr( FIMassiveTildeKinematics() );
0316 Ptr<IFMassiveTildeKinematics>::ptr IFMTK = new_ptr( IFMassiveTildeKinematics() );
0317
0318 DipoleShowerHandlerPtr theDipoleShowerHandler;
0319
0320 MergingFactoryPtr theTreeFactory;
0321
0322 map<MatchboxMEBasePtr, NodePtr> theFirstNodeMap;
0323
0324 map<NodePtr, CrossSection> theHighMeWeightMap;
0325
0326 protected:
0327
0328
0329
0330
0331
0332
0333
0334
0335 virtual void doinit();
0336
0337
0338
0339
0340 public:
0341
0342
0343
0344
0345
0346
0347
0348 void persistentOutput(PersistentOStream & os) const;
0349
0350
0351
0352
0353
0354
0355 void persistentInput(PersistentIStream & is, int version);
0356
0357
0358
0359
0360
0361
0362
0363
0364 static void Init();
0365
0366 protected:
0367
0368
0369
0370
0371
0372
0373
0374 virtual IBPtr clone() const;
0375
0376
0377
0378
0379
0380 virtual IBPtr fullclone() const;
0381
0382
0383
0384
0385
0386
0387
0388 private:
0389
0390
0391
0392
0393
0394
0395
0396 Merger & operator=(const Merger &) = delete;
0397
0398 };
0399
0400 }
0401
0402
0403
0404 #endif