File indexing completed on 2026-08-06 09:24:26
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef HERWIG_ShowerTree_H
0010 #define HERWIG_ShowerTree_H
0011
0012 #include "ThePEG/Config/ThePEG.h"
0013 #include "Herwig/Shower/ShowerHandler.fh"
0014 #include "Herwig/Shower/PerturbativeProcess.h"
0015 #include "Herwig/Shower/RealEmissionProcess.h"
0016 #include "Herwig/Shower/ShowerEventRecord.h"
0017 #include "Herwig/Shower/QTilde/ShowerConfig.h"
0018 #include "Herwig/Shower/QTilde/Base/ShowerParticle.h"
0019 #include "Herwig/Shower/QTilde/Base/ShowerProgenitor.h"
0020 #include "ThePEG/EventRecord/Step.h"
0021 #include <cassert>
0022 #include "ShowerTree.fh"
0023
0024 namespace Herwig {
0025
0026
0027
0028
0029 typedef multimap<Energy,ShowerTreePtr,std::greater<Energy> > ShowerDecayMap;
0030
0031 using namespace ThePEG;
0032
0033
0034
0035
0036
0037
0038
0039
0040 class ShowerTree : public ShowerEventRecord {
0041
0042 friend class QTildeShowerHandler;
0043
0044 public:
0045
0046
0047
0048
0049
0050 ShowerTree(PerturbativeProcessPtr process);
0051
0052
0053
0054
0055
0056 static Lorentz5Distance spaceTimeDistance(tPPtr particle);
0057
0058
0059
0060
0061
0062
0063
0064
0065 static void constructTrees(ShowerTreePtr & hardTree,
0066 ShowerDecayMap & decayTrees,
0067 PerturbativeProcessPtr hard,
0068 DecayProcessMap decay);
0069
0070 public:
0071
0072
0073
0074
0075
0076
0077
0078 void fillEventRecord(StepPtr pstep,bool ISR,bool FSR) {
0079 if(_wasHard)
0080 insertHard (pstep,ISR,FSR);
0081 else
0082 insertDecay(pstep,ISR,FSR);
0083 }
0084
0085
0086
0087
0088
0089
0090 void setParents();
0091
0092
0093
0094
0095
0096
0097
0098
0099 bool isHard() const { return _wasHard; }
0100
0101
0102
0103
0104
0105 bool isDecay() const { return !_wasHard; }
0106
0107
0108
0109
0110
0111 map<ShowerProgenitorPtr,ShowerParticlePtr> & incomingLines() {
0112 return _incomingLines;
0113 }
0114
0115
0116
0117
0118 map<ShowerProgenitorPtr,tShowerParticlePtr> & outgoingLines() {
0119 return _outgoingLines;
0120 }
0121
0122
0123
0124
0125 void updateFinalStateShowerProduct(ShowerProgenitorPtr progenitor,
0126 ShowerParticlePtr parent,
0127 const ShowerParticleVector & children);
0128
0129
0130
0131
0132 void updateInitialStateShowerProduct(ShowerProgenitorPtr progenitor,
0133 ShowerParticlePtr newParent);
0134
0135
0136
0137
0138 tShowerParticlePtr getFinalStateShowerProduct(ShowerProgenitorPtr progenitor) {
0139 return _outgoingLines.find(progenitor)==_outgoingLines.end()
0140 ? tShowerParticlePtr() : _outgoingLines[progenitor];
0141 }
0142
0143
0144
0145
0146
0147
0148
0149 void addFinalStateBranching(ShowerParticlePtr parent,
0150 const ShowerParticleVector & children);
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160 void addInitialStateBranching(ShowerParticlePtr oldParent,
0161 ShowerParticlePtr newParent,
0162 ShowerParticlePtr otherChild);
0163
0164
0165
0166
0167
0168
0169
0170 void updateAfterShower(ShowerDecayMap & decay);
0171
0172
0173
0174
0175
0176
0177
0178
0179 bool hasShowered() const { return _hasShowered; }
0180
0181
0182
0183
0184 void hasShowered(bool in) { _hasShowered=in; }
0185
0186
0187
0188
0189
0190 ShowerTreePtr parent() const { return _parent; }
0191
0192
0193
0194
0195
0196 void clear();
0197
0198
0199
0200
0201
0202 void resetShowerProducts();
0203
0204
0205
0206
0207 void setVetoes(const map<ShowerInteraction,Energy> & pTs,
0208 unsigned int type);
0209
0210
0211
0212
0213 vector<ShowerProgenitorPtr> extractProgenitors();
0214
0215
0216
0217
0218 const set<tShowerParticlePtr> & forwardParticles() const { return _forward; }
0219
0220
0221
0222
0223
0224 const map<tShowerTreePtr,pair<tShowerProgenitorPtr,tShowerParticlePtr> > &
0225 treelinks() const {return _treelinks;}
0226
0227
0228
0229
0230 void updateLink(tShowerTreePtr tree,
0231 pair<tShowerProgenitorPtr,tShowerParticlePtr> in) {
0232 _treelinks[tree] = in;
0233 }
0234
0235
0236
0237
0238 void transform(const LorentzRotation & rot, bool applyNow);
0239
0240
0241
0242
0243 void applyTransforms();
0244
0245
0246
0247
0248 void clearTransforms();
0249
0250
0251
0252
0253 const LorentzRotation & transform() {return _transforms;}
0254
0255
0256
0257
0258 vector<ShowerParticlePtr> extractProgenitorParticles();
0259
0260
0261
0262
0263 void checkMomenta();
0264
0265
0266
0267
0268 void update(PerturbativeProcessPtr newProcess);
0269
0270
0271
0272
0273 RealEmissionProcessPtr perturbativeProcess();
0274
0275 protected:
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287 void insertHard(StepPtr pstep,bool ISR,bool FSR);
0288
0289
0290
0291
0292
0293
0294
0295 void insertDecay(StepPtr pstep,bool ISR,bool FSR);
0296
0297
0298
0299
0300
0301
0302 void addFinalStateShower(PPtr particle, StepPtr step);
0303
0304
0305
0306
0307
0308
0309
0310
0311 void addInitialStateShower(PPtr particle, PPtr hadron,
0312 StepPtr step, bool addchildren=true);
0313
0314
0315
0316
0317
0318
0319
0320 void fixColour(tShowerParticlePtr part);
0321
0322 private:
0323
0324
0325
0326 PPair _incoming;
0327
0328
0329
0330
0331
0332
0333 map<ShowerProgenitorPtr,ShowerParticlePtr> _incomingLines;
0334
0335
0336
0337
0338
0339
0340 map<ShowerProgenitorPtr,tShowerParticlePtr> _outgoingLines;
0341
0342
0343
0344
0345 set<tShowerParticlePtr> _forward;
0346
0347
0348
0349
0350 bool _wasHard;
0351
0352
0353
0354
0355
0356 map<tShowerTreePtr,pair<tShowerProgenitorPtr,tShowerParticlePtr> > _treelinks;
0357
0358
0359
0360
0361 tShowerTreePtr _parent;
0362
0363
0364
0365
0366 bool _hasShowered;
0367
0368
0369
0370
0371 LorentzRotation _transforms;
0372
0373 private:
0374
0375
0376
0377
0378 static bool _spaceTime;
0379
0380
0381
0382
0383 static Energy2 _vmin2;
0384
0385 };
0386 }
0387
0388 #endif