Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:27

0001 // -*- C++ -*-
0002 //
0003 // ReweightConstant.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG 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 THEPEG_ReweightConstant_H
0010 #define THEPEG_ReweightConstant_H
0011 //
0012 // This is the declaration of the ReweightConstant class.
0013 //
0014 
0015 #include "ThePEG/MatrixElement/ReweightBase.h"
0016 
0017 namespace ThePEG {
0018 
0019 /**
0020  * The ReweightConstant class is a simple ReweightBase sub-class which
0021  * simply reweight an event with a constant.
0022  *
0023  * @see \ref ReweightConstantInterfaces "The interfaces"
0024  * defined for ReweightConstant.
0025  */
0026 class ReweightConstant: public ReweightBase {
0027 
0028 public:
0029 
0030   /** @name Standard constructors and destructors. */
0031   //@{
0032   /**
0033    * The default constructor.
0034    */
0035   ReweightConstant() : C(1.0) {}
0036   //@}
0037 
0038 public:
0039 
0040   /**
0041    * Return the wieght for the kinematical configuation provided by
0042    * the assigned XComb object (in the LastXCombInfo base class).
0043    */
0044   virtual double weight() const;
0045 
0046 public:
0047 
0048   /** @name Functions used by the persistent I/O system. */
0049   //@{
0050   /**
0051    * Function used to write out object persistently.
0052    * @param os the persistent output stream written to.
0053    */
0054   void persistentOutput(PersistentOStream & os) const;
0055 
0056   /**
0057    * Function used to read in object persistently.
0058    * @param is the persistent input stream read from.
0059    * @param version the version number of the object when written.
0060    */
0061   void persistentInput(PersistentIStream & is, int version);
0062   //@}
0063 
0064   /**
0065    * The standard Init function used to initialize the interfaces.
0066    * Called exactly once for each class by the class description system
0067    * before the main function starts or
0068    * when this class is dynamically loaded.
0069    */
0070   static void Init();
0071 
0072 protected:
0073 
0074   /** @name Clone Methods. */
0075   //@{
0076   /**
0077    * Make a simple clone of this object.
0078    * @return a pointer to the new object.
0079    */
0080   virtual IBPtr clone() const;
0081 
0082   /** Make a clone of this object, possibly modifying the cloned object
0083    * to make it sane.
0084    * @return a pointer to the new object.
0085    */
0086   virtual IBPtr fullclone() const;
0087   //@}
0088 
0089 private:
0090 
0091   /**
0092    * The constant to reweight with.
0093    */
0094   double C;
0095 
0096 private:
0097 
0098   /**
0099    * The static object used to initialize the description of this class.
0100    * Indicates that this is a concrete class with persistent data.
0101    */
0102   static ClassDescription<ReweightConstant> initReweightConstant;
0103 
0104   /**
0105    * The assignment operator is private and must never be called.
0106    * In fact, it should not even be implemented.
0107    */
0108   ReweightConstant & operator=(const ReweightConstant &) = delete;
0109 
0110 };
0111 
0112 }
0113 
0114 #include "ThePEG/Utilities/ClassTraits.h"
0115 
0116 namespace ThePEG {
0117 
0118 /** @cond TRAITSPECIALIZATIONS */
0119 
0120 /** This template specialization informs ThePEG about the
0121  *  base classes of ReweightConstant. */
0122 template <>
0123 struct BaseClassTrait<ReweightConstant,1> {
0124   /** Typedef of the first base class of ReweightConstant. */
0125   typedef ReweightBase NthBase;
0126 };
0127 
0128 /** This template specialization informs ThePEG about the name of
0129  *  the ReweightConstant class and the shared object where it is defined. */
0130 template <>
0131 struct ClassTraits<ReweightConstant>
0132   : public ClassTraitsBase<ReweightConstant> {
0133   /** Return a platform-independent class name */
0134   static string className() { return "ThePEG::ReweightConstant"; }
0135   /** Return the name of the shared library be loaded to get
0136    *  access to the ReweightConstant class and every other class it uses
0137    *  (except the base class). */
0138   static string library() { return "ReweightConstant.so"; }
0139 };
0140 
0141 /** @endcond */
0142 
0143 }
0144 
0145 #endif /* THEPEG_ReweightConstant_H */