File indexing completed on 2026-08-06 09:24:01
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef HERWIG_GeneralTwoBodyDecayer_H
0010 #define HERWIG_GeneralTwoBodyDecayer_H
0011
0012
0013
0014
0015 #include "Herwig/Decay/PerturbativeDecayer.h"
0016 #include "Herwig/Decay/PhaseSpaceMode.h"
0017 #include "ThePEG/Helicity/Vertex/VertexBase.h"
0018 #include "GeneralTwoBodyDecayer.fh"
0019
0020 namespace Herwig {
0021 using namespace ThePEG;
0022 using Helicity::VertexBasePtr;
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 class GeneralTwoBodyDecayer: public PerturbativeDecayer {
0039
0040 public:
0041
0042
0043 typedef pair<tcPDPtr, Energy> PMPair;
0044
0045 public:
0046
0047
0048
0049
0050 GeneralTwoBodyDecayer() : maxWeight_(1.), colour_(1,DVector(1,1.))
0051 {}
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 virtual ParticleVector decay(const Particle & parent,
0063 const tPDVector & children) const;
0064
0065
0066
0067
0068
0069
0070
0071 virtual int modeNumber(bool & cc, tcPDPtr parent,const tPDVector & children) const;
0072
0073
0074
0075
0076
0077
0078
0079 virtual Energy partialWidth(PMPair inpart, PMPair outa,
0080 PMPair outb) const;
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092 virtual bool twoBodyMEcode(const DecayMode & dm, int & mecode,
0093 double & coupling) const;
0094
0095
0096
0097
0098
0099
0100
0101
0102 virtual double brat(const DecayMode & dm, const Particle & p,
0103 double oldbrat) const;
0104
0105
0106
0107
0108
0109 virtual void setDecayInfo(PDPtr incoming, PDPair outgoing,
0110 vector<VertexBasePtr>,
0111 map<ShowerInteraction,VertexBasePtr> &,
0112 const vector<map<ShowerInteraction,VertexBasePtr> > &,
0113 map<ShowerInteraction,VertexBasePtr>) =0;
0114
0115 protected:
0116
0117
0118
0119
0120
0121
0122
0123 void setWeight(double wgt) { maxWeight_ = wgt; }
0124
0125
0126
0127
0128
0129
0130
0131 void colourConnections(const Particle & parent,
0132 const ParticleVector & out) const;
0133
0134
0135
0136
0137 double colourFactor(tcPDPtr in, tcPDPtr out1, tcPDPtr out2) const;
0138
0139
0140
0141
0142 double matrixElementRatio(const Particle & inpart, const ParticleVector & decay2,
0143 const ParticleVector & decay3, MEOption meopt,
0144 ShowerInteraction inter);
0145
0146
0147
0148
0149 void decayInfo(PDPtr incoming, PDPair outgoing);
0150
0151
0152 public:
0153
0154
0155
0156
0157
0158
0159
0160 void persistentOutput(PersistentOStream & os) const;
0161
0162
0163
0164
0165
0166
0167 void persistentInput(PersistentIStream & is, int version);
0168
0169
0170
0171
0172
0173
0174
0175
0176 static void Init();
0177
0178 protected:
0179
0180
0181
0182
0183
0184
0185
0186
0187 virtual void doinit();
0188
0189
0190
0191
0192
0193 virtual void doinitrun();
0194
0195
0196 protected:
0197
0198
0199
0200
0201
0202
0203
0204
0205 typedef vector<pair<int,double > > CFlowPairVec;
0206 typedef vector<CFlowPairVec> CFlow;
0207
0208 const vector<DVector> & getColourFactors(const Particle & inpart,
0209 const ParticleVector & decay,
0210 unsigned int & nflow);
0211
0212 const CFlow & colourFlows(const Particle & inpart,
0213 const ParticleVector & decay);
0214
0215
0216
0217
0218 virtual double threeBodyME(const int , const Particle & inpart,
0219 const ParticleVector & decay,
0220 ShowerInteraction inter, MEOption meopt);
0221
0222
0223
0224 private:
0225
0226
0227
0228
0229
0230 GeneralTwoBodyDecayer & operator=(const GeneralTwoBodyDecayer &) = delete;
0231
0232 private:
0233
0234
0235
0236
0237 PDPtr incoming_;
0238
0239
0240
0241
0242 vector<PDPtr> outgoing_;
0243
0244
0245
0246
0247 double maxWeight_;
0248
0249
0250
0251
0252 vector<DVector> colour_;
0253
0254 };
0255
0256
0257
0258
0259
0260 template<typename T, typename Cmp, typename A>
0261 inline PersistentOStream & operator<<(PersistentOStream & os,
0262 const map<ShowerInteraction,T,Cmp,A> & m) {
0263 os << m.size();
0264 if(m.find(ShowerInteraction::QCD)!=m.end()) {
0265 os << 0 << m.at(ShowerInteraction::QCD);
0266 }
0267 if(m.find(ShowerInteraction::QED)!=m.end()) {
0268 os << 1 << m.at(ShowerInteraction::QED);
0269 }
0270 return os;
0271 }
0272
0273
0274
0275
0276 template <typename T, typename Cmp, typename A>
0277 inline PersistentIStream & operator>>(PersistentIStream & is, map<ShowerInteraction,T,Cmp,A> & m) {
0278 m.clear();
0279 long size;
0280 int k;
0281 is >> size;
0282 while ( size-- && is ) {
0283 is >> k;
0284 if(k==0)
0285 is >> m[ShowerInteraction::QCD];
0286 else if(k==1)
0287 is >> m[ShowerInteraction::QED];
0288 else
0289 assert(false);
0290 }
0291 return is;
0292 }
0293 }
0294
0295 #endif