Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // HwDecayerBase.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_HwDecayerBase_H
0010 #define HERWIG_HwDecayerBase_H
0011 //
0012 // This is the declaration of the HwDecayerBase class.
0013 //
0014 
0015 #include "ThePEG/PDT/Decayer.h"
0016 #include "Herwig/Shower/RealEmissionProcess.fh"
0017 #include "HwDecayerBase.fh"
0018 
0019 namespace Herwig {
0020 
0021 struct Branching;
0022 
0023 using namespace ThePEG;
0024 
0025 /**
0026  * The HwDecayerBase class is the base class for Decayers in Herwig. It inherits
0027  * from the Decayer class of ThePEG and implements additional functionality for the 
0028  * output of the results to the particle database and initialization of the datbase.
0029  *
0030  * It also provide the option of specifying a class based on the DecayRadiationGenerator
0031  * which should be used to generate QED radiation in the decay
0032  *
0033  * @see \ref HwDecayerBaseInterfaces "The interfaces"
0034  * defined for HwDecayerBase.
0035 
0036  */
0037 class HwDecayerBase: public Decayer {
0038 
0039 public:
0040 
0041   /**
0042    * The default constructor.
0043    */
0044   HwDecayerBase() : _initialize(false), _dbOutput(false) {}
0045 
0046   /** @name Virtual functions required by the Decayer class. */
0047   //@{
0048   /**
0049    * Check if this decayer can perfom the decay specified by the
0050    * given decay mode.
0051    * @param dm the DecayMode describing the decay.
0052    * @return true if this decayer can handle the given mode, otherwise false.
0053    */
0054   virtual bool accept(const DecayMode & dm) const;
0055 
0056   /**
0057    * Perform a decay for a given DecayMode and a given Particle instance.
0058    * @param dm the DecayMode describing the decay.
0059    * @param p the Particle instance to be decayed.
0060    * @return a ParticleVector containing the decay products.
0061    */
0062   virtual ParticleVector decay(const DecayMode & dm, const Particle & p) const;
0063   //@}
0064 
0065 public:
0066 
0067   /**
0068    *  Virtual members to be overridden by inheriting classes
0069    *  which implement hard corrections 
0070    */
0071   //@{
0072   
0073   /**
0074    * Type of POWHEG correction
0075    */
0076   enum POWHEGType {No, ISR, FSR, Both};
0077 
0078 
0079   /**
0080    *  Has a POWHEG style correction
0081    */
0082   virtual POWHEGType hasPOWHEGCorrection() {return No;}
0083 
0084 
0085   /**
0086    *  Has an old fashioned ME correction
0087    */
0088   virtual bool hasMECorrection() {return false;}
0089 
0090   /**
0091    *  Initialize the ME correction
0092    */
0093   virtual void initializeMECorrection(RealEmissionProcessPtr , double & ,
0094                       double & );
0095 
0096   /**
0097    *  Apply the hard matrix element correction to a given hard process or decay
0098    */
0099   virtual RealEmissionProcessPtr applyHardMatrixElementCorrection(RealEmissionProcessPtr);
0100 
0101   /**
0102    * Apply the soft matrix element correction
0103    * @param parent The initial particle in the current branching
0104    * @param progenitor The progenitor particle of the jet
0105    * @param fs Whether the emission is initial or final-state
0106    * @param highestpT The highest pT so far in the shower
0107    * @param ids ids of the particles produced in the branching
0108    * @param z The momentum fraction of the branching
0109    * @param scale the evolution scale of the branching
0110    * @param pT The transverse momentum of the branching
0111    * @return If true the emission should be vetoed
0112    */
0113   virtual bool softMatrixElementVeto(PPtr parent,
0114                      PPtr progenitor,
0115                      const bool & fs,
0116                      const Energy & highestpT,
0117                      const vector<tcPDPtr> & ids,
0118                      const double & z,
0119                      const Energy & scale,
0120                      const Energy & pT);
0121 
0122   /**
0123    *  Apply the POWHEG style correction
0124    */
0125   virtual RealEmissionProcessPtr generateHardest(RealEmissionProcessPtr);
0126   //@}
0127 
0128 protected:
0129 
0130   /** @name Virtual functions to replaced those from the Decayer class. 
0131    *  This is so that the decay and accept members of this class can handle all
0132    *  the more complicated features of the DecayMode class
0133    */
0134   //@{
0135   /**
0136    * Check if this decayer can perfom the decay for a particular mode
0137    * @param parent The decaying particle
0138    * @param children The decay products
0139    * @return true If this decayer can handle the given mode, otherwise false.
0140    */
0141   virtual bool accept(tcPDPtr parent, const tPDVector & children) const = 0;
0142   
0143   /**
0144    *  Perform the decay of the particle to the specified decay products
0145    * @param parent The decaying particle
0146    * @param children The decay products
0147    * @return a ParticleVector containing the decay products.
0148    */
0149   virtual ParticleVector decay(const Particle & parent,
0150                    const tPDVector & children) const = 0;
0151   //@}
0152 
0153 public:
0154 
0155   /** @name Functions used by the persistent I/O system. */
0156   //@{
0157   /**
0158    * Function used to write out object persistently.
0159    * @param os the persistent output stream written to.
0160    */
0161   void persistentOutput(PersistentOStream & os) const;
0162 
0163   /**
0164    * Function used to read in object persistently.
0165    * @param is the persistent input stream read from.
0166    * @param version the version number of the object when written.
0167    */
0168   void persistentInput(PersistentIStream & is, int version);
0169   //@}
0170 
0171   /**
0172    * The standard Init function used to initialize the interfaces.
0173    * Called exactly once for each class by the class description system
0174    * before the main function starts or
0175    * when this class is dynamically loaded.
0176    */
0177   static void Init();
0178 
0179 public:
0180 
0181   /**
0182    *  Functions for the Herwig decayer
0183    */
0184   //@{
0185   /**
0186    * Output the setup information for the particle database
0187    * @param os The stream to output the information to
0188    * @param header Whether or not to output the information for MySQL
0189    */
0190   virtual void dataBaseOutput(ofstream & os,bool header) const = 0;
0191 
0192   /**
0193    *  Access to the initialize variable
0194    */
0195   bool initialize() const {return _initialize;}
0196 
0197   /**
0198    *  Access the database output variable
0199    */
0200   bool databaseOutput() const {return _dbOutput;}
0201   //@}
0202 
0203 protected:
0204 
0205   /**
0206    * Set rho to be diagonal if no correlations
0207    */
0208   void fixRho(RhoDMatrix &) const;
0209   
0210 protected:
0211 
0212   /** @name Standard Interfaced functions. */
0213   //@{
0214   /**
0215    * Finalize this object. Called in the run phase just after a
0216    * run has ended. Used eg. to write out statistics.
0217    */
0218   virtual void dofinish();
0219   //@}
0220 
0221 private:
0222 
0223   /**
0224    * The assignment operator is private and must never be called.
0225    * In fact, it should not even be implemented.
0226    */
0227   HwDecayerBase & operator=(const HwDecayerBase &) = delete;
0228 
0229 private:
0230 
0231   /**
0232    * perform initialisation
0233    */
0234   bool _initialize;
0235 
0236   /**
0237    * Print out database  
0238    */
0239   bool _dbOutput;
0240 };
0241 
0242 }
0243 
0244 #endif /* HERWIG_HwDecayerBase_H */