Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Reshuffler.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_Reshuffler_H
0010 #define HERWIG_Reshuffler_H
0011 //
0012 // This is the declaration of the Reshuffler class.
0013 //
0014 
0015 #include "ThePEG/Config/ThePEG.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * \author Simon Platzer, Stephen Webster
0023  * 
0024  * \brief The Reshuffler class implements reshuffling
0025  * of partons on their nominal mass shell to their constituent 
0026  * mass shells.
0027  *
0028  */
0029 class Reshuffler {
0030 
0031 protected:
0032 
0033   /**
0034    * The function object defining the equation
0035    * to be solved.
0036    */
0037   template<class PIterator, class MIterator>
0038   struct ReshuffleEquation {
0039 
0040     ReshuffleEquation (Energy q,
0041                PIterator pp_begin,
0042                PIterator pp_end,
0043                MIterator mm_begin,
0044                MIterator mm_end)
0045       : w(q), p_begin(pp_begin), p_end(pp_end),
0046     m_begin(mm_begin), m_end(mm_end) {}
0047 
0048     typedef double ArgType;
0049     typedef double ValType;
0050 
0051     static double aUnit() { return 1.; }
0052     static double vUnit() { return 1.; }
0053 
0054     double operator() (double xi) const {
0055       double r = - w/GeV;
0056       PIterator p = p_begin;
0057       MIterator m = m_begin;
0058       for (; p != p_end; ++p, ++m) {
0059     r += sqrt(sqr(*m) +
0060           xi*xi*(sqr((**p).momentum().t())-sqr((**p).dataPtr()->mass()))) / GeV;
0061       }
0062       return r;  
0063     }
0064 
0065     Energy w;
0066 
0067     PIterator p_begin;
0068     PIterator p_end;
0069 
0070     MIterator m_begin;
0071     MIterator m_end;
0072 
0073   };
0074 
0075   /**
0076    * Reshuffle to consitutent masses
0077    */
0078   void reshuffle(const PVector& particles,
0079          const vector<Energy>& masses) const;
0080 
0081 };
0082 
0083 }
0084 
0085 #endif /* HERWIG_Reshuffler_H */
0086