herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
DipoleSplittingKinematics.h
1 // -*- C++ -*-
2 //
3 // DipoleSplittingKinematics.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_DipoleSplittingKinematics_H
10 #define HERWIG_DipoleSplittingKinematics_H
11 //
12 // This is the declaration of the DipoleSplittingKinematics class.
13 //
14 
15 #include "ThePEG/Handlers/HandlerBase.h"
16 #include "ThePEG/Vectors/Lorentz5Vector.h"
17 
18 #include "ThePEG/EventRecord/Particle.h"
19 #include "ThePEG/Utilities/UtilityBase.h"
20 
21 #include "Herwig/Shower/Dipole/Utility/DipoleMCCheck.h"
22 
23 namespace Herwig {
24 
25  using namespace ThePEG;
26 
27  class DipoleIndex;
28  class DipoleSplittingInfo;
29  class DipoleSplittingKernel;
30 
42 
43  public:
44 
51 
55  virtual ~DipoleSplittingKinematics();
57 
58  public:
59 
65  virtual pair<double,double> kappaSupport(const DipoleSplittingInfo&) const {
66  return {0.0,1.0};
67  }
68 
73  virtual pair<double,double> xiSupport(const DipoleSplittingInfo&) const {
74  return {0.0,1.0};
75  }
76 
85  virtual Energy dipoleScale(const Lorentz5Momentum& pEmitter,
86  const Lorentz5Momentum& pSpectator) const {
87  // MEMinBias produces non-zero zeros.
88  if(abs(pEmitter*pSpectator)<0.0000001*GeV2)return ZERO;
89  assert(pEmitter*pSpectator >= ZERO);
90  return sqrt(2.*pEmitter*pSpectator);
91  }
92 
98  virtual Energy recoilMassKin(const Lorentz5Momentum&,
99  const Lorentz5Momentum& pSpectator) const {
100  return pSpectator.m();
101  }
102 
106  virtual Energy ptMax(Energy dScale,
107  double emX, double specX,
108  const DipoleIndex& dIndex,
109  const DipoleSplittingKernel& split) const =0;
110 
114  virtual Energy ptMax(Energy dScale,
115  double emX, double specX,
116  const DipoleSplittingInfo& dInfo,
117  const DipoleSplittingKernel& split) const;
118 
122  virtual Energy ptMax(Energy dScale,
123  double emX, double specX,
124  const DipoleIndex& dIndex,
125  const DipoleSplittingKernel& split,
126  tPPtr emitter, tPPtr spectator) const;
127 
131  virtual Energy QMax(Energy dScale,
132  double emX, double specX,
133  const DipoleIndex& dIndex,
134  const DipoleSplittingKernel& split) const =0;
135 
139  virtual Energy QMax(Energy dScale,
140  double emX, double specX,
141  const DipoleSplittingInfo& dInfo,
142  const DipoleSplittingKernel& split) const;
143 
147  virtual Energy QMax(Energy dScale,
148  double emX, double specX,
149  const DipoleIndex& dIndex,
150  const DipoleSplittingKernel& split,
151  tPPtr emitter, tPPtr spectator) const;
152 
156  virtual Energy PtFromQ(Energy scale, const DipoleSplittingInfo&) const = 0;
157 
161  virtual Energy QFromPt(Energy scale, const DipoleSplittingInfo&) const = 0;
162 
166  virtual Energy IRCutoff() const { return theIRCutoff; }
167 
172  double xMin() const { return theXMin; }
173 
177  Energy generatePt(double r, Energy dScale,
178  double emX, double specX,
179  const DipoleIndex& dIndex,
180  const DipoleSplittingKernel& split,
181  double& weight) const;
182 
187  virtual double ptToRandom(Energy pt, Energy dScale,
188  double emX, double specX,
189  const DipoleIndex& dIndex,
190  const DipoleSplittingKernel& split) const;
191 
195  virtual pair<double,double> zBoundaries(Energy pt,
196  const DipoleSplittingInfo& dInfo,
197  const DipoleSplittingKernel& split) const = 0;
198 
203 
204  FlatZ = 0,
205  OneOverZ,
206  OneOverOneMinusZ,
207  OneOverZOneMinusZ
208 
209  };
210 
214  double generateZ(double r, Energy pt, int sampling,
215  const DipoleSplittingInfo& dInfo,
216  const DipoleSplittingKernel& split,
217  double& weight) const;
218 
224  virtual bool generateSplitting(double kappa, double xi, double phi,
225  DipoleSplittingInfo& info,
226  const DipoleSplittingKernel&) = 0;
227 
234  double jacobian() const { return theJacobian; }
235 
241  virtual bool haveOverestimate() const { return false; }
242 
247  virtual double jacobianOverestimate() const { return -1.; }
248 
252  Energy lastPt() const { return theLastPt; }
253 
257  double lastZ() const { return theLastZ; }
258 
263  // Do not need in current implementation,
264  // using lastSplittingParameters instead.
265  //double lastZPrime() const { return theLastZPrime; }
266 
270  double lastPhi() const { return theLastPhi; }
271 
276  double lastEmitterZ() const { return theLastEmitterZ; }
277 
282  double lastSpectatorZ() const { return theLastSpectatorZ; }
283 
289  const vector<double>& lastSplittingParameters() const { return theLastSplittingParameters; }
290 
296  void prepareSplitting(DipoleSplittingInfo& dInfo);
297 
298  public:
299 
305  virtual void generateKinematics(const Lorentz5Momentum& pEmitter,
306  const Lorentz5Momentum& pSpectator,
307  const DipoleSplittingInfo& dInfo) = 0;
308 
309 
310 
314  const Lorentz5Momentum& lastEmitterMomentum() const { return theEmitterMomentum; }
315 
319  const Lorentz5Momentum& lastSpectatorMomentum() const { return theSpectatorMomentum; }
320 
324  const Lorentz5Momentum& lastEmissionMomentum() const { return theEmissionMomentum; }
325 
326  /*
327  * Return true, if there is a transformation which should
328  * be applied to all other final state particles except the ones
329  * involved in the splitting after having performed the splitting.
330  */
331  virtual bool doesTransform () const { return false; }
332 
336  virtual void setTransformation () {};
337 
338  /*
339  * Use the Dipole scale instead of hardpt for z-boundaries.
340  */
341  int openZBoundaries() const { return theOpenZBoundaries; }
342 
343  /*
344  * perform the transformation if required.
345  */
346  virtual void transform (PPtr&) {};
347 
348  /*
349  * SW 30/01/2019: Test feature only, not for release.
350  * Return true to only apply the transformation to non-coloured particles.
351  * Note this requires careful handling in DipoleEventRecord
352  */
353  //virtual bool transformHardOnly() const { return false; }
354 
359  //virtual void transformHard ( PPtr& ) {};
360 
366  // void addToRecoilMom( const Lorentz5Momentum& mom ) {
367  // Lorentz5Momentum newRecoilMom = splitRecoilMomentum() + mom;
368  // splitRecoilMomentum(newRecoilMom);
369  // }
370 
371  /*
372  * Return true if this splitting is of a dipole which contains
373  * a decayed parton and requires the remnant to absorb the recoil.
374  */
375  virtual bool isDecay() const { return false; }
376 
380  //virtual Lorentz5Momentum decayRecoil ( const Lorentz5Momentum& p, const int) { return p; }
381 
385  virtual void decayRecoil ( PList& ) {};
386 
390  virtual Lorentz5Momentum pVector(const Lorentz5Momentum& pEmitter,
391  const Lorentz5Momentum&,
392  const DipoleSplittingInfo&) const {
393  return pEmitter;
394  }
395 
399  virtual Lorentz5Momentum nVector(const Lorentz5Momentum&,
400  const Lorentz5Momentum& pSpectator,
401  const DipoleSplittingInfo&) const {
402  return pSpectator;
403  }
404 
405  // {;}
406 
407  protected:
408 
413  Lorentz5Momentum getKt(const Lorentz5Momentum& p1,
414  const Lorentz5Momentum& p2,
415  Energy pt,
416  double phi,
417  bool spacelike = false) const;
418 
425  void jacobian(double w) { theJacobian = w; }
426 
430  void lastPt(Energy p) { theLastPt = p; }
431 
435  void lastZ(double z) { theLastZ = z; }
436 
440  // Do not need in current implementation,
441  // using lastSplittingParameters instead.
442  //void lastZPrime(double zPrime) { theLastZPrime = zPrime; }
443 
447  void lastPhi(double p) { theLastPhi = p; }
448 
453  void lastEmitterZ(double z) { theLastEmitterZ = z; }
454 
459  void lastSpectatorZ(double z) { theLastSpectatorZ = z; }
460 
466  vector<double>& splittingParameters() { return theLastSplittingParameters; }
467 
471  void emitterMomentum(const Lorentz5Momentum& p) { theEmitterMomentum = p; }
472 
476  void spectatorMomentum(const Lorentz5Momentum& p) { theSpectatorMomentum = p; }
477 
481  void emissionMomentum(const Lorentz5Momentum& p) { theEmissionMomentum = p; }
482 
486  void splitRecoilMomentum( const Lorentz5Momentum& mom ) { theSplitRecoilMomentum = mom; }
487 
491  const Lorentz5Momentum& splitRecoilMomentum() const { return theSplitRecoilMomentum; }
492 
493  public:
494 
501  static void Init();
502 
503  public:
504 
511  void persistentOutput(PersistentOStream & os) const;
512 
518  void persistentInput(PersistentIStream & is, int version);
520 
521 
522  // If needed, insert declarations of virtual function defined in the
523  // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
524 
525  private:
526 
531  Energy theIRCutoff;
532 
537  double theXMin;
538 
542  double theJacobian;
543 
547  Energy theLastPt;
548 
552  double theLastZ;
553 
559  // Do not need in current implementation,
560  // using lastSplittingParameters instead.
561  //double theLastZPrime;
562 
566  double theLastPhi;
567 
573 
579 
586 
590  Lorentz5Momentum theEmitterMomentum;
591 
595  Lorentz5Momentum theEmissionMomentum;
596 
600  Lorentz5Momentum theSpectatorMomentum;
601 
606  Lorentz5Momentum theSplitRecoilMomentum;
607 
608 
609 
610  int theOpenZBoundaries;
611 
612  protected:
613 
617  Ptr<DipoleMCCheck>::ptr theMCCheck;
618 
619  private:
620 
626 
631  DipoleSplittingKinematics & operator=(const DipoleSplittingKinematics &) = delete;
632 
633  };
634 
635 }
636 
637 #include "ThePEG/Utilities/ClassTraits.h"
638 
639 namespace ThePEG {
640 
645  template <>
646  struct BaseClassTrait<Herwig::DipoleSplittingKinematics,1> {
648  typedef HandlerBase NthBase;
649  };
650 
653  template <>
654  struct ClassTraits<Herwig::DipoleSplittingKinematics>
655  : public ClassTraitsBase<Herwig::DipoleSplittingKinematics> {
657  static string className() { return "Herwig::DipoleSplittingKinematics"; }
665  static string library() { return "HwDipoleShower.so"; }
666  };
667 
670 }
671 
672 #endif /* HERWIG_DipoleSplittingKinematics_H */
ThePEG::Ptr< Particle >::pointer PPtr
Lorentz5Momentum theEmitterMomentum
The emitter&#39;s momentum after the splitting.
double lastSpectatorZ() const
Return the momentum fraction, by which the spectator&#39;s momentum fraction should be divided after the ...
double sqrt(int x)
DipoleSplittingKinematics is the base class for dipole splittings as performed in the dipole shower...
const Lorentz5Momentum & lastEmissionMomentum() const
Return the emission&#39;s momentum.
void lastPt(Energy p)
Set the last generated pt.
double jacobian() const
Get the splitting phasespace weight associated to the last call to generateSplitting.
const vector< double > & lastSplittingParameters() const
Return any additional parameters needed to evaluate the splitting kernel or to generate the full spli...
double lastPhi() const
Return the last calculated zPrime for massive FF and decay dipoles.
double theLastEmitterZ
The momentum fraction, by which the emitter&#39;s momentum fraction should be divided after the splitting...
virtual double jacobianOverestimate() const
Return the overestimated jacobian for the last generated parameters.
DipoleIndex is used to index splitting generators for a particular dipole.
double theJacobian
The last calculated splitting phase space weight.
const Lorentz5Momentum & splitRecoilMomentum() const
Return the momentum of the recoil system after splitting.
Energy theLastPt
The last generated pt.
void lastSpectatorZ(double z)
Set the momentum fraction, by which the spectator&#39;s momentum fraction should be divided after the spl...
virtual pair< double, double > xiSupport(const DipoleSplittingInfo &) const
Return the boundaries in between the momentum fraction random number is to be sampled.
virtual bool isDecay() const
SW 30/01/2019: Test feature only, not for release.
vector< double > theLastSplittingParameters
Any additional parameters needed to evaluate the splitting kernel or to generate the full splitting...
virtual void setTransformation()
Calculate and store a required Lorentz transformation.
static AbstractClassDescription< DipoleSplittingKinematics > initDipoleSplittingKinematics
The static object used to initialize the description of this class.
virtual Lorentz5Momentum nVector(const Lorentz5Momentum &, const Lorentz5Momentum &pSpectator, const DipoleSplittingInfo &) const
Return the nVector, required for spin correlations.
double xMin() const
Return the minimum momentum fraction for incoming partons.
Lorentz5Momentum theSplitRecoilMomentum
The momentum of the recoil system after the splitting, used in decay dipole kinematics.
Lorentz5Momentum theSpectatorMomentum
The spectator&#39;s momentum after the splitting.
void splitRecoilMomentum(const Lorentz5Momentum &mom)
Set the momentum of the recoil system after the splitting.
double lastEmitterZ() const
Return the momentum fraction, by which the emitter&#39;s momentum fraction should be divided after the sp...
const Lorentz5Momentum & lastEmitterMomentum() const
Return the emitter&#39;s momentum after the splitting.
const Lorentz5Momentum & lastSpectatorMomentum() const
Return the spectator&#39;s momentum after the splitting.
ZSamplingOptions
Enumerate the variants of sampling z.
virtual void decayRecoil(PList &)
Perform the recoil in the case of a decayed parton.
Ptr< DipoleMCCheck >::ptr theMCCheck
Pointer to a check histogram object.
void lastEmitterZ(double z)
Set the momentum fraction, by which the emitter&#39;s momentum fraction should be divided after the split...
double theLastPhi
The last calculated zPrime required for massive FF and decay kinematics dipoles.
virtual bool haveOverestimate() const
Return true, if this splitting kinematics class is capable of delivering an overestimate to the jacob...
virtual Energy recoilMassKin(const Lorentz5Momentum &, const Lorentz5Momentum &pSpectator) const
Return the mass of the system absorbing the recoil in the dipole splitting.
vector< double > & splittingParameters()
Access any additional parameters needed to evaluate the splitting kernel or to generate the full spli...
ThePEG::Ptr< Particle >::transient_pointer tPPtr
void lastZ(double z)
Set the last generated momentum fraction.
double lastZ() const
Return the last generated momentum fraction.
-*- C++ -*-
double theXMin
The minimum momentum fraction for incoming partons.
virtual pair< double, double > kappaSupport(const DipoleSplittingInfo &) const
Return the boundaries in between the evolution variable random number is to be sampled; the lower cuo...
void spectatorMomentum(const Lorentz5Momentum &p)
Set the spectator&#39;s momentum after the splitting.
void lastPhi(double p)
Set the last calculated zPrime for massive FF and decay dipoles.
void emissionMomentum(const Lorentz5Momentum &p)
Set the emission&#39;s momentum.
DipoleSplittingInfo contains all parameters to generate a full dipole splitting.
virtual Energy dipoleScale(const Lorentz5Momentum &pEmitter, const Lorentz5Momentum &pSpectator) const
Return the dipole scale associated to the given pair of emitter and spectator.
void jacobian(double w)
Set the splitting phasespace weight associated to the last call to generateSplitting.
virtual Energy IRCutoff() const
Return the infrared cutoff.
double theLastZ
The last generated momentum fraction.
Energy theIRCutoff
The infrared cutoff associated to this splitting kinematics.
constexpr ZeroUnit ZERO
Energy lastPt() const
Return the last generated pt.
DipoleSplittingKernel is the base class for all kernels used within the dipole shower.
list< PPtr > PList
double theLastSpectatorZ
The momentum fraction, by which the spectator&#39;s momentum fraction should be divided after the splitti...
Lorentz5Momentum theEmissionMomentum
The emission&#39;s momentum after the splitting.
void emitterMomentum(const Lorentz5Momentum &p)
Set the emitter&#39;s momentum after the splitting.
virtual Lorentz5Momentum pVector(const Lorentz5Momentum &pEmitter, const Lorentz5Momentum &, const DipoleSplittingInfo &) const
Return the pVector, required for spin correlations.