herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
DipoleSplittingReweight.h
1 // -*- C++ -*-
2 //
3 // DipoleSplittingReweight.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_DipoleSplittingReweight_H
10 #define HERWIG_DipoleSplittingReweight_H
11 //
12 // This is the declaration of the DipoleSplittingReweight class.
13 //
14 
15 #include "ThePEG/Handlers/HandlerBase.h"
16 #include "DipoleSplittingInfo.h"
17 
18 #include "Herwig/Shower/Dipole/DipoleShowerHandler.fh"
19 
20 namespace Herwig {
21 
22 using namespace ThePEG;
23 
35 
36 public:
37 
44 
48  virtual ~DipoleSplittingReweight();
50 
51 public:
52 
57  virtual bool firstInteraction() const { return true; }
58 
63  virtual bool secondaryInteractions() const { return false; }
64 
68  void updateCurrentHandler();
69 
73  Ptr<DipoleShowerHandler>::tptr currentHandler() const;
74 
78  virtual double evaluate(const DipoleSplittingInfo&) const = 0;
79 
84  virtual double hint(const DipoleSplittingInfo&) const {
85  return 1.;
86  }
87 
92  virtual bool hintOnly(const DipoleSplittingInfo&) const {
93  return false;
94  }
95 
99  virtual void reweightFactor(const double) {
100  return;
101  }
102 
106  virtual void negativeScaling(const double) {
107  return;
108  }
109 
110 public:
111 
118  void persistentOutput(PersistentOStream & os) const;
119 
125  void persistentInput(PersistentIStream & is, int version);
127 
134  static void Init();
135 
136 // If needed, insert declarations of virtual function defined in the
137 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
138 
139 private:
140 
146 
151  DipoleSplittingReweight & operator=(const DipoleSplittingReweight &) = delete;
152 
156  Ptr<DipoleShowerHandler>::tptr theCurrentHandler;
157 
158 };
159 
160 }
161 
162 #include "ThePEG/Utilities/ClassTraits.h"
163 
164 namespace ThePEG {
165 
170 template <>
171 struct BaseClassTrait<Herwig::DipoleSplittingReweight,1> {
173  typedef HandlerBase NthBase;
174 };
175 
178 template <>
179 struct ClassTraits<Herwig::DipoleSplittingReweight>
180  : public ClassTraitsBase<Herwig::DipoleSplittingReweight> {
182  static string className() { return "Herwig::DipoleSplittingReweight"; }
190  static string library() { return "HwDipoleShower.so"; }
191 };
192 
195 }
196 
197 #endif /* HERWIG_DipoleSplittingReweight_H */
virtual bool firstInteraction() const
Return true, if the reweighting should be applied to the first interaction.
virtual void negativeScaling(const double)
Scaling factor for negative reweights.
virtual bool hintOnly(const DipoleSplittingInfo &) const
Return true, if the reweight can be entirely absorbed into the hint.
virtual double hint(const DipoleSplittingInfo &) const
Return an enhancement hint for the sampling of the un-reweighted splitting kernel.
static AbstractClassDescription< DipoleSplittingReweight > initDipoleSplittingReweight
The static object used to initialize the description of this class.
virtual void reweightFactor(const double)
Set the factor in front of enhance used by the veto algorithm.
-*- C++ -*-
DipoleSplittingInfo contains all parameters to generate a full dipole splitting.
virtual bool secondaryInteractions() const
Return true, if the reweighting should be applied to the secondary interactions.
DipoleSplittingReweight is used by the dipole shower to reweight splittings from a given dipole split...
Ptr< DipoleShowerHandler >::tptr theCurrentHandler
A pointer to the currently active dipole shower handler object.