Page MenuHomeHEPForge

No OneTemporary

diff --git a/PDF/WeiszackerWilliamsPDF.cc b/PDF/WeiszackerWilliamsPDF.cc
--- a/PDF/WeiszackerWilliamsPDF.cc
+++ b/PDF/WeiszackerWilliamsPDF.cc
@@ -1,85 +1,90 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the WeiszackerWilliamsPDF class.
//
#include "WeiszackerWilliamsPDF.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/PDT/ParticleData.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/StandardModel/StandardModelBase.h"
#include "ThePEG/Repository/EventGenerator.h"
using namespace Herwig;
+WeiszackerWilliamsPDF::WeiszackerWilliamsPDF()
+ : _q2min(0.*GeV2), _q2max(4.*GeV2)
+{}
+
bool WeiszackerWilliamsPDF::canHandleParticle(tcPDPtr particle) const {
return ( abs(particle->id()) == ParticleID::eminus ||
abs(particle->id()) == ParticleID::muminus );
}
cPDVector WeiszackerWilliamsPDF::partons(tcPDPtr) const {
// only photon
return cPDVector(1,getParticleData(ParticleID::gamma));
}
-double WeiszackerWilliamsPDF::xfl(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
+double WeiszackerWilliamsPDF::xfl(tcPDPtr particle, tcPDPtr parton, Energy2,
double l, Energy2 ) const {
if(parton->id()!=ParticleID::gamma) return 0.;
double x(exp(-l));
- return 0.5*SM().alphaEM()/Constants::pi*(1.+sqr(1.-x))/x
- *log(partonScale/sqr(particle->mass()));
+ // remember this is x fx so no x in the denominator!!
+ return 0.5*SM().alphaEM()/Constants::pi*(1.+sqr(1.-x));
}
double WeiszackerWilliamsPDF::xfvl(tcPDPtr, tcPDPtr, Energy2, double,
Energy2) const {
// valence density is zero
return 0.0;
}
NoPIOClassDescription<WeiszackerWilliamsPDF>
WeiszackerWilliamsPDF::initWeiszackerWilliamsPDF;
// Definition of the static class description member.
void WeiszackerWilliamsPDF::Init() {
static ClassDocumentation<WeiszackerWilliamsPDF> documentation
("The WeiszackerWilliamsPDF provides the PDF for a photon inside"
" an incoming lepton in the Weisszacker-Williams approximation");
static Parameter<WeiszackerWilliamsPDF,Energy2> interfaceQ2Min
("Q2Min",
"Minimum value of the magnitude of Q^2 for the photon",
&WeiszackerWilliamsPDF::_q2min, GeV2, 0.0*GeV2, 0.0*GeV2, 100.0*GeV2,
false, false, Interface::limited);
static Parameter<WeiszackerWilliamsPDF,Energy2> interfaceQ2Max
("Q2Max",
"Maximum value of the magnitude of Q^2 for the photon",
&WeiszackerWilliamsPDF::_q2max, GeV2, 4.0*GeV2, 0.0*GeV2, 100.0*GeV2,
false, false, Interface::limited);
}
double WeiszackerWilliamsPDF::
flattenScale(tcPDPtr a, tcPDPtr b, const PDFCuts & c,
double l, double z, double & jacobian) const {
double x = exp(-l);
- Energy2 qqmax = min(_q2max,sqr(x)*c.sMax());
- Energy2 qqmin = max(_q2min,sqr(x)*sqr(a->mass())/(1.-x));
+ Energy2 qqmax = min(_q2max,0.25*sqr(x)*c.sMax());
+ Energy2 qqmin = max(_q2min,sqr(x*a->mass())/(1.-x));
if(qqmin>=qqmax) {
jacobian = 0.;
return 0.;
}
- double low(log(qqmin/c.sMax())),upp(log(qqmax/c.sMax()));
- jacobian *= upp-low;
+ double low(log(qqmin/c.scaleMaxL(l))),upp(log(qqmax/c.scaleMaxL(l)));
+ // jacobian factor
+ jacobian *= log(qqmax/qqmin);
return exp(low+z*(upp-low));
}
double WeiszackerWilliamsPDF::flattenL(tcPDPtr, tcPDPtr, const PDFCuts & c,
double z, double & jacobian) const {
jacobian *= c.lMax() - c.lMin();
- return c.lMin() + z*jacobian;
+ return c.lMin() + z*(c.lMax() - c.lMin());
}
diff --git a/PDF/WeiszackerWilliamsPDF.fh b/PDF/WeiszackerWilliamsPDF.fh
deleted file mode 100644
--- a/PDF/WeiszackerWilliamsPDF.fh
+++ /dev/null
@@ -1,22 +0,0 @@
-// -*- C++ -*-
-//
-// This is the forward declaration of the WeiszackerWilliamsPDF class.
-//
-#ifndef HERWIG_WeiszackerWilliamsPDF_FH
-#define HERWIG_WeiszackerWilliamsPDF_FH
-
-#include "ThePEG/Config/Pointers.h"
-
-namespace Herwig {
-
-class WeiszackerWilliamsPDF;
-
-}
-
-namespace ThePEG {
-
-ThePEG_DECLARE_POINTERS(Herwig::WeiszackerWilliamsPDF,WeiszackerWilliamsPDFPtr);
-
-}
-
-#endif
diff --git a/PDF/WeiszackerWilliamsPDF.h b/PDF/WeiszackerWilliamsPDF.h
--- a/PDF/WeiszackerWilliamsPDF.h
+++ b/PDF/WeiszackerWilliamsPDF.h
@@ -1,189 +1,186 @@
// -*- C++ -*-
#ifndef HERWIG_WeiszackerWilliamsPDF_H
#define HERWIG_WeiszackerWilliamsPDF_H
//
// This is the declaration of the WeiszackerWilliamsPDF class.
//
#include "ThePEG/PDF/PDFBase.h"
-#include "WeiszackerWilliamsPDF.fh"
namespace Herwig {
using namespace ThePEG;
/**
* Here is the documentation of the WeiszackerWilliamsPDF class.
*
* @see \ref WeiszackerWilliamsPDFInterfaces "The interfaces"
* defined for WeiszackerWilliamsPDF.
*/
class WeiszackerWilliamsPDF: public PDFBase {
public:
/**
* Default constructor
*/
- inline WeiszackerWilliamsPDF();
+ WeiszackerWilliamsPDF();
/** @name Virtual functions to be overridden by sub-classes. */
//@{
/**
* Return true if this PDF can handle the extraction of partons from
* the given \a particle.
*/
virtual bool canHandleParticle(tcPDPtr particle) const;
/**
* Return the partons which this PDF may extract from the given
* \a particle.
*/
virtual cPDVector partons(tcPDPtr particle) const;
/**
* The density. Return the pdf for the given \a parton inside the
* given \a particle for the virtuality \a partonScale and
* logarithmic momentum fraction \a l \f$(l=\log(1/x)\$f. The \a
* particle is assumed to have a virtuality \a particleScale.
*/
virtual double xfl(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
double l, Energy2 particleScale = 0.0*GeV2) const;
/**
* The valence density. Return the pdf for the given cvalence \a
* parton inside the given \a particle for the virtuality \a
* partonScale and logarithmic momentum fraction \a l
* \f$(l=\log(1/x)\$f. The \a particle is assumed to have a
* virtuality \a particleScale. If not overidden by a sub class this
* will return zero.
*/
virtual double xfvl(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
double l, Energy2 particleScale = 0.0*GeV2) const;
/**
* Generate scale (as a fraction of the maximum scale). If the PDF
* contains strange peaks which can be difficult to handle, this
* function may be overwritten to return an appropriate scale
* \f$Q^2/Q^2_{\max}\f$ for a \a z uniformly distributed in
* ]0,1[. Also the jacobobian of the \f$Q^2/Q^2_{\max}\rightarrow
* z\f$ variable transformation must multiply the \a jacobian
* argument. The default version will simply use the function
* \f$Q^2/Q^2_{\max} = (Q^2_{\max}/Q^2_{\min})^(z-1)\f$ or, if
* \f$Q^2_{\min}\f$ is zero, \f$Q^2/Q^2_{\max} = z\f$ (where the
* limits are set by \a cut).
*/
virtual double flattenScale(tcPDPtr particle, tcPDPtr parton,
const PDFCuts & cut, double l, double z,
double & jacobian) const;
/**
* Generate a momentum fraction. If the PDF contains strange peaks
* which can be difficult to handle, this function may be
* overwritten to return an appropriate \f$l=\log(1/x)\f$ for a \a z
* uniformly distributed in ]0,1[. Also the jacobobian of the
* \f$l\rightarrow z\f$ variable transformation must in the function
* multiply the \a jacobian argument. The default version will
* simply use the function \f$l(z) = l_{\min} +
* z*(l_{\max}-l_{\min})\f$ (where the limits are set by \a cut).
*/
virtual double flattenL(tcPDPtr particle, tcPDPtr parton, const PDFCuts &cut,
double z, double & jacobian) const;
//@}
public:
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const;
+ inline virtual IBPtr clone() const {return new_ptr(*this);}
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
- inline virtual IBPtr fullclone() const;
+ inline virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is an concrete class without persistent data.
*/
static NoPIOClassDescription<WeiszackerWilliamsPDF> initWeiszackerWilliamsPDF;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
WeiszackerWilliamsPDF & operator=(const WeiszackerWilliamsPDF &);
private:
/**
* Minimum \f$Q^2\f$ for the photon
*/
Energy2 _q2min;
/**
* Maximum \f$Q^2\f$ for the photon
*/
Energy2 _q2max;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of WeiszackerWilliamsPDF. */
template <>
struct BaseClassTrait<Herwig::WeiszackerWilliamsPDF,1> {
/** Typedef of the first base class of WeiszackerWilliamsPDF. */
typedef PDFBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the WeiszackerWilliamsPDF class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::WeiszackerWilliamsPDF>
: public ClassTraitsBase<Herwig::WeiszackerWilliamsPDF> {
/** Return a platform-independent class name */
static string className() { return "Herwig::WeiszackerWilliamsPDF"; }
/**
* The name of a file containing the dynamic library where the class
* WeiszackerWilliamsPDF is implemented. It may also include several, space-separated,
* libraries if the class WeiszackerWilliamsPDF depends on other classes (base classes
* excepted). In this case the listed libraries will be dynamically
* linked in the order they are specified.
*/
static string library() { return "HwLeptonPDF.so"; }
};
/** @endcond */
}
-#include "WeiszackerWilliamsPDF.icc"
-
#endif /* HERWIG_WeiszackerWilliamsPDF_H */
diff --git a/PDF/WeiszackerWilliamsPDF.icc b/PDF/WeiszackerWilliamsPDF.icc
deleted file mode 100644
--- a/PDF/WeiszackerWilliamsPDF.icc
+++ /dev/null
@@ -1,21 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the WeiszackerWilliamsPDF class.
-//
-
-namespace Herwig {
-
-inline WeiszackerWilliamsPDF::WeiszackerWilliamsPDF()
- : _q2min(0.*GeV2), _q2max(4.*GeV2)
-{}
-
-inline IBPtr WeiszackerWilliamsPDF::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr WeiszackerWilliamsPDF::fullclone() const {
- return new_ptr(*this);
-}
-
-}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Jan 20, 11:24 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242844
Default Alt Text
(10 KB)

Event Timeline