Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef Herwig_SpinHadronizer_H
0003 #define Herwig_SpinHadronizer_H
0004 //
0005 // This is the declaration of the SpinHadronizer class.
0006 //
0007 
0008 #include "ThePEG/Handlers/StepHandler.h"
0009 
0010 namespace Herwig {
0011 
0012 using namespace ThePEG;
0013 
0014 /**
0015  * The SpinHadronizer class is designed to be used as a post-hadronization handler to
0016  * give a simple model of spin transfer between the perturbative and non-perturbative
0017  * stages.
0018  *
0019  * @see \ref SpinHadronizerInterfaces "The interfaces"
0020  * defined for SpinHadronizer.
0021  */
0022 class SpinHadronizer: public StepHandler {
0023 
0024 public:
0025 
0026   /**
0027    * The default constructor.
0028    */
0029   SpinHadronizer() : omegaHalf_(2./3.), omegaThreeHalf_(0.2),
0030         minFlav_(3), maxFlav_(5), debug_(false), qPol_(6,make_pair(0.,0.))
0031   {}
0032 
0033 public:
0034 
0035   /** @name Virtual functions required by the StepHandler class. */
0036   //@{
0037   /**
0038     * The main function called by the EventHandler class to
0039     * perform a step. Given the current state of an Event, this function
0040     * performs the event generation step and includes the result in a new
0041     * Step object int the Event record.
0042     * @param eh the EventHandler in charge of the Event generation.
0043     * @param tagged if not empty these are the only particles which should
0044     * be considered by the StepHandler.
0045     * @param hint a Hint object with possible information from previously
0046     * performed steps.
0047     * @throws Veto if the StepHandler requires the current step to be discarded.
0048     * @throws Stop if the generation of the current Event should be stopped
0049     * after this call.
0050     * @throws Exception if something goes wrong.
0051     */
0052   virtual void handle(EventHandler & eh, const tPVector & tagged,
0053               const Hint & hint);
0054   //@}
0055 
0056 public:
0057 
0058   /** @name Functions used by the persistent I/O system. */
0059   //@{
0060   /**
0061    * Function used to write out object persistently.
0062    * @param os the persistent output stream written to.
0063    */
0064   void persistentOutput(PersistentOStream & os) const;
0065 
0066   /**
0067    * Function used to read in object persistently.
0068    * @param is the persistent input stream read from.
0069    * @param version the version number of the object when written.
0070    */
0071   void persistentInput(PersistentIStream & is, int version);
0072   //@}
0073 
0074   /**
0075    * The standard Init function used to initialize the interfaces.
0076    * Called exactly once for each class by the class description system
0077    * before the main function starts or
0078    * when this class is dynamically loaded.
0079    */
0080   static void Init();
0081 
0082 protected:
0083 
0084   /**
0085    *  Functions to calculate the spins
0086    */
0087   //@{
0088 
0089   /**
0090    *  Calculate the spin of a baryon
0091    */
0092   void baryonSpin(tPPtr baryon);
0093 
0094   /**
0095    *  Calculate the spin of a meson
0096    */
0097   void mesonSpin(tPPtr meson);
0098 
0099   //@}
0100 
0101 protected:
0102 
0103   /** @name Standard Interfaced functions. */
0104   //@{
0105   /**
0106    * Initialize this object after the setup phase before saving an
0107    * EventGenerator to disk.
0108    * @throws InitException if object could not be initialized properly.
0109    */
0110   virtual void doinit();
0111 
0112   /**
0113    * Initialize this object. Called in the run phase just before
0114    * a run begins.
0115    */
0116   virtual void doinitrun();
0117 
0118   /**
0119    * Finalize this object. Called in the run phase just after a
0120    * run has ended. Used eg. to write out statistics.
0121    */
0122   virtual void dofinish();
0123   //@}
0124 
0125 protected:
0126 
0127   /** @name Clone Methods. */
0128   //@{
0129   /**
0130    * Make a simple clone of this object.
0131    * @return a pointer to the new object.
0132    */
0133   virtual IBPtr clone() const;
0134 
0135   /** Make a clone of this object, possibly modifying the cloned object
0136    * to make it sane.
0137    * @return a pointer to the new object.
0138    */
0139   virtual IBPtr fullclone() const;
0140   //@}
0141 
0142 private:
0143 
0144   /**
0145    * The assignment operator is private and must never be called.
0146    * In fact, it should not even be implemented.
0147    */
0148   SpinHadronizer & operator=(const SpinHadronizer &) = delete;
0149 
0150 private:
0151 
0152   /**
0153    *  Parameters
0154    */
0155   //@{
0156   /**
0157    *  Falk-Peskin \f$\omega_\frac12\f$ parameter
0158    */
0159   double omegaHalf_;
0160 
0161   /**
0162    *  Falk-Peskin \f$\omega_\frac32\f$ parameter
0163    */
0164   double omegaThreeHalf_;
0165 
0166   /**
0167    *  Minimum quark flavour
0168    */
0169   unsigned int minFlav_;
0170 
0171   /**
0172    *  Maximum quark flavour
0173    */
0174   unsigned int maxFlav_;
0175 
0176   /**
0177    *  Print out debugging info
0178    */
0179   bool debug_;
0180 
0181   /**
0182    *  Polarization of the quarks
0183    */
0184   vector<pair<double,double> > qPol_;
0185   //@}
0186 
0187 };
0188 
0189 }
0190 
0191 #endif /* Herwig_SpinHadronizer_H */