herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
FFDipole.h
1 // -*- C++ -*-
2 //
3 // FFDipole.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef HERWIG_FFDipole_H
10 #define HERWIG_FFDipole_H
11 //
12 // This is the declaration of the FFDipole class.
13 //
14 
15 #include "ThePEG/Repository/EventGenerator.h"
16 #include "Herwig/Decay/DecayIntegrator.fh"
17 #include "Herwig/Utilities/Kinematics.h"
18 #include "Herwig/Utilities/Maths.h"
19 #include "ThePEG/StandardModel/StandardModelBase.h"
20 #include "ThePEG/Vectors/Lorentz5Vector.h"
21 #include "ThePEG/Interface/Interfaced.h"
22 #include "FFDipole.fh"
23 
24 namespace Herwig {
25 using namespace ThePEG;
27 
38 class FFDipole: public Interfaced {
39 
40 public:
41 
46  _emin(1.e-6*MeV), _eminrest(100*MeV), _eminlab(100*MeV), _emax(),
47  _multiplicity(), _m(3), _charge(), _qdrf(2),
48  _qnewdrf(2), _qprf(2), _qnewprf(2), _qlab(2), _qnewlab(2), _dipolewgt(),
49  _yfswgt(), _jacobianwgt(), _mewgt(), _maxwgt(7.0), _mode(1), _maxtry(500),
50  _energyopt(1), _betaopt(4), _dipoleopt(), _nweight(0), _wgtsum(0.), _wgtsq(0.),
51  _weightOutput(false) {}
52 
56  virtual ~FFDipole();
57 
58 public:
59 
67  virtual ParticleVector generatePhotons(const Particle & p,
68  ParticleVector children,
69  tDecayIntegratorPtr decayer);
70 
71 public:
72 
79  void persistentOutput(PersistentOStream & os) const;
80 
86  void persistentInput(PersistentIStream & is, int version);
88 
95  static void Init();
96 
97 protected:
98 
105  virtual IBPtr clone() const {return new_ptr(*this);}
106 
111  virtual IBPtr fullclone() const {return new_ptr(*this);}
113 
114 protected:
115 
126  double photon(double beta1,double ombeta1, double beta2, double ombeta2);
127 
137  double exactDipoleWeight(double beta1,double ombeta1,
138  double beta2,double ombeta2,unsigned int iphot) {
139  double opbc,ombc;
140  // if cos is greater than zero use result accurate as cos->1
141  if(_cosphot[iphot]>0) {
142  opbc=1.+beta2*_cosphot[iphot];
143  ombc=ombeta1+beta1*sqr(_sinphot[iphot])/(1.+_cosphot[iphot]);
144  }
145  // if cos is less than zero use result accurate as cos->-1
146  else {
147  opbc=ombeta2+beta2*sqr(_sinphot[iphot])/(1.-_cosphot[iphot]);
148  ombc=1.-beta1*_cosphot[iphot];
149  }
150  return 0.5/(opbc*ombc)*(1.+beta1*beta2
151  -0.5*ombeta1*(1.+beta1)*opbc/ombc
152  -0.5*ombeta2*(1.+beta2)*ombc/opbc);
153  }
154 
158  double jacobianWeight() {
159  Energy pcm1=Kinematics::pstarTwoBodyDecay(_m[0],_m[1],_m[2]);
160  Energy m12 =sqrt((_qnewdrf[0]+_qnewdrf[1]).m2()) ;
161  Energy pcm2=Kinematics::pstarTwoBodyDecay(m12,_m[1],_m[2]) ;
162  double betaprobeta = pcm2*_m[0]/pcm1/m12 ;
163  double spros = sqr(m12/_m[0]) ;
164  double deltafn = m12/(m12+_bigLdrf.e());
165  return betaprobeta*spros*deltafn ;
166  }
167 
171  double meWeight(const ParticleVector & children);
172 
179  double makePhotons(const Boost & boost,
180  const ParticleVector & children);
181 
188  bool boostMomenta(const Boost & boost);
189 
194  unsigned int removePhotons();
195 
199  double collinearWeight(const ParticleVector & children);
200 
204  double virtualWeight(const ParticleVector & children);
205 
206 protected:
207 
214  virtual void dofinish();
216 
217 private:
218 
223  FFDipole & operator=(const FFDipole &) = delete;
224 
225 private:
226 
230  void printDebugInfo(const Particle & p,
231  const ParticleVector & children,
232  double wgt) const;
233 
234 private:
235 
239  Energy _emin;
240 
244  Energy _eminrest;
245 
249  Energy _eminlab;
250 
254  Energy _emax;
255 
259  unsigned int _multiplicity;
260 
264  vector<Energy> _m;
265 
269  double _charge;
270 
278  vector<Lorentz5Momentum> _qdrf;
279 
282  vector<Lorentz5Momentum> _qnewdrf;
283 
287  vector<Lorentz5Momentum> _ldrf;
288 
292  Lorentz5Momentum _bigLdrf;
294 
302  vector<Lorentz5Momentum> _qprf;
303 
307  vector<Lorentz5Momentum> _qnewprf;
308 
312  vector<Lorentz5Momentum> _lprf;
313 
317  Lorentz5Momentum _bigLprf;
319 
327  vector<Lorentz5Momentum> _qlab;
328 
332  vector<Lorentz5Momentum> _qnewlab;
333 
337  vector<Lorentz5Momentum> _llab;
338 
342  Lorentz5Momentum _bigLlab;
344 
345 
354  double _dipolewgt;
355 
359  double _yfswgt;
360 
364  double _jacobianwgt;
365 
369  double _mewgt;
370 
374  double _maxwgt;
376 
385  vector<double> _cosphot;
386 
390  vector<double> _sinphot;
392 
396  vector<double> _photonwgt;
397 
401  vector<bool> _photcut;
402 
406  unsigned int _mode;
407 
411  unsigned int _maxtry;
412 
416  unsigned int _energyopt;
417 
421  unsigned int _betaopt;
422 
426  unsigned int _dipoleopt;
427 
431  tDecayIntegratorPtr _decayer;
432 
437 
445  unsigned int _nweight;
446 
450  double _wgtsum;
451 
455  double _wgtsq;
456 
462 };
463 
464 }
465 
466 #endif /* HERWIG_FFDipole_H */
double _yfswgt
Reweighting factor for the YFS form-factor.
Definition: FFDipole.h:359
double _wgtsq
Sum of squares of weights.
Definition: FFDipole.h:455
vector< Lorentz5Momentum > _qnewdrf
Definition: FFDipole.h:282
vector< Lorentz5Momentum > _qlab
Momentum of the particles in the lab frame.
Definition: FFDipole.h:327
vector< bool > _photcut
Whether a given photon passes the energy cut.
Definition: FFDipole.h:401
double sqrt(int x)
Definition: expm-1.h:45
vector< double > _photonwgt
Weights for the individual photons.
Definition: FFDipole.h:396
The FFDipole class generates radiation from a final-final dipole for the generation of photons in dec...
Definition: FFDipole.h:38
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Definition: FFDipole.h:111
vector< Lorentz5Momentum > _llab
Momenta of the photons in the lab frame.
Definition: FFDipole.h:337
double jacobianWeight()
Jacobian factor for the weight.
Definition: FFDipole.h:158
Lorentz5Momentum _bigLlab
Total momentum of the photons in the lab frame.
Definition: FFDipole.h:342
unsigned int _nweight
Storage of averages etc for testing.
Definition: FFDipole.h:445
unsigned int _maxtry
Maximum number of attempts to generate a result.
Definition: FFDipole.h:411
unsigned int _betaopt
Option for the inclusion of higher order corrections.
Definition: FFDipole.h:421
unsigned int _mode
Type of unweighting to perform.
Definition: FFDipole.h:406
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
constexpr double pi
Energy _emin
The minimum photon energy in the boosted frame.
Definition: FFDipole.h:239
unsigned int _dipoleopt
Option for the form of the primary distribution.
Definition: FFDipole.h:426
constexpr auto sqr(const T &x) -> decltype(x *x)
double _dipolewgt
Reweighting factors due to differences between the true and crude distributions.
Definition: FFDipole.h:354
double _mewgt
Reweighting factor due to matrix element corrections.
Definition: FFDipole.h:369
unsigned int _energyopt
Option for the energy cut-off.
Definition: FFDipole.h:416
vector< Lorentz5Momentum > _qnewlab
Momenta of the charged particles in the lab frame after radiation.
Definition: FFDipole.h:332
unsigned int _multiplicity
Photon multiplicity being generated.
Definition: FFDipole.h:259
tPPtr _parent
The decaying particle.
Definition: FFDipole.h:436
tDecayIntegratorPtr _decayer
The decayer.
Definition: FFDipole.h:431
vector< Energy > _m
Masses of the particles involved.
Definition: FFDipole.h:264
Lorentz5Momentum _bigLdrf
Total momentum of the photons in the dipole rest frame.
Definition: FFDipole.h:292
bool _weightOutput
Whether or not to output the averages.
Definition: FFDipole.h:460
vector< Lorentz5Momentum > _qdrf
Momenta of the particles in the dipole rest frame.
Definition: FFDipole.h:278
Lorentz5Momentum _bigLprf
Total momentum of the photons in the parent rest frame.
Definition: FFDipole.h:317
double _charge
Produce of the particles charges.
Definition: FFDipole.h:269
double _maxwgt
Maximum weight.
Definition: FFDipole.h:374
vector< Lorentz5Momentum > _lprf
Momenta of the photons in the parent rest frame.
Definition: FFDipole.h:312
double _jacobianwgt
Reweighting factor due to phase space.
Definition: FFDipole.h:364
Energy pstarTwoBodyDecay(const Energy M, const Energy m1, const Energy m2)
For the two body decay M -> m1 + m2 it gives the module of the 3-momentum of the decay product in the...
Definition: Kinematics.h:93
Energy _eminrest
The minimum photon energy in the rest frame.
Definition: FFDipole.h:244
virtual IBPtr clone() const
Make a simple clone of this object.
Definition: FFDipole.h:105
vector< Lorentz5Momentum > _qnewprf
Momenta of the charged particles in the parent&#39;s rest frame after radiation.
Definition: FFDipole.h:307
ThePEG::Ptr< Particle >::transient_pointer tPPtr
vector< Lorentz5Momentum > _ldrf
Momenta of the photons in the dipole rest frame.
Definition: FFDipole.h:287
vector< Lorentz5Momentum > _qprf
Momentum of the particles in the parent&#39;s rest frame.
Definition: FFDipole.h:302
double exactDipoleWeight(double beta1, double ombeta1, double beta2, double ombeta2, unsigned int iphot)
Calculate the exact weight for the dipole.
Definition: FFDipole.h:137
FFDipole()
The default constructor.
Definition: FFDipole.h:45
-*- C++ -*-
vector< double > _sinphot
Sine of the photon angles.
Definition: FFDipole.h:390
vector< PPtr > ParticleVector
Energy _eminlab
The minimum photon energy in the lab frame.
Definition: FFDipole.h:249
double _wgtsum
Sum of weights.
Definition: FFDipole.h:450
vector< double > _cosphot
Angles of the photons with respect to the first charged particle which are stored for numerical accur...
Definition: FFDipole.h:385
Energy _emax
The maximum photon energy.
Definition: FFDipole.h:254