Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef Herwig_BSMModel_H
0003 #define Herwig_BSMModel_H
0004 //
0005 // This is the declaration of the BSMModel class.
0006 //
0007 
0008 #include "Herwig/Models/StandardModel/StandardModel.h"
0009 #include "ThePEG/Utilities/CFileLineReader.h"
0010 
0011 namespace Herwig {
0012 
0013 using namespace ThePEG;
0014 
0015 /**
0016  * Here is the documentation of the BSMModel class.
0017  *
0018  * @see \ref BSMModelInterfaces "The interfaces"
0019  * defined for BSMModel.
0020  */
0021 class BSMModel: public Herwig::StandardModel {
0022 
0023 public:
0024 
0025   /**
0026    * The default constructor.
0027    */
0028   BSMModel();
0029 
0030 public:
0031 
0032   /** @name Functions used by the persistent I/O system. */
0033   //@{
0034   /**
0035    * Function used to write out object persistently.
0036    * @param os the persistent output stream written to.
0037    */
0038   void persistentOutput(PersistentOStream & os) const;
0039 
0040   /**
0041    * Function used to read in object persistently.
0042    * @param is the persistent input stream read from.
0043    * @param version the version number of the object when written.
0044    */
0045   void persistentInput(PersistentIStream & is, int version);
0046   //@}
0047 
0048   /**
0049    * The standard Init function used to initialize the interfaces.
0050    * Called exactly once for each class by the class description system
0051    * before the main function starts or
0052    * when this class is dynamically loaded.
0053    */
0054   static void Init();
0055 
0056 protected:
0057 
0058   /**
0059    * Get name of SLHA decay file
0060    */
0061   const string & decayFile() const {return decayFile_;}
0062 
0063   /**
0064    * Set name of SLHA decay file
0065    */
0066   void decayFile(string in) {decayFile_ = in;}
0067 
0068   /**
0069    *  Read the decays
0070    */
0071   void decayRead();
0072 
0073   /**
0074    * Read decaymodes from LHA file
0075    * @param ifs input stream containg data
0076    * @param decay string containing name of parent and value of total width
0077    */
0078   void readDecay(CFileLineReader & ifs, string decay) const;
0079 
0080   /**
0081    * Create a DecayMode object in the repository
0082    * @param tag The tag identifying the decay mode including the prefix
0083    * 'decaymode'
0084    * @param brat Branching ratio of this mode 
0085    */
0086   void createDecayMode(string tag, double brat) const;
0087 
0088   /**
0089    * Create a DecayMode object in the repository
0090    * @param tag The tag identifying the decay mode including the prefix
0091    * 'decaymode'
0092    * @param brat Branching ratio of this mode 
0093    */
0094   vector<pair<double,string> > createWZDecayModes(string tag, double brat,
0095                           tcPDPtr boson,
0096                           Energy maxMass) const;
0097 
0098   /**
0099    *  read the decays
0100    */
0101   bool readDecays() const {return readDecays_;}
0102 
0103   /**
0104    *  set the reading of the decays
0105    */ 
0106   void readDecays(bool in) {readDecays_=in;}
0107 
0108   /**
0109    *  Map of PDG ids from file to those used internally
0110    */
0111   map<long,long> & idMap() {return idMap_;}
0112 
0113   /**
0114    *  Get ParticleData object with Id mapping
0115    */
0116   PDPtr getBSMParticleData(PID id) const {
0117     map<long,long>::const_iterator it = idMap_.find(id);
0118     if(it==idMap_.end())
0119       return getParticleData(id);
0120     else
0121       return getParticleData(it->second);
0122   }
0123 
0124 protected:
0125 
0126   /** @name Standard Interfaced functions. */
0127   //@{
0128   /**
0129    * Initialize this object after the setup phase before saving an
0130    * EventGenerator to disk.
0131    * @throws InitException if object could not be initialized properly.
0132    */
0133   virtual void doinit();
0134   //@}
0135 
0136   /**
0137    * Overloaded function from Interfaced
0138    */
0139   virtual bool preInitialize() const {
0140     return true;
0141   }
0142 
0143 private:
0144 
0145   /**
0146    * The assignment operator is private and must never be called.
0147    * In fact, it should not even be implemented.
0148    */
0149   BSMModel & operator=(const BSMModel &) = delete;
0150 
0151 private:
0152 
0153   /**
0154    *  Name of the decay file
0155    */
0156   string decayFile_;
0157 
0158   /**
0159    *  Read the decays from the file
0160    */
0161   bool readDecays_;
0162 
0163   /**
0164    * Whether or not to replace the top decay modes with those from
0165    * the SLHA files
0166    */
0167   bool topModesFromFile_;
0168 
0169   /**
0170    *  Tolerance for branching ratios
0171    */
0172   double tolerance_;
0173 
0174   /**
0175    *  Map of ids from files to those used by Herwig
0176    */
0177   map<long,long> idMap_;
0178 
0179   /**
0180    *  Whether or not to allow the width of SM particles to be reset
0181    */
0182   bool allowedToResetSMWidths_;
0183 
0184 };
0185 
0186 }
0187 
0188 #endif /* Herwig_BSMModel_H */