File indexing completed on 2026-08-06 09:24:08
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef HERWIG_GeneralHardME_H
0010 #define HERWIG_GeneralHardME_H
0011
0012
0013
0014
0015 #include "Herwig/MatrixElement/HwMEBase.h"
0016 #include "ThePEG/Utilities/Exception.h"
0017 #include "ThePEG/Persistency/PersistentOStream.h"
0018 #include "ThePEG/Persistency/PersistentIStream.h"
0019 #include "Herwig/Models/General/HPDiagram.h"
0020 #include "Herwig/MatrixElement/ProductionMatrixElement.h"
0021 #include "Herwig/MatrixElement/HardVertex.h"
0022 #include "ThePEG/EventRecord/SpinInfo.h"
0023 #include "ThePEG/PDF/PolarizedBeamParticleData.h"
0024 #include "GeneralHardME.fh"
0025
0026 namespace Herwig {
0027 using namespace ThePEG;
0028 using Helicity::VertexBasePtr;
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 class GeneralHardME: public HwMEBase {
0041
0042 public:
0043
0044
0045
0046
0047 typedef vector<HPDiagram>::size_type HPCount;
0048
0049
0050
0051
0052 enum ColourStructure {UNDEFINED,
0053 Colour11to11,Colour11to33bar,Colour11to88,
0054 Colour33to33,Colour33barto11,Colour33barto33bar,
0055 Colour33barto66bar, Colour33barto6bar6,
0056 Colour33to61, Colour3bar3barto6bar1,
0057 Colour33to16, Colour3bar3barto16bar,
0058 Colour38to3bar6, Colour38to63bar,
0059 Colour33barto18,Colour33barto81,Colour33barto88,
0060 Colour38to13,Colour38to31,
0061 Colour38to83,Colour38to38,
0062 Colour3bar3barto3bar3bar,
0063 Colour3bar8to13bar,Colour3bar8to3bar1,
0064 Colour3bar8to83bar,Colour3bar8to3bar8,
0065 Colour88to11,Colour88to33bar,
0066 Colour88to66bar,Colour88to88,
0067 Colour88to18,Colour88to81,
0068 Colour33to13bar,Colour33to3bar1,
0069 Colour33to83bar,Colour33to3bar8,
0070 Colour3bar3barto13,Colour3bar3barto31,
0071 Colour3bar3barto83,Colour3bar3barto38,
0072 Colour38to3bar3bar,Colour3bar8to33};
0073
0074 public:
0075
0076
0077
0078
0079 GeneralHardME();
0080
0081 public:
0082
0083
0084
0085
0086
0087
0088
0089 virtual unsigned int orderInAlphaS() const;
0090
0091
0092
0093
0094
0095 virtual unsigned int orderInAlphaEW() const;
0096
0097
0098
0099
0100
0101
0102
0103
0104 virtual double me2() const = 0;
0105
0106
0107
0108
0109 virtual Energy2 scale() const {
0110 if(scaleChoice_==0) {
0111 return scaleFactor_*sHat();
0112 }
0113 else if(scaleChoice_==1) {
0114 Energy2 mbar = 0.5*(meMomenta()[2].mass2()+meMomenta()[3].mass2());
0115 Energy2 t = 0.5*(tHat()-mbar);
0116 Energy2 u = 0.5*(uHat()-mbar);
0117 Energy2 s = 0.5*sHat();
0118 return scaleFactor_*4.*s*t*u/(s*s+t*t+u*u);
0119 }
0120 else if(scaleChoice_ ==2) {
0121 Energy2 scale1 = meMomenta()[2].mass2()+meMomenta()[2].perp2();
0122 Energy2 scale2 = meMomenta()[3].mass2()+meMomenta()[3].perp2();
0123 return scaleFactor_*max(scale1,scale2);
0124 }
0125 else {
0126 assert(false);
0127 return ZERO;
0128 }
0129 }
0130
0131
0132
0133
0134 virtual void getDiagrams() const;
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 virtual Selector<DiagramIndex>
0145 diagrams(const DiagramVector & dv) const;
0146
0147
0148
0149
0150
0151
0152
0153
0154 virtual Selector<const ColourLines *>
0155 colourGeometries(tcDiagPtr diag) const;
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169 void setProcessInfo(const vector<HPDiagram> & process,
0170 ColourStructure colour, bool debug,
0171 unsigned int scaleOption,
0172 double scaleFactor);
0173
0174 public:
0175
0176
0177
0178
0179
0180
0181
0182 void persistentOutput(PersistentOStream & os) const;
0183
0184
0185
0186
0187
0188
0189 void persistentInput(PersistentIStream & is, int version);
0190
0191
0192
0193
0194
0195
0196
0197
0198 static void Init();
0199
0200 protected:
0201
0202
0203
0204
0205
0206
0207
0208 virtual void doinitrun();
0209
0210
0211 protected:
0212
0213
0214
0215
0216
0217 virtual void debug(double ) const {}
0218
0219 protected:
0220
0221
0222
0223
0224
0225 const vector<HPDiagram> & getProcessInfo() const {
0226 return diagrams_;
0227 }
0228
0229
0230
0231
0232
0233 pair<long, long> getIncoming() const {
0234 return incoming_;
0235 }
0236
0237
0238
0239
0240
0241 pair<long, long> getOutgoing() const {
0242 return outgoing_;
0243 }
0244
0245
0246
0247
0248 const vector<DVector> & getColourFactors() const {
0249 return colour_;
0250 }
0251
0252
0253
0254
0255 HPCount numberOfDiags() const {
0256 return numberOfDiagrams_;
0257 }
0258
0259
0260
0261
0262 size_t numberOfFlows() const {
0263 return numberOfFlows_;
0264 }
0265
0266
0267
0268
0269 bool debugME() const {
0270 return debug_;
0271 }
0272
0273
0274
0275
0276
0277
0278
0279
0280 unsigned int colourFlow() const {return flow_;}
0281
0282
0283
0284
0285 void colourFlow(unsigned int flow) const {flow_=flow;}
0286
0287
0288
0289
0290 unsigned int diagram() const {return diagram_;}
0291
0292
0293
0294
0295 void diagram(unsigned int diag) const {diagram_=diag;}
0296
0297
0298
0299
0300
0301 double selectColourFlow(vector<double> & flow,
0302 vector<double> & me,double average) const;
0303
0304
0305
0306
0307 vector<ProductionMatrixElement> & flowME() const {
0308 return flowME_;
0309 }
0310
0311
0312
0313
0314 vector<ProductionMatrixElement> & diagramME() const {
0315 return diagramME_;
0316 }
0317
0318
0319
0320
0321 ColourStructure colour() const {return colourStructure_;}
0322
0323
0324
0325
0326 ParticleVector hardParticles(tSubProPtr subp) {
0327 ParticleVector output(4);
0328 output[0] = subp->incoming().first;
0329 output[1] = subp->incoming().second;
0330 output[2] = subp->outgoing()[0];
0331 output[3] = subp->outgoing()[1];
0332
0333
0334 if( output[0]->id() != getIncoming().first )
0335 swap(output[0], output[1]);
0336 if( output[2]->id() != getOutgoing().first )
0337 swap(output[2], output[3]);
0338
0339 return output;
0340 }
0341
0342
0343
0344
0345 void setRescaledMomenta(const ParticleVector & external) {
0346 cPDVector data(4);
0347 vector<Lorentz5Momentum> momenta(4);
0348 for( size_t i = 0; i < 4; ++i ) {
0349 data[i] = external[i]->dataPtr();
0350 momenta[i] = external[i]->momentum();
0351 }
0352 rescaleMomenta(momenta, data);
0353 }
0354
0355
0356
0357
0358 void createVertex(ProductionMatrixElement & me,
0359 ParticleVector & external) {
0360 HardVertexPtr hardvertex = new_ptr(HardVertex());
0361 hardvertex->ME(me);
0362 for(ParticleVector::size_type i = 0; i < 4; ++i) {
0363 tSpinPtr spin = external[i]->spinInfo();
0364 if(i<2) {
0365 tcPolarizedBeamPDPtr beam =
0366 dynamic_ptr_cast<tcPolarizedBeamPDPtr>(external[i]->dataPtr());
0367 if(beam) spin->rhoMatrix() = beam->rhoMatrix();
0368 }
0369 spin->productionVertex(hardvertex);
0370 }
0371 }
0372
0373
0374
0375
0376 void initializeMatrixElements(PDT::Spin in1, PDT::Spin in2,
0377 PDT::Spin out1, PDT::Spin out2) {
0378 flowME().resize(numberOfFlows(),
0379 ProductionMatrixElement(in1,in2,out1,out2));
0380 diagramME().resize(numberOfDiags(),
0381 ProductionMatrixElement(in1,in2,out1,out2));
0382 }
0383
0384 private:
0385
0386
0387
0388
0389
0390 GeneralHardME & operator=(const GeneralHardME &) = delete;
0391
0392 private:
0393
0394
0395
0396
0397
0398
0399
0400
0401 pair<long, long> incoming_;
0402
0403
0404
0405
0406 pair<long, long> outgoing_;
0407
0408
0409
0410
0411
0412
0413
0414
0415
0416 vector<HPDiagram> diagrams_;
0417
0418
0419
0420
0421 HPCount numberOfDiagrams_;
0422
0423
0424
0425
0426
0427
0428
0429
0430
0431 ColourStructure colourStructure_;
0432
0433
0434
0435
0436 vector<DVector> colour_;
0437
0438
0439
0440
0441 unsigned int numberOfFlows_;
0442
0443
0444
0445
0446
0447 bool debug_;
0448
0449
0450
0451
0452 unsigned int scaleChoice_;
0453
0454
0455
0456
0457 double scaleFactor_;
0458
0459
0460
0461
0462
0463
0464
0465
0466 mutable unsigned int flow_;
0467
0468
0469
0470
0471 mutable unsigned int diagram_;
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481 mutable vector<ProductionMatrixElement> flowME_;
0482
0483
0484
0485
0486 mutable vector<ProductionMatrixElement> diagramME_;
0487
0488
0489 };
0490
0491
0492
0493 class MEException : public Exception {};
0494
0495 }
0496
0497 #endif