Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:13

0001 // -*- C++ -*-
0002 //
0003 // ShowerApproximation.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef Herwig_ShowerApproximation_H
0010 #define Herwig_ShowerApproximation_H
0011 //
0012 // This is the declaration of the ShowerApproximation class.
0013 //
0014 
0015 #include "ThePEG/Handlers/HandlerBase.h"
0016 #include "ThePEG/Handlers/StandardXComb.h"
0017 #include "Herwig/MatrixElement/Matchbox/Dipoles/SubtractionDipole.fh"
0018 #include "Herwig/MatrixElement/Matchbox/Utility/ColourBasis.h"
0019 #include "Herwig/MatrixElement/Matchbox/Phasespace/TildeKinematics.fh"
0020 #include "Herwig/MatrixElement/Matchbox/Phasespace/InvertedTildeKinematics.fh"
0021 #include "HardScaleProfile.h"
0022 
0023 namespace Herwig {
0024 
0025 using namespace ThePEG;
0026 
0027 /**
0028  * \ingroup Matchbox
0029  * \author Simon Platzer
0030  *
0031  * \brief ShowerApproximation describes the shower emission to be used
0032  * in NLO matching.
0033  *
0034  */
0035 class ShowerApproximation: public HandlerBase {
0036 
0037 public:
0038 
0039   /**
0040    * The default constructor.
0041    */
0042   ShowerApproximation();
0043 
0044 public:
0045 
0046   /**
0047    * Return true, if this shower approximation will require a
0048    * splitting generator
0049    */
0050   virtual bool needsSplittingGenerator() const { return false; }
0051 
0052   /**
0053    * Return true, if this shower approximation will require
0054    * H events
0055    */
0056   virtual bool hasHEvents() const { return true; }
0057 
0058   /**
0059    * Return true, if this shower approximation will require tilde
0060    * XCombs for the real phase space point generated
0061    */
0062   virtual bool needsTildeXCombs() const { return false; }
0063 
0064   /**
0065    * Return true, if this shower approximation will require 
0066    * a truncated parton shower
0067    */
0068   virtual bool needsTruncatedShower() const { return false; }
0069 
0070   /**
0071    * Return the tilde kinematics object returning the shower
0072    * kinematics parametrization if different from the nominal dipole
0073    * mappings.
0074    */
0075   virtual Ptr<TildeKinematics>::tptr showerTildeKinematics() const;
0076 
0077   /**
0078    * Return the tilde kinematics object returning the shower
0079    * kinematics parametrization if different from the nominal dipole
0080    * mappings.
0081    */
0082   virtual Ptr<InvertedTildeKinematics>::tptr showerInvertedTildeKinematics() const;
0083 
0084 public:
0085 
0086   /**
0087    * Set the XComb object describing the Born process
0088    */
0089   void setBornXComb(tStdXCombPtr xc) { theBornXComb = xc; }
0090 
0091   /**
0092    * Return the XComb object describing the Born process
0093    */
0094   tStdXCombPtr bornXComb() const { return theBornXComb; }
0095 
0096   /**
0097    * Return the XComb object describing the Born process
0098    */
0099   tcStdXCombPtr bornCXComb() const { return theBornXComb; }
0100 
0101   /**
0102    * Set the XComb object describing the real emission process
0103    */
0104   void setRealXComb(tStdXCombPtr xc) { theRealXComb = xc; }
0105 
0106   /**
0107    * Return the XComb object describing the real emission process
0108    */
0109   tStdXCombPtr realXComb() const { return theRealXComb; }
0110 
0111   /**
0112    * Return the XComb object describing the real emission process
0113    */
0114   tcStdXCombPtr realCXComb() const { return theRealXComb; }
0115 
0116   /**
0117    * Set the tilde xcomb objects associated to the real xcomb
0118    */
0119   void setTildeXCombs(const vector<StdXCombPtr>& xc) { theTildeXCombs = xc; }
0120 
0121   /**
0122    * Return the tilde xcomb objects associated to the real xcomb
0123    */
0124   const vector<StdXCombPtr>& tildeXCombs() const { return theTildeXCombs; }
0125 
0126   /**
0127    * Set the dipole in charge for the emission
0128    */
0129   void setDipole(Ptr<SubtractionDipole>::tptr);
0130 
0131   /**
0132    * Return the dipole in charge for the emission
0133    */
0134   Ptr<SubtractionDipole>::tptr dipole() const;
0135 
0136   /**
0137    * Return true, if this matching is capable of spin correlations.
0138    */
0139   virtual bool hasSpinCorrelations() const { return false; }
0140 
0141 public:
0142 
0143   /**
0144    * Return true if one of the recently encountered configutations was
0145    * below the infrared cutoff.
0146    */
0147   bool belowCutoff() const { return theBelowCutoff; }
0148 
0149   /**
0150    * Indicate that one of the recently encountered configutations was
0151    * below the infrared cutoff.
0152    */
0153   void wasBelowCutoff() { theBelowCutoff = true; }
0154 
0155   /**
0156    * Reset the below cutoff flag.
0157    */
0158   void resetBelowCutoff() { theBelowCutoff = false; }
0159 
0160   /**
0161    * Return the pt cut to be applied for final-final dipoles.
0162    */
0163   Energy ffPtCut() const { return theFFPtCut; }
0164 
0165   /**
0166    * Return the pt cut to be applied for final-initial dipoles.
0167    */
0168   Energy fiPtCut() const { return theFIPtCut; }
0169 
0170   /**
0171    * Return the pt cut to be applied for initial-initial dipoles.
0172    */
0173   Energy iiPtCut() const { return theIIPtCut; }
0174 
0175   /**
0176    * Return the pt cut to be applied for initial-initial dipoles.
0177    */
0178   Energy safeCut() const { return theSafeCut;}
0179 
0180   /**
0181    * Return the screening scale to be applied for final-final dipoles.
0182    */
0183   Energy ffScreeningScale() const { return theFFScreeningScale; }
0184 
0185   /**
0186    * Return the screening scale to be applied for final-initial dipoles.
0187    */
0188   Energy fiScreeningScale() const { return theFIScreeningScale; }
0189 
0190   /**
0191    * Return the screening scale to be applied for initial-initial dipoles.
0192    */
0193   Energy iiScreeningScale() const { return theIIScreeningScale; }
0194 
0195   /**
0196    * Return the shower renormalization scale
0197    */
0198   virtual Energy2 showerEmissionScale() const;
0199 
0200   /**
0201    * Return the shower renormalization scale
0202    */
0203   Energy2 showerRenormalizationScale() const {
0204     return sqr(renormalizationScaleFactor())*showerEmissionScale();
0205   }
0206 
0207   /**
0208    * Return the shower factorization scale
0209    */
0210   Energy2 showerFactorizationScale() const {
0211     return sqr(factorizationScaleFactor())*showerEmissionScale();
0212   }
0213 
0214   /**
0215    * Return the Born renormalization scale
0216    */
0217   Energy2 bornRenormalizationScale() const;
0218 
0219   /**
0220    * Return the Born factorization scale
0221    */
0222   Energy2 bornFactorizationScale() const;
0223 
0224   /**
0225    * Return the real emission renormalization scale
0226    */
0227   Energy2 realRenormalizationScale() const;
0228 
0229   /**
0230    * Return the real emission factorization scale
0231    */
0232   Energy2 realFactorizationScale() const;
0233 
0234   /**
0235    * Enumerate possible scale choices
0236    */
0237   enum ScaleChoices {
0238 
0239     bornScale = 0,
0240     /** Use the born scales */
0241 
0242     realScale = 1,
0243     /** Use the real scales */
0244 
0245     showerScale = 2
0246     /** Use the shower scales */
0247 
0248   };
0249 
0250   /**
0251    * Return the scale choice in the real emission cross section to be
0252    * used in the matching subtraction.
0253    */
0254   int realEmissionScaleInSubtraction() const { return theRealEmissionScaleInSubtraction; }
0255 
0256   /**
0257    * Return the scale choice in the born cross section to be
0258    * used in the matching subtraction.
0259    */
0260   int bornScaleInSubtraction() const { return theBornScaleInSubtraction; }
0261 
0262   /**
0263    * Return the scale choice in the emission contribution to be
0264    * used in the matching subtraction.
0265    */
0266   int emissionScaleInSubtraction() const { return theEmissionScaleInSubtraction; }
0267 
0268   /**
0269    * Return the scale choice in the real emission cross section to be
0270    * used in the splitting.
0271    */
0272   int realEmissionScaleInSplitting() const { return theRealEmissionScaleInSplitting; }
0273 
0274   /**
0275    * Return the scale choice in the born cross section to be
0276    * used in the splitting.
0277    */
0278   int bornScaleInSplitting() const { return theBornScaleInSplitting; }
0279 
0280   /**
0281    * Return the scale choice in the emission contribution to be
0282    * used in the splitting.
0283    */
0284   int emissionScaleInSplitting() const { return theEmissionScaleInSplitting; }
0285 
0286   /**
0287    * Return the scale weight
0288    */
0289   double scaleWeight(int rScale, int bScale, int eScale) const;
0290 
0291   /**
0292    * Return the scale weight for the matching subtraction
0293    */
0294   double subtractionScaleWeight() const {
0295     return scaleWeight(realEmissionScaleInSubtraction(),
0296                bornScaleInSubtraction(),
0297                emissionScaleInSubtraction());
0298   }
0299 
0300   /**
0301    * Return the scale weight for the splitting
0302    */
0303   double splittingScaleWeight() const {
0304     return scaleWeight(realEmissionScaleInSplitting(),
0305                bornScaleInSplitting(),
0306                emissionScaleInSplitting());
0307   }
0308 
0309 public:
0310 
0311   /**
0312    * Return true, if the phase space restrictions of the dipole shower should
0313    * be applied.
0314    */
0315   bool restrictPhasespace() const { return theRestrictPhasespace; }
0316 
0317   /**
0318    * Indicate that the phase space restrictions of the dipole shower should
0319    * be applied.
0320    */
0321   void restrictPhasespace(bool yes) { theRestrictPhasespace = yes; }
0322 
0323   /**
0324    * Return profile scales
0325    */
0326   Ptr<HardScaleProfile>::tptr profileScales() const { return theHardScaleProfile; }
0327 
0328   /**
0329    * Set profile scales
0330    */
0331   void profileScales(Ptr<HardScaleProfile>::ptr prof) { theHardScaleProfile = prof; }
0332 
0333   /**
0334    * Return true if maximum pt should be deduced from the factorization scale
0335    */
0336   bool hardScaleIsMuF() const { return maxPtIsMuF; }
0337 
0338   /**
0339    * Indicate that maximum pt should be deduced from the factorization scale
0340    */
0341   void hardScaleIsMuF(bool yes) { maxPtIsMuF = yes; }
0342 
0343   /**
0344    * Return the scale factor for the hard scale
0345    */
0346   double hardScaleFactor() const { return theHardScaleFactor; }
0347 
0348   /**
0349    * Set the scale factor for the hard scale
0350    */
0351   void hardScaleFactor(double f) { theHardScaleFactor = f; }
0352 
0353   /**
0354    * Get the factorization scale factor
0355    */
0356   double factorizationScaleFactor() const { return theFactorizationScaleFactor; }
0357 
0358   /**
0359    * Get the renormalization scale factor
0360    */
0361   double renormalizationScaleFactor() const { return theRenormalizationScaleFactor; }
0362 
0363   /**
0364    * Set the factorization scale factor
0365    */
0366   void factorizationScaleFactor(double f) { theFactorizationScaleFactor = f; }
0367 
0368   /**
0369    * Set the renormalization scale factor
0370    */
0371   void renormalizationScaleFactor(double f) { theRenormalizationScaleFactor = f; }
0372 
0373   /**
0374    * Determine if the configuration is below or above the cutoff.
0375    */
0376   virtual void checkCutoff();
0377 
0378   /**
0379    * Determine all kinematic variables which are not provided by the
0380    * dipole kinematics; store all shower variables in the respective
0381    * dipole object for later use.
0382    */
0383   virtual void getShowerVariables();
0384 
0385   /**
0386    * Return the shower approximation to the real emission cross
0387    * section for the given pair of Born and real emission
0388    * configurations.
0389    */
0390   virtual CrossSection dSigHatDR() const = 0;
0391 
0392   /**
0393    * Return the shower approximation splitting kernel for the given
0394    * pair of Born and real emission configurations in units of the
0395    * Born center of mass energy squared, and including a weight to
0396    * project onto the splitting given by the dipole used.
0397    */
0398   virtual double me2() const = 0;
0399 
0400   /**
0401    * Return the Born PDF weight
0402    */
0403   double bornPDFWeight(Energy2 muF) const;
0404 
0405   /**
0406    * Return the real emission PDF weight
0407    */
0408   double realPDFWeight(Energy2 muF) const;
0409 
0410 protected:
0411 
0412   /**
0413    * Return true, if the shower was able to generate an emission
0414    * leading from the given Born to the given real emission process.
0415    */
0416   virtual bool isInShowerPhasespace() const;
0417 
0418   /**
0419    * Return true, if the shower emission leading from the given Born
0420    * to the given real emission process would have been generated
0421    * above the shower's infrared cutoff.
0422    */
0423   virtual bool isAboveCutoff() const;
0424 
0425   /**
0426    * Return the relevant hard scale
0427    */
0428   virtual Energy hardScale() const;
0429 
0430   /**
0431    * Use the maximum available phase space for the momentum fraction
0432    */
0433   void useOpenZ(bool yes) { theOpenZ = yes; }
0434 
0435   /**
0436    * Return true if the maximum available phase space should be used
0437    * for the momentum fraction
0438    */
0439   bool openZ() const { return theOpenZ; }
0440 
0441 public:
0442 
0443   /**
0444    * Generate a weight for the given dipole channel
0445    */
0446   virtual double channelWeight(int emitter, int emission, 
0447                    int spectator, int bemitter) const;
0448 
0449   /**
0450    * Generate a normalized weight taking into account all channels
0451    */
0452   virtual double channelWeight() const;
0453 
0454 public:
0455 
0456   /** @name Functions used by the persistent I/O system. */
0457   //@{
0458   /**
0459    * Function used to write out object persistently.
0460    * @param os the persistent output stream written to.
0461    */
0462   void persistentOutput(PersistentOStream & os) const;
0463 
0464   /**
0465    * Function used to read in object persistently.
0466    * @param is the persistent input stream read from.
0467    * @param version the version number of the object when written.
0468    */
0469   void persistentInput(PersistentIStream & is, int version);
0470   //@}
0471 
0472   /**
0473    * The standard Init function used to initialize the interfaces.
0474    * Called exactly once for each class by the class description system
0475    * before the main function starts or
0476    * when this class is dynamically loaded.
0477    */
0478   static void Init();
0479 
0480 
0481 protected:
0482 
0483   /** @name Standard Interfaced functions. */
0484   //@{
0485   /**
0486    * Initialize this object after the setup phase before saving an
0487    * EventGenerator to disk.
0488    * @throws InitException if object could not be initialized properly.
0489    */
0490   virtual void doinit();
0491   //@}
0492 
0493 
0494 // If needed, insert declarations of virtual function defined in the
0495 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0496 
0497 public:
0498 
0499   /**
0500    * A large-N colour basis to be used when reproducing the shower
0501    * kernels.
0502    */
0503   Ptr<ColourBasis>::tptr largeNBasis() const { return theLargeNBasis; }
0504 
0505 protected:
0506 
0507   /**
0508    * A large-N colour basis to be used when reproducing the shower
0509    * kernels.
0510    */
0511   Ptr<ColourBasis>::ptr theLargeNBasis;
0512 
0513   /**
0514    * Set the large-N basis
0515    */
0516   void setLargeNBasis();
0517 
0518   /**
0519    * The x value from which on we extrapolate PDFs for numerically stable ratios.
0520    */
0521   double theExtrapolationX;
0522 
0523 private:
0524 
0525   /**
0526    * The XComb object describing the Born process
0527    */
0528   tStdXCombPtr theBornXComb;
0529 
0530   /**
0531    * The XComb object describing the real emission process
0532    */
0533   tStdXCombPtr theRealXComb;
0534 
0535   /**
0536    * The tilde xcomb objects associated to the real xcomb
0537    */
0538   vector<StdXCombPtr> theTildeXCombs;
0539 
0540   /**
0541    * The dipole in charge for the emission
0542    */
0543   Ptr<SubtractionDipole>::tptr theDipole;
0544 
0545   /**
0546    * True if one of the recently encountered configutations was below
0547    * the infrared cutoff.
0548    */
0549   bool theBelowCutoff;
0550 
0551   /**
0552    * The pt cut to be applied for final-final dipoles.
0553    */
0554   Energy theFFPtCut;
0555 
0556   /**
0557    * An optional screening scale for final-final dipoles; see
0558    * DipoleSplittingKernel
0559    */
0560   Energy theFFScreeningScale;
0561 
0562   /**
0563    * The pt cut to be applied for final-initial dipoles.
0564    */
0565   Energy theFIPtCut;
0566 
0567   /**
0568    * An optional screening scale for final-initial dipoles; see
0569    * DipoleSplittingKernel
0570    */
0571   Energy theFIScreeningScale;
0572 
0573   /**
0574    * The pt cut to be applied for initial-initial dipoles.
0575    */
0576   Energy theIIPtCut;
0577 
0578   /**
0579    * An optional screening scale for initial-initial dipoles; see
0580    * DipoleSplittingKernel
0581    */
0582   Energy theIIScreeningScale;
0583 
0584   /**
0585    * The cut to be applied as an enhanced shower cutoff.
0586    */
0587   Energy theSafeCut;
0588 
0589   /**
0590    * True, if the phase space restrictions of the dipole shower should
0591    * be applied.
0592    */
0593   bool theRestrictPhasespace;
0594 
0595   /**
0596    * The scale factor for the hard scale
0597    */
0598   double theHardScaleFactor;
0599 
0600   /**
0601    * The scale factor for the renormalization scale
0602    */
0603   double theRenormalizationScaleFactor;
0604 
0605   /**
0606    * The scale factor for the factorization scale
0607    */
0608   double theFactorizationScaleFactor;
0609 
0610   /**
0611    * The scale choice in the real emission cross section to be
0612    * used in the matching subtraction.
0613    */
0614   int theRealEmissionScaleInSubtraction;
0615 
0616   /**
0617    * The scale choice in the born cross section to be
0618    * used in the matching subtraction.
0619    */
0620   int theBornScaleInSubtraction;
0621 
0622   /**
0623    * The scale choice in the emission contribution to be
0624    * used in the matching subtraction.
0625    */
0626   int theEmissionScaleInSubtraction;
0627 
0628   /**
0629    * The scale choice in the real emission cross section to be
0630    * used in the splitting.
0631    */
0632   int theRealEmissionScaleInSplitting;
0633 
0634   /**
0635    * The scale choice in the born cross section to be
0636    * used in the splitting.
0637    */
0638   int theBornScaleInSplitting;
0639 
0640   /**
0641    * The scale choice in the emission contribution to be
0642    * used in the splitting.
0643    */
0644   int theEmissionScaleInSplitting;
0645 
0646   /**
0647    * A freezing value for the renormalization scale
0648    */
0649   Energy theRenormalizationScaleFreeze;
0650 
0651   /**
0652    * A freezing value for the factorization scale
0653    */
0654   Energy theFactorizationScaleFreeze;
0655 
0656   /**
0657    * True if maximum pt should be deduced from the factorization scale
0658    */
0659   bool maxPtIsMuF;
0660 
0661   /**
0662    * The profile scales
0663    */
0664   Ptr<HardScaleProfile>::ptr theHardScaleProfile;
0665 
0666   /**
0667    * Use the maximum available phase space for the momentum fraction
0668    */
0669   bool theOpenZ;
0670 
0671 private:
0672 
0673   /**
0674    * The assignment operator is private and must never be called.
0675    * In fact, it should not even be implemented.
0676    */
0677   ShowerApproximation & operator=(const ShowerApproximation &) = delete;
0678 
0679 };
0680 
0681 }
0682 
0683 #endif /* Herwig_ShowerApproximation_H */