Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // ReweightBase.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_ReweightBase_H
0010 #define ThePEG_ReweightBase_H
0011 // This is the declaration of the ReweightBase class.
0012 
0013 #include "ThePEG/Handlers/HandlerBase.h"
0014 #include "ThePEG/EventRecord/SubProcess.h"
0015 #include "ThePEG/Handlers/LastXCombInfo.h"
0016 #include "ThePEG/Handlers/StandardXComb.fh"
0017 
0018 namespace ThePEG {
0019 
0020 /**
0021  * The ReweightBase class is the base class of all objects
0022  * representing external biases to matrix elements. These can be used
0023  * to enhance certain matrix elements or certain phase space
0024  * regions. They can be used in two ways, either to completely change
0025  * the matrix element (re-weight), in which case the total cross
0026  * section will be affected or, when using weighted events in an
0027  * EventHandler, to pre-weight certain events but leaving the cross
0028  * section unchanged
0029  *
0030  * There is only one virtual function which must be overridden in
0031  * derived classes: weight().
0032  *
0033  * @see \ref ReweightBaseInterfaces "The interfaces"
0034  * defined for ReweightBase.
0035  * @see MEBase
0036  * @see EventHandler
0037  * @see SubProcessHandler
0038  */
0039 class ReweightBase: public HandlerBase, public LastXCombInfo<> {
0040 
0041 public:
0042  
0043   /** @name Standard constructors and destructors. */
0044   //@{
0045   
0046   /**
0047    * Destructor.
0048    */
0049   virtual ~ReweightBase();
0050   //@}
0051   
0052 public:
0053 
0054   /**
0055    * Return the wieght for the kinematical configuation provided by
0056    * the assigned XComb object (in the LastXCombInfo base class).
0057    */
0058   virtual double weight() const = 0;
0059 
0060   /**
0061    * Assigne an XComb object with information about the sub-process to
0062    * be used in the reweighting.
0063    */
0064   void setXComb(tXCombPtr xc);
0065 
0066 public:
0067 
0068   /** @name Functions used by the persistent I/O system. */
0069   //@{
0070   /**
0071    * Function used to write out object persistently.
0072    * @param os the persistent output stream written to.
0073    */
0074   void persistentOutput(PersistentOStream & os) const;
0075 
0076   /**
0077    * Function used to read in object persistently.
0078    * @param is the persistent input stream read from.
0079    * @param version the version number of the object when written.
0080    */
0081   void persistentInput(PersistentIStream & is, int version);
0082   //@}
0083 
0084   /**
0085    * Standard Init function used to initialize the interfaces.
0086    */
0087   static void Init();
0088 
0089 private:
0090 
0091   /**
0092    * Describe an abstract base class with persistent data.
0093    */
0094   static AbstractClassDescription<ReweightBase> initReweightBase;
0095 
0096   /**
0097    *  Private and non-existent assignment operator.
0098    */
0099   ReweightBase & operator=(const ReweightBase &) = delete;
0100 
0101 };
0102 
0103 }
0104 
0105 
0106 namespace ThePEG {
0107 
0108 /** @cond TRAITSPECIALIZATIONS */
0109 
0110 /**
0111  * This template specialization informs ThePEG about the base class of
0112  * ReweightBase.
0113  */
0114 template <>
0115 struct BaseClassTrait<ReweightBase,1>: public ClassTraitsType {
0116   /** Typedef of the base class of ReweightBase. */
0117   typedef HandlerBase NthBase;
0118 };
0119 
0120 /**
0121  * This template specialization informs ThePEG about the name of the
0122  * ReweightBase class.
0123  */
0124 template <>
0125 struct ClassTraits<ReweightBase>: public ClassTraitsBase<ReweightBase> {
0126   /** Return the class name. */
0127   static string className() { return "ThePEG::ReweightBase"; }
0128 };
0129 
0130 /** @endcond */
0131 
0132 }
0133 
0134 #endif /* ThePEG_ReweightBase_H */