herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
QTildeShowerHandler.h
1 // -*- C++ -*-
2 #ifndef Herwig_QTildeShowerHandler_H
3 #define Herwig_QTildeShowerHandler_H
4 //
5 // This is the declaration of the QTildeShowerHandler class.
6 //
7 
8 #include "QTildeShowerHandler.fh"
9 #include "Herwig/Shower/ShowerHandler.h"
10 #include "Herwig/Shower/QTilde/SplittingFunctions/SplittingGenerator.h"
11 #include "Herwig/Shower/QTilde/Base/ShowerTree.h"
12 #include "Herwig/Shower/QTilde/Base/ShowerProgenitor.fh"
13 #include "Herwig/Shower/QTilde/Base/HardTree.h"
14 #include "Herwig/Shower/QTilde/Base/Branching.h"
15 #include "Herwig/Shower/QTilde/Base/ShowerVeto.h"
16 #include "Herwig/Shower/QTilde/Base/FullShowerVeto.h"
17 #include "Herwig/Shower/QTilde/Kinematics/KinematicsReconstructor.fh"
18 #include "Herwig/Shower/QTilde/Base/PartnerFinder.fh"
19 #include "Herwig/Shower/QTilde/SplittingFunctions/SudakovFormFactor.fh"
20 #include "Herwig/MatrixElement/HwMEBase.h"
21 #include "Herwig/Decay/HwDecayerBase.h"
22 #include "Herwig/MatrixElement/Matchbox/Matching/ShowerApproximation.h"
23 #include "Herwig/Shower/RealEmissionProcess.h"
24 #include "Herwig/Utilities/Statistic.h"
25 
26 namespace Herwig {
27 
28 using namespace ThePEG;
29 
37 
38 public:
39 
44 
45 public:
46 
53 
57  virtual ~QTildeShowerHandler();
59 
60 public:
61 
69  void fillEventRecord();
70 
74  virtual Energy hardScale() const {
75  return muPt;
76  }
77 
82  virtual bool showerHardProcessVeto() const { return false; }
83 
87  virtual HardTreePtr generateCKKW(ShowerTreePtr tree) const;
88 
96  virtual void showerHardProcess(ShowerTreePtr,XCPtr);
97 
101  virtual void showerDecay(ShowerTreePtr);
103 
108 
112  tSplittingGeneratorPtr splittingGenerator() const { return _splittingGenerator; }
113 
117  int hardEmission() const {return _hardEmission;}
119 
123  virtual void connectTrees(ShowerTreePtr showerTree, HardTreePtr hardTree, bool hard );
124 
132  unsigned int softCorrelations() const {
133  return _softOpt;
134  }
135 
139  virtual bool correlations() const {
140  return spinCorrelations()!=0||_softOpt!=0;
141  }
143 
144 public:
152  tKinematicsReconstructorPtr kinematicsReconstructor() const { return _reconstructor; }
153 
157  tPartnerFinderPtr partnerFinder() const { return _partnerfinder; }
158 
160 
161 protected:
162 
166  void doShowering(bool hard,XCPtr);
167 
171  virtual RealEmissionProcessPtr hardMatrixElementCorrection(bool);
172 
176  virtual void hardestEmission(bool hard);
177 
181  void setupMECorrection(RealEmissionProcessPtr real);
182 
189  virtual vector<ShowerProgenitorPtr> setupShower(bool hard);
190 
194  virtual void setEvolutionPartners(bool hard,ShowerInteraction,
195  bool clear);
196 
210  virtual bool timeLikeShower(tShowerParticlePtr particle, ShowerInteraction,
211  Branching fb, bool first);
212 
221  virtual bool spaceLikeShower(tShowerParticlePtr particle,PPtr beam,
223 
233  virtual bool
234  spaceLikeDecayShower(tShowerParticlePtr particle,
235  const ShowerParticle::EvolutionScales & maxScales,
236  Energy minimumMass,ShowerInteraction,
237  Branching fb);
238 
242  virtual bool truncatedTimeLikeShower(tShowerParticlePtr particle,
243  HardBranchingPtr branch,
244  ShowerInteraction type,
245  Branching fb, bool first);
246 
250  virtual bool truncatedSpaceLikeShower(tShowerParticlePtr particle,PPtr beam,
251  HardBranchingPtr branch,
252  ShowerInteraction type);
253 
257  virtual bool truncatedSpaceLikeDecayShower(tShowerParticlePtr particle,
258  const ShowerParticle::EvolutionScales & maxScales,
259  Energy minimumMass, HardBranchingPtr branch,
260  ShowerInteraction type, Branching fb);
262 
270  bool MECOn() const {
271  return _hardEmission == 1;
272  }
273 
277  bool hardMEC() const {
278  return _hardEmission == 1 && (_meCorrMode == 1 || _meCorrMode == 2);
279  }
280 
284  bool softMEC() const {
285  return _hardEmission == 1 && (_meCorrMode == 1 || _meCorrMode > 2);
286  }
288 
292  bool isTruncatedShowerON() const {return _trunc_Mode;}
293 
301  bool ipTon() const {
302  return _iptrms != ZERO || ( _beta == 1.0 && _gamma != ZERO && _iptmax !=ZERO );
303  }
305 
311  void addVeto (ShowerVetoPtr v) { _vetoes.push_back(v); }
312 
316  void removeVeto (ShowerVetoPtr v) {
317  vector<ShowerVetoPtr>::iterator vit = find(_vetoes.begin(),_vetoes.end(),v);
318  if (vit != _vetoes.end())
319  _vetoes.erase(vit);
320  }
321 
323 
332  bool hardVetoReadOption() const {return _hardVetoReadOption;}
334 
343  double initialStateRadiationEnhancementFactor() const { return _initialenhance; }
344 
348  double finalStateRadiationEnhancementFactor() const { return _finalenhance; }
349 
353  void initialStateRadiationEnhancementFactor(double in) { _initialenhance=in; }
354 
358  void finalStateRadiationEnhancementFactor(double in) { _finalenhance=in; }
360 
368  tHardTreePtr hardTree() {return _hardtree;}
369 
373  void hardTree(tHardTreePtr in) {_hardtree = in;}
375 
383  Ptr<BeamParticleData>::const_pointer beamParticle() const { return _beam; }
384 
388  void setBeamParticle(Ptr<BeamParticleData>::const_pointer in) { _beam=in; }
390 
398  tShowerTreePtr currentTree() { return _currenttree; }
399 
403  void currentTree(tShowerTreePtr tree) { _currenttree=tree; }
404 
406 
410  unsigned int maximumTries() const { return _maxtry; }
411 
419  ShowerProgenitorPtr progenitor() { return _progenitor; }
420 
424  void progenitor(ShowerProgenitorPtr in) { _progenitor=in; }
426 
430  virtual void generateIntrinsicpT(vector<ShowerProgenitorPtr>);
431 
435  map<tShowerProgenitorPtr,pair<Energy,double> > & intrinsicpT() { return _intrinsic; }
436 
440  void setupMaximumScales(const vector<ShowerProgenitorPtr> &,XCPtr);
441 
445  void setupHardScales(const vector<ShowerProgenitorPtr> &,XCPtr);
446 
450  void convertHardTree(bool hard,ShowerInteraction type);
451 
452 protected:
453 
457  PPtr findFirstParton(tPPtr seed) const;
458 
462  tPPair remakeRemnant(tPPair oldp);
463 
464 protected:
465 
469  virtual bool startTimeLikeShower(ShowerInteraction);
470 
474  void updateHistory(tShowerParticlePtr particle);
475 
479  virtual bool startSpaceLikeShower(PPtr,ShowerInteraction);
480 
484  virtual bool
485  startSpaceLikeDecayShower(const ShowerParticle::EvolutionScales & maxScales,
486  Energy minimumMass,ShowerInteraction);
487 
491  Branching selectTimeLikeBranching(tShowerParticlePtr particle,
492  ShowerInteraction type,
493  HardBranchingPtr branch);
494 
498  Branching selectSpaceLikeDecayBranching(tShowerParticlePtr particle,
499  const ShowerParticle::EvolutionScales & maxScales,
500  Energy minmass,ShowerInteraction type,
501  HardBranchingPtr branch);
505  ShowerParticleVector createTimeLikeChildren(tShowerParticlePtr particle,
506  IdList ids);
507 
511  virtual bool timeLikeVetoed(const Branching &,ShowerParticlePtr);
512 
516  virtual bool spaceLikeVetoed(const Branching &,ShowerParticlePtr);
517 
521  virtual bool spaceLikeDecayVetoed(const Branching &,ShowerParticlePtr);
522 
526  bool hardOnly() const {return _limitEmissions==3;}
527 
531  void checkFlags();
532 
536  void addFSRUsingDecayPOWHEG(HardTreePtr ISRTree);
537 
538 public:
539 
546  void persistentOutput(PersistentOStream & os) const;
547 
553  void persistentInput(PersistentIStream & is, int version);
555 
562  static void Init();
563 
564 protected:
565 
569  virtual tPPair cascade(tSubProPtr sub, XCPtr xcomb);
570 
574  void decay(ShowerTreePtr tree, ShowerDecayMap & decay);
575 
576 protected:
577 
584  virtual IBPtr clone() const;
585 
590  virtual IBPtr fullclone() const;
592 
593 protected:
594 
600  virtual void doinit();
601 
606  virtual void doinitrun();
608 
609 private:
610 
615  QTildeShowerHandler & operator=(const QTildeShowerHandler &) = delete;
616 
617 private:
618 
619 
624 
628  ShowerTreePtr hard_;
629 
634 
638  vector<ShowerTreePtr> done_;
640 
641 private :
642 
646  SplittingGeneratorPtr _splittingGenerator;
647 
651  unsigned int _maxtry;
652 
656  unsigned int _meCorrMode;
657 
661  unsigned int _evolutionScheme;
662 
671 
675  Energy _iptrms;
676 
680  double _beta;
681 
685  Energy _gamma;
686 
690  Energy _iptmax;
691 
695  unsigned int _limitEmissions;
696 
700  ShowerProgenitorPtr _progenitor;
701 
705  HwMEBasePtr _hardme;
706 
710  HwDecayerBasePtr _decayme;
711 
715  ShowerTreePtr _currenttree;
716 
720  HardTreePtr _hardtree;
721 
731 
737 
741  Ptr<BeamParticleData>::const_pointer _beam;
742 
746  map<tShowerProgenitorPtr,pair<Energy,double> > _intrinsic;
747 
751  vector<ShowerVetoPtr> _vetoes;
752 
756  vector<FullShowerVetoPtr> _fullShowerVetoes;
757 
761  unsigned int _nReWeight;
762 
766  bool _reWeight;
767 
771  unsigned int _nis;
772 
776  unsigned int _nfs;
777 
782 
787 
792 
796  unsigned int _softOpt;
797 
802 
807  static bool _hardEmissionWarn;
808 
813  static bool _missingTruncWarn;
814 
818  Energy muPt;
819 
820 private:
828  KinematicsReconstructorPtr _reconstructor;
829 
833  PartnerFinderPtr _partnerfinder;
834 
836 
837 };
838 
839 }
840 
841 #endif /* HERWIG_QTildeShowerHandler_H */
double initialStateRadiationEnhancementFactor() const
Enhancement factors for radiation needed to generate the soft matrix element correction.
ThePEG::Ptr< Particle >::pointer PPtr
HwMEBasePtr _hardme
Matrix element.
double _initialenhance
Radiation enhancement factors for use with the veto algorithm if needed by the soft matrix element co...
multimap< Energy, ShowerTreePtr, std::greater< Energy > > ShowerDecayMap
Typedef for map of ShowerTrees for decays.
Definition: ShowerTree.h:29
void progenitor(ShowerProgenitorPtr in)
Set the progenitor.
PartnerFinderPtr _partnerfinder
Pointer to the PartnerFinder object.
vector< ShowerParticlePtr > ShowerParticleVector
A Vector of ShowerParticle pointers.
Definition: ShowerConfig.h:54
ShowerInteraction
Handy header file to be included in all Shower classes.
bool _reWeight
Whether or not we are reweighting.
unsigned int _meCorrMode
Matrix element correction switch.
bool _trunc_Mode
Truncated shower switch.
unsigned int maximumTries() const
Access the maximum number of attempts to generate the shower.
bool isTruncatedShowerON() const
Is the truncated shower on?
The QTildeShowerHandler class.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Energy muPt
The relevant hard scale to be used in the profile scales.
virtual bool correlations() const
Any correlations.
double _finalenhance
Enhancement factor for final-state radiation.
unsigned int softCorrelations() const
Access to switches for spin correlations.
ShowerProgenitorPtr _progenitor
The progenitor of the current shower.
vector< ShowerVetoPtr > _vetoes
Vetoes.
unsigned int _limitEmissions
Limit the number of emissions for testing.
unsigned int _softOpt
Option for the kernal for soft correlations.
KinematicsReconstructorPtr _reconstructor
Pointer to the various objects.
ShowerDecayMap decay_
The ShowerTree for the decays.
static bool _hardEmissionWarn
True if no warnings about incorrect hard emission mode setting have been issued yet.
tShowerTreePtr currentTree()
Set/Get the current tree being evolver for inheriting classes.
vector< tcPDPtr > IdList
Definition of the IdList for branchings.
Definition: ShowerConfig.h:64
pair< tPPtr, tPPtr > tPPair
Iterator find(IteratorRange< Iterator > r, const T &t)
unsigned int _nis
number of IS emissions
map< tShowerProgenitorPtr, pair< Energy, double > > & intrinsicpT()
Access to the intrinsic for inheriting classes.
ShowerProgenitorPtr progenitor()
Set/Get the ShowerProgenitor for the current shower.
ShowerTreePtr hard_
Stuff from the ShowerHandler.
unsigned int _evolutionScheme
Control of the reconstruction option.
Ptr< BeamParticleData >::const_pointer beamParticle() const
Access/set the beam particle for the current initial-state shower.
void initialStateRadiationEnhancementFactor(double in)
Set the enhancement factor for initial-state radiation.
void removeVeto(ShowerVetoPtr v)
Remove a veto.
void setBeamParticle(Ptr< BeamParticleData >::const_pointer in)
Set the beam particle data.
bool ipTon() const
Switch for intrinsic pT.
unsigned int _nReWeight
Number of iterations for reweighting.
int _hardEmission
Mode for the hard emissions.
HardTreePtr _hardtree
The HardTree currently being showered.
virtual bool showerHardProcessVeto() const
Hook to allow vetoing of event after showering hard sub-process as in e.g.
tKinematicsReconstructorPtr kinematicsReconstructor() const
Access methods to access the objects.
bool hardMEC() const
Any hard ME correction?
bool _hardPOWHEG
Option for hard radiation in POWHEG events.
tPartnerFinderPtr partnerFinder() const
Access to the PartnerFinder object.
ShowerTreePtr _currenttree
The ShowerTree currently being showered.
int hardEmission() const
Mode for hard emissions.
vector< ShowerTreePtr > done_
The ShowerTrees for which the initial shower.
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
SplittingGeneratorPtr _splittingGenerator
Pointer to the splitting generator.
ThePEG::Ptr< Particle >::transient_pointer tPPtr
tHardTreePtr hardTree()
Access to set/get the HardTree currently beinging showered.
The branching struct is used to store information on the branching.
Definition: Branching.h:20
Energy _iptrms
rms intrinsic pT of Gaussian distribution
bool softMEC() const
Any soft ME correction?
tSplittingGeneratorPtr splittingGenerator() const
Access to the flags and shower variables.
double _beta
Proportion of inverse quadratic intrinsic pT distribution.
void hardTree(tHardTreePtr in)
The HardTree currently being showered.
Ptr< XComb >::pointer XCPtr
Pointer to an XComb object.
static bool _missingTruncWarn
True if no warnings about missing truncated shower have been issued yet.
bool MECOn() const
Switches for matrix element corrections.
bool _hardVetoReadOption
If hard veto pT scale is being read-in this determines whether the read-in value is applied to primar...
void finalStateRadiationEnhancementFactor(double in)
Set the enhancement factor for final-state radiation.
-*- C++ -*-
unsigned int _nfs
Number of FS emissions.
map< tShowerProgenitorPtr, pair< Energy, double > > _intrinsic
Storage of the intrinsic of the particles.
Energy _iptmax
Upper bound on intrinsic pT for inverse quadratic.
HwDecayerBasePtr _decayme
Decayer.
This class is the main driver of the shower: it is responsible for the proper handling of all other s...
Definition: ShowerHandler.h:40
Energy _gamma
Parameter for inverse quadratic: 2*Beta*Gamma/(sqr(Gamma)+sqr(intrinsicpT))
ShowerInteraction interaction_
The option for wqhich interactions to use.
void currentTree(tShowerTreePtr tree)
Set the tree.
bool hardVetoReadOption() const
Switches for vetoing hard emissions.
void addVeto(ShowerVetoPtr v)
Insert a veto.
vector< FullShowerVetoPtr > _fullShowerVetoes
Full Shower Vetoes.
constexpr ZeroUnit ZERO
virtual Energy hardScale() const
Return the relevant hard scale to be used in the profile scales.
Struct to store the evolution scales.
bool hardOnly() const
Only generate the hard emission, for testing only.
RCPtr< XComb > pointer
unsigned int _maxtry
Maximum number of tries to generate the shower of a particular tree.
double finalStateRadiationEnhancementFactor() const
Access the enhancement factor for final-state radiation.
Ptr< BeamParticleData >::const_pointer _beam
The beam particle data for the current initial-state shower.