Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/Decay/HwDecayHandler.cc b/Decay/HwDecayHandler.cc
--- a/Decay/HwDecayHandler.cc
+++ b/Decay/HwDecayHandler.cc
@@ -1,215 +1,238 @@
// -*- C++ -*-
//
// HwDecayHandler.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the HwDecayHandler class.
//
#include "HwDecayHandler.h"
#include "ThePEG/Handlers/EventHandler.h"
#include "ThePEG/Handlers/Hint.h"
#include "ThePEG/PDT/ParticleData.h"
#include "ThePEG/PDT/DecayMode.h"
#include "ThePEG/PDT/Decayer.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/RefVector.h"
#include "ThePEG/EventRecord/Step.h"
#include "ThePEG/EventRecord/Collision.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "DecayIntegrator.h"
#include "DecayPhaseSpaceMode.h"
+#include "ThePEG/PDT/MixedParticleData.h"
#include "Herwig++/Utilities/EnumParticles.h"
using namespace Herwig;
using namespace ThePEG::Helicity;
void HwDecayHandler::
handle(EventHandler &, const tPVector & tagged,
const Hint &) {
// First go through the tagged particles for unstable ones
tPVector parents;
for(int i = 0, N = tagged.size(); i<N; ++i) {
if(tagged[i]) {
// add to parents if not stable
if(!tagged[i]->data().stable() &&
tagged[i]->data().id() != ExtraParticleID::Remnant &&
_excluded.find( tagged[i]->dataPtr() ) == _excluded.end() ) {
parents.push_back(tagged[i]);
}
// if stable and has spinInfo set the developed flag
else {
develop(tagged[i]);
}
}
}
// if nothing to be decayed return
if(parents.empty()) return;
useMe();
// Create a new step, decay all particles and add their children to the step
StepPtr newstep = _newstep ? newStep() : currentStep();
for(int i = 0, N = parents.size(); i<N; ++i) {
performDecay(newstep->find(parents[i]), *newstep);
}
}
-
// perform decay method including modifications for spin correlations
// and for the decayer to specify intermediate decay products
void HwDecayHandler::performDecay(tPPtr parent, Step & s) const {
long ntry = 0;
tcSpinfoPtr hwspin;
- if ( maxLifeTime() >= ZERO ) {
+ tcMixedParticleDataPtr
+ mixdata=dynamic_ptr_cast<tcMixedParticleDataPtr>(parent->dataPtr());
+ if(mixdata) {
+ pair<bool,Length> mixing = mixdata->generateLifeTime();
+ develop(parent);
+ parent->setLifeLength(Distance());
+ PPtr newparent;
+ if(mixing.first) {
+ newparent = parent->dataPtr()->CC()->
+ produceParticle(parent->momentum());
+ }
+ else {
+ newparent = parent->dataPtr() ->
+ produceParticle(parent->momentum());
+ }
+ newparent->setLabVertex(parent->labDecayVertex());
+ Lorentz5Distance lifeLength(mixing.second,
+ parent->momentum().vect()*
+ (mixing.second/parent->mass()));
+ newparent->setLifeLength(lifeLength);
+ s.addDecayProduct(parent, newparent);
+ parent = newparent;
+ }
+ else if ( maxLifeTime() >= ZERO ) {
if( ( lifeTimeOption() && parent->lifeLength().tau() > maxLifeTime())||
(!lifeTimeOption() && parent->data().cTau() > maxLifeTime()) ) {
parent->setLifeLength(Distance());
develop(parent);
return;
}
}
while ( true ) {
// exit if fails
if ( ++ntry >= maxLoop() )
throw Exception() << "Too many tries " << maxLoop() << "to generate decay of "
<< *parent << "in "
<< "HwDecayHandler::performDecay" << Exception::eventerror;
// select the decay mode
tDMPtr dm(parent->data().selectMode(*parent));
// check we found a decay mode and it had a decayer
if ( !dm ) {
generator()->log() << *generator()->currentEvent() << "\n";
generator()->log() << *parent << "\n";
throw Exception() << "No DecayModes for " << parent->PDGName()
<< " in HwDecayHandler::performDecay"
<< Exception::eventerror;
}
if ( !dm->decayer() ) throw Exception() << "No decayer for DecayMode of "
<< parent->PDGName()
<< " in HwDecayHandler::performDecay"
<< Exception::eventerror;
try {
ParticleVector children = dm->decayer()->decay(*dm, *parent);
if(children.empty()) continue;
assert(parent->children().empty());
// generate radiation in the decay
tDecayIntegratorPtr hwdec=dynamic_ptr_cast<tDecayIntegratorPtr>(dm->decayer());
if (hwdec && hwdec->canGeneratePhotons())
children = hwdec->generatePhotons(*parent,children);
// set up parent
parent->decayMode(dm);
// add children
for ( int i = 0, N = children.size(); i < N; ++i ) {
children[i]->setLabVertex(parent->labDecayVertex());
if ( !s.addDecayProduct(parent, children[i]) )
throw Exception() << "Failed to add child "
<< children[i]->PDGName()
<< " in decay of " << parent->PDGName()
<< Exception::eventerror;
}
parent->scale(ZERO);
// loop over the children
for ( int i = 0, N = children.size(); i < N; ++i ) {
// if the child has already been decayed add products to the record
if(children[i]->decayed()) addDecayedParticle(children[i],s);
// if not stable decay the child
else if (!children[i]->data().stable() &&
_excluded.find( children[i]->dataPtr() ) == _excluded.end() ) {
performDecay(children[i], s);
}
// if stable and has spinInfo set up decay matrices etc.
else {
develop(children[i]);
}
}
// sort out the spinInfo for the parent after the decays
if(parent->spinInfo()) {
hwspin=dynamic_ptr_cast<tcSpinfoPtr>(parent->spinInfo());
if(hwspin) hwspin->develop();
}
return;
}
catch (Veto)
{}
}
}
// method to add an intermediate which has already been decayed to the event record
void HwDecayHandler::addDecayedParticle(tPPtr parent, Step & s) const {
for ( int i = 0, N = parent->children().size(); i < N; ++i ) {
parent->children()[i]->setLabVertex(parent->labDecayVertex());
s.addDecayProduct(parent->children()[i]);
}
parent->scale(ZERO);
for ( int i = 0, N = parent->children().size(); i < N; ++i ) {
if((parent->children()[i])->decayed()) {
for(unsigned int ix=0;ix<(parent->children()[i])->children().size();++ix)
addDecayedParticle(parent->children()[i],s);
}
else if ( ! parent->children()[i]->data().stable() &&
_excluded.find( parent->children()[i]->dataPtr() ) == _excluded.end() ) {
performDecay(parent->children()[i], s);
}
else {
develop(parent->children()[i]);
}
}
return;
}
void HwDecayHandler::persistentOutput(PersistentOStream & os) const {
os << _newstep << _excluded << _excludedVector;
}
void HwDecayHandler::persistentInput(PersistentIStream & is, int) {
is >> _newstep >> _excluded >> _excludedVector;
}
ClassDescription<HwDecayHandler> HwDecayHandler::initHwDecayHandler;
void HwDecayHandler::Init() {
static ClassDocumentation<HwDecayHandler> documentation
("This is the handler for decays in Herwig++.",
"Decays in Herwig++ include full spin correlations, based on \\cite{Richardson:2001df}.",
"%\\cite{Richardson:2001df}\n"
"\\bibitem{Richardson:2001df}\n"
" P.~Richardson,\n"
" ``Spin correlations in Monte Carlo simulations,''\n"
" JHEP {\\bf 0111}, 029 (2001)\n"
" [arXiv:hep-ph/0110108].\n"
" %%CITATION = JHEPA,0111,029;%%\n"
);
static Switch<HwDecayHandler,bool> interfaceNewStep
("NewStep",
"Add the particles in a new step",
&HwDecayHandler::_newstep, true, false, false);
static SwitchOption interfaceNewStepNew
(interfaceNewStep,
"Yes",
"Add particles in a new step",
true);
static SwitchOption interfaceNewStepCurrent
(interfaceNewStep,
"No",
"Add them in the current step",
false);
static RefVector<HwDecayHandler,ParticleData> interfaceExcluded
("Excluded",
"Particles which should not be decayed",
&HwDecayHandler::_excludedVector, -1, false, false, true, false, false);
}
void HwDecayHandler::doinit() {
DecayHandler::doinit();
_excluded = set<tcPDPtr>(_excludedVector.begin(),_excludedVector.end());
}
diff --git a/MatrixElement/DIS/MEChargedCurrentDIS.h b/MatrixElement/DIS/MEChargedCurrentDIS.h
--- a/MatrixElement/DIS/MEChargedCurrentDIS.h
+++ b/MatrixElement/DIS/MEChargedCurrentDIS.h
@@ -1,261 +1,261 @@
// -*- C++ -*-
#ifndef HERWIG_MEChargedCurrentDIS_H
#define HERWIG_MEChargedCurrentDIS_H
//
// This is the declaration of the MEChargedCurrentDIS class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEChargedCurrentDIS class provides the matrix elements for
* charged current DIS.
*
* By default both the incoming and outgong quarks are assumed to be massless
* although the mass of the outgoing quark can be included if required. This
* option should be used if top production is included.
*
* @see \ref MEChargedCurrentDISInterfaces "The interfaces"
* defined for MEChargedCurrentDIS.
*/
class MEChargedCurrentDIS: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MEChargedCurrentDIS();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Matrix element for \f$\ell q\to \gamma/Z \to \ell q\f$.
* @param f1 Fermion on lepton line
* @param a1 Anti-fermion on lepton line
* @param f2 Fermion on quark line
* @param a2 Anti-fermion on quark line
* @param lorder The order of particles on the lepton line
* @param qorder The order of particles on the quark line
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double helicityME(vector<SpinorWaveFunction> & f1 ,
vector<SpinorWaveFunction> & f2,
vector<SpinorBarWaveFunction> & a1 ,
vector<SpinorBarWaveFunction> & a2,
bool lorder, bool qorder,
bool me) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEChargedCurrentDIS> initMEChargedCurrentDIS;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEChargedCurrentDIS & operator=(const MEChargedCurrentDIS &);
private:
/**
* Pointer to the vertex for the helicity calculations
*/
AbstractFFVVertexPtr _theFFWVertex;
/**
* The allowed flavours of the incoming quarks
*/
unsigned int _maxflavour;
/**
* Option for the mass of the outgoing quarks
*/
unsigned int _massopt;
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
/**
* Pointers to the intermediates resonances
*/
//@{
/**
* Pointer to the \f$W^+\f$
*/
tcPDPtr _wp;
/**
* Pointer to the \f$W^-\f$
*/
tcPDPtr _wm;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEChargedCurrentDIS. */
template <>
struct BaseClassTrait<Herwig::MEChargedCurrentDIS,1> {
/** Typedef of the first base class of MEChargedCurrentDIS. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEChargedCurrentDIS class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEChargedCurrentDIS>
: public ClassTraitsBase<Herwig::MEChargedCurrentDIS> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEChargedCurrentDIS"; }
/**
* The name of a file containing the dynamic library where the class
* MEChargedCurrentDIS is implemented. It may also include several, space-separated,
* libraries if the class MEChargedCurrentDIS 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 "HwMEDIS.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEChargedCurrentDIS_H */
diff --git a/MatrixElement/DIS/MENeutralCurrentDIS.h b/MatrixElement/DIS/MENeutralCurrentDIS.h
--- a/MatrixElement/DIS/MENeutralCurrentDIS.h
+++ b/MatrixElement/DIS/MENeutralCurrentDIS.h
@@ -1,280 +1,280 @@
// -*- C++ -*-
#ifndef HERWIG_MENeutralCurrentDIS_H
#define HERWIG_MENeutralCurrentDIS_H
//
// This is the declaration of the MENeutralCurrentDIS class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MENeutralCurrentDIS class provides the matrix elements for
* neutral current DIS.
*
* For consistency both the incoming and outgoing quarks are assumed to be massless.
*
* @see \ref MENeutralCurrentDISInterfaces "The interfaces"
* defined for MENeutralCurrentDIS.
*/
class MENeutralCurrentDIS: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MENeutralCurrentDIS();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
- inline virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
+ virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Matrix element for \f$\ell q\to \gamma/Z \to \ell q\f$.
* @param f1 Fermion on lepton line
* @param a1 Anti-fermion on lepton line
* @param f2 Fermion on quark line
* @param a2 Anti-fermion on quark line
* @param lorder The order of particles on the lepton line
* @param qorder The order of particles on the quark line
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double helicityME(vector<SpinorWaveFunction> & f1 ,
vector<SpinorWaveFunction> & f2,
vector<SpinorBarWaveFunction> & a1 ,
vector<SpinorBarWaveFunction> & a2,
bool lorder, bool qorder,
bool me) const;
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MENeutralCurrentDIS> initMENeutralCurrentDIS;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MENeutralCurrentDIS & operator=(const MENeutralCurrentDIS &);
private:
/**
* Pointer to the vertices for the helicity calculations
*/
//@{
/**
* Pointer to the Z vertex
*/
AbstractFFVVertexPtr _theFFZVertex;
/**
* Pointer to the photon vertex
*/
AbstractFFVVertexPtr _theFFPVertex;
//@}
/**
* Pointers to the intermediate resonances
*/
//@{
/**
* Pointer to the Z ParticleData object
*/
tcPDPtr _z0;
/**
* Pointer to the photon ParticleData object
*/
tcPDPtr _gamma;
//@}
/**
* Switches to control the particles in the hard process
*/
//@{
/**
* Minimumflavour of the incoming quarks
*/
int _minflavour;
/**
* Maximum flavour of the incoming quarks
*/
int _maxflavour;
/**
* Whether to include both \f$Z^0\f$ and \f$\gamma\f$ or only one
*/
unsigned int _gammaZ;
//@}
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MENeutralCurrentDIS. */
template <>
struct BaseClassTrait<Herwig::MENeutralCurrentDIS,1> {
/** Typedef of the first base class of MENeutralCurrentDIS. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MENeutralCurrentDIS class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MENeutralCurrentDIS>
: public ClassTraitsBase<Herwig::MENeutralCurrentDIS> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MENeutralCurrentDIS"; }
/**
* The name of a file containing the dynamic library where the class
* MENeutralCurrentDIS is implemented. It may also include several, space-separated,
* libraries if the class MENeutralCurrentDIS 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 "HwMEDIS.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MENeutralCurrentDIS_H */
diff --git a/MatrixElement/Gamma/MEGammaGamma2ff.h b/MatrixElement/Gamma/MEGammaGamma2ff.h
--- a/MatrixElement/Gamma/MEGammaGamma2ff.h
+++ b/MatrixElement/Gamma/MEGammaGamma2ff.h
@@ -1,232 +1,232 @@
// -*- C++ -*-
#ifndef HERWIG_MEGammaGamma2ff_H
#define HERWIG_MEGammaGamma2ff_H
//
// This is the declaration of the MEGammaGamma2ff class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
namespace Herwig {
using namespace ThePEG;
/**
* The MEGammaGamma2ff class provides the matrix elements for
* \f$\gamma\gamma\to f \bar{f}\f$.
*
* @see \ref MEGammaGamma2ffInterfaces "The interfaces"
* defined for MEGammaGamma2ff.
*/
class MEGammaGamma2ff: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MEGammaGamma2ff();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Matrix element for \f$\gamma\gamma\to q\bar{q}\f$
* @param p1 The wavefunctions for the first incoming photon
* @param p2 The wavefunctions for the second incoming photon
* @param f The wavefunction for the outgoing fermion
* @param fbar The wavefunction for the outgoing antifermion
* @param calc Whether or not to calculate the matrix element
*/
double helicityME(vector<VectorWaveFunction> &p1,vector<VectorWaveFunction> &p2,
vector<SpinorBarWaveFunction> & f,
vector<SpinorWaveFunction> & fbar, bool calc) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEGammaGamma2ff> initMEGammaGamma2ff;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEGammaGamma2ff & operator=(const MEGammaGamma2ff &);
private:
/**
* Which processes to include
*/
int process_;
/**
* Pointer to the photon vertex
*/
AbstractFFVVertexPtr vertex_;
/**
* Matrix element
*/
mutable ProductionMatrixElement me_;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEGammaGamma2ff. */
template <>
struct BaseClassTrait<Herwig::MEGammaGamma2ff,1> {
/** Typedef of the first base class of MEGammaGamma2ff. */
typedef ME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEGammaGamma2ff class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEGammaGamma2ff>
: public ClassTraitsBase<Herwig::MEGammaGamma2ff> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEGammaGamma2ff"; }
/**
* The name of a file containing the dynamic library where the class
* MEGammaGamma2ff is implemented. It may also include several, space-separated,
* libraries if the class MEGammaGamma2ff 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 "HwMEGammaGamma.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEGammaGamma2ff_H */
diff --git a/MatrixElement/General/GeneralHardME.h b/MatrixElement/General/GeneralHardME.h
--- a/MatrixElement/General/GeneralHardME.h
+++ b/MatrixElement/General/GeneralHardME.h
@@ -1,293 +1,316 @@
// -*- C++ -*-
//
// GeneralHardME.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_GeneralHardME_H
#define HERWIG_GeneralHardME_H
//
// This is the declaration of the GeneralHardME class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "ThePEG/Utilities/Exception.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/Models/General/HPDiagram.h"
#include "GeneralHardME.fh"
namespace Herwig {
using namespace ThePEG;
using Helicity::VertexBasePtr;
/**
* This defines the GeneralHardME class that is designed to serve as a
* base class for matrix elements of specific spin structures when those
* structures are created by a a general model, i.e. a SUSY production
* ME. It stores a vector of diagram structures that contain the required
* to calculate the matrix element.
*
* @see HwME2to2Base
*/
class GeneralHardME: public HwME2to2Base {
public:
/**
* Convenient typedef for size_type of HPDiagram vector
*/
typedef vector<HPDiagram>::size_type HPCount;
public:
/**
* The default constructor.
*/
GeneralHardME();
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const = 0;
/**
* Return the scale associated with the last set phase space point.
*/
- virtual inline Energy2 scale() const;
+ virtual Energy2 scale() const {
+ if(scaleChoice_==0) {
+ return sHat();
+ }
+ else {
+ assert( scaleChoice_== 1 );
+ Energy2 t = 0.5*(tHat()-meMomenta()[2].mass2());
+ Energy2 u = 0.5*(uHat()-meMomenta()[3].mass2());
+ Energy2 s = 0.5*sHat();
+ return 4.*s*t*u/(s*s+t*t+u*u);
+ }
+ }
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex>
diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const = 0;
//@}
/**
* Set the diagrams and matrix of colour factors.
* @param process vector of MEDiagram with information that
* will allow the diagrams to be created in the specific matrix element
* @param factors
* @param ncf Number of colour flows
* @param debug Whether to compare the numerical answer to an analytical
* formula (This is only stored for certain processes. It is intended
* for quick checks of the matrix elements).
* @param scaleOption The option of what scale to use
*/
void setProcessInfo(const vector<HPDiagram> & process,
const vector<DVector> & factors,
const unsigned int ncf,
bool debug, unsigned int scaleOption);
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* A debugging function to test the value of me2 against an
* analytic function. This is to be overidden in an inheriting class.
* @param x The value of \f$ |\mathcal{M} |^2 \f$
*/
virtual void debug(double x) const;
protected:
/**
* Access the HPDiagrams that store the required information
* to create the diagrams
*/
- inline const vector<HPDiagram> & getProcessInfo() const;
+ const vector<HPDiagram> & getProcessInfo() const {
+ return theDiagrams;
+ }
/**
* Return the incoming pair
* @return Pair of particle ids for the incoming particles
*/
- inline pair<long, long> getIncoming() const;
-
+ pair<long, long> getIncoming() const {
+ return theIncoming;
+ }
+
/**
* Return the outgoing pair
* @return Pair of particle ids for the outgoing particles
*/
- inline pair<long, long> getOutgoing() const;
+ pair<long, long> getOutgoing() const {
+ return theOutgoing;
+ }
/**
* Return the matrix of colour factors
*/
- inline const vector<DVector> & getColourFactors() const;
+ const vector<DVector> & getColourFactors() const {
+ return theColour;
+ }
/**
* Get the number of diagrams in this process
*/
- inline HPCount numberOfDiags() const;
+ HPCount numberOfDiags() const {
+ return theNDiags;
+ }
/**
* Access number of colour flows
*/
- inline size_t numberOfFlows() const;
+ size_t numberOfFlows() const {
+ return theNcf;
+ }
/**
* Whether to print the debug information
*/
- inline bool debugME() const;
+ bool debugME() const {
+ return theDebug;
+ }
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is an abstract class with persistent data.
*/
static AbstractClassDescription<GeneralHardME> initGeneralHardME;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
GeneralHardME & operator=(const GeneralHardME &);
private:
/**
* Store incoming particles
*/
pair<long, long> theIncoming;
/**
* Store the outgoing particles
*/
pair<long, long> theOutgoing;
/**
* Store all diagrams as a vector of structures
*/
vector<HPDiagram> theDiagrams;
/**
* Store the number of diagrams for fast retrieval
*/
HPCount theNDiags;
/**
* Store colour factors for ME calc.
*/
vector<DVector> theColour;
/**
* The number of colourflows.
*/
unsigned int theNcf;
/**
* Whether to test the value of me2 against the analytical function
*/
bool theDebug;
/**
* The scale chocie
*/
unsigned int scaleChoice_;
};
/** Exception class to indicate a problem has occurred with setting
up to matrix element.*/
class MEException : public Exception {};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of GeneralHardME. */
template <>
struct BaseClassTrait<Herwig::GeneralHardME,1> {
/** Typedef of the first base class of GeneralHardME. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the GeneralHardME class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::GeneralHardME>
: public ClassTraitsBase<Herwig::GeneralHardME> {
/** Return a platform-independent class name */
static string className() { return "Herwig::GeneralHardME"; }
};
/** @endcond */
}
-#include "GeneralHardME.icc"
-
#endif /* HERWIG_GeneralHardME_H */
diff --git a/MatrixElement/General/GeneralHardME.icc b/MatrixElement/General/GeneralHardME.icc
deleted file mode 100644
--- a/MatrixElement/General/GeneralHardME.icc
+++ /dev/null
@@ -1,58 +0,0 @@
-// -*- C++ -*-
-//
-// GeneralHardME.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the GeneralHardME class.
-//
-
-namespace Herwig {
-
-inline const vector<HPDiagram> & GeneralHardME::getProcessInfo() const {
- return theDiagrams;
-}
-
-inline const vector<vector<double> > &
-GeneralHardME::getColourFactors() const {
- return theColour;
-}
-
-inline pair<long,long> GeneralHardME::getIncoming() const {
- return theIncoming;
-}
-
-inline pair<long,long> GeneralHardME::getOutgoing() const {
- return theOutgoing;
-}
-
-inline GeneralHardME::HPCount GeneralHardME::numberOfDiags() const {
- return theNDiags;
-}
-
-inline size_t GeneralHardME::numberOfFlows() const {
- return theNcf;
-}
-
-inline bool GeneralHardME::debugME() const {
- return theDebug;
-}
-
-inline Energy2 GeneralHardME::scale() const {
- if(scaleChoice_==0) {
- return sHat();
- }
- else {
- assert( scaleChoice_== 1 );
- Energy2 t = 0.5*(tHat()-meMomenta()[2].mass2());
- Energy2 u = 0.5*(uHat()-meMomenta()[3].mass2());
- Energy2 s = 0.5*sHat();
- return 4.*s*t*u/(s*s+t*t+u*u);
- }
-}
-
-}
diff --git a/MatrixElement/General/MEff2ff.h b/MatrixElement/General/MEff2ff.h
--- a/MatrixElement/General/MEff2ff.h
+++ b/MatrixElement/General/MEff2ff.h
@@ -1,278 +1,278 @@
// -*- C++ -*-
//
// MEff2ff.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEff2ff_H
#define HERWIG_MEff2ff_H
//
// This is the declaration of the MEff2ff class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFTVertex.h"
namespace Herwig {
using namespace ThePEG;
using Helicity::SpinorWaveFunction;
using Helicity::SpinorBarWaveFunction;
/**
* This is the implementation of the \f$ 2\to 2\f$ matrix element for
* a \f$ \Psi \Psi \to \Psi \Psi\f$ process. It inherits from
* GeneralHardME and implements the appropriate virtual functions.
*
* @see \ref MEff2ffInterfaces "The Interfaces"
* defined for MEff2ff.
* @see GeneralHardME
*/
class MEff2ff: public GeneralHardME {
public:
/** Vector of SpinorWaveFunctions. */
typedef vector<SpinorWaveFunction> SpinorVector;
/** Vector of SpinorBarWaveFunctions. */
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
public:
/**
* The default constructor.
*/
- inline MEff2ff() : theScaV(0), theVecV(0), theTenV(0) {}
+ MEff2ff() : theScaV(0), theVecV(0), theTenV(0) {}
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
private:
/** @name Functions to compute the ProductionMatrixElement. */
//@{
/**
* Compute the matrix element for \f$\Psi\bar{\Psi}\to\Psi\bar{\Psi}\f$
* @param fin Spinors for first incoming particle
* @param fbin SpinorBar Wavefunctions for second incoming particle
* @param fbout SpinorBar Wavefunctions for outgoing particle
* @param fout Spinors for first outgoing particle
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
ffb2ffbHeME(SpinorVector & fin, SpinorBarVector & fbin,
SpinorBarVector & fbout, SpinorVector & fout,
double & me2) const;
/**
* Compute the matrix element for \f$\Psi\Psi\to\Psi\Psi\f$
* @param fin Spinors for first incoming particle
* @param fin2 Spinors for second incoming particle
* @param fbout SpinorBar for first outgoing particle
* @param fbout2 SpinorBar Wavefunctions for outgoing particle
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
ff2ffHeME(SpinorVector & fin, SpinorVector & fin2,
SpinorBarVector & fbout, SpinorBarVector & fbout2,
double & me2) const;
/**
* Compute the matrix element for
* \f$\bar{\Psi}\bar{\Psi}\to\bar{\Psi}\bar{\Psi}\f$
* @param fbin SpinorBars for first incoming particle
* @param fbin2 SpinorBars for second incoming particle
* @param fout Spinors for first outgoing particle
* @param fout2 Spinors Wavefunctions for outgoing particle
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
fbfb2fbfbHeME(SpinorBarVector & fbin, SpinorBarVector & fbin2,
SpinorVector & fout, SpinorVector & fout2,
double & me2) const;
/**
* Compute the matrix element for \f$\Psi\bar{\Psi}\to\lambda\lambda\f$
* @param fin Spinors for first incoming particle
* @param fbin SpinorBar Wavefunctions for second incoming particle
* @param fbout SpinorBar Wavefunctions for first outgoing particle
* @param fout Spinors for second outgoing particle
* @param fout2 Spinor Wavefunctions for first outgoing particle
* @param fbout2 SpinorBar Wavefunctions for second outgoing particle
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
ffb2mfmfHeME(SpinorVector & fin, SpinorBarVector & fbin,
SpinorBarVector & fbout, SpinorVector & fout,
SpinorVector & fout2, SpinorBarVector & fbout2,
double & me2) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEff2ff> initMEff2ff;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEff2ff & operator=(const MEff2ff &);
private:
/**
* Store the vector of FFSVertex pairs
*/
vector<pair<AbstractFFSVertexPtr, AbstractFFSVertexPtr> > theScaV;
/**
* Store the vector of FFVVertex pairs
*/
vector<pair<AbstractFFVVertexPtr, AbstractFFVVertexPtr> > theVecV;
/**
* Store the vector of FFTVertex pairs
*/
vector<pair<AbstractFFTVertexPtr, AbstractFFTVertexPtr> > theTenV;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEff2ff. */
template <>
struct BaseClassTrait<Herwig::MEff2ff,1> {
/** Typedef of the first base class of MEff2ff. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEff2ff class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEff2ff>
: public ClassTraitsBase<Herwig::MEff2ff> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEff2ff"; }
};
/** @endcond */
}
#endif /* HERWIG_MEff2ff_H */
diff --git a/MatrixElement/General/MEff2ss.h b/MatrixElement/General/MEff2ss.h
--- a/MatrixElement/General/MEff2ss.h
+++ b/MatrixElement/General/MEff2ss.h
@@ -1,232 +1,232 @@
// -*- C++ -*-
//
// MEff2ss.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEff2ss_H
#define HERWIG_MEff2ss_H
//
// This is the declaration of the MEff2ss class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVSSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractSSTVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using ThePEG::Helicity::SpinorWaveFunction;
using ThePEG::Helicity::SpinorBarWaveFunction;
using ThePEG::Helicity::ScalarWaveFunction;
/**
* The MEff2ss class is designed to implement the matrix element for a
* fermion-antifermion to scalar-scalar hard process. It inherits from
* GeneralHardME and implements the appropriate virtual functions for this
* specific spin combination.
*
* @see \ref MEff2ssInterfaces "The interfaces"
* defined for MEff2ss.
* @see GeneralHardME
*/
class MEff2ss: public GeneralHardME {
public:
/** Vector of SpinorWaveFunctions objects */
typedef vector<SpinorWaveFunction> SpinorVector;
/** Vector of SpinorBarWaveFunction objects. */
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
public:
/**
* The default constructor.
*/
- inline MEff2ss() : theFerm(0), theVec(0), theTen(0) {}
+ MEff2ss() : theFerm(0), theVec(0), theTen(0) {}
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEff2ss> initMEff2ss;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEff2ss & operator=(const MEff2ss &);
private:
/**
* Calculate the matrix element
* @param sp A vector of SpinorWaveFunction objects
* @param sbar A vector of SpinorBarWaveFunction objects
* @param sca1 A ScalarWaveFunction for an outgoing scalar
* @param sca2 A ScalarWaveFunction for the other outgoing scalar
* @param me2 The spin averaged matrix element
*/
ProductionMatrixElement ff2ssME(const SpinorVector & sp,
const SpinorBarVector & sbar,
const ScalarWaveFunction & sca1,
const ScalarWaveFunction & sca2,
double & me2) const;
private:
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* fermion
*/
vector<pair<AbstractFFSVertexPtr, AbstractFFSVertexPtr> > theFerm;
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* vector
*/
vector<pair<AbstractFFVVertexPtr, AbstractVSSVertexPtr> > theVec;
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* tensor
*/
vector<pair<AbstractFFTVertexPtr, AbstractSSTVertexPtr> > theTen;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEff2ss. */
template <>
struct BaseClassTrait<Herwig::MEff2ss,1> {
/** Typedef of the first base class of MEff2ss. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEff2ss class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEff2ss>
: public ClassTraitsBase<Herwig::MEff2ss> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEff2ss"; }
};
/** @endcond */
}
#endif /* HERWIG_MEff2ss_H */
diff --git a/MatrixElement/General/MEff2sv.h b/MatrixElement/General/MEff2sv.h
--- a/MatrixElement/General/MEff2sv.h
+++ b/MatrixElement/General/MEff2sv.h
@@ -1,240 +1,240 @@
// -*- C++ -*-
//
// MEff2sv.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEff2sv_H
#define HERWIG_MEff2sv_H
//
// This is the declaration of the MEff2sv class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVSSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using Helicity::SpinorWaveFunction;
using Helicity::SpinorBarWaveFunction;
using Helicity::VectorWaveFunction;
using Helicity::ScalarWaveFunction;
/**
* The MEff2sv class is designed to implement the matrix element for a
* fermion-antifermion to vector-scalar hard process. It inherits from
* GeneralHardME and implements the appropriate virtual functions for this
* specific spin combination.
*
* @see \ref MEff2svInterfaces "The interfaces"
* defined for MEff2sv.
* @see GeneralHardME
*/
class MEff2sv: public GeneralHardME {
public:
/** @name Typedefs */
//@{
/**
* A vector of SpinorWaveFunctions
*/
typedef vector<SpinorWaveFunction> SpinorVector;
/**
* A vector of SpinorWaveBarFunctions
*/
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
/**
* A vector of VectorWaveFunctions
*/
typedef vector<VectorWaveFunction> VBVector;
//@}
public:
/**
* The default constructor.
*/
- inline MEff2sv() : theSca(0), theVec(0), theFerm(0) {}
+ MEff2sv() : theSca(0), theVec(0), theFerm(0) {}
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEff2sv> initMEff2sv;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEff2sv & operator=(const MEff2sv &);
private:
/** @name Functions to compute the ProductionMatrixElement. */
//@{
/**
* Compute the matrix element for \f$\Psi\bar{\Psi}\to\Psi\bar{\Psi}\f$
* @param sp Spinors for first incoming particle
* @param spbar SpinorBar Wavefunctions for second incoming particle
* @param vec VectorWaveFunctions for outgoing vector
* @param sca Outgoing ScalarWaveFunction
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
ffb2svHeME(SpinorVector & sp, SpinorBarVector & spbar,
ScalarWaveFunction & sca, VBVector & vec,
double & me2) const;
//@}
private:
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* scalar
*/
vector<pair<AbstractFFSVertexPtr, AbstractVSSVertexPtr> > theSca;
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* vector
*/
vector<pair<AbstractFFVVertexPtr, AbstractVVSVertexPtr> > theVec;
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* fermion
*/
vector<pair<AbstractFFSVertexPtr, AbstractFFVVertexPtr> > theFerm;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEff2sv. */
template <>
struct BaseClassTrait<Herwig::MEff2sv,1> {
/** Typedef of the first base class of MEff2sv. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEff2sv class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEff2sv>
: public ClassTraitsBase<Herwig::MEff2sv> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEff2sv"; }
};
/** @endcond */
}
#endif /* HERWIG_MEff2sv_H */
diff --git a/MatrixElement/General/MEff2vs.h b/MatrixElement/General/MEff2vs.h
--- a/MatrixElement/General/MEff2vs.h
+++ b/MatrixElement/General/MEff2vs.h
@@ -1,240 +1,240 @@
// -*- C++ -*-
//
// MEff2vs.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEff2vs_H
#define HERWIG_MEff2vs_H
//
// This is the declaration of the MEff2vs class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVSSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using Helicity::SpinorWaveFunction;
using Helicity::SpinorBarWaveFunction;
using Helicity::VectorWaveFunction;
using Helicity::ScalarWaveFunction;
/**
* The MEff2vs class is designed to implement the matrix element for a
* fermion-antifermion to vector-scalar hard process. It inherits from
* GeneralHardME and implements the appropriate virtual functions for this
* specific spin combination.
*
* @see \ref MEff2vsInterfaces "The interfaces"
* defined for MEff2vs.
* @see GeneralHardME
*/
class MEff2vs: public GeneralHardME {
public:
/** @name Typedefs */
//@{
/**
* A vector of SpinorWaveFunctions
*/
typedef vector<SpinorWaveFunction> SpinorVector;
/**
* A vector of SpinorWaveBarFunctions
*/
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
/**
* A vector of VectorWaveFunctions
*/
typedef vector<VectorWaveFunction> VBVector;
//@}
public:
/**
* The default constructor.
*/
- inline MEff2vs() : theSca(0), theVec(0), theFerm(0) {}
+ MEff2vs() : theSca(0), theVec(0), theFerm(0) {}
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEff2vs> initMEff2vs;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEff2vs & operator=(const MEff2vs &);
private:
/** @name Functions to compute the ProductionMatrixElement. */
//@{
/**
* Compute the matrix element for \f$\Psi\bar{\Psi}\to\Psi\bar{\Psi}\f$
* @param sp Spinors for first incoming particle
* @param spbar SpinorBar Wavefunctions for second incoming particle
* @param vec VectorWaveFunctions for outgoing vector
* @param sca Outgoing ScalarWaveFunction
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
ffb2vsHeME(SpinorVector & sp, SpinorBarVector & spbar,
VBVector & vec, ScalarWaveFunction & sca,
double & me2) const;
//@}
private:
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* scalar
*/
vector<pair<AbstractFFSVertexPtr, AbstractVSSVertexPtr> > theSca;
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* vector
*/
vector<pair<AbstractFFVVertexPtr, AbstractVVSVertexPtr> > theVec;
/**
* Storage for dynamically cast vertices for a diagram with intermediate
* fermion
*/
vector<pair<AbstractFFVVertexPtr, AbstractFFSVertexPtr> > theFerm;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEff2vs. */
template <>
struct BaseClassTrait<Herwig::MEff2vs,1> {
/** Typedef of the first base class of MEff2vs. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEff2vs class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEff2vs>
: public ClassTraitsBase<Herwig::MEff2vs> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEff2vs"; }
};
/** @endcond */
}
#endif /* HERWIG_MEff2vs_H */
diff --git a/MatrixElement/General/MEff2vv.h b/MatrixElement/General/MEff2vv.h
--- a/MatrixElement/General/MEff2vv.h
+++ b/MatrixElement/General/MEff2vv.h
@@ -1,239 +1,239 @@
// -*- C++ -*-
//
// MEff2vv.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEff2vv_H
#define HERWIG_MEff2vv_H
//
// This is the declaration of the MEff2vv class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using ThePEG::Helicity::SpinorWaveFunction;
using ThePEG::Helicity::SpinorBarWaveFunction;
using ThePEG::Helicity::VectorWaveFunction;
/**
* This class implements the matrix element calculation for a generic
* \f$\Psi \Psi \rightarrow V^{\mu} V^{\nu}\f$ process.
*
* @see \ref MEff2vvInterfaces "The interfaces"
* defined for MEff2vv.
*/
class MEff2vv: public GeneralHardME {
public:
/** Vector of SpinorWaveFunctions objects */
typedef vector<SpinorWaveFunction> SpinorVector;
/** Vector of SpinorBarWaveFunction objects. */
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
/** Vector of VectorWaveFunction objects. */
typedef vector<VectorWaveFunction> VBVector;
public:
/**
* The default constructor.
*/
- inline MEff2vv() : theVec(0), theTen(0), theSca(0) {}
+ MEff2vv() : theVec(0), theTen(0), theSca(0) {}
/** @name Virtual functions required by the GeneralHardME class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
private:
/**
* Compute the production matrix element.
* @param sp Spinors for first incoming fermion
* @param sbar SpinorBar Wavefunctions for incoming anti-fermion
* @param v1 A vector of VectorWaveFunction objects for the first vector
* @param m1 Whether v1 is massless or not
* @param v2 A vector of VectorWaveFunction objects for the second vector
* @param m2 Whether v2 is massless or not
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
ProductionMatrixElement
ff2vvME(const SpinorVector & sp, const SpinorBarVector sbar,
const VBVector & v1, bool m1, const VBVector & v2, bool m2,
double & me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEff2vv> initMEff2vv;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEff2vv & operator=(const MEff2vv &);
private:
/**
* Storage for a dynamically cast vertices for a tchannel vector
* intermediate
*/
vector<pair<AbstractFFVVertexPtr, AbstractFFVVertexPtr> > theFerm;
/**
* Storage for a dynamically cast vertices for a schannel vector
* intermediate
*/
vector<pair<AbstractFFVVertexPtr, AbstractVVVVertexPtr> > theVec;
/**
* Storage for a dynamically cast vertices for a schannel scalar
* intermediate
*/
vector<pair<AbstractFFTVertexPtr, AbstractVVTVertexPtr> > theTen;
/**
* Storage for a dynamically cast vertices for a schannel scalar
* intermediate for massless external vector bosons
*/
vector<pair<AbstractFFSVertexPtr, AbstractVVSVertexPtr> > theSca;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEff2vv. */
template <>
struct BaseClassTrait<Herwig::MEff2vv,1> {
/** Typedef of the first base class of MEff2vv. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEff2vv class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEff2vv>
: public ClassTraitsBase<Herwig::MEff2vv> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEff2vv"; }
};
/** @endcond */
}
#endif /* HERWIG_MEff2vv_H */
diff --git a/MatrixElement/General/MEfv2fs.h b/MatrixElement/General/MEfv2fs.h
--- a/MatrixElement/General/MEfv2fs.h
+++ b/MatrixElement/General/MEfv2fs.h
@@ -1,244 +1,244 @@
// -*- C++ -*-
//
// MEfv2fs.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEfv2fs_H
#define HERWIG_MEfv2fs_H
//
// This is the declaration of the MEfv2fs class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.fh"
#include "ThePEG/Helicity/Vertex/AbstractVSSVertex.fh"
namespace Herwig {
using namespace ThePEG;
using ThePEG::Helicity::SpinorWaveFunction;
using ThePEG::Helicity::SpinorBarWaveFunction;
using ThePEG::Helicity::VectorWaveFunction;
using ThePEG::Helicity::ScalarWaveFunction;
/**
* This class is designed to implement the matrix element for
* fermion-vector to fermion scalar. It inherits from GeneralHardME
* and implements the required virtual functions.
*
* @see @see \ref MEfv2fsInterfaces "The Interfaces"
* defined for MEfv2fs.
* @see GeneralHardME
*/
class MEfv2fs: public GeneralHardME {
/** Vector of SpinorWaveFunctions. */
typedef vector<SpinorWaveFunction> SpinorVector;
/** Vector of SpinorBarWaveFunctions. */
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
/** Vector of VectorWaveFunctions. */
typedef vector<VectorWaveFunction> VecWFVector;
public:
/**
* The default constructor.
*/
- inline MEfv2fs() : theScaV(0), theFermV(0) {}
+ MEfv2fs() : theScaV(0), theFermV(0) {}
public:
/** @name Virtual functions required by the GeneralHardME class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param subp Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr subp);
private:
/** @name Functions to calculate production matrix elements and me2. */
//@{
/**
* Calculate me2 and the production matrix element for the normal mode.
* @param spIn Vector of SpinorWaveFunction for the incoming fermion
* @param vecIn Vector of VectorWaveFunction for incoming boson
* @param spbOut Vector of SpinorBarWaveFunction for outgoing fermion
* @param scaOut ScalarWaveFunction for outgoing scalar.
* @param full_me The value of me2 calculation
*/
ProductionMatrixElement fv2fbsHeME(const SpinorVector & spIn,
const VecWFVector & vecIn,
const SpinorBarVector & spbOut,
const ScalarWaveFunction & scaOut,
double & full_me) const;
/**
* Calculate me2 and the production matrix element for the cc mode.
* @param spbIn Vector of SpinorBarWaveFunction for the incoming fermion
* @param vecIn Vector of VectorWaveFunction for incoming boson
* @param spOut Vector of SpinorWaveFunction for outgoing fermion
* @param scaOut ScalarWaveFunction for outgoing scalar.
* @param full_me The value of me2 calculation
*/
ProductionMatrixElement fbv2fsHeME(const SpinorBarVector & spbIn,
const VecWFVector & vecIn,
const SpinorVector & spOut,
const ScalarWaveFunction & scaOut,
double & full_me) const;
//@}
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEfv2fs> initMEfv2fs;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEfv2fs & operator=(const MEfv2fs &);
private:
/**
* Store a pair of FFSVertex and VSSVertex pointers
*/
vector<pair<AbstractFFSVertexPtr, AbstractVSSVertexPtr> > theScaV;
/**
* Store a pair of FFSVertex and FFVVertex pointers
*/
vector<pair<AbstractFFSVertexPtr, AbstractFFVVertexPtr> > theFermV;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEfv2fs. */
template <>
struct BaseClassTrait<Herwig::MEfv2fs,1> {
/** Typedef of the first base class of MEfv2fs. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEfv2fs class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEfv2fs>
: public ClassTraitsBase<Herwig::MEfv2fs> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEfv2fs"; }
};
/** @endcond */
}
#endif /* HERWIG_MEfv2fs_H */
diff --git a/MatrixElement/General/MEfv2vf.h b/MatrixElement/General/MEfv2vf.h
--- a/MatrixElement/General/MEfv2vf.h
+++ b/MatrixElement/General/MEfv2vf.h
@@ -1,235 +1,235 @@
// -*- C++ -*-
//
// MEfv2vf.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEfv2vf_H
#define HERWIG_MEfv2vf_H
//
// This is the declaration of the MEfv2vf class.
//
#include "GeneralHardME.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
namespace Herwig {
using namespace ThePEG;
/**
* This class implements the matrix element for a fermion and a vector
* boson to a fermion and a vector boson. It inherits from GeneralHardME
* and implements the appropriate virtual functions.
*
* @see \ref MEfv2vfInterfaces "The interfaces"
* defined for MEfv2vf.
*/
class MEfv2vf: public GeneralHardME {
public:
/** A vector of SpinorWaveFunctions. */
typedef vector<Helicity::SpinorWaveFunction> SpinorVector;
/** A vector of SpinorBarWaveFunctions. */
typedef vector<Helicity::SpinorBarWaveFunction> SpinorBarVector;
/** A vector of VectorWaveFunctions. */
typedef vector<Helicity::VectorWaveFunction> VBVector;
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
private:
/** @name Functions to calculate the Helicity MatrixElement.*/
//@{
/**
* Calculate the matrix element for an incoming fermion
* @param spIn A vector of spinors for the incoming fermion
* @param vecIn A vector of VectorWaveFunctions for the incoming boson
* @param spbOut A vector of SpinorBarWaveFunctions for the outgoing fermion
* @param vecOut A vector of VectorWaveFunctions for the outgoing boson
* @param mc If the outgoing vector is massless or not
* @param mesq The matrix element squared
*/
ProductionMatrixElement
fv2vfHeME(const SpinorVector & spIn, const VBVector & vecIn,
const VBVector & vecOut, bool mc,
const SpinorBarVector & spbOut, double & mesq) const;
/**
* Calculate the matrix element for an incoming anti-fermion
* @param spbIn A vector of SpinorBarWaveFunctions for the incoming anti-fermion
* @param vecIn A vector of VectorWaveFunctions for the incoming boson
* @param spOut A vector of Spinors for the outgoing antifermion
* @param vecOut A vector of VectorWaveFunctions for the outgoing boson
* @param mc If the outgoing vector is massless or not
* @param mesq The matrix element squared
*/
ProductionMatrixElement
fbv2vfbHeME(const SpinorBarVector & spbIn, const VBVector & vecIn,
const VBVector & vecOut, bool mc,
const SpinorVector & spOut, double & mesq) const;
//@}
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEfv2vf> initMEfv2vf;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEfv2vf & operator=(const MEfv2vf &);
private:
/** @name Store dynamically casted vertices. */
//@{
/**
* A pair off FFVVertex pointers
*/
vector<pair<AbstractFFVVertexPtr, AbstractFFVVertexPtr> > theFerm;
/**
* A pair of FFVVertex, VVVertex pointers
*/
vector<pair<AbstractFFVVertexPtr, AbstractVVVVertexPtr> > theVec;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEfv2vf. */
template <>
struct BaseClassTrait<Herwig::MEfv2vf,1> {
/** Typedef of the first base class of MEfv2vf. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEfv2vf class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEfv2vf>
: public ClassTraitsBase<Herwig::MEfv2vf> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEfv2vf"; }
};
/** @endcond */
}
#endif /* HERWIG_MEfv2vf_H */
diff --git a/MatrixElement/General/MEvv2ff.h b/MatrixElement/General/MEvv2ff.h
--- a/MatrixElement/General/MEvv2ff.h
+++ b/MatrixElement/General/MEvv2ff.h
@@ -1,223 +1,223 @@
// -*- C++ -*-
//
// MEvv2ff.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEvv2ff_H
#define HERWIG_MEvv2ff_H
//
// This is the declaration of the MEvv2ff class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractFFTVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using ThePEG::Helicity::SpinorWaveFunction;
using ThePEG::Helicity::SpinorBarWaveFunction;
using ThePEG::Helicity::VectorWaveFunction;
/**
* This class is designed to implement the matrix element for the
* \f$2 \rightarrow 2\f$ process vector-vector to fermion-antifermion pair. It
* inherits from GeneralHardME and implements the me2() virtual function.
*
* @see \ref MEvv2ffInterfaces "The Interfaces"
* defined for MEvv2ff.
* @see GeneralHardME
*
*/
class MEvv2ff: public GeneralHardME {
public:
/** A Vector of VectorWaveFunction objects. */
typedef vector<VectorWaveFunction> VBVector;
/** A vector of SpinorBarWaveFunction objects. */
typedef vector<SpinorWaveFunction> SpinorVector;
/** A vector of SpinorBarWaveFunction objects. */
typedef vector<SpinorBarWaveFunction> SpinorBarVector;
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
private:
/**
* Calculate the value of the matrix element
*/
ProductionMatrixElement vv2ffME(const VBVector & v1, const VBVector & v2,
const SpinorBarVector & sbar,
const SpinorVector & sp, double & me2) const;
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEvv2ff> initMEvv2ff;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEvv2ff & operator=(const MEvv2ff &);
private:
/** @name Dynamically casted vertices. */
//@{
/**
* Intermediate fermion
*/
vector<pair<AbstractFFVVertexPtr, AbstractFFVVertexPtr> > theFerm;
/**
* Intermediate vector
*/
vector<pair<AbstractVVVVertexPtr, AbstractFFVVertexPtr> > theVec;
/**
* Intermediate tensor
*/
vector<pair<AbstractVVTVertexPtr, AbstractFFTVertexPtr> > theTen;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEvv2ff. */
template <>
struct BaseClassTrait<Herwig::MEvv2ff,1> {
/** Typedef of the first base class of MEvv2ff. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEvv2ff class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEvv2ff>
: public ClassTraitsBase<Herwig::MEvv2ff> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEvv2ff"; }
};
/** @endcond */
}
#endif /* HERWIG_MEvv2ff_H */
diff --git a/MatrixElement/General/MEvv2ss.h b/MatrixElement/General/MEvv2ss.h
--- a/MatrixElement/General/MEvv2ss.h
+++ b/MatrixElement/General/MEvv2ss.h
@@ -1,229 +1,229 @@
// -*- C++ -*-
//
// MEvv2ss.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEvv2ss_H
#define HERWIG_MEvv2ss_H
//
// This is the declaration of the MEvv2ss class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVSSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractSSTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSSVertex.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using ThePEG::Helicity::VectorWaveFunction;
using ThePEG::Helicity::ScalarWaveFunction;
/**
* This is the implementation of the matrix element for the process
* vector-vector to scalar-scalar. It inherits from GeneralHardME and
* implements the required virtual functions.
*
* @see \ref MEff2ffInterfaces "The Interfaces"
* defined for MEff2ff.
* @see GeneralHardME
*/
class MEvv2ss: public GeneralHardME {
public:
/** A vector of VectorWaveFunction objects*/
typedef vector<VectorWaveFunction> VBVector;
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Set the Hardvertex for the spin correlations
* @param sub
*/
virtual void constructVertex(tSubProPtr sub);
private:
/**
* Calculate the matrix element.
* @param v1 A vector of VectorWaveFunction objects for the first boson
* @param v2 A vector of VectorWaveFunction objects for the second boson
* @param sca1 A ScalarWaveFunction for the first outgoing
* @param sca2 A ScalarWaveFunction for the second outgoing
* @param me2 The value of the spin-summed matrix element squared
* (to be calculated)
*/
ProductionMatrixElement vv2ssME(const VBVector & v1, const VBVector & v2,
const ScalarWaveFunction & sca1,
const ScalarWaveFunction & sca2,
double & me2) const;
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEvv2ss> initMEvv2ss;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEvv2ss & operator=(const MEvv2ss &);
private:
/** @name The dynamically casted vertices. */
//@{
/**
* Intermediate t-channel scalar
*/
vector<pair<AbstractVSSVertexPtr, AbstractVSSVertexPtr> > theSca;
/**
* Intermediate s-channel vector
*/
vector<pair<AbstractVVVVertexPtr, AbstractVSSVertexPtr> > theVec;
/**
* Intermediate s-channel tensor
*/
vector<pair<AbstractVVTVertexPtr, AbstractSSTVertexPtr> > theTen;
/**
* The contact vertex
*/
AbstractVVSSVertexPtr theContact;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEvv2ss. */
template <>
struct BaseClassTrait<Herwig::MEvv2ss,1> {
/** Typedef of the first base class of MEvv2ss. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEvv2ss class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEvv2ss>
: public ClassTraitsBase<Herwig::MEvv2ss> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEvv2ss"; }
};
/** @endcond */
}
#endif /* HERWIG_MEvv2ss_H */
diff --git a/MatrixElement/General/MEvv2vv.h b/MatrixElement/General/MEvv2vv.h
--- a/MatrixElement/General/MEvv2vv.h
+++ b/MatrixElement/General/MEvv2vv.h
@@ -1,224 +1,224 @@
// -*- C++ -*-
//
// MEvv2vv.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEvv2vv_H
#define HERWIG_MEvv2vv_H
//
// This is the declaration of the MEvv2vv class.
//
#include "GeneralHardME.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVTVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVVertex.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using Helicity::VectorWaveFunction;
/**
* This is the implementation of the matrix element for
* \f$2\to 2\f$ massless vector-boson pair to vector-boson pair. It inherits from
* GeneralHardME and implements the appropriate virtual member functions.
*
* @see \ref MEvv2vvInterfaces "The interfaces"
* defined for MEvv2vv.
*/
class MEvv2vv: public GeneralHardME {
public:
/**
* Typedef for VectorWaveFunction
*/
typedef vector<VectorWaveFunction> VBVector;
public:
/** @name Virtual functions required by the GeneralHardME class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
/**
* Construct the vertex information for the spin correlations
* @param sub Pointer to the relevent SubProcess
*/
virtual void constructVertex(tSubProPtr sub);
private:
/**
* Compute the matrix element for \f$V\, V\to V\, V\f$
* @param vin1 VectorWaveFunctions for first incoming particle
* @param vin2 VectorWaveFunctions for second incoming particle
* @param vout1 VectorWaveFunctions for first outgoing particle
* @param mc Whether vout1 is massless or not
* @param vout2 VectorWaveFunctions for outgoing particle
* @param md Whether vout2 is massless or not
* @param me2 colour averaged, spin summed ME
* @return ProductionMatrixElement containing results of
* helicity calculations
*/
ProductionMatrixElement
vv2vvHeME(VBVector & vin1, VBVector & vin2,
VBVector & vout1, bool mc, VBVector & vout2, bool md,
double & me2) const;
protected:
/**
* A debugging function to test the value of me2 against an
* analytic function.
* @param me2 The value of the \f$ |\bar{\mathcal{M}}|^2 \f$
*/
virtual void debug(double me2) const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEvv2vv> initMEvv2vv;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEvv2vv & operator=(const MEvv2vv &);
private:
/**
* Store the dynamically casted VVSVertex pointers
*/
vector<pair<AbstractVVSVertexPtr, AbstractVVSVertexPtr> > theScaV;
/**
* Store the dynamically casted VVVVertex pointers
*/
vector<pair<AbstractVVVVertexPtr, AbstractVVVVertexPtr> > theVecV;
/**
* Store the dynamically casted VVTVertex pointers
*/
vector<pair<AbstractVVTVertexPtr, AbstractVVTVertexPtr> > theTenV;
/**
* Store the dynamically casted VVVVVertex pointer
*/
AbstractVVVVVertexPtr theFPVertex;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEvv2vv. */
template <>
struct BaseClassTrait<Herwig::MEvv2vv,1> {
/** Typedef of the first base class of MEvv2vv. */
typedef Herwig::GeneralHardME NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEvv2vv class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEvv2vv>
: public ClassTraitsBase<Herwig::MEvv2vv> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEvv2vv"; }
};
/** @endcond */
}
#endif /* HERWIG_MEvv2vv_H */
diff --git a/MatrixElement/General/Makefile.am b/MatrixElement/General/Makefile.am
--- a/MatrixElement/General/Makefile.am
+++ b/MatrixElement/General/Makefile.am
@@ -1,14 +1,14 @@
noinst_LTLIBRARIES = libHwGeneralME.la
libHwGeneralME_la_SOURCES = \
-GeneralHardME.cc GeneralHardME.h GeneralHardME.icc GeneralHardME.fh \
+GeneralHardME.cc GeneralHardME.h GeneralHardME.fh \
MEvv2ff.cc MEvv2ff.h \
MEvv2ss.cc MEvv2ss.h \
MEfv2fs.cc MEfv2fs.h \
MEff2ss.cc MEff2ss.h \
MEff2ff.cc MEff2ff.h \
MEff2vv.cc MEff2vv.h \
MEfv2vf.cc MEfv2vf.h \
MEff2vs.h MEff2vs.cc \
MEff2sv.h MEff2sv.cc \
MEvv2vv.cc MEvv2vv.h
diff --git a/MatrixElement/Hadron/MEPP2GammaGamma.cc b/MatrixElement/Hadron/MEPP2GammaGamma.cc
--- a/MatrixElement/Hadron/MEPP2GammaGamma.cc
+++ b/MatrixElement/Hadron/MEPP2GammaGamma.cc
@@ -1,358 +1,366 @@
// -*- C++ -*-
//
// MEPP2GammaGamma.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the MEPP2GammaGamma class.
//
#include "MEPP2GammaGamma.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "Herwig++/Models/StandardModel/StandardModel.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "Herwig++/MatrixElement/HardVertex.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
using namespace Herwig;
+IBPtr MEPP2GammaGamma::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr MEPP2GammaGamma::fullclone() const {
+ return new_ptr(*this);
+}
+
unsigned int MEPP2GammaGamma::orderInAlphaS() const {
return 0;
}
unsigned int MEPP2GammaGamma::orderInAlphaEW() const {
return 2;
}
void MEPP2GammaGamma::doinit() {
// get the vedrtex pointers from the SM object
tcHwSMPtr hwsm= dynamic_ptr_cast<tcHwSMPtr>(standardModel());
// do the initialisation
if(hwsm)
{_photonvertex = hwsm->vertexFFP();}
else throw InitException() << "Wrong type of StandardModel object in "
<< "MEPP2GammaGamma::doinit() the Herwig++"
<< " version must be used"
<< Exception::runerror;
// call the base class
HwME2to2Base::doinit();
}
void MEPP2GammaGamma::getDiagrams() const {
// diagrams for q qbar to gamma gamma
tcPDPtr p = getParticleData(ParticleID::gamma);
if(_process==0||_process==1) {
for ( int i = 1; i <= 5; ++i ) {
tcPDPtr q = getParticleData(i);
tcPDPtr qb = q->CC();
// t channel
add(new_ptr((Tree2toNDiagram(3), q, qb, qb, 1, p, 2, p, -1)));
// u channel
add(new_ptr((Tree2toNDiagram(3), q, qb, qb, 2, p, 1, p, -2)));
}
}
// diagrams for g g to gamma gamma (this is garbage)
tcPDPtr g = getParticleData(ParticleID::g);
if(_process==0||_process==2)
add(new_ptr((Tree2toNDiagram(2), g, g, 1, p, 3, p, 3, p, -3)));
}
Energy2 MEPP2GammaGamma::scale() const {
Energy2 s(sHat()),u(uHat()),t(tHat());
return 2.*s*t*u/(s*s+t*t+u*u);
}
Selector<MEBase::DiagramIndex>
MEPP2GammaGamma::diagrams(const DiagramVector & diags) const {
Selector<DiagramIndex> sel;
for ( DiagramIndex i = 0; i < diags.size(); ++i )
if ( diags[i]->id() == -1 ) sel.insert(_diagwgt[0], i);
else if ( diags[i]->id() == -2 ) sel.insert(_diagwgt[1], i);
else if ( diags[i]->id() == -3 ) sel.insert(1.0, i);
return sel;
}
Selector<const ColourLines *>
MEPP2GammaGamma::colourGeometries(tcDiagPtr diag) const {
// q qbar colour lines
static const ColourLines cqqbar("1 -2 -3");
// g g colour lines
static const ColourLines cgluon("1 -2,-1 2");
// selector
Selector<const ColourLines *> sel;
if ( diag->id() == -1 || diag->id() == -2 ) sel.insert(1.0, &cqqbar);
else sel.insert(1.0, &cgluon);
return sel;
}
void MEPP2GammaGamma::persistentOutput(PersistentOStream & os) const {
os << _photonvertex << _maxflavour << _process;
}
void MEPP2GammaGamma::persistentInput(PersistentIStream & is, int) {
is >> _photonvertex >> _maxflavour >> _process;
}
ClassDescription<MEPP2GammaGamma> MEPP2GammaGamma::initMEPP2GammaGamma;
// Definition of the static class description member.
void MEPP2GammaGamma::Init() {
static ClassDocumentation<MEPP2GammaGamma> documentation
("The MEPP2GammaGamma class implements the matrix element for photon pair"
" production in hadron collisions.");
static Parameter<MEPP2GammaGamma,unsigned int> interfaceMaximumFlavour
("MaximumFlavour",
"The maximum flavour of the quarks in the process",
&MEPP2GammaGamma::_maxflavour, 5, 1, 5,
false, false, Interface::limited);
static Switch<MEPP2GammaGamma,unsigned int> interfaceProcess
("Process",
"Subprocesses to include",
&MEPP2GammaGamma::_process, 0, false, false);
static SwitchOption interfaceProcessAll
(interfaceProcess,
"All",
"Include all the subprocesses",
0);
static SwitchOption interfaceProcessqqbar
(interfaceProcess,
"qqbar",
"Only include the incoming q qbar subproces",
1);
static SwitchOption interfaceProcessgg
(interfaceProcess,
"gg",
"Only include the incoming gg subprocess",
2);
}
double MEPP2GammaGamma::me2() const {
// total matrix element
double me(0.);
// g g to gamma gamma
if(mePartonData()[0]->id()==ParticleID::g) {
VectorWaveFunction g1in(meMomenta()[0],mePartonData()[0],incoming);
VectorWaveFunction g2in(meMomenta()[1],mePartonData()[1],incoming);
VectorWaveFunction p1out(meMomenta()[2],mePartonData()[2],outgoing);
VectorWaveFunction p2out(meMomenta()[3],mePartonData()[3],outgoing);
vector<VectorWaveFunction> g1,g2,p1,p2;
for(unsigned int ix=0;ix<2;++ix) {
g1in.reset(2*ix) ;g1.push_back( g1in);
g2in.reset(2*ix) ;g2.push_back( g2in);
p1out.reset(2*ix);p1.push_back(p1out);
p2out.reset(2*ix);p2.push_back(p2out);
}
// calculate the matrix element
me = ggME(g1,g2,p1,p2,false);
}
// q qbar to gamma gamma
else {
unsigned int iq(1),iqb(0);
if(mePartonData()[0]->id()>0){iq=0;iqb=1;}
SpinorWaveFunction qin (meMomenta()[iq ],mePartonData()[iq ],incoming);
SpinorBarWaveFunction qbin(meMomenta()[iqb],mePartonData()[iqb],incoming);
VectorWaveFunction p1out(meMomenta()[ 2 ],mePartonData()[ 2 ],outgoing);
VectorWaveFunction p2out(meMomenta()[ 3 ],mePartonData()[ 3 ],outgoing);
vector<SpinorWaveFunction> fin;
vector<SpinorBarWaveFunction> ain;
vector<VectorWaveFunction> p1,p2;
for(unsigned int ix=0;ix<2;++ix) {
qin.reset(ix) ;fin.push_back( qin );
qbin.reset(ix) ;ain.push_back( qbin);
p1out.reset(2*ix); p1.push_back(p1out);
p2out.reset(2*ix); p2.push_back(p2out);
}
// calculate the matrix element
me= qqbarME(fin,ain,p1,p2,false);
}
return me;
}
double MEPP2GammaGamma::qqbarME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
vector<VectorWaveFunction> & p1,
vector<VectorWaveFunction> & p2,
bool calc) const {
// the particles should be in the order
// for the incoming
// 0 incoming fermion (u spinor)
// 1 incoming antifermion (vbar spinor)
// for the outgoing
// 0 first outgoing photon
// 1 second outgoing photon
// me to be returned
ProductionMatrixElement newme(PDT::Spin1Half,PDT::Spin1Half,
PDT::Spin1,PDT::Spin1);
// wavefunction for the intermediate particles
SpinorWaveFunction inter;
unsigned int inhel1,inhel2,outhel1,outhel2;
Complex diag[3];
double me(0.),diag1(0.),diag2(0.);
for(inhel1=0;inhel1<2;++inhel1) {
for(inhel2=0;inhel2<2;++inhel2) {
for(outhel1=0;outhel1<2;++outhel1) {
for(outhel2=0;outhel2<2;++outhel2) {
// first diagram
inter = _photonvertex->evaluate(ZERO,5,fin[inhel1].particle()->CC(),
fin[inhel1],p1[outhel1]);
diag[0] = _photonvertex->evaluate(ZERO,inter,ain[inhel2],p2[outhel2]);
// second diagram
inter = _photonvertex->evaluate(ZERO,5,fin[inhel1].particle()->CC(),
fin[inhel1],p2[outhel2]);
diag[1] = _photonvertex->evaluate(ZERO,inter,ain[inhel2],p1[outhel1]);
// compute the running totals
diag[2]=diag[0]+diag[1];
diag1 += norm(diag[0]);
diag2 += norm(diag[1]);
me += norm(diag[2]);
// matrix element
if(calc) newme(inhel1,inhel2,2*outhel1,2*outhel2)=diag[2];
}
}
}
}
// save the info on the diagrams
if(!calc) {
_diagwgt[0]=diag1;
_diagwgt[1]=diag2;
}
// check versus analytic result
// Energy2 s(sHat()),u(uHat()),t(tHat());
// double test = 2./3.*sqr(4.*pi*SM().alphaEM(0.))*(t/u+u/t)*
// sqr(mePartonData()[0]->charge())*
// sqr(mePartonData()[0]->charge());
// cerr << "testing me " << 12./me*test << endl;
// return the answer (including colour and spin factor)
if(calc) _me.reset(newme);
return me/12;
}
double MEPP2GammaGamma::ggME(vector<VectorWaveFunction> &,
vector<VectorWaveFunction> &,
vector<VectorWaveFunction> &,
vector<VectorWaveFunction> &,
bool calc) const {
// we probably need some basis rotation here ?????
// get the scales
Energy2 s(sHat()),u(uHat()),t(tHat());
Complex me[2][2][2][2];
double charge(11./9.);
// ++++
me[1][1][1][1] = charge*ggme(s,t,u);
// +++-
me[1][1][1][0] =-charge;
// ++-+
me[1][1][0][1] =-charge;
// ++--
me[1][1][0][0] =-charge;
// +-++
me[1][0][1][1] =-charge;
// +-+-
me[1][0][1][0] = charge*ggme(u,t,s);
// +--+
me[1][0][0][1] = charge*ggme(t,s,u);
// +---
me[1][0][0][0] = charge;
// -+++
me[0][1][1][1] =-charge;
// -++-
me[0][1][1][0] =-me[1][0][0][1];
// -+-+
me[0][1][0][1] =-me[1][0][1][0];
// -+--
me[0][1][0][0] = charge;
// --++
me[0][0][1][1] = charge;
// --+-
me[0][0][1][0] = charge;
// ---+
me[0][0][0][1] = charge;
// ----
me[0][0][0][0] =-me[1][1][1][1];
ProductionMatrixElement newme(PDT::Spin1,PDT::Spin1,
PDT::Spin1,PDT::Spin1);
unsigned int inhel1,inhel2,outhel1,outhel2;
double sum(0.);
for(inhel1=0;inhel1<2;++inhel1) {
for(inhel2=0;inhel2<2;++inhel2) {
for(outhel1=0;outhel1<2;++outhel1) {
for(outhel2=0;outhel2<2;++outhel2) {
sum+=real( me[inhel1][inhel2][outhel1][outhel2]*
conj(me[inhel1][inhel2][outhel1][outhel2]));
// matrix element
if(calc) newme(2*inhel1,2*inhel2,
2*outhel1,2*outhel2)=me[inhel1][inhel2][outhel1][outhel2];
}
}
}
}
// double pi2(sqr(pi));
// Energy2 s2(sqr(s)),t2(sqr(t)),u2(sqr(u));
// double alntu=log(t/u);
// double alnst=log(-s/t);
// double alnsu=alnst+alntu;
// double test=5.*4.
// +sqr((2.*s2+2.*(u2-t2)*alntu+(t2+u2)*(sqr(alntu)+pi2))/s2)
// +sqr((2.*u2+2.*(t2-s2)*alnst+(t2+s2)* sqr(alnst) )/u2)
// +sqr((2.*t2+2.*(u2-s2)*alnsu+(u2+s2)* sqr(alnsu) )/t2)
// +4.*pi2*(sqr((t2-s2+(t2+s2)*alnst)/u2)+sqr((u2-s2+(u2+s2)*alnsu)/t2));
// cerr << "testing ratio " << sum/test/sqr(charge)*2. << endl;
// final factors
if(calc) _me.reset(newme);
return 0.5*sum*sqr(SM().alphaS(scale())*SM().alphaEM(ZERO));
}
void MEPP2GammaGamma::constructVertex(tSubProPtr sub) {
SpinfoPtr spin[4];
// extract the particles in the hard process
ParticleVector hard;
hard.push_back(sub->incoming().first);hard.push_back(sub->incoming().second);
hard.push_back(sub->outgoing()[0]);hard.push_back(sub->outgoing()[1]);
// order of particles
unsigned int order[4]={0,1,2,3};
// identify the process and calculate matrix element
vector<VectorWaveFunction> g1,g2,p1,p2;
if(hard[0]->id()==ParticleID::g) {
VectorWaveFunction (g1,hard[order[0]],incoming,false,true,true);
VectorWaveFunction (g2,hard[order[1]],incoming,false,true,true);
VectorWaveFunction (p1,hard[order[2]],outgoing,true ,true,true);
VectorWaveFunction (p2,hard[order[3]],outgoing,true ,true,true);
g1[1]=g1[2];g2[1]=g2[2];p1[1]=p1[2];p2[1]=p2[2];
ggME(g1,g2,p1,p2,true);
}
else {
if(hard[order[0]]->id()<0) swap(order[0],order[1]);
vector<SpinorWaveFunction> q;
vector<SpinorBarWaveFunction> qb;
SpinorWaveFunction (q ,hard[order[0]],incoming,false,true);
SpinorBarWaveFunction(qb,hard[order[1]],incoming,false,true);
VectorWaveFunction (p1,hard[order[2]],outgoing,true ,true,true);
VectorWaveFunction (p2,hard[order[3]],outgoing,true ,true,true);
p1[1]=p1[2];p2[1]=p2[2];
qqbarME(q,qb,p1,p2,true);
}
// get the spin info objects
for(unsigned int ix=0;ix<4;++ix)
spin[ix]=dynamic_ptr_cast<SpinfoPtr>(hard[order[ix]]->spinInfo());
// construct the vertex
HardVertexPtr hardvertex=new_ptr(HardVertex());
// set the matrix element for the vertex
hardvertex->ME(_me);
// set the pointers and to and from the vertex
for(unsigned int ix=0;ix<4;++ix)
spin[ix]->setProductionVertex(hardvertex);
}
diff --git a/MatrixElement/Hadron/MEPP2GammaGamma.h b/MatrixElement/Hadron/MEPP2GammaGamma.h
--- a/MatrixElement/Hadron/MEPP2GammaGamma.h
+++ b/MatrixElement/Hadron/MEPP2GammaGamma.h
@@ -1,279 +1,289 @@
// -*- C++ -*-
//
// MEPP2GammaGamma.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEPP2GammaGamma_H
#define HERWIG_MEPP2GammaGamma_H
//
// This is the declaration of the MEPP2GammaGamma class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2GammaGamma class implements the production of photon pairs in
* hadron hadron collisions.
*
* @see \ref MEPP2GammaGammaInterfaces "The interfaces"
* defined for MEPP2GammaGamma.
*/
class MEPP2GammaGamma: public HwME2to2Base {
public:
/**
* The default constructor.
*/
- inline MEPP2GammaGamma();
-
+ MEPP2GammaGamma() : _maxflavour(5),_process(0) {
+ massOption(true,0);
+ massOption(true,0);
+ }
+
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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;
+ virtual IBPtr clone() const;
/** 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;
+ virtual IBPtr fullclone() const;
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* Members to return the matrix elements for the different subprocesses
*/
//@{
/**
* Matrix element for \f$q\bar{q}\to \gamma\gamma\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param p1 Polarization vectors for the first outgoing photon
* @param p2 Polarization vectors for the second outgoing photon
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double qqbarME(vector<SpinorWaveFunction> & fin, vector<SpinorBarWaveFunction> & ain,
vector<VectorWaveFunction> & p1 , vector<VectorWaveFunction> & p2 ,
bool me) const;
/**
* Matrix element for \f$gg \to \gamma\gamma\f$.
* @param g1 Polarization vectors for the first incoming gluon
* @param g2 Polarization vectors for the second incoming gluon
* @param p1 Polarization vectors for the first outgoing photon
* @param p2 Polarization vectors for the second outgoing photon
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double ggME(vector<VectorWaveFunction> & g1 , vector<VectorWaveFunction> & g2 ,
vector<VectorWaveFunction> & p1 , vector<VectorWaveFunction> & p2 ,
bool me) const;
//@}
/**
* \f$gg\to\gamma\gamma\f$ matrix element for the \f$++++\f$ helicity configuration.
* @param s The \f$s\f$ invariant
* @param t The \f$t\f$ invariant
* @param u The \f$u\f$ invariant
*/
- inline Complex ggme(Energy2 s,Energy2 t,Energy2 u) const;
+ Complex ggme(Energy2 s,Energy2 t,Energy2 u) const {
+ double ltu(log(abs(t/u)));
+ double frac1((t-u)/s),frac2((sqr(t)+sqr(u))/sqr(s));
+ double thetatu = (t/u<0) ? 0 : 1;
+ double thetat = (t<ZERO) ? 0 : 1;
+ double thetau = (u<ZERO) ? 0 : 1;
+ using Constants::pi;
+ return Complex(1.+frac1*ltu+0.5*frac2*(sqr(ltu)+sqr(pi)*thetatu),
+ -pi*(thetat-thetau)*(frac1+frac2*ltu));
+ }
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2GammaGamma> initMEPP2GammaGamma;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2GammaGamma & operator=(const MEPP2GammaGamma &);
private:
/**
* Pointer to the quark-antiquark-photon vertex
*/
AbstractFFVVertexPtr _photonvertex;
/**
* Maximum PDG code of the quarks allowed
*/
unsigned int _maxflavour;
/**
* Option for which processes to include
*/
unsigned int _process;
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
/**
* weights for the different quark annhilation diagrams
*/
mutable double _diagwgt[2];
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2GammaGamma. */
template <>
struct BaseClassTrait<Herwig::MEPP2GammaGamma,1> {
/** Typedef of the first base class of MEPP2GammaGamma. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2GammaGamma class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2GammaGamma>
: public ClassTraitsBase<Herwig::MEPP2GammaGamma> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2GammaGamma"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2GammaGamma is implemented. It may also include several, space-separated,
* libraries if the class MEPP2GammaGamma 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 "HwMEHadron.so"; }
};
/** @endcond */
}
-#include "MEPP2GammaGamma.icc"
-
#endif /* HERWIG_MEPP2GammaGamma_H */
diff --git a/MatrixElement/Hadron/MEPP2GammaGamma.icc b/MatrixElement/Hadron/MEPP2GammaGamma.icc
deleted file mode 100644
--- a/MatrixElement/Hadron/MEPP2GammaGamma.icc
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- C++ -*-
-//
-// MEPP2GammaGamma.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the MEPP2GammaGamma class.
-//
-
-namespace Herwig {
-
-inline MEPP2GammaGamma::MEPP2GammaGamma() : _maxflavour(5),_process(0) {
- massOption(true,0);
- massOption(true,0);
-}
-
-inline IBPtr MEPP2GammaGamma::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr MEPP2GammaGamma::fullclone() const {
- return new_ptr(*this);
-}
-
-inline Complex MEPP2GammaGamma::ggme(Energy2 s,Energy2 t,Energy2 u) const {
- double ltu(log(abs(t/u)));
- double frac1((t-u)/s),frac2((sqr(t)+sqr(u))/sqr(s));
- double thetatu = (t/u<0) ? 0 : 1;
- double thetat = (t<ZERO) ? 0 : 1;
- double thetau = (u<ZERO) ? 0 : 1;
- using Constants::pi;
- return Complex(1.+frac1*ltu+0.5*frac2*(sqr(ltu)+sqr(pi)*thetatu),
- -pi*(thetat-thetau)*(frac1+frac2*ltu));
-}
-
-}
diff --git a/MatrixElement/Hadron/MEPP2GammaJet.h b/MatrixElement/Hadron/MEPP2GammaJet.h
--- a/MatrixElement/Hadron/MEPP2GammaJet.h
+++ b/MatrixElement/Hadron/MEPP2GammaJet.h
@@ -1,299 +1,299 @@
// -*- C++ -*-
//
// MEPP2GammaJet.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEPP2GammaJet_H
#define HERWIG_MEPP2GammaJet_H
//
// This is the declaration of the MEPP2GammaJet class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/** \ingroup MatrixElements
* The MEPP2GammaJet class implements the matrix element for photon+jet
* production in hadron-hadron collisions.
*
* @see \ref MEPP2GammaJetInterfaces "The interfaces"
* defined for MEPP2GammaJet.
*/
class MEPP2GammaJet: public HwME2to2Base {
public:
/**
* The default constructor.
*/
- inline MEPP2GammaJet();
+ MEPP2GammaJet();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans)
;
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* Members to return the matrix elements for the different subprocesses
*/
//@{
/**
* Matrix element for \f$q\bar{q}\to g\gamma\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param gout Polarization vectors for the outgoing gluon
* @param pout Polarization vectors for the outgoing photon
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double qqbarME(vector<SpinorWaveFunction> & fin, vector<SpinorBarWaveFunction> & ain,
vector<VectorWaveFunction> & gout, vector<VectorWaveFunction> & pout,
bool me) const;
/**
* Matrix element for \f$qg\to \gamma q\f$.
* @param fin Spinors for incoming quark
* @param gin Polarization vectors for the incoming gluon
* @param pout Polarization vectors for the outgoing photon
* @param fout Spinors for outgoing quark
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double qgME(vector<SpinorWaveFunction> & fin,vector<VectorWaveFunction> & gin,
vector<VectorWaveFunction> & pout,vector<SpinorBarWaveFunction> & fout,
bool me) const;
/**
* Matrix element for \f$\bar{q}g\to \gamma \bar{q}\f$.
* @param ain Spinors for the incoming antiquark
* @param gin Polarization vectors for the incoming gluon
* @param pout Polarization vectors for the outgoing photon
* @param aout Spinors for the outgoing antiquark
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double qbargME(vector<SpinorBarWaveFunction> & ain, vector<VectorWaveFunction> & gin,
vector<VectorWaveFunction> & pout, vector<SpinorWaveFunction> & aout,
bool me) const;
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2GammaJet> initMEPP2GammaJet;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2GammaJet & operator=(const MEPP2GammaJet &);
private:
/**
* Pointer to the quark-antiquark-gluon vertex
*/
AbstractFFVVertexPtr _gluonvertex;
/**
* Pointer to the quark-antiquark-photon vertex
*/
AbstractFFVVertexPtr _photonvertex;
/**
* Maximum PDG code of the quarks allowed
*/
int _maxflavour;
/**
* Option for which processes to include
*/
unsigned int _processopt;
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2GammaJet. */
template <>
struct BaseClassTrait<Herwig::MEPP2GammaJet,1> {
/** Typedef of the first base class of MEPP2GammaJet. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2GammaJet class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2GammaJet>
: public ClassTraitsBase<Herwig::MEPP2GammaJet> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2GammaJet"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2GammaJet is implemented. It may also include several, space-separated,
* libraries if the class MEPP2GammaJet 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2GammaJet_H */
diff --git a/MatrixElement/Hadron/MEPP2Higgs.h b/MatrixElement/Hadron/MEPP2Higgs.h
--- a/MatrixElement/Hadron/MEPP2Higgs.h
+++ b/MatrixElement/Hadron/MEPP2Higgs.h
@@ -1,325 +1,325 @@
// -*- C++ -*-
//
// MEPP2Higgs.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEPP2Higgs_H
#define HERWIG_MEPP2Higgs_H
//
// This is the declaration of the MEPP2Higgs class.
//
#include "ThePEG/MatrixElement/MEBase.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractFFSVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVSVertex.h"
#include "Herwig++/PDT/SMHiggsMassGenerator.h"
#include "Herwig++/Models/StandardModel/StandardModel.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2Higgs class implements the matrix element for the process
* pp->Higgs with different Higgs shape prescriptions (see details in hep-ph/9505211)
* and the NLL corrected Higgs width (see details in the FORTRAN HERWIG manual).
*
* @see \ref MEPP2HiggsInterfaces "The interfaces"
* defined for MEPP2Higgs.
*/
class MEPP2Higgs: public MEBase {
public:
/**
* The default constructor.
*/
MEPP2Higgs();
/**
* Return the matrix element for the kinematical configuation
* previously provided by the last call to setKinematics(). Uses
* me().
*/
virtual CrossSection dSigHatDR() const;
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Generate internal degrees of freedom given nDim() uniform
* random numbers in the interval \f$ ]0,1[ \f$. To help the phase space
* generator, the dSigHatDR should be a smooth function of these
* numbers, although this is not strictly necessary.
* @param r a pointer to the first of nDim() consecutive random numbers.
* @return true if the generation succeeded, otherwise false.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degrees of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *> colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2Higgs> initMEPP2Higgs;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2Higgs & operator=(const MEPP2Higgs &);
//@}
/**
* Members to return the matrix elements for the different subprocesses
*/
//@{
/**
* Calculates the matrix element for the process g,g->h (via quark loops)
* @param g1 a vector of wave functions of the first incoming gluon
* @param g2 a vector of wave functions of the second incoming gluon
* @param calc Whether or not to calculate the matrix element for spin correlations
* @return the amlitude value.
*/
double ggME(vector<VectorWaveFunction> g1,
vector<VectorWaveFunction> g2,
ScalarWaveFunction &,
bool calc) const;
/**
* Calculates the matrix element for the process q,qbar->h
* @param fin a vector of quark spinors
* @param ain a vector of anti-quark spinors
* @param calc Whether or not to calculate the matrix element for spin correlations
* @return the amlitude value.
*/
double qqME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
ScalarWaveFunction &,
bool calc) const;
//@}
private:
/**
* Defines the Higgs resonance shape
*/
unsigned int shapeopt;
/**
* The processes to be included (GG->H and/or qq->H)
*/
unsigned int processopt;
/**
* Minimum flavour of incoming quarks
*/
int minflavouropt;
/**
* Maximum flavour of incoming quarks
*/
int maxflavouropt;
/**
* Storage of the diagram weights for the \f$gg\to Hg\f$ subprocess
*/
mutable double diagwgt[3];
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
/**
* Pointer to the H->2gluons vertex (used in gg->H)
*/
AbstractVVSVertexPtr hggvertex;
/**
* Pointer to the fermion-fermion Higgs vertex (used in qq->H)
*/
AbstractFFSVertexPtr ffhvertex;
/**
* Pointer to the Standard Model instance used in the class
*/
tcHwSMPtr theSM;
/**
* The mass generator for the Higgs
*/
SMHiggsMassGeneratorPtr _hmass;
/**
* On-shell mass for the higgs
*/
Energy _mh;
/**
* On-shell width for the higgs
*/
Energy _wh;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the base classes of MEPP2Higgs. */
template <>
struct BaseClassTrait<Herwig::MEPP2Higgs,1> {
/** Typedef of the first base class of MEPP2Higgs. */
typedef MEBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2Higgs class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2Higgs>
: public ClassTraitsBase<Herwig::MEPP2Higgs> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2Higgs"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2Higgs is implemented. It may also include several, space-separated,
* libraries if the class MEPP2Higgs 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2Higgs_H */
diff --git a/MatrixElement/Hadron/MEPP2HiggsJet.cc b/MatrixElement/Hadron/MEPP2HiggsJet.cc
--- a/MatrixElement/Hadron/MEPP2HiggsJet.cc
+++ b/MatrixElement/Hadron/MEPP2HiggsJet.cc
@@ -1,867 +1,875 @@
// -*- C++ -*-
//
// MEPP2HiggsJet.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the MEPP2HiggsJet class.
//
#include "MEPP2HiggsJet.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/StandardModel/StandardModelBase.h"
#include "ThePEG/Utilities/SimplePhaseSpace.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "ThePEG/Cuts/Cuts.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
#include "Herwig++/MatrixElement/HardVertex.h"
using namespace Herwig;
const Complex MEPP2HiggsJet::_epsi = Complex(0.,-1.e-20);
+IBPtr MEPP2HiggsJet::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr MEPP2HiggsJet::fullclone() const {
+ return new_ptr(*this);
+}
+
unsigned int MEPP2HiggsJet::orderInAlphaS() const {
return 3;
}
unsigned int MEPP2HiggsJet::orderInAlphaEW() const {
return 1;
}
void MEPP2HiggsJet::persistentOutput(PersistentOStream & os) const {
os << _shapeopt << _maxflavour << _process << _minloop << _maxloop << _massopt
<< ounit(_mh,GeV) << ounit(_wh,GeV) << _hmass;
}
void MEPP2HiggsJet::persistentInput(PersistentIStream & is, int) {
is >> _shapeopt >> _maxflavour >> _process >> _minloop >> _maxloop >> _massopt
>> iunit(_mh,GeV) >> iunit(_wh,GeV) >> _hmass;
}
ClassDescription<MEPP2HiggsJet> MEPP2HiggsJet::initMEPP2HiggsJet;
// Definition of the static class description member.
void MEPP2HiggsJet::Init() {
static ClassDocumentation<MEPP2HiggsJet> documentation
("The MEPP2HiggsJet class implements the matrix elements for"
" Higgs+Jet production in hadron-hadron collisions.",
"The theoretical calculations of \\cite{Baur:1989cm} and \\cite{Ellis:1987xu}"
" were used for the Higgs+jet matrix element in hadron-hadron collisions.",
"\\bibitem{Baur:1989cm} U.~Baur and E.~W.~N.~Glover,"
"Nucl.\\ Phys.\\ B {\\bf 339} (1990) 38.\n"
"\\bibitem{Ellis:1987xu} R.~K.~Ellis, I.~Hinchliffe, M.~Soldate and "
"J.~J.~van der Bij, Nucl.\\ Phys.\\ B {\\bf 297} (1988) 221.");
static Parameter<MEPP2HiggsJet,unsigned int> interfaceMaximumFlavour
("MaximumFlavour",
"The maximum flavour of the quarks in the process",
&MEPP2HiggsJet::_maxflavour, 5, 1, 5,
false, false, Interface::limited);
static Switch<MEPP2HiggsJet,unsigned int> interfaceShapeOption
("ShapeScheme",
"Option for the treatment of the Higgs resonance shape",
&MEPP2HiggsJet::_shapeopt, 1, false, false);
static SwitchOption interfaceStandardShapeFixed
(interfaceShapeOption,
"FixedBreitWigner",
"Breit-Wigner s-channel resonanse",
1);
static SwitchOption interfaceStandardShapeRunning
(interfaceShapeOption,
"MassGenerator",
"Use the mass generator to give the shape",
2);
static Switch<MEPP2HiggsJet,unsigned int> interfaceProcess
("Process",
"Which subprocesses to include",
&MEPP2HiggsJet::_process, 0, false, false);
static SwitchOption interfaceProcessAll
(interfaceProcess,
"All",
"Include all subprocesses",
0);
static SwitchOption interfaceProcess1
(interfaceProcess,
"qqbar",
"Only include the incoming q qbar subprocess",
1);
static SwitchOption interfaceProcessqg
(interfaceProcess,
"qg",
"Only include the incoming qg subprocess",
2);
static SwitchOption interfaceProcessqbarg
(interfaceProcess,
"qbarg",
"Only include the incoming qbar g subprocess",
3);
static SwitchOption interfaceProcessgg
(interfaceProcess,
"gg",
"Only include the incoming gg subprocess",
4);
static Parameter<MEPP2HiggsJet,int> interfaceMinimumInLoop
("MinimumInLoop",
"The minimum flavour of the quarks to include in the loops",
&MEPP2HiggsJet::_minloop, 6, 4, 6,
false, false, Interface::limited);
static Parameter<MEPP2HiggsJet,int> interfaceMaximumInLoop
("MaximumInLoop",
"The maximum flavour of the quarks to include in the loops",
&MEPP2HiggsJet::_maxloop, 6, 4, 6,
false, false, Interface::limited);
static Switch<MEPP2HiggsJet,unsigned int> interfaceMassOption
("MassOption",
"Option for the treatment of the masses in the loop diagrams",
&MEPP2HiggsJet::_massopt, 0, false, false);
static SwitchOption interfaceMassOptionFull
(interfaceMassOption,
"Full",
"Include the full mass dependence",
0);
static SwitchOption interfaceMassOptionLarge
(interfaceMassOption,
"Large",
"Use the heavy mass limit",
1);
}
bool MEPP2HiggsJet::generateKinematics(const double * r) {
Energy ptmin = max(lastCuts().minKT(mePartonData()[2]),
lastCuts().minKT(mePartonData()[3]));
Energy e = sqrt(sHat())/2.0;
// generate the mass of the higgs boson
Energy2 mhmax2 = sHat()-4.*ptmin*e;
Energy2 mhmin2 =ZERO;
if(mhmax2<=mhmin2) return false;
double rhomin = atan((mhmin2-sqr(_mh))/_mh/_wh);
double rhomax = atan((mhmax2-sqr(_mh))/_mh/_wh);
Energy mh = sqrt(_mh*_wh*tan(rhomin+r[1]*(rhomax-rhomin))+sqr(_mh));
// assign masses
if(mePartonData()[2]->id()!=ParticleID::h0) {
meMomenta()[2].setMass(ZERO);
meMomenta()[3].setMass(mh);
}
else {
meMomenta()[3].setMass(ZERO);
meMomenta()[2].setMass(mh);
}
Energy q = ZERO;
try {
q = SimplePhaseSpace::
getMagnitude(sHat(), meMomenta()[2].mass(), meMomenta()[3].mass());
}
catch ( ImpossibleKinematics ) {
return false;
}
Energy2 m22 = meMomenta()[2].mass2();
Energy2 m32 = meMomenta()[3].mass2();
Energy2 e0e2 = 2.0*e*sqrt(sqr(q) + m22);
Energy2 e1e2 = 2.0*e*sqrt(sqr(q) + m22);
Energy2 e0e3 = 2.0*e*sqrt(sqr(q) + m32);
Energy2 e1e3 = 2.0*e*sqrt(sqr(q) + m32);
Energy2 pq = 2.0*e*q;
double ctmin = -1.0,ctmax = 1.0;
Energy2 thmin = lastCuts().minTij(mePartonData()[0], mePartonData()[2]);
if ( thmin > ZERO ) ctmax = min(ctmax, (e0e2 - m22 - thmin)/pq);
thmin = lastCuts().minTij(mePartonData()[1], mePartonData()[2]);
if ( thmin > ZERO ) ctmin = max(ctmin, (thmin + m22 - e1e2)/pq);
thmin = lastCuts().minTij(mePartonData()[1], mePartonData()[3]);
if ( thmin > ZERO ) ctmax = min(ctmax, (e1e3 - m32 - thmin)/pq);
thmin = lastCuts().minTij(mePartonData()[0], mePartonData()[3]);
if ( thmin > ZERO ) ctmin = max(ctmin, (thmin + m32 - e0e3)/pq);
if ( ptmin > ZERO ) {
double ctm = 1.0 - sqr(ptmin/q);
if ( ctm <= 0.0 ) return false;
ctmin = max(ctmin, -sqrt(ctm));
ctmax = min(ctmax, sqrt(ctm));
}
if ( ctmin >= ctmax ) return false;
double cth = getCosTheta(ctmin, ctmax, r);
Energy pt = q*sqrt(1.0-sqr(cth));
phi(rnd(2.0*Constants::pi));
meMomenta()[2].setX(pt*sin(phi()));
meMomenta()[2].setY(pt*cos(phi()));
meMomenta()[2].setZ(q*cth);
meMomenta()[3].setX(-pt*sin(phi()));
meMomenta()[3].setY(-pt*cos(phi()));
meMomenta()[3].setZ(-q*cth);
meMomenta()[2].rescaleEnergy();
meMomenta()[3].rescaleEnergy();
vector<LorentzMomentum> out(2);
out[0] = meMomenta()[2];
out[1] = meMomenta()[3];
tcPDVector tout(2);
tout[0] = mePartonData()[2];
tout[1] = mePartonData()[3];
if ( !lastCuts().passCuts(tout, out, mePartonData()[0], mePartonData()[1]) )
return false;
tHat(pq*cth + m22 - e0e2);
uHat(m22 + m32 - sHat() - tHat());
// main piece
jacobian((pq/sHat())*Constants::pi*jacobian());
// mass piece
jacobian((rhomax-rhomin)*jacobian());
return true;
}
void MEPP2HiggsJet::getDiagrams() const {
tcPDPtr h0=getParticleData(ParticleID::h0);
tcPDPtr g =getParticleData(ParticleID::g);
tcPDPtr q[6],qb[6];
for(int ix=0;ix<int(_maxflavour);++ix) {
q [ix]=getParticleData( ix+1);
qb[ix]=getParticleData(-ix-1);
}
// q qbar -> H g
if(_process==0||_process==1)
{for(unsigned int ix=0;ix<_maxflavour;++ix)
{add(new_ptr((Tree2toNDiagram(2), q[ix], qb[ix], 1, g , 3, h0, 3, g, -1)));}}
// q g -> H g
if(_process==0||_process==2)
{for(unsigned int ix=0;ix<_maxflavour;++ix)
{add(new_ptr((Tree2toNDiagram(3), q[ix], g, g, 2, h0, 1, q[ix], -2)));}}
// qbar g -> H qbar
if(_process==0||_process==3)
{for(unsigned int ix=0;ix<_maxflavour;++ix)
{add(new_ptr((Tree2toNDiagram(3), qb[ix], g, g, 2, h0, 1, qb[ix], -3)));}}
// g g -> H g
if(_process==0||_process==4)
{
// t channel
add(new_ptr((Tree2toNDiagram(3), g, g, g, 1, h0, 2, g, -4)));
// u channel
add(new_ptr((Tree2toNDiagram(3), g, g, g, 2, h0, 1, g, -5)));
// s channel
add(new_ptr((Tree2toNDiagram(2), g, g, 1, g , 3, h0, 3, g, -6)));
}
}
Energy2 MEPP2HiggsJet::scale() const {
return meMomenta()[2].perp2()+ meMomenta()[2].m2();
}
double MEPP2HiggsJet::me2() const {
useMe();
double output(0.);
// g g to H g
if(mePartonData()[0]->id()==ParticleID::g&&mePartonData()[1]->id()==ParticleID::g) {
// order of the particles
unsigned int ih(2),ig(3);
if(mePartonData()[3]->id()==ParticleID::h0){ig=2;ih=3;}
VectorWaveFunction glin1(meMomenta()[ 0],mePartonData()[ 0],incoming);
VectorWaveFunction glin2(meMomenta()[ 1],mePartonData()[ 1],incoming);
ScalarWaveFunction hout(meMomenta()[ih],mePartonData()[ih],outgoing);
VectorWaveFunction glout(meMomenta()[ig],mePartonData()[ig],outgoing);
vector<VectorWaveFunction> g1,g2,g4;
for(unsigned int ix=0;ix<2;++ix) {
glin1.reset(2*ix);g1.push_back(glin1);
glin2.reset(2*ix);g2.push_back(glin2);
glout.reset(2*ix);g4.push_back(glout);
}
// calculate the matrix element
output = ggME(g1,g2,hout,g4,false);
}
// qg -> H q
else if(mePartonData()[0]->id()>0&&mePartonData()[1]->id()==ParticleID::g) {
// order of the particles
unsigned int iq(0),iqb(3),ih(2),ig(1);
if(mePartonData()[0]->id()==ParticleID::g){iq=1;ig=0;}
if(mePartonData()[3]->id()==ParticleID::h0){iqb=2;ih=3;}
// calculate the spinors and polarization vectors
vector<SpinorWaveFunction> fin;
vector<SpinorBarWaveFunction> fout;
vector<VectorWaveFunction> gin;
SpinorWaveFunction qin (meMomenta()[iq ],mePartonData()[iq ],incoming);
VectorWaveFunction glin(meMomenta()[ig ],mePartonData()[ig ],incoming);
ScalarWaveFunction hout(meMomenta()[ih ],mePartonData()[ih ],outgoing);
SpinorBarWaveFunction qout(meMomenta()[iqb],mePartonData()[iqb],outgoing);
for(unsigned int ix=0;ix<2;++ix) {
qin.reset(ix) ; fin.push_back( qin);
qout.reset(ix) ;fout.push_back(qout);
glin.reset(2*ix); gin.push_back(glin);
}
// calculate the matrix element
output = qgME(fin,gin,hout,fout,false);
}
// qbar g -> H q
else if(mePartonData()[0]->id()<0&&mePartonData()[1]->id()==ParticleID::g) {
// order of the particles
unsigned int iq(0),iqb(3),ih(2),ig(1);
if(mePartonData()[0]->id()==ParticleID::g){iq=1;ig=0;}
if(mePartonData()[3]->id()==ParticleID::h0){iqb=2;ih=3;}
// calculate the spinors and polarization vectors
vector<SpinorBarWaveFunction> fin;
vector<SpinorWaveFunction> fout;
vector<VectorWaveFunction> gin;
SpinorBarWaveFunction qin (meMomenta()[iq ],mePartonData()[iq ],incoming);
VectorWaveFunction glin(meMomenta()[ig ],mePartonData()[ig ],incoming);
ScalarWaveFunction hout(meMomenta()[ih ],mePartonData()[ih ],outgoing);
SpinorWaveFunction qout(meMomenta()[iqb],mePartonData()[iqb],outgoing);
for(unsigned int ix=0;ix<2;++ix) {
qin.reset(ix) ; fin.push_back( qin);
qout.reset(ix) ;fout.push_back(qout);
glin.reset(2*ix); gin.push_back(glin);
}
// calculate the matrix element
output = qbargME(fin,gin,hout,fout,false);
}
// q qbar to H g
else if(mePartonData()[0]->id()==-mePartonData()[1]->id()) {
// order of the particles
unsigned int iq(0),iqb(1),ih(2),ig(3);
if(mePartonData()[0]->id()<0){iq=1;iqb=0;}
if(mePartonData()[2]->id()==ParticleID::g){ig=2;ih=3;}
// calculate the spinors and polarization vectors
vector<SpinorWaveFunction> fin;
vector<SpinorBarWaveFunction> ain;
vector<VectorWaveFunction> gout;
SpinorWaveFunction qin (meMomenta()[iq ],mePartonData()[iq ],incoming);
SpinorBarWaveFunction qbin(meMomenta()[iqb],mePartonData()[iqb],incoming);
ScalarWaveFunction hout(meMomenta()[ih ],mePartonData()[ih ],outgoing);
VectorWaveFunction glout(meMomenta()[ig ],mePartonData()[ig ],outgoing);
for(unsigned int ix=0;ix<2;++ix) {
qin.reset(ix) ; fin.push_back( qin);
qbin.reset(ix) ; ain.push_back( qbin);
glout.reset(2*ix);gout.push_back(glout);
}
// calculate the matrix element
output = qqbarME(fin,ain,hout,gout,false);
}
else
throw Exception() << "Unknown subprocess in MEPP2HiggsJet::me2()"
<< Exception::runerror;
// return the answer
return output;
}
double MEPP2HiggsJet::qqbarME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
ScalarWaveFunction & hout,
vector<VectorWaveFunction> & gout,
bool calc) const {
// the particles should be in the order
// for the incoming
// 0 incoming fermion (u spinor)
// 1 incoming antifermion (vbar spinor)
// for the outgoing
// 0 outgoing higgs
// 1 outgoing gluon
// me to be returned
ProductionMatrixElement newme(PDT::Spin1Half,PDT::Spin1Half,
PDT::Spin0,PDT::Spin1);
// get the kinematic invariants
Energy2 s(sHat()),u(uHat()),t(tHat()),mh2(hout.m2()),et(scale());
// calculate the loop function
complex<Energy2> A5 = Energy2();
for ( int ix=_minloop; ix<=_maxloop; ++ix ) {
// full mass dependance
if(_massopt==0) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
A5+= mf2*(4.+4.*double(s/(u+t))*(W1(s,mf2)-W1(mh2,mf2))
+(1.-4.*double(mf2/(u+t)))*(W2(s,mf2)-W2(mh2,mf2)));
}
// infinite mass limit
else {
A5+=2.*(s-mh2)/3.;
}
}
// multiply by the rest of the form factors
using Constants::pi;
double g(sqrt(4.*pi*SM().alphaEM(mh2)/SM().sin2ThetaW()));
double gs(sqrt(4.*pi*SM().alphaS(et)));
Energy mw(getParticleData(ParticleID::Wplus)->mass());
complex<InvEnergy> A5c = A5 * Complex(0.,1.)*g*sqr(gs)*gs/(32.*s*sqr(pi)*mw);
// compute the matrix element
LorentzPolarizationVectorE fcurrent;
complex<Energy2> fdotp;
complex<Energy> epsdot[2];
Complex diag;
Lorentz5Momentum ps(fin[0].momentum()+ain[0].momentum());
ps.rescaleMass();
for(unsigned int ix=0;ix<2;++ix){epsdot[ix]=gout[ix].wave().dot(ps);}
Energy2 denom(-ps*gout[0].momentum());
LorentzSpinorBar<double> atemp;
double output(0.);
for(unsigned int ihel1=0;ihel1<2;++ihel1) {
for(unsigned int ihel2=0;ihel2<2;++ihel2) {
// compute the fermion current
atemp=ain[ihel2].wave();
fcurrent=UnitRemoval::E*fin[ihel1].wave().vectorCurrent(atemp);
fdotp = -(fcurrent.dot(gout[0].momentum()));
for(unsigned int ghel=0;ghel<2;++ghel) {
// calculate the matrix element
diag=A5c*(fcurrent.dot(gout[ghel].wave())
-fdotp*epsdot[ghel]/denom);
// calculate the matrix element
output+=real(diag*conj(diag));
if(calc) newme(ihel1,ihel2,0,2*ghel)=diag;
}
}
}
// test with glover form
// final colour/spin factors
if(calc) _me.reset(newme);
return output/9.;
}
double MEPP2HiggsJet::qgME(vector<SpinorWaveFunction> & fin,
vector<VectorWaveFunction> & gin,
ScalarWaveFunction & hout,
vector<SpinorBarWaveFunction> & fout,bool calc) const {
// the particles should be in the order
// for the incoming
// 0 incoming fermion (u spinor)
// 1 incoming gluon
// for the outgoing
// 0 outgoing higgs
// 1 outgoing fermion (ubar spinor)
// me to be returned
ProductionMatrixElement newme(PDT::Spin1Half,PDT::Spin1,
PDT::Spin0,PDT::Spin1Half);
// get the kinematic invariants
Energy2 s(sHat()),u(uHat()),t(tHat()),mh2(hout.m2()),et(scale());
// calculate the loop function
complex<Energy2> A5 = Energy2();
for(int ix=_minloop;ix<=_maxloop;++ix) {
if(_massopt==0) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
A5+= mf2*(4.+4.*double(u/(s+t))*(W1(u,mf2)-W1(mh2,mf2))
+(1.-4.*double(mf2/(s+t)))*(W2(u,mf2)-W2(mh2,mf2)));
}
else {
A5+=2.*(u-mh2)/3.;
}
}
// multiply by the rest of the form factors
using Constants::pi;
double g(sqrt(4.*pi*SM().alphaEM(mh2)/SM().sin2ThetaW()));
double gs(sqrt(4.*pi*SM().alphaS(et)));
Energy mw(getParticleData(ParticleID::Wplus)->mass());
complex<InvEnergy> A5c =A5*Complex(0.,1.)*g*sqr(gs)*gs/(32.*u*sqr(pi)*mw);
// compute the matrix element
LorentzPolarizationVectorE fcurrent;
complex<Energy2> fdotp;
complex<Energy> epsdot[2];
Complex diag;
Lorentz5Momentum pu(fin[0].momentum()+fout[0].momentum());
pu.rescaleMass();
for(unsigned int ix=0;ix<2;++ix){epsdot[ix]=gin[ix].wave().dot(pu);}
Energy2 denom(pu*gin[0].momentum());
LorentzSpinorBar<double> atemp;
double output(0.);
for(unsigned int ihel=0;ihel<2;++ihel) {
for(unsigned int ohel=0;ohel<2;++ohel) {
// compute the fermion current
atemp=fout[ohel].wave();
fcurrent=UnitRemoval::E*fin[ihel].wave().vectorCurrent(atemp);
fdotp=fcurrent.dot(gin[0].momentum());
for(unsigned int ghel=0;ghel<2;++ghel) {
// calculate the matrix element
diag=A5c*(fcurrent.dot(gin[ghel].wave())-fdotp*epsdot[ghel]/denom);
// calculate the matrix element
output+=real(diag*conj(diag));
if(calc) newme(ihel,2*ghel,0,ohel)=diag;
}
}
}
// final colour/spin factors
if(calc) _me.reset(newme);
return output/24.;
}
double MEPP2HiggsJet::qbargME(vector<SpinorBarWaveFunction> & fin,
vector<VectorWaveFunction> & gin,
ScalarWaveFunction & hout,
vector<SpinorWaveFunction> & fout,bool calc) const {
// the particles should be in the order
// for the incoming
// 0 incoming antifermion (vbar spinor)
// 1 incoming gluon
// for the outgoing
// 0 outgoing higgs
// 1 outgoing antifermion (v spinor)
// me to be returned
ProductionMatrixElement newme(PDT::Spin1Half,PDT::Spin1,
PDT::Spin0,PDT::Spin1Half);
// get the kinematic invariants
Energy2 s(sHat()),u(uHat()),t(tHat()),mh2(hout.m2()),et(scale());
// calculate the loop function
complex<Energy2> A5 = Energy2();
for(int ix=_minloop;ix<=_maxloop;++ix) {
if(_massopt==0) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
A5+= mf2*(4.+4.*double(u/(s+t))*(W1(u,mf2)-W1(mh2,mf2))
+(1.-4.*double(mf2/(s+t)))*(W2(u,mf2)-W2(mh2,mf2)));
}
else {
A5+=2.*(u-mh2)/3.;
}
}
// multiply by the rest of the form factors
using Constants::pi;
double g(sqrt(4.*pi*SM().alphaEM(mh2)/SM().sin2ThetaW()));
double gs(sqrt(4.*pi*SM().alphaS(et)));
Energy mw(getParticleData(ParticleID::Wplus)->mass());
complex<InvEnergy> A5c = A5*Complex(0.,1.)*g*sqr(gs)*gs/(32.*u*sqr(pi)*mw);
// compute the matrix element
LorentzPolarizationVectorE fcurrent;
complex<Energy2> fdotp;
complex<Energy> epsdot[2];
Complex diag;
Lorentz5Momentum pu(fin[0].momentum()+fout[0].momentum());
pu.rescaleMass();
for(unsigned int ix=0;ix<2;++ix){epsdot[ix]=gin[ix].wave().dot(pu);}
Energy2 denom(pu*gin[0].momentum());
LorentzSpinorBar<double> atemp;
double output(0.);
for(unsigned int ihel=0;ihel<2;++ihel) {
for(unsigned int ohel=0;ohel<2;++ohel) {
// compute the fermion current
atemp=fin[ihel].wave();
fcurrent=UnitRemoval::E*fout[ohel].wave().vectorCurrent(atemp);
fdotp=fcurrent.dot(gin[0].momentum());
for(unsigned int ghel=0;ghel<2;++ghel) {
// calculate the matrix element
diag=A5c*(fcurrent.dot(gin[ghel].wave())-fdotp*epsdot[ghel]/denom);
// calculate the matrix element
output+=real(diag*conj(diag));
if(calc) newme(ihel,2*ghel,0,ohel)=diag;
}
}
}
// final colour/spin factors
if(calc) _me.reset(newme);
return output/24.;
}
Selector<MEBase::DiagramIndex>
MEPP2HiggsJet::diagrams(const DiagramVector & diags) const {
Selector<DiagramIndex> sel;
for ( DiagramIndex i = 0; i < diags.size(); ++i )
{
if(abs(diags[i]->id())<4) sel.insert(1.0, i);
else sel.insert(_diagwgt[abs(diags[i]->id())-4], i);
}
return sel;
}
Selector<const ColourLines *>
MEPP2HiggsJet::colourGeometries(tcDiagPtr diag) const {
// colour lines for q qbar -> h0 g
static const ColourLines cqqbar("1 3 5,-2 -3 -5");
// colour lines for q g -> h0 q
static const ColourLines cqg("1 2 -3, 3 -2 5");
// colour lines for qbar q -> h0 qbar
static const ColourLines cqbarg("-1 -2 3, -3 2 -5");
// colour lines for g g -> h0 g
static const ColourLines cgg[6]={ColourLines("1 2 5, -3 -5, 3 -2 -1"),
ColourLines("-1 -2 -5, 3 5, -3 2 1"),
ColourLines("1 5, -1 -2 3, -3 2 -5"),
ColourLines("-1 -5, 1 2 -3, 3 -2 5"),
ColourLines("1 3 5, -5 -3 -2, 2 -1"),
ColourLines("-1 -3 -5, 5 3 2 ,-2 1")};
// select the colour flow
Selector<const ColourLines *> sel;
if ( diag->id() == -1) sel.insert(1.0, &cqqbar);
else if ( diag->id() == -2) sel.insert(1.0, &cqg);
else if ( diag->id() == -3) sel.insert(1.0, &cqbarg);
else
{
sel.insert(0.5, &cgg[2*(abs(diag->id())-4) ]);
sel.insert(0.5, &cgg[2*(abs(diag->id())-4)+1]);
}
// return the answer
return sel;
}
double MEPP2HiggsJet::ggME(vector<VectorWaveFunction> g1, vector<VectorWaveFunction> g2,
ScalarWaveFunction & hout, vector<VectorWaveFunction> g4,
bool calc) const {
// the particles should be in the order
// for the incoming
// 0 first incoming gluon
// 1 second incoming gluon
// for the outgoing
// 0 outgoing higgs
// 1 outgoing gluon
// me to be returned
ProductionMatrixElement newme(PDT::Spin1,PDT::Spin1,
PDT::Spin0,PDT::Spin1);
// get the kinematic invariants
Energy2 s(sHat()),u(uHat()),t(tHat()),mh2(hout.m2()),et(scale());
// calculate the loop functions
Complex A4stu(0.),A2stu(0.),A2tsu(0.),A2ust(0.);
Complex A5s(0.),A5t(0.),A5u(0.);
for(int ix=_minloop;ix<=_maxloop;++ix) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
// loop functions
if(_massopt==0) {
A4stu+=A4(s,t,u,mf2);
A2stu+=A2(s,t,u,mf2);
A2tsu+=A2(u,s,t,mf2);
A2ust+=A2(t,s,u,mf2);
A5s+= mf2/s*(4.+4.*double(s/(u+t))*(W1(s,mf2)-W1(mh2,mf2))
+(1.-4.*double(mf2/(u+t)))*(W2(s,mf2)-W2(mh2,mf2)));
A5t+= mf2/t*(4.+4.*double(t/(s+u))*(W1(t,mf2)-W1(mh2,mf2))
+(1.-4.*double(mf2/(s+u)))*(W2(t,mf2)-W2(mh2,mf2)));
A5u+= mf2/u*(4.+4.*double(u/(s+t))*(W1(u,mf2)-W1(mh2,mf2))
+(1.-4.*double(mf2/(s+t)))*(W2(u,mf2)-W2(mh2,mf2)));
}
else {
A4stu=-1./3.;
A2stu=-sqr(s/mh2)/3.;
A2tsu=-sqr(t/mh2)/3.;
A2ust=-sqr(u/mh2)/3.;
A5s+=2.*(s-mh2)/3./s;
A5t+=2.*(t-mh2)/3./t;
A5u+=2.*(u-mh2)/3./u;
}
}
Complex A3stu=0.5*(A2stu+A2ust+A2tsu-A4stu);
// compute the dot products for the matrix element
complex<InvEnergy> eps[3][4][2];
Energy2 pdot[4][4];
pdot[0][0]=ZERO;
pdot[0][1]= g1[0].momentum()*g2[0].momentum();
pdot[0][2]=-1.*g1[0].momentum()*g4[0].momentum();
pdot[0][3]=-1.*g1[0].momentum()*hout.momentum();
pdot[1][0]= pdot[0][1];
pdot[1][1]= ZERO;
pdot[1][2]=-1.*g2[0].momentum()*g4[0].momentum();
pdot[1][3]=-1.*g2[0].momentum()*hout.momentum();
pdot[2][0]= pdot[0][2];
pdot[2][1]= pdot[1][2];
pdot[2][2]= ZERO;
pdot[2][3]= g4[0].momentum()*hout.momentum();
pdot[3][0]=pdot[0][3];
pdot[3][1]=pdot[1][3];
pdot[3][2]=pdot[2][3];
pdot[3][3]=mh2;
for(unsigned int ix=0;ix<2;++ix)
{
eps[0][0][ix]=InvEnergy();
eps[0][1][ix]=g1[ix].wave().dot(g2[0].momentum())/pdot[0][1];
eps[0][2][ix]=-1.*g1[ix].wave().dot(g4[0].momentum())/pdot[0][2];
eps[0][3][ix]=-1.*g1[ix].wave().dot(hout.momentum())/ pdot[0][3];
eps[1][0][ix]=g2[ix].wave().dot(g1[0].momentum())/ pdot[1][0];
eps[1][1][ix]=InvEnergy();
eps[1][2][ix]=-1.*g2[ix].wave().dot(g4[0].momentum())/pdot[1][2];
eps[1][3][ix]=-1.*g2[ix].wave().dot(hout.momentum())/ pdot[1][3];
eps[2][0][ix]=g4[ix].wave().dot(g1[0].momentum())/ pdot[2][0];
eps[2][1][ix]=g4[ix].wave().dot(g2[0].momentum())/ pdot[2][1];
eps[2][2][ix]=InvEnergy();
eps[2][3][ix]=-1.*g4[ix].wave().dot(hout.momentum())/ pdot[2][3];
}
// prefactors
using Constants::pi;
double g(sqrt(4.*pi*SM().alphaEM(mh2)/SM().sin2ThetaW()));
double gs(sqrt(4.*pi*SM().alphaS(et)));
Energy mw(getParticleData(ParticleID::Wplus)->mass());
Energy3 pre=g*sqr(mh2)*gs*sqr(gs)/(32.*sqr(pi)*mw);
// compute the matrix element
double output(0.);
Complex diag[4],wdot[3][3];
_diagwgt[0]=0.;
_diagwgt[1]=0.;
_diagwgt[2]=0.;
for(unsigned int ihel1=0;ihel1<2;++ihel1) {
for(unsigned int ihel2=0;ihel2<2;++ihel2) {
for(unsigned int ohel=0;ohel<2;++ohel) {
wdot[0][1]=g1[ihel1].wave().dot(g2[ihel2].wave());
wdot[0][2]=g1[ihel1].wave().dot(g4[ohel ].wave());
wdot[1][0]=wdot[0][1];
wdot[1][2]=g2[ihel2].wave().dot(g4[ohel ].wave());
wdot[2][0]=wdot[0][2];
wdot[2][1]=wdot[1][2];
// last piece
diag[3]=pre*A3stu*(eps[0][2][ihel1]*eps[1][0][ihel2]*eps[2][1][ohel]-
eps[0][1][ihel1]*eps[1][2][ihel2]*eps[2][0][ohel]+
(eps[2][0][ohel ]-eps[2][1][ohel ])*wdot[0][1]/pdot[0][1]+
(eps[1][2][ihel2]-eps[1][0][ihel2])*wdot[0][2]/pdot[0][2]+
(eps[0][1][ihel1]-eps[0][2][ihel1])*wdot[1][2]/pdot[1][2]);
// first piece
diag[3]+=pre*(
+A2stu*(eps[0][1][ihel1]*eps[1][0][ihel2]-wdot[0][1]/pdot[0][1])*
(eps[2][0][ohel ]-eps[2][1][ohel ])
+A2ust*(eps[0][2][ihel1]*eps[2][0][ohel ]-wdot[0][2]/pdot[0][2])*
(eps[1][2][ihel2]-eps[1][0][ihel2])
+A2tsu*(eps[1][2][ihel2]*eps[2][1][ohel ]-wdot[1][2]/pdot[1][2])*
(eps[0][1][ihel1]-eps[0][2][ihel1])
);
output+=real(diag[3]*conj(diag[3]));
// matrix element if needed
if(calc) newme(2*ihel1,2*ihel2,0,2*ohel)=diag[3];
// different diagrams
diag[0] = A5t*UnitRemoval::InvE*(-eps[0][3][ihel1]*
(-2.*eps[2][1][ohel ]*eps[1][0][ihel2]*pdot[2][1]*pdot[1][0]
-2.*eps[1][2][ihel2]*eps[2][0][ohel ]*pdot[1][2]*pdot[2][0]
+wdot[1][2]*(pdot[0][1]+pdot[0][2]))
-2.*eps[2][1][ohel ]*pdot[2][1]*wdot[0][1]
-2.*eps[1][2][ihel2]*pdot[1][2]*wdot[0][2]
+wdot[1][2]*(eps[0][1][ihel1]*pdot[0][1]+
eps[0][2][ihel1]*pdot[0][2]));
diag[1] = A5u*UnitRemoval::InvE*(-eps[1][3][ihel2]*
(+2.*eps[0][1][ihel1]*eps[2][0][ohel ]*pdot[0][1]*pdot[2][0]
+2.*eps[0][2][ihel1]*eps[2][1][ohel ]*pdot[0][2]*pdot[2][1]
-wdot[0][2]*(pdot[1][0]+pdot[1][2]))
+2.*eps[2][0][ohel ]*pdot[2][0]*wdot[0][1]
+2.*eps[0][2][ihel1]*pdot[0][2]*wdot[2][1]
-wdot[0][2]*(eps[1][0][ihel2]*pdot[1][0]+
eps[1][2][ihel2]*pdot[1][2]));
diag[2] = A5s*UnitRemoval::InvE*(-eps[2][3][ohel ]*
(+2.*eps[0][1][ihel1]*eps[1][2][ihel2]*pdot[0][1]*pdot[1][2]
-2.*eps[1][0][ihel2]*eps[0][2][ihel1]*pdot[1][0]*pdot[1][3]
+wdot[0][1]*(pdot[2][0]-pdot[2][1]))
+2.*eps[0][1][ihel1]*pdot[0][1]*wdot[1][2]
-2.*eps[1][0][ihel2]*pdot[1][0]*wdot[0][2]
+wdot[0][1]*(eps[2][0][ohel]*pdot[2][0]-
eps[2][1][ohel]*pdot[2][1]));
_diagwgt[0]+=real(diag[0]*conj(diag[0]));
_diagwgt[1]+=real(diag[1]*conj(diag[1]));
_diagwgt[2]+=real(diag[2]*conj(diag[2]));
}
}
}
// final colour and spin factors
if(calc){_me.reset(newme);}
return 3.*output/32.;
}
void MEPP2HiggsJet::constructVertex(tSubProPtr sub)
{
// extract the particles in the hard process
ParticleVector hard;
hard.push_back(sub->incoming().first);hard.push_back(sub->incoming().second);
hard.push_back(sub->outgoing()[0]);hard.push_back(sub->outgoing()[1]);
// ensure correct order or particles
if((hard[0]->id()==ParticleID::g&&hard[1]->id()!=ParticleID::g)||
(hard[0]->id()<0&&hard[1]->id()<6)) swap(hard[0],hard[1]);
if(hard[2]->id()!=ParticleID::h0) swap(hard[2],hard[3]);
// different processes
// g g to H g
if(hard[0]->id()==ParticleID::g) {
vector<VectorWaveFunction> g1,g2,g4;
VectorWaveFunction(g1,hard[0],incoming,false,true,true);
VectorWaveFunction(g2,hard[1],incoming,false,true,true);
VectorWaveFunction(g4,hard[3],outgoing,true ,true,true);
ScalarWaveFunction hout(hard[2],outgoing,true);
g1[1]=g1[2];g2[1]=g2[2];g4[1]=g4[2];
ggME(g1,g2,hout,g4,true);
}
// qg -> H q
else if(hard[0]->id()>0&&hard[1]->id()==ParticleID::g) {
vector<VectorWaveFunction> g2;
vector<SpinorWaveFunction> qin;
vector<SpinorBarWaveFunction> qout;
SpinorWaveFunction( qin,hard[0],incoming,false,true);
VectorWaveFunction( g2,hard[1],incoming,false,true,true);
SpinorBarWaveFunction(qout,hard[3],outgoing,true ,true);
ScalarWaveFunction hout(hard[2],outgoing,true);
g2[1]=g2[2];
qgME(qin,g2,hout,qout,true);
}
// qbar g -> H q
else if(hard[0]->id()<0&&hard[1]->id()==ParticleID::g) {
vector<VectorWaveFunction> g2;
vector<SpinorBarWaveFunction> qin;
vector<SpinorWaveFunction> qout;
SpinorBarWaveFunction( qin,hard[0],incoming,false,true);
VectorWaveFunction( g2,hard[1],incoming,false,true,true);
SpinorWaveFunction( qout,hard[3],outgoing,true ,true);
ScalarWaveFunction hout(hard[2],outgoing,true);
g2[1]=g2[2];
qbargME(qin,g2,hout,qout,true);
}
// q qbar to H g
else if(hard[0]->id()==-hard[1]->id()) {
vector<SpinorBarWaveFunction> qbar;
vector<SpinorWaveFunction> q;
vector<VectorWaveFunction> g4;
SpinorWaveFunction( q ,hard[0],incoming,false,true);
SpinorBarWaveFunction(qbar,hard[1],incoming,false,true);
VectorWaveFunction( g4,hard[3],outgoing,true ,true,true);
ScalarWaveFunction hout(hard[2],outgoing,true);
g4[1]=g4[2];
qqbarME(q,qbar,hout,g4,true);
}
else throw Exception() << "Unknown subprocess in MEPP2HiggsJet::constructVertex()"
<< Exception::runerror;
// construct the vertex
HardVertexPtr hardvertex=new_ptr(HardVertex());
// set the matrix element for the vertex
hardvertex->ME(_me);
// set the pointers and to and from the vertex
for(unsigned int ix=0;ix<4;++ix) {
dynamic_ptr_cast<ThePEG::Helicity::SpinfoPtr>(hard[ix]->spinInfo())->
setProductionVertex(hardvertex);
}
}
int MEPP2HiggsJet::nDim() const {
return 2;
}
void MEPP2HiggsJet::doinit() {
ME2to2Base::doinit();
tcPDPtr h0=getParticleData(ParticleID::h0);
_mh = h0->mass();
_wh = h0->generateWidth(_mh);
if(h0->massGenerator()) {
_hmass=dynamic_ptr_cast<SMHiggsMassGeneratorPtr>(h0->massGenerator());
}
if(_shapeopt==2&&!_hmass) throw InitException()
<< "If using the mass generator for the line shape in MEPP2HiggsJet::doinit()"
<< "the mass generator must be an instance of the SMHiggsMassGenerator class"
<< Exception::runerror;
}
CrossSection MEPP2HiggsJet::dSigHatDR() const {
using Constants::pi;
InvEnergy2 bwfact;
Energy moff = mePartonData()[2]->id()==ParticleID::h0 ?
meMomenta()[2].mass() : meMomenta()[3].mass();
if(_shapeopt==1) {
tcPDPtr h0 = mePartonData()[2]->id()==ParticleID::h0 ?
mePartonData()[2] : mePartonData()[3];
bwfact = h0->generateWidth(moff)*moff/pi/
(sqr(sqr(moff)-sqr(_mh))+sqr(_mh*_wh));
}
else {
bwfact = _hmass->BreitWignerWeight(moff,0);
}
return me2()*jacobian()/(16.0*sqr(Constants::pi)*sHat())*sqr(hbarc)*
(sqr(sqr(moff)-sqr(_mh))+sqr(_mh*_wh))/(_mh*_wh)*bwfact;
}
diff --git a/MatrixElement/Hadron/MEPP2HiggsJet.h b/MatrixElement/Hadron/MEPP2HiggsJet.h
--- a/MatrixElement/Hadron/MEPP2HiggsJet.h
+++ b/MatrixElement/Hadron/MEPP2HiggsJet.h
@@ -1,449 +1,490 @@
// -*- C++ -*-
//
// MEPP2HiggsJet.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEPP2HiggsJet_H
#define HERWIG_MEPP2HiggsJet_H
//
// This is the declaration of the MEPP2HiggsJet class.
//
#include "ThePEG/MatrixElement/ME2to2Base.h"
#include "Herwig++/Utilities/Maths.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/ScalarWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "Herwig++/PDT/SMHiggsMassGenerator.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2HiggsJet class implements the matrix element for Higgs+jet production.
*
* @see \ref MEPP2HiggsJetInterfaces "The interfaces"
* defined for MEPP2HiggsJet.
*/
class MEPP2HiggsJet: public ME2to2Base {
public:
/**
* The default constructor.
*/
- inline MEPP2HiggsJet();
+ MEPP2HiggsJet() :
+ _shapeopt(2),_maxflavour(5), _process(0),
+ _minloop(6),_maxloop(6),_massopt(0) , _mh(ZERO),_wh(ZERO)
+ {}
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the matrix element for the kinematical configuation
* previously provided by the last call to setKinematics(). Uses
* me().
*/
virtual CrossSection dSigHatDR() const;
/**
* The number of internal degreed of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Generate internal degrees of freedom given nDim() uniform
* random numbers in the interval \f$ ]0,1[ \f$. To help the phase space
* generator, the dSigHatDR should be a smooth function of these
* numbers, although this is not strictly necessary.
* @param r a pointer to the first of nDim() consecutive random numbers.
* @return true if the generation succeeded, otherwise false.
*/
virtual bool generateKinematics(const double * r);
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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;
+ virtual IBPtr clone() const;
/** 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;
+ virtual IBPtr fullclone() const;
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* Members to return the matrix elements for the different subprocesses
*/
//@{
/**
* Matrix element for \f$q\bar{q}\to Hg\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param hout Wavefunction for the outgoing higgs
* @param gout Polarization vectors for the outgoing gluon
* @param me Whether or not to calculate the matrix element for spin correlations
**/
double qqbarME(vector<SpinorWaveFunction> & fin, vector<SpinorBarWaveFunction> & ain,
ScalarWaveFunction & hout, vector<VectorWaveFunction> & gout,
bool me) const;
/**
* Matrix element for \f$qg\to Hq\f$.
* @param fin Spinors for incoming quark
* @param gin Polarization vectors for the incoming gluon
* @param hout Wavefunction for the outgoing higgs
* @param fout Spinors for outgoing quark
* @param me Whether or not to calculate the matrix element for spin correlations
**/
double qgME(vector<SpinorWaveFunction> & fin,vector<VectorWaveFunction> & gin,
ScalarWaveFunction & hout, vector<SpinorBarWaveFunction> & fout,
bool me) const;
/**
* Matrix element for \f$\bar{q}g\to H\bar{q}\f$.
* @param fin Spinors for incoming antiquark
* @param gin Polarization vectors for the incoming gluon
* @param hout Wavefunction for the outgoing higgs
* @param fout Spinors for outgoing antiquark
* @param me Whether or not to calculate the matrix element for spin correlations
**/
double qbargME(vector<SpinorBarWaveFunction> & fin,vector<VectorWaveFunction> & gin,
ScalarWaveFunction & hout, vector<SpinorWaveFunction> & fout,
bool me) const;
/**
* Matrix element for \f$gg\to Hg\f$.
* @param g1 Polarization vectors for the first incoming gluon
* @param g2 Polarization vectors for the second incoming gluon
* @param hout Wavefunction for the outgoing higgs
* @param g4 Polarization vectors for the outgoing gluon
* @param me Whether or not to calculate the matrix element for spin correlations
**/
double ggME(vector<VectorWaveFunction> g1, vector<VectorWaveFunction> g2,
ScalarWaveFunction & hout, vector<VectorWaveFunction> g4,
bool me) const;
//@}
private:
/**
* Members to calculate the functions for the loop diagrams
*/
//@{
/**
* The \f$W_1(s)\f$ function of NPB297 (1988) 221-243.
* @param s The invariant
* @param mf2 The fermion mass squared
*/
- inline Complex W1(Energy2 s,Energy2 mf2) const;
+ Complex W1(Energy2 s,Energy2 mf2) const {
+ double root = sqrt(abs(1.-4.*mf2/s));
+ if(s<ZERO) return 2.*root*asinh(0.5*sqrt(-s/mf2));
+ else if(s<4.*mf2) return 2.*root*asin(0.5*sqrt( s/mf2));
+ else return root*(2.*acosh(0.5*sqrt(s/mf2))
+ -Constants::pi*Complex(0.,1.));
+ }
/**
* The \f$W_2(s)\f$ function of NPB297 (1988) 221-243.
* @param s The invariant
* @param mf2 The fermion mass squared
*/
- inline Complex W2(Energy2 s,Energy2 mf2) const;
+ Complex W2(Energy2 s,Energy2 mf2) const {
+ double root=0.5*sqrt(abs(s)/mf2);
+ if(s<ZERO) return 4.*sqr(asinh(root));
+ else if(s<4.*mf2) return -4.*sqr(asin(root));
+ else return 4.*sqr(acosh(root))-sqr(Constants::pi)
+ -4.*Constants::pi*acosh(root)*Complex(0.,1.);
+ }
/**
* The \f$W_3(s,t,u,v)\f$ function of NPB297 (1988) 221-243.
* @param s The \f$s\f$ invariant
* @param t The \f$t\f$ invariant
* @param u The \f$u\f$ invariant
* @param v The \f$u\f$ invariant
* @param mf2 The fermion mass squared.
*/
- inline Complex W3(Energy2 s, Energy2 t, Energy2 u, Energy2 v, Energy2 mf2) const;
-
+ Complex W3(Energy2 s, Energy2 t, Energy2 u, Energy2 v, Energy2 mf2) const {
+ return I3(s,t,u,v,mf2)-I3(s,t,u,s,mf2)-I3(s,t,u,u,mf2);
+ }
+
/**
* The \f$I_3(s,t,u,v)\f$ function of NPB297 (1988) 221-243.
* @param s The \f$s\f$ invariant
* @param t The \f$t\f$ invariant
* @param u The \f$u\f$ invariant
* @param v The \f$v\f$ invariant
* @param mf2 The fermion mass squared
*/
- inline Complex I3(Energy2 s, Energy2 t, Energy2 u, Energy2 v, Energy2 mf2) const;
+ Complex I3(Energy2 s, Energy2 t, Energy2 u, Energy2 v, Energy2 mf2) const {
+ double ratio=(4.*mf2*t/(u*s)),root(sqrt(1+ratio));
+ if(v==ZERO) return 0.;
+ Complex y=0.5*(1.+sqrt(1.-4.*(mf2+_epsi*MeV*MeV)/v));
+ Complex xp=0.5*(1.+root),xm=0.5*(1.-root);
+ Complex output =
+ Math::Li2(xm/(xm-y))-Math::Li2(xp/(xp-y))+
+ Math::Li2(xm/(y-xp))-Math::Li2(xp/(y-xm))+
+ log(-xm/xp)*log(1.-_epsi-v/mf2*xp*xm);
+ return output*2./root;
+ }
+
+ /**
+ * The \f$b_2(s,t,u)\f$ function of NPB297 (1988) 221-243.
+ * @param s The \f$s\f$ invariant
+ * @param t The \f$t\f$ invariant
+ * @param u The \f$u\f$ invariant
+ * @param mf2 The fermion mass squared.
+ */
+ Complex b2(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
+ Energy2 mh2(s+u+t);
+ complex<Energy2> output=s*(u-s)/(s+u)+2.*u*t*(u+2.*s)/sqr(s+u)*(W1(t,mf2)-W1(mh2,mf2))
+ +(mf2-0.25*s)*(0.5*(W2(s,mf2)+W2(mh2,mf2))-W2(t,mf2)+W3(s,t,u,mh2,mf2))
+ +sqr(s)*(2.*mf2/sqr(s+u)-0.5/(s+u))*(W2(t,mf2)-W2(mh2,mf2))
+ +0.5*u*t/s*(W2(mh2,mf2)-2.*W2(t,mf2))
+ +0.125*(s-12.*mf2-4.*u*t/s)*W3(t,s,u,mh2,mf2);
+ return output*mf2/sqr(mh2);
+ }
/**
* The \f$b_2(s,t,u)\f$ function of NPB297 (1988) 221-243.
* @param s The \f$s\f$ invariant
* @param t The \f$t\f$ invariant
* @param u The \f$u\f$ invariant
* @param mf2 The fermion mass squared.
*/
- inline Complex b2(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const;
+ Complex b4(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
+ Energy2 mh2(s+t+u);
+ return mf2/mh2*(-2./3.+(mf2/mh2-0.25)*(W2(t,mf2)-W2(mh2,mf2)+W3(s,t,u,mh2,mf2)));
+ }
- /**
- * The \f$b_2(s,t,u)\f$ function of NPB297 (1988) 221-243.
- * @param s The \f$s\f$ invariant
- * @param t The \f$t\f$ invariant
- * @param u The \f$u\f$ invariant
- * @param mf2 The fermion mass squared.
- */
- inline Complex b4(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const;
/**
* The \f$A_2(s,t,u)\f$ function of NPB297 (1988) 221-243.
* @param s The \f$s\f$ invariant
* @param t The \f$t\f$ invariant
* @param u The \f$u\f$ invariant
* @param mf2 The fermion mass squared.
*/
- inline Complex A2(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const;
+ Complex A2(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
+ return b2(s,t,u,mf2)+b2(s,u,t,mf2);
+ }
/**
* The \f$A_4(s,t,u)\f$ function of NPB297 (1988) 221-243.
* @param s The \f$s\f$ invariant
* @param t The \f$t\f$ invariant
* @param u The \f$u\f$ invariant
* @param mf2 The fermion mass squared.
*/
- inline Complex A4(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const;
+ Complex A4(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
+ return b4(s,t,u,mf2)+b4(u,s,t,mf2)+b4(t,u,s,mf2);
+ }
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2HiggsJet> initMEPP2HiggsJet;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2HiggsJet & operator=(const MEPP2HiggsJet &);
private:
/**
* Defines the Higgs resonance shape
*/
unsigned int _shapeopt;
/**
* Maximum PDG code of the quarks allowed
*/
unsigned int _maxflavour;
/**
* Option for which processes to include
*/
unsigned int _process;
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
/**
* Minimum flavour of quarks to include in the loops
*/
int _minloop;
/**
* Maximum flavour of quarks to include in the loops
*/
int _maxloop;
/**
* Option for treatment of the fermion loops
*/
unsigned int _massopt;
/**
* Small complex number to regularize some integrals
*/
static const Complex _epsi;
/**
* On-shell mass for the higgs
*/
Energy _mh;
/**
* On-shell width for the higgs
*/
Energy _wh;
/**
* The mass generator for the Higgs
*/
SMHiggsMassGeneratorPtr _hmass;
/**
* Storage of the loop functions
*/
//@{
/**
* B functions
*/
mutable Complex _bi[5];
/**
* C functions
*/
mutable Complex _ci[8];
/**
* D functions
*/
mutable Complex _di[4];
//@}
/**
* Storage of the diagram weights for the \f$gg\to Hg\f$ subprocess
*/
mutable double _diagwgt[3];
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2HiggsJet. */
template <>
struct BaseClassTrait<Herwig::MEPP2HiggsJet,1> {
/** Typedef of the first base class of MEPP2HiggsJet. */
typedef ME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2HiggsJet class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2HiggsJet>
: public ClassTraitsBase<Herwig::MEPP2HiggsJet> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2HiggsJet"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2HiggsJet is implemented. It may also include several, space-separated,
* libraries if the class MEPP2HiggsJet 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 "HwMEHadron.so"; }
};
/** @endcond */
}
-#include "MEPP2HiggsJet.icc"
-
#endif /* HERWIG_MEPP2HiggsJet_H */
diff --git a/MatrixElement/Hadron/MEPP2HiggsJet.icc b/MatrixElement/Hadron/MEPP2HiggsJet.icc
deleted file mode 100644
--- a/MatrixElement/Hadron/MEPP2HiggsJet.icc
+++ /dev/null
@@ -1,89 +0,0 @@
-// -*- C++ -*-
-//
-// MEPP2HiggsJet.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the MEPP2HiggsJet class.
-//
-
-namespace Herwig {
-
-inline MEPP2HiggsJet::MEPP2HiggsJet() :
- _shapeopt(2),_maxflavour(5), _process(0),
- _minloop(6),_maxloop(6),_massopt(0) , _mh(ZERO),_wh(ZERO)
-{}
-
-inline IBPtr MEPP2HiggsJet::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr MEPP2HiggsJet::fullclone() const {
- return new_ptr(*this);
-}
-
-inline Complex MEPP2HiggsJet::W1(Energy2 s,Energy2 mf2) const {
- double root = sqrt(abs(1.-4.*mf2/s));
- if(s<ZERO) return 2.*root*asinh(0.5*sqrt(-s/mf2));
- else if(s<4.*mf2) return 2.*root*asin(0.5*sqrt( s/mf2));
- else return root*(2.*acosh(0.5*sqrt(s/mf2))
- -Constants::pi*Complex(0.,1.));
-}
-
-inline Complex MEPP2HiggsJet::W2(Energy2 s,Energy2 mf2) const {
- double root=0.5*sqrt(abs(s)/mf2);
- if(s<ZERO) return 4.*sqr(asinh(root));
- else if(s<4.*mf2) return -4.*sqr(asin(root));
- else return 4.*sqr(acosh(root))-sqr(Constants::pi)
- -4.*Constants::pi*acosh(root)*Complex(0.,1.);
-}
-
-inline Complex MEPP2HiggsJet::I3(Energy2 s, Energy2 t, Energy2 u, Energy2 v,
- Energy2 mf2) const
-{
- double ratio=(4.*mf2*t/(u*s)),root(sqrt(1+ratio));
- if(v==ZERO) return 0.;
- else {
- Complex y=0.5*(1.+sqrt(1.-4.*(mf2+_epsi*MeV*MeV)/v));
- Complex xp=0.5*(1.+root),xm=0.5*(1.-root);
- Complex output =
- Math::Li2(xm/(xm-y))-Math::Li2(xp/(xp-y))+
- Math::Li2(xm/(y-xp))-Math::Li2(xp/(y-xm))+
- log(-xm/xp)*log(1.-_epsi-v/mf2*xp*xm);
- return output*2./root;
- }
-}
-
-inline Complex MEPP2HiggsJet::b2(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
- Energy2 mh2(s+u+t);
- complex<Energy2> output=s*(u-s)/(s+u)+2.*u*t*(u+2.*s)/sqr(s+u)*(W1(t,mf2)-W1(mh2,mf2))
- +(mf2-0.25*s)*(0.5*(W2(s,mf2)+W2(mh2,mf2))-W2(t,mf2)+W3(s,t,u,mh2,mf2))
- +sqr(s)*(2.*mf2/sqr(s+u)-0.5/(s+u))*(W2(t,mf2)-W2(mh2,mf2))
- +0.5*u*t/s*(W2(mh2,mf2)-2.*W2(t,mf2))
- +0.125*(s-12.*mf2-4.*u*t/s)*W3(t,s,u,mh2,mf2);
- return output*mf2/sqr(mh2);
-}
-
-inline Complex MEPP2HiggsJet::b4(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
- Energy2 mh2(s+t+u);
- return mf2/mh2*(-2./3.+(mf2/mh2-0.25)*(W2(t,mf2)-W2(mh2,mf2)+W3(s,t,u,mh2,mf2)));
-}
-
-inline Complex MEPP2HiggsJet::W3(Energy2 s, Energy2 t, Energy2 u,
- Energy2 v, Energy2 mf2) const {
- return I3(s,t,u,v,mf2)-I3(s,t,u,s,mf2)-I3(s,t,u,u,mf2);
-}
-
-inline Complex MEPP2HiggsJet::A2(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
- return b2(s,t,u,mf2)+b2(s,u,t,mf2);
-}
-
-inline Complex MEPP2HiggsJet::A4(Energy2 s, Energy2 t, Energy2 u, Energy2 mf2) const {
- return b4(s,t,u,mf2)+b4(u,s,t,mf2)+b4(t,u,s,mf2);
-}
-
-}
diff --git a/MatrixElement/Hadron/MEPP2HiggsVBF.h b/MatrixElement/Hadron/MEPP2HiggsVBF.h
--- a/MatrixElement/Hadron/MEPP2HiggsVBF.h
+++ b/MatrixElement/Hadron/MEPP2HiggsVBF.h
@@ -1,148 +1,148 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2HiggsVBF_H
#define HERWIG_MEPP2HiggsVBF_H
//
// This is the declaration of the MEPP2HiggsVBF class.
//
#include "Herwig++/MatrixElement/MEfftoffH.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEPP2HiggsVBF class provides the matrix elements for the
* production of the Higgs boson via the vector boson fusion mechanism
* in hadron collisions
*
* @see \ref MEPP2HiggsVBFInterfaces "The interfaces"
* defined for MEPP2HiggsVBF.
*/
class MEPP2HiggsVBF: public MEfftoffH {
public:
/**
* The default constructor.
*/
MEPP2HiggsVBF();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2HiggsVBF> initMEPP2HiggsVBF;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2HiggsVBF & operator=(const MEPP2HiggsVBF &);
private:
/**
* Maximum flavour of the quarks involved
*/
unsigned int _maxflavour;
/**
* Minimum flavour of the quarks involved
*/
unsigned int _minflavour;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2HiggsVBF. */
template <>
struct BaseClassTrait<Herwig::MEPP2HiggsVBF,1> {
/** Typedef of the first base class of MEPP2HiggsVBF. */
typedef Herwig::MEfftoffH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2HiggsVBF class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2HiggsVBF>
: public ClassTraitsBase<Herwig::MEPP2HiggsVBF> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2HiggsVBF"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2HiggsVBF is implemented. It may also include several, space-separated,
* libraries if the class MEPP2HiggsVBF 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2HiggsVBF_H */
diff --git a/MatrixElement/Hadron/MEPP2QQ.h b/MatrixElement/Hadron/MEPP2QQ.h
--- a/MatrixElement/Hadron/MEPP2QQ.h
+++ b/MatrixElement/Hadron/MEPP2QQ.h
@@ -1,336 +1,336 @@
// -*- C++ -*-
//
// MEPP2QQ.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEPP2QQ_H
#define HERWIG_MEPP2QQ_H
//
// This is the declaration of the MEPP2QQ class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2QQ class implements the production of a heavy quark-antiquark
* pair via QCD.
*
* @see \ref MEPP2QQInterfaces "The interfaces"
* defined for MEPP2QQ.
*/
class MEPP2QQ: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MEPP2QQ();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Members to calculate the matrix elements
*/
//@{
/**
* Matrix element for \f$gg\to q\bar{q}\f$
* @param g1 The wavefunctions for the first incoming gluon
* @param g2 The wavefunctions for the second incoming gluon
* @param q The wavefunction for the outgoing quark
* @param qbar The wavefunction for the outgoing antiquark
* @param flow The colour flow
*/
double gg2qqbarME(vector<VectorWaveFunction> &g1,vector<VectorWaveFunction> &g2,
vector<SpinorBarWaveFunction> & q,vector<SpinorWaveFunction> & qbar,
unsigned int flow) const;
/**
* Matrix element for \f$q\bar{q}\to q\bar{q}\f$
* @param q1 The wavefunction for the incoming quark
* @param q2 The wavefunction for the incoming antiquark
* @param q3 The wavefunction for the outgoing quark
* @param q4 The wavefunction for the outgoing antiquark
* @param flow The colour flow
*/
double qqbar2qqbarME(vector<SpinorWaveFunction> & q1,
vector<SpinorBarWaveFunction> & q2,
vector<SpinorBarWaveFunction> & q3,
vector<SpinorWaveFunction> & q4,
unsigned int flow) const;
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans)
;
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2QQ> initMEPP2QQ;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2QQ & operator=(const MEPP2QQ &);
private:
/**
* Vertices needed to compute the diagrams
*/
//@{
/**
* \f$ggg\f$ vertex
*/
AbstractVVVVertexPtr _gggvertex;
/**
* \f$q\bar{q}g\f$ vertex
*/
AbstractFFVVertexPtr _qqgvertex;
//@}
/**
* Quark Flavour
*/
unsigned int _quarkflavour;
/**
* Processes to include
*/
unsigned int _process;
/**
* Option for the treatment of bottom and lighter
* quark masses
*/
unsigned int _bottomopt;
/**
* Option for the treatment of top quark masses
*/
unsigned int _topopt;
/**
* Colour flow
*/
mutable unsigned int _flow;
/**
* Diagram
*/
mutable unsigned int _diagram;
/**
* Matrix element
*/
mutable ProductionMatrixElement _me;
/**
* ParticleData objects of the partons
*/
//@{
/**
* The gluon
*/
PDPtr _gluon;
/**
* the quarks
*/
vector<PDPtr> _quark;
/**
* the antiquarks
*/
vector<PDPtr> _antiquark;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2QQ. */
template <>
struct BaseClassTrait<Herwig::MEPP2QQ,1> {
/** Typedef of the first base class of MEPP2QQ. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2QQ class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2QQ>
: public ClassTraitsBase<Herwig::MEPP2QQ> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2QQ"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2QQ is implemented. It may also include several, space-separated,
* libraries if the class MEPP2QQ 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2QQ_H */
diff --git a/MatrixElement/Hadron/MEPP2WH.h b/MatrixElement/Hadron/MEPP2WH.h
--- a/MatrixElement/Hadron/MEPP2WH.h
+++ b/MatrixElement/Hadron/MEPP2WH.h
@@ -1,152 +1,152 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2WH_H
#define HERWIG_MEPP2WH_H
//
// This is the declaration of the MEPP2WH class.
//
#include "Herwig++/MatrixElement/MEfftoVH.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEPP2WH class provides the matrix elements for the production of
* the \f$W^\pm\f$ boson in association with the Higgs in hadron collisions.
*
* @see \ref MEPP2WHInterfaces "The interfaces"
* defined for MEPP2WH.
*/
class MEPP2WH: public MEfftoVH {
public:
/**
* Default constructor
*/
MEPP2WH();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2WH> initMEPP2WH;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2WH & operator=(const MEPP2WH &);
private:
/**
* Switches to control the particles in the hard process
*/
//@{
/**
* The allowed flavours of the incoming quarks
*/
unsigned int _maxflavour;
/**
* Which intermediate \f$W^\pm\f$ bosons to include
*/
unsigned int _plusminus;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2WH. */
template <>
struct BaseClassTrait<Herwig::MEPP2WH,1> {
/** Typedef of the first base class of MEPP2WH. */
typedef Herwig::MEfftoVH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2WH class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2WH>
: public ClassTraitsBase<Herwig::MEPP2WH> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2WH"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2WH is implemented. It may also include several, space-separated,
* libraries if the class MEPP2WH 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2WH_H */
diff --git a/MatrixElement/Hadron/MEPP2WJet.h b/MatrixElement/Hadron/MEPP2WJet.h
--- a/MatrixElement/Hadron/MEPP2WJet.h
+++ b/MatrixElement/Hadron/MEPP2WJet.h
@@ -1,363 +1,363 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2WJet_H
#define HERWIG_MEPP2WJet_H
//
// This is the declaration of the MEPP2WJet class.
//
#include "ThePEG/MatrixElement/MEBase.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2WJet class implements the matrix element for the production of
* a W boson and a jet including the decay of the W.
*
* @see \ref MEPP2WJetInterfaces "The interfaces"
* defined for MEPP2WJet.
*/
class MEPP2WJet: public MEBase {
public:
/**
* The default constructor.
*/
MEPP2WJet();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degrees of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given nDim() uniform
* random numbers in the interval \f$ ]0,1[ \f$. To help the phase space
* generator, the dSigHatDR should be a smooth function of these
* numbers, although this is not strictly necessary.
* @param r a pointer to the first of nDim() consecutive random numbers.
* @return true if the generation succeeded, otherwise false.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the matrix element squared differential in the variables
* given by the last call to generateKinematics().
*/
virtual CrossSection dSigHatDR() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Used internally by generateKinematics, after calculating the
* limits on cos(theta).
*/
double getCosTheta(double cthmin, double cthmax, const double r);
/**
* Matrix elements for the different subprocesses
*/
//@{
/**
* Matrix element for \f$q\bar{q}\to W^\pm g\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param gout Polarization vectors for the outgoing gluon
* @param lm Spinors for outgoing lepton
* @param lp Spinors for outgoing antilepton
* @param me Whether or not to calculate the matrix element for spin correlations
**/
InvEnergy2 qqbarME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
vector<VectorWaveFunction> & gout,
vector<SpinorBarWaveFunction> & lm,
vector<SpinorWaveFunction> & lp,
bool me=false) const;
/**
* Matrix element for \f$qg\to W^\pm q\f$.
* @param fin Spinors for incoming quark
* @param gin Polarization vectors for the incoming gluon
* @param fout Spinors for outgoing quark
* @param lm Spinors for outgoing lepton
* @param lp Spinors for outgoing antilepton
* @param me Whether or not to calculate the matrix element for spin correlations
**/
InvEnergy2 qgME(vector<SpinorWaveFunction> & fin,
vector<VectorWaveFunction> & gin,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorBarWaveFunction> & lm,
vector<SpinorWaveFunction> & lp,
bool me=false) const;
/**
* Matrix element for \f$\bar{q}g\to W^\pm\bar{q}\f$.
* @param fin Spinors for incoming antiquark
* @param gin Polarization vectors for the incoming gluon
* @param fout Spinors for outgoing antiquark
* @param lm Spinors for outgoing lepton
* @param lp Spinors for outgoing antilepton
* @param me Whether or not to calculate the matrix element for spin correlations
**/
InvEnergy2 qbargME(vector<SpinorBarWaveFunction> & fin,
vector<VectorWaveFunction> & gin,
vector<SpinorWaveFunction> & fout,
vector<SpinorBarWaveFunction> & lm,
vector<SpinorWaveFunction> & lp,
bool me=false) const;
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2WJet> initMEPP2WJet;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2WJet & operator=(const MEPP2WJet &);
private:
/**
* Vertices for the helicity amplitude calculation
*/
//@{
/**
* Pointer to the W vertex
*/
AbstractFFVVertexPtr _theFFWVertex;
/**
* Pointer to the \f$qqg\f$ vertex
*/
AbstractFFVVertexPtr _theQQGVertex;
//@}
/**
* @name Pointers to the W ParticleData objects
*/
//@{
/**
* The \f$W^+\f$ data pointer
*/
tcPDPtr _wplus;
/**
* The \f$W^-\f$ data pointer
*/
tcPDPtr _wminus;
//@}
/**
* @name Switches to control the particles in the hard process
*/
//@{
/**
* Subprocesses to include
*/
unsigned int _process;
/**
* Allowed flavours for the incoming quarks
*/
unsigned int _maxflavour;
/**
* Which charge states to include
*/
unsigned int _plusminus;
/**
* W decay modes
*/
unsigned int _wdec;
/**
* Option for the treatment of the W off-shell effects
*/
unsigned int _widthopt;
//@}
/**
* Matrix element for spin correlations
*/
mutable ProductionMatrixElement _me;
/**
* Storage of the scale to avoid the need to recalculate
*/
Energy2 _scale;
/**
* Storage of the off-shell W mass to avoid the need to recalculate
*/
Energy2 _mw2;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2WJet. */
template <>
struct BaseClassTrait<Herwig::MEPP2WJet,1> {
/** Typedef of the first base class of MEPP2WJet. */
typedef MEBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2WJet class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2WJet>
: public ClassTraitsBase<Herwig::MEPP2WJet> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2WJet"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2WJet is implemented. It may also include several, space-separated,
* libraries if the class MEPP2WJet 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2WJet_H */
diff --git a/MatrixElement/Hadron/MEPP2ZH.h b/MatrixElement/Hadron/MEPP2ZH.h
--- a/MatrixElement/Hadron/MEPP2ZH.h
+++ b/MatrixElement/Hadron/MEPP2ZH.h
@@ -1,140 +1,140 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2ZH_H
#define HERWIG_MEPP2ZH_H
//
// This is the declaration of the MEPP2ZH class.
//
#include "Herwig++/MatrixElement/MEfftoVH.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEPP2ZH class implements the matrix element
* for \f$q\bar{q}\to Z^0h^0\f$.
*
* @see \ref MEPP2ZHInterfaces "The interfaces"
* defined for MEPP2ZH.
*/
class MEPP2ZH: public MEfftoVH {
public:
/**
* The default constructor.
*/
MEPP2ZH();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2ZH> initMEPP2ZH;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2ZH & operator=(const MEPP2ZH &);
private:
/**
* The allowed flavours of the incoming quarks
*/
int _maxflavour;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2ZH. */
template <>
struct BaseClassTrait<Herwig::MEPP2ZH,1> {
/** Typedef of the first base class of MEPP2ZH. */
typedef Herwig::MEfftoVH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2ZH class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2ZH>
: public ClassTraitsBase<Herwig::MEPP2ZH> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2ZH"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2ZH is implemented. It may also include several, space-separated,
* libraries if the class MEPP2ZH 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2ZH_H */
diff --git a/MatrixElement/Hadron/MEPP2ZJet.h b/MatrixElement/Hadron/MEPP2ZJet.h
--- a/MatrixElement/Hadron/MEPP2ZJet.h
+++ b/MatrixElement/Hadron/MEPP2ZJet.h
@@ -1,370 +1,370 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2ZJet_H
#define HERWIG_MEPP2ZJet_H
//
// This is the declaration of the MEPP2ZJet class.
//
#include "ThePEG/MatrixElement/MEBase.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2ZJet class implements the matrix element for the production
* of a Z boson + a jet including the decay of the Z including \f$Z/\gamma\f$
* interference
*
* @see \ref MEPP2ZJetInterfaces "The interfaces"
* defined for MEPP2ZJet.
*/
class MEPP2ZJet: public MEBase {
public:
/**
* The default constructor.
*/
MEPP2ZJet();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degrees of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given nDim() uniform
* random numbers in the interval \f$ ]0,1[ \f$. To help the phase space
* generator, the dSigHatDR should be a smooth function of these
* numbers, although this is not strictly necessary.
* @param r a pointer to the first of nDim() consecutive random numbers.
* @return true if the generation succeeded, otherwise false.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the matrix element squared differential in the variables
* given by the last call to generateKinematics().
*/
virtual CrossSection dSigHatDR() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Used internally by generateKinematics, after calculating the
* limits on cos(theta).
*/
double getCosTheta(double cthmin, double cthmax, const double r);
/**
* Matrix elements for the different subprocesses
*/
//@{
/**
* Matrix element for \f$q\bar{q}\to Z/\gamma g\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param gout Polarization vectors for the outgoing gluon
* @param lm Spinors for outgoing lepton
* @param lp Spinors for outgoing antilepton
* @param me Whether or not to calculate the matrix element for spin correlations
**/
InvEnergy2 qqbarME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
vector<VectorWaveFunction> & gout,
vector<SpinorBarWaveFunction> & lm, vector<SpinorWaveFunction> & lp,
bool me=false) const;
/**
* Matrix element for \f$qg\to Z/\gamma q\f$.
* @param fin Spinors for incoming quark
* @param gin Polarization vectors for the incoming gluon
* @param fout Spinors for outgoing quark
* @param lm Spinors for outgoing lepton
* @param lp Spinors for outgoing antilepton
* @param me Whether or not to calculate the matrix element for spin correlations
**/
InvEnergy2 qgME(vector<SpinorWaveFunction> & fin,vector<VectorWaveFunction> & gin,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorBarWaveFunction> & lm, vector<SpinorWaveFunction> & lp,
bool me=false) const;
/**
* Matrix element for \f$\bar{q}g\to Z/\gamma\bar{q}\f$.
* @param fin Spinors for incoming antiquark
* @param gin Polarization vectors for the incoming gluon
* @param fout Spinors for outgoing antiquark
* @param lm Spinors for outgoing lepton
* @param lp Spinors for outgoing antilepton
* @param me Whether or not to calculate the matrix element for spin correlations
**/
InvEnergy2 qbargME(vector<SpinorBarWaveFunction> & fin,
vector<VectorWaveFunction> & gin,
vector<SpinorWaveFunction> & fout,
vector<SpinorBarWaveFunction> & lm, vector<SpinorWaveFunction> & lp,
bool me=false) const;
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2ZJet> initMEPP2ZJet;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2ZJet & operator=(const MEPP2ZJet &);
private:
/**
* Vertices for the helicity amplitude calculation
*/
//@{
/**
* Pointer to the Z vertex
*/
AbstractFFVVertexPtr _theFFZVertex;
/**
* Pointer to the photon vertex
*/
AbstractFFVVertexPtr _theFFPVertex;
/**
* Pointer to the \f$qqg\f$ vertex
*/
AbstractFFVVertexPtr _theQQGVertex;
//@}
/**
* @name Pointers to the \f$Z^0\f$ and \f$\gamma\f$ ParticleData objects
*/
//@{
/**
* Pointer to the Z ParticleData object
*/
tcPDPtr _z0;
/**
* Pointer to the photon ParticleData object
*/
tcPDPtr _gamma;
//@}
/**
* @name Switches to control the particles in the hard process
*/
//@{
/**
* Subprocesses to include
*/
unsigned int _process;
/**
* Allowed flavours for the incoming quarks
*/
int _maxflavour;
/**
* Control over which Z decay modes to include
*/
int _zdec;
/**
* Which terms to include
*/
unsigned int _gammaZ;
/**
* Option for the treatment of the W off-shell effects
*/
unsigned int _widthopt;
//@}
/**
* Probability of selecting \f$1/s^2\f$ for the jacobian
* transformation of the boson mass
*/
double _pprob;
/**
* Matrix element for spin correlations
*/
mutable ProductionMatrixElement _me;
/**
* Storage of the scale to avoid the need to recalculate
*/
Energy2 _scale;
/**
* Storage of the off-shell Z mass to avoid the need to recalculate
*/
Energy2 _mz2;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2ZJet. */
template <>
struct BaseClassTrait<Herwig::MEPP2ZJet,1> {
/** Typedef of the first base class of MEPP2ZJet. */
typedef MEBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2ZJet class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2ZJet>
: public ClassTraitsBase<Herwig::MEPP2ZJet> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2ZJet"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2ZJet is implemented. It may also include several, space-separated,
* libraries if the class MEPP2ZJet 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2ZJet_H */
diff --git a/MatrixElement/Hadron/MEQCD2to2.h b/MatrixElement/Hadron/MEQCD2to2.h
--- a/MatrixElement/Hadron/MEQCD2to2.h
+++ b/MatrixElement/Hadron/MEQCD2to2.h
@@ -1,405 +1,405 @@
// -*- C++ -*-
//
// MEQCD2to2.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEQCD2to2_H
#define HERWIG_MEQCD2to2_H
//
// This is the declaration of the MEQCD2to2 class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVertex.h"
#include "ThePEG/Helicity/Vertex/AbstractVVVVVertex.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEQCD2to2 class provides the matrix elements for \f$2\to2\f$
* QCD scattering processes in hadron-hadron collisions.
*
* @see \ref MEQCD2to2Interfaces "The interfaces"
* defined for MEQCD2to2.
*/
class MEQCD2to2: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MEQCD2to2();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Members to calculate the matrix elements
*/
//@{
/**
* Matrix element for \f$gg\to gg\f$.
* @param g1 The wavefunctions for the first incoming gluon
* @param g2 The wavefunctions for the second incoming gluon
* @param g3 The wavefunctions for the first outgoing gluon
* @param g4 The wavefunctions for the second outgoing gluon
* @param flow The colour flow
*/
double gg2ggME(vector<VectorWaveFunction> &g1,vector<VectorWaveFunction> &g2,
vector<VectorWaveFunction> &g3,vector<VectorWaveFunction> &g4,
unsigned int flow) const;
/**
* Matrix element for \f$gg\to q\bar{q}\f$
* @param g1 The wavefunctions for the first incoming gluon
* @param g2 The wavefunctions for the second incoming gluon
* @param q The wavefunction for the outgoing quark
* @param qbar The wavefunction for the outgoing antiquark
* @param flow The colour flow
*/
double gg2qqbarME(vector<VectorWaveFunction> &g1,vector<VectorWaveFunction> &g2,
vector<SpinorBarWaveFunction> & q,vector<SpinorWaveFunction> & qbar,
unsigned int flow) const;
/**
* Matrix element for \f$q\bar{q}\to gg\f$
* @param q The wavefunction for the incoming quark
* @param qbar The wavefunction for the incoming antiquark
* @param g1 The wavefunctions for the first outgoing gluon
* @param g2 The wavefunctions for the second outgoing gluon
* @param flow The colour flow
*/
double qqbar2ggME(vector<SpinorWaveFunction> & q,vector<SpinorBarWaveFunction> & qbar,
vector<VectorWaveFunction> &g1,vector<VectorWaveFunction> &g2,
unsigned int flow) const;
/**
* Matrix element for \f$qg\to qg\f$
* @param qin The wavefunction for the incoming quark
* @param g2 The wavefunction for the incoming gluon
* @param qout The wavefunction for the outgoing quark
* @param g4 The wavefunction for the outgoing gluon
* @param flow The colour flow
*/
double qg2qgME(vector<SpinorWaveFunction> & qin,vector<VectorWaveFunction> &g2,
vector<SpinorBarWaveFunction> & qout,vector<VectorWaveFunction> &g4,
unsigned int flow) const;
/**
* Matrix elements for \f$\bar{q}g\to \bar{q}g\f$.
* @param qin The wavefunction for the incoming antiquark
* @param g2 The wavefunction for the incoming gluon
* @param qout The wavefunction for the outgoing antiquark
* @param g4 The wavefunction for the outgoing gluon
* @param flow The colour flow
*/
double qbarg2qbargME(vector<SpinorBarWaveFunction> & qin,
vector<VectorWaveFunction> &g2,
vector<SpinorWaveFunction> & qout,vector<VectorWaveFunction> &g4,
unsigned int flow) const;
/**
* Matrix element for \f$qq\to qq\f$
* @param q1 The wavefunction for the first incoming quark
* @param q2 The wavefunction for the second incoming quark
* @param q3 The wavefunction for the first outgoing quark
* @param q4 The wavefunction for the second outgoing quark
* @param flow The colour flow
*/
double qq2qqME(vector<SpinorWaveFunction> & q1, vector<SpinorWaveFunction> & q2,
vector<SpinorBarWaveFunction> & q3, vector<SpinorBarWaveFunction> & q4,
unsigned int flow) const;
/**
* Matrix element for \f$\bar{q}\bar{q}\to \bar{q}\bar{q}\f$
* @param q1 The wavefunction for the first incoming antiquark
* @param q2 The wavefunction for the second incoming antiquark
* @param q3 The wavefunction for the first outgoing antiquark
* @param q4 The wavefunction for the second outgoing antiquark
* @param flow The colour flow
*/
double qbarqbar2qbarqbarME(vector<SpinorBarWaveFunction> & q1,
vector<SpinorBarWaveFunction> & q2,
vector<SpinorWaveFunction> & q3,
vector<SpinorWaveFunction> & q4,
unsigned int flow) const;
/**
* Matrix element for \f$q\bar{q}\to q\bar{q}\f$
* @param q1 The wavefunction for the incoming quark
* @param q2 The wavefunction for the incoming antiquark
* @param q3 The wavefunction for the outgoing quark
* @param q4 The wavefunction for the outgoing antiquark
* @param flow The colour flow
*/
double qqbar2qqbarME(vector<SpinorWaveFunction> & q1,
vector<SpinorBarWaveFunction> & q2,
vector<SpinorBarWaveFunction> & q3,
vector<SpinorWaveFunction> & q4,
unsigned int flow) const;
//@}
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans)
;
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEQCD2to2> initMEQCD2to2;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEQCD2to2 & operator=(const MEQCD2to2 &);
private:
/**
* Vertices needed to compute the diagrams
*/
//@{
/**
* \f$gggg\f$ vertex
*/
AbstractVVVVVertexPtr _ggggvertex;
/**
* \f$ggg\f$ vertex
*/
AbstractVVVVertexPtr _gggvertex;
/**
* \f$q\bar{q}g\f$ vertex
*/
AbstractFFVVertexPtr _qqgvertex;
//@}
/**
* Maximum numbere of quark flavours to include
*/
unsigned int _maxflavour;
/**
* Processes to include
*/
unsigned int _process;
/**
* Colour flow
*/
mutable unsigned int _flow;
/**
* Diagram
*/
mutable unsigned int _diagram;
/**
* Matrix element
*/
mutable ProductionMatrixElement _me;
/**
* ParticleData objects of the partons
*/
//@{
/**
* The gluon
*/
PDPtr _gluon;
/**
* the quarks
*/
vector<PDPtr> _quark;
/**
* the antiquarks
*/
vector<PDPtr> _antiquark;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEQCD2to2. */
template <>
struct BaseClassTrait<Herwig::MEQCD2to2,1> {
/** Typedef of the first base class of MEQCD2to2. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEQCD2to2 class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEQCD2to2>
: public ClassTraitsBase<Herwig::MEQCD2to2> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEQCD2to2"; }
/**
* The name of a file containing the dynamic library where the class
* MEQCD2to2 is implemented. It may also include several, space-separated,
* libraries if the class MEQCD2to2 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 "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEQCD2to2_H */
diff --git a/MatrixElement/Hadron/MEQCD2to2Fast.cc b/MatrixElement/Hadron/MEQCD2to2Fast.cc
--- a/MatrixElement/Hadron/MEQCD2to2Fast.cc
+++ b/MatrixElement/Hadron/MEQCD2to2Fast.cc
@@ -1,393 +1,401 @@
// -*- C++ -*-
//
// MEQCD2to2Fast.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the MEQCD2to2Fast class.
//
#include "MEQCD2to2Fast.h"
#include "ThePEG/Utilities/SimplePhaseSpace.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
#include "Herwig++/Models/StandardModel/StandardModel.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "ThePEG/Cuts/Cuts.h"
using namespace Herwig;
+IBPtr MEQCD2to2Fast::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr MEQCD2to2Fast::fullclone() const {
+ return new_ptr(*this);
+}
+
Energy2 MEQCD2to2Fast::scale() const {
Energy2 s(sHat()),u(uHat()),t(tHat());
return 2.*s*t*u/(s*s+t*t+u*u);
}
void MEQCD2to2Fast::persistentOutput(PersistentOStream & os) const {
os << _maxflavour << _process;
}
void MEQCD2to2Fast::persistentInput(PersistentIStream & is, int) {
is >> _maxflavour >> _process;
}
unsigned int MEQCD2to2Fast::orderInAlphaS() const {
return 2;
}
unsigned int MEQCD2to2Fast::orderInAlphaEW() const {
return 0;
}
ClassDescription<MEQCD2to2Fast> MEQCD2to2Fast::initMEQCD2to2Fast;
// Definition of the static class description member.
void MEQCD2to2Fast::Init() {
static ClassDocumentation<MEQCD2to2Fast> documentation
("The MEQCD2to2Fast class implements the QCD 2->2 processes in hadron-hadron"
" collisions");
static Parameter<MEQCD2to2Fast,unsigned int> interfaceMaximumFlavour
("MaximumFlavour",
"The maximum flavour of the quarks in the process",
&MEQCD2to2Fast::_maxflavour, 5, 1, 5,
false, false, Interface::limited);
static Switch<MEQCD2to2Fast,unsigned int> interfaceProcess
("Process",
"Which subprocesses to include",
&MEQCD2to2Fast::_process, 0, false, false);
static SwitchOption interfaceProcessAll
(interfaceProcess,
"All",
"Include all subprocesses",
0);
static SwitchOption interfaceProcess1
(interfaceProcess,
"gg2gg",
"Include only gg->gg subprocesses",
1);
static SwitchOption interfaceProcess2
(interfaceProcess,
"gg2qqbar",
"Include only gg -> q qbar processes",
2);
static SwitchOption interfaceProcessqqbargg
(interfaceProcess,
"qqbar2gg",
"Include only q qbar -> gg processes",
3);
static SwitchOption interfaceProcessqgqg
(interfaceProcess,
"qg2qg",
"Include only q g -> q g processes",
4);
static SwitchOption interfaceProcessqbargqbarg
(interfaceProcess,
"qbarg2qbarg",
"Include only qbar g -> qbar g processes",
5);
static SwitchOption interfaceProcessqqqq
(interfaceProcess,
"qq2qq",
"Include only q q -> q q processes",
6);
static SwitchOption interfaceProcessqbarqbarqbarqbar
(interfaceProcess,
"qbarqbar2qbarqbar",
"Include only qbar qbar -> qbar qbar processes",
7);
static SwitchOption interfaceProcessqqbarqqbar
(interfaceProcess,
"qqbar2qqbar",
"Include only q qbar -> q qbar processes",
8);
}
Selector<MEBase::DiagramIndex>
MEQCD2to2Fast::diagrams(const DiagramVector & diags) const {
// select the diagram, this is easy for us as we have already done it
Selector<DiagramIndex> sel;
for ( DiagramIndex i = 0; i < diags.size(); ++i ) {
if(diags[i]->id()==-int(_diagram)) sel.insert(1.0, i);
else sel.insert(0., i);
}
return sel;
}
void MEQCD2to2Fast::getDiagrams() const {
// get the particle data objects
PDPtr gluon=getParticleData(ParticleID::g);
vector<PDPtr> quark,antiquark;
for(int ix=1;ix<=int(_maxflavour);++ix) {
quark.push_back( getParticleData( ix));
antiquark.push_back(getParticleData(-ix));
}
// gg-> gg subprocess
if(_process==0||_process==1) {
// s-channel
add(new_ptr((Tree2toNDiagram(2),gluon,gluon, 1, gluon,
3,gluon, 3, gluon, -1)));
// first t-channel
add(new_ptr((Tree2toNDiagram(3),gluon,gluon,gluon,
1,gluon, 2,gluon,-2)));
// second t-channel
add(new_ptr((Tree2toNDiagram(3),gluon,gluon,gluon,
2,gluon, 1,gluon,-3)));
}
// processes involving one quark line
for(unsigned int ix=0;ix<_maxflavour;++ix) {
// gg -> q qbar subprocesses
if(_process==0||_process==2) {
// first t-channel
add(new_ptr((Tree2toNDiagram(3),gluon,antiquark[ix],gluon,
1,quark[ix], 2,antiquark[ix],-4)));
// interchange
add(new_ptr((Tree2toNDiagram(3),gluon,antiquark[ix],gluon,
2,quark[ix], 1,antiquark[ix],-5)));
// s-channel
add(new_ptr((Tree2toNDiagram(2),gluon,gluon, 1, gluon,
3,quark[ix], 3, antiquark[ix], -6)));
}
// q qbar -> g g subprocesses
if(_process==0||_process==3) {
// first t-channel
add(new_ptr((Tree2toNDiagram(3),quark[ix],antiquark[ix],antiquark[ix],
1,gluon, 2,gluon,-7)));
// second t-channel
add(new_ptr((Tree2toNDiagram(3),quark[ix],antiquark[ix],antiquark[ix],
2,gluon, 1,gluon,-8)));
// s-channel
add(new_ptr((Tree2toNDiagram(2),quark[ix], antiquark[ix],
1, gluon, 3, gluon, 3, gluon,-9)));
}
// q g -> q g subprocesses
if(_process==0||_process==4) {
// s-channel
add(new_ptr((Tree2toNDiagram(2),quark[ix], gluon,
1, quark[ix], 3, quark[ix], 3, gluon,-10)));
// quark t-channel
add(new_ptr((Tree2toNDiagram(3),quark[ix],quark[ix],gluon,
2,quark[ix],1,gluon,-11)));
// gluon t-channel
add(new_ptr((Tree2toNDiagram(3),quark[ix],gluon,gluon,
1,quark[ix],2,gluon,-12)));
}
// qbar g -> qbar g subprocesses
if(_process==0||_process==5) {
// s-channel
add(new_ptr((Tree2toNDiagram(2),antiquark[ix], gluon,
1, antiquark[ix], 3, antiquark[ix], 3, gluon,-13)));
// quark t-channel
add(new_ptr((Tree2toNDiagram(3),antiquark[ix],antiquark[ix],gluon,
2,antiquark[ix],1,gluon,-14)));
// gluon t-channel
add(new_ptr((Tree2toNDiagram(3),antiquark[ix],gluon,gluon,
1,antiquark[ix],2,gluon,-15)));
}
// processes involving two quark lines
for(unsigned int iy=0;iy<_maxflavour;++iy) {
// q q -> q q subprocesses
if(_process==0||_process==6) {
// gluon t-channel
add(new_ptr((Tree2toNDiagram(3),quark[ix],gluon,quark[iy],
1,quark[ix],2,quark[iy],-16)));
// exchange for identical quarks
if(ix==iy)
add(new_ptr((Tree2toNDiagram(3),quark[ix],gluon,quark[iy],
2,quark[ix],1,quark[iy],-17)));
}
// qbar qbar -> qbar qbar subprocesses
if(_process==0||_process==7) {
// gluon t-channel
add(new_ptr((Tree2toNDiagram(3),antiquark[ix],gluon,antiquark[iy],
1,antiquark[ix],2,antiquark[iy],-18)));
// exchange for identical quarks
if(ix==iy)
add(new_ptr((Tree2toNDiagram(3),antiquark[ix],gluon,antiquark[iy],
2,antiquark[ix],1,antiquark[iy],-19)));
}
// q qbar -> q qbar
if(_process==0||_process==8) {
// gluon s-channel
add(new_ptr((Tree2toNDiagram(2),quark[ix], antiquark[ix],
1, gluon, 3, quark[iy], 3, antiquark[iy],-20)));
// gluon t-channel
add(new_ptr((Tree2toNDiagram(3),quark[ix],gluon,antiquark[iy],
1,quark[ix],2,antiquark[iy],-21)));
}
}
}
}
Selector<const ColourLines *>
MEQCD2to2Fast::colourGeometries(tcDiagPtr diag) const {
// colour lines for gg to gg
static const ColourLines cgggg[12]={ColourLines("1 -2, -1 -3 -5, 5 -4, 2 3 4"),// A_2 s
ColourLines("-1 2, 1 3 5, -5 4, -2 -3 -4"),// A_1 s
ColourLines("1 5, -1 -2 3, -3 -4, -5 2 4"),// A_1 u
ColourLines("-1 -5, 1 2 -3, 3 4, 5 -2 -4"),// A_2 u
ColourLines("1 -2, -1 -3 -4, 4 -5, 2 3 5"),// B_2 s
ColourLines("-1 2, 1 3 4, -4 5, -2 -3 -5"),// B_1 s
ColourLines("1 4, -1 -2 3, -3 -5, -4 2 5"),// B_1 t
ColourLines("-1 -4, 1 2 -3, 3 5, 4 -2 -5"),// B_2 t
ColourLines("1 4, -1 -2 -5, 3 5, -3 2 -4"),// C_1 t
ColourLines("-1 -4, 1 2 5, -3 -5, 3 -2 4"),// C_2 t
ColourLines("1 5, -1 -2 -4, 3 4, -3 2 -5"),// C_1 u
ColourLines("-1 -5, 1 2 4, -3 -4, 3 -2 5") // C_2 u
};
// colour lines for gg to q qbar
static const ColourLines cggqq[4]={ColourLines("1 4, -1 -2 3, -3 -5"),
ColourLines("3 4, -3 -2 1, -1 -5"),
ColourLines("2 -1, 1 3 4, -2 -3 -5"),
ColourLines("1 -2, -1 -3 -5, 2 3 4")};
// colour lines for q qbar to gg
static const ColourLines cqqgg[4]={ColourLines("1 4, -4 -2 5, -3 -5"),
ColourLines("1 5, -3 -4, 4 -2 -5"),
ColourLines("1 3 4, -4 5, -2 -3 -5"),
ColourLines("1 3 5, -5 4, -2 -3 -4")};
// colour lines for q g to q g
static const ColourLines cqgqg[4]={ColourLines("1 -2, 2 3 5, 4 -5"),
ColourLines("1 5, 3 4,-3 2 -5 "),
ColourLines("1 2 -3, 3 5, -5 -2 4"),
ColourLines("1 -2 5,3 2 4,-3 -5")};
// colour lines for qbar g -> qbar g
static const ColourLines cqbgqbg[4]={ColourLines("-1 2, -2 -3 -5, -4 5"),
ColourLines("-1 -5, -3 -4, 3 -2 5"),
ColourLines("-1 -2 3, -3 -5, 5 2 -4"),
ColourLines("-1 2 -5,-3 -2 -4, 3 5")};
// colour lines for q q -> q q
static const ColourLines cqqqq[2]={ColourLines("1 2 5,3 -2 4"),
ColourLines("1 2 4,3 -2 5")};
// colour lines for qbar qbar -> qbar qbar
static const ColourLines cqbqbqbqb[2]={ColourLines("-1 -2 -5,-3 2 -4"),
ColourLines("-1 -2 -4,-3 2 -5")};
// colour lines for q qbar -> q qbar
static const ColourLines cqqbqqb[2]={ColourLines("1 3 4,-2 -3 -5"),
ColourLines("1 2 -3,4 -2 -5")};
// select the colour flow (as all ready picked just insert answer)
Selector<const ColourLines *> sel;
switch(abs(diag->id())) {
// gg -> gg subprocess
case 1:
if(_flow==1) {
sel.insert(0.5, &cgggg[0]);
sel.insert(0.5, &cgggg[1]);
}
else {
sel.insert(0.5, &cgggg[4]);
sel.insert(0.5, &cgggg[5]);
}
break;
case 2:
if(_flow==2) {
sel.insert(0.5, &cgggg[6]);
sel.insert(0.5, &cgggg[7]);
}
else {
sel.insert(0.5, &cgggg[8]);
sel.insert(0.5, &cgggg[9]);
}
break;
case 3:
if(_flow==1) {
sel.insert(0.5, &cgggg[2]);
sel.insert(0.5, &cgggg[3]);
}
else {
sel.insert(0.5, &cgggg[10]);
sel.insert(0.5, &cgggg[11]);
}
break;
// gg -> q qbar subprocess
case 4: case 5:
sel.insert(1.0, &cggqq[abs(diag->id())-4]);
break;
case 6:
sel.insert(1.0, &cggqq[1+_flow]);
break;
// q qbar -> gg subprocess
case 7: case 8:
sel.insert(1.0, &cqqgg[abs(diag->id())-7]);
break;
case 9:
sel.insert(1.0, &cqqgg[1+_flow]);
break;
// q g -> q g subprocess
case 10: case 11:
sel.insert(1.0, &cqgqg[abs(diag->id())-10]);
break;
case 12:
sel.insert(1.0, &cqgqg[1+_flow]);
break;
// q g -> q g subprocess
case 13: case 14:
sel.insert(1.0, &cqbgqbg[abs(diag->id())-13]);
break;
case 15:
sel.insert(1.0, &cqbgqbg[1+_flow]);
break;
// q q -> q q subprocess
case 16: case 17:
sel.insert(1.0, &cqqqq[abs(diag->id())-16]);
break;
// qbar qbar -> qbar qbar subprocess
case 18: case 19:
sel.insert(1.0, &cqbqbqbqb[abs(diag->id())-18]);
break;
// q qbar -> q qbar subprocess
case 20: case 21:
sel.insert(1.0, &cqqbqqb[abs(diag->id())-20]);
break;
}
return sel;
}
double MEQCD2to2Fast::me2() const {
// total matrix element
double me(0.);
// gg initiated processes
if(mePartonData()[0]->id()==ParticleID::g&&mePartonData()[1]->id()==ParticleID::g) {
// gg -> gg
if(mePartonData()[2]->id()==ParticleID::g) me = gg2ggME();
// gg -> q qbar
else me=gg2qqbarME();
}
// quark first processes
else if(mePartonData()[0]->id()>0) {
// q g -> q g
if(mePartonData()[1]->id()==ParticleID::g) me = qg2qgME();
else if(mePartonData()[1]->id()<0) {
// q qbar initiated processes( q qbar -> gg)
if(mePartonData()[2]->id()==ParticleID::g) me = qqbar2ggME();
// q qbar to q qbar
else me = qqbar2qqbarME();
}
// q q -> q q
else if(mePartonData()[1]->id()>0) me = qq2qqME();
}
// antiquark first processes
else if(mePartonData()[0]->id()<0) {
// qbar g -> qbar g
if(mePartonData()[1]->id()==ParticleID::g) me = qbarg2qbargME();
// qbar qbar -> qbar qbar
else if(mePartonData()[1]->id()<0) me = qbarqbar2qbarqbarME();
}
else {
throw Exception() << "Unknown process in MEQCD2to2Fast::me2()"
<< Exception::abortnow;
}
// multpliy by alpha_S^2 and return answer
double alphas(4.*Constants::pi*SM().alphaS(scale()));
return me*sqr(alphas);
}
diff --git a/MatrixElement/Hadron/MEQCD2to2Fast.h b/MatrixElement/Hadron/MEQCD2to2Fast.h
--- a/MatrixElement/Hadron/MEQCD2to2Fast.h
+++ b/MatrixElement/Hadron/MEQCD2to2Fast.h
@@ -1,261 +1,366 @@
// -*- C++ -*-
//
// MEQCD2to2Fast.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEQCD2to2Fast_H
#define HERWIG_MEQCD2to2Fast_H
//
// This is the declaration of the MEQCD2to2Fast class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "ThePEG/Repository/UseRandom.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEQCD2to2Fast class implements the matrix elements for
* QCD \f$2\to2\f$ scattering processes using hard coded formulae and
* as such can not include spin correlations. It is designed to be a faster
* replacement for MEQCD2to2 for use in the underlying event.
*
* @see \ref MEQCD2to2FastInterfaces "The interfaces"
* defined for MEQCD2to2Fast.
*/
class MEQCD2to2Fast: public HwME2to2Base {
public:
/**
* The default constructor.
*/
- inline MEQCD2to2Fast();
+ MEQCD2to2Fast() :_maxflavour(5),_process(0) {
+ massOption(true ,0);
+ massOption(false,0);
+ }
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Members to calculate the matrix elements
*/
//@{
/**
* Matrix element for \f$gg\to gg\f$.
*/
- inline double gg2ggME() const;
+ double gg2ggME() const {
+ Energy2 u(uHat()),t(tHat()),s(sHat());
+ double output = 9./4.*(3.-t*u/s/s-s*u/t/t-s*t/u/u);
+ double flow[3]={(1.-u*t/s/s-s*t/u/u+t*t/s/u),
+ (1.-t*u/s/s-s*u/t/t+u*u/s/t),
+ (1.-t*s/u/u-u*s/t/t+s*s/u/t)};
+ _flow = 1+UseRandom::rnd3(flow[0],flow[1],flow[2]);
+ double diag[3]={(sqr(u)+sqr(t))/sqr(s),
+ (sqr(s)+sqr(u))/sqr(t),
+ (sqr(s)+sqr(t))/sqr(u)};
+ if(_flow==1) diag[1]=0;
+ else if(_flow==2) diag[2]=0;
+ else if(_flow==3) diag[0]=0;
+ _diagram=1+UseRandom::rnd3(diag[0],diag[1],diag[2]);
+ return output;
+ }
/**
* Matrix element for \f$gg\to q\bar{q}\f$
*/
- inline double gg2qqbarME() const;
+ double gg2qqbarME() const {
+ Energy2 u(uHat()),t(tHat()),s(sHat());
+ Energy4 u2(sqr(u)),t2(sqr(t)),s2(sqr(s));
+ double output =(1./6./u/t-3./8./s2)*(t2+u2);
+ double flow[2]={u2/(u2+t2),t2/(u2+t2)};
+ _flow = 1+UseRandom::rnd2(flow[0],flow[1]);
+ _diagram=3+_flow;
+ return output;
+ }
/**
* Matrix element for \f$q\bar{q}\to gg\f$
*/
- inline double qqbar2ggME() const;
+ double qqbar2ggME() const {
+ Energy2 u(uHat()),t(tHat()),s(sHat());
+ Energy4 s2(sqr(s)),u2(sqr(u)),t2(sqr(t));
+ double output = 0.5*(32./27./u/t-8./3./s2)*(t2+u2);
+ double flow[2] = {u2/(u2+t2),t2/(t2+u2)};
+ _flow=1+UseRandom::rnd2(flow[0],flow[1]);
+ _diagram=6+_flow;
+ return output;
+ }
/**
* Matrix element for \f$qg\to qg\f$
*/
- inline double qg2qgME() const;
-
+ double qg2qgME() const {
+ Energy2 u(uHat()),t(tHat()),s(sHat());
+ Energy4 s2(sqr(s)),u2(sqr(u)),t2(sqr(t));
+ double output = (-4./9./s/u+1./t2)*(s2+u2);
+ double flow[2]={u2/(s2+u2),s2/(s2+u2)};
+ _flow=1+UseRandom::rnd2(flow[0],flow[1]);
+ _diagram=9+_flow;
+ return output;
+ }
+
/**
* Matrix elements for \f$\bar{q}g\to \bar{q}g\f$.
*/
- inline double qbarg2qbargME() const;
-
+ double qbarg2qbargME() const {
+ // scale
+ Energy2 u(uHat()),t(tHat()),s(sHat());
+ Energy4 u2(sqr(u)),s2(sqr(s)); // t2(sqr(t))
+ double flow[2]={u2/(s2+u2),s2/(s2+u2)};
+ _flow=1+UseRandom::rnd2(flow[0],flow[1]);
+ _diagram=12+_flow;
+ return (-4./9./s/u+1./t/t)*(s*s+u*u);
+ }
+
/**
* Matrix element for \f$qq\to qq\f$
*/
- inline double qq2qqME() const;
+ double qq2qqME() const {
+ Energy2 u(uHat()),t(tHat());
+ Energy4 s2(sqr(sHat())),u2(sqr(u)),t2(sqr(t));
+ double output;
+ if(mePartonData()[0]->id()==mePartonData()[1]->id()) {
+ output = 0.5*(4./9.*((s2+u2)/t2+(s2+t2)/u2)
+ -8./27.*s2/u/t);
+ double flow[2]={(s2+u2)/t2,(s2+t2)/u2};
+ _flow=1+UseRandom::rnd2(flow[0],flow[1]);
+ }
+ else {
+ output = 4./9.*(s2+u2)/t2;
+ _flow=2;
+ }
+ _diagram = 15+_flow;
+ return output;
+ }
/**
* Matrix element for \f$\bar{q}\bar{q}\to \bar{q}\bar{q}\f$
*/
- inline double qbarqbar2qbarqbarME() const;
-
+ double qbarqbar2qbarqbarME() const {
+ Energy2 u(uHat()),t(tHat());
+ Energy4 u2(sqr(u)),t2(sqr(t)),s2(sqr(sHat()));
+ double output;
+ if(mePartonData()[0]->id()==mePartonData()[1]->id()) {
+ output = 0.5*(4./9.*((s2+u2)/t2+(s2+t2)/u2)
+ -8./27.*s2/u/t);
+ double flow[2]={(s2+u2)/t2,(s2+t2)/u2};
+ _flow=1+UseRandom::rnd2(flow[0],flow[1]);
+ }
+ else {
+ output = 4./9.*(s2+u2)/t2;
+ _flow = 2;
+ }
+ _diagram = 17+_flow;
+ // final part of colour and spin factors
+ return output;
+ }
+
/**
* Matrix element for \f$q\bar{q}\to q\bar{q}\f$
*/
- inline double qqbar2qqbarME() const;
+ double qqbar2qqbarME() const {
+ // type of process
+ bool diagon[2]={mePartonData()[0]->id()== -mePartonData()[1]->id(),
+ mePartonData()[0]->id()== mePartonData()[2]->id()};
+ // scale
+ Energy2 u(uHat()),t(tHat()),s(sHat());
+ Energy4 s2(sqr(s)),t2(sqr(t)),u2(sqr(u));
+ double output;
+ if(diagon[0]&&diagon[1]) {
+ output= (4./9.*((s2+u2)/t2+(u2+t2)/s2)
+ -8./27.*u2/s/t);
+ double flow[2]={(t2+u2)/s2,(s2+u2)/t2};
+ _flow=1+UseRandom::rnd2(flow[0],flow[1]);
+ }
+ else if(diagon[0]) {
+ output = (4./9.*(t2+u2)/s2);
+ _flow=1;
+ }
+ else {
+ output = (4./9.*(s2+u2)/t2);
+ _flow=2;
+ }
+ _diagram=19+_flow;
+ return output;
+ }
//@}
-
+
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const;
+ virtual IBPtr clone() const;
/** 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;
+ virtual IBPtr fullclone() const;
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEQCD2to2Fast> initMEQCD2to2Fast;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEQCD2to2Fast & operator=(const MEQCD2to2Fast &);
private:
/**
* Maximum numbere of quark flavours to include
*/
unsigned int _maxflavour;
/**
* Processes to include
*/
unsigned int _process;
/**
* Colour flow
*/
mutable unsigned int _flow;
/**
* Diagram
*/
mutable unsigned int _diagram;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEQCD2to2Fast. */
template <>
struct BaseClassTrait<Herwig::MEQCD2to2Fast,1> {
/** Typedef of the first base class of MEQCD2to2Fast. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEQCD2to2Fast class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEQCD2to2Fast>
: public ClassTraitsBase<Herwig::MEQCD2to2Fast> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEQCD2to2Fast"; }
/**
* The name of a file containing the dynamic library where the class
* MEQCD2to2Fast is implemented. It may also include several, space-separated,
* libraries if the class MEQCD2to2Fast 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 "HwMEHadronFast.so"; }
};
/** @endcond */
}
-#include "MEQCD2to2Fast.icc"
-
#endif /* HERWIG_MEQCD2to2Fast_H */
diff --git a/MatrixElement/Hadron/MEQCD2to2Fast.icc b/MatrixElement/Hadron/MEQCD2to2Fast.icc
deleted file mode 100644
--- a/MatrixElement/Hadron/MEQCD2to2Fast.icc
+++ /dev/null
@@ -1,149 +0,0 @@
-// -*- C++ -*-
-//
-// MEQCD2to2Fast.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the MEQCD2to2Fast class.
-//
-
-namespace Herwig {
-
-inline MEQCD2to2Fast::MEQCD2to2Fast():_maxflavour(5),_process(0) {
- massOption(true ,0);
- massOption(false,0);
-}
-
-inline IBPtr MEQCD2to2Fast::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr MEQCD2to2Fast::fullclone() const {
- return new_ptr(*this);
-}
-
-inline double MEQCD2to2Fast::gg2qqbarME() const {
- Energy2 u(uHat()),t(tHat()),s(sHat());
- Energy4 u2(sqr(u)),t2(sqr(t)),s2(sqr(s));
- double output =(1./6./u/t-3./8./s2)*(t2+u2);
- double flow[2]={u2/(u2+t2),t2/(u2+t2)};
- _flow = 1+UseRandom::rnd2(flow[0],flow[1]);
- _diagram=3+_flow;
- return output;
-}
-
-inline double MEQCD2to2Fast::qqbar2ggME() const {
- Energy2 u(uHat()),t(tHat()),s(sHat());
- Energy4 s2(sqr(s)),u2(sqr(u)),t2(sqr(t));
- double output = 0.5*(32./27./u/t-8./3./s2)*(t2+u2);
- double flow[2] = {u2/(u2+t2),t2/(t2+u2)};
- _flow=1+UseRandom::rnd2(flow[0],flow[1]);
- _diagram=6+_flow;
- return output;
-}
-
-inline double MEQCD2to2Fast::qg2qgME() const{
- Energy2 u(uHat()),t(tHat()),s(sHat());
- Energy4 s2(sqr(s)),u2(sqr(u)),t2(sqr(t));
- double output = (-4./9./s/u+1./t2)*(s2+u2);
- double flow[2]={u2/(s2+u2),s2/(s2+u2)};
- _flow=1+UseRandom::rnd2(flow[0],flow[1]);
- _diagram=9+_flow;
- return output;
-}
-
-inline double MEQCD2to2Fast::gg2ggME() const {
- Energy2 u(uHat()),t(tHat()),s(sHat());
- double output = 9./4.*(3.-t*u/s/s-s*u/t/t-s*t/u/u);
- double flow[3]={(1.-u*t/s/s-s*t/u/u+t*t/s/u),
- (1.-t*u/s/s-s*u/t/t+u*u/s/t),
- (1.-t*s/u/u-u*s/t/t+s*s/u/t)};
- _flow = 1+UseRandom::rnd3(flow[0],flow[1],flow[2]);
- double diag[3]={(sqr(u)+sqr(t))/sqr(s),
- (sqr(s)+sqr(u))/sqr(t),
- (sqr(s)+sqr(t))/sqr(u)};
- if(_flow==1) diag[1]=0;
- else if(_flow==2) diag[2]=0;
- else if(_flow==3) diag[0]=0;
- _diagram=1+UseRandom::rnd3(diag[0],diag[1],diag[2]);
- return output;
-}
-
-inline double MEQCD2to2Fast::qbarg2qbargME() const {
- // scale
- Energy2 u(uHat()),t(tHat()),s(sHat());
- Energy4 u2(sqr(u)),s2(sqr(s)); // t2(sqr(t))
- double flow[2]={u2/(s2+u2),s2/(s2+u2)};
- _flow=1+UseRandom::rnd2(flow[0],flow[1]);
- _diagram=12+_flow;
- return (-4./9./s/u+1./t/t)*(s*s+u*u);
-}
-
-inline double MEQCD2to2Fast::qq2qqME() const {
- Energy2 u(uHat()),t(tHat());
- Energy4 s2(sqr(sHat())),u2(sqr(u)),t2(sqr(t));
- double output;
- if(mePartonData()[0]->id()==mePartonData()[1]->id()) {
- output = 0.5*(4./9.*((s2+u2)/t2+(s2+t2)/u2)
- -8./27.*s2/u/t);
- double flow[2]={(s2+u2)/t2,(s2+t2)/u2};
- _flow=1+UseRandom::rnd2(flow[0],flow[1]);
- }
- else {
- output = 4./9.*(s2+u2)/t2;
- _flow=2;
- }
- _diagram = 15+_flow;
- return output;
-}
-
-inline double MEQCD2to2Fast::qbarqbar2qbarqbarME() const {
- Energy2 u(uHat()),t(tHat());
- Energy4 u2(sqr(u)),t2(sqr(t)),s2(sqr(sHat()));
- double output;
- if(mePartonData()[0]->id()==mePartonData()[1]->id()) {
- output = 0.5*(4./9.*((s2+u2)/t2+(s2+t2)/u2)
- -8./27.*s2/u/t);
- double flow[2]={(s2+u2)/t2,(s2+t2)/u2};
- _flow=1+UseRandom::rnd2(flow[0],flow[1]);
- }
- else {
- output = 4./9.*(s2+u2)/t2;
- _flow = 2;
- }
- _diagram = 17+_flow;
- // final part of colour and spin factors
- return output;
-}
-
-inline double MEQCD2to2Fast::qqbar2qqbarME() const {
- // type of process
- bool diagon[2]={mePartonData()[0]->id()== -mePartonData()[1]->id(),
- mePartonData()[0]->id()== mePartonData()[2]->id()};
- // scale
- Energy2 u(uHat()),t(tHat()),s(sHat());
- Energy4 s2(sqr(s)),t2(sqr(t)),u2(sqr(u));
- double output;
- if(diagon[0]&&diagon[1]) {
- output= (4./9.*((s2+u2)/t2+(u2+t2)/s2)
- -8./27.*u2/s/t);
- double flow[2]={(t2+u2)/s2,(s2+u2)/t2};
- _flow=1+UseRandom::rnd2(flow[0],flow[1]);
- }
- else if(diagon[0]) {
- output = (4./9.*(t2+u2)/s2);
- _flow=1;
- }
- else {
- output = (4./9.*(s2+u2)/t2);
- _flow=2;
- }
- _diagram=19+_flow;
- return output;
-}
-
-}
diff --git a/MatrixElement/Hadron/MEqq2W2ff.h b/MatrixElement/Hadron/MEqq2W2ff.h
--- a/MatrixElement/Hadron/MEqq2W2ff.h
+++ b/MatrixElement/Hadron/MEqq2W2ff.h
@@ -1,268 +1,268 @@
// -*- C++ -*-
//
// MEqq2W2ff.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEqq2W2ff_H
#define HERWIG_MEqq2W2ff_H
//
// This is the declaration of the MEqq2W2ff class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEqq2W2ff class implements the matrix element for \f$q\bar{q'}\to W^\pm\f$
* including the decay of the \f$W^\pm\f$ to Standard Model fermions.
*
* @see \ref MEqq2W2ffInterfaces "The interfaces"
* defined for MEqq2W2ff.
*/
class MEqq2W2ff: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MEqq2W2ff();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Matrix element for \f$q\bar{q}\to \gamma/Z \to f\bar{f}\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param fout Spinors for incoming quark
* @param aout Spinors for incoming antiquark
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double qqbarME(vector<SpinorWaveFunction> & fin ,
vector<SpinorBarWaveFunction> & ain ,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorWaveFunction> & aout,
bool me) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEqq2W2ff> initMEqq2W2ff;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEqq2W2ff & operator=(const MEqq2W2ff &);
private:
/**
* Pointer to the W vertex
*/
AbstractFFVVertexPtr _theFFWVertex;
/**
* Pointers to the intermediates resonances
*/
//@{
/**
* Pointer to the \f$W^+\f$
*/
tcPDPtr _wp;
/**
* Pointer to the \f$W^-\f$
*/
tcPDPtr _wm;
//@}
/**
* Switches to control the particles in the hard process
*/
//@{
/**
* The allowed flavours of the incoming quarks
*/
unsigned int _maxflavour;
/**
* Which intermediate \f$W^\pm\f$ bosons to include
*/
unsigned int _plusminus;
/**
* Which decay products of the \f$W^\pm\f$ to include
*/
unsigned int _process;
//@}
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEqq2W2ff. */
template <>
struct BaseClassTrait<Herwig::MEqq2W2ff,1> {
/** Typedef of the first base class of MEqq2W2ff. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEqq2W2ff class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEqq2W2ff>
: public ClassTraitsBase<Herwig::MEqq2W2ff> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEqq2W2ff"; }
/** Return the name(s) of the shared library (or libraries) be loaded to get
* access to the MEqq2W2ff class and any other class on which it depends
* (except the base class). */
static string library() { return "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEqq2W2ff_H */
diff --git a/MatrixElement/Hadron/MEqq2gZ2ff.h b/MatrixElement/Hadron/MEqq2gZ2ff.h
--- a/MatrixElement/Hadron/MEqq2gZ2ff.h
+++ b/MatrixElement/Hadron/MEqq2gZ2ff.h
@@ -1,284 +1,284 @@
// -*- C++ -*-
//
// MEqq2gZ2ff.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEqq2gZ2ff_H
#define HERWIG_MEqq2gZ2ff_H
//
// This is the declaration of the MEqq2gZ2ff class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEqq2gZ2ff class implements the products of Standard Model
* fermion antifermion pairs via the \f$Z^0\f$ resonance including
* photon interference terms.
*
* @see \ref MEqq2gZ2ffInterfaces "The interfaces"
* defined for MEqq2gZ2ff.
*/
class MEqq2gZ2ff: public HwME2to2Base {
public:
/**
* The default constructor.
*/
MEqq2gZ2ff();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Matrix element for \f$q\bar{q}\to \gamma/Z \to f\bar{f}\f$.
* @param fin Spinors for incoming quark
* @param ain Spinors for incoming antiquark
* @param fout Spinors for incoming quark
* @param aout Spinors for incoming antiquark
* @param me Whether or not to calculate the matrix element for spin correlations
*/
double qqbarME(vector<SpinorWaveFunction> & fin ,
vector<SpinorBarWaveFunction> & ain ,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorWaveFunction> & aout,
bool me) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEqq2gZ2ff> initMEqq2gZ2ff;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEqq2gZ2ff & operator=(const MEqq2gZ2ff &);
private:
/**
* Pointer to the vertices for the helicity calculations
*/
//@{
/**
* Pointer to the Z vertex
*/
AbstractFFVVertexPtr _theFFZVertex;
/**
* Pointer to the photon vertex
*/
AbstractFFVVertexPtr _theFFPVertex;
//@}
/**
* Pointers to the intermediate resonances
*/
//@{
/**
* Pointer to the Z ParticleData object
*/
tcPDPtr _z0;
/**
* Pointer to the photon ParticleData object
*/
tcPDPtr _gamma;
//@}
/**
* Switches to control the particles in the hard process
*/
//@{
/**
* Minimum allowed flavour for the incoming quarks
*/
int _minflavour;
/**
* Maximum allowed flavour for the incoming quarks
*/
int _maxflavour;
/**
* Whether to include both \f$Z^0\f$ and \f$\gamma\f$ or only one
*/
unsigned int _gammaZ;
/**
* Which processes to include
*/
int _process;
//@}
/**
* Matrix element for spin correlations
*/
ProductionMatrixElement _me;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEqq2gZ2ff. */
template <>
struct BaseClassTrait<Herwig::MEqq2gZ2ff,1> {
/** Typedef of the first base class of MEqq2gZ2ff. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEqq2gZ2ff class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEqq2gZ2ff>
: public ClassTraitsBase<Herwig::MEqq2gZ2ff> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEqq2gZ2ff"; }
/** Return the name(s) of the shared library (or libraries) be loaded to get
* access to the MEqq2gZ2ff class and any other class on which it depends
* (except the base class). */
static string library() { return "HwMEHadron.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEqq2gZ2ff_H */
diff --git a/MatrixElement/Hadron/Makefile.am b/MatrixElement/Hadron/Makefile.am
--- a/MatrixElement/Hadron/Makefile.am
+++ b/MatrixElement/Hadron/Makefile.am
@@ -1,26 +1,26 @@
pkglib_LTLIBRARIES = HwMEHadron.la
HwMEHadron_la_SOURCES = \
MEqq2gZ2ff.cc MEqq2gZ2ff.h \
MEqq2W2ff.cc MEqq2W2ff.h \
MEPP2GammaJet.h MEPP2GammaJet.cc\
MEQCD2to2.h MEQCD2to2.cc\
-MEPP2HiggsJet.h MEPP2HiggsJet.icc MEPP2HiggsJet.cc\
-MEPP2GammaGamma.h MEPP2GammaGamma.icc MEPP2GammaGamma.cc \
+MEPP2HiggsJet.h MEPP2HiggsJet.cc\
+MEPP2GammaGamma.h MEPP2GammaGamma.cc \
MEPP2QQ.h MEPP2QQ.cc \
MEPP2QQHiggs.h MEPP2QQHiggs.cc \
MEPP2Higgs.h MEPP2Higgs.cc\
MEPP2WH.h MEPP2WH.cc \
MEPP2ZH.h MEPP2ZH.cc \
MEPP2WJet.cc MEPP2WJet.h \
MEPP2ZJet.cc MEPP2ZJet.h \
MEPP2VV.cc MEPP2VV.h \
MEPP2VGamma.cc MEPP2VGamma.h \
MEPP2HiggsVBF.cc MEPP2HiggsVBF.h \
MEMinBias.h MEMinBias.cc
HwMEHadron_la_LDFLAGS = -module -version-info 2:1:0
pkglib_LTLIBRARIES += HwMEHadronFast.la
HwMEHadronFast_la_SOURCES = \
-MEQCD2to2Fast.h MEQCD2to2Fast.icc MEQCD2to2Fast.cc
+MEQCD2to2Fast.h MEQCD2to2Fast.cc
HwMEHadronFast_la_LDFLAGS = -module -version-info 2:0:0
diff --git a/MatrixElement/HardVertex.h b/MatrixElement/HardVertex.h
--- a/MatrixElement/HardVertex.h
+++ b/MatrixElement/HardVertex.h
@@ -1,139 +1,139 @@
// -*- C++ -*-
//
// HardVertex.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_HardVertex_H
#define HERWIG_HardVertex_H
//
// This is the declaration of the HardVertex class.
#include "ThePEG/Helicity/HelicityVertex.h"
#include "ProductionMatrixElement.h"
#include "HardVertex.fh"
// #include "HardVertex.xh"
namespace Herwig {
using ThePEG::Helicity::HelicityVertex;
using namespace ThePEG;
/** \ingroup Helicity
* \author Peter Richardson
*
* The HardVertex class is designed to implement the vertex for a
* hard interaction for the Herwig++ spin correlation algorithm.
* It inherits from the HelicityVertex class of ThePEG and implements
* the methods to calculate the \f$\rho\f$ and \f$D\f$ matrices.
*
* The ProductionMatrixElement class is used to store the matrix element
* and this class performs the calculations of the matrices.
*
* @see HelicityVertex
* @see ProductionMatrixElement
*/
class HardVertex: public HelicityVertex {
public:
/**
* Access to the matrix element
*/
//@{
/**
* Get the matrix element
*/
const ProductionMatrixElement & ME() const {
return _matrixelement;
}
/**
* Set the matrix element
*/
- inline void ME(const ProductionMatrixElement & in) const {
+ void ME(const ProductionMatrixElement & in) const {
_matrixelement.reset(in);
}
//@}
public:
/**
* Standard Init function used to initialize the interfaces.
*/
static void Init();
public:
/**
* Method to calculate the \f$\rho\f$ matrix for one of the outgoing particles
* @param iout The outgoing particle we are calculating the \f$\rho\f$ matrix for.
*/
virtual RhoDMatrix getRhoMatrix(int iout,bool) const;
/**
* Method to calculate the \f$D\f$ matrix for an incoming particle.
* @param in The incoming particle we are calculating the \f$D\f$ matrix for.
*/
virtual RhoDMatrix getDMatrix(int in) const;
private:
/**
* Describe a concrete class without persistent data.
*/
static NoPIOClassDescription<HardVertex> initHardVertex;
/**
* Private and non-existent assignment operator.
*/
HardVertex & operator=(const HardVertex &);
private:
/**
* Storage of the matrix element.
*/
ProductionMatrixElement _matrixelement;
};
}
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* The following template specialization informs ThePEG about the
* base class of HardVertex.
*/
template <>
struct BaseClassTrait<Herwig::HardVertex,1> {
/** Typedef of the base class of HardVertex. */
typedef ThePEG::Helicity::HelicityVertex NthBase;
};
/**
* The following template specialization informs ThePEG about the
* name of this class and the shared object where it is defined.
*/
template <>
struct ClassTraits<Herwig::HardVertex>
: public ClassTraitsBase<Herwig::HardVertex> {
/**
* Return the class name.
*/
static string className() { return "Herwig::HardVertex"; }
};
/** @endcond */
}
#endif /* HERWIG_HardVertex_H */
diff --git a/MatrixElement/HwME2to2Base.h b/MatrixElement/HwME2to2Base.h
--- a/MatrixElement/HwME2to2Base.h
+++ b/MatrixElement/HwME2to2Base.h
@@ -1,188 +1,193 @@
// -*- C++ -*-
//
// HwME2to2Base.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_ME2to2Base_H
#define HERWIG_ME2to2Base_H
// This is the declaration of the ME2to2Base class.
#include "ThePEG/MatrixElement/ME2to2Base.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
#include "ThePEG/Interface/Switch.fh"
namespace Herwig {
using namespace ThePEG;
/**
* HwME2to2Base can be used as a base class for any matrix element class
* implementing 2\f$\rightarrow\f$ 2 processes.
*
* It is heavily based on the ME2to2Base class of ThePEG but makes a number of
* changes to give us greater control over the masses of the outgoing
* particles so that they can be
* - set massless where required by gauge invariance
* - have their off-shell masses generated using the sophisticated approaches
* available in Herwig++.
*
* @see \ref HwME2to2BaseInterfaces "The interfaces"
* defined for HwME2to2Base.
* @see MEBase
*/
class HwME2to2Base: public ME2to2Base {
public:
/**
* Default constructor.
*/
- inline HwME2to2Base();
+ HwME2to2Base() : _massopt1(1), _massopt2(1), _rescaleOption(1) {}
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The number of internal degreed of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given 'nDim()' uniform
* random numbers in the interval ]0,1[. To help the phase space
* generator, the 'dSigHatDR()' should be a smooth function of these
* numbers, although this is not strictly necessary. Return
* false if the chosen points failed the kinematical cuts.
*/
virtual bool generateKinematics(const double * r);
/**
* Set the typed and momenta of the incoming and outgoing partons to
* be used in subsequent calls to me() and colourGeometries()
* according to the associated XComb object.
*/
virtual void setKinematics();
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* Standard Init function used to initialize the interfaces.
*/
static void Init();
protected:
/**
* Set the treatment of the outgoing masses
* @param first is the first outgoing particle
* @param iopt The option for the treatment of the mass
*/
- inline void massOption(bool first, unsigned int iopt);
+ void massOption(bool first, unsigned int iopt) {
+ if(first) _massopt1 = iopt;
+ else _massopt2 = iopt;
+ }
/**
* Set the treatment of the rescaling of the momenta for
* the matrix element calculation
* @param iopt The rescaling option
*/
- inline void rescalingOption(unsigned int iopt);
+ void rescalingOption(unsigned int iopt) {
+ _rescaleOption=iopt;
+ }
/**
* rescale the momenta for the computation of the helicity matrix element
*/
bool rescaleMomenta(const vector<Lorentz5Momentum> &,
const cPDVector &);
/**
* Access to the rescaled momenta
*/
- inline const vector<Lorentz5Momentum> & rescaledMomenta() const;
+ const vector<Lorentz5Momentum> & rescaledMomenta() const {
+ return _rescaledMomenta;
+ }
private:
/**
* Describe an abstract base class with persistent data.
*/
static AbstractClassDescription<HwME2to2Base> initHwME2to2Base;
/**
* Private and non-existent assignment operator.
*/
HwME2to2Base & operator=(const HwME2to2Base &);
private:
/**
* Treatment of the mass of the first particle
*/
unsigned int _massopt1;
/**
* Treatment of the mass of the second particle
*/
unsigned int _massopt2;
/**
* Produced to produce rescaled momenta
*/
unsigned int _rescaleOption;
/**
* Rescaled momenta for use in ME calculations
*/
vector<Lorentz5Momentum> _rescaledMomenta;
};
}
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* This template specialization informs Herwig about the
* base class of HwME2to2Base.
*/
template <>
struct BaseClassTrait<Herwig::HwME2to2Base,1>: public ClassTraitsType {
/** Typedef of the base class of HwME2to2Base. */
typedef ME2to2Base NthBase;
};
/**
* This template specialization informs Herwig about the name of the
* HwME2to2Base class.
*/
template <>
struct ClassTraits<Herwig::HwME2to2Base>
: public ClassTraitsBase<Herwig::HwME2to2Base> {
/** Return the class name. */
static string className() { return "Herwig::HwME2to2Base"; }
};
/** @endcond */
}
-#include "HwME2to2Base.icc"
-
#endif /* HERWIG_HwME2to2Base_H */
diff --git a/MatrixElement/HwME2to2Base.icc b/MatrixElement/HwME2to2Base.icc
deleted file mode 100644
--- a/MatrixElement/HwME2to2Base.icc
+++ /dev/null
@@ -1,31 +0,0 @@
-// -*- C++ -*-
-//
-// HwME2to2Base.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the HwME2to2Base class.
-//
-namespace Herwig {
-
-inline HwME2to2Base::HwME2to2Base()
- : _massopt1(1), _massopt2(1), _rescaleOption(1)
-{}
-
-inline void HwME2to2Base::massOption(bool first, unsigned int iopt) {
- if(first) _massopt1 = iopt;
- else _massopt2 = iopt;
-}
-
-inline void HwME2to2Base::rescalingOption(unsigned int iopt) {
- _rescaleOption=iopt;
-}
-
-inline const vector<Lorentz5Momentum> & HwME2to2Base::rescaledMomenta() const {
- return _rescaledMomenta;
-}
-}
diff --git a/MatrixElement/Lepton/MEee2HiggsVBF.h b/MatrixElement/Lepton/MEee2HiggsVBF.h
--- a/MatrixElement/Lepton/MEee2HiggsVBF.h
+++ b/MatrixElement/Lepton/MEee2HiggsVBF.h
@@ -1,113 +1,113 @@
// -*- C++ -*-
#ifndef HERWIG_MEee2HiggsVBF_H
#define HERWIG_MEee2HiggsVBF_H
//
// This is the declaration of the MEee2HiggsVBF class.
//
#include "Herwig++/MatrixElement/MEfftoffH.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEee2HiggsVBF class
*
* @see \ref MEee2HiggsVBFInterfaces "The interfaces"
* defined for MEee2HiggsVBF.
*/
class MEee2HiggsVBF: public MEfftoffH {
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() 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 {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ 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<MEee2HiggsVBF> initMEee2HiggsVBF;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEee2HiggsVBF & operator=(const MEee2HiggsVBF &);
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEee2HiggsVBF. */
template <>
struct BaseClassTrait<Herwig::MEee2HiggsVBF,1> {
/** Typedef of the first base class of MEee2HiggsVBF. */
typedef Herwig::MEfftoffH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEee2HiggsVBF class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEee2HiggsVBF>
: public ClassTraitsBase<Herwig::MEee2HiggsVBF> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEee2HiggsVBF"; }
/**
* The name of a file containing the dynamic library where the class
* MEee2HiggsVBF is implemented. It may also include several, space-separated,
* libraries if the class MEee2HiggsVBF 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 "HwMELepton.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEee2HiggsVBF_H */
diff --git a/MatrixElement/Lepton/MEee2ZH.h b/MatrixElement/Lepton/MEee2ZH.h
--- a/MatrixElement/Lepton/MEee2ZH.h
+++ b/MatrixElement/Lepton/MEee2ZH.h
@@ -1,112 +1,112 @@
// -*- C++ -*-
#ifndef HERWIG_MEee2ZH_H
#define HERWIG_MEee2ZH_H
//
// This is the declaration of the MEee2ZH class.
//
#include "Herwig++/MatrixElement/MEfftoVH.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEee2ZH class implements the matrix element
* for \f$e^+e^-\to Z^0h^0\f$.
*
* @see \ref MEee2ZHInterfaces "The interfaces"
* defined for MEee2ZH.
*/
class MEee2ZH: public MEfftoVH {
public:
/** @name Virtual functions required by the MEfftoVH class. */
//@{
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() 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 {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static NoPIOClassDescription<MEee2ZH> initMEee2ZH;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEee2ZH & operator=(const MEee2ZH &);
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEee2ZH. */
template <>
struct BaseClassTrait<Herwig::MEee2ZH,1> {
/** Typedef of the first base class of MEee2ZH. */
typedef Herwig::MEfftoVH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEee2ZH class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEee2ZH>
: public ClassTraitsBase<Herwig::MEee2ZH> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEee2ZH"; }
/**
* The name of a file containing the dynamic library where the class
* MEee2ZH is implemented. It may also include several, space-separated,
* libraries if the class MEee2ZH 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 "HwMELepton.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEee2ZH_H */
diff --git a/MatrixElement/Lepton/MEee2gZ2ll.cc b/MatrixElement/Lepton/MEee2gZ2ll.cc
--- a/MatrixElement/Lepton/MEee2gZ2ll.cc
+++ b/MatrixElement/Lepton/MEee2gZ2ll.cc
@@ -1,274 +1,273 @@
// -*- C++ -*-
//
// MEee2gZ2ll.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the MEee2gZ2ll class.
//
#include "MEee2gZ2ll.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
#include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "Herwig++/MatrixElement/HardVertex.h"
using namespace Herwig;
void MEee2gZ2ll::getDiagrams() const {
// specific the diagrams
tcPDPtr ep = getParticleData(ParticleID::eplus);
tcPDPtr em = getParticleData(ParticleID::eminus);
// setup the processes
for( int i =11;i<=16;++i) {
if(_allowed==0 || (_allowed==1 && i%2==1) || (_allowed==2&&i==11)
|| (_allowed==3&&i==13) || (_allowed==4&&i==15)) {
tcPDPtr lm = getParticleData(i);
tcPDPtr lp = lm->CC();
add(new_ptr((Tree2toNDiagram(2), em, ep, 1, _gamma, 3, lm, 3, lp, -1)));
add(new_ptr((Tree2toNDiagram(2), em, ep, 1, _Z0, 3, lm, 3, lp, -2)));
}
}
}
Energy2 MEee2gZ2ll::scale() const {
return sHat();
}
unsigned int MEee2gZ2ll::orderInAlphaS() const {
return 0;
}
unsigned int MEee2gZ2ll::orderInAlphaEW() const {
return 2;
}
Selector<MEBase::DiagramIndex>
MEee2gZ2ll::diagrams(const DiagramVector & diags) const {
double lastCont(0.5),lastBW(0.5);
if ( lastXCombPtr() ) {
lastCont = meInfo()[0];
lastBW = meInfo()[1];
}
Selector<DiagramIndex> sel;
for ( DiagramIndex i = 0; i < diags.size(); ++i ) {
if ( diags[i]->id() == -1 ) sel.insert(lastCont, i);
else if ( diags[i]->id() == -2 ) sel.insert(lastBW, i);
}
return sel;
}
Selector<const ColourLines *>
MEee2gZ2ll::colourGeometries(tcDiagPtr) const {
static ColourLines ctST(" ");
Selector<const ColourLines *> sel;
sel.insert(1.0, &ctST);
return sel;
}
void MEee2gZ2ll::persistentOutput(PersistentOStream & os) const {
os << _allowed << _theFFZVertex << _theFFPVertex << _gamma << _Z0;
}
void MEee2gZ2ll::persistentInput(PersistentIStream & is, int) {
is >> _allowed >> _theFFZVertex >> _theFFPVertex >> _gamma >> _Z0;
}
ClassDescription<MEee2gZ2ll> MEee2gZ2ll::initMEee2gZ2ll;
// Definition of the static class description member.
void MEee2gZ2ll::Init() {
static Switch<MEee2gZ2ll,int> interfaceallowed
("Allowed",
"Allowed outgoing leptons",
&MEee2gZ2ll::_allowed, 0, false, false);
static SwitchOption interfaceallowedAll
(interfaceallowed,
"All",
"Allow all leptons as outgoing particles",
0);
static SwitchOption interfaceallowedCharged
(interfaceallowed,
"Charged",
"Only charged leptons as outgoing particles",
1);
static SwitchOption interfaceallowedElectron
(interfaceallowed,
"Electron",
"Only the electron and positron as outgoing leptons",
2);
static SwitchOption interfaceallowedMuon
(interfaceallowed,
"Muon",
"Only muons as outgoing particles",
3);
static SwitchOption interfaceallowedTau
(interfaceallowed,
"Tau",
"Only taus as outgoing particles",
4);
static ClassDocumentation<MEee2gZ2ll> documentation
("The MEee2gZ2ll class implements the matrix element for"
"e+e- to leptons via Z and photon exchange using helicity amplitude"
"techniques");
}
double MEee2gZ2ll::me2() const {
int ie(0),ip(1),ilp(2),ilm(3);
// get the order right
if(mePartonData()[0]->id()!=11) swap(ie,ip);
if(mePartonData()[2]->id()<0) swap(ilm,ilp);
vector<SpinorWaveFunction> fin,aout;
vector<SpinorBarWaveFunction> ain,fout;
SpinorWaveFunction ein (meMomenta()[ie ],mePartonData()[ie ],incoming);
SpinorBarWaveFunction pin (meMomenta()[ip ],mePartonData()[ip ],incoming);
SpinorBarWaveFunction ilmout(meMomenta()[ilm],mePartonData()[ilm],outgoing);
SpinorWaveFunction ilpout(meMomenta()[ilp],mePartonData()[ilp],outgoing);
for(unsigned int ix=0;ix<2;++ix) {
ein.reset(ix) ;fin.push_back( ein );
pin.reset(ix) ;ain.push_back( pin );
ilmout.reset(ix);fout.push_back(ilmout);
ilpout.reset(ix);aout.push_back(ilpout);
}
// compute the matrix element
double me,lastCont,lastBW;
HelicityME(fin,ain,fout,aout,me,lastCont,lastBW);
// save the components
DVector save;
save.push_back(lastCont);
save.push_back(lastBW);
meInfo(save);
// return the answer
return me;
}
ProductionMatrixElement MEee2gZ2ll::HelicityME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorWaveFunction> & aout,
double & me,double & cont,
double & BW ) const {
// the particles should be in the order
// for the incoming
// 0 incoming fermion (u spinor)
// 1 incoming antifermion (vbar spinor)
// for the outgoing
// 0 outgoing fermion (ubar spinor)
// 1 outgoing antifermion (v spinor)
// me to be returned
ProductionMatrixElement output(PDT::Spin1Half,PDT::Spin1Half,
PDT::Spin1Half,PDT::Spin1Half);
// // wavefunctions for the intermediate particles
VectorWaveFunction interZ,interG;
// temporary storage of the different diagrams
Complex diag1,diag2;
// sum over helicities to get the matrix element
unsigned int inhel1,inhel2,outhel1,outhel2;
- double total[3]={0.,0.};
+ double total[3]={0.,0.,0.};
for(inhel1=0;inhel1<2;++inhel1) {
for(inhel2=0;inhel2<2;++inhel2) {
// intermediate Z
interZ = _theFFZVertex->evaluate(sHat(),1,_Z0,fin[inhel1],ain[inhel2]);
// intermediate photon
interG = _theFFPVertex->evaluate(sHat(),1,_gamma,fin[inhel1],ain[inhel2]);
for(outhel1=0;outhel1<2;++outhel1) {
for(outhel2=0;outhel2<2;++outhel2) {
// first the Z exchange diagram
diag1 = _theFFZVertex->evaluate(sHat(),aout[outhel2],fout[outhel1],
interZ);
// then the photon exchange diagram
diag2 = _theFFPVertex->evaluate(sHat(),aout[outhel2],fout[outhel1],
interG);
// add up squares of individual terms
- total[1] += real(diag1*conj(diag1));
- total[2] += real(diag2*conj(diag2));
- diag1+=diag2;
+ total[1] += norm(diag1);
+ total[2] += norm(diag2);
// the full thing including interference
- diag1 +=diag2;
- total[0] += real(diag1*conj(diag1));
- output(inhel1,inhel2,outhel1,outhel2)=diag1;
+ diag1 += diag2;
+ total[0] += norm(diag1);
+ output(inhel1,inhel2,outhel1,outhel2) = diag1;
}
}
}
}
// results
for(int ix=0;ix<3;++ix){total[ix]*=0.25;}
cont = total[2];
BW = total[1];
me = total[0];
return output;
}
void MEee2gZ2ll::constructVertex(tSubProPtr sub) {
// extract the particles in the hard process
ParticleVector hard;
hard.push_back(sub->incoming().first);hard.push_back(sub->incoming().second);
hard.push_back(sub->outgoing()[0]);hard.push_back(sub->outgoing()[1]);
if(hard[0]->id()<hard[1]->id()) swap(hard[0],hard[1]);
if(hard[2]->id()<hard[3]->id()) swap(hard[2],hard[3]);
vector<SpinorWaveFunction> fin,aout;
vector<SpinorBarWaveFunction> ain,fout;
SpinorWaveFunction( fin ,hard[0],incoming,false,true);
SpinorBarWaveFunction(ain ,hard[1],incoming,false,true);
SpinorBarWaveFunction(fout,hard[2],outgoing,true ,true);
SpinorWaveFunction( aout,hard[3],outgoing,true ,true);
// calculate the matrix element
double me,cont,BW;
ProductionMatrixElement prodme=HelicityME(fin,ain,fout,aout,me,cont,BW);
// construct the vertex
HardVertexPtr hardvertex=new_ptr(HardVertex());
// set the matrix element for the vertex
hardvertex->ME(prodme);
// set the pointers and to and from the vertex
for(unsigned int ix=0;ix<4;++ix) {
dynamic_ptr_cast<SpinfoPtr>(hard[ix]->spinInfo())->setProductionVertex(hardvertex);
}
}
void MEee2gZ2ll::doinit() {
ME2to2Base::doinit();
// set the particle data objects
_Z0=getParticleData(ThePEG::ParticleID::Z0);
_gamma=getParticleData(ThePEG::ParticleID::gamma);
// cast the SM pointer to the Herwig SM pointer
tcHwSMPtr hwsm= dynamic_ptr_cast<tcHwSMPtr>(standardModel());
// do the initialisation
if(hwsm) {
_theFFZVertex = hwsm->vertexFFZ();
_theFFPVertex = hwsm->vertexFFP();
}
else {
throw InitException() << "Wrong type of StandardModel object in "
<< "MEee2gZ2ll::doinit() the Herwig++ version must be used"
<< Exception::runerror;
}
}
void MEee2gZ2ll::rebind(const TranslationMap & trans)
{
_theFFZVertex = trans.translate(_theFFZVertex);
_theFFPVertex = trans.translate(_theFFPVertex);
_Z0 = trans.translate(_Z0);
_gamma = trans.translate(_gamma);
ME2to2Base::rebind(trans);
}
IVector MEee2gZ2ll::getReferences() {
IVector ret = ME2to2Base::getReferences();
ret.push_back(_theFFZVertex);
ret.push_back(_theFFPVertex);
ret.push_back(_Z0 );
ret.push_back(_gamma );
return ret;
}
diff --git a/MatrixElement/Lepton/MEee2gZ2ll.h b/MatrixElement/Lepton/MEee2gZ2ll.h
--- a/MatrixElement/Lepton/MEee2gZ2ll.h
+++ b/MatrixElement/Lepton/MEee2gZ2ll.h
@@ -1,278 +1,278 @@
// -*- C++ -*-
//
// MEee2gZ2ll.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEee2gZ2ll_H
#define HERWIG_MEee2gZ2ll_H
//
// This is the declaration of the MEee2gZ2ll class.
//
#include "ThePEG/MatrixElement/ME2to2Base.h"
#include "Herwig++/Models/StandardModel/StandardModel.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEee2gZ2ll class provides the matrix element for
* \f$e^+e^-\to\ell^+\ell^-\f$. N.B. for the production of \f$e^+e^-\f$
* only the \f$s\f$-channel Z and photon diagrams are included.
*
* @see \ref MEee2gZ2llInterfaces "The interfaces"
* defined for MEee2gZ2ll.
*/
class MEee2gZ2ll: public ME2to2Base {
public:
/**
* The default constructor.
*/
- inline MEee2gZ2ll() : _allowed(0) {}
+ MEee2gZ2ll() : _allowed(0) {}
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans)
;
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* Member to calculate the matrix element
* @param fin Spinors for incoming fermion
* @param ain Spinors for incoming antifermion
* @param fout Spinors for outgoing fermion
* @param aout Spinors for outgong antifermion
* @param me Spin summed Matrix element
* @param cont The continuum piece of the matrix element
* @param BW The Z piece of the matrix element
*/
ProductionMatrixElement HelicityME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorWaveFunction> & aout,
double & me,
double & cont,
double & BW ) const;
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEee2gZ2ll> initMEee2gZ2ll;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEee2gZ2ll & operator=(const MEee2gZ2ll &);
private:
/**
* Pointer to the fermion-antifermion Z vertex
*/
AbstractFFVVertexPtr _theFFZVertex;
/**
* Pointer to the fermion-antifermion photon vertex
*/
AbstractFFVVertexPtr _theFFPVertex;
/**
* Pointer to the particle data object for the Z
*/
PDPtr _Z0;
/**
* Pointer to the particle data object for the photon
*/
PDPtr _gamma;
/**
* The allowed outgoing
*/
int _allowed;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEee2gZ2ll. */
template <>
struct BaseClassTrait<Herwig::MEee2gZ2ll,1> {
/** Typedef of the first base class of MEee2gZ2ll. */
typedef ME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEee2gZ2ll class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEee2gZ2ll>
: public ClassTraitsBase<Herwig::MEee2gZ2ll> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEee2gZ2ll"; }
/**
* The name of a file containing the dynamic library where the class
* MEee2gZ2ll is implemented. It may also include several, space-separated,
* libraries if the class MEee2gZ2ll 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 "HwMELepton.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEee2gZ2ll_H */
diff --git a/MatrixElement/Lepton/MEee2gZ2qq.h b/MatrixElement/Lepton/MEee2gZ2qq.h
--- a/MatrixElement/Lepton/MEee2gZ2qq.h
+++ b/MatrixElement/Lepton/MEee2gZ2qq.h
@@ -1,287 +1,287 @@
// -*- C++ -*-
//
// MEee2gZ2qq.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEee2gZ2qq_H
#define HERWIG_MEee2gZ2qq_H
//
// This is the declaration of the MEee2gZ2qq class.
//
#include "Herwig++/MatrixElement/HwME2to2Base.h"
#include "Herwig++/Models/StandardModel/StandardModel.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/Rebinder.h"
#include "Herwig++/MatrixElement/ProductionMatrixElement.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEee2gZ2qq class implements the matrix element
* for \f$e^+e^-\to Z/\gamma \to q\bar{q}\f$ including spin correlations.
* The class includes greater control over the type of quark produced than is available
* in the corresponding matrix element from ThePEG, in addition to spin correlations.
*
* @see \ref MEee2gZ2qqInterfaces "The interfaces"
* defined for MEee2gZ2qq.
*/
class MEee2gZ2qq: public HwME2to2Base {
public:
/**
* The default constructor.
*/
- inline MEee2gZ2qq() : _minflav(1), _maxflav(5), _massopt(1)
+ MEee2gZ2qq() : _minflav(1), _maxflav(5), _massopt(1)
{}
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the order in \f$\alpha_S\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaS() const;
/**
* Return the order in \f$\alpha_{EW}\f$ in which this matrix
* element is given.
*/
virtual unsigned int orderInAlphaEW() const;
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* Add all possible diagrams with the add() function.
*/
virtual void getDiagrams() const;
/**
* Get diagram selector. With the information previously supplied with the
* setKinematics method, a derived class may optionally
* override this method to weight the given diagrams with their
* (although certainly not physical) relative probabilities.
* @param dv the diagrams to be weighted.
* @return a Selector relating the given diagrams to their weights.
*/
virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
* @param diag the diagram chosen.
* @return the possible colour geometries weighted by their
* relative probabilities.
*/
virtual Selector<const ColourLines *>
colourGeometries(tcDiagPtr diag) const;
/**
* Construct the vertex of spin correlations.
*/
virtual void constructVertex(tSubProPtr);
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 {return new_ptr(*this);}
+ 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 {return new_ptr(*this);}
+ virtual IBPtr fullclone() const {return new_ptr(*this);}
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans)
;
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* Member to calculate the matrix element
* @param fin Spinors for incoming fermion
* @param ain Spinors for incoming antifermion
* @param fout Spinors for outgoing fermion
* @param aout Spinors for outgong antifermion
* @param me Spin summed Matrix element
* @param cont The continuum piece of the matrix element
* @param BW The Z piece of the matrix element
*/
ProductionMatrixElement HelicityME(vector<SpinorWaveFunction> & fin,
vector<SpinorBarWaveFunction> & ain,
vector<SpinorBarWaveFunction> & fout,
vector<SpinorWaveFunction> & aout,
double & me,
double & cont,
double & BW ) const;
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEee2gZ2qq> initMEee2gZ2qq;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEee2gZ2qq & operator=(const MEee2gZ2qq &);
private:
/**
* Pointer to the fermion-antifermion Z vertex
*/
AbstractFFVVertexPtr _theFFZVertex;
/**
* Pointer to the fermion-antifermion photon vertex
*/
AbstractFFVVertexPtr _theFFPVertex;
/**
* Pointer to the particle data object for the Z
*/
PDPtr _Z0;
/**
* Pointer to the particle data object for the photon
*/
PDPtr _gamma;
/**
* The minimum PDG of the quarks to be produced
*/
int _minflav;
/**
* The maximum PDG of the quarks to be produced
*/
int _maxflav;
/**
* Option for the treatment of the top quark mass
*/
unsigned int _massopt;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEee2gZ2qq. */
template <>
struct BaseClassTrait<Herwig::MEee2gZ2qq,1> {
/** Typedef of the first base class of MEee2gZ2qq. */
typedef Herwig::HwME2to2Base NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEee2gZ2qq class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEee2gZ2qq>
: public ClassTraitsBase<Herwig::MEee2gZ2qq> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEee2gZ2qq"; }
/** Return the name(s) of the shared library (or libraries) be loaded to get
* access to the MEee2gZ2qq class and any other class on which it depends
* (except the base class). */
static string library() { return "HwMELepton.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEee2gZ2qq_H */
diff --git a/MatrixElement/Makefile.am b/MatrixElement/Makefile.am
--- a/MatrixElement/Makefile.am
+++ b/MatrixElement/Makefile.am
@@ -1,11 +1,10 @@
SUBDIRS = General Lepton Hadron DIS Powheg Gamma
noinst_LTLIBRARIES = libHwME.la
libHwME_la_SOURCES = \
-HwME2to2Base.h HwME2to2Base.icc HwME2to2Base.cc \
+HwME2to2Base.h HwME2to2Base.cc \
MEfftoVH.h MEfftoVH.cc \
MEfftoffH.h MEfftoffH.cc \
HardVertex.fh HardVertex.h HardVertex.cc \
-ProductionMatrixElement.h ProductionMatrixElement.icc \
-ProductionMatrixElement.cc
+ProductionMatrixElement.h ProductionMatrixElement.cc
diff --git a/MatrixElement/Powheg/MEPP2HiggsPowheg.h b/MatrixElement/Powheg/MEPP2HiggsPowheg.h
--- a/MatrixElement/Powheg/MEPP2HiggsPowheg.h
+++ b/MatrixElement/Powheg/MEPP2HiggsPowheg.h
@@ -1,460 +1,460 @@
// -*- C++ -*-
//
// MEPP2HiggsPowheg.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEPP2HiggsPowheg_H
#define HERWIG_MEPP2HiggsPowheg_H
//
// This is the declaration of the MEPP2HiggsPowheg class.
//
#include "Herwig++/MatrixElement/Hadron/MEPP2Higgs.h"
#include "ThePEG/PDF/BeamParticleData.h"
namespace Herwig {
using namespace ThePEG;
using namespace ThePEG::Helicity;
/**
* The MEPP2HiggsPowheg class implements the matrix element for the process
* pp->Higgs with different Higgs shape prescriptions (see details in hep-ph/9505211)
* and the NLL corrected Higgs width (see details in the FORTRAN HERWIG manual).
*
* @see \ref MEPP2HiggsPowhegInterfaces "The interfaces"
* defined for MEPP2HiggsPowheg.
*/
class MEPP2HiggsPowheg: public MEPP2Higgs {
public:
/**
* The default constructor.
*/
MEPP2HiggsPowheg();
public:
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* The matrix element for the kinematical configuration
* previously provided by the last call to setKinematics(), suitably
* scaled by sHat() to give a dimension-less number.
* @return the matrix element scaled with sHat() to give a
* dimensionless number.
*/
virtual double me2() const;
/**
* Generate internal degrees of freedom given nDim() uniform
* random numbers in the interval \f$ ]0,1[ \f$. To help the phase space
* generator, the dSigHatDR should be a smooth function of these
* numbers, although this is not strictly necessary.
* @param r a pointer to the first of nDim() consecutive random numbers.
* @return true if the generation succeeded, otherwise false.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degrees of freedom used in the matrix
* element.
*/
virtual int nDim() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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();
/**
* Function to set the born variables.
*/
void get_born_variables() const;
/**
* Calculate the correction weight with which leading-order
* configurations are re-weighted.
*/
double NLOweight() const;
/**
* Invariant required for the evaluation of next-to-leading order
* quantities (Frixione et al. NPB.383 WZ production at colliders).
*/
Energy2 s(double xt, double y) const {
return p2_/x(xt,y);
}
/**
* Invariant required for the evaluation of next-to-leading order
* quantities (Frixione et al. NPB.383 WZ production at colliders).
*/
Energy2 tk(double xt, double y) const {
double x_xt_y(x(xt,y));
return -0.5*p2_/x_xt_y*(1.- x_xt_y)*(1.-y);
}
/**
* Invariant required for the evaluation of next-to-leading order
* quantities (Frixione et al. NPB.383 WZ production at colliders).
*/
Energy2 uk(double xt, double y) const {
double x_xt_y(x(xt,y));
return -0.5*p2_/x_xt_y*(1.- x_xt_y)*(1.+y);
}
/**
* Calculate the minimum of \f$x\f$.
*/
double xbar(double y) const;
/**
* Calculate auxiliary function of \f$\bar{x}(y)\f$, \f$\bar{\eta}(y)\f$.
*/
double etabar(double y) const;
/**
* Calculate the variable \f$x=p^{2}/s\f$ from the integration variables.
*/
double x(double xt, double y) const {
double x0(xbar(y));
return x0+(1.-x0)*xt;
}
/**
* Calculate the momentum fraction of the plus parton.
*/
double xp(double x, double y) const;
/**
* Calculate the momentum fraction of the minus parton.
*/
double xm(double x, double y) const;
/**
* Calculate the ratio of the NLO luminosity to the LO
* luminosity function for the \f$q\bar{q}\f$ initiated channel.
*/
double Lhat_ab(tcPDPtr a, tcPDPtr b, double x, double y) const;
/**
* Calculate the universal soft-virtual contribution to the NLO weight.
*/
double Vtilde_universal() const;
/**
* Function for calculation of the \f$gg\f$ initiated real
* contribution.
*/
double Ctilde_Ltilde_gg_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ctilde_Ltilde_qg_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* Function for calculation of the \f$gq\f$ initiated real
* contribution.
*/
double Ctilde_Ltilde_gq_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* The regular part of the virtual correction matrix element(s)
*/
double M_V_regular() const;
/**
* The matrix element q + qbar -> n + g times tk*uk
*/
Energy2 t_u_M_R_qqbar(double xt, double y) const;
/**
* The matrix element qbar + q -> n + g times tk*uk
*/
Energy2 t_u_M_R_qbarq(double xt, double y) const;
/**
* The matrix element g + g -> n + g times tk*uk
*/
Energy2 t_u_M_R_gg(double xt, double y) const;
/**
* The matrix element q + g -> n + q times tk*uk
*/
Energy2 t_u_M_R_qg(double xt, double y) const;
/**
* The matrix element g + q -> n + q times tk*uk
*/
Energy2 t_u_M_R_gq(double xt, double y) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Rtilde_Ltilde_qqbar_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* Function for calculation of the \f$\bar{q}q\f$ initiated real
* contribution.
*/
double Rtilde_Ltilde_qbarq_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* Function for calculation of the \f$qq\f$
* initiated real contribution.
*/
double Rtilde_Ltilde_gg_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Rtilde_Ltilde_qg_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
/**
* Function for calculation of the \f$gq\f$ initiated real
* contribution.
*/
double Rtilde_Ltilde_gq_on_x(tcPDPtr a,tcPDPtr b,double xt,double y) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2HiggsPowheg> initMEPP2HiggsPowheg;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2HiggsPowheg & operator=(const MEPP2HiggsPowheg &);
private:
/**
* Parameters for the NLO weight
*/
//@{
/**
* The colour factors
*/
const double CF_ , CA_ , TR_;
/**
* Number of light flavours (in the beta function beta0_)
*/
const int nlf_;
/**
* (Proportional to) The beta function
*/
const double beta0_;
/**
* Whether to generate the positive, negative or leading order contribution
*/
unsigned int contrib_;
/**
* Whether to use a fixed or a running QCD coupling for the NLO weight
*/
unsigned int nlo_alphaS_opt_;
/**
* The value of alphaS to use for the nlo weight if nlo_alphaS_opt_=1
*/
double fixed_alphaS_;
//@}
/**
* Radiation variables
*/
//@{
/**
* The \f$\tilde{x}\f$ variable
*/
double xt_;
/**
* The \f$y\f$ angular variable
*/
double y_;
//@}
/**
* Values of the PDF's before radiation
*/
mutable double lo_lumi_;
/**
* The value of the leading order gg->H matrix element
*/
mutable double lo_ggME_;
/**
* The invariant mass of the lo final state.
*/
mutable Energy2 p2_ ;
/**
* The invariant mass of the lo final state.
*/
mutable Energy2 s2_ ;
/**
* The momentum fraction of the plus parton in the Born process
*/
mutable double xbp_;
/**
* The momentum fraction of the minus parton in the Born process
*/
mutable double xbm_;
/**
* The sqrt(1-xbp_)
*/
mutable double etabarp_;
/**
* The sqrt(1-xbm_)
*/
mutable double etabarm_;
/**
* The ParticleData object for the plus lo parton
*/
mutable tcPDPtr a_lo_;
/**
* The ParticleData object for the minus lo parton
*/
mutable tcPDPtr b_lo_;
/**
* The BeamParticleData object for the plus direction hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer hadron_A_;
/**
* The BeamParticleData object for the minus direction hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer hadron_B_;
/**
* The value of \f$\alpha_S\f$ used for the calculation
*/
mutable double alphaS_;
/**
* Selects a dynamic (sHat) or fixed factorization scale
*/
unsigned int scaleopt_;
/**
* The factorization scale
*/
Energy mu_F_;
/**
* The renormalization scale
*/
Energy mu_UV_;
/**
* Prefactor if variable scale used
*/
double scaleFact_;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the base classes of MEPP2HiggsPowheg. */
template <>
struct BaseClassTrait<Herwig::MEPP2HiggsPowheg,1> {
/** Typedef of the first base class of MEPP2HiggsPowheg. */
typedef Herwig::MEPP2Higgs NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2HiggsPowheg class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2HiggsPowheg>
: public ClassTraitsBase<Herwig::MEPP2HiggsPowheg> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2HiggsPowheg"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2HiggsPowheg is implemented. It may also include several, space-separated,
* libraries if the class MEPP2HiggsPowheg 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 "HwMEHadron.so HwPowhegME.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2HiggsPowheg_H */
diff --git a/MatrixElement/Powheg/MEPP2WHPowheg.h b/MatrixElement/Powheg/MEPP2WHPowheg.h
--- a/MatrixElement/Powheg/MEPP2WHPowheg.h
+++ b/MatrixElement/Powheg/MEPP2WHPowheg.h
@@ -1,427 +1,427 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2WHPowheg_H
#define HERWIG_MEPP2WHPowheg_H
//
// This is the declaration of the MEPP2WHPowheg class.
//
#include "Herwig++/MatrixElement/Hadron/MEPP2WH.h"
#include "ThePEG/PDF/BeamParticleData.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEPP2WHPowheg class provides the next-to-leading order
* matrix elements for \f$W^\pm\f$ in assoication with a Higgs boson
* in the PoOWHEG scheme.
*
* @see \ref MEPP2WHPowhegInterfaces "The interfaces"
* defined for MEPP2WHPowheg.
*/
class MEPP2WHPowheg: public MEPP2WH {
public:
/**
* Default constructor
*/
MEPP2WHPowheg();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degreed of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given 'nDim()' uniform
* random numbers in the interval ]0,1[. To help the phase space
* generator, the 'dSigHatDR()' should be a smooth function of these
* numbers, although this is not strictly necessary. Return
* false if the chosen points failed the kinematical cuts.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the matrix element for the kinematical configuation
* previously provided by the last call to setKinematics(). Uses
* me().
*/
virtual CrossSection dSigHatDR() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Calculate the correction weight with which leading-order
* configurations are re-weighted.
*/
double NLOweight() const;
/**
* Calculate the variable \f$x=M_{B}^2/s\f$ from the integration variables.
*/
double x(double xt, double v) const;
/**
* Calculate the momentum fraction of the first parton.
*/
double x_a(double x, double v) const;
/**
* Calculate the momentum fraction of second parton.
*/
double x_b(double x, double v) const;
/**
* Calculate the minimum of \f$x\f$.
*/
double xbar(double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$qg\f$ initiated channel.
*/
double Ltilde_qg(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$g\bar{q}\f$ initiated channel.
*/
double Ltilde_gq(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$q\bar{q}\f$ initiated channel.
*/
double Ltilde_qq(double x, double v) const;
/**
* Calculate the soft-virtual contribution to the NLO weight.
*/
double Vtilde_qq() const;
/**
* Function for calculation of the \f$g\bar{q}\f$ and \f$g\bar{q}\f$
* initiated real contribution.
*/
double Ccalbar_qg(double x) const;
/**
* Function for calculation of the \f$qg\f$
* initiated real contribution.
*/
double Fcal_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_qq(double x, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ftilde_qg(double xt, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_gq(double xt, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_qq(double xt, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ctilde_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_qq(double x, double v) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2WHPowheg> initMEPP2WHPowheg;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2WHPowheg & operator=(const MEPP2WHPowheg &);
private:
/**
* The momentum fraction of the first parton in the Born process
*/
mutable double _xb_a;
/**
* The momentum fraction of the second parton in the Born process
*/
mutable double _xb_b;
/**
* The ParticleData object for the first parton in the Born process
*/
mutable tcPDPtr _parton_a;
/**
* The ParticleData object for the second parton in the Born process
*/
mutable tcPDPtr _parton_b;
/**
* The BeamParticleData object for the first hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_A;
/**
* The BeamParticleData object for the second hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_B;
/**
* the ParticleData object for the gluon
*/
tcPDPtr _gluon;
/**
* The \f$T_R\f$ colour factor
*/
const double _TR;
/**
* The \f$C_F\f$ colour factor
*/
const double _CF;
/**
* The value of \f$\frac{\alpha_S}{2\pi}\f$ used for the calculation
*/
mutable double _alphaS2Pi;
/**
* The mass squared of the lepton pair
*/
mutable Energy2 _mll2;
/**
* The renormalization/factorization scale
*/
mutable Energy2 _mu2;
/**
* Parameters for the NLO weight
*/
//@{
/**
* Whether to generate the positive, negative or leading order contribution
*/
unsigned int _contrib;
/**
* Whether to use a fixed or a running QCD coupling for the NLO weight
*/
unsigned int _nlo_alphaS_opt;
/**
* The value of alphaS to use for the nlo weight if _nloalphaSopt=1
*/
double _fixed_alphaS;
/**
* The magnitude of the correction term to reduce the negative contribution
*/
double _a;
/**
* The power of the correction term to reduce the negative contribution
*/
double _p;
/**
* Cut-off for the correction function
*/
double _eps;
//@}
/**
* Choice of the scale
*/
//@{
/**
* Type of scale
*/
unsigned int _scaleopt;
/**
* Fixed scale if used
*/
Energy _fixedScale;
/**
* Prefactor if variable scale used
*/
double _scaleFact;
//@}
/**
* Radiation variables
*/
//@{
/**
* The \f$\tilde{x}\f$ variable
*/
double _xt;
/**
* The \f$v\f$ angular variable
*/
double _v;
//@}
/**
* Values of the PDF's before radiation
*/
//@{
/**
* For the quark
*/
mutable double _oldq;
/**
* For the antiquark
*/
mutable double _oldqbar;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2WHPowheg. */
template <>
struct BaseClassTrait<Herwig::MEPP2WHPowheg,1> {
/** Typedef of the first base class of MEPP2WHPowheg. */
typedef Herwig::MEPP2WH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2WHPowheg class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2WHPowheg>
: public ClassTraitsBase<Herwig::MEPP2WHPowheg> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2WHPowheg"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2WHPowheg is implemented. It may also include several, space-separated,
* libraries if the class MEPP2WHPowheg 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 "HwMEHadron.so HwPowhegME.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2WHPowheg_H */
diff --git a/MatrixElement/Powheg/MEPP2ZHPowheg.h b/MatrixElement/Powheg/MEPP2ZHPowheg.h
--- a/MatrixElement/Powheg/MEPP2ZHPowheg.h
+++ b/MatrixElement/Powheg/MEPP2ZHPowheg.h
@@ -1,425 +1,425 @@
// -*- C++ -*-
#ifndef HERWIG_MEPP2ZHPowheg_H
#define HERWIG_MEPP2ZHPowheg_H
//
// This is the declaration of the MEPP2ZHPowheg class.
//
#include "Herwig++/MatrixElement/Hadron/MEPP2ZH.h"
#include "ThePEG/PDF/BeamParticleData.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEPP2ZHPowheg class implements the matrix element
* for \f$q\bar{q}\to Z^0h^0\f$.
*
* @see \ref MEPP2ZHPowhegInterfaces "The interfaces"
* defined for MEPP2ZHPowheg.
*/
class MEPP2ZHPowheg: public MEPP2ZH {
public:
/**
* The default constructor.
*/
MEPP2ZHPowheg();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degreed of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given 'nDim()' uniform
* random numbers in the interval ]0,1[. To help the phase space
* generator, the 'dSigHatDR()' should be a smooth function of these
* numbers, although this is not strictly necessary. Return
* false if the chosen points failed the kinematical cuts.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the matrix element for the kinematical configuation
* previously provided by the last call to setKinematics(). Uses
* me().
*/
virtual CrossSection dSigHatDR() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Calculate the correction weight with which leading-order
* configurations are re-weighted.
*/
double NLOweight() const;
/**
* Calculate the variable \f$x=M_{B}^2/s\f$ from the integration variables.
*/
double x(double xt, double v) const;
/**
* Calculate the momentum fraction of the first parton.
*/
double x_a(double x, double v) const;
/**
* Calculate the momentum fraction of second parton.
*/
double x_b(double x, double v) const;
/**
* Calculate the minimum of \f$x\f$.
*/
double xbar(double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$qg\f$ initiated channel.
*/
double Ltilde_qg(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$g\bar{q}\f$ initiated channel.
*/
double Ltilde_gq(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$q\bar{q}\f$ initiated channel.
*/
double Ltilde_qq(double x, double v) const;
/**
* Calculate the soft-virtual contribution to the NLO weight.
*/
double Vtilde_qq() const;
/**
* Function for calculation of the \f$g\bar{q}\f$ and \f$g\bar{q}\f$
* initiated real contribution.
*/
double Ccalbar_qg(double x) const;
/**
* Function for calculation of the \f$qg\f$
* initiated real contribution.
*/
double Fcal_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_qq(double x, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ftilde_qg(double xt, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_gq(double xt, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_qq(double xt, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ctilde_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_qq(double x, double v) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEPP2ZHPowheg> initMEPP2ZHPowheg;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEPP2ZHPowheg & operator=(const MEPP2ZHPowheg &);
private:
/**
* The momentum fraction of the first parton in the Born process
*/
mutable double _xb_a;
/**
* The momentum fraction of the second parton in the Born process
*/
mutable double _xb_b;
/**
* The ParticleData object for the first parton in the Born process
*/
mutable tcPDPtr _parton_a;
/**
* The ParticleData object for the second parton in the Born process
*/
mutable tcPDPtr _parton_b;
/**
* The BeamParticleData object for the first hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_A;
/**
* The BeamParticleData object for the second hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_B;
/**
* the ParticleData object for the gluon
*/
tcPDPtr _gluon;
/**
* The \f$T_R\f$ colour factor
*/
const double _TR;
/**
* The \f$C_F\f$ colour factor
*/
const double _CF;
/**
* The value of \f$\frac{\alpha_S}{2\pi}\f$ used for the calculation
*/
mutable double _alphaS2Pi;
/**
* The mass squared of the lepton pair
*/
mutable Energy2 _mll2;
/**
* The renormalization/factorization scale
*/
mutable Energy2 _mu2;
/**
* Parameters for the NLO weight
*/
//@{
/**
* Whether to generate the positive, negative or leading order contribution
*/
unsigned int _contrib;
/**
* Whether to use a fixed or a running QCD coupling for the NLO weight
*/
unsigned int _nlo_alphaS_opt;
/**
* The value of alphaS to use for the nlo weight if _nloalphaSopt=1
*/
double _fixed_alphaS;
/**
* The magnitude of the correction term to reduce the negative contribution
*/
double _a;
/**
* The power of the correction term to reduce the negative contribution
*/
double _p;
/**
* Cut-off for the correction function
*/
double _eps;
//@}
/**
* Choice of the scale
*/
//@{
/**
* Type of scale
*/
unsigned int _scaleopt;
/**
* Fixed scale if used
*/
Energy _fixedScale;
/**
* Prefactor if variable scale used
*/
double _scaleFact;
//@}
/**
* Radiation variables
*/
//@{
/**
* The \f$\tilde{x}\f$ variable
*/
double _xt;
/**
* The \f$v\f$ angular variable
*/
double _v;
//@}
/**
* Values of the PDF's before radiation
*/
//@{
/**
* For the quark
*/
mutable double _oldq;
/**
* For the antiquark
*/
mutable double _oldqbar;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEPP2ZHPowheg. */
template <>
struct BaseClassTrait<Herwig::MEPP2ZHPowheg,1> {
/** Typedef of the first base class of MEPP2ZHPowheg. */
typedef Herwig::MEPP2ZH NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEPP2ZHPowheg class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEPP2ZHPowheg>
: public ClassTraitsBase<Herwig::MEPP2ZHPowheg> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEPP2ZHPowheg"; }
/**
* The name of a file containing the dynamic library where the class
* MEPP2ZHPowheg is implemented. It may also include several, space-separated,
* libraries if the class MEPP2ZHPowheg 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 "HwMEHadron.so HwPowhegME.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEPP2ZHPowheg_H */
diff --git a/MatrixElement/Powheg/MEqq2W2ffPowheg.h b/MatrixElement/Powheg/MEqq2W2ffPowheg.h
--- a/MatrixElement/Powheg/MEqq2W2ffPowheg.h
+++ b/MatrixElement/Powheg/MEqq2W2ffPowheg.h
@@ -1,410 +1,410 @@
// -*- C++ -*-
//
// MEqq2W2ffPowheg.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEqq2W2ffPowheg_H
#define HERWIG_MEqq2W2ffPowheg_H
//
// This is the declaration of the MEqq2W2ffPowheg class.
//
#include "Herwig++/MatrixElement/Hadron/MEqq2W2ff.h"
#include "ThePEG/PDF/BeamParticleData.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEqq2W2ffPowheg class implements the matrix element for \f$q\bar{q'}\to W^\pm\f$
* including the decay of the \f$W^\pm\f$ to Standard Model fermions.
*
* @see \ref MEqq2W2ffPowhegInterfaces "The interfaces"
* defined for MEqq2W2ffPowheg.
*/
class MEqq2W2ffPowheg: public MEqq2W2ff {
public:
/**
* The default constructor.
*/
MEqq2W2ffPowheg();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degreed of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given 'nDim()' uniform
* random numbers in the interval ]0,1[. To help the phase space
* generator, the 'dSigHatDR()' should be a smooth function of these
* numbers, although this is not strictly necessary. Return
* false if the chosen points failed the kinematical cuts.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the matrix element for the kinematical configuation
* previously provided by the last call to setKinematics(). Uses
* me().
*/
virtual CrossSection dSigHatDR() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Calculate the correction weight with which leading-order
* configurations are re-weighted.
*/
double NLOweight() const;
/**
* Calculate the variable \f$x=M_{B}^2/s\f$ from the integration variables.
*/
double x(double xt, double v) const;
/**
* Calculate the momentum fraction of the first parton.
*/
double x_a(double x, double v) const;
/**
* Calculate the momentum fraction of second parton.
*/
double x_b(double x, double v) const;
/**
* Calculate the minimum of \f$x\f$.
*/
double xbar(double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$qg\f$ initiated channel.
*/
double Ltilde_qg(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$g\bar{q}\f$ initiated channel.
*/
double Ltilde_gq(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$q\bar{q}\f$ initiated channel.
*/
double Ltilde_qq(double x, double v) const;
/**
* Calculate the soft-virtual contribution to the NLO weight.
*/
double Vtilde_qq() const;
/**
* Function for calculation of the \f$g\bar{q}\f$ and \f$g\bar{q}\f$
* initiated real contribution.
*/
double Ccalbar_qg(double x) const;
/**
* Function for calculation of the \f$qg\f$
* initiated real contribution.
*/
double Fcal_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_qq(double x, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ftilde_qg(double xt, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_gq(double xt, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_qq(double xt, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ctilde_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_qq(double x, double v) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEqq2W2ffPowheg> initMEqq2W2ffPowheg;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEqq2W2ffPowheg & operator=(const MEqq2W2ffPowheg &);
private:
/**
* The momentum fraction of the first parton in the Born process
*/
mutable double _xb_a;
/**
* The momentum fraction of the second parton in the Born process
*/
mutable double _xb_b;
/**
* The ParticleData object for the first parton in the Born process
*/
mutable tcPDPtr _parton_a;
/**
* The ParticleData object for the second parton in the Born process
*/
mutable tcPDPtr _parton_b;
/**
* The BeamParticleData object for the first hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_A;
/**
* The BeamParticleData object for the second hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_B;
/**
* the ParticleData object for the gluon
*/
tcPDPtr _gluon;
/**
* The \f$T_R\f$ colour factor
*/
const double _TR;
/**
* The \f$C_F\f$ colour factor
*/
const double _CF;
/**
* The value of \f$\frac{\alpha_S}{2\pi}\f$ used for the calculation
*/
mutable double _alphaS2Pi;
/**
* The mass squared of the lepton pair
*/
mutable Energy2 _mll2;
/**
* The renormalization/factorization scale
*/
mutable Energy2 _mu2;
/**
* Parameters for the NLO weight
*/
//@{
/**
* Whether to generate the positive, negative or leading order contribution
*/
unsigned int _contrib;
/**
* Whether to use a fixed or a running QCD coupling for the NLO weight
*/
unsigned int _nlo_alphaS_opt;
/**
* The value of alphaS to use for the nlo weight if _nloalphaSopt=1
*/
double _fixed_alphaS;
/**
* The magnitude of the correction term to reduce the negative contribution
*/
double _a;
/**
* The power of the correction term to reduce the negative contribution
*/
double _p;
/**
* Cut-off for the correction function
*/
double _eps;
//@}
/**
* Choice of the scale
*/
//@{
/**
* Type of scale
*/
unsigned int _scaleopt;
/**
* Fixed scale if used
*/
Energy _fixedScale;
/**
* Prefactor if variable scale used
*/
double _scaleFact;
//@}
/**
* Radiation variables
*/
//@{
/**
* The \f$\tilde{x}\f$ variable
*/
double _xt;
/**
* The \f$v\f$ angular variable
*/
double _v;
//@}
/**
* Values of the PDF's before radiation
*/
//@{
/**
* For the quark
*/
mutable double _oldq;
/**
* For the antiquark
*/
mutable double _oldqbar;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEqq2W2ffPowheg. */
template <>
struct BaseClassTrait<Herwig::MEqq2W2ffPowheg,1> {
/** Typedef of the first base class of MEqq2W2ffPowheg. */
typedef Herwig::MEqq2W2ff NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEqq2W2ffPowheg class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEqq2W2ffPowheg>
: public ClassTraitsBase<Herwig::MEqq2W2ffPowheg> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEqq2W2ffPowheg"; }
/** Return the name(s) of the shared library (or libraries) be loaded to get
* access to the MEqq2W2ffPowheg class and any other class on which it depends
* (except the base class). */
static string library() { return "HwMEHadron.so HwPowhegME.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEqq2W2ffPowheg_H */
diff --git a/MatrixElement/Powheg/MEqq2gZ2ffPowheg.h b/MatrixElement/Powheg/MEqq2gZ2ffPowheg.h
--- a/MatrixElement/Powheg/MEqq2gZ2ffPowheg.h
+++ b/MatrixElement/Powheg/MEqq2gZ2ffPowheg.h
@@ -1,413 +1,413 @@
// -*- C++ -*-
//
// MEqq2gZ2ffPowheg.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_MEqq2gZ2ffPowheg_H
#define HERWIG_MEqq2gZ2ffPowheg_H
//
// This is the declaration of the MEqq2gZ2ffPowheg class.
//
#include "Herwig++/MatrixElement/Hadron/MEqq2gZ2ff.h"
#include "ThePEG/PDF/BeamParticleData.h"
namespace Herwig {
using namespace ThePEG;
/**
* The MEqq2gZ2ffPowheg class implements the products of Standard Model
* fermion antifermion pairs via the \f$Z^0\f$ resonance including
* photon interference terms.
*
* @see \ref MEqq2gZ2ffPowhegInterfaces "The interfaces"
* defined for MEqq2gZ2ffPowheg.
*/
class MEqq2gZ2ffPowheg: public MEqq2gZ2ff {
public:
/**
* The default constructor.
*/
MEqq2gZ2ffPowheg();
/** @name Virtual functions required by the MEBase class. */
//@{
/**
* Return the scale associated with the last set phase space point.
*/
virtual Energy2 scale() const;
/**
* The number of internal degreed of freedom used in the matrix
* element.
*/
virtual int nDim() const;
/**
* Generate internal degrees of freedom given 'nDim()' uniform
* random numbers in the interval ]0,1[. To help the phase space
* generator, the 'dSigHatDR()' should be a smooth function of these
* numbers, although this is not strictly necessary. Return
* false if the chosen points failed the kinematical cuts.
*/
virtual bool generateKinematics(const double * r);
/**
* Return the matrix element for the kinematical configuation
* previously provided by the last call to setKinematics(). Uses
* me().
*/
virtual CrossSection dSigHatDR() const;
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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:
/**
* Calculate the correction weight with which leading-order
* configurations are re-weighted.
*/
double NLOweight() const;
/**
* Calculate the variable \f$x=M_{B}^2/s\f$ from the integration variables.
*/
double x(double xt, double v) const;
/**
* Calculate the momentum fraction of the first parton.
*/
double x_a(double x, double v) const;
/**
* Calculate the momentum fraction of the second parton.
*/
double x_b(double x, double v) const;
/**
* Calculate the minimum of \f$x\f$.
*/
double xbar(double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$qg\f$ initiated channel.
*/
double Ltilde_qg(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$g\bar{q}\f$ initiated channel.
*/
double Ltilde_gq(double x, double v) const;
/**
* Calculate the ratio of the radiative luminosity funcion to the
* Born luminosity function for the \f$q\bar{q}\f$ initiated channel.
*/
double Ltilde_qq(double x, double v) const;
/**
* Calculate the soft-virtual contribution to the NLO weight.
*/
double Vtilde_qq() const;
/**
* Function for calculation of the \f$qg\f$ and \f$g\bar{q}\f$ initiated real
* contributions.
*/
double Ccalbar_qg(double x) const;
/**
* Function for calculation of the \f$qg\f$
* initiated real contribution.
*/
double Fcal_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Fcal_qq(double x, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ftilde_qg(double xt, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_gq(double xt, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ftilde_qq(double xt, double v) const;
/**
* Function for calculation of the \f$qg\f$ initiated real
* contribution.
*/
double Ctilde_qg(double x, double v) const;
/**
* Function for calculation of the \f$g\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_gq(double x, double v) const;
/**
* Function for calculation of the \f$q\bar{q}\f$ initiated real
* contribution.
*/
double Ctilde_qq(double x, double v) const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
- inline virtual IBPtr clone() const { return new_ptr(*this); }
+ 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 { return new_ptr(*this); }
+ virtual IBPtr fullclone() const { return new_ptr(*this); }
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<MEqq2gZ2ffPowheg> initMEqq2gZ2ffPowheg;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEqq2gZ2ffPowheg & operator=(const MEqq2gZ2ffPowheg &);
private:
/**
* The momentum fraction of the first parton in the Born process
*/
mutable double _xb_a;
/**
* The momentum fraction of the second parton in the Born process
*/
mutable double _xb_b;
/**
* The ParticleData object for the first parton in the Born process
*/
mutable tcPDPtr _parton_a;
/**
* The ParticleData object for the second parton in the Born process
*/
mutable tcPDPtr _parton_b;
/**
* The BeamParticleData object for the first hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_A;
/**
* The BeamParticleData object for the second hadron
*/
mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_B;
/**
* the ParticleData object for the gluon
*/
tcPDPtr _gluon;
/**
* The \f$T_R\f$ colour factor
*/
const double _TR;
/**
* The \f$C_F\f$ colour factor
*/
const double _CF;
/**
* The value of \f$\frac{\alpha_S}{2\pi}\f$ used for the calculation
*/
mutable double _alphaS2Pi;
/**
* The mass squared of the lepton pair
*/
mutable Energy2 _mll2;
/**
* The renormalization/factorization scale
*/
mutable Energy2 _mu2;
/**
* Parameters for the NLO weight
*/
//@{
/**
* Whether to generate the positive, negative or leading order contribution
*/
unsigned int _contrib;
/**
* Whether to use a fixed or a running QCD coupling for the NLO weight
*/
unsigned int _nlo_alphaS_opt;
/**
* The value of alphaS to use for the nlo weight if _nloalphaSopt=1
*/
double _fixed_alphaS;
/**
* The magnitude of the correction term to reduce the negative contribution
*/
double _a;
/**
* The power of the correction term to reduce the negative contribution
*/
double _p;
/**
* Cut-off for the correction function
*/
double _eps;
//@}
/**
* Choice of the scale
*/
//@{
/**
* Type of scale
*/
unsigned int _scaleopt;
/**
* Fixed scale if used
*/
Energy _fixedScale;
/**
* Prefactor if variable scale used
*/
double _scaleFact;
//@}
/**
* Radiation variables
*/
//@{
/**
* The \f$\tilde{x}\f$ variable
*/
double _xt;
/**
* The \f$v\f$ angular variable
*/
double _v;
//@}
/**
* Values of the PDF's before radiation
*/
//@{
/**
* For the quark
*/
mutable double _oldq;
/**
* For the antiquark
*/
mutable double _oldqbar;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MEqq2gZ2ffPowheg. */
template <>
struct BaseClassTrait<Herwig::MEqq2gZ2ffPowheg,1> {
/** Typedef of the first base class of MEqq2gZ2ffPowheg. */
typedef Herwig::MEqq2gZ2ff NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MEqq2gZ2ffPowheg class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::MEqq2gZ2ffPowheg>
: public ClassTraitsBase<Herwig::MEqq2gZ2ffPowheg> {
/** Return a platform-independent class name */
static string className() { return "Herwig::MEqq2gZ2ffPowheg"; }
/** Return the name(s) of the shared library (or libraries) be loaded to get
* access to the MEqq2gZ2ffPowheg class and any other class on which it depends
* (except the base class). */
static string library() { return "HwMEHadron.so HwPowhegME.so"; }
};
/** @endcond */
}
#endif /* HERWIG_MEqq2gZ2ffPowheg_H */
diff --git a/MatrixElement/ProductionMatrixElement.h b/MatrixElement/ProductionMatrixElement.h
--- a/MatrixElement/ProductionMatrixElement.h
+++ b/MatrixElement/ProductionMatrixElement.h
@@ -1,454 +1,659 @@
// -*- C++ -*-
//
// ProductionMatrixElement.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_ProductionMatrixElement_H
#define HERWIG_ProductionMatrixElement_H
//
// This is the declaration of the ProductionMatrixElement class.
#include <ThePEG/Config/ThePEG.h>
#include <ThePEG/Utilities/ClassDescription.h>
#include <ThePEG/Helicity/RhoDMatrix.h>
namespace Herwig {
using ThePEG::Helicity::RhoDMatrix;
using namespace ThePEG;
/** \ingroup Helicity
*
* The storage of the helicity amplitude expression for the matrix element
* of a hard process. Two incoming particles and an arbitary number of
* external particles are supported.
*
* @see DecayMatrixElement
* @see RhoDMatrix
* @see HardVertex
*
* \author Peter Richardson
*/
class ProductionMatrixElement: public Base {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Constructor for 2-1 scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out \f$2S+1\f$ for the outgoing particle.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out);
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out) {
+ _nout=2;
+ _inspin.resize(2);
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin.push_back(out);
+ setMESize();
+ }
/**
* Constructor for 2-2 scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out1 \f$2S+1\f$ for the first outgoing particle.
* @param out2 \f$2S+1\f$ for the second outgoing particle.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
- PDT::Spin out2);
-
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
+ PDT::Spin out2) {
+ _nout=2;
+ _inspin.resize(2);
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin.push_back(out1);
+ _outspin.push_back(out2);
+ setMESize();
+ }
+
/**
* Constructor for 2-3 scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out1 \f$2S+1\f$ for the first outgoing particle.
* @param out2 \f$2S+1\f$ for the second outgoing particle.
* @param out3 \f$2S+1\f$ for the third outgoing particle.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
- PDT::Spin out2,PDT::Spin out3);
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
+ PDT::Spin out2,PDT::Spin out3) {
+ _inspin.resize(2);
+ _nout=3;
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin.push_back(out1);
+ _outspin.push_back(out2);
+ _outspin.push_back(out3);
+ setMESize();
+ }
/**
* Constructor for 2-4 scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out1 \f$2S+1\f$ for the first outgoing particle.
* @param out2 \f$2S+1\f$ for the second outgoing particle.
* @param out3 \f$2S+1\f$ for the third outgoing particle.
* @param out4 \f$2S+1\f$ for the fourth outgoing particle.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
- PDT::Spin out2,PDT::Spin out3, PDT::Spin out4);
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
+ PDT::Spin out2,PDT::Spin out3, PDT::Spin out4) {
+ _nout=4;
+ _inspin.resize(2);
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin.push_back(out1);
+ _outspin.push_back(out2);
+ _outspin.push_back(out3);
+ _outspin.push_back(out4);
+ setMESize();
+ }
/**
* Constructor for 2-5 scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out1 \f$2S+1\f$ for the first outgoing particle.
* @param out2 \f$2S+1\f$ for the second outgoing particle.
* @param out3 \f$2S+1\f$ for the third outgoing particle.
* @param out4 \f$2S+1\f$ for the fourth outgoing particle.
* @param out5 \f$2S+1\f$ for the fifth outgoing particle.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
- PDT::Spin out2,PDT::Spin out3, PDT::Spin out4,
- PDT::Spin out5);
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
+ PDT::Spin out2,PDT::Spin out3, PDT::Spin out4,
+ PDT::Spin out5) {
+ _nout=5;
+ _inspin.resize(2);
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin.push_back(out1);
+ _outspin.push_back(out2);
+ _outspin.push_back(out3);
+ _outspin.push_back(out4);
+ _outspin.push_back(out5);
+ setMESize();
+ }
/**
* Constructor for 2-6 scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out1 \f$2S+1\f$ for the first outgoing particle.
* @param out2 \f$2S+1\f$ for the second outgoing particle.
* @param out3 \f$2S+1\f$ for the third outgoing particle.
* @param out4 \f$2S+1\f$ for the fourth outgoing particle.
* @param out5 \f$2S+1\f$ for the fifth outgoing particle.
* @param out6 \f$2S+1\f$ for the sixth outgoing particle.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
- PDT::Spin out2,PDT::Spin out3, PDT::Spin out4,
- PDT::Spin out5, PDT::Spin out6);
-
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,PDT::Spin out1,
+ PDT::Spin out2,PDT::Spin out3, PDT::Spin out4,
+ PDT::Spin out5, PDT::Spin out6) {
+ _nout=6;
+ _inspin.resize(2);
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin.push_back(out1);
+ _outspin.push_back(out2);
+ _outspin.push_back(out3);
+ _outspin.push_back(out4);
+ _outspin.push_back(out5);
+ _outspin.push_back(out6);
+ setMESize();
+ }
+
/**
* Constructor for 2-n scattering.
* @param in1 \f$2S+1\f$ for the first incoming particle.
* @param in2 \f$2S+1\f$ for the second incoming particle.
* @param out A vector containing \f$2S+1\f$ for the outgoing particles.
*/
- inline ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,vector<PDT::Spin> out);
-
+ ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,vector<PDT::Spin> out) {
+ _inspin.resize(2);
+ _nout=out.size();
+ _inspin[0]=in1;
+ _inspin[1]=in2;
+ _outspin=out;
+ setMESize();
+ }
+
/**
* Default constructor.
*/
ProductionMatrixElement() {};
//@}
public:
/** @name Access to the spins of the particles. */
//@{
/**
* Get the spins of the incoming particles particle
* @return A vector containing \f$2S+1\f$ for the two incoming particles.
*/
- inline vector<PDT::Spin> inspin();
+ vector<PDT::Spin> inspin() {return _inspin;}
/**
* Get the spins of the outgoing particles.
* @return A vector containing \f$2S+1\f$ for the outgoing particles.
*/
- inline vector<PDT::Spin> outspin();
+ vector<PDT::Spin> outspin() {return _outspin;}
//@}
public:
/** @name Access to the individual helicity components. */
//@{
-
/**
* Access the helicity components for a 2-1 scattering. This method supplies
* the component but does not allow it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel The helicity of the outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out The helicity of the outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel) const;
-
+ Complex operator () (unsigned int in1,unsigned int in2,
+ unsigned int out) const {
+ assert(_outspin.size()==1);
+ unsigned int iloc = in1*_constants[1] + in2*_constants[2] + out*_constants[3];
+ assert(iloc<_matrixelement.size());
+ return _matrixelement[iloc];
+ }
+
/**
* Access the helicity components for a 2-1 scattering. This method supplies
* the component and allows it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel The helicity of the outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out The helicity of the outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel);
+ Complex & operator () (unsigned int in1,unsigned int in2,
+ unsigned int out) {
+ assert(_outspin.size()==1);
+ unsigned int iloc = in1*_constants[1] + in2*_constants[2] + out*_constants[3];
+ assert(iloc<_matrixelement.size());
+ return _matrixelement[iloc];
+ }
/**
* Access the helicity components for a 2-2 scattering. This method supplies
* the component but does not allow it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2) const;
+ Complex operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2) const {
+ assert(_outspin.size()==2);
+ unsigned int iloc = in1*_constants[1] + in2*_constants[2] +
+ out1*_constants[3] + out2*_constants[4];
+ assert(iloc<_matrixelement.size());
+ return _matrixelement[iloc];
+ }
/**
* Access the helicity components for a 2-2 scattering. This method supplies
* the component and allows it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2);
+ Complex & operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2) {
+ assert(_outspin.size()==2);
+ unsigned int iloc = in1*_constants[1] + in2*_constants[2] +
+ out1*_constants[3] + out2*_constants[4];
+ assert(iloc<_matrixelement.size());
+ return _matrixelement[iloc];
+ }
/**
* Access the helicity components for a 2-3 scattering. This method supplies
* the component but does not allow it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3) const;
+ Complex operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3) const {
+ assert(_outspin.size()==3);
+ vector<unsigned int> ivec(5);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ return (*this)(ivec);
+ }
/**
* Access the helicity components for a 2-3 scattering. This method supplies
* the component and allows it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3);
+ Complex & operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3) {
+ assert(_outspin.size()==3);
+ vector<unsigned int> ivec(5);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ return (*this)(ivec);
+ }
/**
* Access the helicity components for a 2-4 scattering. This method supplies
* the component but does not allow it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
- * @param outhel4 The helicity of the fourth outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
+ * @param out4 The helicity of the fourth outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3,unsigned int outhel4) const;
-
+ Complex operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3,unsigned int out4) const {
+ assert(_outspin.size()==4);
+ vector<unsigned int> ivec(6);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ ivec[5]=out4;
+ return (*this)(ivec);
+ }
+
/**
* Access the helicity components for a 2-4 scattering. This method supplies
* the component and allows it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
- * @param outhel4 The helicity of the fourth outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
+ * @param out4 The helicity of the fourth outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3, unsigned int outhel4);
+ Complex & operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3, unsigned int out4) {
+ assert(_outspin.size()==4);
+ vector<unsigned int> ivec(6);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ ivec[5]=out4;
+ return (*this)(ivec);
+ }
/**
* Access the helicity components for a 2-5 scattering. This method supplies
* the component but does not allow it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
- * @param outhel4 The helicity of the fourth outgoing particle.
- * @param outhel5 The helicity of the fifth outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
+ * @param out4 The helicity of the fourth outgoing particle.
+ * @param out5 The helicity of the fifth outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3,unsigned int outhel4,
- unsigned int outhel5) const;
-
+ Complex operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3,unsigned int out4,
+ unsigned int out5) const {
+ assert(_outspin.size()==5);
+ vector<unsigned int> ivec(7);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ ivec[5]=out4;
+ ivec[6]=out5;
+ return (*this)(ivec);
+ }
+
/**
* Access the helicity components for a 2-5 scattering. This method supplies
* the component and allows it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
- * @param outhel4 The helicity of the fourth outgoing particle.
- * @param outhel5 The helicity of the fifth outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
+ * @param out4 The helicity of the fourth outgoing particle.
+ * @param out5 The helicity of the fifth outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3, unsigned int outhel4,
- unsigned int outhel5);
+ Complex & operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3, unsigned int out4,
+ unsigned int out5) {
+ assert(_outspin.size()==5);
+ vector<unsigned int> ivec(7);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ ivec[5]=out4;
+ ivec[6]=out5;
+ return (*this)(ivec);
+ }
/**
* Access the helicity components for a 2-6 scattering. This method supplies
* the component but does not allow it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
- * @param outhel4 The helicity of the fourth outgoing particle.
- * @param outhel5 The helicity of the fifth outgoing particle.
- * @param outhel6 The helicity of the sixth outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
+ * @param out4 The helicity of the fourth outgoing particle.
+ * @param out5 The helicity of the fifth outgoing particle.
+ * @param out6 The helicity of the sixth outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3,unsigned int outhel4,
- unsigned int outhel5,unsigned int outhel6) const;
+ Complex operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3,unsigned int out4,
+ unsigned int out5,unsigned int out6) const {
+ assert(_outspin.size()==6);
+ vector<unsigned int> ivec(8);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ ivec[5]=out4;
+ ivec[6]=out5;
+ ivec[7]=out6;
+ return (*this)(ivec);
+ }
/**
* Access the helicity components for a 2-6 scattering. This method supplies
* the component and allows it to be changed.
- * @param inhel1 The helicity of the first incoming particle.
- * @param inhel2 The helicity of the second incoming particle.
- * @param outhel1 The helicity of the first outgoing particle.
- * @param outhel2 The helicity of the second outgoing particle.
- * @param outhel3 The helicity of the third outgoing particle.
- * @param outhel4 The helicity of the fourth outgoing particle.
- * @param outhel5 The helicity of the fifth outgoing particle.
- * @param outhel6 The helicity of the sixth outgoing particle.
+ * @param in1 The helicity of the first incoming particle.
+ * @param in2 The helicity of the second incoming particle.
+ * @param out1 The helicity of the first outgoing particle.
+ * @param out2 The helicity of the second outgoing particle.
+ * @param out3 The helicity of the third outgoing particle.
+ * @param out4 The helicity of the fourth outgoing particle.
+ * @param out5 The helicity of the fifth outgoing particle.
+ * @param out6 The helicity of the sixth outgoing particle.
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (unsigned int inhel1,unsigned int inhel2,
- unsigned int outhel1,unsigned int outhel2,
- unsigned int outhel3, unsigned int outhel4,
- unsigned int outhel5, unsigned int outhel6);
-
+ Complex & operator () (unsigned int in1,unsigned int in2,
+ unsigned int out1,unsigned int out2,
+ unsigned int out3, unsigned int out4,
+ unsigned int out5, unsigned int out6) {
+ assert(_outspin.size()==6);
+ vector<unsigned int> ivec(8);
+ ivec[0]=in1;
+ ivec[1]=in2;
+ ivec[2]=out1;
+ ivec[3]=out2;
+ ivec[4]=out3;
+ ivec[5]=out4;
+ ivec[6]=out5;
+ ivec[7]=out6;
+ return (*this)(ivec);
+ }
/**
* Access the helicity components for a 2-n scattering. This method supplies
* the component but does not allow it to be changed.
* @param hel The helicities of the incoming and outgoing particles
* @return The matrix element for the given helicities.
*/
- inline Complex operator () (vector<unsigned int> hel) const;
-
+ Complex operator () (vector<unsigned int> hel) const {
+ assert(_outspin.size() == hel.size()-2);
+ unsigned int iloc(0),ix;
+ // incoming and outgoing particles
+ for(ix=0;ix<hel.size();++ix)
+ iloc += hel[ix]*_constants[ix+1];
+ assert(iloc<_matrixelement.size());
+ return _matrixelement[iloc];
+ }
+
/**
* Access the helicity components for a 2-n scattering. This method supplies
* the component and allows it to be changed.
* @param hel The helicities of the incoming and outgoing particles
* @return The matrix element for the given helicities.
*/
- inline Complex & operator () (vector<unsigned int> hel);
+ Complex & operator () (vector<unsigned int> hel) {
+ assert(_outspin.size() == hel.size()-2);
+ unsigned int iloc=0,ix;
+ // incoming particles
+ for(ix=0;ix<hel.size();++ix)
+ iloc += hel[ix]*_constants[ix+1];
+ assert(iloc<_matrixelement.size());
+ return _matrixelement[iloc];
+ }
//@}
public:
/**
* Calculate the decay matrix for an incoming particle.
*/
RhoDMatrix calculateDMatrix(int,const RhoDMatrix &,
const vector<RhoDMatrix> &) const;
/**
* Calculate the rho matrix for a given outgoing particle.
*/
RhoDMatrix calculateRhoMatrix(int,const RhoDMatrix &,
const RhoDMatrix &,
const vector<RhoDMatrix> &) const;
public:
/**
* Reset the matrix element.
*/
- inline void reset(const ProductionMatrixElement &) const;
+ void reset(const ProductionMatrixElement & x) const {
+ _nout = x._nout;
+ _inspin = x._inspin;
+ _outspin = x._outspin;
+ _matrixelement = x._matrixelement;
+ _constants = x._constants;
+ }
public:
/**
* Standard Init function used to initialize the interfaces.
*/
static void Init();
private:
/**
* Describe a concrete class without persistent data.
*/
static NoPIOClassDescription<ProductionMatrixElement> initProductionMatrixElement;
/**
* Private and non-existent assignment operator.
*/
ProductionMatrixElement & operator=(const ProductionMatrixElement& );
private:
/**
* Set the size of the vector containing the matrix element.
*/
- inline void setMESize();
+ void setMESize() {
+ unsigned int ix;
+ int isize=_inspin[0]*_inspin[1];
+ for(ix=0;ix<_outspin.size();++ix)
+ isize*=_outspin[ix];
+ // zero the matrix element
+ _matrixelement.resize(isize,0.);
+ // set up the constants for the mapping of helicity to vectro index
+ _constants.resize(_outspin.size()+3);
+ unsigned int temp=1;
+ for(ix=_outspin.size()+1;ix>1;--ix) {
+ temp*=_outspin[ix-2];
+ _constants[ix]=temp;
+ }
+ temp*=_inspin[1];_constants[1]=temp;
+ temp*=_inspin[0];_constants[0]=temp;
+ _constants[_outspin.size()+2]=1;
+ }
private:
/**
* Number of outgoing particles.
*/
mutable unsigned int _nout;
/**
* Spin of the incoming particles as 2s+1.
*/
mutable vector<PDT::Spin> _inspin;
/**
* Spins of the outgoing particles.
*/
mutable vector<PDT::Spin> _outspin;
/**
* Storage of the matrix element, a vector is better for memory usage.
*/
mutable vector<Complex> _matrixelement;
/**
* Constants needed to map the index of the vector to a helicity structure.
*/
mutable vector<int> _constants;
};
}
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* The following template specialization informs ThePEG about the
* base class of ProductionMatrixElement.
*/
template <>
struct BaseClassTrait<Herwig::ProductionMatrixElement,1> {
/** Typedef of the base class of ProductionMatrixElement. */
typedef Base NthBase;
};
/**
* The following template specialization informs ThePEG about the
* name of this class and the shared object where it is defined.
*/
template <>
struct ClassTraits<Herwig::ProductionMatrixElement>
: public ClassTraitsBase<Herwig::ProductionMatrixElement> {
/**
* Return the class name.
*/
static string className() { return "Herwig::ProductionMatrixElement"; }
};
/** @endcond */
}
-#include "ProductionMatrixElement.icc"
-
#endif /* HERWIG_ProductionMatrixElement_H */
diff --git a/MatrixElement/ProductionMatrixElement.icc b/MatrixElement/ProductionMatrixElement.icc
deleted file mode 100644
--- a/MatrixElement/ProductionMatrixElement.icc
+++ /dev/null
@@ -1,400 +0,0 @@
-// -*- C++ -*-
-//
-// ProductionMatrixElement.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the ProductionMatrixElement class.
-//
-// Author: Peter Richardson
-//
-
-namespace Herwig {
-
-using namespace ThePEG;
-
-
-// constructor for 2-1 scattering
-inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,
- PDT::Spin out1)
-{
- _nout=2;
- _inspin.resize(2);
- _inspin[0]=in1; _inspin[1]=in2;
- _outspin.push_back(out1);
- setMESize();
-}
-// constructor for 2-2 scattering
-inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1,PDT::Spin in2,
- PDT::Spin out1,PDT::Spin out2)
-{
- _nout=2;
- _inspin.resize(2);
- _inspin[0]=in1; _inspin[1]=in2;
- _outspin.push_back(out1);_outspin.push_back(out2);
- setMESize();
-}
-
-// constructor for 2-3 scattering
-inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1, PDT::Spin in2,
- PDT::Spin out1,PDT::Spin out2,
- PDT::Spin out3)
-{
- _inspin.resize(2);
- _nout=3; _inspin[0]=in1; _inspin[1]=in2;
- _outspin.push_back(out1);_outspin.push_back(out2);_outspin.push_back(out3);
- setMESize();
-}
-
-// constructor for 2-4 scattering
- inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1, PDT::Spin in2,
- PDT::Spin out1,PDT::Spin out2,
- PDT::Spin out3,PDT::Spin out4)
-{
- _nout=4;
- _inspin.resize(2);
- _inspin[0]=in1; _inspin[1]=in2;
- _outspin.push_back(out1);_outspin.push_back(out2);
- _outspin.push_back(out3);_outspin.push_back(out4);
- setMESize();
-}
-
-// constructor for 2-5 scattering
-inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1, PDT::Spin in2,
- PDT::Spin out1,PDT::Spin out2,
- PDT::Spin out3,PDT::Spin out4,
- PDT::Spin out5)
-{
- _nout=5;
- _inspin.resize(2);
- _inspin[0]=in1; _inspin[1]=in2;
- _outspin.push_back(out1);_outspin.push_back(out2);
- _outspin.push_back(out3);_outspin.push_back(out4);_outspin.push_back(out5);
- setMESize();
-}
-
-// constructor for 2-6 scattering
-inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1, PDT::Spin in2,
- PDT::Spin out1,PDT::Spin out2,
- PDT::Spin out3,PDT::Spin out4,
- PDT::Spin out5,PDT::Spin out6)
-{
- _nout=6;
- _inspin.resize(2);
- _inspin[0]=in1; _inspin[1]=in2;
- _outspin.push_back(out1);_outspin.push_back(out2);
- _outspin.push_back(out3);_outspin.push_back(out4);
- _outspin.push_back(out5);_outspin.push_back(out6);
- setMESize();
-}
-
-// constructor for 2-n scattering
-inline ProductionMatrixElement::ProductionMatrixElement(PDT::Spin in1, PDT::Spin in2,
- vector<PDT::Spin> out)
-{
- _inspin.resize(2);
- _nout=out.size(); _inspin[0]=in1; _inspin[1]=in2;
- _outspin=out;setMESize();
-}
-
-// set the size of the vector containing the matrix element
-inline void ProductionMatrixElement::setMESize()
-{
- unsigned int ix;
- int isize=_inspin[0]*_inspin[1];
- for(ix=0;ix<_outspin.size();++ix){isize*=_outspin[ix];}
- // zero the matrix element
- _matrixelement.resize(isize,0.);
- // set up the constants for the mapping of helicity to vectro index
- _constants.resize(_outspin.size()+3);
- unsigned int temp=1;
- for(ix=_outspin.size()+1;ix>1;--ix){temp*=_outspin[ix-2];_constants[ix]=temp;}
- temp*=_inspin[1];_constants[1]=temp;
- temp*=_inspin[0];_constants[0]=temp;
- _constants[_outspin.size()+2]=1;
-}
-
-// get the spins of the incoming particles particle
-inline vector<PDT::Spin> ProductionMatrixElement::inspin(){return _inspin;}
-
-// get the spins of the outgoing particles
-inline vector<PDT::Spin> ProductionMatrixElement::outspin(){return _outspin;}
-
-// access to the individual helicity components (2-2 scattering)
-inline Complex ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1) const
-{
- // check this is really a 2-2 matrix element
- if(_outspin.size()!=1)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-1 matrix element"
- << " but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- unsigned int iloc(0);
- iloc+=in1*_constants[1];
- iloc+=in2*_constants[2];
- iloc+=out1*_constants[3];
- if(iloc>=_matrixelement.size())
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Invalid component of 2-1 matrix element requested"
- << Exception::abortnow;
- return 0.;
- }
- return _matrixelement[iloc];
-}
-
-// access to the individual helicity components (2-2 scattering)
-inline Complex ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2) const
-{
- // check this is really a 2-2 matrix element
- if(_outspin.size()!=2)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-2 matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- unsigned int iloc(0);
- iloc+=in1*_constants[1];
- iloc+=in2*_constants[2];
- iloc+=out1*_constants[3];
- iloc+=out2*_constants[4];
- if(iloc>=_matrixelement.size())
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Invalid component of 2-2 matrix element requested"
- << Exception::abortnow;
- return 0.;
- }
- return _matrixelement[iloc];
-}
-
-// access to the individual helicity components (2-3 scattering)
-inline Complex ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,
- unsigned int out1,unsigned int out2,unsigned int out3) const
-{
- if(_outspin.size()!=3)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-3 matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- // map the indices to the location in the vector
- vector<unsigned int> ivec(5);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- return (*this)(ivec);
-}
-
-// access to the individual helicity components (2-4 scattering)
-inline Complex ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3,unsigned int out4) const
-{
- if(_outspin.size()!=4)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-4 matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- vector<unsigned int> ivec(6);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- ivec[5]=out4;
- return (*this)(ivec);
-}
-
-
-// access to the individual helicity components (2-5 scattering)
-inline Complex ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3,unsigned int out4, unsigned int out5) const
-{
- if(_outspin.size()!=5)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-4 matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- vector<unsigned int> ivec(7);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- ivec[5]=out4;ivec[6]=out5;
- return (*this)(ivec);
-}
-
-
-// access to the individual helicity components (2-6 scattering)
-inline Complex ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3,unsigned int out4, unsigned int out5, unsigned int out6) const
-{
- if(_outspin.size()!=6)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-6 matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- vector<unsigned int> ivec(8);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- ivec[5]=out4;ivec[6]=out5;ivec[7]=out6;
- return (*this)(ivec);
-}
-
-
-// access to the individual helicity components (2-n scattering)
-inline Complex ProductionMatrixElement::operator ()
- (vector<unsigned int> in) const
-{
- if(_outspin.size()!=in.size()-2)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-" << in.size()
- << " matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return 0.;
- }
- unsigned int iloc(0),ix;
- // incoming and outgoing particles
- for(ix=0;ix<in.size();++ix){iloc+=in[ix]*_constants[ix+1];}
- if(iloc>=_matrixelement.size())
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Invalid component of 2-n matrix element requested"
- << Exception::abortnow;
- return 0.;
- }
- return _matrixelement[iloc];
-}
-
-// set the individual helicity components (2-1 scattering)
-inline Complex & ProductionMatrixElement::operator () (unsigned int in1,unsigned int in2,
- unsigned int out1)
-{
- static Complex dummy=0.;
- unsigned int iloc(0);
- iloc+= in1*_constants[1];
- iloc+= in2*_constants[2];
- iloc+=out1*_constants[3];
- if(iloc>=_matrixelement.size())
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Invalid component of 2-1 matrix element requested"
- << Exception::abortnow;
- return dummy;
- }
- return _matrixelement[iloc];
-}
-
-// set the individual helicity components (2-2 scattering)
-inline Complex & ProductionMatrixElement::operator () (unsigned int in1,
- unsigned int in2,
- unsigned int out1,
- unsigned int out2)
-{
- static Complex dummy=0.;
- unsigned int iloc(0);
- iloc+= in1*_constants[1];
- iloc+= in2*_constants[2];
- iloc+=out1*_constants[3];
- iloc+=out2*_constants[4];
- if(iloc>=_matrixelement.size())
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Invalid component of 2-2 matrix element requested"
- << Exception::abortnow;
- return dummy;
- }
- return _matrixelement[iloc];
-}
-
-// set the individual helicity components (2-3 scattering)
-inline Complex & ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3)
-{
- vector<unsigned int> ivec(5);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- return (*this)(ivec);
-}
-
-// set the individual helicity components (2-4 scattering)
-inline Complex & ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3, unsigned int out4)
-{
- vector<unsigned int> ivec(6);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- ivec[5]=out4;
- return (*this)(ivec);
-}
-
-// set the individual helicity components (2-5 scattering)
-inline Complex & ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3, unsigned int out4, unsigned int out5)
-{
- vector<unsigned int> ivec(7);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- ivec[5]=out4; ivec[6]=out5;
- return (*this)(ivec);
-}
-
-// set the individual helicity components (2-6 scattering)
-inline Complex & ProductionMatrixElement::operator ()
- (unsigned int in1,unsigned int in2,unsigned int out1,unsigned int out2,
- unsigned int out3, unsigned int out4, unsigned int out5, unsigned int out6)
-{
- vector<unsigned int> ivec(8);
- ivec[0]=in1;ivec[1]=in2;ivec[2]=out1;ivec[3]=out2;ivec[4]=out3;
- ivec[5]=out4; ivec[6]=out5; ivec[7]=out6;
- return (*this)(ivec);
-}
-
-inline Complex & ProductionMatrixElement::operator ()
- (vector<unsigned int> in)
-{
- static Complex dummy=0;
- if(_outspin.size()!=in.size()-2)
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Requested component of 2-" << in.size()
- << " matrix element but matrix element is 2-"
- << _outspin.size() << Exception::abortnow;
- return dummy;
- }
- unsigned int iloc=0;
- // incoming particles
- for(unsigned int ix=0;ix<in.size();++ix){iloc+=in[ix]*_constants[ix+1];}
- if(iloc>=_matrixelement.size())
- {
- throw ThePEG::Helicity::HelicityConsistencyError()
- << "Invalid component of 2-n matrix element requested"
- << Exception::abortnow;
- return dummy;
- }
- return _matrixelement[iloc];
-}
-
-// reset the matrix element
-inline void ProductionMatrixElement::reset(const ProductionMatrixElement & x) const
-{
- _nout = x._nout;
- _inspin = x._inspin;
- _outspin =x._outspin;
- _matrixelement=x._matrixelement;
- _constants=x._constants;
-}
-
-}
diff --git a/PDT/SMHiggsWidthGenerator.cc b/PDT/SMHiggsWidthGenerator.cc
--- a/PDT/SMHiggsWidthGenerator.cc
+++ b/PDT/SMHiggsWidthGenerator.cc
@@ -1,393 +1,396 @@
// -*- C++ -*-
//
// SMHiggsWidthGenerator.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the SMHiggsWidthGenerator class.
//
#include "SMHiggsWidthGenerator.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/StandardModel/StandardModelBase.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/PDT/DecayMode.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/PDT/ParticleData.h"
using namespace Herwig;
void SMHiggsWidthGenerator::persistentOutput(PersistentOStream & os) const {
os << _widthopt << _offshell << ounit(_mw,GeV) << ounit(_mz,GeV)
<< ounit(_gamw,GeV) << ounit(_gamz,GeV) << ounit(_qmass,GeV)
<< ounit(_lmass,GeV) << _sw2 << _ca << _cf;
}
void SMHiggsWidthGenerator::persistentInput(PersistentIStream & is, int) {
is >> _widthopt >> _offshell >> iunit(_mw,GeV) >> iunit(_mz,GeV)
>> iunit(_gamw,GeV) >> iunit(_gamz,GeV) >> iunit(_qmass,GeV)
>> iunit(_lmass,GeV) >> _sw2 >> _ca >> _cf;
}
ClassDescription<SMHiggsWidthGenerator> SMHiggsWidthGenerator::initSMHiggsWidthGenerator;
// Definition of the static class description member.
void SMHiggsWidthGenerator::Init() {
static ClassDocumentation<SMHiggsWidthGenerator> documentation
("The SMHiggsWidthGenerator class calculates the running Higgs width as in"
"hep-ph/9505211.",
"The Higgs width was calculated as in \\cite{Seymour:1995qg}.",
"%\\cite{Seymour:1995qg}\n"
"\\bibitem{Seymour:1995qg}\n"
" M.~H.~Seymour,\n"
" %``The Higgs boson line shape and perturbative unitarity,''\n"
" Phys.\\ Lett.\\ B {\\bf 354}, 409 (1995)\n"
" [arXiv:hep-ph/9505211].\n"
" %%CITATION = PHLTA,B354,409;%%\n"
);
static Switch<SMHiggsWidthGenerator,unsigned int> interfaceWidthOption
("WidthScheme",
"Option for the treatment of the Higss Width calculation",
&SMHiggsWidthGenerator::_widthopt, 2, false, false);
static SwitchOption interfaceFixedWidth
(interfaceWidthOption,
"Fixed",
"Fixed Higgs width, taken from ThePEGParticles.in",
1);
static SwitchOption interfaceNLLWidth
(interfaceWidthOption,
"NLLcorrected",
"NLL corrected Higgs width (a-la FORTRAN HERWIG)",
2);
static SwitchOption interfaceLOWidthOption
(interfaceWidthOption,
"LO",
"LO Higgs width (formula taken from The \"Higgs Hunter's Guide\")",
3);
static Parameter<SMHiggsWidthGenerator,double> interfaceOffShell
("OffShell",
"Number of times the width the Higgs is allowed to be off-shell",
&SMHiggsWidthGenerator::_offshell, 10., 0.01, 100.0,
false, false, Interface::limited);
}
bool SMHiggsWidthGenerator::accept(const ParticleData & in) const {
return in.id()==ParticleID::h0;
}
Energy SMHiggsWidthGenerator::width(const ParticleData & in, Energy m) const {
if(_widthopt==1) {
return in.width();
}
else if(_widthopt <=3 ) {
Energy higgswidth = ZERO;
for (unsigned int i = 1; i < 14; ++i) higgswidth += partialWidth(m,i);
return higgswidth;
}
else
throw Exception() << "Unknown width option in SMHiggsWidthGenerator::width()"
<< Exception::runerror;
}
DecayMap SMHiggsWidthGenerator::rate(const ParticleData & p) const {
if(_mw==ZERO) return p.decaySelector();
else return branching(p.mass(),p);
}
DecayMap SMHiggsWidthGenerator::rate(const Particle & p) {
return branching(p.mass(),p.data());
}
DecayMap SMHiggsWidthGenerator::branching(Energy scale, const ParticleData & p) const {
// if not using running width return original
if(_widthopt==1) return p.decaySelector();
// calculate the partial widths
vector<Energy> partial;
Energy total(ZERO);
for(unsigned int ix=0;ix<14;++ix) {
partial.push_back(partialWidth(scale,ix));
total+=partial.back();
}
// produce the new decay selector
DecayMap newdm;
for(DecaySet::const_iterator it=p.decayModes().begin();
it!=p.decayModes().end();++it) {
tDMPtr mode=*it;
if(mode->orderedProducts().size()!=2||!mode->on()) continue;
// particle antiparticle
long id=abs(mode->orderedProducts()[0]->id());
double br=0;
if(mode->orderedProducts()[0]->id()==-mode->orderedProducts()[1]->id()) {
// quarks
if(id<=6) br = partial[id ]/total;
// leptons
else if(id>=11&&id<=15&&(id-9)%2==0) br = partial[(id+3)/2]/total;
// WW
else if(id==ParticleID::Wplus) br = partial[10 ]/total;
// unknown mode
else continue;
}
else if(mode->orderedProducts()[0]->id()==mode->orderedProducts()[1]->id()) {
// gamma gamma
if(id==ParticleID::Z0) br = partial[11]/total;
else if(id==ParticleID::gamma) br = partial[12]/total;
else if(id==ParticleID::g) br = partial[13]/total;
// unknown mode
else continue;
}
// unknown mode
else continue;
// insert the mode into the new selector
newdm.insert(br,mode);
}
return newdm;
}
// Taken from HERWIG 6510.
Complex SMHiggsWidthGenerator::HwW2(double tau) const {
using Constants::pi;
if (tau > 1.0) {
return sqr(asin(1.0/sqrt(tau)));
}
else if (tau < 1.0) {
double FNsqr = sqrt(1-tau);
double FNlog = log((1+FNsqr)/(1-FNsqr));
return Complex(-0.25 * (sqr(FNlog)-pi*pi),0.5*pi*FNlog);
}
else {
return sqr(0.5*pi);
}
}
Energy SMHiggsWidthGenerator::partialWidth(Energy Mh,unsigned int imode) const {
useMe();
using Constants::pi;
if(Mh!=_qlast) {
_qlast = Mh;
Energy2 q2 = sqr(_qlast);
// couplings
_lambdaQCD = generator()->standardModel()->LambdaQCD(q2);
_alphaEM = generator()->standardModel()->alphaEM();
_alphaS = generator()->standardModel()->alphaS(q2);
// QCD correction factors for H -> f fbar
double nflavour=0.;
for (unsigned int i =1; i <= 6; ++i) if (2.0*_qmass[i] < Mh) nflavour+=1.;
// All calculation are being done for Monte-Carlo QCD Lambda, except Higgs width...
// not needed in C++ as should be normal lambda
// MC only in shower
//double bcoeff4=(11.*_ca-10.)/(12.*pi);
//double kfac=_ca*(67./18.-sqr(pi)/6.)-25./9.;
//_lambdaQCD /= exp(kfac/(4.*pi*bcoeff4))/sqrt(2.);
double k1 = 5./sqr(pi);
double k0 = 3./(4.*sqr(pi));
_beta0 = (11.*_ca-2.0*nflavour)/3.;
double beta1 = (34.*sqr(_ca)-(10.*_ca+6.*_cf)*nflavour)/3.;
_gam0 = -8.;
double gam1 = -404./3.+40.*nflavour/9.;
double SClog = log(sqr(Mh/_lambdaQCD));
- _cd = 1.+(k1/k0-2.*_gam0+_gam0*beta1/sqr(_beta0)*log(SClog)+
- (_gam0*beta1-gam1*_beta0)/sqr(_beta0))/(_beta0*SClog);
+ if(SClog<=0.)
+ _cd = 1.;
+ else
+ _cd = 1.+(k1/k0-2.*_gam0+_gam0*beta1/sqr(_beta0)*log(SClog)+
+ (_gam0*beta1-gam1*_beta0)/sqr(_beta0))/(_beta0*SClog);
_gfermiinv = 8.*_sw2*sqr(_mw)/_alphaEM;
}
// output value
Energy3 output(ZERO);
// quark modes
if(imode<=6) {
Energy mf = _qmass[imode];
double xf = sqr(mf/Mh);
if( xf >= 0.25 ) return ZERO;
if(_widthopt==2) {
if (mf > _lambdaQCD) mf *= pow(log(Mh/_lambdaQCD)/log(mf/_lambdaQCD),
_gam0/(2.0*_beta0));
output = _ca*Mh*sqr(mf)*pow(1.0-4.0*xf,1.5)*_cd;
}
else {
output = _ca*Mh*sqr(mf)*pow(1.0-4.0*xf,1.5);
}
}
// lepton modes
else if(imode<=9) {
Energy mf = _lmass[imode-7];
double xf = sqr(mf/Mh);
if (xf < 0.25) output = Mh*sqr(mf)*pow(1.0-4.0*xf,1.5);
}
// H->W*W*
else if(imode==10) {
if(_widthopt==2) {
double xw = sqr(_mw/Mh);
double yw = _mw*_gamw/sqr(Mh);
output = pow<3,1>(Mh)*HwDoubleBW(xw,yw)/2.;
}
else {
double xfw = sqr(_mw/Mh);
if(2.0*_mw < Mh) output = pow<3,1>(Mh)*sqrt(1-4.0*xfw)*(1-xfw+0.75*sqr(xfw))/2.;
}
}
// H->Z*Z*
else if(imode==11) {
if(_widthopt==2) {
double xz = sqr(_mz/Mh);
double yz = _mz*_gamz/sqr(Mh);
output = pow<3,1>(Mh)*HwDoubleBW(xz,yz)/4.;
}
else {
double xfz = sqr(_mz/Mh);
if (2.0*_mz < Mh) output = pow<3,1>(Mh)*sqrt(1-4.0*xfz)*(1-xfz+0.75*sqr(xfz))/4.;
}
}
// H->gamma gamma
else if(imode==12) {
double taut = sqr(2.0*_qmass[ParticleID::t]/Mh);
double tauw = sqr(2.0*_mw/Mh);
Complex ftaut = HwW2 (taut);
Complex ftauw = HwW2 (tauw);
double re = 4.0/3.0*(-2.0*taut*(1.0+(1.0-taut)*ftaut.real()))+(2.0+3.0*tauw*(1+(2.0-tauw)*ftauw.real()));
double im = 4.0/3.0*(-2.0*taut*( (1.0-taut)*ftaut.imag()))+( 3.0*tauw*( (2.0-tauw)*ftauw.imag()));
output = sqr(_alphaEM/pi)*pow<3,1>(Mh)*(sqr(re)+ sqr(im))/32.;
}
// H -> gg
else if(imode==13) {
double tau = sqr(2.0*_qmass[ParticleID::t]/Mh);
Complex ftau = HwW2(tau);
double re = 1+(1.0-tau)*ftau.real();
double im = (1.0-tau)*ftau.imag();
output = sqr(_alphaS/pi)*pow<3,1>(Mh)*sqr(tau)*(sqr(re)+ sqr(im))/4.;
}
return output/_gfermiinv;
}
// Taken from HERWIG 6510.
double SMHiggsWidthGenerator::HwDoubleBW(double x, double y) const {
// Calculate the Double Breit-Wigner Integral
// x=(mw/mh)**2, y=mw*gw/mh**2
double limit = 0.425;
double nbin = 25;
double itgerl = 0.0;
if (y < 0.0) return itgerl;
if (x > limit) {
// Direct Integration
double fac1 = 0.25/nbin;
for (unsigned int i = 0; i < nbin; ++i) {
double x1 = (i+0.5)*fac1;
double fac2 = (sqr(1-sqrt(x1))-x1)/nbin;
double sq = 1.0;
int j = 0;
while (j < nbin && 0.0 < sq) {
double x2 = (j+0.5)*fac2+x1;
sq = 1.0+x1*x1+x2*x2-2*(x1+x2+x1*x2);
itgerl += 2.0*(sqr(1-x1-x2)+8.0*x1*x2)*sqrt(sq)/(sqr(x1-x)+y*y)*y/(sqr(x2-x)+y*y)*y*fac1*fac2;
++j;
}
}
} else {
// Integration using tan theta substitution
double th1low = atan ((0.0-x)/y);
double th1high = atan ((1.0-x)/y);
double fac1 = (th1high-th1low)/nbin;
for (unsigned int i = 0; i < nbin; ++i) {
double th1 = (i+0.5)*fac1+th1low;
double x1 = y*tan(th1)+x;
double x2max = min(x1,sqr(1-sqrt(x1)));
double th2low = atan ((0-x)/y);
double th2high = atan ((x2max-x)/y);
double fac2 = (th2high-th2low)/nbin;
double sq = 1.0;
int j = 0;
while (j < nbin && 0.0 < sq) {
double th2 = (j+0.5)*fac2+th2low;
double x2 = y*tan(th2)+x;
double sq = 1.0+x1*x1+x2*x2-2*(x1+x2+x1*x2);
itgerl += 2.0*(sqr(1-x1-x2)+8*x1*x2)*sqrt(sq)*fac1*fac2;
++j;
}
}
}
itgerl *= 1/sqr(Constants::pi);
return itgerl;
}
void SMHiggsWidthGenerator::doinit() {
WidthGenerator::doinit();
// extract W and Z mass and width
tPDPtr w = getParticleData(ParticleID::Wplus);
tPDPtr z = getParticleData(ParticleID::Z0);
_mw = w->mass();
_mz = z->mass();
_gamw = w->width();
_gamz = z->width();
// quark masses
for(int ix=1;ix<7;++ix) {
tcPDPtr q = getParticleData(ix);
_qmass[ix] = q->mass();
}
// lepton masses
for ( int ix=0; ix<3; ++ix ) {
tcPDPtr lepton = getParticleData(11+2*ix);
_lmass[ix] = lepton->mass();
}
// sin2 theta_w
_sw2 = generator()->standardModel()->sin2ThetaW();
// casmirs
double ncolour = generator()->standardModel()->Nc();
_ca = ncolour;
_cf = (sqr(ncolour)-1.0)/(2.0*_ca);
// reset the width and set the limits
tPDPtr h0=getParticleData(ParticleID::h0);
Energy wid = width(*h0,h0->mass());
h0->width(wid);
h0->widthCut(_offshell*wid);
}
pair<Energy,Energy> SMHiggsWidthGenerator::width(Energy scale, const ParticleData & p) const {
if(_widthopt==1) return make_pair(p.width(),p.width());
// calculate the partial widths
vector<Energy> partial;
Energy total(ZERO);
for(unsigned int ix=0;ix<14;++ix) {
partial.push_back(partialWidth(scale,ix));
total+=partial.back();
}
// sum for the on modes
Energy partialon(ZERO);
for(DecaySet::const_iterator it=p.decayModes().begin();it!=p.decayModes().end();++it) {
tDMPtr mode=*it;
if(!mode->on()||mode->orderedProducts().size()!=2) continue;
// particle antiparticle
long id=abs(mode->orderedProducts()[0]->id());
if(mode->orderedProducts()[0]->id()==-mode->orderedProducts()[1]->id()) {
// quarks
if(id<=6) partialon += partial[id ];
// leptons
else if(id>=11&&id<=15&&(id-9)%2==0) partialon += partial[(id+3)/2];
// WW
else if(id==ParticleID::Wplus) partialon += partial[10 ];
// unknown mode
else continue;
}
else if(mode->orderedProducts()[0]->id()==mode->orderedProducts()[1]->id()) {
// gamma gamma
if(id==ParticleID::Z0) partialon += partial[11];
else if(id==ParticleID::gamma) partialon += partial[12];
else if(id==ParticleID::g) partialon += partial[13];
// unknown mode
else continue;
}
// unknown mode
else continue;
}
return make_pair(partialon,total);
}
diff --git a/Shower/Base/HardTree.cc b/Shower/Base/HardTree.cc
--- a/Shower/Base/HardTree.cc
+++ b/Shower/Base/HardTree.cc
@@ -1,159 +1,160 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the HardTree class.
//
#include "HardTree.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Repository/CurrentGenerator.h"
using namespace Herwig;
HardTree::HardTree(vector<HardBranchingPtr> branchings,
vector<HardBranchingPtr> spacelike)
: _branchings(branchings.begin(),branchings.end()),
_spacelike (spacelike .begin(),spacelike .end())
{}
void HardBranching::setMomenta(LorentzRotation R,double aparent,
Lorentz5Momentum ptparent,
bool setMomentum) {
if(setMomentum) _original=R*_particle->momentum();
// compute the shower variables
Energy2 dot = _n*_p;
+ if(dot==ZERO) return;
double alpha = (_original*_n)/dot;
_z=alpha/aparent;
double beta = ((_original*_p)-alpha*sqr(_p.mass()))/dot;
_qt=_original-alpha*_p-beta*_n-ptparent;
_pt=sqrt(max(-_qt*_qt,ZERO));
// reconstruct children
for(unsigned int ix=0;ix<_children.size();++ix) {
_children[ix]->_p=_p;
_children[ix]->_n=_n;
_children[ix]->setMomenta(R,alpha,_qt,setMomentum);
}
// calculate the evolution scale and phi
if(!_children.empty()) {
double z = _children[0]->_z;
Energy pt = _children[0]->_pt;
IdList ids(3);
ids[0]=_particle->id();
ids[1]=_children[0]->_particle->id();
ids[2]=_children[1]->_particle->id();
_scale=_sudakov->calculateScale(z,pt,ids,_incoming ? 1 : 0);
// get the pt vector
Lorentz5Momentum vect=_children[0]->_qt;
Boost beta_bb = -(_p+ _n).boostVector();
Lorentz5Momentum p_bb = _p;
vect.boost(beta_bb);
p_bb.boost( beta_bb );
Axis axis(p_bb.vect().unit());
LorentzRotation rot;
if(axis.perp2()>0.) {
double sinth(sqrt(sqr(axis.x())+sqr(axis.y())));
rot.setRotate(-acos(axis.z()),
Axis(-axis.y()/sinth,axis.x()/sinth,0.));
vect.transform(rot);
}
else if(axis.z()<0.) {
vect.setZ(vect.z());
}
_phi= atan2(vect.y(),vect.x());
if(_phi<0.) _phi+=Constants::twopi;
if(_children[1]->_incoming) _phi+=Constants::pi;
}
}
bool HardTree::connect(ShowerTreePtr shower) {
_particles.clear();
// extract the progenitors from the ShowerTree
vector<ShowerProgenitorPtr> progenitors = shower->extractProgenitors();
// connect the trees up
for(set<HardBranchingPtr>::iterator it=branchings().begin();
it!=branchings().end();++it) {
Energy2 dmin(1e30*GeV2);
tShowerParticlePtr partner;
for(unsigned int ix=0;ix<progenitors.size();++ix) {
if((**it).branchingParticle()->id()!=progenitors[ix]->progenitor()->id()) continue;
if((**it).branchingParticle()->isFinalState()!=
progenitors[ix]->progenitor()->isFinalState()) continue;
Energy2 dtest =
sqr(progenitors[ix]->progenitor()->momentum().x()-(**it).showerMomentum().x())+
sqr(progenitors[ix]->progenitor()->momentum().y()-(**it).showerMomentum().y())+
sqr(progenitors[ix]->progenitor()->momentum().z()-(**it).showerMomentum().z())+
sqr(progenitors[ix]->progenitor()->momentum().t()-(**it).showerMomentum().t());
if(dtest<dmin) {
partner = progenitors[ix]->progenitor();
dmin = dtest;
}
}
if(!partner) return false;
connect(partner,*it);
if((**it).incoming()) {
double z((**it).z());
tHardBranchingPtr parent=(**it).parent();
while (parent) {
z *= parent->z();
parent=parent->parent();
}
partner->x(z);
}
}
// return false if not matched
return particles().size()==progenitors.size();
}
HardBranching::HardBranching(ShowerParticlePtr particle, SudakovPtr sudakov,
tHardBranchingPtr parent,bool incoming)
: _particle(particle), _incoming(incoming), _parent(parent),
_sudakov(sudakov)
{}
void HardBranching::fixColours() {
if(!_sudakov) return;
if(!_incoming&&_children.empty()) return;
if(_incoming && !_parent) return;
if(_incoming)
_sudakov->splittingFn()->
colourConnection(_parent->_particle,_particle,
_parent->children()[1]->_particle,true);
else
_sudakov->splittingFn()->
colourConnection(_particle,_children[0]->_particle,
_children[1]->_particle,false);
}
ostream & Herwig::operator<<(ostream & os, const HardTree & x) {
os << "Output of HardTree " << &x << "\n";
for(set<HardBranchingPtr>::const_iterator it=x._branchings.begin();
it!=x._branchings.end();++it) {
os << "Hard Particle: " << *(**it).branchingParticle() << " has Sudakov "
<< (**it).sudakov() << "\n";
os << "It's colour lines are " << (**it).branchingParticle()->colourLine() << "\t"
<< (**it).branchingParticle()->antiColourLine() << "\n";
for(unsigned int iy=0;iy<(**it).children().size();++iy) {
os << "\t Children : " << *(**it).children()[iy]->branchingParticle()
<< "\n";
os << "It's colour lines are "
<< (**it).children()[iy]->branchingParticle()->colourLine() << "\t"
<< (**it).children()[iy]->branchingParticle()->antiColourLine() << "\n";
}
}
for(set<HardBranchingPtr>::const_iterator it=x._spacelike.begin();
it!=x._spacelike.end();++it) {
os << "SpaceLike: " << *(**it).branchingParticle() << " has Sudakov"
<< (**it).sudakov() << "\n";
os << "It's colour lines are "
<< (**it).branchingParticle()->colourLine() << "\t"
<< (**it).branchingParticle()->antiColourLine() << "\n";
for(unsigned int iy=0;iy<(**it).children().size();++iy) {
os << "\t Children: " << *(**it).children()[iy]->branchingParticle()
<< "\n";
os << "It's colour lines are "
<< (**it).children()[iy]->branchingParticle()->colourLine() << "\t"
<< (**it).children()[iy]->branchingParticle()->antiColourLine() << "\n";
}
}
return os;
}
diff --git a/Shower/Base/SudakovFormFactor.cc b/Shower/Base/SudakovFormFactor.cc
--- a/Shower/Base/SudakovFormFactor.cc
+++ b/Shower/Base/SudakovFormFactor.cc
@@ -1,367 +1,388 @@
// -*- C++ -*-
//
// SudakovFormFactor.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the SudakovFormFactor class.
//
#include "SudakovFormFactor.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "Herwig++/Shower/ShowerHandler.h"
#include "ShowerParticle.h"
#include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
#include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
#include "ThePEG/Helicity/FermionSpinInfo.h"
using namespace Herwig;
using namespace ThePEG::Helicity;
void SudakovFormFactor::persistentOutput(PersistentOStream & os) const {
os << splittingFn_ << alpha_ << pdfmax_ << particles_ << pdffactor_
<< a_ << b_ << ounit(c_,GeV) << ounit(kinCutoffScale_,GeV) << cutOffOption_
<< ounit(vgcut_,GeV) << ounit(vqcut_,GeV)
<< ounit(pTmin_,GeV) << ounit(pT2min_,GeV2);
}
void SudakovFormFactor::persistentInput(PersistentIStream & is, int) {
is >> splittingFn_ >> alpha_ >> pdfmax_ >> particles_ >> pdffactor_
>> a_ >> b_ >> iunit(c_,GeV) >> iunit(kinCutoffScale_,GeV) >> cutOffOption_
>> iunit(vgcut_,GeV) >> iunit(vqcut_,GeV)
>> iunit(pTmin_,GeV) >> iunit(pT2min_,GeV2);
}
AbstractClassDescription<SudakovFormFactor> SudakovFormFactor::initSudakovFormFactor;
// Definition of the static class description member.
void SudakovFormFactor::Init() {
static ClassDocumentation<SudakovFormFactor> documentation
("The SudakovFormFactor class is the base class for the implementation of Sudakov"
" form factors in Herwig++");
static Reference<SudakovFormFactor,SplittingFunction>
interfaceSplittingFunction("SplittingFunction",
"A reference to the SplittingFunction object",
&Herwig::SudakovFormFactor::splittingFn_,
false, false, true, false);
static Reference<SudakovFormFactor,ShowerAlpha>
interfaceAlpha("Alpha",
"A reference to the Alpha object",
&Herwig::SudakovFormFactor::alpha_,
false, false, true, false);
static Parameter<SudakovFormFactor,double> interfacePDFmax
("PDFmax",
"Maximum value of PDF weight. ",
&SudakovFormFactor::pdfmax_, 35.0, 1.0, 100000.0,
false, false, Interface::limited);
static Switch<SudakovFormFactor,unsigned int> interfacePDFFactor
("PDFFactor",
"Include additional factors in the overestimate for the PDFs",
&SudakovFormFactor::pdffactor_, 0, false, false);
static SwitchOption interfacePDFFactorOff
(interfacePDFFactor,
"Off",
"Don't include any factors",
0);
static SwitchOption interfacePDFFactorOverZ
(interfacePDFFactor,
"OverZ",
"Include an additional factor of 1/z",
1);
static SwitchOption interfacePDFFactorOverOneMinusZ
(interfacePDFFactor,
"OverOneMinusZ",
"Include an additional factor of 1/(1-z)",
2);
static SwitchOption interfacePDFFactorOverZOneMinusZ
(interfacePDFFactor,
"OverZOneMinusZ",
"Include an additional factor of 1/z/(1-z)",
3);
static Switch<SudakovFormFactor,unsigned int> interfaceCutOffOption
("CutOffOption",
"The type of cut-off to use to end the shower",
&SudakovFormFactor::cutOffOption_, 0, false, false);
static SwitchOption interfaceCutOffOptionDefault
(interfaceCutOffOption,
"Default",
"Use the standard Herwig++ cut-off on virtualities with the minimum"
" virtuality depending on the mass of the branching particle",
0);
static SwitchOption interfaceCutOffOptionFORTRAN
(interfaceCutOffOption,
"FORTRAN",
"Use a FORTRAN-like cut-off on virtualities",
1);
static SwitchOption interfaceCutOffOptionpT
(interfaceCutOffOption,
"pT",
"Use a cut on the minimum allowed pT",
2);
static Parameter<SudakovFormFactor,double> interfaceaParameter
("aParameter",
"The a parameter for the kinematic cut-off",
&SudakovFormFactor::a_, 0.3, -10.0, 10.0,
false, false, Interface::limited);
static Parameter<SudakovFormFactor,double> interfacebParameter
("bParameter",
"The b parameter for the kinematic cut-off",
&SudakovFormFactor::b_, 2.3, -10.0, 10.0,
false, false, Interface::limited);
static Parameter<SudakovFormFactor,Energy> interfacecParameter
("cParameter",
"The c parameter for the kinematic cut-off",
&SudakovFormFactor::c_, GeV, 0.3*GeV, 0.1*GeV, 10.0*GeV,
false, false, Interface::limited);
static Parameter<SudakovFormFactor,Energy>
interfaceKinScale ("cutoffKinScale",
"kinematic cutoff scale for the parton shower phase"
" space (unit [GeV])",
&SudakovFormFactor::kinCutoffScale_, GeV,
2.3*GeV, 0.001*GeV, 10.0*GeV,false,false,false);
static Parameter<SudakovFormFactor,Energy> interfaceGluonVirtualityCut
("GluonVirtualityCut",
"For the FORTRAN cut-off option the minimum virtuality of the gluon",
&SudakovFormFactor::vgcut_, GeV, 0.85*GeV, 0.1*GeV, 10.0*GeV,
false, false, Interface::limited);
static Parameter<SudakovFormFactor,Energy> interfaceQuarkVirtualityCut
("QuarkVirtualityCut",
"For the FORTRAN cut-off option the minimum virtuality added to"
" the mass for particles other than the gluon",
&SudakovFormFactor::vqcut_, GeV, 0.85*GeV, 0.1*GeV, 10.0*GeV,
false, false, Interface::limited);
static Parameter<SudakovFormFactor,Energy> interfacepTmin
("pTmin",
"The minimum pT if using a cut-off on the pT",
&SudakovFormFactor::pTmin_, GeV, 1.0*GeV, ZERO, 10.0*GeV,
false, false, Interface::limited);
}
bool SudakovFormFactor::
PDFVeto(const Energy2 t, const double x,
const tcPDPtr parton0, const tcPDPtr parton1,
Ptr<BeamParticleData>::transient_const_pointer beam) const {
tcPDFPtr pdf;
//using the pdf's associated with the ShowerHandler assures, that
//modified pdf's are used for the secondary interactions via
//CascadeHandler::resetPDFs(...)
if(ShowerHandler::currentHandler()->firstPDF().particle() == beam)
pdf = ShowerHandler::currentHandler()->firstPDF().pdf();
if(ShowerHandler::currentHandler()->secondPDF().particle() == beam)
pdf = ShowerHandler::currentHandler()->secondPDF().pdf();
assert(pdf);
Energy2 theScale = t;
if (theScale < sqr(ShowerHandler::currentHandler()->pdfFreezingScale()))
theScale = sqr(ShowerHandler::currentHandler()->pdfFreezingScale());
double newpdf(0.0), oldpdf(0.0);
//different treatment of MPI ISR is done via CascadeHandler::resetPDFs()
newpdf=pdf->xfx(beam,parton0,theScale,x/z());
oldpdf=pdf->xfx(beam,parton1,theScale,x);
if(newpdf<=0.) return true;
if(oldpdf<=0.) return false;
double ratio = newpdf/oldpdf;
double maxpdf(pdfmax_);
switch (pdffactor_) {
case 1:
maxpdf /= z();
break;
case 2:
maxpdf /= 1.-z();
break;
case 3:
maxpdf /= (z()*(1.-z()));
break;
}
// ratio / PDFMax must be a probability <= 1.0
if (ratio > maxpdf) {
generator()->log() << "PDFVeto warning: Ratio > " << name()
<< ":PDFmax (by a factor of "
<< ratio/maxpdf <<") for "
<< parton0->PDGName() << " to "
<< parton1->PDGName() << "\n";
}
return ratio < UseRandom::rnd()*maxpdf;
}
void SudakovFormFactor::addSplitting(const IdList & in) {
bool add=true;
for(unsigned int ix=0;ix<particles_.size();++ix) {
if(particles_[ix].size()==in.size()) {
bool match=true;
for(unsigned int iy=0;iy<in.size();++iy) {
if(particles_[ix][iy]!=in[iy]) {
match=false;
break;
}
}
if(match) {
add=false;
break;
}
}
}
if(add) particles_.push_back(in);
}
SpinfoPtr SudakovFormFactor::getMapping(RhoDMatrix & rho, RhoDMatrix & mapping,
ShowerParticle & particle,ShoKinPtr showerkin) {
// output spininfo
SpinfoPtr output;
// if the particle is final-state and not from the hard process
if(!particle.perturbative() && particle.isFinalState()) {
// mapping is the identity
mapping=RhoDMatrix(particle.dataPtr()->iSpin());
output=dynamic_ptr_cast<SpinfoPtr>(particle.spinInfo());
// should have spin info
if(!output) {
cerr << " particle does not have spinInfo " << endl;
exit(1);
}
}
// if particle is final-state and is from the hard process
else if(particle.perturbative() && particle.isFinalState()) {
// get the basis vectors
vector<Lorentz5Momentum> basis=showerkin->getBasis();
// we are doing the evolution in the back-to-back frame
// work out the boostvector
Boost boostv(-(basis[0]+basis[1]).boostVector());
// boost the momentum
Lorentz5Momentum porig(basis[0]);porig.boost(boostv);
// now rotate so along the z axis as needed for the splitting functions
Axis axis(porig.vect().unit());
LorentzRotation rot;
if(axis.perp2()>0.) {
double sinth(sqrt(1.-sqr(axis.z())));
rot.setRotate(acos(axis.z()),Axis(-axis.y()/sinth,axis.x()/sinth,0.));
porig.transform(rot);
}
else if(axis.z()>0.) {
porig.setZ(-porig.z());
}
// the rest depends on the spin of the particle
PDT::Spin spin(particle.dataPtr()->iSpin());
mapping=RhoDMatrix(spin);
// do the spin dependent bit
if(spin==PDT::Spin0) {
cerr << "testing spin 0 not yet implemented " << endl;
exit(0);
}
else if(spin==PDT::Spin1Half) {
FermionSpinPtr fspin=dynamic_ptr_cast<FermionSpinPtr>(particle.spinInfo());
// spin info exists get information from it
if(fspin) {
output=fspin;
// rotate the original basis
vector<LorentzSpinor<SqrtEnergy> > sbasis;
for(unsigned int ix=0;ix<2;++ix) {
sbasis.push_back(fspin->getProductionBasisState(ix));
sbasis.back().transform(rot);
}
// splitting basis
vector<LorentzSpinorBar<SqrtEnergy> > fbasis;
SpinorBarWaveFunction wave;
if(particle.id()>0)
wave=SpinorBarWaveFunction(porig,particle.dataPtr(),outgoing);
else
wave=SpinorBarWaveFunction(porig,particle.dataPtr(),incoming);
for(unsigned int ix=0;ix<2;++ix) {
wave.reset(ix);
fbasis.push_back(wave.dimensionedWave());
}
// work out the mapping
for(unsigned int ix=0;ix<2;++ix) {
for(unsigned int iy=0;iy<2;++iy) {
mapping(ix,iy)=sbasis[iy].scalar(fbasis[ix])/2./porig.mass();
if(particle.id()<0){mapping(ix,iy)=conj(mapping(ix,iy));}
cerr << "testing the mapping " << ix << " " << iy << " "
<< mapping(ix,iy) << endl;
}
}
}
// spin info does not exist create it
else {
cerr << "testing no basis case not yet handled " << endl;
exit(1);
}
}
else {
cerr << "testing spin 1 not yet implemented " << endl;
exit(0);
}
}
// set the decayed flag
output->decay();
rho=output->rhoMatrix();
return output;
}
+void SudakovFormFactor::removeSplitting(const IdList & in) {
+ for(vector<IdList>::iterator it=particles_.begin();
+ it!=particles_.end();++it) {
+ if(it->size()==in.size()) {
+ bool match=true;
+ for(unsigned int iy=0;iy<in.size();++iy) {
+ if((*it)[iy]!=in[iy]) {
+ match=false;
+ break;
+ }
+ }
+ if(match) {
+ vector<IdList>::iterator itemp=it;
+ --itemp;
+ particles_.erase(it);
+ it = itemp;
+ }
+ }
+ }
+}
+
Energy2 SudakovFormFactor::guesst(Energy2 t1,unsigned int iopt,
const IdList &ids,
double enhance,bool ident) const {
unsigned int pdfopt = iopt!=1 ? 0 : pdffactor_;
double c =
1./((splittingFn_->integOverP(zlimits_.second,ids,pdfopt) -
splittingFn_->integOverP(zlimits_.first ,ids,pdfopt))*
alpha_->overestimateValue()/Constants::twopi*enhance);
assert(iopt<=2);
if(iopt==1) {
c/=pdfmax_;
if(ident) c*=0.5;
}
else if(iopt==2) c*=-1.;
if(splittingFn_->interactionOrder()==1) {
return t1*pow(UseRandom::rnd(),c);
}
else {
assert(false && "Units are dubious here.");
int nm(splittingFn()->interactionOrder()-1);
c/=Math::powi(alpha_->overestimateValue()/Constants::twopi,nm);
return t1 / pow (1. - nm*c*log(UseRandom::rnd())
* Math::powi(t1*UnitRemoval::InvE2,nm)
,1./double(nm));
}
}
double SudakovFormFactor::guessz (unsigned int iopt, const IdList &ids) const {
unsigned int pdfopt = iopt!=1 ? 0 : pdffactor_;
double lower = splittingFn_->integOverP(zlimits_.first,ids,pdfopt);
return splittingFn_->invIntegOverP
(lower + UseRandom::rnd()*(splittingFn_->integOverP(zlimits_.second,ids,pdfopt) -
lower),ids,pdfopt);
}
void SudakovFormFactor::doinit() {
Interfaced::doinit();
pT2min_ = cutOffOption()==2 ? sqr(pTmin_) : ZERO;
}
diff --git a/Shower/Base/SudakovFormFactor.h b/Shower/Base/SudakovFormFactor.h
--- a/Shower/Base/SudakovFormFactor.h
+++ b/Shower/Base/SudakovFormFactor.h
@@ -1,678 +1,683 @@
// -*- C++ -*-
//
// SudakovFormFactor.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_SudakovFormFactor_H
#define HERWIG_SudakovFormFactor_H
//
// This is the declaration of the SudakovFormFactor class.
//
#include "ThePEG/Interface/Interfaced.h"
#include "Herwig++/Shower/SplittingFunctions/SplittingFunction.h"
#include "Herwig++/Shower/Couplings/ShowerAlpha.h"
#include "Herwig++/Shower/SplittingFunctions/SplittingGenerator.fh"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/PDF/BeamParticleData.h"
#include <cassert>
#include "ThePEG/Helicity/RhoDMatrix.h"
#include "ThePEG/Helicity/SpinInfo.h"
#include "ShowerKinematics.h"
#include "SudakovFormFactor.fh"
namespace Herwig {
using namespace ThePEG;
using ThePEG::Helicity::RhoDMatrix;
using ThePEG::Helicity::SpinfoPtr;
/**
* A typedef for the BeamParticleData
*/
typedef Ptr<BeamParticleData>::transient_const_pointer tcBeamPtr;
/** \ingroup Shower
*
* This is the definition of the Sudakov form factor class. In general this
* is the base class for the implementation of Sudakov form factors in Herwig++.
* The methods generateNextTimeBranching(), generateNextDecayBranching() and
* generateNextSpaceBranching need to be implemented in classes inheriting from this
* one.
*
* In addition a number of methods are implemented to assist with the calculation
* of the form factor using the veto algorithm in classes inheriting from this one.
*
* In general the Sudakov form-factor, for final-state radiation, is given
* by
* \f[\Delta_{ba}(\tilde{q}_{i+1},\tilde{q}_i)=
* \exp\left\{
* -\int^{\tilde{q}^2_i}_{\tilde{q}^2_{i+1}}
* \frac{{\rm d}\tilde{q}^2}{\tilde{q}^2}
* \int\frac{\alpha_S(z,\tilde{q})}{2\pi}
* P_{ba}(z,\tilde{q})\Theta(p_T)
* \right\}.
* \f]
* We can solve this to obtain the next value of the scale \f$\tilde{q}_{i+1}\f$
* given the previous value \f$\tilde{q}_i\f$
* in the following way. First we obtain a simplified form of the integrand
* which is greater than or equal to the true integrand for all values of
* \f$\tilde{q}\f$.
*
* In practice it is easiest to obtain this over estimate in pieces. The ShowerAlpha
* object contains an over estimate for \f$\alpha_S\f$, the splitting function
* contains both an over estimate of the spltting function and its integral
* which is needed to compute the over estimate of the \f$\tilde{q}\f$ integrand,
* together with an over estimate of the limit of the \f$z\f$ integral.
*
* This gives an overestimate of the integrand
* \f[g(\tilde{q}^2) = \frac{c}{\tilde{q}^2}, \f]
* where because the over estimates are chosen to be independent of \f$\tilde{q}\f$ the
* parameter
* \f[c = \frac{\alpha_{\rm over}}{2\pi}\int^{z_1}_{z_0}P_{\rm over}(z),\f]
* is a constant independent of \f$\tilde{q}\f$.
*
* The guesst() member can then be used to generate generate the value of
* \f$\tilde{q}^2\f$ according to this result. This is done by solving the Sudakov
* form factor, with the over estimates, is equal to a random number
* \f$r\f$ in the interval \f$[0,1]\f$. This gives
* \f[\tilde{q}^2_{i+1}=G^{-1}\left[G(\tilde{q}^2_i)+\ln r\right],\f]
* where \f$G(\tilde{q}^2)=c\ln(\tilde{q}^2)\f$ is the infinite integral
* of \f$g(\tilde{q}^2)\f$ and \f$G^{-1}(x)=\exp\left(\frac{x}c\right)\f$
* is its inverse.
* It this case we therefore obtain
* \f[\tilde{q}^2_{i+1}=\tilde{q}^2_ir^{\frac1c}.\f]
* The value of \f$z\f$ can then be calculated in a similar way
* \f[z = I^{-1}\left[I(z_0)+r\left(I(z_1)-I(z_0)\right)\right],\f]
* using the guessz() member,
* where \f$I=\int P(z){\rm d}z\f$ and \f$I^{-1}\f$ is its inverse.
*
* The veto algorithm then uses rejection using the ratio of the
* true value to the overestimated one to obtain the original distribution.
* This is accomplished using the
* - alphaSVeto() member for the \f$\alpha_S\f$ veto
* - SplittingFnVeto() member for the veto on the value of the splitting function.
* in general there must also be a chech that the emission is in the allowed
* phase space but this is left to the inheriting classes as it will depend
* on the ordering variable.
*
* The Sudakov form factor for the initial-scale shower is different because
* it must include the PDF which guides the backward evolution.
* It is given by
* \f[\Delta_{ba}(\tilde{q}_{i+1},\tilde{q}_i)=
* \exp\left\{
* -\int^{\tilde{q}^2_i}_{\tilde{q}^2_{i+1}}
* \frac{{\rm d}\tilde{q}^2}{\tilde{q}^2}
* \int\frac{\alpha_S(z,\tilde{q})}{2\pi}
* P_{ba}(z,\tilde{q})\frac{x'f_a(\frac{x}z,\tilde{q}^2)}{xf_b(x,\tilde{q^2})}
* \right\},
* \f]
* where \f$x\f$ is the fraction of the beam momentum the parton \f$b\f$ had before
* the backward evolution.
* This can be solve in the same way as for the final-state branching but the constant
* becomes
* \f[c = \frac{\alpha_{\rm over}}{2\pi}\int^{z_1}_{z_0}P_{\rm over}(z)PDF_{\rm max},\f]
* where
* \f[PDF_{\rm max}=\max\frac{x'f_a(\frac{x}z,\tilde{q}^2)}{xf_b(x,\tilde{q^2})},\f]
* which can be set using an interface.
* In addition the PDFVeto() member then is needed to implement the relevant veto.
*
* @see SplittingGenerator
* @see SplittingFunction
* @see ShowerAlpha
* @see \ref SudakovFormFactorInterfaces "The interfaces"
* defined for SudakovFormFactor.
*/
class SudakovFormFactor: public Interfaced {
/**
* The SplittingGenerator is a friend to insert the particles in the
* branchings at initialisation
*/
friend class SplittingGenerator;
protected:
/**
* Type def to make things easier
*/
typedef Ptr<BeamParticleData>::transient_const_pointer tcBeamPtr;
public:
/**
* The default constructor.
*/
SudakovFormFactor() : pdfmax_(35.0), pdffactor_(0),
cutOffOption_(0), a_(0.3), b_(2.3), c_(0.3*GeV),
kinCutoffScale_( 2.3*GeV ), vgcut_(0.85*GeV),
vqcut_(0.85*GeV), pTmin_(1.*GeV), pT2min_(ZERO),
z_( 0.0 ),phi_(0.0), pT_() {}
/**
* Members to generate the scale of the next branching
*/
//@{
/**
* Return the scale of the next time-like branching. If there is no
* branching then it returns ZERO.
* @param startingScale starting scale for the evolution
* @param ids The PDG codes of the particles in the splitting
* @param cc Whether this is the charge conjugate of the branching
* @param enhance The radiation enhancement factor
* defined.
*/
virtual ShoKinPtr generateNextTimeBranching(const Energy startingScale,
const IdList &ids,const bool cc,
double enhance)=0;
/**
* Return the scale of the next space-like decay branching. If there is no
* branching then it returns ZERO.
* @param startingScale starting scale for the evolution
* @param stoppingScale stopping scale for the evolution
* @param minmass The minimum mass allowed for the spake-like particle.
* @param ids The PDG codes of the particles in the splitting
* @param cc Whether this is the charge conjugate of the branching
* defined.
* @param enhance The radiation enhancement factor
*/
virtual ShoKinPtr generateNextDecayBranching(const Energy startingScale,
const Energy stoppingScale,
const Energy minmass,
const IdList &ids,
const bool cc,
double enhance)=0;
/**
* Return the scale of the next space-like branching. If there is no
* branching then it returns ZERO.
* @param startingScale starting scale for the evolution
* @param ids The PDG codes of the particles in the splitting
* @param x The fraction of the beam momentum
* @param cc Whether this is the charge conjugate of the branching
* defined.
* @param beam The beam particle
* @param enhance THe radiation enhancement factor
*/
virtual ShoKinPtr generateNextSpaceBranching(const Energy startingScale,
const IdList &ids,double x,
const bool cc,double enhance,
tcBeamPtr beam)=0;
//@}
/**
* Generate the azimuthal angle of the branching
* @param particle The branching particle
* @param ids The PDG codes of the particles in the branchings
* @param The Shower kinematics
*/
virtual double generatePhi(ShowerParticle & particle,const IdList & ids,
ShoKinPtr kinematics)=0;
/**
* Methods to provide public access to the private member variables
*/
//@{
/**
* Return the pointer to the SplittingFunction object.
*/
tSplittingFnPtr splittingFn() const { return splittingFn_; }
/**
* Return the pointer to the ShowerAlpha object.
*/
tShowerAlphaPtr alpha() const { return alpha_; }
//@}
public:
/**
* Methods to access the kinematic variables for the branching
*/
//@{
/**
* The energy fraction
*/
double z() const { return z_; }
/**
* The azimuthal angle
*/
double phi() const { return phi_; }
/**
* The transverse momentum
*/
Energy pT() const { return pT_; }
//@}
/**
* Access the maximum weight for the PDF veto
*/
double pdfMax() const { return pdfmax_;}
/**
* Method to return the evolution scale given the
* transverse momentum, \f$p_T\f$ and \f$z\f$.
*/
virtual Energy calculateScale(double z, Energy pt, IdList ids,unsigned int iopt)=0;
/**
* Method to create the ShowerKinematics object for a final-state branching
*/
virtual ShoKinPtr createFinalStateBranching(Energy scale,double z,
double phi, Energy pt)=0;
/**
* Method to create the ShowerKinematics object for an initial-state branching
*/
virtual ShoKinPtr createInitialStateBranching(Energy scale,double z,
double phi, Energy pt)=0;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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 Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
protected:
/**
* Methods to implement the veto algorithm to generate the scale of
* the next branching
*/
//@{
/**
* Value of the energy fraction for the veto algorithm
* @param iopt The option for calculating z
* @param ids The PDG codes of the particles in the splitting
* - 0 is final-state
* - 1 is initial-state for the hard process
* - 2 is initial-state for particle decays
*/
double guessz (unsigned int iopt, const IdList &ids) const;
/**
* Value of the scale for the veto algorithm
* @param t1 The starting valoe of the scale
* @param iopt The option for calculating t
* @param ids The PDG codes of the particles in the splitting
* - 0 is final-state
* - 1 is initial-state for the hard process
* - 2 is initial-state for particle decays
* @param enhance The radiation enhancement factor
* @param identical Whether or not the outgoing particles are identical
*/
Energy2 guesst (Energy2 t1,unsigned int iopt, const IdList &ids,
double enhance, bool identical) const;
/**
* Veto on the PDF for the initial-state shower
* @param t The scale
* @param x The fraction of the beam momentum
* @param parton0 Pointer to the particleData for the
* new parent (this is the particle we evolved back to)
* @param parton1 Pointer to the particleData for the
* original particle
* @param beam The BeamParticleData object
*/
bool PDFVeto(const Energy2 t, const double x,
const tcPDPtr parton0, const tcPDPtr parton1,
tcBeamPtr beam) const;
/**
* The veto on the splitting function.
* @param t The scale
* @param ids The PDG codes of the particles in the splitting
* @param mass Whether or not to use the massive splitting functions
* @return true if vetoed
*/
bool SplittingFnVeto(const Energy2 t,
const IdList &ids,
const bool mass) const
{ return UseRandom::rnd()>splittingFn_->ratioP(z_, t, ids,mass); }
/**
* The veto on the coupling constant
* @param pt2 The value of ther transverse momentum squared, \f$p_T^2\f$.
* @return true if vetoed
*/
bool alphaSVeto(const Energy2 pt2) const
{return UseRandom::rnd() > Math::powi(alpha_->ratio(pt2),
splittingFn_->interactionOrder());}
//@}
/**
* Methods to set the kinematic variables for the branching
*/
//@{
/**
* The energy fraction
*/
void z(double in) { z_=in; }
/**
* The azimuthal angle
*/
void phi(double in) { phi_=in; }
/**
* The transverse momentum
*/
void pT(Energy in) { pT_=in; }
//@}
/**
* Set/Get the limits on the energy fraction for the splitting
*/
//@{
/**
* Get the limits
*/
pair<double,double> zLimits() const { return zlimits_;}
/**
* Set the limits
*/
void zLimits(pair<double,double> in) { zlimits_=in; }
//@}
/**
* Set the particles in the splittings
*/
void addSplitting(const IdList &);
/**
+ * Delete the particles in the splittings
+ */
+ void removeSplitting(const IdList &);
+
+ /**
* Access the potential branchings
*/
vector<IdList> particles() const { return particles_; }
/**
* For a particle which came from the hard process get the spin density and
* the mapping required to the basis used in the Shower
* @param rho The \f$\rho\f$ matrix
* @param mapping The mapping
* @param particle The particle
* @param showerkin The ShowerKinematics object
*/
SpinfoPtr getMapping(RhoDMatrix & rho, RhoDMatrix & map,
ShowerParticle & particle,ShoKinPtr showerkin);
/**
* Methods to set the member variables for inheriting classes
*/
//@{
/**
* Method to set the SplittingFunction
*/
void splittingFn(tSplittingFnPtr in) { splittingFn_ = in;}
/**
* Method to set the coupling
*/
void alpha(tShowerAlphaPtr in) { alpha_ = in; }
/**
* Method to set the maximum PDF weight
*/
void pdfMax(double in) { pdfmax_ = in;}
/**
* Get the option for the PDF factor
*/
unsigned int PDFFactor() const { return pdffactor_; }
//@}
public:
/**
* @name Methods for the cut-off
*/
//@{
/**
* The option being used
*/
unsigned int cutOffOption() const { return cutOffOption_; }
/**
* The kinematic scale
*/
Energy kinScale() const {return kinCutoffScale_;}
/**
* The virtuality cut-off on the gluon \f$Q_g=\frac{\delta-am_q}{b}\f$
* @param scale The scale \f$\delta\f$
* @param mq The quark mass \f$m_q\f$.
*/
Energy kinematicCutOff(Energy scale, Energy mq) const
{return max((scale -a_*mq)/b_,c_);}
/**
* The virtualilty cut-off for gluons
*/
Energy vgCut() const { return vgcut_; }
/**
* The virtuality cut-off for everything else
*/
Energy vqCut() const { return vqcut_; }
/**
* The minimum \f$p_T\f$ for the branching
*/
Energy pTmin() const { return pTmin_; }
/**
* The square of the minimum \f$p_T\f$
*/
Energy2 pT2min() const { return pT2min_; }
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is an abstract class with persistent data.
*/
static AbstractClassDescription<SudakovFormFactor> initSudakovFormFactor;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
SudakovFormFactor & operator=(const SudakovFormFactor &);
private:
/**
* Pointer to the splitting function for this Sudakov form factor
*/
SplittingFnPtr splittingFn_;
/**
* Pointer to the coupling for this Sudakov form factor
*/
ShowerAlphaPtr alpha_;
/**
* Maximum value of the PDF weight
*/
double pdfmax_;
/**
* List of the particles this Sudakov is used for to aid in setting up
* interpolation tables if needed
*/
vector<IdList> particles_;
/**
* Option for the inclusion of a factor \f$1/(1-z)\f$ in the PDF estimate
*/
unsigned pdffactor_;
private:
/**
* Option for the type of cut-off to be applied
*/
unsigned int cutOffOption_;
/**
* Parameters for the default Herwig++ cut-off option, i.e. the parameters for
* the \f$Q_g=\max(\frac{\delta-am_q}{b},c)\f$ kinematic cut-off
*/
//@{
/**
* The \f$a\f$ parameter
*/
double a_;
/**
* The \f$b\f$ parameter
*/
double b_;
/**
* The \f$c\f$ parameter
*/
Energy c_;
/**
* Kinematic cutoff used in the parton shower phase space.
*/
Energy kinCutoffScale_;
//@}
/**
* Parameters for the FORTRAN-like cut-off
*/
//@{
/**
* The virtualilty cut-off for gluons
*/
Energy vgcut_;
/**
* The virtuality cut-off for everything else
*/
Energy vqcut_;
//@}
/**
* Parameters for the \f$p_T\f$ cut-off
*/
//@{
/**
* The minimum \f$p_T\f$ for the branching
*/
Energy pTmin_;
/**
* The square of the minimum \f$p_T\f$
*/
Energy2 pT2min_;
//@}
private:
/**
* Member variables to keep the shower kinematics information
* generated by a call to generateNextTimeBranching or generateNextSpaceBranching
*/
//@{
/**
* The energy fraction
*/
double z_;
/**
* The azimuthal angle
*/
double phi_;
/**
* The transverse momentum
*/
Energy pT_;
//@}
/**
* The limits of \f$z\f$ in the splitting
*/
pair<double,double> zlimits_;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of SudakovFormFactor. */
template <>
struct BaseClassTrait<Herwig::SudakovFormFactor,1> {
/** Typedef of the first base class of SudakovFormFactor. */
typedef Interfaced NthBase;
};
/** This template specialization informs ThePEG about the name of
* the SudakovFormFactor class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::SudakovFormFactor>
: public ClassTraitsBase<Herwig::SudakovFormFactor> {
/** Return a platform-independent class name */
static string className() { return "Herwig::SudakovFormFactor"; }
/**
* The name of a file containing the dynamic library where the class
* SudakovFormFactor is implemented. It may also include several, space-separated,
* libraries if the class SudakovFormFactor 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 "HwShower.so"; }
};
/** @endcond */
}
#endif /* HERWIG_SudakovFormFactor_H */
diff --git a/Shower/Default/MECorrections/VectorBosonQQBarMECorrection.cc b/Shower/Default/MECorrections/VectorBosonQQBarMECorrection.cc
--- a/Shower/Default/MECorrections/VectorBosonQQBarMECorrection.cc
+++ b/Shower/Default/MECorrections/VectorBosonQQBarMECorrection.cc
@@ -1,502 +1,509 @@
// -*- C++ -*-
//
// VectorBosonQQBarMECorrection.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the VectorBosonQQBarMECorrection class.
//
#include "VectorBosonQQBarMECorrection.h"
#include "Herwig++/Shower/Base/ShowerParticle.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Handlers/EventHandler.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "Herwig++/Shower/Base/Evolver.h"
#include "Herwig++/Shower/Base/KinematicsReconstructor.h"
#include "Herwig++/Shower/Base/PartnerFinder.h"
using namespace Herwig;
const double VectorBosonQQBarMECorrection::EPS=0.00000001;
-NoPIOClassDescription<VectorBosonQQBarMECorrection> VectorBosonQQBarMECorrection::initVectorBosonQQBarMECorrection;
+NoPIOClassDescription<VectorBosonQQBarMECorrection>
+VectorBosonQQBarMECorrection::initVectorBosonQQBarMECorrection;
// Definition of the static class description member.
IBPtr VectorBosonQQBarMECorrection::clone() const {
return new_ptr(*this);
}
IBPtr VectorBosonQQBarMECorrection::fullclone() const {
return new_ptr(*this);
}
void VectorBosonQQBarMECorrection::Init() {
static ClassDocumentation<VectorBosonQQBarMECorrection> documentation
("The VectorBosonQQBarMECorrection class implements the matrix"
" element correction for e+e- -> q qbar and Z/W-> q qbar");
}
bool VectorBosonQQBarMECorrection::canHandle(ShowerTreePtr tree,
double & initial, double & final,
EvolverPtr evolver) {
// check radiation on
if(!evolver->isFSRadiationON()) return false;
// check 2 outgoing particles
if(tree->outgoingLines().size()!=2) return false;
// check 1 or 2 incoming particles
if(tree->incomingLines().size()!=1&&tree->incomingLines().size()!=2) return false;
// if one incoming particle must be W/Z or gamma
int id[2];
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator cit;
cit=tree->incomingLines().begin();
id[0]=cit->first->progenitor()->id();
if(tree->incomingLines().size()==1) {
if(abs(id[0])!=ParticleID::Wplus&&id[0]!=ParticleID::Z0&&
abs(id[0])!=ParticleID::gamma) return false;
}
// check incoming leptons beams
else {
++cit;
id[1]=cit->first->progenitor()->id();
if(id[0]!=-id[1]||abs(id[0])>15||abs(id[0])<11||abs(id[0])%2!=1) return false;
}
map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator cjt;
// check outgoing quarks
cjt=tree->outgoingLines().begin();
id[0]=cjt->first->progenitor()->id();
++cjt;
id[1]=cjt->first->progenitor()->id();
- if(id[0]!=-id[1]||abs(id[0])>6) return false;
+ if(float(id[0])/float(id[1])>0 || abs(id[0])>6 || abs(id[1])>6 )
+ return false;
// get the quark and antiquark
ParticleVector qq;
for(cjt=tree->outgoingLines().begin();cjt!=tree->outgoingLines().end();++cjt)
qq.push_back(cjt->first->copy());
// ensure quark first
if(qq[0]->id()<0) swap(qq[0],qq[1]);
// centre of mass energy
d_Q = (qq[0]->momentum() + qq[1]->momentum()).m();
// quark mass
d_m = 0.5*(qq[0]->momentum().m()+qq[1]->momentum().m());
// set the other parameters
setRho(sqr(d_m/d_Q));
setKtildeSymm();
// otherwise can do it
initial=1.;
final =1.;
return true;
}
void VectorBosonQQBarMECorrection::
applyHardMatrixElementCorrection(ShowerTreePtr tree) {
// get the quark and antiquark
ParticleVector qq;
map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator cit;
for(cit=tree->outgoingLines().begin();cit!=tree->outgoingLines().end();++cit)
qq.push_back(cit->first->copy());
// ensure quark first
if(qq[0]->id()<0) swap(qq[0],qq[1]);
// get the momenta
vector<Lorentz5Momentum> newfs = applyHard(qq);
// return if no emission
if(newfs.size()!=3) return;
// perform final check to ensure energy greater than constituent mass
for (int i=0; i<2; i++) {
if (newfs[i].e() < qq[i]->data().constituentMass()) return;
}
if (newfs[2].e() < getParticleData(ParticleID::g)->constituentMass())
return;
// set masses
for (int i=0; i<2; i++) newfs[i].setMass(qq[i]->mass());
newfs[2].setMass(ZERO);
// decide which particle emits
bool firstEmits=
newfs[2].vect().perp2(newfs[0].vect())<
newfs[2].vect().perp2(newfs[1].vect());
// create the new quark, antiquark and gluon
PPtr newg = getParticleData(ParticleID::g)->produceParticle(newfs[2]);
PPtr newq,newa;
if(firstEmits) {
- newq = getParticleData(abs(qq[0]->id()))->produceParticle(newfs[0]);
+ newq = qq[0]->dataPtr()->produceParticle(newfs[0]);
newa = new_ptr(Particle(*qq[1]));
qq[1]->antiColourLine()->removeAntiColoured(newa);
newa->set5Momentum(newfs[1]);
}
else {
newq = new_ptr(Particle(*qq[0]));
qq[0]->colourLine()->removeColoured(newq);
newq->set5Momentum(newfs[0]);
- newa = getParticleData(-abs(qq[0]->id()))->produceParticle(newfs[1]);
+ newa = qq[1]->dataPtr()->produceParticle(newfs[1]);
}
// get the original colour line
ColinePtr col;
if(qq[0]->id()>0) col=qq[0]->colourLine();
else col=qq[0]->antiColourLine();
// set the colour lines
if(firstEmits) {
col->addColoured(newq);
col->addAntiColoured(newg);
newa->colourNeighbour(newg);
}
else {
col->addAntiColoured(newa);
col->addColoured(newg);
newq->antiColourNeighbour(newg);
}
// change the existing quark and antiquark
PPtr orig;
for(cit=tree->outgoingLines().begin();cit!=tree->outgoingLines().end();++cit) {
if(cit->first->progenitor()->id()==newq->id()) {
// remove old particles from colour line
col->removeColoured(cit->first->copy());
col->removeColoured(cit->first->progenitor());
// insert new particles
cit->first->copy(newq);
ShowerParticlePtr sp(new_ptr(ShowerParticle(*newq,1,true)));
cit->first->progenitor(sp);
tree->outgoingLines()[cit->first]=sp;
cit->first->perturbative(!firstEmits);
if(firstEmits) orig=cit->first->original();
}
else {
// remove old particles from colour line
col->removeAntiColoured(cit->first->copy());
col->removeColoured(cit->first->progenitor());
// insert new particles
cit->first->copy(newa);
ShowerParticlePtr sp(new_ptr(ShowerParticle(*newa,1,true)));
cit->first->progenitor(sp);
tree->outgoingLines()[cit->first]=sp;
cit->first->perturbative(firstEmits);
if(!firstEmits) orig=cit->first->original();
}
}
// add the gluon
ShowerParticlePtr sg=new_ptr(ShowerParticle(*newg,1,true));
ShowerProgenitorPtr gluon=new_ptr(ShowerProgenitor(orig,newg,sg));
gluon->perturbative(false);
tree->outgoingLines().insert(make_pair(gluon,sg));
tree->hardMatrixElementCorrection(true);
}
vector<Lorentz5Momentum> VectorBosonQQBarMECorrection::
applyHard(const ParticleVector &p) {
double x, xbar;
vector<Lorentz5Momentum> fs;
// return if no emission
if (getHard(x, xbar) < UseRandom::rnd() || p.size() != 2) return fs;
// centre of mass energy
Lorentz5Momentum pcm = p[0]->momentum() + p[1]->momentum();
// momenta of quark,antiquark and gluon
Lorentz5Momentum pq, pa, pg;
if (p[0]->id() > 0) {
pq = p[0]->momentum();
pa = p[1]->momentum();
} else {
pa = p[0]->momentum();
pq = p[1]->momentum();
}
// boost to boson rest frame
Boost beta = (pcm.findBoostToCM());
pq.boost(beta);
pa.boost(beta);
// return if fails ?????
double xg = 2.-x-xbar;
if((1.-x)*(1.-xbar)*(1.-xg) < d_rho*xg*xg) return fs;
Axis u1, u2, u3;
// moduli of momenta in units of Q and cos theta
// stick to q direction?
// p1 is the one that is kept, p2 is the other fermion, p3 the gluon.
Energy e1, e2, e3;
Energy pp1, pp2, pp3;
bool keepq = true;
if (UseRandom::rnd() > sqr(x)/(sqr(x)+sqr(xbar)))
keepq = false;
if (keepq) {
pp1 = d_Q*sqrt(sqr(x)-4.*d_rho)/2.;
pp2 = d_Q*sqrt(sqr(xbar)-4.*d_rho)/2.;
e1 = d_Q*x/2.;
e2 = d_Q*xbar/2.;
u1 = pq.vect().unit();
} else {
pp2 = d_Q*sqrt(sqr(x)-4.*d_rho)/2.;
pp1 = d_Q*sqrt(sqr(xbar)-4.*d_rho)/2.;
e2 = d_Q*x/2.;
e1 = d_Q*xbar/2.;
u1 = pa.vect().unit();
}
pp3 = d_Q*xg/2.;
e3 = pp3;
u2 = u1.orthogonal();
u2 /= u2.mag();
u3 = u1.cross(u2);
u3 /= u3.mag();
double ct2=-2., ct3=-2.;
if (pp1 == ZERO || pp2 == ZERO || pp3 == ZERO) {
bool touched = false;
if (pp1 == ZERO) {
ct2 = 1;
ct3 = -1;
touched = true;
}
if (pp2 == ZERO || pp3 == ZERO) {
ct2 = 1;
ct3 = 1;
touched = true;
}
if (!touched)
throw Exception() << "VectorBosonQQBarMECorrection::applyHard()"
<< " did not set ct2/3"
<< Exception::abortnow;
} else {
ct3 = (sqr(pp1)+sqr(pp3)-sqr(pp2))/(2.*pp1*pp3);
ct2 = (sqr(pp1)+sqr(pp2)-sqr(pp3))/(2.*pp1*pp2);
}
double phi = Constants::twopi*UseRandom::rnd();
double cphi = cos(phi);
double sphi = sin(phi);
double st2 = sqrt(1.-sqr(ct2));
double st3 = sqrt(1.-sqr(ct3));
ThreeVector<Energy> pv1, pv2, pv3;
pv1 = pp1*u1;
pv2 = -ct2*pp2*u1 + st2*cphi*pp2*u2 + st2*sphi*pp2*u3;
pv3 = -ct3*pp3*u1 - st3*cphi*pp3*u2 - st3*sphi*pp3*u3;
if (keepq) {
pq = Lorentz5Momentum(pv1, e1);
pa = Lorentz5Momentum(pv2, e2);
} else {
pa = Lorentz5Momentum(pv1, e1);
pq = Lorentz5Momentum(pv2, e2);
}
pg = Lorentz5Momentum(pv3, e3);
pq.boost(-beta);
pa.boost(-beta);
pg.boost(-beta);
fs.push_back(pq);
fs.push_back(pa);
fs.push_back(pg);
return fs;
}
double VectorBosonQQBarMECorrection::getHard(double &x1, double &x2) {
double w = 0.0;
double y1 = UseRandom::rnd(),y2 = UseRandom::rnd();
// simply double MC efficiency
// -> weight has to be divided by two (Jacobian)
if (y1 + y2 > 1) {
y1 = 1.-y1;
y2 = 1.-y2;
}
bool inSoft = false;
if (y1 < 0.25) {
if (y2 < 0.25) {
inSoft = true;
if (y1 < y2) {
y1 = 0.25-y1;
y2 = y1*(1.5 - 2.*y2);
} else {
y2 = 0.25 - y2;
y1 = y2*(1.5 - 2.*y1);
}
} else {
if (y2 < y1 + 2.*sqr(y1)) return w;
}
} else {
if (y2 < 0.25) {
if (y1 < y2 + 2.*sqr(y2)) return w;
}
}
// inside PS?
x1 = 1.-y1;
x2 = 1.-y2;
if(y1*y2*(1.-y1-y2) < d_rho*sqr(y1+y2)) return w;
double k1 = getKfromX(x1, x2);
double k2 = getKfromX(x2, x1);
// Is it in the quark emission zone?
if (k1 < d_kt1) return 0.0;
// No...is it in the anti-quark emission zone?
if (k2 < d_kt2) return 0.0;
// Point is in dead zone: compute q qbar g weight
w = MEV(x1, x2);
// for axial:
// w = MEA(x1, x2);
// Reweight soft region
if (inSoft) {
if (y1 < y2) w *= 2.*y1;
else w *= 2.*y2;
}
// alpha and colour factors
Energy2 pt2 = sqr(d_Q)*(1.-x1)*(1.-x2);
w *= 1./3./Constants::pi*coupling()->value(pt2);
return w;
}
bool VectorBosonQQBarMECorrection::
softMatrixElementVeto(ShowerProgenitorPtr initial,ShowerParticlePtr parent,Branching br)
{
// check we should be applying the veto
if(parent->id()!=initial->progenitor()->id()||
br.ids[0]!=br.ids[1]||
br.ids[2]!=ParticleID::g) return false;
// calculate pt
double d_z = br.kinematics->z();
Energy d_qt = br.kinematics->scale();
Energy2 d_m2 = parent->momentum().m2();
- Energy pPerp = (1.-d_z)*sqrt( sqr(d_z*d_qt) - d_m2);
+ Energy2 pPerp2 = sqr(d_z*d_qt) - d_m2;
+ if(pPerp2<ZERO) {
+ parent->setEvolutionScale(br.kinematics->scale());
+ return true;
+ }
+ Energy pPerp = (1.-d_z)*sqrt(pPerp2);
// if not hardest so far don't apply veto
if(pPerp<initial->highestpT()) return false;
// calculate the weight
double weight = 0.;
if(parent->id()>0) weight = qWeightX(d_qt, d_z);
else weight = qbarWeightX(d_qt, d_z);
// compute veto from weight
bool veto = !UseRandom::rndbool(weight);
// if not vetoed reset max
if(!veto) initial->highestpT(pPerp);
// if vetoing reset the scale
if(veto) parent->setEvolutionScale(br.kinematics->scale());
// return the veto
return veto;
}
void VectorBosonQQBarMECorrection::setRho(double r)
{
d_rho = r;
d_v = sqrt(1.-4.*d_rho);
}
void VectorBosonQQBarMECorrection::setKtildeSymm() {
d_kt1 = (1. + sqrt(1. - 4.*d_rho))/2.;
setKtilde2();
}
void VectorBosonQQBarMECorrection::setKtilde2() {
double num = d_rho * d_kt1 + 0.25 * d_v *(1.+d_v)*(1.+d_v);
double den = d_kt1 - d_rho;
d_kt2 = num/den;
}
double VectorBosonQQBarMECorrection::getZfromX(double x1, double x2) {
double uval = u(x2);
double num = x1 - (2. - x2)*uval;
double den = sqrt(x2*x2 - 4.*d_rho);
return uval + num/den;
}
double VectorBosonQQBarMECorrection::getKfromX(double x1, double x2) {
double zval = getZfromX(x1, x2);
return (1.-x2)/(zval*(1.-zval));
}
double VectorBosonQQBarMECorrection::MEV(double x1, double x2) {
// Vector part
double num = (x1+2.*d_rho)*(x1+2.*d_rho) + (x2+2.*d_rho)*(x2+2.*d_rho)
- 8.*d_rho*(1.+2.*d_rho);
double den = (1.+2.*d_rho)*(1.-x1)*(1.-x2);
return (num/den - 2.*d_rho/((1.-x1)*(1.-x1))
- 2*d_rho/((1.-x2)*(1.-x2)))/d_v;
}
double VectorBosonQQBarMECorrection::MEA(double x1, double x2) {
// Axial part
double num = (x1+2.*d_rho)*(x1+2.*d_rho) + (x2+2.*d_rho)*(x2+2.*d_rho)
+ 2.*d_rho*((5.-x1-x2)*(5.-x1-x2) - 19.0 + 4*d_rho);
double den = d_v*d_v*(1.-x1)*(1.-x2);
return (num/den - 2.*d_rho/((1.-x1)*(1.-x1))
- 2*d_rho/((1.-x2)*(1.-x2)))/d_v;
}
double VectorBosonQQBarMECorrection::u(double x2) {
return 0.5*(1. + d_rho/(1.-x2+d_rho));
}
void VectorBosonQQBarMECorrection::
getXXbar(double kti, double z, double &x, double &xbar) {
double w = sqr(d_v) + kti*(-1. + z)*z*(2. + kti*(-1. + z)*z);
if (w < 0) {
x = -1.;
xbar = -1;
} else {
x = (1. + sqr(d_v)*(-1. + z) + sqr(kti*(-1. + z))*z*z*z
+ z*sqrt(w)
- kti*(-1. + z)*z*(2. + z*(-2 + sqrt(w))))/
(1. - kti*(-1. + z)*z + sqrt(w));
xbar = 1. + kti*(-1. + z)*z;
}
}
double VectorBosonQQBarMECorrection::qWeight(double x, double xbar) {
double rval;
double xg = 2. - xbar - x;
// always return one in the soft gluon region
if(xg < EPS) return 1.0;
// check it is in the phase space
if((1.-x)*(1.-xbar)*(1.-xg) < d_rho*xg*xg) return 0.0;
double k1 = getKfromX(x, xbar);
double k2 = getKfromX(xbar, x);
// Is it in the quark emission zone?
if(k1 < d_kt1) {
rval = MEV(x, xbar)/PS(x, xbar);
// is it also in the anti-quark emission zone?
if(k2 < d_kt2) rval *= 0.5;
return rval;
}
return 1.0;
}
double VectorBosonQQBarMECorrection::qbarWeight(double x, double xbar) {
double rval;
double xg = 2. - xbar - x;
// always return one in the soft gluon region
if(xg < EPS) return 1.0;
// check it is in the phase space
if((1.-x)*(1.-xbar)*(1.-xg) < d_rho*xg*xg) return 0.0;
double k1 = getKfromX(x, xbar);
double k2 = getKfromX(xbar, x);
// Is it in the antiquark emission zone?
if(k2 < d_kt2) {
rval = MEV(x, xbar)/PS(xbar, x);
// is it also in the quark emission zone?
if(k1 < d_kt1) rval *= 0.5;
return rval;
}
return 1.0;
}
double VectorBosonQQBarMECorrection::qWeightX(Energy qtilde, double z) {
double x, xb;
getXXbar(sqr(qtilde/d_Q), z, x, xb);
// if exceptionally out of phase space, leave this emission, as there
// is no good interpretation for the soft ME correction.
if (x < 0 || xb < 0) return 1.0;
return qWeight(x, xb);
}
double VectorBosonQQBarMECorrection::qbarWeightX(Energy qtilde, double z) {
double x, xb;
getXXbar(sqr(qtilde/d_Q), z, xb, x);
// see above in qWeightX.
if (x < 0 || xb < 0) return 1.0;
return qbarWeight(x, xb);
}
double VectorBosonQQBarMECorrection::PS(double x, double xbar) {
double u = 0.5*(1. + d_rho / (1.-xbar+d_rho));
double z = u + (x - (2.-xbar)*u)/sqrt(xbar*xbar - 4.*d_rho);
double brack = (1.+z*z)/(1.-z)- 2.*d_rho/(1-xbar);
// interesting: the splitting function without the subtraction
// term. Actually gives a much worse approximation in the collinear
// limit. double brack = (1.+z*z)/(1.-z);
double den = (1.-xbar)*sqrt(xbar*xbar - 4.*d_rho);
return brack/den;
}
diff --git a/Shower/Powheg/HardGenerators/DrellYanHardGenerator.cc b/Shower/Powheg/HardGenerators/DrellYanHardGenerator.cc
--- a/Shower/Powheg/HardGenerators/DrellYanHardGenerator.cc
+++ b/Shower/Powheg/HardGenerators/DrellYanHardGenerator.cc
@@ -1,549 +1,553 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the DrellYanHardGenerator class.
//
#include <math.h>
#include "DrellYanHardGenerator.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/PDT/ParticleData.h"
#include "ThePEG/PDF/BeamParticleData.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/Shower/Base/ShowerTree.h"
#include "Herwig++/Shower/Base/Evolver.h"
#include "Herwig++/Shower/Base/KinematicsReconstructor.h"
#include "Herwig++/Shower/Base/PartnerFinder.h"
#include "Herwig++/Shower/Base/MECorrectionBase.h"
#include "ThePEG/Repository/EventGenerator.h"
using namespace std;
using namespace Herwig;
DrellYanHardGenerator::DrellYanHardGenerator()
: _power(2.0),_preqqbar(6.5),
_preqg(4.0),_pregqbar(4.0),
_min_pt(2.*GeV)
{}
void DrellYanHardGenerator::persistentOutput(PersistentOStream & os) const {
os << _alphaS << _power << _preqqbar << _preqg << _pregqbar << ounit( _min_pt,GeV );
}
void DrellYanHardGenerator::persistentInput(PersistentIStream & is, int) {
is >> _alphaS >> _power >> _preqqbar >> _preqg >> _pregqbar >> iunit( _min_pt, GeV );
}
ClassDescription<DrellYanHardGenerator> DrellYanHardGenerator::initDrellYanHardGenerator;
// Definition of the static class description member.
void DrellYanHardGenerator::Init() {
static ClassDocumentation<DrellYanHardGenerator> documentation
("Hard QCD radiation for Drell-Yan processes in the POWHEG scheme.",
"Hard QCD radiation for Drell-Yan processes in the POWHEG scheme \\cite{Hamilton:2008pd}.",
"%\\cite{Hamilton:2008pd}\n"
"\\bibitem{Hamilton:2008pd}\n"
" K.~Hamilton, P.~Richardson and J.~Tully,\n"
" ``A Positive-Weight Next-to-Leading Order Monte Carlo Simulation of Drell-Yan\n"
" Vector Boson Production,''\n"
" JHEP {\\bf 0810}, 015 (2008)\n"
" [arXiv:0806.0290 [hep-ph]].\n"
" %%CITATION = JHEPA,0810,015;%%\n"
);
static Reference<DrellYanHardGenerator,ShowerAlpha> interfaceShowerAlpha
("ShowerAlpha",
"The object calculating the strong coupling constant",
&DrellYanHardGenerator::_alphaS, false, false, true, false, false);
static Parameter<DrellYanHardGenerator,double> interfacePower
("Power",
"The power for the sampling of the matrix elements",
&DrellYanHardGenerator::_power, 2.0, 1.0, 10.0,
false, false, Interface::limited);
static Parameter<DrellYanHardGenerator,double> interfacePrefactorqqbar
("Prefactorqqbar",
"The prefactor for the sampling of the q qbar channel",
&DrellYanHardGenerator::_preqqbar, 5.0, 0.0, 1000.0,
false, false, Interface::limited);
static Parameter<DrellYanHardGenerator,double> interfacePrefactorqg
("Prefactorqg",
"The prefactor for the sampling of the q g channel",
&DrellYanHardGenerator::_preqg, 3.0, 0.0, 1000.0,
false, false, Interface::limited);
static Parameter<DrellYanHardGenerator,double> interfacePrefactorgqbar
("Prefactorgqbar",
"The prefactor for the sampling of the g qbar channel",
&DrellYanHardGenerator::_pregqbar, 3.0, 0.0, 1000.0,
false, false, Interface::limited);
static Parameter<DrellYanHardGenerator, Energy> interfacePtMin
("minPt",
"The pt cut on hardest emision generation"
"2*(1-Beta)*exp(-sqr(intrinsicpT/RMS))/sqr(RMS)",
&DrellYanHardGenerator::_min_pt, GeV, 2.*GeV, ZERO, 100000.0*GeV,
false, false, Interface::limited);
}
HardTreePtr DrellYanHardGenerator::generateHardest(ShowerTreePtr tree) {
useMe();
// get the particles to be showered
_beams.clear();
_partons.clear();
// find the incoming particles
ShowerParticleVector incoming;
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator cit;
_quarkplus = true;
vector<ShowerProgenitorPtr> particlesToShower;
//progenitor particles are produced in z direction.
for( cit = tree->incomingLines().begin(); cit != tree->incomingLines().end(); ++cit ) {
incoming.push_back( cit->first->progenitor() );
_beams.push_back( cit->first->beam() );
_partons.push_back( cit->first->progenitor()->dataPtr() );
// check that quark is along +ve z direction
if(cit->first->progenitor()->id() > 0 && cit->first->progenitor()->momentum().z() < ZERO )
_quarkplus = false;
particlesToShower.push_back( cit->first );
}
// find the gauge boson
PPtr boson;
if(tree->outgoingLines().size() == 1) {
boson = tree->outgoingLines().begin()->first->copy();
}
else {
boson = tree->outgoingLines().begin()->first->copy()->parents()[0];
}
if(!boson) throw Exception()
<< "DrellYanHardGenerator::generateHardest()\n"
<< "boson pointer is null." << Exception::abortnow;
if(!(abs(boson->id())==ParticleID::Wplus||boson->id()==ParticleID::Z0||
boson->id()==ParticleID::gamma)) throw Exception()
<< "DrellYanHardGenerator::generateHardest()\n"
<< "boson does not point to a Z/W/gamma !" << Exception::abortnow;
// calculate the rapidity of the boson
_yb = 0.5 * log((boson->momentum().e()+boson->momentum().z())/
(boson->momentum().e()-boson->momentum().z()));
_yb *= _quarkplus ? 1. : -1.;
_mass=boson->mass();
// we are assuming quark first, swap order to ensure this
// if antiquark first
if(_partons[0]->id()<_partons[1]->id()) {
swap(_partons[0],_partons[1]);
swap(_beams[0],_beams[1]);
}
vector<Lorentz5Momentum> pnew;
int emission_type(-1);
// generate the hard emission and return if no emission
- if(!getEvent(pnew,emission_type)) return HardTreePtr();
+ if(!getEvent(pnew,emission_type)) {
+ for(unsigned int ix=0;ix<particlesToShower.size();++ix)
+ particlesToShower[ix]->maximumpT(_min_pt);
+ return HardTreePtr();
+ }
// construct the HardTree object needed to perform the showers
ShowerParticleVector newparticles;
// make the particles for the HardTree
tcPDPtr gluon=getParticleData(ParticleID::g);
// create the partons
int iemit;
// q qbar -> g V
if(emission_type==0) {
newparticles.push_back(new_ptr(ShowerParticle(_partons[0] ,false)));
newparticles.push_back(new_ptr(ShowerParticle(_partons[1] ,false)));
newparticles.push_back(new_ptr(ShowerParticle(gluon , true)));
iemit = pnew[0].z()/pnew[2].rapidity()>ZERO ? 0 : 1;
}
// q g -> q V
else if(emission_type==1) {
iemit=1;
newparticles.push_back(new_ptr(ShowerParticle(_partons[0] ,false)));
newparticles.push_back(new_ptr(ShowerParticle(gluon ,false)));
newparticles.push_back(new_ptr(ShowerParticle(_partons[1]->CC(), true)));
}
// g qbar -> qbar V
else {
iemit=0;
newparticles.push_back(new_ptr(ShowerParticle(gluon ,false)));
newparticles.push_back(new_ptr(ShowerParticle(_partons[1] ,false)));
newparticles.push_back(new_ptr(ShowerParticle(_partons[0]->CC(), true)));
}
// create the boson
newparticles.push_back(new_ptr(ShowerParticle(boson->dataPtr(),true)));
// set the momenta
for(unsigned int ix=0;ix<4;++ix) newparticles[ix]->set5Momentum(pnew[ix]);
// create the off-shell particle
Lorentz5Momentum poff=pnew[iemit]-pnew[2];
poff.rescaleMass();
newparticles.push_back(new_ptr(ShowerParticle(_partons[iemit],false)));
newparticles.back()->set5Momentum(poff);
// find the sudakov for the branching
BranchingList branchings=evolver()->splittingGenerator()->initialStateBranchings();
long index = abs(_partons[iemit]->id());
IdList br(3);
// types of particle in the branching
br[0]=newparticles[iemit]->id();
br[1]=newparticles[ 4 ]->id();
br[2]=newparticles[ 2 ]->id();
if(emission_type==0) {
br[0]=abs(br[0]);
br[1]=abs(br[1]);
}
else if(emission_type==1) {
br[1]=-br[1];
br[2]=-br[2];
}
SudakovPtr sudakov;
for(BranchingList::const_iterator cit = branchings.lower_bound(index);
cit != branchings.upper_bound(index); ++cit ) {
IdList ids = cit->second.second;
if(ids[0]==br[0]&&ids[1]==br[1]&&ids[2]==br[2]) {
sudakov=cit->second.first;
break;
}
}
if(!sudakov) throw Exception() << "Can't find Sudakov for the hard emission in "
<< "DrellYanHardGenerator::generateHardest()"
<< Exception::runerror;
vector<HardBranchingPtr> nasonin,nasonhard;
// create the branchings for the incoming particles
nasonin.push_back(new_ptr(HardBranching(newparticles[0],
iemit==0 ? sudakov : SudakovPtr(),
HardBranchingPtr(),true)));
nasonin.push_back(new_ptr(HardBranching(newparticles[1],
iemit==1 ? sudakov : SudakovPtr(),
HardBranchingPtr(),true)));
// create the branching for the emitted jet
nasonin[iemit]->addChild(new_ptr(HardBranching(newparticles[2],SudakovPtr(),
nasonin[iemit],false)));
// intermediate IS particle
nasonhard.push_back(new_ptr(HardBranching(newparticles[4],SudakovPtr(),
nasonin[iemit],true)));
nasonin[iemit]->addChild(nasonhard.back());
// set the colour partners
nasonhard.back()->colourPartner(nasonin[iemit==0 ? 1 : 0]);
nasonin[iemit==0 ? 1 : 0]->colourPartner(nasonhard.back());
// add other particle
nasonhard.push_back(nasonin[iemit==0 ? 1 : 0]);
// outgoing boson
nasonhard.push_back(new_ptr(HardBranching(newparticles[3],SudakovPtr(),
HardBranchingPtr(),false)));
// make the tree
HardTreePtr nasontree=new_ptr(HardTree(nasonhard,nasonin));
// connect the ShowerParticles with the branchings
// and set the maximum pt for the radiation
set<HardBranchingPtr> hard=nasontree->branchings();
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if( _pt < _min_pt ) particlesToShower[ix]->maximumpT(_min_pt);
else particlesToShower[ix]->maximumpT(_pt);
for(set<HardBranchingPtr>::const_iterator mit=hard.begin();
mit!=hard.end();++mit) {
if(particlesToShower[ix]->progenitor()->id()==(*mit)->branchingParticle()->id()&&
particlesToShower[ix]->progenitor()->isFinalState()!=(*mit)->incoming()) {
nasontree->connect(particlesToShower[ix]->progenitor(),*mit);
if((*mit)->incoming()) {
(*mit)->beam(particlesToShower[ix]->original()->parents()[0]);
}
HardBranchingPtr parent=(*mit)->parent();
while(parent) {
parent->beam(particlesToShower[ix]->original()->parents()[0]);
parent=parent->parent();
};
}
}
}
// calculate the shower variables
evolver()->showerModel()->kinematicsReconstructor()->
deconstructHardJets(nasontree,evolver());
return nasontree;
}
bool DrellYanHardGenerator::canHandle(ShowerTreePtr tree) {
// two incoming particles
if(tree->incomingLines().size()!=2) return false;
// should be a quark and an antiquark
unsigned int ix(0);
ShowerParticlePtr part[2];
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator cit;
for(cit=tree->incomingLines().begin();cit!=tree->incomingLines().end();++cit)
{part[ix]=cit->first->progenitor();++ix;}
// check quark and antiquark
if(!(part[0]->id()>0&&part[0]->id()<6&&part[1]->id()<0&&part[1]->id()>-6)&&
!(part[1]->id()>0&&part[1]->id()<6&&part[0]->id()<0&&part[0]->id()>-6))
return false;
// one or two outgoing particles
if(tree->outgoingLines().size()>2) return false;
// find the outgoing particles
ix=0;
map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator cjt;
for(cjt=tree->outgoingLines().begin();cjt!=tree->outgoingLines().end();++cjt)
{part[ix]=cjt->first->progenitor();++ix;}
// outgoing particles (1 which is W/Z)
if(tree->outgoingLines().size()==1&&
!(part[0]->id()!=ParticleID::gamma||part[0]->id()!=ParticleID::Z0||
abs(part[0]->id())==ParticleID::Wplus))
return false;
else if(tree->outgoingLines().size()==2) {
if(part[0]->parents().empty()||part[1]->parents().empty()) return false;
if(part[0]->parents()[0]!=part[1]->parents()[0]) return false;
if(!(part[0]->parents()[0]->id()==ParticleID::gamma||
part[0]->parents()[0]->id()==ParticleID::Z0||
abs(part[0]->parents()[0]->id())==ParticleID::Wplus)) return false;
}
// can handle it
return true;
}
double DrellYanHardGenerator::getResult(int emis_type, Energy pt, double yj) {
Energy2 s=sqr(generator()->maximumCMEnergy());
Energy2 m2(sqr(_mass));
Energy2 scale = m2+sqr(pt);
Energy et=sqrt(scale);
// longitudinal real correction fractions
double x = pt*exp( yj)/sqrt(s)+et*exp( _yb)/sqrt(s);
double y = pt*exp(-yj)/sqrt(s)+et*exp(-_yb)/sqrt(s);
// reject if outside region
if(x<0.||x>1.||y<0.||y>1.||x*y<m2/s) return 0.;
// longitudinal born fractions
double x1 = _mass*exp( _yb)/sqrt(s);
double y1 = _mass*exp(-_yb)/sqrt(s);
// mandelstam variables
Energy2 th = -sqrt(s)*x*pt*exp(-yj);
Energy2 uh = -sqrt(s)*y*pt*exp( yj);
Energy2 sh = m2-th-uh;
double res;
// pdf part of the cross section
double pdf[4];
pdf[0]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],m2,x1);
pdf[1]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],m2,y1);
//qqbar2Zg
using Constants::pi;
if(emis_type==0) {
pdf[2]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],scale,x);
pdf[3]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],scale,y);
res = 4./3./pi*(sqr(th-m2)+sqr(uh-m2))*pt/(sh*uh*th)*GeV;
}
//qg2Zq
else if(emis_type==1) {
pdf[2]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],scale,x);
pdf[3]=_beams[1]->pdf()->xfx(_beams[1],getParticleData(ParticleID::g),scale,y);
res = -1./2./pi*(sqr(uh-m2)+sqr(sh-m2))*pt/(sh*sh*uh)*GeV;
}
//qbarg2Zqbar
else {
pdf[2]=_beams[0]->pdf()->xfx(_beams[0],getParticleData(ParticleID::g),scale,x);
pdf[3]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],scale,y);
res =- 1./2./pi*(sqr(th-m2)+sqr(sh-m2))*pt/(sh*sh*th)*GeV;
}
//deals with pdf zero issue at large x
if(pdf[0]<=0.||pdf[1]<=0.||pdf[2]<=0.||pdf[3]<=0.) {
res=0.;
}
else {
res*=pdf[2]*pdf[3]/pdf[0]/pdf[1]*m2/sh;
}
res*=_alphaS->ratio(scale);
return res;
}
bool DrellYanHardGenerator::getEvent(vector<Lorentz5Momentum> & pnew,
int & emis_type){
// pt cut-off
// Energy minp = 0.1*GeV;
// maximum pt (half of centre-of-mass energy)
Energy maxp = 0.5*generator()->maximumCMEnergy();
// set pt of emission to zero
_pt=ZERO;
//Working Variables
Energy pt;
double yj;
// limits on the rapidity of the jet
double minyj = -8.0,maxyj = 8.0;
bool reject;
double wgt;
emis_type=-1;
for(int j=0;j<3;j++) {
pt=maxp;
double a = _alphaS->overestimateValue()*_prefactor[j]*(maxyj-minyj)/(_power-1.);
do {
// generate next pt
pt=GeV/pow(pow(GeV/pt,_power-1)-log(UseRandom::rnd())/a,1./(_power-1.));
// generate rapidity of the jet
yj=UseRandom::rnd()*(maxyj-minyj)+ minyj;
// calculate rejection weight
wgt=getResult(j,pt,yj);
wgt/= _prefactor[j]*pow(GeV/pt,_power);
reject = UseRandom::rnd()>wgt;
//no emission event if p goes past p min - basically set to outside
//of the histogram bounds (hopefully hist object just ignores it)
if(pt<_min_pt){
pt=ZERO;
reject = false;
}
if(wgt>1.0) {
ostringstream s;
s << "DrellYanHardGenerator::getEvent weight for channel " << j
<< "is " << wgt << " which is greater than 1";
generator()->logWarning( Exception(s.str(), Exception::warning) );
}
}
while(reject);
// set pt of emission etc
if(pt>_pt){
emis_type = j;
_pt=pt;
_yj=yj;
}
}
//was this an (overall) no emission event?
if(_pt<_min_pt){
_pt=ZERO;
emis_type = 3;
}
if(emis_type==3) return false;
// generate the momenta of the particles
// hadron-hadron cmf
Energy2 s=sqr(generator()->maximumCMEnergy());
// transverse energy
Energy2 m2(sqr(_mass));
Energy et=sqrt(m2+sqr(_pt));
// first calculate all the kinematic variables
// longitudinal real correction fractions
double x = _pt*exp( _yj)/sqrt(s)+et*exp( _yb)/sqrt(s);
double y = _pt*exp(-_yj)/sqrt(s)+et*exp(-_yb)/sqrt(s);
// that and uhat
Energy2 th = -sqrt(s)*x*_pt*exp(-_yj);
Energy2 uh = -sqrt(s)*y*_pt*exp( _yj);
Energy2 sh = x*y*s;
if(emis_type==1) swap(th,uh);
// decide which was the emitting particle
unsigned int iemit=1;
// from q qbar
if(emis_type==0) {
if(UseRandom::rnd()<sqr(m2-uh)/(sqr(m2-uh)+sqr(m2-th))) iemit=2;
}
else {
if(UseRandom::rnd()<sqr(m2-th)/(sqr(m2-th)+sqr(m2-sh))) iemit=2;
}
// reconstruct the momenta in the rest frame of the gauge boson
Lorentz5Momentum pb(ZERO,ZERO,ZERO,_mass,_mass),pspect,pg,pemit;
double cos3;
if(emis_type==0) {
pg=Lorentz5Momentum(ZERO,ZERO,ZERO,0.5*(sh-m2)/_mass,ZERO);
Energy2 tp(th),up(uh);
double zsign(-1.);
if(iemit==2) {
swap(tp,up);
zsign=1;
}
pspect = Lorentz5Momentum(ZERO,ZERO
,zsign*0.5*(m2-tp)/_mass,0.5*(m2-tp)/_mass,
ZERO);
Energy eemit=0.5*(m2-up)/_mass;
cos3 = 0.5/pspect.z()/pg.e()*(sqr(pspect.e())+sqr(pg.e())-sqr(eemit));
}
else {
pg=Lorentz5Momentum(ZERO,ZERO,ZERO,0.5*(m2-uh)/_mass,ZERO);
double zsign(1.);
if(iemit==1) {
if(emis_type==1) zsign=-1.;
pspect=Lorentz5Momentum(ZERO,ZERO,0.5*zsign*(sh-m2)/_mass,0.5*(sh-m2)/_mass);
Energy eemit=0.5*(m2-th)/_mass;
cos3 = 0.5/pspect.z()/pg.e()*(sqr(pspect.e())+sqr(pg.e())-sqr(eemit));
}
else {
if(emis_type==2) zsign=-1.;
pspect=Lorentz5Momentum(ZERO,ZERO,0.5*zsign*(m2-th)/_mass,0.5*(m2-th)/_mass);
Energy eemit=0.5*(sh-m2)/_mass;
cos3 = 0.5/pspect.z()/pg.e()*(-sqr(pspect.e())-sqr(pg.e())+sqr(eemit));
}
}
// rotate the gluon
double sin3(sqrt(1.-sqr(cos3))),phi(Constants::twopi*UseRandom::rnd());
pg.setX(pg.e()*sin3*cos(phi));
pg.setY(pg.e()*sin3*sin(phi));
pg.setZ(pg.e()*cos3);
if(emis_type==0) {
pemit=pb+pg-pspect;
}
else {
if(iemit==1) pemit=pb+pspect-pg;
else pemit=pspect+pg-pb;
}
pemit .setMass(ZERO);
pg .setMass(ZERO);
pspect.setMass(ZERO);
// find the new CMF
Lorentz5Momentum pp[2];
if(emis_type==0) {
pp[0]=pemit;
pp[1]=pspect;
if(iemit==2) swap(pp[0],pp[1]);
}
else if(emis_type==1) {
pp[1]=pg;
if(iemit==1) pp[0]=pemit;
else pp[0]=pspect;
}
else {
pp[0]=pg;
if(iemit==1) pp[1]=pemit;
else pp[1]=pspect;
}
Lorentz5Momentum pz= _quarkplus ? pp[0] : pp[1];
pp[0]/=x;
pp[1]/=y;
Lorentz5Momentum plab(pp[0]+pp[1]);
plab.rescaleMass();
// construct the boost to rest frame of plab
LorentzRotation trans=LorentzRotation(plab.findBoostToCM());
pz.transform(trans);
// rotate so emitting particle along z axis
// rotate so in x-z plane
trans.rotateZ(-atan2(pz.y(),pz.x()));
// rotate so along
trans.rotateY(-acos(pz.z()/pz.vect().mag()));
// undo azimuthal rotation
trans.rotateZ(atan2(pz.y(),pz.x()));
// perform the transforms
pb .transform(trans);
pspect.transform(trans);
pg .transform(trans);
pemit .transform(trans);
// copy the momenta for the new particles
pnew.resize(4);
if(emis_type==0) {
pnew[0]=pemit;
pnew[1]=pspect;
if(iemit==2) swap(pnew[0],pnew[1]);
pnew[2]=pg;
}
else if(emis_type==1) {
pnew[0]=pemit;
pnew[2]=pspect;
if(iemit==2) swap(pnew[0],pnew[2]);
pnew[1]=pg;
}
else if(emis_type==2) {
pnew[1]=pspect;
pnew[2]=pemit;
if(iemit==1) swap(pnew[1],pnew[2]);
pnew[0]=pg;
}
pnew[3]=pb;
return true;
}
void DrellYanHardGenerator::doinitrun() {
// insert the different prefactors in the vector for easy look up
_prefactor.push_back(_preqqbar);
_prefactor.push_back(_preqg);
_prefactor.push_back(_pregqbar);
HardestEmissionGenerator::doinitrun();
}
diff --git a/Shower/Powheg/HardGenerators/GGtoHHardGenerator.cc b/Shower/Powheg/HardGenerators/GGtoHHardGenerator.cc
--- a/Shower/Powheg/HardGenerators/GGtoHHardGenerator.cc
+++ b/Shower/Powheg/HardGenerators/GGtoHHardGenerator.cc
@@ -1,679 +1,683 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the GGtoHHardGenerator class.
//
#include "GGtoHHardGenerator.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/Shower/Base/HardTree.h"
#include "Herwig++/Shower/Base/ShowerTree.h"
#include "Herwig++/Utilities/Maths.h"
#include "Herwig++/Shower/Base/Evolver.h"
#include "Herwig++/Shower/Base/KinematicsReconstructor.h"
#include "Herwig++/Shower/Base/PartnerFinder.h"
#include "Herwig++/Shower/Base/MECorrectionBase.h"
#include "ThePEG/Repository/EventGenerator.h"
using namespace Herwig;
const complex<Energy2>
GGtoHHardGenerator::_epsi = complex<Energy2>(ZERO,-1.e-10*GeV2);
GGtoHHardGenerator::GGtoHHardGenerator() : _power(2.0),_pregg(5.),
_preqg(3.),_pregqbar(3.),
_min_pt(2.*GeV),
_minloop(6),_maxloop(6),_massopt(0)
{}
void GGtoHHardGenerator::persistentOutput(PersistentOStream & os) const {
os << _alphaS << _power << _pregg << _preqg << _pregqbar
<< ounit( _min_pt,GeV ) << _minloop << _maxloop << _massopt;
}
void GGtoHHardGenerator::persistentInput(PersistentIStream & is, int) {
is >> _alphaS >> _power >> _pregg >> _preqg >> _pregqbar >>
iunit( _min_pt, GeV )>> _minloop >> _maxloop >> _massopt;
}
ClassDescription<GGtoHHardGenerator> GGtoHHardGenerator::initGGtoHHardGenerator;
// Definition of the static class description member.
void GGtoHHardGenerator::Init() {
static ClassDocumentation<GGtoHHardGenerator> documentation
("The GGtoHHardGenerator class implements the generation of hard QCD radiation in "
"gg to h0 processes in the POWHEG scheme",
"Hard QCD radiation for $gg\\to h^0$ processes in the POWHEG scheme \\cite{Hamilton:2009za}.",
"%\\cite{Hamilton:2009za}\n"
"\\bibitem{Hamilton:2009za}\n"
" K.~Hamilton, P.~Richardson and J.~Tully,\n"
" ``A Positive-Weight Next-to-Leading Order Monte Carlo Simulation for Higgs\n"
" Boson Production,''\n"
" JHEP {\\bf 0904}, 116 (2009)\n"
" [arXiv:0903.4345 [hep-ph]].\n"
" %%CITATION = JHEPA,0904,116;%%\n"
);
static Reference<GGtoHHardGenerator,ShowerAlpha> interfaceShowerAlpha
("ShowerAlpha",
"The object calculating the strong coupling constant",
&GGtoHHardGenerator::_alphaS, false, false, true, false, false);
static Parameter<GGtoHHardGenerator,double> interfacePower
("Power",
"The power for the sampling of the matrix elements",
&GGtoHHardGenerator::_power, 2.0, 1.0, 10.0,
false, false, Interface::limited);
static Parameter<GGtoHHardGenerator,double> interfacePrefactorgg
("Prefactorgg",
"The prefactor for the sampling of the q qbar channel",
&GGtoHHardGenerator::_pregg, 5.0, 0.0, 1000.0,
false, false, Interface::limited);
static Parameter<GGtoHHardGenerator,double> interfacePrefactorqg
("Prefactorqg",
"The prefactor for the sampling of the q g channel",
&GGtoHHardGenerator::_preqg, 3.0, 0.0, 1000.0,
false, false, Interface::limited);
static Parameter<GGtoHHardGenerator,double> interfacePrefactorgqbar
("Prefactorgqbar",
"The prefactor for the sampling of the g qbar channel",
&GGtoHHardGenerator::_pregqbar, 3.0, 0.0, 1000.0,
false, false, Interface::limited);
static Parameter<GGtoHHardGenerator, Energy> interfacePtMin
("minPt",
"The pt cut on hardest emision generation"
"2*(1-Beta)*exp(-sqr(intrinsicpT/RMS))/sqr(RMS)",
&GGtoHHardGenerator::_min_pt, GeV, 2.*GeV, ZERO, 100000.0*GeV,
false, false, Interface::limited);
static Parameter<GGtoHHardGenerator,int> interfaceMaximumInLoop
("MaximumInLoop",
"The maximum flavour of the quarks to include in the loops",
&GGtoHHardGenerator::_maxloop, 6, 5, 6,
false, false, Interface::limited);
static Switch<GGtoHHardGenerator,unsigned int> interfaceMassOption
("MassOption",
"Option for the treatment of the masses in the loop diagrams",
&GGtoHHardGenerator::_massopt, 0, false, false);
static SwitchOption interfaceMassOptionFull
(interfaceMassOption,
"Full",
"Include the full mass dependence",
0);
static SwitchOption interfaceMassOptionLarge
(interfaceMassOption,
"Large",
"Use the heavy mass limit",
1);
}
bool GGtoHHardGenerator::canHandle(ShowerTreePtr tree) {
// two incoming particles
if(tree->incomingLines().size()!=2) return false;
// should be gluons
vector<ShowerParticlePtr> part;
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator cit;
for(cit=tree->incomingLines().begin();cit!=tree->incomingLines().end();++cit) {
part.push_back(cit->first->progenitor());
}
// check gluons
if(part.size()!=2||part[0]->id()!=ParticleID::g||part[1]->id()!=ParticleID::g)
return false;
// one outgoing particles
if(tree->outgoingLines().size()>1) return false;
// find the outgoing particles
part.clear();
map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator cjt;
for(cjt=tree->outgoingLines().begin();cjt!=tree->outgoingLines().end();++cjt) {
part.push_back(cjt->first->progenitor());
}
// check its the Higgs
if(part[0]->id()!=ParticleID::h0) return false;
// can handle it
return true;
}
void GGtoHHardGenerator::doinitrun() {
// insert the different prefactors in the vector for easy look up
_prefactor.push_back(_pregg);
_prefactor.push_back(_preqg);
_prefactor.push_back(_preqg);
_prefactor.push_back(_pregqbar);
_prefactor.push_back(_pregqbar);
HardestEmissionGenerator::doinitrun();
}
HardTreePtr GGtoHHardGenerator::generateHardest(ShowerTreePtr tree) {
useMe();
// get the particles to be showered
_beams.clear();
_partons.clear();
// find the incoming particles
ShowerParticleVector incoming;
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator cit;
vector<ShowerProgenitorPtr> particlesToShower;
for( cit = tree->incomingLines().begin();
cit != tree->incomingLines().end(); ++cit ) {
incoming.push_back( cit->first->progenitor() );
_beams.push_back( cit->first->beam() );
_partons.push_back( cit->first->progenitor()->dataPtr() );
particlesToShower.push_back( cit->first );
}
// find the higgs boson
PPtr higgs;
if(tree->outgoingLines().size() == 1) {
higgs = tree->outgoingLines().begin()->first->copy();
}
else {
higgs = tree->outgoingLines().begin()->first->copy()->parents()[0];
}
// calculate the rapidity of the higgs
_yh = 0.5 * log((higgs->momentum().e()+higgs->momentum().z())/
(higgs->momentum().e()-higgs->momentum().z()));
_mass=higgs->mass();
_mh2 = sqr(_mass);
vector<Lorentz5Momentum> pnew;
int emission_type(-1);
// generate the hard emission and return if no emission
- if(!getEvent(pnew,emission_type)) return HardTreePtr();
+ if(!getEvent(pnew,emission_type)) {
+ for(unsigned int ix=0;ix<particlesToShower.size();++ix)
+ particlesToShower[ix]->maximumpT(_min_pt);
+ return HardTreePtr();
+ }
// construct the HardTree object needed to perform the showers
ShowerParticleVector newparticles(4);
// create the partons
int iemit=-1;
// g g -> h g
if(emission_type==0) {
newparticles[0] = new_ptr(ShowerParticle(_partons[0] ,false));
newparticles[1] = new_ptr(ShowerParticle(_partons[1] ,false));
iemit = pnew[0].z()/pnew[3].z()>0. ? 0 : 1;
}
// g q -> H q
else if(emission_type==1) {
newparticles[0] = new_ptr(ShowerParticle(_partons[0] ,false));
newparticles[1] = new_ptr(ShowerParticle(_out ,false));
iemit = 1;
}
// q g -> H q
else if(emission_type==2) {
newparticles[0] = new_ptr(ShowerParticle(_out ,false));
newparticles[1] = new_ptr(ShowerParticle(_partons[1] ,false));
iemit = 0;
}
// g qbar -> H qbar
else if(emission_type==3) {
newparticles[0] = new_ptr(ShowerParticle(_partons[0] ,false));
newparticles[1] = new_ptr(ShowerParticle(_out ,false));
iemit = 1;
}
// qbar g -> H qbar
else if(emission_type==4) {
newparticles[0] = new_ptr(ShowerParticle(_out ,false));
newparticles[1] = new_ptr(ShowerParticle(_partons[1] ,false));
iemit = 0;
}
// create the jet
newparticles[3] = new_ptr(ShowerParticle(_out , true));
// create the boson
newparticles[2] = new_ptr(ShowerParticle(higgs->dataPtr(),true));
// set the momenta
for(unsigned int ix=0;ix<4;++ix) newparticles[ix]->set5Momentum(pnew[ix]);
// create the off-shell particle
Lorentz5Momentum poff=pnew[iemit]-pnew[3];
poff.rescaleMass();
newparticles.push_back(new_ptr(ShowerParticle(_partons[iemit],false)));
newparticles.back()->set5Momentum(poff);
// find the sudakov for the branching
BranchingList branchings=evolver()->splittingGenerator()->initialStateBranchings();
long index = abs(_partons[iemit]->id());
IdList br(3);
// types of particle in the branching
br[0]=newparticles[iemit]->id();
br[1]=newparticles[ 4 ]->id();
br[2]=newparticles[ 3 ]->id();
SudakovPtr sudakov;
for(BranchingList::const_iterator cit = branchings.lower_bound(index);
cit != branchings.upper_bound(index); ++cit ) {
IdList ids = cit->second.second;
if(ids[0]==br[0]&&ids[1]==br[1]&&ids[2]==br[2]) {
sudakov=cit->second.first;
break;
}
}
if(!sudakov) throw Exception() << "Can't find Sudakov for the hard emission in "
<< "GGtoHHardGenerator::generateHardest()"
<< Exception::runerror;
vector<HardBranchingPtr> nasonin,nasonhard;
// create the branchings for the incoming particles
nasonin.push_back(new_ptr(HardBranching(newparticles[0],
iemit==0 ? sudakov : SudakovPtr(),
HardBranchingPtr(),true)));
nasonin.push_back(new_ptr(HardBranching(newparticles[1],
iemit==1 ? sudakov : SudakovPtr(),
HardBranchingPtr(),true)));
// create the branching for the emitted jet
nasonin[iemit]->addChild(new_ptr(HardBranching(newparticles[3],SudakovPtr(),
nasonin[iemit],false)));
// intermediate IS particle
nasonhard.push_back(new_ptr(HardBranching(newparticles[4],SudakovPtr(),
nasonin[iemit],true)));
nasonin[iemit]->addChild(nasonhard.back());
// set the colour partners
nasonhard.back()->colourPartner(nasonin[iemit==0 ? 1 : 0]);
nasonin[iemit==0 ? 1 : 0]->colourPartner(nasonhard.back());
// add other particle
nasonhard.push_back(nasonin[iemit==0 ? 1 : 0]);
// outgoing Higgs boson
nasonhard.push_back(new_ptr(HardBranching(newparticles[2],SudakovPtr(),
HardBranchingPtr(),false)));
// make the tree
HardTreePtr nasontree=new_ptr(HardTree(nasonhard,nasonin));
// connect the ShowerParticles with the branchings
// and set the maximum pt for the radiation
set<HardBranchingPtr> hard=nasontree->branchings();
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if( _pt < _min_pt ) particlesToShower[ix]->maximumpT(_min_pt);
else particlesToShower[ix]->maximumpT(_pt);
for(set<HardBranchingPtr>::const_iterator mit=hard.begin();
mit!=hard.end();++mit) {
if(particlesToShower[ix]->progenitor()->id()==(*mit)->branchingParticle()->id()&&
particlesToShower[ix]->progenitor()->isFinalState()!=(*mit)->incoming()) {
if(particlesToShower[ix]->progenitor()->momentum().z()/
(*mit)->branchingParticle()->momentum().z()<0.) continue;
nasontree->connect(particlesToShower[ix]->progenitor(),*mit);
if((*mit)->incoming()) {
(*mit)->beam(particlesToShower[ix]->original()->parents()[0]);
}
HardBranchingPtr parent=(*mit)->parent();
while(parent) {
parent->beam(particlesToShower[ix]->original()->parents()[0]);
parent=parent->parent();
};
}
}
}
// calculate the shower variables
evolver()->showerModel()->kinematicsReconstructor()->
deconstructHardJets(nasontree,evolver());
// return the answer
return nasontree;
}
bool GGtoHHardGenerator::getEvent(vector<Lorentz5Momentum> & pnew,
int & emis_type){
// maximum pt (half of centre-of-mass energy)
Energy maxp = 0.5*generator()->maximumCMEnergy();
// set pt of emission to zero
_pt=ZERO;
//Working Variables
Energy pt;
double yj;
// limits on the rapidity of the jet
double minyj = -8.0,maxyj = 8.0;
bool reject;
double wgt;
emis_type=-1;
tcPDPtr outParton;
for(int j=0;j<5;++j) {
pt = maxp;
do {
double a = _alphaS->overestimateValue()*_prefactor[j]*(maxyj-minyj)/(_power-1.);
// generate next pt
pt=GeV/pow(pow(GeV/pt,_power-1)-log(UseRandom::rnd())/a,1./(_power-1.));
// generate rapidity of the jet
yj=UseRandom::rnd()*(maxyj-minyj)+ minyj;
// calculate rejection weight
wgt=getResult(j,pt,yj,outParton);
wgt/= _prefactor[j]*pow(GeV/pt,_power);
reject = UseRandom::rnd()>wgt;
//no emission event if p goes past p min - basically set to outside
//of the histogram bounds (hopefully hist object just ignores it)
if(pt<_min_pt){
pt=ZERO;
reject = false;
}
if(wgt>1.0) {
ostringstream s;
s << "GGtoHHardGenerator::getEvent weight for channel " << j
<< "is " << wgt << " which is greater than 1";
generator()->logWarning( Exception(s.str(), Exception::warning) );
}
}
while(reject);
// set pt of emission etc
if(pt>_pt){
emis_type = j;
_pt=pt;
_yj=yj;
_out = outParton;
}
}
//was this an (overall) no emission event?
if(_pt<_min_pt){
_pt=ZERO;
emis_type = 5;
}
if(emis_type==5) return false;
// generate the momenta of the particles
// hadron-hadron cmf
Energy2 s=sqr(generator()->maximumCMEnergy());
// transverse energy
Energy et=sqrt(_mh2+sqr(_pt));
// first calculate all the kinematic variables
// longitudinal real correction fractions
double x = _pt*exp( _yj)/sqrt(s)+et*exp( _yh)/sqrt(s);
double y = _pt*exp(-_yj)/sqrt(s)+et*exp(-_yh)/sqrt(s);
// that and uhat
// Energy2 th = -sqrt(s)*x*_pt*exp(-_yj);
// Energy2 uh = -sqrt(s)*y*_pt*exp( _yj);
// Energy2 sh = x*y*s;
// reconstruct the momenta
// incoming momenta
pnew.push_back(Lorentz5Momentum(ZERO,ZERO,
x*0.5*sqrt(s), x*0.5*sqrt(s),ZERO));
pnew.push_back(Lorentz5Momentum(ZERO,ZERO,
-y*0.5*sqrt(s), y*0.5*sqrt(s),ZERO));
// outgoing momenta
double phi(Constants::twopi*UseRandom::rnd());
double sphi(sin(phi)),cphi(cos(phi));
pnew.push_back(Lorentz5Momentum( cphi*_pt, sphi*_pt, et*sinh(_yh),
et*cosh(_yh), _mass));
pnew.push_back(Lorentz5Momentum(-cphi*_pt,-sphi*_pt,_pt*sinh(_yj),
_pt*cosh(_yj),ZERO));
return true;
}
Complex GGtoHHardGenerator::B(Energy2 s,Energy2 mf2) const {
Complex output,pii(0.,Constants::pi);
double rat=s/(4.*mf2);
if(s<ZERO)
output=2.-2.*sqrt(1.-1./rat)*log(sqrt(-rat)+sqrt(1.-rat));
else if(s>=ZERO&&rat<1.)
output=2.-2.*sqrt(1./rat-1.)*asin(sqrt(rat));
else
output=2.-sqrt(1.-1./rat)*(2.*log(sqrt(rat)+sqrt(rat-1.))-pii);
return output;
}
complex<InvEnergy2> GGtoHHardGenerator::C(Energy2 s,Energy2 mf2) const {
complex<InvEnergy2> output;
Complex pii(0.,Constants::pi);
double rat=s/(4.*mf2);
if(s<ZERO)
output=2.*sqr(log(sqrt(-rat)+sqrt(1.-rat)))/s;
else if(s>=ZERO&&rat<1.)
output=-2.*sqr(asin(sqrt(rat)))/s;
else {
double cosh=log(sqrt(rat)+sqrt(rat-1.));
output=2.*(sqr(cosh)-sqr(Constants::pi)/4.-pii*cosh)/s;
}
return output;
}
Complex GGtoHHardGenerator::dIntegral(Energy2 a, Energy2 b, double y0) const {
Complex output;
if(b==ZERO) output=0.;
else {
Complex y1=0.5*(1.+sqrt(1.-4.*(a+_epsi)/b));
Complex y2=1.-y1;
Complex z1=y0/(y0-y1);
Complex z2=(y0-1.)/(y0-y1);
Complex z3=y0/(y0-y2);
Complex z4=(y0-1.)/(y0-y2);
output=Math::Li2(z1)-Math::Li2(z2)+Math::Li2(z3)-Math::Li2(z4);
}
return output;
}
complex<InvEnergy4> GGtoHHardGenerator::D(Energy2 s,Energy2 t, Energy2,
Energy2 mf2) const {
Complex output,pii(0.,Constants::pi);
Energy4 st=s*t;
Energy4 root=sqrt(sqr(st)-4.*st*mf2*(s+t-_mh2));
double xp=0.5*(st+root)/st,xm=1-xp;
output = 2.*(-dIntegral(mf2,s,xp)-dIntegral(mf2,t,xp)
+dIntegral(mf2,_mh2,xp)+log(-xm/xp)
*(log((mf2+_epsi)/GeV2)-log((mf2+_epsi-s*xp*xm)/GeV2)
+log((mf2+_epsi-_mh2*xp*xm)/GeV2)-log((mf2+_epsi-t*xp*xm)/GeV2)));
return output/root;
}
complex<Energy> GGtoHHardGenerator::me1(Energy2 s,Energy2 t,Energy2 u, Energy2 mf2,
unsigned int i ,unsigned int j ,unsigned int k ,
unsigned int i1,unsigned int j1,unsigned int k1) const {
Energy2 s1(s-_mh2),t1(t-_mh2),u1(u-_mh2);
return mf2*4.*sqrt(2.*s*t*u)*(-4.*(1./(u*t)+1./(u*u1)+1./(t*t1))
-4.*((2.*s+t)*_bi[k]/sqr(u1)+(2.*s+u)*_bi[j]/sqr(t1))/s
-(s-4.*mf2)*(s1*_ci[i1]+(u-s)*_ci[j1]+(t-s)*_ci[k1])/(s*t*u)
-8.*mf2*(_ci[j1]/(t*t1)+_ci[k1]/(u*u1))
+0.5*(s-4.*mf2)*(s*t*_di[k]+u*s*_di[j]-u*t*_di[i])/(s*t*u)
+4.*mf2*_di[i]/s
-2.*(u*_ci[k]+t*_ci[j]+u1*_ci[k1]+t1*_ci[j1]-u*t*_di[i])/sqr(s));
}
complex<Energy> GGtoHHardGenerator::me2(Energy2 s,Energy2 t,Energy2 u,
Energy2 mf2) const {
Energy2 s1(s-_mh2),t1(t-_mh2),u1(u-_mh2);
return mf2*4.*sqrt(2.*s*t*u)*(4.*_mh2+(_mh2-4.*mf2)*(s1*_ci[4]+t1*_ci[5]+u1*_ci[6])
-0.5*(_mh2-4.*mf2)*(s*t*_di[3]+u*s*_di[2]+u*t*_di[1]) )/
(s*t*u);
}
Complex GGtoHHardGenerator::F(double x) {
if(x<.25) {
double root = sqrt(1.-4.*x);
Complex pii(0.,Constants::pi);
return 0.5*sqr(log((1.+root)/(1.-root))-pii);
}
else {
return -2.*sqr(asin(0.5/sqrt(x)));
}
}
Energy4 GGtoHHardGenerator::loME() {
Complex I(0);
if(_massopt==0) {
for ( int ix=_minloop; ix<=_maxloop; ++ix ) {
double x = sqr(getParticleData(ix)->mass())/_mh2;
I += 3.*x*(2.+(4.*x-1.)*F(x));
}
}
else {
I = 1.;
}
return sqr(_mh2)/576./Constants::pi*norm(I);
}
tPDPtr GGtoHHardGenerator::quarkFlavour(tcPDFPtr pdf, Energy2 scale,
double x, tcBeamPtr beam,
double & pdfweight, bool anti) {
vector<double> weights;
vector<tPDPtr> partons;
pdfweight = 0.;
if(!anti) {
for(int ix=1;ix<=5;++ix) {
partons.push_back(getParticleData(ix));
weights.push_back(pdf->xfx(beam,partons.back(),scale,x));
pdfweight += weights.back();
}
}
else {
for(int ix=1;ix<=5;++ix) {
partons.push_back(getParticleData(-ix));
weights.push_back(pdf->xfx(beam,partons.back(),scale,x));
pdfweight += weights.back();
}
}
double wgt=UseRandom::rnd()*pdfweight;
for(unsigned int ix=0;ix<weights.size();++ix) {
if(wgt<=weights[ix]) return partons[ix];
wgt -= weights[ix];
}
assert(false);
return tPDPtr();
}
Energy2 GGtoHHardGenerator::ggME(Energy2 s, Energy2 t, Energy2 u) {
Energy2 output;
if(_massopt==0) {
complex<Energy> me[2][2][2];
me[1][1][1] = ZERO;
me[1][1][0] = ZERO;
me[0][1][0] = ZERO;
me[0][1][1] = ZERO;
for(int ix=_minloop;ix<=_maxloop;++ix) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
_bi[1]=B(s,mf2);
_bi[2]=B(u,mf2);
_bi[3]=B(t,mf2);
_bi[4]=B(_mh2,mf2);
_bi[1]=_bi[1]-_bi[4];
_bi[2]=_bi[2]-_bi[4];
_bi[3]=_bi[3]-_bi[4];
_ci[1]=C(s,mf2);
_ci[2]=C(u,mf2);
_ci[3]=C(t,mf2);
_ci[7]=C(_mh2,mf2);
_ci[4]=(s*_ci[1]-_mh2*_ci[7])/(s-_mh2);
_ci[5]=(u*_ci[2]-_mh2*_ci[7])/(u-_mh2);
_ci[6]=(t*_ci[3]-_mh2*_ci[7])/(t-_mh2);
_di[1]=D(t,u,s,mf2);
_di[2]=D(s,t,u,mf2);
_di[3]=D(s,u,t,mf2);
me[1][1][1]+=me1(s,u,t,mf2,1,2,3,4,5,6);
me[1][1][0]+=me2(s,u,t,mf2);
me[0][1][0]+=me1(u,s,t,mf2,2,1,3,5,4,6);
me[0][1][1]+=me1(t,u,s,mf2,3,2,1,6,5,4);
}
me[0][0][0]=-me[1][1][1];
me[0][0][1]=-me[1][1][0];
me[1][0][1]=-me[0][1][0];
me[1][0][0]=-me[0][1][1];
output = real(me[0][0][0]*conj(me[0][0][0])+
me[0][0][1]*conj(me[0][0][1])+
me[0][1][0]*conj(me[0][1][0])+
me[0][1][1]*conj(me[0][1][1])+
me[1][0][0]*conj(me[1][0][0])+
me[1][0][1]*conj(me[1][0][1])+
me[1][1][0]*conj(me[1][1][0])+
me[1][1][1]*conj(me[1][1][1]));
output *= 3./8.;
}
else {
output=32./3.*
(pow<4,1>(s)+pow<4,1>(t)+pow<4,1>(u)+pow<4,1>(_mh2))/s/t/u;
}
// spin and colour factors
return output/4./64.;
}
Energy2 GGtoHHardGenerator::qgME(Energy2 s, Energy2 t, Energy2 u) {
Energy2 output;
if(_massopt==0) {
complex<Energy2> A(ZERO);
Energy2 si(u-_mh2);
for(int ix=_minloop;ix<=_maxloop;++ix) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
A += mf2*(2.+2.*double(u/si)*(B(u,mf2)-B(_mh2,mf2))
+double((4.*mf2-s-t)/si)*Complex(u*C(u,mf2)-_mh2*C(_mh2,mf2)));
}
output =-4.*(sqr(s)+sqr(t))/sqr(si)/u*real(A*conj(A));
}
else{
output =-4.*(sqr(s)+sqr(t))/u/9.;
}
// final colour/spin factors
return output/24.;
}
Energy2 GGtoHHardGenerator::qbargME(Energy2 s, Energy2 t, Energy2 u) {
Energy2 output;
if(_massopt==0) {
complex<Energy2> A(ZERO);
Energy2 si(u-_mh2);
for(int ix=_minloop;ix<=_maxloop;++ix) {
Energy2 mf2=sqr(getParticleData(ix)->mass());
A+=mf2*(2.+2.*double(u/si)*(B(u,mf2)-B(_mh2,mf2))
+double((4.*mf2-s-t)/si)*Complex(u*C(u,mf2)-_mh2*C(_mh2,mf2)));
}
output =-4.*(sqr(s)+sqr(t))/sqr(si)/u*real(A*conj(A));
}
else {
output =-4.*(sqr(s)+sqr(t))/u/9.;
}
// final colour/spin factors
return output/24.;
}
double GGtoHHardGenerator::getResult(int emis_type, Energy pt, double yj,
tcPDPtr & outParton) {
Energy2 s=sqr(generator()->maximumCMEnergy());
Energy2 scale = _mh2+sqr(pt);
Energy et=sqrt(scale);
// longitudinal real correction fractions
double x = pt*exp( yj)/sqrt(s)+et*exp( _yh)/sqrt(s);
double y = pt*exp(-yj)/sqrt(s)+et*exp(-_yh)/sqrt(s);
// reject if outside region
if(x<0.||x>1.||y<0.||y>1.||x*y<_mh2/s) return 0.;
// longitudinal born fractions
double x1 = _mass*exp( _yh)/sqrt(s);
double y1 = _mass*exp(-_yh)/sqrt(s);
// mandelstam variables
Energy2 th = -sqrt(s)*x*pt*exp(-yj);
Energy2 uh = -sqrt(s)*y*pt*exp( yj);
Energy2 sh = _mh2-th-uh;
InvEnergy2 res = InvEnergy2();
// pdf part of the cross section
double pdf[4];
pdf[0]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],_mh2,x1);
pdf[1]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],_mh2,y1);
// g g -> H g
if(emis_type==0) {
outParton = _partons[1];
pdf[2]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],scale,x);
pdf[3]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],scale,y);
res = ggME(sh,uh,th)/loME();
}
// q g -> H q
else if(emis_type==1) {
outParton = quarkFlavour(_beams[0]->pdf(),scale,x,_beams[0],pdf[2],false);
pdf[3]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],scale,y);
res = qgME(sh,uh,th)/loME();
}
// g q -> H q
else if(emis_type==2) {
pdf[2]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],scale,x);
outParton = quarkFlavour(_beams[1]->pdf(),scale,y,_beams[1],pdf[3],false);
res = qgME(sh,th,uh)/loME();
}
// qbar g -> H qbar
else if(emis_type==3) {
outParton = quarkFlavour(_beams[0]->pdf(),scale,x,_beams[0],pdf[2],true);
pdf[3]=_beams[1]->pdf()->xfx(_beams[1],_partons[1],scale,y);
res = qbargME(sh,uh,th)/loME();
}
// g qbar -> H qbar
else if(emis_type==4) {
pdf[2]=_beams[0]->pdf()->xfx(_beams[0],_partons[0],scale,x);
outParton = quarkFlavour(_beams[1]->pdf(),scale,y,_beams[1],pdf[3],true);
res = qbargME(sh,th,uh)/loME();
}
//deals with pdf zero issue at large x
if(pdf[0]<=0.||pdf[1]<=0.||pdf[2]<=0.||pdf[3]<=0.) {
res = ZERO;
}
else {
res *= pdf[2]*pdf[3]/pdf[0]/pdf[1]*_mh2/sh;
}
return _alphaS->ratio(scale)/8./sqr(Constants::pi)*_mh2/sh*GeV*pt*res;
}
diff --git a/Shower/SplittingFunctions/SplittingGenerator.cc b/Shower/SplittingFunctions/SplittingGenerator.cc
--- a/Shower/SplittingFunctions/SplittingGenerator.cc
+++ b/Shower/SplittingFunctions/SplittingGenerator.cc
@@ -1,266 +1,335 @@
// -*- C++ -*-
//
// SplittingGenerator.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the SplittingGenerator class.
//
#include "SplittingGenerator.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/Command.h"
#include "ThePEG/Utilities/StringUtils.h"
#include "ThePEG/Repository/Repository.h"
#include "Herwig++/Shower/Base/ShowerParticle.h"
#include <cassert>
using namespace Herwig;
IBPtr SplittingGenerator::clone() const {
return new_ptr(*this);
}
IBPtr SplittingGenerator::fullclone() const {
return new_ptr(*this);
}
void SplittingGenerator::persistentOutput(PersistentOStream & os) const {
os << _isr_Mode << _fsr_Mode << _bbranchings << _fbranchings;
}
void SplittingGenerator::persistentInput(PersistentIStream & is, int) {
is >> _isr_Mode >> _fsr_Mode >> _bbranchings >> _fbranchings;
}
ClassDescription<SplittingGenerator> SplittingGenerator::initSplittingGenerator;
// Definition of the static class description member.
void SplittingGenerator::Init() {
static ClassDocumentation<SplittingGenerator> documentation
("There class is responsible for initializing the Sudakov form factors ",
"and generating splittings.");
static Switch<SplittingGenerator, bool> interfaceISRMode
("ISR",
"Include initial-state radiation?",
&SplittingGenerator::_isr_Mode, 1, false, false);
static SwitchOption interfaceISRMode0
(interfaceISRMode,"No","ISR (Initial State Radiation) is OFF", 0);
static SwitchOption interfaceISRMode1
(interfaceISRMode,"Yes","ISR (Initial State Radiation) is ON", 1);
static Switch<SplittingGenerator, bool> interfaceFSRMode
("FSR",
"Include final-state radiation?",
&SplittingGenerator::_fsr_Mode, 1, false, false);
static SwitchOption interfaceFSRMode0
(interfaceFSRMode,"No","FSR (Final State Radiation) is OFF", 0);
static SwitchOption interfaceFSRMode1
(interfaceFSRMode,"Yes","FSR (Final State Radiation) is ON", 1);
static Command<SplittingGenerator> interfaceAddSplitting
("AddFinalSplitting",
"Adds another splitting to the list of splittings considered "
"in the shower. Command is a->b,c; Sudakov",
&SplittingGenerator::addFinalSplitting);
static Command<SplittingGenerator> interfaceAddInitialSplitting
("AddInitialSplitting",
"Adds another splitting to the list of initial splittings to consider "
"in the shower. Command is a->b,c; Sudakov. Here the particle a is the "
"particle that is PRODUCED by the splitting. b is the initial state "
"particle that is splitting in the shower.",
&SplittingGenerator::addInitialSplitting);
+
+ static Command<SplittingGenerator> interfaceDeleteSplitting
+ ("DeleteFinalSplitting",
+ "Deletes a splitting from the list of splittings considered "
+ "in the shower. Command is a->b,c; Sudakov",
+ &SplittingGenerator::deleteFinalSplitting);
+
+ static Command<SplittingGenerator> interfaceDeleteInitialSplitting
+ ("DeleteInitialSplitting",
+ "Deletes a splitting from the list of initial splittings to consider "
+ "in the shower. Command is a->b,c; Sudakov. Here the particle a is the "
+ "particle that is PRODUCED by the splitting. b is the initial state "
+ "particle that is splitting in the shower.",
+ &SplittingGenerator::deleteInitialSplitting);
}
string SplittingGenerator::addSplitting(string arg, bool final) {
string partons = StringUtils::car(arg);
string sudakov = StringUtils::cdr(arg);
vector<tPDPtr> products;
string::size_type next = partons.find("->");
if(next == string::npos)
return "Error: Invalid string for splitting " + arg;
if(partons.find(';') == string::npos)
return "Error: Invalid string for splitting " + arg;
tPDPtr parent = Repository::findParticle(partons.substr(0,next));
partons = partons.substr(next+2);
do {
next = min(partons.find(','), partons.find(';'));
tPDPtr pdp = Repository::findParticle(partons.substr(0,next));
partons = partons.substr(next+1);
if(pdp) products.push_back(pdp);
else return "Error: Could not create splitting from " + arg;
} while(partons[0] != ';' && partons.size());
SudakovPtr s;
s = dynamic_ptr_cast<SudakovPtr>(Repository::TraceObject(sudakov));
if(!s) return "Error: Could not load Sudakov " + sudakov + '\n';
IdList ids;
ids.push_back(parent->id());
for(vector<tPDPtr>::iterator it = products.begin(); it!=products.end(); ++it)
ids.push_back((*it)->id());
// check splitting can handle this
if(!s->splittingFn()->accept(ids))
return "Error: Sudakov " + sudakov + "can't handle particles\n";
// add to map
addToMap(ids,s,final);
return "";
}
+string SplittingGenerator::deleteSplitting(string arg, bool final) {
+ string partons = StringUtils::car(arg);
+ string sudakov = StringUtils::cdr(arg);
+ vector<tPDPtr> products;
+ string::size_type next = partons.find("->");
+ if(next == string::npos)
+ return "Error: Invalid string for splitting " + arg;
+ if(partons.find(';') == string::npos)
+ return "Error: Invalid string for splitting " + arg;
+ tPDPtr parent = Repository::findParticle(partons.substr(0,next));
+ partons = partons.substr(next+2);
+ do {
+ next = min(partons.find(','), partons.find(';'));
+ tPDPtr pdp = Repository::findParticle(partons.substr(0,next));
+ partons = partons.substr(next+1);
+ if(pdp) products.push_back(pdp);
+ else return "Error: Could not create splitting from " + arg;
+ } while(partons[0] != ';' && partons.size());
+ SudakovPtr s;
+ s = dynamic_ptr_cast<SudakovPtr>(Repository::TraceObject(sudakov));
+ if(!s) return "Error: Could not load Sudakov " + sudakov + '\n';
+ IdList ids;
+ ids.push_back(parent->id());
+ for(vector<tPDPtr>::iterator it = products.begin(); it!=products.end(); ++it)
+ ids.push_back((*it)->id());
+ // check splitting can handle this
+ if(!s->splittingFn()->accept(ids))
+ return "Error: Sudakov " + sudakov + "can't handle particles\n";
+ // delete from map
+ deleteFromMap(ids,s,final);
+ return "";
+}
+
void SplittingGenerator::addToMap(const IdList &ids, const SudakovPtr &s, bool final) {
if(isISRadiationON() && !final) {
_bbranchings.insert(BranchingInsert(ids[1],BranchingElement(s,ids)));
s->addSplitting(ids);
}
if(isFSRadiationON() && final) {
_fbranchings.insert(BranchingInsert(ids[0],BranchingElement(s,ids)));
s->addSplitting(ids);
}
}
+void SplittingGenerator::deleteFromMap(const IdList &ids,
+ const SudakovPtr &s, bool final) {
+ if(isISRadiationON() && !final) {
+ pair<BranchingList::iterator,BranchingList::iterator>
+ range = _bbranchings.equal_range(ids[1]);
+ for(BranchingList::iterator it=range.first;it!=range.second&&it->first==ids[1];++it) {
+ if(it->second.first==s&&it->second.second==ids)
+ _bbranchings.erase(it);
+ }
+ s->removeSplitting(ids);
+ }
+ if(isFSRadiationON() && final) {
+ pair<BranchingList::iterator,BranchingList::iterator>
+ range = _fbranchings.equal_range(ids[0]);
+ for(BranchingList::iterator it=range.first;it!=range.second&&it->first==ids[0];++it) {
+ if(it->second.first==s&&it->second.second==ids)
+ _fbranchings.erase(it);
+ }
+ s->removeSplitting(ids);
+ }
+}
+
Branching SplittingGenerator::chooseForwardBranching(ShowerParticle &particle,
double enhance) const {
Energy newQ = ZERO;
ShoKinPtr kinematics = ShoKinPtr();
SudakovPtr sudakov=SudakovPtr();
IdList ids;
// First, find the eventual branching, corresponding to the highest scale.
long index = abs(particle.data().id());
// if no branchings return empty branching struct
if(_fbranchings.find(index) == _fbranchings.end())
return Branching(ShoKinPtr(), IdList(),SudakovPtr());
// otherwise select branching
for(BranchingList::const_iterator cit = _fbranchings.lower_bound(index);
cit != _fbranchings.upper_bound(index); ++cit) {
// check size of scales beforehand...
ShoKinPtr newKin= cit->second.first->
generateNextTimeBranching(particle.evolutionScale(),
cit->second.second,particle.id()!=cit->first,
enhance);
if(!newKin) continue;
// select highest scale
if(newKin->scale() > newQ &&
newKin->scale() <= particle.evolutionScale()) {
kinematics=newKin;
newQ = newKin->scale();
sudakov = cit->second.first;
ids = cit->second.second;
sudakov=cit->second.first;
}
}
// return empty branching if nothing happened
if(!kinematics) return Branching(ShoKinPtr(), IdList(),SudakovPtr());
// and generate phi
sudakov->generatePhi(particle,ids,kinematics);
// If a branching has been selected initialize it
kinematics->initialize(particle,PPtr());
// and return it
return Branching(kinematics, ids,sudakov);
}
Branching SplittingGenerator::chooseDecayBranching(ShowerParticle &particle,
Energy stoppingScale,
Energy minmass,
double enhance) const {
Energy newQ = Constants::MaxEnergy;
ShoKinPtr kinematics;
SudakovPtr sudakov;
IdList ids;
// First, find the eventual branching, corresponding to the lowest scale.
long index = abs(particle.data().id());
// if no branchings return empty branching struct
if(_fbranchings.find(index) == _fbranchings.end())
return Branching(ShoKinPtr(), IdList(),SudakovPtr());
// otherwise select branching
for(BranchingList::const_iterator cit = _fbranchings.lower_bound(index);
cit != _fbranchings.upper_bound(index); ++cit) {
ShoKinPtr newKin;
if(particle.evolutionScale() < stoppingScale)
newKin = cit->second.first->
generateNextDecayBranching(particle.evolutionScale(),
stoppingScale,minmass,
cit->second.second,
particle.id()!=cit->first,enhance);
if(!newKin) continue;
if(newKin->scale() < newQ && newKin->scale() > particle.evolutionScale()) {
newQ = newKin->scale();
ids = cit->second.second;
kinematics=newKin;
sudakov=cit->second.first;
}
}
// return empty branching if nothing happened
if(!kinematics) return Branching(ShoKinPtr(), IdList(),SudakovPtr());
// initialize the branching
kinematics->initialize(particle,PPtr());
// and return it
return Branching(kinematics, ids,sudakov);
}
Branching SplittingGenerator::
chooseBackwardBranching(ShowerParticle &particle,PPtr beamparticle,
double enhance,
Ptr<BeamParticleData>::transient_const_pointer beam) const {
Energy newQ=ZERO;
ShoKinPtr kinematics=ShoKinPtr();
SudakovPtr sudakov;
IdList ids;
// First, find the eventual branching, corresponding to the highest scale.
long index = abs(particle.id());
// if no possible branching return
if(_bbranchings.find(index) == _bbranchings.end())
return Branching(ShoKinPtr(), IdList(),sudakov);
// select the branching
for(BranchingList::const_iterator cit = _bbranchings.lower_bound(index);
cit != _bbranchings.upper_bound(index); ++cit ) {
ShoKinPtr newKin=cit->second.first->
generateNextSpaceBranching(particle.evolutionScale(),
cit->second.second, particle.x(),
particle.id()!=cit->first,enhance,beam);
if(!newKin) continue;
if(newKin->scale() > newQ) {
newQ = newKin->scale();
kinematics=newKin;
ids = cit->second.second;
sudakov=cit->second.first;
}
}
// return empty branching if nothing happened
if(!kinematics) return Branching(ShoKinPtr(), IdList(),SudakovPtr());
// initialize the ShowerKinematics
// and return it
kinematics->initialize(particle,beamparticle);
// return the answer
return Branching(kinematics, ids,sudakov);
}
void SplittingGenerator::rebind(const TranslationMap & trans)
{
BranchingList::iterator cit;
for(cit=_fbranchings.begin();cit!=_fbranchings.end();++cit)
{(cit->second).first=trans.translate((cit->second).first);}
for(cit=_bbranchings.begin();cit!=_bbranchings.end();++cit)
{(cit->second).first=trans.translate((cit->second).first);}
Interfaced::rebind(trans);
}
IVector SplittingGenerator::getReferences() {
IVector ret = Interfaced::getReferences();
BranchingList::iterator cit;
for(cit=_fbranchings.begin();cit!=_fbranchings.end();++cit)
{ret.push_back((cit->second).first);}
for(cit=_bbranchings.begin();cit!=_bbranchings.end();++cit)
{ret.push_back((cit->second).first);}
return ret;
}
diff --git a/Shower/SplittingFunctions/SplittingGenerator.h b/Shower/SplittingFunctions/SplittingGenerator.h
--- a/Shower/SplittingFunctions/SplittingGenerator.h
+++ b/Shower/SplittingFunctions/SplittingGenerator.h
@@ -1,410 +1,435 @@
// -*- C++ -*-
//
// SplittingGenerator.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_SplittingGenerator_H
#define HERWIG_SplittingGenerator_H
//
// This is the declaration of the SplittingGenerator class.
//
#include "ThePEG/Interface/Interfaced.h"
#include "Herwig++/Shower/Base/SudakovFormFactor.h"
#include "SplittingGenerator.fh"
#include "Herwig++/Shower/Base/ShowerKinematics.h"
#include "ThePEG/Utilities/Rebinder.h"
#include<vector>
namespace Herwig {
using namespace ThePEG;
/**
* Forward declaration of the ShowerParticle class
*/
class ShowerParticle;
/**
* typedef to pair the SudakovFormFactor and the particles in a branching
*/
typedef pair<SudakovPtr,IdList> BranchingElement;
/**
* typedef to pair the PDG code of the particle and the BranchingElement
*/
typedef multimap<long,BranchingElement> BranchingList;
/**
* typedef to create a structure which can be inserted into a BranchingList
*/
typedef pair<long, BranchingElement> BranchingInsert;
/** \ingroup Shower
* The branching struct is used to store information on the branching.
* The kinematics variable is a pointer to the ShowerKinematics for the branching
* The sudakov variable is a pointer to the SudakovFormFactor for the branching
* The ids variable is the list of particles in the branching
*/
struct Branching {
/**
* Pointer to the ShowerKinematics object for the branching
*/
ShoKinPtr kinematics;
/**
* PDG codes of the particles in the branching
*/
IdList ids;
/**
* The SudakovFormFactor for the branching
*/
tSudakovPtr sudakov;
/**
* Constructor for the struct
* @param a pointer to the ShowerKinematics object for the branching
* @param c PDG codes of the particles in the branching
* @param d The SudakovFormFactor for the branching
*/
Branching(ShoKinPtr a, IdList c,tSudakovPtr d) : kinematics(a), ids(c), sudakov(d) {}
/**
* Default constructor
*/
Branching() {}
};
/** \ingroup Shower
*
* This class is responsible for creating, at the beginning of the Run,
* all the SplittingFunction objects and the corresponding
* SudakovFormFactor objects, and then of the generation of splittings
* (radiation emissions) during the event.
* Many switches are defined in this class which allowed the user to turn on/off:
* - each type of interaction (QCD, QED, EWK,...);
* - initial- and final-state radiation for all type of interactions;
* - initial- and final-state radiation for each type of interaction;
* - each type of splitting (\f$u\to ug\f$, \f$d\to dg\f$, \f$\ldots\f$,
* \f$g\to gg\f$, \f$g\to u\bar{u}\f$, \f$\ldots\f$).
*
* These switches are useful mainly for debugging, but eventually can
* also be used for a "quick and dirty" estimation of systematic errors.
*
* In the future it should be possible to implement in this class
*
* - the \f$1\to2\f$ azimuthal correlations for soft emission due to QCD coherence
* using the ShowerParticle object provided in the input.
* - Similarly having the \f$\rho-D\f$ matrix and the SplittingFunction pointer
* it should be possible to implement the spin correlations.
*
* @see SudakovFormFactor
* @see SplitFun
*
* @see \ref SplittingGeneratorInterfaces "The interfaces"
* defined for SplittingGenerator.
*/
class SplittingGenerator: public Interfaced {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
SplittingGenerator() : _isr_Mode(1), _fsr_Mode(1) {}
//@}
public:
/**
* Methods to select the next branching and reconstruct the kinematics
*/
//@{
/**
* Choose a new forward branching for a time-like particle
* The method returns:
* - a pointer to a ShowerKinematics object, which
* contains the information about the new scale and all other
* kinematics variables that need to be generated simultaneously;
* - a pointer to the SudakovFormFactor object associated
* with the chosen emission.
* - The PDG codes of the particles in the branching,
* as a Branching struct.
*
* In the case no branching has been generated, both the returned
* pointers are null ( ShoKinPtr() , tSudakovFFPtr() ).
*
* @param particle The particle to be evolved
* @param enhance The factor by which to ehnace the emission of radiation
* @return The Branching struct for the branching
*/
Branching chooseForwardBranching(ShowerParticle & particle,
double enhance) const;
/**
* Select the next branching of a particles for the initial-state shower
* in the particle's decay.
* @param particle The particle being showerwed
* @param maxscale The maximum scale
* @param minmass Minimum mass of the particle after the branching
* @param enhance The factor by which to ehnace the emission of radiation
* @return The Branching struct for the branching
*/
Branching chooseDecayBranching(ShowerParticle & particle,
Energy maxscale,
Energy minmass,double enhance) const;
/**
* Choose a new backward branching for a space-like particle.
* The method returns:
* - a pointer to a ShowerKinematics object, which
* contains the information about the new scale and all other
* kinematics variables that need to be generated simultaneously;
* - a pointer to the SudakovFormFactor object associated
* with the chosen emission.
* - The PDG codes of the particles in the branching,
* as a Branching struct.
*
* In the case no branching has been generated, both the returned
* pointers are null ( ShoKinPtr() , tSudakovFFPtr() ).
*
* @param particle The particle to be evolved
* @param enhance The factor by which to ehnace the emission of radiation
* @param beam The beam particle
* @return The Branching struct for the branching
*/
Branching
chooseBackwardBranching(ShowerParticle & particle,
PPtr beam,
double enhance,
Ptr<BeamParticleData>::transient_const_pointer) const;
//@}
public:
/**
* Access to the switches
*/
//@{
/**
* It returns true/false if the initial-state radiation is on/off.
*/
bool isISRadiationON() const { return _isr_Mode; }
/**
* It returns true/false if the final-state radiation is on/off.
*/
bool isFSRadiationON() const { return _fsr_Mode; }
//@}
/**
* Methods to parse the information from the input files to create the
* branchings
*/
//@{
/**
* Add a final-state splitting
*/
string addFinalSplitting(string arg) { return addSplitting(arg,true); }
/**
* Add an initial-state splitting
*/
string addInitialSplitting(string arg) { return addSplitting(arg,false); }
+
+ /**
+ * Add a final-state splitting
+ */
+ string deleteFinalSplitting(string arg) { return deleteSplitting(arg,true); }
+
+ /**
+ * Add an initial-state splitting
+ */
+ string deleteInitialSplitting(string arg) { return deleteSplitting(arg,false); }
//@}
/**
* Access to the splittings
*/
//@{
/**
* Access the final-state branchings
*/
const BranchingList & finalStateBranchings() const { return _fbranchings; }
/**
* Access the initial-state branchings
*/
const BranchingList & initialStateBranchings() const { return _bbranchings; }
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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.
*/
virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
virtual IBPtr fullclone() const;
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans)
;
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* Add a branching to the map
* @param ids PDG coeds of the particles in the branching
* @param sudakov The SudakovFormFactor for the branching
* @param final Whether this is an initial- or final-state branching
*/
void addToMap(const IdList & ids, const SudakovPtr & sudakov, bool final);
/**
+ * Remove a branching to the map
+ * @param ids PDG coeds of the particles in the branching
+ * @param sudakov The SudakovFormFactor for the branching
+ * @param final Whether this is an initial- or final-state branching
+ */
+ void deleteFromMap(const IdList & ids, const SudakovPtr & sudakov, bool final);
+
+ /**
* Obtain the reference vectors for a final-state particle
* @param particle The particle
* @param p The p reference vector
* @param n The n reference vector
*/
void finalStateBasisVectors(ShowerParticle particle, Lorentz5Momentum & p,
Lorentz5Momentum & n) const;
/**
* Add a splitting
* @param in string to be parsed
* @param final Whether this is an initial- or final-state branching
*/
string addSplitting(string in ,bool final);
+ /**
+ * Delete a splitting
+ * @param in string to be parsed
+ * @param final Whether this is an initial- or final-state branching
+ */
+ string deleteSplitting(string in ,bool final);
+
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<SplittingGenerator> initSplittingGenerator;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
SplittingGenerator & operator=(const SplittingGenerator &);
private:
/**
* Switches to control the radiation
*/
//@{
/**
* Is inqitial-state radiation on/off
*/
bool _isr_Mode;
/**
* Is final-state radiation on/off
*/
bool _fsr_Mode;
//@}
/**
* List of the branchings and the appropriate Sudakovs for forward branchings
*/
BranchingList _fbranchings;
/**
* Lists of the branchings and the appropriate Sudakovs for backward branchings.
*/
BranchingList _bbranchings;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of SplittingGenerator. */
template <>
struct BaseClassTrait<Herwig::SplittingGenerator,1> {
/** Typedef of the first base class of SplittingGenerator. */
typedef Interfaced NthBase;
};
/** This template specialization informs ThePEG about the name of
* the SplittingGenerator class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::SplittingGenerator>
: public ClassTraitsBase<Herwig::SplittingGenerator> {
/** Return a platform-independent class name */
static string className() { return "Herwig::SplittingGenerator"; }
/**
* The name of a file containing the dynamic library where the class
* SplittingGenerator is implemented. It may also include several, space-separated,
* libraries if the class SplittingGenerator 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 "HwShower.so"; }
};
/** @endcond */
}
#endif /* HERWIG_SplittingGenerator_H */
diff --git a/Tests/Hadron/HTest.cc b/Tests/Hadron/HTest.cc
new file mode 100644
--- /dev/null
+++ b/Tests/Hadron/HTest.cc
@@ -0,0 +1,180 @@
+// -*- C++ -*-
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the HTest class.
+//
+
+#include "HTest.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+#include "ThePEG/PDT/EnumParticles.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/EventRecord/Event.h"
+#include "fastjet/PseudoJet.hh"
+#include "fastjet/ClusterSequence.hh"
+
+using namespace Herwig;
+
+void HTest::analyze(tEventPtr event, long, int , int) {
+ // Rotate to CMS, extract final state particles and call analyze(particles).
+ set<tPPtr> particles;
+ event->selectFinalState(inserter(particles));
+ tPPtr h0;
+ tParticleVector part2;
+ for(set<tPPtr>::const_iterator it=particles.begin();
+ it!=particles.end();++it) {
+ if((**it).id()==ParticleID::h0) h0=*it;
+ else part2.push_back(*it);
+ }
+ if(!h0) return;
+ *_higgspt += h0->momentum().perp()/GeV;
+ // callFastjet using R-parameter of 1 to get inclusive jets
+ vector<fastjet::PseudoJet> fastjet_particles;
+ for (unsigned int j=0; j<part2.size(); j++) {
+ fastjet::PseudoJet p(part2[j]->momentum().x()/GeV,
+ part2[j]->momentum().y()/GeV,
+ part2[j]->momentum().z()/GeV,
+ part2[j]->momentum().e()/GeV);
+ p.set_user_index(j);
+ fastjet_particles.push_back(p);
+ }
+ fastjet::RecombinationScheme recomb_scheme = fastjet::E_scheme;
+ fastjet::Strategy strategy = fastjet::Best;
+ fastjet::JetDefinition jet_def(fastjet::kt_algorithm, 1.,
+ recomb_scheme, strategy);
+ fastjet::ClusterSequence cs(fastjet_particles, jet_def);
+ vector<fastjet::PseudoJet> jets = sorted_by_pt(cs.inclusive_jets());
+ double yh = h0->momentum().rapidity();
+ double yjet = jets[0].rapidity();
+ double ptj=jets[0].perp();
+ int njet[3]={0,0,0};
+ for(unsigned int ix=0;ix<jets.size();++ix) {
+ if(jets[ix].perp()>10.) ++njet[0];
+ if(jets[ix].perp()>40.) ++njet[1];
+ if(jets[ix].perp()>80.) ++njet[2];
+ }
+ *_jetpt += ptj;
+ if(ptj>10.) {
+ *_yj[0] += yjet;
+ *_yjyh[0] += yjet-yh;
+ }
+ if(ptj>40.) {
+ *_yj[1] += yjet;
+ *_yjyh[1] += yjet-yh;
+ }
+ if(ptj>80.) {
+ *_yj[2] += yjet;
+ *_yjyh[2] += yjet-yh;
+ }
+ for(unsigned int ix=0;ix<3;++ix) *_njet[ix] +=njet[ix];
+}
+
+IBPtr HTest::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr HTest::fullclone() const {
+ return new_ptr(*this);
+}
+
+void HTest::persistentOutput(PersistentOStream & ) const {
+}
+
+void HTest::persistentInput(PersistentIStream & , int) {
+}
+
+ClassDescription<HTest> HTest::initHTest;
+// Definition of the static class description member.
+
+void HTest::Init() {
+
+ static ClassDocumentation<HTest> documentation
+ ("There is no documentation for the HTest class");
+
+}
+
+void HTest::dofinish() {
+ AnalysisHandler::dofinish();
+ ofstream file;
+ string fname = generator()->filename() + string("-") + name() + string(".top");
+ file.open(fname.c_str());
+ using namespace HistogramOptions;
+ _higgspt->topdrawOutput(file,Frame|Ylog,"BLACK","Higgs Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _higgspt->normaliseToCrossSection();
+ _higgspt->topdrawOutput(file,Frame|Ylog,"BLACK","Higgs Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _jetpt->topdrawOutput(file,Frame|Ylog,"BLACK","Hardest Jet Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _jetpt->normaliseToCrossSection();
+ _jetpt->topdrawOutput(file,Frame|Ylog,"BLACK","Hardest Jet Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ string title;
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity p0T1>80 GeV";
+ _yj[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dy0j1",
+ " G G X X","y0j1"," X X");
+ _yj[ix]->normaliseToCrossSection();
+ _yj[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dy0j1/nb",
+ " G G X X ","y0j1"," X X");
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity - higgs rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity - higgs rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity - higgs rapidity p0T1>80 GeV";
+ _yjyh[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0h1)",
+ " G G X X X X ","y0j1-y0h1"," X X X X");
+ _yjyh[ix]->normaliseToCrossSection();
+ _yjyh[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0h1)/nb",
+ " G G X X X X ","y0j1-y0h1"," X X X X");
+
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Number of jets p0T1>10 GeV";
+ else if(ix==1) title ="Number of jets p0T1>40 GeV";
+ else if(ix==2) title ="Number of jets p0T1>80 GeV";
+ _njet[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dN0jet1",
+ " G G X X","N0jet1"," X X");
+ _njet[ix]->normaliseToCrossSection();
+ _njet[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dN0jet1/nb",
+ " G G X X","N0jet1"," X X");
+ }
+}
+
+void HTest::doinitrun() {
+ AnalysisHandler::doinitrun();
+ _higgspt = new_ptr(Histogram(0.,1000.,1000));
+ _jetpt = new_ptr(Histogram(0.,1000.,1000));
+ for(unsigned int ix=0;ix<3;++ix) {
+ _yj [ix] = new_ptr(Histogram(-10.,10.,200));
+ _yjyh[ix] = new_ptr(Histogram(-10.,10.,200));
+ _njet[ix] = new_ptr(Histogram(-0.5,10.5,11));
+ }
+}
diff --git a/Tests/Hadron/HTest.h b/Tests/Hadron/HTest.h
new file mode 100644
--- /dev/null
+++ b/Tests/Hadron/HTest.h
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+#ifndef HERWIG_HTest_H
+#define HERWIG_HTest_H
+//
+// This is the declaration of the HTest class.
+//
+
+#include "ThePEG/Handlers/AnalysisHandler.h"
+#include "Herwig++/Utilities/Histogram.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * Here is the documentation of the HTest class.
+ *
+ * @see \ref HTestInterfaces "The interfaces"
+ * defined for HTest.
+ */
+class HTest: public AnalysisHandler {
+
+public:
+
+ /** @name Virtual functions required by the AnalysisHandler class. */
+ //@{
+ /**
+ * Analyze a given Event. Note that a fully generated event
+ * may be presented several times, if it has been manipulated in
+ * between. The default version of this function will call transform
+ * to make a lorentz transformation of the whole event, then extract
+ * all final state particles and call analyze(tPVector) of this
+ * analysis object and those of all associated analysis objects. The
+ * default version will not, however, do anything on events which
+ * have not been fully generated, or have been manipulated in any
+ * way.
+ * @param event pointer to the Event to be analyzed.
+ * @param ieve the event number.
+ * @param loop the number of times this event has been presented.
+ * If negative the event is now fully generated.
+ * @param state a number different from zero if the event has been
+ * manipulated in some way since it was last presented.
+ */
+ virtual void analyze(tEventPtr event, long ieve, int loop, int state);
+ //@}
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * 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.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+protected:
+
+ /** @name Standard Interfaced functions. */
+ //@{
+ /**
+ * Initialize this object. Called in the run phase just before
+ * a run begins.
+ */
+ virtual void doinitrun();
+
+ /**
+ * Finalize this object. Called in the run phase just after a
+ * run has ended. Used eg. to write out statistics.
+ */
+ virtual void dofinish();
+ //@}
+
+private:
+
+ /**
+ * The static object used to initialize the description of this class.
+ * Indicates that this is a concrete class with persistent data.
+ */
+ static ClassDescription<HTest> initHTest;
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ HTest & operator=(const HTest &);
+
+private:
+
+ HistogramPtr _higgspt,_jetpt;
+
+ HistogramPtr _yj[3];
+
+ HistogramPtr _yjyh[3];
+
+ HistogramPtr _njet[3];
+
+};
+
+}
+
+#include "ThePEG/Utilities/ClassTraits.h"
+
+namespace ThePEG {
+
+/** @cond TRAITSPECIALIZATIONS */
+
+/** This template specialization informs ThePEG about the
+ * base classes of HTest. */
+template <>
+struct BaseClassTrait<Herwig::HTest,1> {
+ /** Typedef of the first base class of HTest. */
+ typedef AnalysisHandler NthBase;
+};
+
+/** This template specialization informs ThePEG about the name of
+ * the HTest class and the shared object where it is defined. */
+template <>
+struct ClassTraits<Herwig::HTest>
+ : public ClassTraitsBase<Herwig::HTest> {
+ /** Return a platform-independent class name */
+ static string className() { return "Herwig::HTest"; }
+ /**
+ * The name of a file containing the dynamic library where the class
+ * HTest is implemented. It may also include several, space-separated,
+ * libraries if the class HTest 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 "libfastjet.so HadronJetTest.so"; }
+};
+
+/** @endcond */
+
+}
+
+#endif /* HERWIG_HTest_H */
diff --git a/Tests/Hadron/VHTest.cc b/Tests/Hadron/VHTest.cc
new file mode 100644
--- /dev/null
+++ b/Tests/Hadron/VHTest.cc
@@ -0,0 +1,269 @@
+// -*- C++ -*-
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the VHTest class.
+//
+
+#include "VHTest.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+#include "ThePEG/PDT/EnumParticles.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/EventRecord/Event.h"
+#include "fastjet/PseudoJet.hh"
+#include "fastjet/ClusterSequence.hh"
+
+using namespace Herwig;
+
+void VHTest::analyze(tEventPtr event, long, int , int ) {
+ // Rotate to CMS, extract final state particles and call analyze(particles).
+ set<tPPtr> particles;
+ event->selectFinalState(inserter(particles));
+ tPPtr h0;
+ tParticleVector part2;
+ tParticleVector leptons;
+ for(set<tPPtr>::const_iterator it=particles.begin();
+ it!=particles.end();++it) {
+ if((**it).id()==ParticleID::h0) h0=*it;
+ else {
+ tPPtr parent=*it;
+ do {
+ if(abs(parent->id())==ParticleID::Wplus||
+ parent->id()==ParticleID::Z0) break;
+ parent = parent->parents()[0];
+ }
+ while(!parent->parents().empty());
+ if(!parent) {
+ part2.push_back(*it);
+ continue;
+ }
+ else if(abs(parent->id())==ParticleID::Wplus||
+ parent->id()==ParticleID::Z0) {
+ leptons.push_back(*it);
+ }
+ else {
+ part2.push_back(*it);
+ }
+ }
+ }
+ if(!h0) return;
+ if(leptons.size()!=2) return;
+ Lorentz5Momentum pv = leptons[0]->momentum()+leptons[1]->momentum();
+ Lorentz5Momentum pvh = pv+h0->momentum();
+ *_higgspt += h0->momentum().perp()/GeV;
+ *_vpt += pv.perp()/GeV;
+ *_vhpt += pvh.perp()/GeV;
+ // callFastjet using R-parameter of 1 to get inclusive jets
+ vector<fastjet::PseudoJet> fastjet_particles;
+ for (unsigned int j=0; j<part2.size(); j++) {
+ fastjet::PseudoJet p(part2[j]->momentum().x()/GeV,
+ part2[j]->momentum().y()/GeV,
+ part2[j]->momentum().z()/GeV,
+ part2[j]->momentum().e()/GeV);
+ p.set_user_index(j);
+ fastjet_particles.push_back(p);
+ }
+ fastjet::RecombinationScheme recomb_scheme = fastjet::E_scheme;
+ fastjet::Strategy strategy = fastjet::Best;
+ fastjet::JetDefinition jet_def(fastjet::kt_algorithm, 1.,
+ recomb_scheme, strategy);
+ fastjet::ClusterSequence cs(fastjet_particles, jet_def);
+ vector<fastjet::PseudoJet> jets = sorted_by_pt(cs.inclusive_jets());
+ double yh = h0->momentum().rapidity();
+ double yv = pv.rapidity();
+ double yvh = pvh.rapidity();
+ double yjet = jets[0].rapidity();
+ double ptj=jets[0].perp();
+ int njet[3]={0,0,0};
+ for(unsigned int ix=0;ix<jets.size();++ix) {
+ if(jets[ix].perp()>10.) ++njet[0];
+ if(jets[ix].perp()>40.) ++njet[1];
+ if(jets[ix].perp()>80.) ++njet[2];
+ }
+ *_jetpt += ptj;
+ if(ptj>10.) {
+ *_yj[0] += yjet;
+ *_yjyh[0] += yjet-yh;
+ *_yjyv[0] += yjet-yv;
+ *_yjyhv[0] += yjet-yvh;
+ }
+ if(ptj>40.) {
+ *_yj[1] += yjet;
+ *_yjyh[1] += yjet-yh;
+ *_yjyv[1] += yjet-yv;
+ *_yjyhv[1] += yjet-yvh;
+ }
+ if(ptj>80.) {
+ *_yj[2] += yjet;
+ *_yjyh[2] += yjet-yh;
+ *_yjyv[2] += yjet-yv;
+ *_yjyhv[2] += yjet-yvh;
+ }
+ for(unsigned int ix=0;ix<3;++ix) *_njet[ix] +=njet[ix];
+}
+
+IBPtr VHTest::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr VHTest::fullclone() const {
+ return new_ptr(*this);
+}
+
+void VHTest::persistentOutput(PersistentOStream & os) const {
+}
+
+void VHTest::persistentInput(PersistentIStream & is, int) {
+}
+
+ClassDescription<VHTest> VHTest::initVHTest;
+// Definition of the static class description member.
+
+void VHTest::Init() {
+
+ static ClassDocumentation<VHTest> documentation
+ ("There is no documentation for the VHTest class");
+
+}
+
+void VHTest::dofinish() {
+ AnalysisHandler::dofinish();
+ ofstream file;
+ string fname = generator()->filename() + string("-") + name() + string(".top");
+ file.open(fname.c_str());
+ using namespace HistogramOptions;
+ _higgspt->topdrawOutput(file,Frame|Ylog,"BLACK","Higgs Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _higgspt->normaliseToCrossSection();
+ _higgspt->topdrawOutput(file,Frame|Ylog,"BLACK","Higgs Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _vpt->topdrawOutput(file,Frame|Ylog,"BLACK","V Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _vpt->normaliseToCrossSection();
+ _vpt->topdrawOutput(file,Frame|Ylog,"BLACK","V Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _vhpt->topdrawOutput(file,Frame|Ylog,"BLACK","VH Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _vhpt->normaliseToCrossSection();
+ _vhpt->topdrawOutput(file,Frame|Ylog,"BLACK","VH Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _jetpt->topdrawOutput(file,Frame|Ylog,"BLACK","Hardest Jet Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _jetpt->normaliseToCrossSection();
+ _jetpt->topdrawOutput(file,Frame|Ylog,"BLACK","Hardest Jet Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ string title;
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity p0T1>80 GeV";
+ _yj[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dy0j1",
+ " G G X X","y0j1"," X X");
+ _yj[ix]->normaliseToCrossSection();
+ _yj[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dy0j1/nb",
+ " G G X X ","y0j1"," X X");
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity - higgs rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity - higgs rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity - higgs rapidity p0T1>80 GeV";
+ _yjyh[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0h1)",
+ " G G X X X X ","y0j1-y0h1"," X X X X");
+ _yjyh[ix]->normaliseToCrossSection();
+ _yjyh[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0h1)/nb",
+ " G G X X X X ","y0j1-y0h1"," X X X X");
+
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity - V rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity - V rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity - V rapidity p0T1>80 GeV";
+ _yjyv[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0V1)",
+ " G G X X X X ","y0j1-y0V1"," X X X X");
+ _yjyv[ix]->normaliseToCrossSection();
+ _yjyv[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0V1)/nb",
+ " G G X X X X ","y0j1-y0V1"," X X X X");
+
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity - HV rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity - HV rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity - HV rapidity p0T1>80 GeV";
+ _yjyhv[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0hV1)",
+ " G G X X X X ","y0j1-y0hV1"," X X X X");
+ _yjyhv[ix]->normaliseToCrossSection();
+ _yjyhv[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0hV1)/nb",
+ " G G X X X X ","y0j1-y0hV1"," X X X X");
+
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Number of jets p0T1>10 GeV";
+ else if(ix==1) title ="Number of jets p0T1>40 GeV";
+ else if(ix==2) title ="Number of jets p0T1>80 GeV";
+ _njet[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dN0jet1",
+ " G G X X","N0jet1"," X X");
+ _njet[ix]->normaliseToCrossSection();
+ _njet[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dN0jet1/nb",
+ " G G X X","N0jet1"," X X");
+ }
+}
+
+void VHTest::doinitrun() {
+ AnalysisHandler::doinitrun();
+ _higgspt = new_ptr(Histogram(0.,1000.,1000));
+ _jetpt = new_ptr(Histogram(0.,1000.,1000));
+ _vpt = new_ptr(Histogram(0.,1000.,1000));
+ _vhpt = new_ptr(Histogram(0.,1000.,1000));
+ for(unsigned int ix=0;ix<3;++ix) {
+ _yj [ix] = new_ptr(Histogram(-10.,10.,200));
+ _yjyh[ix] = new_ptr(Histogram(-10.,10.,200));
+ _yjyv[ix] = new_ptr(Histogram(-10.,10.,200));
+ _yjyhv[ix] = new_ptr(Histogram(-10.,10.,200));
+ _njet[ix] = new_ptr(Histogram(-0.5,10.5,11));
+ }
+}
diff --git a/Tests/Hadron/VHTest.h b/Tests/Hadron/VHTest.h
new file mode 100644
--- /dev/null
+++ b/Tests/Hadron/VHTest.h
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+#ifndef HERWIG_VHTest_H
+#define HERWIG_VHTest_H
+//
+// This is the declaration of the VHTest class.
+//
+
+#include "ThePEG/Handlers/AnalysisHandler.h"
+#include "Herwig++/Utilities/Histogram.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * Here is the documentation of the VHTest class.
+ *
+ * @see \ref VHTestInterfaces "The interfaces"
+ * defined for VHTest.
+ */
+class VHTest: public AnalysisHandler {
+
+public:
+
+ /** @name Virtual functions required by the AnalysisHandler class. */
+ //@{
+ /**
+ * Analyze a given Event. Note that a fully generated event
+ * may be presented several times, if it has been manipulated in
+ * between. The default version of this function will call transform
+ * to make a lorentz transformation of the whole event, then extract
+ * all final state particles and call analyze(tPVector) of this
+ * analysis object and those of all associated analysis objects. The
+ * default version will not, however, do anything on events which
+ * have not been fully generated, or have been manipulated in any
+ * way.
+ * @param event pointer to the Event to be analyzed.
+ * @param ieve the event number.
+ * @param loop the number of times this event has been presented.
+ * If negative the event is now fully generated.
+ * @param state a number different from zero if the event has been
+ * manipulated in some way since it was last presented.
+ */
+ virtual void analyze(tEventPtr event, long ieve, int loop, int state);
+ //@}
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * 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.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+protected:
+
+ /** @name Standard Interfaced functions. */
+ //@{
+ /**
+ * Initialize this object. Called in the run phase just before
+ * a run begins.
+ */
+ virtual void doinitrun();
+
+ /**
+ * Finalize this object. Called in the run phase just after a
+ * run has ended. Used eg. to write out statistics.
+ */
+ virtual void dofinish();
+ //@}
+
+private:
+
+ /**
+ * The static object used to initialize the description of this class.
+ * Indicates that this is a concrete class with persistent data.
+ */
+ static ClassDescription<VHTest> initVHTest;
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ VHTest & operator=(const VHTest &);
+
+private:
+
+ HistogramPtr _higgspt,_jetpt,_vpt,_vhpt;
+
+ HistogramPtr _yj[3];
+
+ HistogramPtr _yjyh[3],_yjyv[3],_yjyhv[3];
+
+ HistogramPtr _njet[3];
+
+};
+
+}
+
+#include "ThePEG/Utilities/ClassTraits.h"
+
+namespace ThePEG {
+
+/** @cond TRAITSPECIALIZATIONS */
+
+/** This template specialization informs ThePEG about the
+ * base classes of VHTest. */
+template <>
+struct BaseClassTrait<Herwig::VHTest,1> {
+ /** Typedef of the first base class of VHTest. */
+ typedef AnalysisHandler NthBase;
+};
+
+/** This template specialization informs ThePEG about the name of
+ * the VHTest class and the shared object where it is defined. */
+template <>
+struct ClassTraits<Herwig::VHTest>
+ : public ClassTraitsBase<Herwig::VHTest> {
+ /** Return a platform-independent class name */
+ static string className() { return "Herwig::VHTest"; }
+ /**
+ * The name of a file containing the dynamic library where the class
+ * VHTest is implemented. It may also include several, space-separated,
+ * libraries if the class VHTest 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 "libfastjet.so HadronJetTest.so"; }
+};
+
+/** @endcond */
+
+}
+
+#endif /* HERWIG_VHTest_H */
diff --git a/Tests/Hadron/VTest.cc b/Tests/Hadron/VTest.cc
new file mode 100644
--- /dev/null
+++ b/Tests/Hadron/VTest.cc
@@ -0,0 +1,196 @@
+// -*- C++ -*-
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the VTest class.
+//
+
+#include "VTest.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+#include "ThePEG/PDT/EnumParticles.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/EventRecord/Event.h"
+#include "fastjet/PseudoJet.hh"
+#include "fastjet/ClusterSequence.hh"
+
+using namespace Herwig;
+
+void VTest::analyze(tEventPtr event, long, int , int) {
+ // Rotate to CMS, extract final state particles and call analyze(particles).
+ set<tPPtr> particles;
+ event->selectFinalState(inserter(particles));
+ tParticleVector leptons;
+ tParticleVector part2;
+ for(set<tPPtr>::const_iterator it=particles.begin();
+ it!=particles.end();++it) {
+ tPPtr parent=*it;
+ do {
+ if(abs(parent->id())==ParticleID::Wplus||
+ parent->id()==ParticleID::Z0||parent->id()==ParticleID::gamma) break;
+ parent = parent->parents()[0];
+ }
+ while(!parent->parents().empty());
+ if(!parent) {
+ part2.push_back(*it);
+ }
+ else if(abs(parent->id())==ParticleID::Wplus||
+ parent->id()==ParticleID::Z0||parent->id()==ParticleID::gamma) {
+ leptons.push_back(*it);
+ }
+ else {
+ part2.push_back(*it);
+ }
+ }
+ if(leptons.size()!=2) return;
+ Lorentz5Momentum pv = leptons[0]->momentum()+leptons[1]->momentum();
+ *_vpt += pv.perp()/GeV;
+ // callFastjet using R-parameter of 1 to get inclusive jets
+ vector<fastjet::PseudoJet> fastjet_particles;
+ for (unsigned int j=0; j<part2.size(); j++) {
+ fastjet::PseudoJet p(part2[j]->momentum().x()/GeV,
+ part2[j]->momentum().y()/GeV,
+ part2[j]->momentum().z()/GeV,
+ part2[j]->momentum().e()/GeV);
+ p.set_user_index(j);
+ fastjet_particles.push_back(p);
+ }
+ fastjet::RecombinationScheme recomb_scheme = fastjet::E_scheme;
+ fastjet::Strategy strategy = fastjet::Best;
+ fastjet::JetDefinition jet_def(fastjet::kt_algorithm, 1.,
+ recomb_scheme, strategy);
+ fastjet::ClusterSequence cs(fastjet_particles, jet_def);
+ vector<fastjet::PseudoJet> jets = sorted_by_pt(cs.inclusive_jets());
+ double yv = pv.rapidity();
+ double yjet = jets[0].rapidity();
+ double ptj=jets[0].perp();
+ int njet[3]={0,0,0};
+ for(unsigned int ix=0;ix<jets.size();++ix) {
+ if(jets[ix].perp()>10.) ++njet[0];
+ if(jets[ix].perp()>40.) ++njet[1];
+ if(jets[ix].perp()>80.) ++njet[2];
+ }
+ *_jetpt += ptj;
+ if(ptj>10.) {
+ *_yj[0] += yjet;
+ *_yjyv[0] += yjet-yv;
+ }
+ if(ptj>40.) {
+ *_yj[1] += yjet;
+ *_yjyv[1] += yjet-yv;
+ }
+ if(ptj>80.) {
+ *_yj[2] += yjet;
+ *_yjyv[2] += yjet-yv;
+ }
+ for(unsigned int ix=0;ix<3;++ix) *_njet[ix] +=njet[ix];
+}
+
+IBPtr VTest::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr VTest::fullclone() const {
+ return new_ptr(*this);
+}
+
+void VTest::persistentOutput(PersistentOStream & ) const {
+}
+
+void VTest::persistentInput(PersistentIStream & , int) {
+}
+
+ClassDescription<VTest> VTest::initVTest;
+// Definition of the static class description member.
+
+void VTest::Init() {
+
+ static ClassDocumentation<VTest> documentation
+ ("There is no documentation for the VTest class");
+
+}
+
+void VTest::dofinish() {
+ AnalysisHandler::dofinish();
+ ofstream file;
+ string fname = generator()->filename() + string("-") + name() + string(".top");
+ file.open(fname.c_str());
+ using namespace HistogramOptions;
+ _vpt->topdrawOutput(file,Frame|Ylog,"BLACK","V Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _vpt->normaliseToCrossSection();
+ _vpt->topdrawOutput(file,Frame|Ylog,"BLACK","V Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _jetpt->topdrawOutput(file,Frame|Ylog,"BLACK","Hardest Jet Pt","",
+ "1/SdS/dp0T1/GeV2-13",
+ " G G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ _jetpt->normaliseToCrossSection();
+ _jetpt->topdrawOutput(file,Frame|Ylog,"BLACK","Hardest Jet Pt","",
+ "dS/dp0T1/nbGeV2-13",
+ " G X X X X",
+ "p0T1/GeV",
+ " X X ");
+ string title;
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity p0T1>80 GeV";
+ _yj[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dy0j1",
+ " G G X X","y0j1"," X X");
+ _yj[ix]->normaliseToCrossSection();
+ _yj[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dy0j1/nb",
+ " G G X X ","y0j1"," X X");
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Hardest jet rapidity - V rapidity p0T1>10 GeV";
+ else if(ix==1) title ="Hardest jet rapidity - V rapidity p0T1>40 GeV";
+ else if(ix==2) title ="Hardest jet rapidity - V rapidity p0T1>80 GeV";
+ _yjyv[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0h1)",
+ " G G X X X X ","y0j1-y0h1"," X X X X");
+ _yjyv[ix]->normaliseToCrossSection();
+ _yjyv[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/d(y0j1-y0h1)/nb",
+ " G G X X X X ","y0j1-y0h1"," X X X X");
+
+ }
+ for(unsigned int ix=0;ix<3;++ix) {
+ if(ix==0) title ="Number of jets p0T1>10 GeV";
+ else if(ix==1) title ="Number of jets p0T1>40 GeV";
+ else if(ix==2) title ="Number of jets p0T1>80 GeV";
+ _njet[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dN0jet1",
+ " G G X X","N0jet1"," X X");
+ _njet[ix]->normaliseToCrossSection();
+ _njet[ix]->topdrawOutput(file,Frame,"BLACK",title,
+ " X X ",
+ "1/SdS/dN0jet1/nb",
+ " G G X X","N0jet1"," X X");
+ }
+}
+
+void VTest::doinitrun() {
+ AnalysisHandler::doinitrun();
+ _vpt = new_ptr(Histogram(0.,1000.,1000));
+ _jetpt = new_ptr(Histogram(0.,1000.,1000));
+ for(unsigned int ix=0;ix<3;++ix) {
+ _yj [ix] = new_ptr(Histogram(-10.,10.,200));
+ _yjyv[ix] = new_ptr(Histogram(-10.,10.,200));
+ _njet[ix] = new_ptr(Histogram(-0.5,10.5,11));
+ }
+}
diff --git a/Tests/Hadron/VTest.h b/Tests/Hadron/VTest.h
new file mode 100644
--- /dev/null
+++ b/Tests/Hadron/VTest.h
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+#ifndef HERWIG_VTest_H
+#define HERWIG_VTest_H
+//
+// This is the declaration of the VTest class.
+//
+
+#include "ThePEG/Handlers/AnalysisHandler.h"
+#include "Herwig++/Utilities/Histogram.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * Here is the documentation of the VTest class.
+ *
+ * @see \ref VTestInterfaces "The interfaces"
+ * defined for VTest.
+ */
+class VTest: public AnalysisHandler {
+
+public:
+
+ /** @name Virtual functions required by the AnalysisHandler class. */
+ //@{
+ /**
+ * Analyze a given Event. Note that a fully generated event
+ * may be presented several times, if it has been manipulated in
+ * between. The default version of this function will call transform
+ * to make a lorentz transformation of the whole event, then extract
+ * all final state particles and call analyze(tPVector) of this
+ * analysis object and those of all associated analysis objects. The
+ * default version will not, however, do anything on events which
+ * have not been fully generated, or have been manipulated in any
+ * way.
+ * @param event pointer to the Event to be analyzed.
+ * @param ieve the event number.
+ * @param loop the number of times this event has been presented.
+ * If negative the event is now fully generated.
+ * @param state a number different from zero if the event has been
+ * manipulated in some way since it was last presented.
+ */
+ virtual void analyze(tEventPtr event, long ieve, int loop, int state);
+ //@}
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * 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.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+protected:
+
+ /** @name Standard Interfaced functions. */
+ //@{
+ /**
+ * Initialize this object. Called in the run phase just before
+ * a run begins.
+ */
+ virtual void doinitrun();
+
+ /**
+ * Finalize this object. Called in the run phase just after a
+ * run has ended. Used eg. to write out statistics.
+ */
+ virtual void dofinish();
+ //@}
+
+private:
+
+ /**
+ * The static object used to initialize the description of this class.
+ * Indicates that this is a concrete class with persistent data.
+ */
+ static ClassDescription<VTest> initVTest;
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ VTest & operator=(const VTest &);
+
+private:
+
+ HistogramPtr _vpt,_jetpt;
+
+ HistogramPtr _yj[3];
+
+ HistogramPtr _yjyv[3];
+
+ HistogramPtr _njet[3];
+
+};
+
+}
+
+#include "ThePEG/Utilities/ClassTraits.h"
+
+namespace ThePEG {
+
+/** @cond TRAITSPECIALIZATIONS */
+
+/** This template specialization informs ThePEG about the
+ * base classes of VTest. */
+template <>
+struct BaseClassTrait<Herwig::VTest,1> {
+ /** Typedef of the first base class of VTest. */
+ typedef AnalysisHandler NthBase;
+};
+
+/** This template specialization informs ThePEG about the name of
+ * the VTest class and the shared object where it is defined. */
+template <>
+struct ClassTraits<Herwig::VTest>
+ : public ClassTraitsBase<Herwig::VTest> {
+ /** Return a platform-independent class name */
+ static string className() { return "Herwig::VTest"; }
+ /**
+ * The name of a file containing the dynamic library where the class
+ * VTest is implemented. It may also include several, space-separated,
+ * libraries if the class VTest 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 "libfastjet.so HadronJetTest.so"; }
+};
+
+/** @endcond */
+
+}
+
+#endif /* HERWIG_VTest_H */
diff --git a/Tests/Inputs/LEP-TopDecay.in b/Tests/Inputs/LEP-TopDecay.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LEP-TopDecay.in
@@ -0,0 +1,19 @@
+cd /Herwig/Generators
+set LEPGenerator:NumberOfEvents 100000000
+set LEPGenerator:RandomNumberGenerator:Seed 31122001
+set LEPGenerator:DebugLevel 1
+set LEPGenerator:PrintEvent 10
+set LEPGenerator:MaxErrors 10000
+set LEPGenerator:EventHandler:LuminosityFunction:Energy 360.0
+set LEPGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
+set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
+cd /Herwig/MatrixElements
+insert SimpleEE:MatrixElements 0 MEee2gZ2qq
+set MEee2gZ2qq:MinimumFlavour 6
+set MEee2gZ2qq:MaximumFlavour 6
+cd /Herwig/Generators
+create Herwig::TopDecay /Herwig/Analysis/TopDecay libfastjet.so LeptonJetTest.so
+insert LEPGenerator:AnalysisHandlers 0 /Herwig/Analysis/TopDecay
+saverun LEP-TopDecay LEPGenerator
+
diff --git a/Tests/Inputs/LHC-HJet-Powheg.in b/Tests/Inputs/LHC-HJet-Powheg.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-HJet-Powheg.in
@@ -0,0 +1,40 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 10000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+set /Herwig/Analysis/Basics:CheckQuark 0
+set /Herwig/Particles/h0:Stable Stable
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] PowhegMEHiggs
+set /Herwig/Particles/p+:PDF /Herwig/Partons/MRST-NLO
+set /Herwig/Particles/pbar-:PDF /Herwig/Partons/MRST-NLO
+create Herwig::O2AlphaS O2AlphaS
+set /Herwig/Generators/LHCGenerator:StandardModelParameters:QCD/RunningAlphaS O2AlphaS
+cd /Herwig/Shower
+# use the general recon for now
+set KinematicsReconstructor:ReconstructionOption General
+# create the Powheg evolver and use it instead of the default one
+create Herwig::PowhegEvolver PowhegEvolver HwPowhegShower.so
+set ShowerHandler:Evolver PowhegEvolver
+set PowhegEvolver:ShowerModel ShowerModel
+set PowhegEvolver:SplittingGenerator SplittingGenerator
+set PowhegEvolver:MECorrMode 0
+set PowhegEvolver:IntrinsicPtGaussian 2.2*GeV
+# create and use the Drell-yan hard emission generator
+create Herwig::DrellYanHardGenerator DrellYanHardGenerator
+set DrellYanHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 DrellYanHardGenerator
+# create and use the gg->H hard emission generator
+create Herwig::GGtoHHardGenerator GGtoHHardGenerator
+set GGtoHHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 GGtoHHardGenerator
+cd /Herwig/Generators
+create Herwig::HTest HTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 HTest
+saverun LHC-HJet-Powheg LHCGenerator
diff --git a/Tests/Inputs/LHC-HJet.in b/Tests/Inputs/LHC-HJet.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-HJet.in
@@ -0,0 +1,19 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 10000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+set /Herwig/Analysis/Basics:CheckQuark 0
+set /Herwig/Particles/h0:Stable Stable
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+set /Herwig/Shower/Evolver:IntrinsicPtGaussian 2.2*GeV
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] MEHiggs
+cd /Herwig/Generators
+create Herwig::HTest HTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 HTest
+saverun LHC-HJet LHCGenerator
diff --git a/Tests/Inputs/LHC-WHJet-Powheg.in b/Tests/Inputs/LHC-WHJet-Powheg.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-WHJet-Powheg.in
@@ -0,0 +1,71 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 100000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+erase LHCGenerator:EventHandler:PostSubProcessHandlers 0
+set /Herwig/Analysis/Basics:CheckQuark 0
+set /Herwig/Particles/h0:Stable Stable
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] PowhegMEPP2WH
+set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
+set /Herwig/Particles/p+:PDF /Herwig/Partons/MRST-NLO
+set /Herwig/Particles/pbar-:PDF /Herwig/Partons/MRST-NLO
+create Herwig::O2AlphaS O2AlphaS
+set /Herwig/Generators/LHCGenerator:StandardModelParameters:QCD/RunningAlphaS O2AlphaS
+cd /Herwig/Shower
+# use the general recon for now
+set KinematicsReconstructor:ReconstructionOption General
+# create the Powheg evolver and use it instead of the default one
+create Herwig::PowhegEvolver PowhegEvolver HwPowhegShower.so
+set ShowerHandler:Evolver PowhegEvolver
+set PowhegEvolver:ShowerModel ShowerModel
+set PowhegEvolver:SplittingGenerator SplittingGenerator
+set PowhegEvolver:MECorrMode 0
+set PowhegEvolver:IntrinsicPtGaussian 2.2*GeV
+# create and use the Drell-yan hard emission generator
+create Herwig::DrellYanHardGenerator DrellYanHardGenerator
+set DrellYanHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 DrellYanHardGenerator
+# create and use the gg->H hard emission generator
+create Herwig::GGtoHHardGenerator GGtoHHardGenerator
+set GGtoHHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 GGtoHHardGenerator
+cd /Herwig/Generators
+create Herwig::VHTest /Herwig/Analysis/VHTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 /Herwig/Analysis/VHTest
+
+set /Herwig/Particles/W+/W+->bbar,c;:OnOff Off
+set /Herwig/Particles/W+/W+->c,dbar;:OnOff Off
+set /Herwig/Particles/W+/W+->c,sbar;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_e,e+;:OnOff On
+set /Herwig/Particles/W+/W+->nu_mu,mu+;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_tau,tau+;:OnOff Off
+set /Herwig/Particles/W+/W+->sbar,u;:OnOff Off
+set /Herwig/Particles/W+/W+->u,dbar;:OnOff Off
+set /Herwig/Particles/W-/W-->b,cbar;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,d;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,s;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_ebar,e-;:OnOff On
+set /Herwig/Particles/W-/W-->nu_mubar,mu-;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_taubar,tau-;:OnOff Off
+set /Herwig/Particles/W-/W-->s,ubar;:OnOff Off
+set /Herwig/Particles/W-/W-->ubar,d;:OnOff Off
+set /Herwig/Particles/Z0/Z0->b,bbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->c,cbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->d,dbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->e-,e+;:OnOff On
+set /Herwig/Particles/Z0/Z0->mu-,mu+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_e,nu_ebar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_mu,nu_mubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_tau,nu_taubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->s,sbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->tau-,tau+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->u,ubar;:OnOff Off
+saverun LHC-WHJet-Powheg LHCGenerator
+
diff --git a/Tests/Inputs/LHC-WHJet.in b/Tests/Inputs/LHC-WHJet.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-WHJet.in
@@ -0,0 +1,50 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 100000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+erase LHCGenerator:EventHandler:PostSubProcessHandlers 0
+set /Herwig/Analysis/Basics:CheckQuark 0
+set /Herwig/Particles/h0:Stable Stable
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+set /Herwig/Shower/Evolver:IntrinsicPtGaussian 2.2*GeV
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] MEPP2WH
+set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
+cd /Herwig/Generators
+create Herwig::VHTest /Herwig/Analysis/VHTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 /Herwig/Analysis/VHTest
+
+set /Herwig/Particles/W+/W+->bbar,c;:OnOff Off
+set /Herwig/Particles/W+/W+->c,dbar;:OnOff Off
+set /Herwig/Particles/W+/W+->c,sbar;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_e,e+;:OnOff On
+set /Herwig/Particles/W+/W+->nu_mu,mu+;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_tau,tau+;:OnOff Off
+set /Herwig/Particles/W+/W+->sbar,u;:OnOff Off
+set /Herwig/Particles/W+/W+->u,dbar;:OnOff Off
+set /Herwig/Particles/W-/W-->b,cbar;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,d;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,s;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_ebar,e-;:OnOff On
+set /Herwig/Particles/W-/W-->nu_mubar,mu-;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_taubar,tau-;:OnOff Off
+set /Herwig/Particles/W-/W-->s,ubar;:OnOff Off
+set /Herwig/Particles/W-/W-->ubar,d;:OnOff Off
+set /Herwig/Particles/Z0/Z0->b,bbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->c,cbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->d,dbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->e-,e+;:OnOff On
+set /Herwig/Particles/Z0/Z0->mu-,mu+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_e,nu_ebar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_mu,nu_mubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_tau,nu_taubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->s,sbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->tau-,tau+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->u,ubar;:OnOff Off
+saverun LHC-WHJet LHCGenerator
+
diff --git a/Tests/Inputs/LHC-WShower-Powheg.in b/Tests/Inputs/LHC-WShower-Powheg.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-WShower-Powheg.in
@@ -0,0 +1,40 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 10000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+set /Herwig/Analysis/Basics:CheckQuark 0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] PowhegMEqq2W2ff
+set PowhegMEqq2W2ff:Process Electron
+set /Herwig/Particles/p+:PDF /Herwig/Partons/MRST-NLO
+set /Herwig/Particles/pbar-:PDF /Herwig/Partons/MRST-NLO
+create Herwig::O2AlphaS O2AlphaS
+set /Herwig/Generators/LHCGenerator:StandardModelParameters:QCD/RunningAlphaS O2AlphaS
+cd /Herwig/Shower
+# use the general recon for now
+set KinematicsReconstructor:ReconstructionOption General
+# create the Powheg evolver and use it instead of the default one
+create Herwig::PowhegEvolver PowhegEvolver HwPowhegShower.so
+set ShowerHandler:Evolver PowhegEvolver
+set PowhegEvolver:ShowerModel ShowerModel
+set PowhegEvolver:SplittingGenerator SplittingGenerator
+set PowhegEvolver:MECorrMode 0
+set PowhegEvolver:IntrinsicPtGaussian 2.2*GeV
+# create and use the Drell-yan hard emission generator
+create Herwig::DrellYanHardGenerator DrellYanHardGenerator
+set DrellYanHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 DrellYanHardGenerator
+# create and use the gg->H hard emission generator
+create Herwig::GGtoHHardGenerator GGtoHHardGenerator
+set GGtoHHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 GGtoHHardGenerator
+cd /Herwig/Generators
+create Herwig::VTest VTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 VTest
+saverun LHC-WShower-Powheg LHCGenerator
diff --git a/Tests/Inputs/LHC-WShower.in b/Tests/Inputs/LHC-WShower.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-WShower.in
@@ -0,0 +1,19 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 10000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+set /Herwig/Analysis/Basics:CheckQuark 0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+set /Herwig/Shower/Evolver:IntrinsicPtGaussian 2.2*GeV
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] MEqq2W2ff
+set MEqq2W2ff:Process Electron
+cd /Herwig/Generators
+create Herwig::VTest VTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 VTest
+saverun LHC-WShower LHCGenerator
diff --git a/Tests/Inputs/LHC-ZHJet-Powheg.in b/Tests/Inputs/LHC-ZHJet-Powheg.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-ZHJet-Powheg.in
@@ -0,0 +1,71 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 100000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+erase LHCGenerator:EventHandler:PostSubProcessHandlers 0
+set /Herwig/Analysis/Basics:CheckQuark 0
+set /Herwig/Particles/h0:Stable Stable
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] PowhegMEPP2ZH
+set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
+set /Herwig/Particles/p+:PDF /Herwig/Partons/MRST-NLO
+set /Herwig/Particles/pbar-:PDF /Herwig/Partons/MRST-NLO
+create Herwig::O2AlphaS O2AlphaS
+set /Herwig/Generators/LHCGenerator:StandardModelParameters:QCD/RunningAlphaS O2AlphaS
+cd /Herwig/Shower
+# use the general recon for now
+set KinematicsReconstructor:ReconstructionOption General
+# create the Powheg evolver and use it instead of the default one
+create Herwig::PowhegEvolver PowhegEvolver HwPowhegShower.so
+set ShowerHandler:Evolver PowhegEvolver
+set PowhegEvolver:ShowerModel ShowerModel
+set PowhegEvolver:SplittingGenerator SplittingGenerator
+set PowhegEvolver:MECorrMode 0
+set PowhegEvolver:IntrinsicPtGaussian 2.2*GeV
+# create and use the Drell-yan hard emission generator
+create Herwig::DrellYanHardGenerator DrellYanHardGenerator
+set DrellYanHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 DrellYanHardGenerator
+# create and use the gg->H hard emission generator
+create Herwig::GGtoHHardGenerator GGtoHHardGenerator
+set GGtoHHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 GGtoHHardGenerator
+cd /Herwig/Generators
+create Herwig::VHTest /Herwig/Analysis/VHTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 /Herwig/Analysis/VHTest
+
+set /Herwig/Particles/W+/W+->bbar,c;:OnOff Off
+set /Herwig/Particles/W+/W+->c,dbar;:OnOff Off
+set /Herwig/Particles/W+/W+->c,sbar;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_e,e+;:OnOff On
+set /Herwig/Particles/W+/W+->nu_mu,mu+;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_tau,tau+;:OnOff Off
+set /Herwig/Particles/W+/W+->sbar,u;:OnOff Off
+set /Herwig/Particles/W+/W+->u,dbar;:OnOff Off
+set /Herwig/Particles/W-/W-->b,cbar;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,d;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,s;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_ebar,e-;:OnOff On
+set /Herwig/Particles/W-/W-->nu_mubar,mu-;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_taubar,tau-;:OnOff Off
+set /Herwig/Particles/W-/W-->s,ubar;:OnOff Off
+set /Herwig/Particles/W-/W-->ubar,d;:OnOff Off
+set /Herwig/Particles/Z0/Z0->b,bbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->c,cbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->d,dbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->e-,e+;:OnOff On
+set /Herwig/Particles/Z0/Z0->mu-,mu+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_e,nu_ebar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_mu,nu_mubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_tau,nu_taubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->s,sbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->tau-,tau+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->u,ubar;:OnOff Off
+saverun LHC-ZHJet-Powheg LHCGenerator
+
diff --git a/Tests/Inputs/LHC-ZHJet.in b/Tests/Inputs/LHC-ZHJet.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-ZHJet.in
@@ -0,0 +1,50 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 100000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+erase LHCGenerator:EventHandler:PostSubProcessHandlers 0
+set /Herwig/Analysis/Basics:CheckQuark 0
+set /Herwig/Particles/h0:Stable Stable
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+set /Herwig/Shower/Evolver:IntrinsicPtGaussian 2.2*GeV
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] MEPP2ZH
+set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
+cd /Herwig/Generators
+create Herwig::VHTest /Herwig/Analysis/VHTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 /Herwig/Analysis/VHTest
+
+set /Herwig/Particles/W+/W+->bbar,c;:OnOff Off
+set /Herwig/Particles/W+/W+->c,dbar;:OnOff Off
+set /Herwig/Particles/W+/W+->c,sbar;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_e,e+;:OnOff On
+set /Herwig/Particles/W+/W+->nu_mu,mu+;:OnOff Off
+set /Herwig/Particles/W+/W+->nu_tau,tau+;:OnOff Off
+set /Herwig/Particles/W+/W+->sbar,u;:OnOff Off
+set /Herwig/Particles/W+/W+->u,dbar;:OnOff Off
+set /Herwig/Particles/W-/W-->b,cbar;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,d;:OnOff Off
+set /Herwig/Particles/W-/W-->cbar,s;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_ebar,e-;:OnOff On
+set /Herwig/Particles/W-/W-->nu_mubar,mu-;:OnOff Off
+set /Herwig/Particles/W-/W-->nu_taubar,tau-;:OnOff Off
+set /Herwig/Particles/W-/W-->s,ubar;:OnOff Off
+set /Herwig/Particles/W-/W-->ubar,d;:OnOff Off
+set /Herwig/Particles/Z0/Z0->b,bbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->c,cbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->d,dbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->e-,e+;:OnOff On
+set /Herwig/Particles/Z0/Z0->mu-,mu+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_e,nu_ebar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_mu,nu_mubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->nu_tau,nu_taubar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->s,sbar;:OnOff Off
+set /Herwig/Particles/Z0/Z0->tau-,tau+;:OnOff Off
+set /Herwig/Particles/Z0/Z0->u,ubar;:OnOff Off
+saverun LHC-ZHJet LHCGenerator
+
diff --git a/Tests/Inputs/LHC-ZShower-Powheg.in b/Tests/Inputs/LHC-ZShower-Powheg.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-ZShower-Powheg.in
@@ -0,0 +1,40 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 10000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+set /Herwig/Analysis/Basics:CheckQuark 0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] PowhegMEqq2gZ2ff
+set MEqq2gZ2ff:Process Electron
+set /Herwig/Particles/p+:PDF /Herwig/Partons/MRST-NLO
+set /Herwig/Particles/pbar-:PDF /Herwig/Partons/MRST-NLO
+create Herwig::O2AlphaS O2AlphaS
+set /Herwig/Generators/LHCGenerator:StandardModelParameters:QCD/RunningAlphaS O2AlphaS
+cd /Herwig/Shower
+# use the general recon for now
+set KinematicsReconstructor:ReconstructionOption General
+# create the Powheg evolver and use it instead of the default one
+create Herwig::PowhegEvolver PowhegEvolver HwPowhegShower.so
+set ShowerHandler:Evolver PowhegEvolver
+set PowhegEvolver:ShowerModel ShowerModel
+set PowhegEvolver:SplittingGenerator SplittingGenerator
+set PowhegEvolver:MECorrMode 0
+set PowhegEvolver:IntrinsicPtGaussian 2.2*GeV
+# create and use the Drell-yan hard emission generator
+create Herwig::DrellYanHardGenerator DrellYanHardGenerator
+set DrellYanHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 DrellYanHardGenerator
+# create and use the gg->H hard emission generator
+create Herwig::GGtoHHardGenerator GGtoHHardGenerator
+set GGtoHHardGenerator:ShowerAlpha AlphaQCD
+insert PowhegEvolver:HardGenerator 0 GGtoHHardGenerator
+cd /Herwig/Generators
+create Herwig::VTest VTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 VTest
+saverun LHC-ZShower-Powheg LHCGenerator
diff --git a/Tests/Inputs/LHC-ZShower.in b/Tests/Inputs/LHC-ZShower.in
new file mode 100644
--- /dev/null
+++ b/Tests/Inputs/LHC-ZShower.in
@@ -0,0 +1,19 @@
+cd /Herwig/Generators
+set LHCGenerator:NumberOfEvents 10000000
+set LHCGenerator:RandomNumberGenerator:Seed 31122001
+set LHCGenerator:DebugLevel 1
+set LHCGenerator:PrintEvent 10
+set LHCGenerator:MaxErrors 10000
+set LHCGenerator:EventHandler:CascadeHandler:MPIHandler NULL
+set LHCGenerator:EventHandler:DecayHandler NULL
+set LHCGenerator:EventHandler:HadronizationHandler NULL
+set /Herwig/Analysis/Basics:CheckQuark 0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 14000.0
+set /Herwig/Shower/Evolver:IntrinsicPtGaussian 2.2*GeV
+cd /Herwig/MatrixElements/
+insert SimpleQCD:MatrixElements[0] MEqq2gZ2ff
+set MEqq2gZ2ff:Process Electron
+cd /Herwig/Generators
+create Herwig::VTest VTest HadronJetTest.so
+insert LHCGenerator:AnalysisHandlers 0 VTest
+saverun LHC-ZShower LHCGenerator
diff --git a/Tests/Lepton/TopDecay.cc b/Tests/Lepton/TopDecay.cc
new file mode 100644
--- /dev/null
+++ b/Tests/Lepton/TopDecay.cc
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the TopDecay class.
+//
+
+#include "TopDecay.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+#include "ThePEG/PDT/EnumParticles.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/EventRecord/Event.h"
+#include "fastjet/PseudoJet.hh"
+#include "fastjet/ClusterSequence.hh"
+
+using namespace Herwig;
+
+void TopDecay::analyze(tEventPtr event, long ieve, int loop, int state) {
+ AnalysisHandler::analyze(event, ieve, loop, state);
+ // Rotate to CMS, extract final state particles and call analyze(particles).
+ tPVector particles;
+ event->selectFinalState(back_inserter(particles));
+ vector<fastjet::PseudoJet> fastjet_particles;
+ for (unsigned int j=0; j<particles.size(); j++) {
+ tPPtr parent=particles[j];
+ do {
+ if(parent->parents().empty()) parent = tPPtr();
+ else parent = parent->parents()[0];
+ }
+ while (parent&&abs(parent->id())!=ParticleID::Wplus);
+ if(parent&&abs(parent->id())==ParticleID::Wplus) continue;
+ fastjet::PseudoJet p(particles[j]->momentum().x()/GeV,
+ particles[j]->momentum().y()/GeV,
+ particles[j]->momentum().z()/GeV,
+ particles[j]->momentum().e()/GeV);
+ p.set_user_index(j);
+ fastjet_particles.push_back(p);
+ }
+ fastjet::RecombinationScheme recomb_scheme = fastjet::E_scheme;
+ fastjet::Strategy strategy = fastjet::Best;
+ fastjet::JetDefinition jet_def(fastjet::ee_kt_algorithm,
+ recomb_scheme, strategy);
+ fastjet::ClusterSequence cs(fastjet_particles, jet_def);
+
+ // ynm distributions
+ y3_ += log10(cs.exclusive_ymerge(3));
+}
+
+
+IBPtr TopDecay::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr TopDecay::fullclone() const {
+ return new_ptr(*this);
+}
+void TopDecay::persistentOutput(PersistentOStream & os) const {
+}
+
+void TopDecay::persistentInput(PersistentIStream & is, int) {
+}
+
+ClassDescription<TopDecay> TopDecay::initTopDecay;
+// Definition of the static class description member.
+
+void TopDecay::Init() {
+
+ static ClassDocumentation<TopDecay> documentation
+ ("There is no documentation for the TopDecay class");
+
+}
+
+void TopDecay::dofinish() {
+ AnalysisHandler::dofinish();
+ using namespace HistogramOptions;
+ string fname = generator()->filename() + string("-")
+ + name() + string(".top");
+ ofstream output(fname.c_str());
+ y3_.topdrawOutput(output,Frame,
+ "RED",
+ "y0231 ",
+ " X X ",
+ "1/NdN/dlog(y0231)",
+ " X X ",
+ "log(y0231)",
+ " X X ");
+}
diff --git a/Tests/Lepton/TopDecay.h b/Tests/Lepton/TopDecay.h
new file mode 100644
--- /dev/null
+++ b/Tests/Lepton/TopDecay.h
@@ -0,0 +1,166 @@
+// -*- C++ -*-
+#ifndef HERWIG_TopDecay_H
+#define HERWIG_TopDecay_H
+//
+// This is the declaration of the TopDecay class.
+//
+
+#include "ThePEG/Handlers/AnalysisHandler.h"
+#include "Herwig++/Utilities/Histogram.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * Here is the documentation of the TopDecay class.
+ *
+ * @see \ref TopDecayInterfaces "The interfaces"
+ * defined for TopDecay.
+ */
+class TopDecay: public AnalysisHandler {
+
+public:
+
+ /**
+ * The default constructor.
+ */
+ TopDecay() : y3_(-4.,-1.,100) {}
+
+public:
+
+ /** @name Virtual functions required by the AnalysisHandler class. */
+ //@{
+ /**
+ * Analyze a given Event. Note that a fully generated event
+ * may be presented several times, if it has been manipulated in
+ * between. The default version of this function will call transform
+ * to make a lorentz transformation of the whole event, then extract
+ * all final state particles and call analyze(tPVector) of this
+ * analysis object and those of all associated analysis objects. The
+ * default version will not, however, do anything on events which
+ * have not been fully generated, or have been manipulated in any
+ * way.
+ * @param event pointer to the Event to be analyzed.
+ * @param ieve the event number.
+ * @param loop the number of times this event has been presented.
+ * If negative the event is now fully generated.
+ * @param state a number different from zero if the event has been
+ * manipulated in some way since it was last presented.
+ */
+ virtual void analyze(tEventPtr event, long ieve, int loop, int state);
+ //@}
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * 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.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+
+protected:
+
+ /** @name Standard Interfaced functions. */
+ //@{
+ /**
+ * Finalize this object. Called in the run phase just after a
+ * run has ended. Used eg. to write out statistics.
+ */
+ virtual void dofinish();
+ //@}
+
+private:
+
+ /**
+ * The static object used to initialize the description of this class.
+ * Indicates that this is a concrete class with persistent data.
+ */
+ static ClassDescription<TopDecay> initTopDecay;
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ TopDecay & operator=(const TopDecay &);
+
+private:
+
+ Histogram y3_;
+
+};
+
+}
+
+#include "ThePEG/Utilities/ClassTraits.h"
+
+namespace ThePEG {
+
+/** @cond TRAITSPECIALIZATIONS */
+
+/** This template specialization informs ThePEG about the
+ * base classes of TopDecay. */
+template <>
+struct BaseClassTrait<Herwig::TopDecay,1> {
+ /** Typedef of the first base class of TopDecay. */
+ typedef AnalysisHandler NthBase;
+};
+
+/** This template specialization informs ThePEG about the name of
+ * the TopDecay class and the shared object where it is defined. */
+template <>
+struct ClassTraits<Herwig::TopDecay>
+ : public ClassTraitsBase<Herwig::TopDecay> {
+ /** Return a platform-independent class name */
+ static string className() { return "Herwig::TopDecay"; }
+ /**
+ * The name of a file containing the dynamic library where the class
+ * TopDecay is implemented. It may also include several, space-separated,
+ * libraries if the class TopDecay 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 "libfastjet.so LeptonJetTest.so"; }
+};
+
+/** @endcond */
+
+}
+
+#endif /* HERWIG_TopDecay_H */
diff --git a/Tests/Makefile.am b/Tests/Makefile.am
--- a/Tests/Makefile.am
+++ b/Tests/Makefile.am
@@ -1,70 +1,112 @@
AUTOMAKE_OPTIONS = -Wno-portability
AM_LDFLAGS += -module -avoid-version -rpath /dummy/path/not/used
EXTRA_DIST = Inputs
dist-hook:
rm -rf $(distdir)/Inputs/.svn
+EXTRA_LTLIBRARIES = LeptonTest.la GammaTest.la HadronTest.la DISTest.la
-EXTRA_LTLIBRARIES = LeptonTest.la GammaTest.la HadronTest.la DISTest.la
+if WANT_LIBFASTJET
+EXTRA_LTLIBRARIES += HadronJetTest.la LeptonJetTest.la
+HadronJetTest_la_SOURCES = \
+Hadron/VHTest.h Hadron/VHTest.cc\
+Hadron/VTest.h Hadron/VTest.cc\
+Hadron/HTest.h Hadron/HTest.cc
+HadronJetTest_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
+-I$(FASTJETPATH)
+HadronJetTest_la_LIBADD = $(FASTJETLIBS)
+LeptonJetTest_la_SOURCES = \
+Lepton/TopDecay.h Lepton/TopDecay.cc
+LeptonJetTest_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
+-I$(FASTJETPATH)
+LeptonJetTest_la_LIBADD = $(FASTJETLIBS)
+endif
LeptonTest_la_SOURCES = \
Lepton/VVTest.h Lepton/VVTest.cc \
Lepton/VBFTest.h Lepton/VBFTest.cc \
Lepton/VHTest.h Lepton/VHTest.cc \
Lepton/FermionTest.h Lepton/FermionTest.cc
GammaTest_la_SOURCES = \
Gamma/GammaMETest.h Gamma/GammaMETest.cc \
Gamma/GammaPMETest.h Gamma/GammaPMETest.cc
DISTest_la_SOURCES = \
DIS/DISTest.h DIS/DISTest.cc
HadronTest_la_SOURCES = \
Hadron/HadronVVTest.h Hadron/HadronVVTest.cc\
Hadron/HadronVBFTest.h Hadron/HadronVBFTest.cc\
Hadron/WHTest.h Hadron/WHTest.cc\
Hadron/ZHTest.h Hadron/ZHTest.cc\
Hadron/VGammaTest.h Hadron/VGammaTest.cc\
Hadron/ZJetTest.h Hadron/ZJetTest.cc\
Hadron/WJetTest.h Hadron/WJetTest.cc\
Hadron/QQHTest.h Hadron/QQHTest.cc
+
REPO = $(top_builddir)/src/HerwigDefaults.rpo
HERWIG = $(top_builddir)/src/Herwig++
HWREAD = $(HERWIG) read -r $(REPO) -L $(builddir)/.libs
HWRUN = $(HERWIG) run
tests : tests-LEP tests-DIS tests-LHC tests-Gamma
+if WANT_LIBFASTJET
tests-LEP : test-LEP-VV test-LEP-VH test-LEP-VBF test-LEP-default test-LEP-BB test-LEP-Quarks test-LEP-Leptons
+else
+tests-LEP : test-LEP-VV test-LEP-VH test-LEP-VBF test-LEP-default test-LEP-BB test-LEP-Quarks test-LEP-TopDecay
+endif
tests-DIS : test-DIS-Charged test-DIS-Neutral
+if WANT_LIBFASTJET
+tests-LHC : test-LHC-WW test-LHC-WZ test-LHC-ZZ test-LHC-ZGamma test-LHC-WGamma test-LHC-ZGamma \
+ test-LHC-ZH test-LHC-WH test-LHC-ZJet test-LHC-WJet test-LHC-Z test-LHC-W test-LHC-ZZVBF test-LHC-VBF \
+ test-LHC-WWVBF test-LHC-bbH test-LHC-ttH test-LHC-GammaGamma test-LHC-GammaJet test-LHC-Higgs \
+ test-LHC-HiggsJet test-LHC-QCDFast test-LHC-QCD test-LHC-Top \
+ test-LHC-WHJet test-LHC-ZHJet test-LHC-HJet test-LHC-ZShower test-LHC-WShower\
+ test-LHC-WHJet-Powheg test-LHC-ZHJet-Powheg test-LHC-HJet-Powheg \
+ test-LHC-ZShower-Powheg test-LHC-WShower-Powheg
+else
tests-LHC : test-LHC-WW test-LHC-WZ test-LHC-ZZ test-LHC-ZGamma test-LHC-WGamma test-LHC-ZGamma \
test-LHC-ZH test-LHC-WH test-LHC-ZJet test-LHC-WJet test-LHC-Z test-LHC-W test-LHC-ZZVBF test-LHC-VBF \
test-LHC-WWVBF test-LHC-bbH test-LHC-ttH test-LHC-GammaGamma test-LHC-GammaJet test-LHC-Higgs \
test-LHC-HiggsJet test-LHC-QCDFast test-LHC-QCD test-LHC-Top
+endif
tests-Gamma : test-Gamma-FF test-Gamma-WW test-Gamma-P
+if WANT_LIBFASTJET
+test-LEP-% : Inputs/LEP-%.in LeptonTest.la LeptonJetTest.la
+ $(HWREAD) $<
+ $(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
+else
test-LEP-% : Inputs/LEP-%.in LeptonTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
+endif
test-Gamma-% : Inputs/Gamma-%.in GammaTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
test-DIS-% : Inputs/DIS-%.in DISTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
+if WANT_LIBFASTJET
+test-LHC-% : Inputs/LHC-%.in HadronTest.la HadronJetTest.la
+ $(HWREAD) $<
+ $(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
+else
test-LHC-% : Inputs/LHC-%.in HadronTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
+endif
clean-local:
rm -f *.out *.log *.tex *.top *.run *.dump *.mult *.Bmult
diff --git a/Tests/python/compare.py b/Tests/python/compare.py
new file mode 100644
--- /dev/null
+++ b/Tests/python/compare.py
@@ -0,0 +1,1697 @@
+import re
+import os
+import histogram
+td_command = '~/bin/td-Linux.libc6 -b -d POSTSCRIPT'
+
+def compareCrossSections(fname1,fname2) :
+ f1 = open(fname1)
+ test = f1.readline()
+ while test:
+ test = f1.readline()
+ loc = test.find("Total")
+ if ( loc >= 0 ) :
+ temp1 = test.rsplit(")")
+ exponent = temp1[1]
+ temp2 = temp1[0].rsplit("(")
+ errors = temp2[1]
+ temp1 = temp2[0].rsplit(" ",1)
+ mantisa = temp1[1]
+ p = re.compile( '[0-9]')
+ error2 = p.sub( '0', mantisa)
+ newerror = error2[0:error2.rindex("0")] + errors
+ cross1 = float(mantisa + exponent)
+ error1 = float(newerror + exponent)
+ f1.close()
+ f2 = open(fname2)
+ test = f2.readline()
+ while test:
+ test = f2.readline()
+ loc = test.find("Total")
+ if ( loc >= 0 ) :
+ temp1 = test.rsplit(")")
+ exponent = temp1[1]
+ temp2 = temp1[0].rsplit("(")
+ errors = temp2[1]
+ temp1 = temp2[0].rsplit(" ",1)
+ mantisa = temp1[1]
+ p = re.compile( '[0-9]')
+ error2 = p.sub( '0', mantisa)
+ newerror = error2[0:error2.rindex("0")] + errors
+ cross2 = float(mantisa + exponent)
+ error2 = float(newerror + exponent)
+ ratio = (cross1-cross2)**2/(error1**2+error2**2)
+ return [cross1,error1,cross2,error2,ratio]
+
+def compareLEPQuarks(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-Quarks.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-Quarks-QuarksTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ fo = open(fname,'w')
+ diff = histogram.compareTopdrawFiles(fname1,fname2,fo,40)
+ fo.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ diff[1] /= float(diff[0])
+ ws = "|| Quarks || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" \
+ % (output[0],output[1],output[2],output[3],output[4],diff[1],op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareLEPLeptons(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-Leptons.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-Leptons-LeptonsTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ fo = open(fname,'w')
+ diff = histogram.compareTopdrawFiles(fname1,fname2,fo,28)
+ fo.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ diff[1] /= float(diff[0])
+ ws = "|| Leptons || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],diff[1],op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareLEPVV(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-VV.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-VV-VVTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ fo = open(fname,'w')
+ diff = histogram.compareTopdrawFiles(fname1,fname2,fo,6)
+ fo.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ diff[1] /= float(diff[0])
+ ws = "|| VV || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],diff[1],op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareLEPVH(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-VH.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-VH-VHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ fo = open(fname,'w')
+ diff = histogram.compareTopdrawFiles(fname1,fname2,fo,10)
+ fo.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ diff[1] /= float(diff[0])
+ ws = "|| VH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],diff[1],op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareLEPVBF(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-VBF.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-VBF-TestVBF.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ fo = open(fname,'w')
+ diff = histogram.compareTopdrawFiles(fname1,fname2,fo,16)
+ fo.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ diff[1] /= float(diff[0])
+ ws = "|| VBF || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],diff[1],op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareCharmShapes(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-BB.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-BB-BELLECharm.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ oname="LEP-BB-Shapes.top"
+ fo = open(oname,'w')
+ diff1 = histogram.compareTopdrawFiles(fname1,fname2,fo,6,True)
+ fname="LEP-BB-CLEOCharm.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ diff2 = histogram.compareTopdrawFiles(fname1,fname2,fo,4,True)
+ fo.close()
+ diff = [diff1[0]+diff2[0],diff1[1]+diff2[1]]
+ op1 = plotLocation + "/" + oname
+ op2 = op1.replace(".top",".ps")
+ diff[1] /= float(diff[0])
+ ws = "|| Charm || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],diff[1],op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +oname
+ os.system(tdstring)
+
+
+def compareLEPShapes(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-default.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ oname="LEP-Shapes.top"
+ fo = open(oname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ # read the event shapes
+ fname="LEP-default-LEPEvent.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ for i in range(0,16) :
+ h1 = histogram.readHistogram(f1,True)
+ h2 = histogram.readHistogram(f2,True)
+ h1.write(fo,True,"BLACK",True,False,False,True)
+ h2.write(fo,False,"RED",True,False,False,True)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ # read the identified particle spectra
+ fname="LEP-default-LEPIdent.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ for i in range(0,54) :
+ h1 = histogram.readHistogram(f1,True)
+ h2 = histogram.readHistogram(f2,True)
+ h1.write(fo,True,"BLACK",True,False,False,True)
+ h2.write(fo,False,"RED",True,False,False,True)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ # single particle spectra
+ fname="LEP-default-LEPSingle.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ for i in range(0,7) :
+ h1 = histogram.readHistogram(f1,True)
+ h2 = histogram.readHistogram(f2,True)
+ h1.write(fo,True,"BLACK",True,False,False,True)
+ h2.write(fo,False,"RED",True,False,False,True)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ # LEP jets
+ fname="LEP-default-LEPJet.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ for i in range(0,4) :
+ h1 = histogram.readHistogram(f1,True)
+ h2 = histogram.readHistogram(f2,True)
+ h1.write(fo,True,"BLACK",True,False,True,True)
+ h2.write(fo,False,"RED",True,False,True,True)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ for i in range(4,13) :
+ h1 = histogram.readLine(f1,True)
+ h2 = histogram.readLine(f2,True)
+ h1.write(fo,True,"BLACK",True,False,True,True)
+ h2.write(fo,False,"RED",True,False,True,True)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ fname="LEP-default-LEPFourJet.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ for i in range(0,4) :
+ h1 = histogram.readHistogram(f1,True)
+ h2 = histogram.readHistogram(f2,True)
+ h1.write(fo,True,"BLACK",True,False,False,False)
+ h2.write(fo,False,"RED",True,False,False,False)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ fname="LEP-default-BFrag.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ for i in range(0,2) :
+ h1 = histogram.readHistogram(f1,True)
+ h2 = histogram.readHistogram(f2,True)
+ h1.write(fo,True,"BLACK",True,False,False,False)
+ h2.write(fo,False,"RED",True,False,False,False)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ fo.close()
+ op1 = plotLocation + "/" + oname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| LEP || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +oname
+ os.system(tdstring)
+
+def compareW(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-W.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-W-WTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(0,38) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i>25 and i < 30) or (i>31 and i <36) :
+ h1.write(fo,True,"BLACK",True,False,False,i%2==0)
+ h2.write(fo,False,"RED",True,False,False,i%2==0)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| W || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZ(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-Z.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-Z-ZTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,39) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i>24 and i < 27) or (i>30 and i <33) :
+ h1.write(fo,True,"BLACK",True,False,False,i%2==0)
+ h2.write(fo,False,"RED",True,False,False,i%2==0)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Z || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WJet-WJetTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,25) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==1 or i==5 or i==9 or i==13 or i==16 or i==19 or i==22
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WJet || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZJet-ZJetTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==1 or i==5 or i==8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZJet || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareHiggs(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-Higgs.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-Higgs-HiggsTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,9) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i==5 or i==6) :
+ logPlot = i==6
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Higgs || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareHiggsJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-HiggsJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-HiggsJet-HiggsJetTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,9) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i%2==0
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ print 'in higgs jet',totalDegree,totalChi
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| HiggsJet || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+
+def compareWWVBF(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WWVBF.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WWVBF-WWVBF-Test.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==3 or i==4 or i==7 or i==8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WWVBF || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZZVBF(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZZVBF.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZZVBF-ZZVBF-Test.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==3 or i==4 or i==7 or i==8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZZVBF || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareVBF(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-VBF.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-VBF-VBF-Test.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==3 or i==4 or i==7 or i==8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| VBF || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWW(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WW.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WW-WWTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i<7 or i==10) :
+ logPlot = i==1 or i==4 or i==10
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WW || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZZ(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZZ.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZZ-ZZTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i>=7) :
+ logPlot = i==1 or i==4 or i==7 or i==10
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZZ || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWZ(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WZ.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WZ-WZTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==1 or i==4 or i==7 or i==10
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WZ || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWGamma(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WGamma.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WGamma-WGammaTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,18) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i<9 or i>=13) :
+ logPlot = i==1 or i==5 or i==13 or i==17
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WGamma || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZGamma(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZGamma.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZGamma-ZGammaTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,18) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i>=9) :
+ logPlot = i==9 or i==13 or i==17
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZGamma || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareGammaGamma(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-GammaGamma.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-GammaGamma-GammaGammaTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,14) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ if(i != 3 and i !=10 and i !=11 and i !=12) :
+ logPlot = True
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Gamma Gamma || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareGammaJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-GammaJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-GammaJet-GammaJetTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,11) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i%2==0 and not i==10
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Gamma Jet || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWH(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WH.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WH-WHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,29) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==2 or i==6 or i==10 or i==14 or i==17 or i==20 or i==23 or i==26
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZH(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZH.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZH-ZHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,15) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==2 or i==6 or i==9 or i==12
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+
+def compareQCD(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-QCD.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-QCD-QCDTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,6) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==2 or i==4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| QCD || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareQCDFast(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-QCDFast.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-QCDFast-QCDTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,6) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==2 or i==4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| QCDFast || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def comparebbH(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-bbH.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-bbH-bbHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,24) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==1 or i==4 or i==7 or i==10 or i==11 or i==13 or i==15 or i==17
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| bbH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def comparettH(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ttH.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ttH-ttHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,24) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==1 or i==4 or i==7 or i==10 or i==11 or i==13 or i==15 or i==17
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ttH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWShower(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WShower.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WShower-VTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,22) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| W || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZShower(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZShower.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZShower-VTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,22) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Z || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWPowheg(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WShower-Powheg.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WShower-Powheg-VTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,22) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| W-Powheg || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZPowheg(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZShower-Powheg.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZShower-Powheg-VTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,22) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Z-Powheg || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareHJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-HJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-HJet-HTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,22) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| H || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareHPowheg(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-HJet-Powheg.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-HJet-Powheg-HTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,22) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| H-Powheg|| %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWHJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WHJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WHJet-VHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,38) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZHJet(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZHJet.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZHJet-VHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,38) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZH || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareWHJetPowheg(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-WHJet-Powheg.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-WHJet-Powheg-VHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,38) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| WH-Powheg || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareZHJetPowheg(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-ZHJet-Powheg.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-ZHJet-Powheg-VHTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,38) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i<=8
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ZH-Powheg || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareNeutralCurrent(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="DIS-Neutral.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="DIS-Neutral-NeutralTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,7) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i!=6
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Neutral || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareChargedCurrent(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="DIS-Charged.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="DIS-Charged-ChargedTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,7) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i!=6
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| Charged || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareGammaFF(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="Gamma-FF.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="Gamma-FF-TestFF.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,73) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = False
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| gamma gamma -> fermions || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareGammaWW(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="Gamma-WW.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="Gamma-WW-TestWW.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,9) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = False
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| gamma gamma -> WW || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareGammaP(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="Gamma-P.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="Gamma-P-TestP.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,6) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==2 or i==4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| gamma hadron -> jets || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+def compareTopDecay(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LEP-TopDecay.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LEP-TopDecay-TopDecay.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,2) :
+ h1 = histogram.readHistogram(f1,False)
+ h2 = histogram.readHistogram(f2,False)
+ logPlot = i==2 or i==4
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| t tbar || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+def compareTop(directory1,directory2,wiki,plotLocation) :
+ # first compare the section sections
+ fname="LHC-Top.out"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ output = compareCrossSections(fname1,fname2)
+ # now compare the distributions
+ fname="LHC-Top-TopTest.top"
+ fname1=directory1 + fname
+ fname2=directory2 + fname
+ f1 = open(fname1)
+ f2 = open(fname2)
+ fo = open(fname,'w')
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(1,14) :
+ nplot = 1
+ if(i==1 or i==3 or i==5 or i==7 or i==9) : nplot = 2
+ h1 = histogram.readHistogram(f1,False,nplot)
+ h2 = histogram.readHistogram(f2,False,nplot)
+ if ( i!=2 and i!=4 and i!=10) :
+ logPlot = False
+ if(nplot == 1 ) :
+ h1.write(fo,True,"BLACK",True,False,False,logPlot)
+ h2.write(fo,False,"RED",True,False,False,logPlot)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ else :
+ h1[0].write(fo,True,"BLACK",True,False,False,logPlot)
+ h2[0].write(fo,False,"RED",True,False,False,logPlot)
+ h1[1].write(fo,False,"BLACK DASHES",True,False,False,logPlot)
+ h2[1].write(fo,False,"RED DASHES",True,False,False,logPlot)
+ out = h1[0].writeDifference(h2[0],fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ out = h1[1].writeDifference(h2[1],fo,False,"RED DASHES")
+ totalDegree += out[0]
+ totalChi += out[1]
+ fo.close()
+ f1.close()
+ f2.close()
+ op1 = plotLocation + "/" + fname
+ op2 = op1.replace(".top",".ps")
+ totalChi /= float(totalDegree)
+ ws = "|| ttbar || %s || %s || %s || %s || %s || %s || [%s top] || [%s ps] ||\n" % (output[0],output[1],output[2],output[3],output[4],totalChi,op1,op2)
+ wiki.write(ws)
+ tdstring = td_command + " " +fname
+ os.system(tdstring)
+
+
+
diff --git a/Tests/python/histogram.py b/Tests/python/histogram.py
new file mode 100644
--- /dev/null
+++ b/Tests/python/histogram.py
@@ -0,0 +1,506 @@
+import re
+import os
+
+class Histogram :
+ '''storage of a histogram'''
+ x = []
+ y = []
+ dx = []
+ data_y = []
+ data_dy = []
+ titleTop=""
+ caseTop=""
+ titleBottom=""
+ caseBottom=""
+ titleLeft=""
+ caseLeft=""
+ titleRight=""
+ caseRight=""
+ hasData = False
+ def write(self,file,new,colour,top,bottom,scaleX,scaleY):
+ if(new) :
+ file.write("NEW FRAME\n")
+ file.write("SET ORDER X Y DX DY\n")
+ file.write("SET FONT DUPLEX\n")
+ file.write("SET WINDOW X 2 12 Y 3.5 9.0\n")
+ if(scaleX) :
+ file.write("SET SCALE X LOG\n")
+ else :
+ file.write("SET SCALE Y LIN\n")
+ if(scaleY) :
+ file.write("SET SCALE Y LOG\n")
+ else :
+ file.write("SET SCALE Y LIN\n")
+ if(top) :
+ file.write(self.titleTop)
+ file.write(self.caseTop)
+ file.write(self.titleLeft)
+ file.write(self.caseLeft)
+ file.write(self.titleRight)
+ file.write(self.caseRight)
+ out = 'SET LIMITS X %s \t %s \t \n' % (self.x[0]-self.dx[0],self.x[len(self.x)-1]+self.dx[len(self.x)-1])
+ file.write(out)
+ if bottom :
+ file.write(self.titleBottom)
+ file.write(self.caseBottom)
+ file.write("SET AXIS BOTTOM ON\n")
+ else :
+ file.write("SET AXIS BOTTOM OFF\n")
+ for i in range(0,len(self.x)) :
+ out = '%s \t %s \t %s \n' % (self.x[i],self.y[i],self.dx[i])
+ file.write(out)
+ file.write("HIST " + colour + "\n")
+
+ def writeData(self,file):
+ if( not self.hasData) : return
+ for i in range(0,len(self.x)) :
+ out = '%s \t %s \t %s \t %s \n' % (self.x[i],self.data_y[i],self.dx[i],self.data_dy[i])
+ file.write(out)
+ file.write("PLOT\n")
+
+ def writeDifference(self,other,file,new,colour) :
+ if(new) :
+ file.write("SET WINDOW X 2 12 Y 2.8 3.5\n")
+ file.write("SET SCALE Y LIN\n")
+ file.write(self.titleBottom)
+ file.write(self.caseBottom)
+ out = 'SET LIMITS X %s \t %s \t \n' % (self.x[0]-self.dx[0],self.x[len(self.x)-1]+self.dx[len(self.x)-1])
+ file.write(out)
+ file.write("SET AXIS BOTTOM ON\n")
+ ndegree = 0
+ chi = 0
+ for i in range(0,len(self.x)) :
+ diff = 0.
+ if (self.y[i]!=0. and other.y[i]!=0) :
+ diff = (self.y[i]-other.y[i])/(self.y[i]+other.y[i])
+ ndegree += 1
+ chi += abs(diff)
+ out = '%s \t %s \t %s \n' % (self.x[i],diff,self.dx[i])
+ file.write(out)
+ file.write("JOIN LEVEL=1 " + colour + "\n")
+ return [ndegree,chi]
+
+ def __add__(self, other):
+ newHist = Histogram()
+ newHist.x = self.x
+ newHist.dx = self.dx
+ newHist.titleTop = self.titleTop
+ newHist.caseTop = self.caseTop
+ newHist.titleBottom= self.titleBottom
+ newHist.caseBottom = self.caseBottom
+ newHist.titleLeft = self.titleLeft
+ newHist.caseLeft = self.caseLeft
+ newHist.titleRight = self.titleRight
+ newHist.caseRight = self.caseRight
+ newHist.hasData = self.hasData
+ newHist.data_y = self.data_y
+ newHist.data_dy = self.data_dy
+ newHist.y=[]
+ for j in range(len(self.y)):
+ newHist.y.append(self.y[j]+other.y[j])
+
+ return newHist
+
+ def __subtract__(self, other):
+ newHist = Histogram()
+ newHist.x = self.x
+ newHist.dx = self.dx
+ newHist.titleTop = self.titleTop
+ newHist.caseTop = self.caseTop
+ newHist.titleBottom= self.titleBottom
+ newHist.caseBottom = self.caseBottom
+ newHist.titleLeft = self.titleLeft
+ newHist.caseLeft = self.caseLeft
+ newHist.titleRight = self.titleRight
+ newHist.caseRight = self.caseRight
+ newHist.hasData = self.hasData
+ newHist.data_y = self.data_y
+ newHist.data_dy = self.data_dy
+ newHist.y=[]
+ for j in range(len(self.y)):
+ newHist.y.append(self.y[j]-other.y[j])
+ return newHist
+
+ def __mul__(self, other):
+ newHist = Histogram()
+ newHist.x = self.x
+ newHist.dx = self.dx
+ newHist.titleTop = self.titleTop
+ newHist.caseTop = self.caseTop
+ newHist.titleBottom= self.titleBottom
+ newHist.caseBottom = self.caseBottom
+ newHist.titleLeft = self.titleLeft
+ newHist.caseLeft = self.caseLeft
+ newHist.titleRight = self.titleRight
+ newHist.caseRight = self.caseRight
+ newHist.hasData = self.hasData
+ newHist.data_y = self.data_y
+ newHist.data_dy = self.data_dy
+ newHist.y=[]
+ for j in range(len(self.y)):
+ newHist.y.append(self.y[j]*other)
+ return newHist
+
+ def __div__(self, other):
+ newHist = Histogram()
+ newHist.x = self.x
+ newHist.dx = self.dx
+ newHist.titleTop = self.titleTop
+ newHist.caseTop = self.caseTop
+ newHist.titleBottom= self.titleBottom
+ newHist.caseBottom = self.caseBottom
+ newHist.titleLeft = self.titleLeft
+ newHist.caseLeft = self.caseLeft
+ newHist.titleRight = self.titleRight
+ newHist.caseRight = self.caseRight
+ newHist.hasData = self.hasData
+ newHist.data_y = self.data_y
+ newHist.data_dy = self.data_dy
+ newHist.y=[]
+ for j in range(len(self.y)):
+ newHist.y.append(self.y[j]/other)
+ return newHist
+
+def readHistogram(f1,data,nplot=1) :
+ test = f1.readline()
+ hist=[]
+ ncount=0
+ for i in range(0,nplot) :
+ hist.append(Histogram())
+ hist[i].x = []
+ hist[i].y = []
+ hist[i].dx = []
+ hist[i].data_y = []
+ hist[i].data_dy = []
+ hist[i].titleTop=""
+ hist[i].caseTop=""
+ hist[i].titleBottom=""
+ hist[i].caseBottom=""
+ hist[i].titleLeft=""
+ hist[i].caseLeft=""
+ hist[i].titleRight=""
+ hist[i].caseRight=""
+ hist[i].hasData = data
+ while test :
+ test = test.lstrip()
+ if (test[0] == "N" or test[0:5] == "SET P" or test[0:6] == "SET AX" or
+ test[0:5] == "SET W" or test[0:5] == "SET O" or test[0:5] == "SET F" or test[0:5] == "SET L" or test[0:5] == "SET S" ) :
+ pass
+ elif (test[0:7] == "TITLE B") :
+ hist[0].titleBottom = test
+ test = f1.readline()
+ hist[0].caseBottom = test
+ elif (test[0:7] == "TITLE T") :
+ hist[0].titleTop = test
+ test = f1.readline()
+ hist[0].caseTop = test
+ elif( test[0:7] == "TITLE L") :
+ hist[0].titleLeft = test
+ test = f1.readline()
+ hist[0].caseLeft = test
+ elif (test[0:7] == "TITLE R") :
+ hist[0].titleRight = test
+ test = f1.readline()
+ hist[0].caseRight = test
+ elif (test[0:4] == "HIST") :
+ ncount += 1
+ if(ncount==nplot) :
+ break
+ else :
+ temp = test.split()
+ hist[ncount].x .append(float(temp[0]))
+ hist[ncount].y .append(float(temp[1]))
+ hist[ncount].dx.append(float(temp[2]))
+ test = f1.readline()
+ if(data) :
+ test = f1.readline()
+ while test :
+ test = test.lstrip()
+ if (test[0:4] == "PLOT") :
+ break
+ elif (test[0:7] == "TITLE B") :
+ hist[0].titleBottom = test
+ test = f1.readline()
+ hist[0].caseBottom = test
+ else :
+ temp = test.split()
+ hist[0].data_y .append(float(temp[1]))
+ hist[0].data_dy.append(float(temp[3]))
+ test = f1.readline()
+ test = f1.readline()
+ while test :
+ if (test[0:4] == "JOIN") :
+ break
+ elif (test[0:7] == "TITLE B") :
+ hist[0].titleBottom = test
+ test = f1.readline()
+ hist[0].caseBottom = test
+ test = f1.readline()
+ if(nplot==1) :
+ return hist[0]
+ else :
+ for i in range(1,nplot) :
+ hist[i].data_y = hist[0].data_y
+ hist[i].data_dy = hist[0].data_dy
+ hist[i].titleTop = hist[0].titleTop
+ hist[i].caseTop = hist[0].caseTop
+ hist[i].titleBottom = hist[0].titleBottom
+ hist[i].caseBottom = hist[0].caseBottom
+ hist[i].titleLeft = hist[0].titleLeft
+ hist[i].caseLeft = hist[0].caseLeft
+ hist[i].titleRight = hist[0].titleRight
+ hist[i].caseRight = hist[0].caseRight
+ hist[i].hasData = hist[0].hasData
+ return hist
+
+def compareTopdrawFiles(fname1,fname2,fo,nplot,data=False) :
+ f1 = open(fname1)
+ f2 = open(fname2)
+ totalDegree = 0
+ totalChi = 0.
+ for i in range(0,nplot) :
+ h1 = readHistogram(f1,data)
+ h2 = readHistogram(f2,data)
+ h1.write(fo,True,"BLACK",True,False,False,False)
+ h2.write(fo,False,"RED",True,False,False,False)
+ if(h1.hasData) : h1.writeData(fo)
+ out = h1.writeDifference(h2,fo,True,"RED")
+ totalDegree += out[0]
+ totalChi += out[1]
+ f1.close()
+ f2.close()
+ return [totalDegree,totalChi]
+
+class LinePlot :
+ '''storage of a histogram'''
+ x = []
+ y = []
+ data_y = []
+ data_dy = []
+ titleTop=""
+ caseTop=""
+ titleBottom=""
+ caseBottom=""
+ titleLeft=""
+ caseLeft=""
+ titleRight=""
+ caseRight=""
+ hasData = False
+ def write(self,file,new,colour,top,bottom,scaleX,scaleY):
+ if(new) :
+ file.write("NEW FRAME\n")
+ file.write("SET ORDER X Y DY\n")
+ file.write("SET FONT DUPLEX\n")
+ file.write("SET WINDOW X 2 12 Y 3.5 9.0\n")
+ if(scaleX) :
+ file.write("SET SCALE X LOG\n")
+ else :
+ file.write("SET SCALE X LIN\n")
+ if(scaleY) :
+ file.write("SET SCALE Y LOG\n")
+ else :
+ file.write("SET SCALE Y LIN\n")
+ if(top) :
+ file.write(self.titleTop)
+ file.write(self.caseTop)
+ file.write(self.titleLeft)
+ file.write(self.caseLeft)
+ file.write(self.titleRight)
+ file.write(self.caseRight)
+ out = 'SET LIMITS X %s \t %s \t \n' % (self.x[0],self.x[len(self.x)-1])
+ file.write(out)
+ if bottom :
+ file.write(self.titleBottom)
+ file.write(self.caseBottom)
+ file.write("SET AXIS BOTTOM ON\n")
+ else :
+ file.write("SET AXIS BOTTOM OFF\n")
+ for i in range(0,len(self.x)) :
+ out = '%s \t %s\n' % (self.x[i],self.y[i])
+ file.write(out)
+ file.write("JOIN LEVEL=1 " + colour + "\n")
+
+ def writeData(self,file):
+ if( not self.hasData) : return
+ for i in range(0,len(self.x)) :
+ out = '%s \t %s \t %s \n' % (self.x[i],self.data_y[i],self.data_dy[i])
+ file.write(out)
+ file.write("PLOT\n")
+
+ def writeDifference(self,other,file,new,colour) :
+ if(new) :
+ file.write("SET WINDOW X 2 12 Y 2.6 3.5\n")
+ file.write("SET SCALE Y LIN\n")
+ file.write(self.titleBottom)
+ file.write(self.caseBottom)
+ out = 'SET LIMITS X %s \t %s\n' % (self.x[0],self.x[len(self.x)-1])
+ file.write(out)
+ file.write("SET AXIS BOTTOM ON\n")
+ ndegree = 0
+ chi = 0
+ for i in range(0,len(self.x)) :
+ diff = 0.
+ if (self.y[i]!=0. and other.y[i]!=0) :
+ diff = (self.y[i]-other.y[i])/(self.y[i]+other.y[i])
+ ndegree += 1
+ chi += abs(diff)
+ out = '%s \t %s \n' % (self.x[i],diff)
+ file.write(out)
+ file.write("JOIN LEVEL=1 " + colour + "\n")
+ return [ndegree,chi]
+
+ def __add__(self, other):
+ newLine = LinePlot()
+ newLine.x = self.x
+ newLine.titleTop = self.titleTop
+ newLine.caseTop = self.caseTop
+ newLine.titleBottom= self.titleBottom
+ newLine.caseBottom = self.caseBottom
+ newLine.titleLeft = self.titleLeft
+ newLine.caseLeft = self.caseLeft
+ newLine.titleRight = self.titleRight
+ newLine.caseRight = self.caseRight
+ newLine.hasData = self.hasData
+ newLine.data_y = self.data_y
+ newLine.data_dy = self.data_dy
+ newLine.y=[]
+ for j in range(len(self.y)):
+ newLine.y.append(self.y[j]+other.y[j])
+
+ return newLine
+
+ def __subtract__(self, other):
+ newLine = LinePlot()
+ newLine.x = self.x
+ newLine.titleTop = self.titleTop
+ newLine.caseTop = self.caseTop
+ newLine.titleBottom= self.titleBottom
+ newLine.caseBottom = self.caseBottom
+ newLine.titleLeft = self.titleLeft
+ newLine.caseLeft = self.caseLeft
+ newLine.titleRight = self.titleRight
+ newLine.caseRight = self.caseRight
+ newLine.hasData = self.hasData
+ newLine.data_y = self.data_y
+ newLine.data_dy = self.data_dy
+ newLine.y=[]
+ for j in range(len(self.y)):
+ newLine.y.append(self.y[j]-other.y[j])
+ return newLine
+
+ def __mul__(self, other):
+ newLine = LinePlot()
+ newLine.x = self.x
+ newLine.titleTop = self.titleTop
+ newLine.caseTop = self.caseTop
+ newLine.titleBottom= self.titleBottom
+ newLine.caseBottom = self.caseBottom
+ newLine.titleLeft = self.titleLeft
+ newLine.caseLeft = self.caseLeft
+ newLine.titleRight = self.titleRight
+ newLine.caseRight = self.caseRight
+ newLine.hasData = self.hasData
+ newLine.data_y = self.data_y
+ newLine.data_dy = self.data_dy
+ newLine.y=[]
+ for j in range(len(self.y)):
+ newLine.y.append(self.y[j]*other)
+ return newLine
+
+ def __div__(self, other):
+ newLine = LinePlot()
+ newLine.x = self.x
+ newLine.titleTop = self.titleTop
+ newLine.caseTop = self.caseTop
+ newLine.titleBottom= self.titleBottom
+ newLine.caseBottom = self.caseBottom
+ newLine.titleLeft = self.titleLeft
+ newLine.caseLeft = self.caseLeft
+ newLine.titleRight = self.titleRight
+ newLine.caseRight = self.caseRight
+ newLine.hasData = self.hasData
+ newLine.data_y = self.data_y
+ newLine.data_dy = self.data_dy
+ newLine.y=[]
+ for j in range(len(self.y)):
+ newLine.y.append(self.y[j]/other)
+ return newLine
+
+def readLine(f1,data=False) :
+ test = f1.readline()
+ hist = LinePlot()
+ hist.x = []
+ hist.y = []
+ hist.data_y = []
+ hist.data_dy = []
+ hist.titleTop=""
+ hist.caseTop=""
+ hist.titleBottom=""
+ hist.caseBottom=""
+ hist.titleLeft=""
+ hist.caseLeft=""
+ hist.titleRight=""
+ hist.caseRight=""
+ hist.hasData = data
+ while test :
+ test = test.lstrip()
+ if (test[0] == "N" or test[0:5] == "SET P" or test[0:6] == "SET AX" or
+ test[0:5] == "SET W" or test[0:5] == "SET O" or test[0:5] == "SET F" or test[0:5] == "SET L" or test[0:5] == "SET S" ) :
+ pass
+ elif (test[0:7] == "TITLE B") :
+ hist.titleBottom = test
+ test = f1.readline()
+ hist.caseBottom = test
+ elif (test[0:7] == "TITLE T") :
+ hist.titleTop = test
+ test = f1.readline()
+ hist.caseTop = test
+ elif( test[0:7] == "TITLE L") :
+ hist.titleLeft = test
+ test = f1.readline()
+ hist.caseLeft = test
+ elif (test[0:7] == "TITLE R") :
+ hist.titleRight = test
+ test = f1.readline()
+ hist.caseRight = test
+ elif (test[0:4] == "JOIN") :
+ break
+ else :
+ temp = test.split()
+ hist.x .append(float(temp[0]))
+ hist.y .append(float(temp[1]))
+ test = f1.readline()
+ if(data) :
+ test = f1.readline()
+ while test :
+ test = test.lstrip()
+ if (test[0:4] == "PLOT") :
+ break
+ elif (test[0:7] == "TITLE B") :
+ hist.titleBottom = test
+ test = f1.readline()
+ hist.caseBottom = test
+ else :
+ temp = test.split()
+ hist.data_y .append(float(temp[1]))
+ hist.data_dy.append(float(temp[2]))
+ test = f1.readline()
+ test = f1.readline()
+ while test :
+ if (test[0:4] == "JOIN") :
+ break
+ elif (test[0:7] == "TITLE B") :
+ hist.titleBottom = test
+ test = f1.readline()
+ hist.caseBottom = test
+ test = f1.readline()
+ test = f1.readline()
+ while test :
+ if (test[0:4] == "JOIN") :
+ break
+ elif (test[0:7] == "TITLE B") :
+ hist.titleBottom = test
+ test = f1.readline()
+ hist.caseBottom = test
+ test = f1.readline()
+ return hist
diff --git a/Tests/python/main.py b/Tests/python/main.py
new file mode 100644
--- /dev/null
+++ b/Tests/python/main.py
@@ -0,0 +1,115 @@
+import compare
+# directories for the comparison
+directory1="trunk/"
+directory2="recon/"
+# location for the plots
+plotLocation="http://projects.hepforge.org/herwig/private/images/peter/comparison1"
+# file for the wiki
+wiki = open("wiki.info",'w')
+wiki.write("= Comparision of Heriwg++ results =\n")
+# lepton-lepton processes
+wiki.write("=== Lepton-Lepton ===\n")
+wiki.write("|| Process || Cross Section/nb || Error/nb || Cross Section/nb || Error/nb || Fractional Difference sigma || Average Fractional Difference Distribution || Topdraw || Postscript ||\n")
+# quarks
+compare.compareLEPQuarks(directory1,directory2,wiki,plotLocation)
+# leptons
+compare.compareLEPLeptons(directory1,directory2,wiki,plotLocation)
+# VH
+compare.compareLEPVH(directory1,directory2,wiki,plotLocation)
+# VV
+compare.compareLEPVV(directory1,directory2,wiki,plotLocation)
+# VBF
+compare.compareLEPVBF(directory1,directory2,wiki,plotLocation)
+# top decay
+compare.compareTopDecay(directory1,directory2,wiki,plotLocation)
+# charm event shapes
+compare.compareCharmShapes(directory1,directory2,wiki,plotLocation)
+# LEP event shapes
+compare.compareLEPShapes(directory1,directory2,wiki,plotLocation)
+# hadron-hadron processes at the LHC
+wiki.write("=== LHC ===\n")
+wiki.write("|| Process || Cross Section/nb || Error/nb || Cross Section/nb || Error/nb || Fractional Difference sigma || Average Fractional Difference Distribution || Topdraw || Postscript ||\n")
+# compare W production
+compare.compareW(directory1,directory2,wiki,plotLocation)
+# compare Z production
+compare.compareZ(directory1,directory2,wiki,plotLocation)
+# compare W+jet production
+compare.compareWJet(directory1,directory2,wiki,plotLocation)
+# compare Z+jet production
+compare.compareZJet(directory1,directory2,wiki,plotLocation)
+# compare Higgs production
+compare.compareHiggs(directory1,directory2,wiki,plotLocation)
+# compare Higgs +jet production
+compare.compareHiggsJet(directory1,directory2,wiki,plotLocation)
+# compare VBF WW
+compare.compareWWVBF(directory1,directory2,wiki,plotLocation)
+# compare VBF ZZ
+compare.compareZZVBF(directory1,directory2,wiki,plotLocation)
+# compare VBF all
+compare.compareVBF(directory1,directory2,wiki,plotLocation)
+# compare WW production
+compare.compareWW(directory1,directory2,wiki,plotLocation)
+# compare WZ production
+compare.compareWZ(directory1,directory2,wiki,plotLocation)
+# compare ZZ production
+compare.compareZZ(directory1,directory2,wiki,plotLocation)
+# compare WGamma production
+compare.compareWGamma(directory1,directory2,wiki,plotLocation)
+# compare ZGamma production
+compare.compareZGamma(directory1,directory2,wiki,plotLocation)
+# compare photon pair production
+compare.compareGammaGamma(directory1,directory2,wiki,plotLocation)
+# compare photon + jet production
+compare.compareGammaJet(directory1,directory2,wiki,plotLocation)
+# compare WH production
+compare.compareWH(directory1,directory2,wiki,plotLocation)
+# compare ZH production
+compare.compareZH(directory1,directory2,wiki,plotLocation)
+# compare QCD production
+compare.compareQCD(directory1,directory2,wiki,plotLocation)
+# compare QCDFast production
+compare.compareQCDFast(directory1,directory2,wiki,plotLocation)
+# compare top pair production
+compare.compareTop(directory1,directory2,wiki,plotLocation)
+# compare bottom pair +Higgs production
+compare.comparebbH(directory1,directory2,wiki,plotLocation)
+# compare top pair +Higgs production
+compare.comparettH(directory1,directory2,wiki,plotLocation)
+# compare shower in W
+compare.compareWShower(directory1,directory2,wiki,plotLocation)
+# compare shower in Z
+compare.compareZShower(directory1,directory2,wiki,plotLocation)
+# compare shower in W Powheg
+compare.compareWPowheg(directory1,directory2,wiki,plotLocation)
+# compare shower in Z Powheg
+compare.compareZPowheg(directory1,directory2,wiki,plotLocation)
+# compare shower in H
+compare.compareHJet(directory1,directory2,wiki,plotLocation)
+# compare shower in H Powheg
+compare.compareHPowheg(directory1,directory2,wiki,plotLocation)
+# compare shower in WH
+compare.compareWHJet(directory1,directory2,wiki,plotLocation)
+# compare shower in ZH
+compare.compareZHJet(directory1,directory2,wiki,plotLocation)
+# compare shower in WH
+compare.compareWHJetPowheg(directory1,directory2,wiki,plotLocation)
+# compare shower in ZH
+compare.compareZHJetPowheg(directory1,directory2,wiki,plotLocation)
+# DIS processes at HERA
+wiki.write("=== DIS ===\n")
+wiki.write("|| Process || Cross Section/nb || Error/nb || Cross Section/nb || Error/nb || Fractional Difference sigma || Average Fractional Difference Distribution || Topdraw || Postscript ||\n")
+# neutral current
+compare.compareNeutralCurrent(directory1,directory2,wiki,plotLocation)
+# charged current
+compare.compareChargedCurrent(directory1,directory2,wiki,plotLocation)
+# photon initiated
+wiki.write("=== Photon Initiated ===\n")
+wiki.write("|| Process || Cross Section/nb || Error/nb || Cross Section/nb || Error/nb || Fractional Difference sigma || Average Fractional Difference Distribution || Topdraw || Postscript ||\n")
+# fermion production
+compare.compareGammaFF(directory1,directory2,wiki,plotLocation)
+# W production
+compare.compareGammaWW(directory1,directory2,wiki,plotLocation)
+# gamma P
+compare.compareGammaP(directory1,directory2,wiki,plotLocation)
+# close the wiki file
+wiki.close()
diff --git a/Utilities/GaussianIntegrator.h b/Utilities/GaussianIntegrator.h
--- a/Utilities/GaussianIntegrator.h
+++ b/Utilities/GaussianIntegrator.h
@@ -1,119 +1,128 @@
// -*- C++ -*-
//
// GaussianIntegrator.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_GaussianIntegrator_H
#define HERWIG_GaussianIntegrator_H
//
// This is the declaration of the GaussianIntegrator class.
//
#include "ThePEG/Pointer/ReferenceCounted.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include <vector>
namespace Herwig {
using namespace ThePEG;
/** \ingroup Utilities
* \author Peter Richardson
* This class is designed to perform the integral of a function
* using Gaussian quadrature.The method is adaptive based on using 6th,12th,
* 24th,48th, or 96th order Gaussian quadrature combined with
* subdivision of the integral if this is insufficient.
*
* The class is templated on a simple class which should provide a
* T::operator () (double) const which provides the integrand for the function.
*/
class GaussianIntegrator : public Pointer::ReferenceCounted {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default Constructor
*/
- inline GaussianIntegrator();
-
+ GaussianIntegrator()
+ : _abserr(1.E-35), _relerr(5.E-5), _binwidth(1.E-5),
+ _maxint(100), _maxeval(100000) {
+ // setup the weights and abscissae
+ Init();
+ }
+
/**
* Specify all the parameters.
* @param abserr Absolute error.
* @param relerr Relative error.
* @param binwidth Width of the bin as a fraction of the integration region.
* @param maxint Maximum number of intervals
* @param maxeval Maximum number of function evaluations
*/
- inline GaussianIntegrator(double abserr, double relerr, double binwidth,
- int maxint, int maxeval);
+ GaussianIntegrator(double abserr, double relerr, double binwidth,
+ int maxint, int maxeval)
+ : _abserr(abserr), _relerr(relerr), _binwidth(binwidth), _maxint(maxint),
+ _maxeval(maxeval) {
+ // setup the weights and abscissae
+ Init();
+ }
/**
* The value of the integral
* @param lower The lower limit of integration.
* @param upper The upper limit of integration.
*/
template <class T>
inline typename BinaryOpTraits<typename T::ValType,
typename T::ArgType>::MulT
value(const T &,
const typename T::ArgType lower,
const typename T::ArgType upper) const;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
GaussianIntegrator & operator=(const GaussianIntegrator &);
/**
* Initialise the weights and abscissae.
*/
void Init();
private:
/**
* The weights for the gaussian quadrature.
*/
std::vector< std::vector<double> > _weights;
/**
* The abscissae.
*/
std::vector< std::vector <double> > _abscissae;
/**
* The parameters controlling the error.
*/
double _abserr,_relerr;
/**
* The minimum width of a bin as a fraction of the integration region.
*/
double _binwidth;
/**
* Maximum number of bins.
*/
int _maxint;
/**
* Maximum number of function evaluations.
*/
int _maxeval;
};
}
-#include "GaussianIntegrator.icc"
#include "GaussianIntegrator.tcc"
#endif /* HERWIG_GaussianIntegrator_H */
diff --git a/Utilities/GaussianIntegrator.icc b/Utilities/GaussianIntegrator.icc
deleted file mode 100644
--- a/Utilities/GaussianIntegrator.icc
+++ /dev/null
@@ -1,43 +0,0 @@
-// -*- C++ -*-
-//
-// GaussianIntegrator.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the GaussianIntegrator class.
-//
-
-namespace Herwig {
-
-// default constructor
-inline GaussianIntegrator::GaussianIntegrator() {
- // set the parameters controlling nthe accuracy etc to their defaults
- // the parameters controlling the error
- _abserr = 1.E-35;
- _relerr = 5.E-5;
- // the minimum width of a bin as a fraction of the integration region
- _binwidth = 1.E-5;
- // maximum number of bins
- _maxint = 100;
- // maximum number of function evaluations
- _maxeval = 100000;
- // setup the weights and abscissae
- Init();
-}
-
-// constrcutor which specifies all the parameters
-inline GaussianIntegrator::GaussianIntegrator(double abserr, double relerr,
- double binwidth,
- int maxint, int maxeval)
- : _abserr(abserr), _relerr(relerr), _binwidth(binwidth), _maxint(maxint),
- _maxeval(maxeval)
-{
- // setup the weights and abscissae
- Init();
-}
-
-}
diff --git a/Utilities/Histogram.cc b/Utilities/Histogram.cc
--- a/Utilities/Histogram.cc
+++ b/Utilities/Histogram.cc
@@ -1,362 +1,371 @@
// -*- C++ -*-
//
// Histogram.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the Histogram class.
//
#include "Histogram.h"
#include "HerwigStrategy.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/Handlers/EventHandler.h"
using namespace Herwig;
+
+IBPtr Histogram::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr Histogram::fullclone() const {
+ return new_ptr(*this);
+}
+
NoPIOClassDescription<Histogram> Histogram::initHistogram;
// Definition of the static class description member.
void Histogram::Init() {
static ClassDocumentation<Histogram> documentation
("The Histogram class implements a simple histogram include data"
" points for comparision with experimental results.");
}
void Histogram::topdrawOutput(ostream & out,
unsigned int flags,
string colour,
string title, string titlecase,
string left, string leftcase,
string bottom, string bottomcase
) const {
using namespace HistogramOptions;
bool frame = ( flags & Frame ) == Frame;
bool errorbars = ( flags & Errorbars ) == Errorbars;
bool xlog = ( flags & Xlog ) == Xlog;
bool ylog = ( flags & Ylog ) == Ylog;
bool smooth = ( flags & Smooth ) == Smooth;
bool rawcount = ( flags & Rawcount ) == Rawcount;
// output the title info if needed
if(frame) {
out << "NEW FRAME\n";
if(_havedata) out << "SET WINDOW X 1.6 8 Y 3.5 9\n";
else out << "SET WINDOW X 1.6 8 Y 1.6 9\n";
out << "SET FONT DUPLEX\n";
out << "TITLE TOP \"" << title << "\"\n";
out << "CASE \"" << titlecase << "\"\n";
out << "TITLE LEFT \"" << left << "\"\n";
out << "CASE \"" << leftcase << "\"\n";
out << (errorbars ? "SET ORDER X Y DX DY \n" : "SET ORDER X Y DX\n");
if (HerwigStrategy::version != "") {
out << "TITLE RIGHT \"" << HerwigStrategy::version << "\"\n";
out << "CASE \"\"\n";
}
if(_havedata) out << "SET AXIS BOTTOM OFF\n";
else {
out << "TITLE BOTTOM \"" << bottom << "\"\n";
out << "CASE \"" << bottomcase << "\"\n";
}
}
// scales
if(xlog && frame) out << "SET SCALE X LOG " << endl;
if(ylog && frame) out << "SET SCALE Y LOG " << endl;
// set the x limits
const unsigned int lastDataBinIndx = _bins.size()-2;
if (frame) {
out << "SET LIMITS X " << _bins[1].limit << " "
<< _bins[lastDataBinIndx+1].limit << endl;
}
// work out the y points
vector<double> yout;
double ymax=-9.8765e34,ymin=9.8765e34;
double numPoints = _total;
if (numPoints == 0) numPoints += 1.;
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
double factor = rawcount ? _prefactor : 0.5 * _prefactor / (numPoints * delta);
double value = factor*_bins[ix].contents;
yout.push_back(value);
ymax=max(ymax, max(value, _bins[ix].data+_bins[ix].dataerror) );
if(yout.back()>0.) ymin=min(ymin,value);
if(_bins[ix].data>0) ymin=min(ymin,_bins[ix].data);
}
if (ymin > 1e34) ymin = 1e-34;
if (ymax < 1e-33) ymax = 1e-33;
if (ymax < 10*ymin) ymin = 0.1*ymax;
// make the y range slightly larger
double fac=pow(ymax/ymin,0.1);
ymax *= fac;
ymin /= fac;
if (ylog && frame) {
out << "SET LIMITS Y " << ymin << " " << ymax << endl;
}
// the histogram from the event generator
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
double factor = rawcount ? _prefactor : 0.5 * _prefactor / (numPoints * delta);
out << _bins[ix].limit+delta << '\t' << yout[ix-1] << '\t' << delta;
if (errorbars) {
out << '\t' << factor*sqrt(_bins[ix].contentsSq);
}
out << '\n';
}
// N.B. in td smoothing only works for histograms with uniform binning.
if(!smooth) {
out << "HIST " << colour << endl;
} else {
out << "SMOOTH Y LEVEL 2 " << endl;
out << "JOIN " << colour << endl;
}
if (_havedata) {
// the real experimental data
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
out << _bins[ix].limit+delta << '\t' << _bins[ix].data << '\t' << delta;
if (errorbars) out << '\t' << _bins[ix].dataerror;
out << '\n';
}
out << "PLOT " << endl;
out << "SET WINDOW X 1.6 8 Y 2.5 3.5\n";
out << "SET LIMITS X " << _bins[1].limit << " "
<< _bins[lastDataBinIndx+1].limit << "\n";
double ymax=0.;
out << _bins[1].limit << "\t" << _bins[1].dataerror/_bins[1].data << "\n";
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
if(_bins[ix].data!=0.) {
if(_bins[ix].dataerror/_bins[ix].data>ymax)
ymax=_bins[ix].dataerror/_bins[ix].data;
out << _bins[ix].limit+delta << '\t'
<< _bins[ix].dataerror/_bins[ix].data << '\n';
}
else {
out << _bins[ix].limit+delta << '\t'
<< 1. << '\n';
}
}
if(_bins[lastDataBinIndx].data!=0.) {
out << _bins[lastDataBinIndx+1].limit << "\t"
<< _bins[lastDataBinIndx].dataerror/_bins[lastDataBinIndx].data << "\n";
out << _bins[lastDataBinIndx+1].limit << "\t"
<<-_bins[lastDataBinIndx].dataerror/_bins[lastDataBinIndx].data << "\n";
}
else {
out << _bins[lastDataBinIndx+1].limit << "\t" << 1. << "\n";
out << _bins[lastDataBinIndx+1].limit << "\t" << -1. << "\n";
}
for(unsigned int ix=lastDataBinIndx;ix>=1;--ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
if(_bins[ix].data!=0.) {
out << _bins[ix].limit+delta << '\t'
<< -_bins[ix].dataerror/_bins[ix].data << '\n';
}
else {
out << _bins[ix].limit+delta << '\t'
<< -1. << '\n';
}
}
if(_bins[1].data!=0.) {
out << _bins[1].limit << "\t" << -_bins[1].dataerror/_bins[1].data << "\n";
}
else {
out << _bins[1].limit << "\t" << -1. << "\n";
}
out << "set scale y lin\n";
out << "set limits y " << -ymax << " " << ymax << "\n";
out << "set fill full\n";
out << "join yellow fill yellow\n";
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
if(_bins[ix].data!=0.) {
out << _bins[ix].limit+delta << "\t"
<< (yout[ix-1]-_bins[ix].data)/_bins[ix].data << "\n";
}
else if(_bins[ix].dataerror!=0.) {
out << _bins[ix].limit+delta << "\t"
<< (yout[ix-1]-_bins[ix].data)/_bins[ix].dataerror << "\n";
}
else {
out << _bins[ix].limit+delta << "\t" << 0. << "\n";
}
}
out << "join\n";
out << "SET WINDOW X 1.6 8 Y 1.6 2.5\n";
out << "SET LIMITS X " << _bins[1].limit << " "
<< _bins[lastDataBinIndx+1].limit << "\n";
out << "SET AXIS BOTTOM ON\n";
out << "TITLE BOTTOM \"" << bottom << "\"\n";
out << "CASE \"" << bottomcase << "\"\n";
ymax =0.;
double ymin=0.;
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
double error = sqrt(sqr(0.5*sqrt(_bins[ix].contentsSq)/(delta*numPoints))+
sqr(_bins[ix].dataerror));
double point=(yout[ix-1]-_bins[ix].data)/error;
if(point<ymin) ymin=point;
if(point>ymax) ymax=point;
out << _bins[ix].limit+delta << '\t'
<< point << '\n';
}
out << "set limits y " << ymin << " " << ymax << "\n";
out << "JOIN" << endl;
}
}
double Histogram::dataNorm() const {
double norm(0.0);
if (_havedata) {
const unsigned int lastDataBinIndx = _bins.size()-2;
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = _bins[ix+1].limit-_bins[ix].limit;
double value = _bins[ix].data;
norm += delta*value;
}
} else {
norm = -1.0;
}
return norm;
}
unsigned int Histogram::visibleEntries() const {
unsigned int numPoints(0);
const unsigned int lastDataBinIndx = _bins.size()-2;
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
numPoints += static_cast<unsigned int>( _bins[ix].contents );
}
return numPoints;
}
void Histogram::simpleOutput(ostream & out, bool errorbars,
bool normdata) {
// simple ascii output (eg for gnuplot)
// work out the y points
vector<double> yout;
unsigned int numPoints = visibleEntries();
if (numPoints == 0) ++numPoints;
double datanorm(1.0);
double chisq(0.0), minfrac(0.05);
unsigned int ndof(0);
if (_havedata) {
if (normdata) datanorm = dataNorm();
normaliseToData();
chiSquared(chisq, ndof, minfrac);
}
prefactor(1.0);
const unsigned int lastDataBinIndx = _bins.size()-2;
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
double value = 0.5*_prefactor*_bins[ix].contents / (delta*numPoints);
yout.push_back(value);
}
out << "# " << numPoints << " entries, mean +- sigma = "
<< _globalStats.mean() << " +- "
<< _globalStats.stdDev() << "\n";
if (_havedata) {
out << "# chi^2/dof = " << chisq << "/" << ndof << " = "
<< chisq/double(ndof) << " (min err = " << minfrac << ")\n";
if (datanorm) {
out << "# data normalised by factor " << datanorm << "\n";
}
}
out << "# xlo xhi ynorm "
<< (errorbars ? "ynorm_err " : "")
<< (_havedata ? "data " : "")
<< (_havedata && errorbars ? "dataerr " : "")
<< "y_entr\n";
// the histogram from the event generator
for(unsigned int ix=1; ix<=lastDataBinIndx; ++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
out << _bins[ix].limit << " "
<< _bins[ix+1].limit << " "
<< yout[ix-1];
if (errorbars) {
out << " " << 0.5*sqrt(_bins[ix].contentsSq)/(delta*numPoints);
}
if (_havedata) {
out << " " << _bins[ix].data/datanorm;
if (errorbars)
out << " " << _bins[ix].dataerror/datanorm;
}
out << " " << _bins[ix].contents << '\n';
}
}
vector<double> Histogram::dumpBins() const {
vector<double> bincontents(_bins.size());
for (size_t i=0; i < _bins.size(); ++i)
bincontents[i] = _bins[i].contents;
return bincontents;
}
Histogram Histogram::ratioWith(const Histogram & h2) const {
const size_t numBins = _bins.size();
assert( numBins > 2 && numBins == h2._bins.size());
Histogram ratio(*this);
for (size_t i=0; i < numBins; ++i) {
assert(_bins[i].limit == h2._bins[i].limit);
if (h2._bins[i].contents > 0.0)
ratio._bins[i].contents /= h2._bins[i].contents;
else
ratio._bins[i].contents = 0.0;
}
return ratio;
}
void Histogram::normaliseToData() {
double numer(0.),denom(0.);
double numPoints = _total;
for(unsigned int ix=1;ix<_bins.size()-1;++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
double value = 0.5*_bins[ix].contents / (delta*numPoints);
if(_bins[ix].dataerror>0.) {
double var = sqr(_bins[ix].dataerror);
numer += _bins[ix].data * value/var;
denom += sqr(value)/var;
}
}
_prefactor = numer/denom;
}
void Histogram::chiSquared(double & chisq,
unsigned int & ndegrees, double minfrac) const {
chisq =0.;
ndegrees=0;
double numPoints = _total;
for(unsigned int ix=1;ix<_bins.size()-1;++ix) {
double delta = 0.5*(_bins[ix+1].limit-_bins[ix].limit);
double value = 0.5*_prefactor*_bins[ix].contents / (delta*numPoints);
double error = _bins[ix].dataerror;
if(error>0.) {
if(abs(error/_bins[ix].data) < minfrac) error = minfrac*_bins[ix].data;
double var=sqr(error)
+ _bins[ix].contentsSq * sqr(0.5*_prefactor / (delta*numPoints));
chisq += sqr(_bins[ix].data - value) / var;
++ndegrees;
}
}
}
void Histogram::normaliseToCrossSection() {
double numPoints = _total;
if (numPoints == 0) numPoints += 1.;
_prefactor=CurrentGenerator::current().eventHandler()->histogramScale()*
numPoints/nanobarn;
}
diff --git a/Utilities/Histogram.h b/Utilities/Histogram.h
--- a/Utilities/Histogram.h
+++ b/Utilities/Histogram.h
@@ -1,350 +1,358 @@
// -*- C++ -*-
//
// Histogram.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_Histogram_H
#define HERWIG_Histogram_H
//
// This is the declaration of the Histogram class.
//
#include "Histogram.fh"
#include "ThePEG/Interface/Interfaced.h"
#include "Statistic.h"
#include <string>
namespace Herwig {
using namespace ThePEG;
/**
* Options for histogram output.
* They can be combined using the '|' operator, e.g. 'Frame | Ylog'
*/
namespace HistogramOptions {
const unsigned int None = 0; /**< No options */
const unsigned int Frame = 1; /**< Plot on new frame */
const unsigned int Errorbars = 1 << 1; /**< Plot error bars */
const unsigned int Xlog = 1 << 2; /**< log scale for x-axis */
const unsigned int Ylog = 1 << 3; /**< log scale for y-axis */
const unsigned int Smooth = 1 << 4; /**< smooth the line */
const unsigned int Rawcount = 1 << 5; /**< don't normalize to unit area */
}
/**
* The Histogram class is a simple histogram for the Analysis handlers.
*
* @see \ref HistogramInterfaces "The interfaces"
* defined for Histogram.
*/
class Histogram: public Interfaced {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
* @param lower The lower limit of the histogram
* @param upper The upper limit of the histogram
* @param nbin Number of bins
*/
- inline Histogram(double lower=0., double upper=0., unsigned int nbin=0);
+ Histogram(double lower=0., double upper=0., unsigned int nbin=0)
+ : _globalStats(), _havedata(false), _bins(nbin+2),_prefactor(1.),_total(0.) {
+ if (upper<lower) swap(upper,lower);
+ _bins[0].limit=-1.e100;
+ double limit(lower);
+ double width((upper-lower)/nbin);
+ for(unsigned int ix=1; ix <= nbin; ++ix) {
+ _bins[ix].limit=limit;
+ limit += width;
+ }
+ _bins.back().limit=limit;
+ }
/**
* Constructor for variable width bins
* @param limits The lower limits for the bins followed by the upper limit of the last bin
*/
- inline Histogram(vector<double> limits);
+ Histogram(vector<double> limits)
+ : _globalStats(), _havedata(false), _bins(limits.size()+1), _prefactor(1.),_total(0.) {
+ _bins[0].limit=-1.e100;
+ for (size_t i=1; i<=limits.size(); ++i)
+ _bins[i].limit=limits[i-1];
+ }
/**
* Constructor with data included
* @param limits The lower limits for the bins followed by the upper limit of the last bin
* @param data The data
* @param dataerror The errors on the data
*/
- inline Histogram(vector<double> limits, vector<double> data, vector<double> dataerror);
+ Histogram(vector<double> limits, vector<double> data, vector<double> dataerror)
+ : _globalStats(), _havedata(true), _bins(limits.size()+1), _prefactor(1.),_total(0.) {
+ _bins[0].limit=-1.e100;
+ for (size_t i=1; i<=limits.size(); ++i)
+ _bins[i].limit=limits[i-1];
+
+ // no data goes into _bins[0] or _bins.back()!
+ for (size_t i=1; i<=min(limits.size()-1,data.size()); ++i)
+ _bins[i].data=data[i-1];
+
+ for (size_t i=1; i<=min(limits.size()-1,dataerror.size()); ++i)
+ _bins[i].dataerror=dataerror[i-1];
+ }
+
//@}
public:
/**
* Operator to add a point to the histogrma with unit weight
*/
- inline void operator+=(double);
+ void operator += (double input) {
+ addWeighted(input,1.0);
+ }
/**
* Function to add a weighted point to the histogram
*/
- inline void addWeighted(double data, double weight);
+ void addWeighted(double input, double weight) {
+ if(isnan(input)) return;
+ unsigned int ibin;
+ for(ibin=1; ibin<_bins.size(); ++ibin) {
+ if(input<_bins[ibin].limit)
+ break;
+ }
+ _bins[ibin-1].contents += weight;
+ _bins[ibin-1].contentsSq += sqr(weight);
+ _globalStats += weight * input;
+ _total += weight;
+ }
/**
* Number of bins (not counting the overflow)
*/
- inline unsigned int numberOfBins() const;
+ unsigned int numberOfBins() const {
+ return _bins.size()-2;
+ }
+
/**
* Get the prefactor
*/
- inline double prefactor() const;
+ double prefactor() const {
+ return _prefactor;
+ }
/**
* Set the prefactor
*/
- inline void prefactor(double );
+ void prefactor(double in ) {
+ _prefactor=in;
+ }
/**
* Access to the statistics on the total entry of the histogram
*/
- inline const Statistic & globalStatistics() const;
+ const Statistic & globalStatistics() const {
+ return _globalStats;
+ }
/**
* Normalise the distributions to the data
*/
void normaliseToData();
/**
* Normalise the distributions to the total cross section
*/
void normaliseToCrossSection();
/**
* Return the chi squared
* @param chisq The chi squared
* @param ndegrees The number of points
* @param minfrac The minimum fractional error on the data point
*/
void chiSquared(double & chisq,
unsigned int & ndegrees, double minfrac=0.) const;
/**
* Output as a topdrawer file. The histogram is normalised to unit area
* @param out The output stream
* @param flags A bitmask of flags from HistogramOptions, e.g. Frame|Ylog
* @param colour The colour for the line
* @param title The title for the top of the plot
* @param titlecase topdraw format for the title
* @param left Left axis lable
* @param leftcase topdraw format for left axis label
* @param bottom Bottom axis lable
* @param bottomcase Bottom axis lable ofr topdraw
* N.B. in td smoothing only works for histograms with uniform binning.
*/
void topdrawOutput(ostream & out,
unsigned int flags = 0,
string colour = string("BLACK"),
string title = string(),
string titlecase = string(),
string left = string(),
string leftcase = string(),
string bottom = string(),
string bottomcase = string()
) const;
/**
* get the number of visible entries (all entries without those in the
* under- and overflow bins) in the histogram. This assumes integer
* entries, ie it gives wrong results for weighted histograms.
*/
unsigned int visibleEntries() const;
/**
* Compute the normalisation of the data.
*/
double dataNorm() const;
/**
* Output into a simple ascii file, easily readable by gnuplot.
*/
void simpleOutput(ostream & out, bool errorbars, bool normdata=false);
/**
* Dump bin data into a vector
*/
vector<double> dumpBins() const;
/**
* Returns a new histogram containing bin-by-bin ratios of two histograms
*/
Histogram ratioWith(const Histogram & h2) 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;
+ virtual IBPtr clone() const;
/** 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;
+ virtual IBPtr fullclone() const;
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static NoPIOClassDescription<Histogram> initHistogram;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Histogram & operator=(const Histogram &);
private:
/**
* Global statistics of all data that went into the histogram.
*/
Statistic _globalStats;
/**
* Set to true if there is experimental data available
*/
bool _havedata;
/**
* One bin of the histogram. limit is the _lower_ bound of the bin.
*/
struct Bin {
/**
* Default constructor
*/
Bin() : contents(0.0), contentsSq(0.0),
limit(0.0), data(0.0), dataerror(0.0) {}
/**
* Contents of the bin
*/
double contents;
/**
* Contents squared for the error
*/
double contentsSq;
/**
* The limit for the bin
*/
double limit;
/**
* The experimental value for the bin
*/
double data;
/**
* The error on the experimental value for the bin
*/
double dataerror;
};
/**
* The histogram bins. _bins[0] is the underflow, _bins.back() the overflow
*/
vector<Bin> _bins;
/**
* Prefactors to multiply the output by
*/
double _prefactor;
/**
* Total entry
*/
double _total;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of Histogram. */
template <>
struct BaseClassTrait<Herwig::Histogram,1> {
/** Typedef of the first base class of Histogram. */
typedef Herwig::Statistic NthBase;
};
/** This template specialization informs ThePEG about the name of
* the Histogram class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::Histogram>
: public ClassTraitsBase<Herwig::Histogram> {
/** Return a platform-independent class name */
static string className() { return "Herwig::Histogram"; }
};
/** @endcond */
}
-#include "Histogram.icc"
-#ifndef ThePEG_TEMPLATES_IN_CC_FILE
-// #include "Histogram.tcc"
-#endif
-
-
-// void SampleHistogram::printMoments(char* name, double Nmax, double dN,
-// double x0, double x1) {
-// ofstream out(name);
-// if (!out) {
-// cerr << "SampleHistoGram::printMoments: ERROR! Can't open file" << endl;
-// }
-
-// time_t now_t;
-// now_t = time(0);
-// out << "# created " << ctime(&now_t)
-// << "# by SampleHistogram::printMoments(..., "
-// << Nmax << ", " << dN << ")" << endl
-// << "# " << this->samples() << " entries, mean +/- sigma = "
-// << this->mean() << " +/- " << this->stdDev() << endl;
-
-// double x0N, x1N, delta, hi;
-// for (double N=dN; N < Nmax; N += dN) {
-// double fN = 0.0;
-// for(int i = 0; i < howManyBuckets-1; i++) {
-// x0N = pow(bucketLimit[i], N);
-// x1N = pow(bucketLimit[i+1], N);
-// delta = (bucketLimit[i+1] - bucketLimit[i]);
-// if (delta > 0 && this->samples() > 0
-// && bucketLimit[i] >= x0 && bucketLimit[i] <= x1
-// && bucketLimit[i+1] >= x0 && bucketLimit[i+1] <= x1) {
-// hi = double(bucketCount[i+1]/(delta*(this->samples())));
-// fN += hi*(x1N-x0N)/N;
-// }
-// }
-// out << N
-// << " "
-// << fN << endl;
-// }
-// out.close();
-// }
-
-
#endif /* HERWIG_Histogram_H */
diff --git a/Utilities/Histogram.icc b/Utilities/Histogram.icc
deleted file mode 100644
--- a/Utilities/Histogram.icc
+++ /dev/null
@@ -1,98 +0,0 @@
-// -*- C++ -*-
-//
-// Histogram.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the Histogram class.
-//
-
-namespace Herwig {
-
-inline Histogram::Histogram(double lower, double upper, unsigned int nbin)
- : _globalStats(), _havedata(false), _bins(nbin+2),_prefactor(1.),_total(0.)
-{
- if (upper<lower)
- swap(upper,lower);
-
- _bins[0].limit=-1.e100;
- double limit(lower);
- double width((upper-lower)/nbin);
- for(unsigned int ix=1; ix <= nbin; ++ix)
- {
- _bins[ix].limit=limit;
- limit += width;
- }
- _bins.back().limit=limit;
-}
-
-inline Histogram::Histogram(vector<double> limits)
- : _globalStats(), _havedata(false), _bins(limits.size()+1), _prefactor(1.),_total(0.)
-{
- _bins[0].limit=-1.e100;
- for (size_t i=1; i<=limits.size(); ++i)
- _bins[i].limit=limits[i-1];
-}
-
-inline Histogram::Histogram(vector<double> limits, vector<double> data,
- vector<double> dataerror)
- : _globalStats(), _havedata(true), _bins(limits.size()+1), _prefactor(1.),_total(0.)
-{
- _bins[0].limit=-1.e100;
- for (size_t i=1; i<=limits.size(); ++i)
- _bins[i].limit=limits[i-1];
-
- // no data goes into _bins[0] or _bins.back()!
- for (size_t i=1; i<=min(limits.size()-1,data.size()); ++i)
- _bins[i].data=data[i-1];
-
- for (size_t i=1; i<=min(limits.size()-1,dataerror.size()); ++i)
- _bins[i].dataerror=dataerror[i-1];
-}
-
-inline IBPtr Histogram::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr Histogram::fullclone() const {
- return new_ptr(*this);
-}
-
-inline void Histogram::operator+=(double input) {
- addWeighted(input,1.0);
-}
-
-inline void Histogram::addWeighted(double input, double weight) {
- if(isnan(input)) return;
- unsigned int ibin;
- for(ibin=1; ibin<_bins.size(); ++ibin) {
- if(input<_bins[ibin].limit)
- break;
- }
- _bins[ibin-1].contents += weight;
- _bins[ibin-1].contentsSq += sqr(weight);
- _globalStats += weight * input;
- _total += weight;
-}
-
-inline unsigned int Histogram::numberOfBins() const {
- return _bins.size()-2;
-}
-
-inline double Histogram::prefactor() const {
- return _prefactor;
-}
-
-inline void Histogram::prefactor(double in) {
- _prefactor=in;
-}
-
-inline const Statistic & Histogram::globalStatistics() const {
- return _globalStats;
-}
-}
-
diff --git a/Utilities/Kinematics.icc b/Utilities/Kinematics.icc
deleted file mode 100644
diff --git a/Utilities/Makefile.am b/Utilities/Makefile.am
--- a/Utilities/Makefile.am
+++ b/Utilities/Makefile.am
@@ -1,17 +1,17 @@
noinst_LTLIBRARIES = libHwUtils.la
libHwUtils_la_SOURCES = \
EnumParticles.h \
Interpolator.tcc Interpolator.h \
-Kinematics.cc Kinematics.h Kinematics.icc \
-Smearing.cc Smearing.h Smearing.icc \
-Maths.h Maths.icc Maths.cc \
-StandardSelectors.cc StandardSelectors.h StandardSelectors.icc \
-Histogram.cc Histogram.fh Histogram.h Histogram.icc \
+Kinematics.cc Kinematics.h \
+Smearing.cc Smearing.h \
+Maths.h Maths.cc \
+StandardSelectors.cc StandardSelectors.h\
+Histogram.cc Histogram.fh Histogram.h \
GaussianIntegrator.cc GaussianIntegrator.h \
-GaussianIntegrator.icc GaussianIntegrator.tcc \
+GaussianIntegrator.tcc \
Statistic.h HerwigStrategy.cc HerwigStrategy.h \
GSLIntegrator.h GSLIntegrator.tcc \
GSLBisection.h GSLBisection.tcc GSLHelper.h
CLEANFILES=
include $(srcdir)/Makefile.am.versionstring
diff --git a/Utilities/Maths.h b/Utilities/Maths.h
--- a/Utilities/Maths.h
+++ b/Utilities/Maths.h
@@ -1,50 +1,55 @@
// -*- C++ -*-
//
// Maths.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_Math_H
#define HERWIG_Math_H
#include <cmath>
#include "ThePEG/Config/Complex.h"
#include "ThePEG/Utilities/Maths.h"
namespace Herwig {
using ThePEG::Complex;
using std::complex;
/** The Math namespace includes the declaration of some useful
* mathematical functions. */
namespace Math {
/**
* The dilog function taken from FORTRAN Herwig
*/
Complex Li2(Complex);
/**
* The real part of the dilog function taken from FORTRAN Herwig
*/
long double ReLi2(long double);
+
+ /**
+ * Fold angles into the range (0,2 Pi)
+ */
+ inline double angleZeroTo2Pi(double angle) {
+ double ret = fmod(angle, 2 * M_PI);
+ if (ret < 0) ret += 2 * M_PI;
+ return ret;
+ }
/**
* Fold angles into the range (-Pi,Pi)
*/
- inline double angleMinusPiToPi(double angle);
-
- /**
- * Fold angles into the range (0,2 Pi)
- */
- inline double angleZeroTo2Pi(double angle);
+ inline double angleMinusPiToPi(double angle) {
+ double ret = angleZeroTo2Pi(angle);
+ if (ret > M_PI) ret -= 2 * M_PI;
+ return ret;
+ }
}
}
-
-#include "Maths.icc"
-
#endif /* HERWIG_Math_H */
diff --git a/Utilities/Maths.icc b/Utilities/Maths.icc
deleted file mode 100644
--- a/Utilities/Maths.icc
+++ /dev/null
@@ -1,26 +0,0 @@
-// -*- C++ -*-
-//
-// Maths.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-
-namespace Herwig {
-
-namespace Math {
-double angleZeroTo2Pi(double angle) {
- double ret = fmod(angle, 2 * M_PI);
- if (ret < 0) ret += 2 * M_PI;
- return ret;
-}
-
-double angleMinusPiToPi(double angle) {
- double ret = angleZeroTo2Pi(angle);
- if (ret > M_PI) ret -= 2 * M_PI;
- return ret;
-}
-
-}
-}
diff --git a/Utilities/Smearing.h b/Utilities/Smearing.h
--- a/Utilities/Smearing.h
+++ b/Utilities/Smearing.h
@@ -1,63 +1,61 @@
// -*- C++ -*-
//
// Smearing.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
#ifndef HERWIG_Smearing_H
#define HERWIG_Smearing_H
//
// This is the declaration of the Smearing class.
namespace Herwig {
/** \ingroup Utilities
*
* This is a pure static class which provides some useful methods for smearing.
*/
class Smearing {
public:
/**
* It returns true if succeed in drawing a value (x) drawn from a
* gaussian of specified mean and sigma, false otherwise.
* Indeed, it generates uncorrelated pairs and throws one of them away.
*/
static bool gaussianSmearing( const double mean, const double sigma, double & x );
/**
* It returns true if it succeed in drawing a rotated 2-vector
* (vx,vy) of given length r , false otherwise.
*/
static bool azimuthalSmearing( const double r, double & vx, double & vy );
private:
/**
* Pure static class so no default constructor
*/
Smearing();
/**
* Pure static class so no copy constructor
*/
Smearing(const Smearing & x);
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Smearing & operator=(const Smearing & x);
};
}
-#include "Smearing.icc"
-
#endif /* HERWIG_Smearing_H */
diff --git a/Utilities/Smearing.icc b/Utilities/Smearing.icc
deleted file mode 100644
--- a/Utilities/Smearing.icc
+++ /dev/null
@@ -1,16 +0,0 @@
-// -*- C++ -*-
-//
-// Smearing.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions of
-// the Smearing class.
-//
-
-namespace Herwig {
-
-}
diff --git a/Utilities/StandardSelectors.cc b/Utilities/StandardSelectors.cc
--- a/Utilities/StandardSelectors.cc
+++ b/Utilities/StandardSelectors.cc
@@ -1,13 +1,55 @@
// -*- C++ -*-
//
// StandardSelectors.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions for the Herwig++ StandardSelectors
//
#include "StandardSelectors.h"
+
+using namespace Herwig;
+
+bool WeakBHadronSelector::check(const Particle & p) const {
+ unsigned int id=abs(p.id());
+ if (!( ( id > 510 && id < 532 ) || ( id > 5121 && id < 5555 ) ) )
+ return false;
+ switch(id)
+ {
+ case 511: // B0
+ case 521: // B+
+ case 531: // B_s0
+ case 5122: // Lambda_b0
+ case 5132: // Xi_b-
+ case 5142: // Xi_bc0
+ case 5232: // Xi_b0
+ case 5242: // Xi_bc+
+ case 5332: // Omega_b
+ case 5342: // Omega_bc0
+ case 5412: // Xi'_bc0
+ case 5414: // Xi*_bc0
+ case 5422: // Xi'_bc+
+ case 5424: // Xi*_bc+
+ case 5432: // Omega'_bc0
+ case 5434: // Omega*_bc0
+ case 5442: // Omega_bcc+
+ case 5444: // Omega*_bcc+
+ case 5512: // Xi_bb-
+ case 5514: // Xi*_bb-
+ case 5522: // Xi_bb0
+ case 5524: // Xi*_bb0
+ case 5532: // Omega_bb-
+ case 5534: // Omega*_bb-
+ case 5542: // Omega_bbc0
+ case 5544: // Omega*_bbc0
+ case 5554: // Omega*_bbb-
+ return true;
+ break;
+ default:
+ return false;
+ }
+}
diff --git a/Utilities/StandardSelectors.h b/Utilities/StandardSelectors.h
--- a/Utilities/StandardSelectors.h
+++ b/Utilities/StandardSelectors.h
@@ -1,42 +1,40 @@
// -*- C++ -*-
//
// StandardSelectors.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_StandardSelectors_H
#define HERWIG_StandardSelectors_H
/**
* This file contains declarations of
* standard selector classes for Herwig++ in addition to those of ThePEG.
* The classes contain only static
* functions and are assumed to be used as template arguments to the
* ParticleSelector class.
*/
#include "ThePEG/EventRecord/SelectorBase.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/EventRecord/ParticleTraits.h"
namespace Herwig {
using namespace ThePEG;
/**
* Selector to select weakly decaying B hadrons
*/
struct WeakBHadronSelector: public SelectorBase {
/**
* Return true if the particle should be extracted.
*/
- inline virtual bool check(const Particle & p) const;
+ virtual bool check(const Particle & p) const;
};
-
-#include "StandardSelectors.icc"
}
#endif /* HERWIG_StandardSelectors_H */
diff --git a/Utilities/StandardSelectors.icc b/Utilities/StandardSelectors.icc
deleted file mode 100644
--- a/Utilities/StandardSelectors.icc
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- C++ -*-
-//
-// StandardSelectors.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
-// Copyright (C) 2002-2007 The Herwig Collaboration
-//
-// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
-// Please respect the MCnet academic guidelines, see GUIDELINES for details.
-//
-//
-// This is the implementation of the inlined member functions for
-// the StandardSelectors
-//
-
-inline bool WeakBHadronSelector::check(const Particle & p) const
-{
- unsigned int id=abs(p.id());
- if (!( ( id > 510 && id < 532 ) || ( id > 5121 && id < 5555 ) ) )
- return false;
- switch(id)
- {
- case 511: // B0
- case 521: // B+
- case 531: // B_s0
- case 5122: // Lambda_b0
- case 5132: // Xi_b-
- case 5142: // Xi_bc0
- case 5232: // Xi_b0
- case 5242: // Xi_bc+
- case 5332: // Omega_b
- case 5342: // Omega_bc0
- case 5412: // Xi'_bc0
- case 5414: // Xi*_bc0
- case 5422: // Xi'_bc+
- case 5424: // Xi*_bc+
- case 5432: // Omega'_bc0
- case 5434: // Omega*_bc0
- case 5442: // Omega_bcc+
- case 5444: // Omega*_bcc+
- case 5512: // Xi_bb-
- case 5514: // Xi*_bb-
- case 5522: // Xi_bb0
- case 5524: // Xi*_bb0
- case 5532: // Omega_bb-
- case 5534: // Omega*_bb-
- case 5542: // Omega_bbc0
- case 5544: // Omega*_bbc0
- case 5554: // Omega*_bbb-
- return true;
- break;
- default:
- return false;
- }
-}
diff --git a/src/MSSM.model b/src/MSSM.model
--- a/src/MSSM.model
+++ b/src/MSSM.model
@@ -1,368 +1,368 @@
##################################################
# Common setup for the MSSM
#
# See LHC-MSSM.in or ILC-MSSM.in for example usage
#
# This file does not contain anything that
# users need to touch. User settings are in
# ???-MSSM.in
#
###################################################
#
# Create particle content
#
###################################################
cd /Herwig/Particles
create ThePEG::ParticleData H0
setup H0 35 H0 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData A0
setup A0 36 A0 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData H+
setup H+ 37 H+ 500.0 0.0 0.0 0.0 3 0 1 0
create ThePEG::ParticleData H-
setup H- -37 H- 500.0 0.0 0.0 0.0 -3 0 1 0
makeanti H+ H-
create ThePEG::ParticleData ~d_L
setup ~d_L 1000001 ~d_L 500.0 0.0 0.0 0.0 -1 3 1 0
create ThePEG::ParticleData ~d_Lbar
setup ~d_Lbar -1000001 ~d_Lbar 500.0 0.0 0.0 0.0 1 -3 1 0
makeanti ~d_L ~d_Lbar
create ThePEG::ParticleData ~u_L
setup ~u_L 1000002 ~u_L 500.0 0.0 0.0 0.0 2 3 1 0
create ThePEG::ParticleData ~u_Lbar
setup ~u_Lbar -1000002 ~u_Lbar 500.0 0.0 0.0 0.0 -2 -3 1 0
makeanti ~u_L ~u_Lbar
create ThePEG::ParticleData ~s_L
setup ~s_L 1000003 ~s_L 500.0 0.0 0.0 0.0 -1 3 1 0
create ThePEG::ParticleData ~s_Lbar
setup ~s_Lbar -1000003 ~s_Lbar 500.0 0.0 0.0 0.0 1 -3 1 0
makeanti ~s_L ~s_Lbar
create ThePEG::ParticleData ~c_L
setup ~c_L 1000004 ~c_L 500.0 0.0 0.0 0.0 2 3 1 0
create ThePEG::ParticleData ~c_Lbar
setup ~c_Lbar -1000004 ~c_Lbar 500.0 0.0 0.0 0.0 -2 -3 1 0
makeanti ~c_L ~c_Lbar
create ThePEG::ParticleData ~b_1
setup ~b_1 1000005 ~b_1 500.0 0.0 0.0 0.0 -1 3 1 0
create ThePEG::ParticleData ~b_1bar
setup ~b_1bar -1000005 ~b_1bar 500.0 0.0 0.0 0.0 1 -3 1 0
makeanti ~b_1 ~b_1bar
create ThePEG::ParticleData ~t_1
setup ~t_1 1000006 ~t_1 500.0 0.0 0.0 0.0 2 3 1 0
create ThePEG::ParticleData ~t_1bar
setup ~t_1bar -1000006 ~t_1bar 500.0 0.0 0.0 0.0 -2 -3 1 0
makeanti ~t_1 ~t_1bar
create ThePEG::ParticleData ~e_L-
setup ~e_L- 1000011 ~e_L- 500.0 0.0 0.0 0.0 -3 0 1 0
create ThePEG::ParticleData ~e_L+
setup ~e_L+ -1000011 ~e_L+ 500.0 0.0 0.0 0.0 3 0 1 0
makeanti ~e_L- ~e_L+
create ThePEG::ParticleData ~nu_eL
setup ~nu_eL 1000012 ~nu_eL 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData ~nu_eLbar
setup ~nu_eLbar -1000012 ~nu_eLbar 500.0 0.0 0.0 0.0 0 0 1 0
makeanti ~nu_eL ~nu_eLbar
create ThePEG::ParticleData ~mu_L-
setup ~mu_L- 1000013 ~mu_L- 500.0 0.0 0.0 0.0 -3 0 1 0
create ThePEG::ParticleData ~mu_L+
setup ~mu_L+ -1000013 ~mu_L+ 500.0 0.0 0.0 0.0 3 0 1 0
makeanti ~mu_L- ~mu_L+
create ThePEG::ParticleData ~nu_muL
setup ~nu_muL 1000014 ~nu_muL 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData ~nu_muLbar
setup ~nu_muLbar -1000014 ~nu_muLbar 500.0 0.0 0.0 0.0 0 0 1 0
makeanti ~nu_muL ~nu_muLbar
create ThePEG::ParticleData ~tau_1-
setup ~tau_1- 1000015 ~tau_1- 500.0 0.0 0.0 0.0 -3 0 1 0
create ThePEG::ParticleData ~tau_1+
setup ~tau_1+ -1000015 ~tau_1+ 500.0 0.0 0.0 0.0 3 0 1 0
makeanti ~tau_1- ~tau_1+
create ThePEG::ParticleData ~nu_tauL
setup ~nu_tauL 1000016 ~nu_tauL 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData ~nu_tauLbar
setup ~nu_tauLbar -1000016 ~nu_tauLbar 500.0 0.0 0.0 0.0 0 0 1 0
makeanti ~nu_tauL ~nu_tauLbar
create ThePEG::ParticleData ~g
setup ~g 1000021 ~g 500.0 0.0 0.0 0.0 0 8 2 0
create ThePEG::ParticleData ~chi_10
setup ~chi_10 1000022 ~chi_10 500.0 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData ~chi_20
setup ~chi_20 1000023 ~chi_20 500.0 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData ~chi_1+
setup ~chi_1+ 1000024 ~chi_1+ 500.0 0.0 0.0 0.0 3 0 2 0
create ThePEG::ParticleData ~chi_1-
setup ~chi_1- -1000024 ~chi_1- 500.0 0.0 0.0 0.0 -3 0 2 0
makeanti ~chi_1+ ~chi_1-
create ThePEG::ParticleData ~chi_30
setup ~chi_30 1000025 ~chi_30 500.0 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData ~chi_40
setup ~chi_40 1000035 ~chi_40 500.0 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData ~chi_2+
setup ~chi_2+ 1000037 ~chi_2+ 500.0 0.0 0.0 0.0 3 0 2 0
create ThePEG::ParticleData ~chi_2-
setup ~chi_2- -1000037 ~chi_2- 500.0 0.0 0.0 0.0 -3 0 2 0
makeanti ~chi_2+ ~chi_2-
create ThePEG::ParticleData ~gravitino
setup ~gravitino 1000039 ~gravitino 500.0 0.0 0.000010 0.0 0 0 4 1
create ThePEG::ParticleData ~d_R
setup ~d_R 2000001 ~d_R 500.0 0.0 0.0 0.0 -1 3 1 0
create ThePEG::ParticleData ~d_Rbar
setup ~d_Rbar -2000001 ~d_Rbar 500.0 0.0 0.0 0.0 1 -3 1 0
makeanti ~d_R ~d_Rbar
create ThePEG::ParticleData ~u_R
setup ~u_R 2000002 ~u_R 500.0 0.0 0.0 0.0 2 3 1 0
create ThePEG::ParticleData ~u_Rbar
setup ~u_Rbar -2000002 ~u_Rbar 500.0 0.0 0.0 0.0 -2 -3 1 0
makeanti ~u_R ~u_Rbar
create ThePEG::ParticleData ~s_R
setup ~s_R 2000003 ~s_R 500.0 0.0 0.0 0.0 -1 3 1 0
create ThePEG::ParticleData ~s_Rbar
setup ~s_Rbar -2000003 ~s_Rbar 500.0 0.0 0.0 0.0 1 -3 1 0
makeanti ~s_R ~s_Rbar
create ThePEG::ParticleData ~c_R
setup ~c_R 2000004 ~c_R 500.0 0.0 0.0 0.0 2 3 1 0
create ThePEG::ParticleData ~c_Rbar
setup ~c_Rbar -2000004 ~c_Rbar 500.0 0.0 0.0 0.0 -2 -3 1 0
makeanti ~c_R ~c_Rbar
create ThePEG::ParticleData ~b_2
setup ~b_2 2000005 ~b_2 500.0 0.0 0.0 0.0 -1 3 1 0
create ThePEG::ParticleData ~b_2bar
setup ~b_2bar -2000005 ~b_2bar 500.0 0.0 0.0 0.0 1 -3 1 0
makeanti ~b_2 ~b_2bar
create ThePEG::ParticleData ~t_2
setup ~t_2 2000006 ~t_2 500.0 0.0 0.0 0.0 2 3 1 0
create ThePEG::ParticleData ~t_2bar
setup ~t_2bar -2000006 ~t_2bar 500.0 0.0 0.0 0.0 -2 -3 1 0
makeanti ~t_2 ~t_2bar
create ThePEG::ParticleData ~e_R-
setup ~e_R- 2000011 ~e_R- 500.0 0.0 0.0 0.0 -3 0 1 0
create ThePEG::ParticleData ~e_R+
setup ~e_R+ -2000011 ~e_R+ 500.0 0.0 0.0 0.0 3 0 1 0
makeanti ~e_R- ~e_R+
create ThePEG::ParticleData ~nu_eR
setup ~nu_eR 2000012 ~nu_eR 500.0 0.0 0.000010 0.0 0 0 1 1
create ThePEG::ParticleData ~nu_eRbar
setup ~nu_eRbar -2000012 ~nu_eRbar 500.0 0.0 0.000010 0.0 0 0 1 1
makeanti ~nu_eR ~nu_eRbar
create ThePEG::ParticleData ~mu_R-
setup ~mu_R- 2000013 ~mu_R- 500.0 0.0 0.0 0.0 -3 0 1 0
create ThePEG::ParticleData ~mu_R+
setup ~mu_R+ -2000013 ~mu_R+ 500.0 0.0 0.0 0.0 3 0 1 0
makeanti ~mu_R- ~mu_R+
create ThePEG::ParticleData ~nu_muR
setup ~nu_muR 2000014 ~nu_muR 500.0 0.0 0.000010 0.0 0 0 1 1
create ThePEG::ParticleData ~nu_muRbar
setup ~nu_muRbar -2000014 ~nu_muRbar 500.0 0.0 0.000010 0.0 0 0 1 1
makeanti ~nu_muR ~nu_muRbar
create ThePEG::ParticleData ~tau_2-
setup ~tau_2- 2000015 ~tau_2- 500.0 0.0 0.0 0.0 -3 0 1 0
create ThePEG::ParticleData ~tau_2+
setup ~tau_2+ -2000015 ~tau_2+ 500.0 0.0 0.0 0.0 3 0 1 0
makeanti ~tau_2- ~tau_2+
create ThePEG::ParticleData ~nu_tauR
setup ~nu_tauR 2000016 ~nu_tauR 500.0 0.0 0.000010 0.0 0 0 1 1
create ThePEG::ParticleData ~nu_tauRbar
setup ~nu_tauRbar -2000016 ~nu_tauRbar 500.0 0.0 0.000010 0.0 0 0 1 1
makeanti ~nu_tauR ~nu_tauRbar
###################################################
#
# Main directory and model object
#
###################################################
mkdir /Herwig/NewPhysics/MSSM
cd /Herwig/NewPhysics/MSSM
create Herwig::MSSM Model HwSusy.so
# SM couplings
set Model:QCD/RunningAlphaS /Herwig/AlphaS
set Model:EW/RunningAlphaEM /Herwig/AlphaEM
set Model:EW/CKM /Herwig/CKM
set Model:RunningMass /Herwig/RunningMass
###################################################
#
# Vertices
#
###################################################
# create MSSM vertices
mkdir /Herwig/Vertices/MSSM
cd /Herwig/Vertices/MSSM
# MSSM
library HwSusy.so
create Herwig::SSWSSVertex MSSM_WSS
create Herwig::SSNFSVertex MSSM_NFS
create Herwig::SSGFSVertex MSSM_GFS
create Herwig::SSHSFSFVertex MSSM_HSS
create Herwig::SSCFSVertex MSSM_CFS
create Herwig::SSGSSVertex MSSM_GSS
create Herwig::SSGNGVertex MSSM_GNG
create Herwig::SSGGSQSQVertex MSSM_GGSS
create Herwig::SSGSGSGVertex MSSM_GGOGO
create Herwig::SSNNZVertex MSSM_NNZ
create Herwig::SSNNPVertex MSSM_NNP
create Herwig::SSCCZVertex MSSM_CCZ
create Herwig::SSCNWVertex MSSM_CNW
create Herwig::SSFFHVertex MSSM_FFH
create Herwig::SSGOGOHVertex MSSM_GOGOH
create Herwig::SSWWHVertex MSSM_WWH
create Herwig::SSWHHVertex MSSM_WHH
create Herwig::SSHHHVertex MSSM_HHH
create Herwig::SSHGGVertex MSSM_HGG
create Herwig::SSHPPVertex MSSM_HPP
cd /Herwig/NewPhysics/MSSM
# SM vertices
set Model:Vertex/FFZ /Herwig/Vertices/FFZVertex
set Model:Vertex/FFW /Herwig/Vertices/FFWVertex
set Model:Vertex/FFH /Herwig/Vertices/FFHVertex
set Model:Vertex/FFG /Herwig/Vertices/FFGVertex
set Model:Vertex/FFP /Herwig/Vertices/FFPVertex
set Model:Vertex/GGG /Herwig/Vertices/GGGVertex
set Model:Vertex/GGGG /Herwig/Vertices/GGGGVertex
set Model:Vertex/WWH /Herwig/Vertices/WWHVertex
set Model:Vertex/WWW /Herwig/Vertices/WWWVertex
set Model:Vertex/WWWW /Herwig/Vertices/WWWWVertex
# MSSM feynman rules
set Model:Vertex/WSFSF /Herwig/Vertices/MSSM/MSSM_WSS
set Model:Vertex/NFSF /Herwig/Vertices/MSSM/MSSM_NFS
set Model:Vertex/GFSF /Herwig/Vertices/MSSM/MSSM_GFS
set Model:Vertex/HSFSF /Herwig/Vertices/MSSM/MSSM_HSS
set Model:Vertex/CFSF /Herwig/Vertices/MSSM/MSSM_CFS
set Model:Vertex/GSFSF /Herwig/Vertices/MSSM/MSSM_GSS
set Model:Vertex/GGSQSQ /Herwig/Vertices/MSSM/MSSM_GGSS
set Model:Vertex/GSGSG /Herwig/Vertices/MSSM/MSSM_GGOGO
set Model:Vertex/GNG /Herwig/Vertices/MSSM/MSSM_GNG
set Model:Vertex/NNZ /Herwig/Vertices/MSSM/MSSM_NNZ
set Model:Vertex/NNP /Herwig/Vertices/MSSM/MSSM_NNP
set Model:Vertex/CCZ /Herwig/Vertices/MSSM/MSSM_CCZ
set Model:Vertex/CNW /Herwig/Vertices/MSSM/MSSM_CNW
set Model:Vertex/SSFFH /Herwig/Vertices/MSSM/MSSM_FFH
set Model:Vertex/GOGOH /Herwig/Vertices/MSSM/MSSM_GOGOH
set Model:Vertex/SSWWH /Herwig/Vertices/MSSM/MSSM_WWH
set Model:Vertex/SSWHH /Herwig/Vertices/MSSM/MSSM_WHH
set Model:Vertex/HHH /Herwig/Vertices/MSSM/MSSM_HHH
set Model:Vertex/HGG /Herwig/Vertices/MSSM/MSSM_HGG
set Model:Vertex/HPP /Herwig/Vertices/MSSM/MSSM_HPP
###################################################
#
# Set up spin correlation Decayers
#
###################################################
cd /Herwig/NewPhysics
set TwoBodyDC:CreateDecayModes No
set ThreeBodyDC:CreateDecayModes No
insert NewModel:DecayParticles 0 /Herwig/Particles/~d_L
insert NewModel:DecayParticles 1 /Herwig/Particles/~u_L
insert NewModel:DecayParticles 2 /Herwig/Particles/~s_L
insert NewModel:DecayParticles 3 /Herwig/Particles/~c_L
insert NewModel:DecayParticles 4 /Herwig/Particles/~b_1
insert NewModel:DecayParticles 5 /Herwig/Particles/~t_1
insert NewModel:DecayParticles 6 /Herwig/Particles/~d_R
insert NewModel:DecayParticles 7 /Herwig/Particles/~u_R
insert NewModel:DecayParticles 8 /Herwig/Particles/~s_R
insert NewModel:DecayParticles 9 /Herwig/Particles/~c_R
insert NewModel:DecayParticles 10 /Herwig/Particles/~b_2
insert NewModel:DecayParticles 11 /Herwig/Particles/~t_2
insert NewModel:DecayParticles 12 /Herwig/Particles/~e_L-
insert NewModel:DecayParticles 13 /Herwig/Particles/~nu_eL
insert NewModel:DecayParticles 14 /Herwig/Particles/~mu_L-
insert NewModel:DecayParticles 15 /Herwig/Particles/~nu_muL
insert NewModel:DecayParticles 16 /Herwig/Particles/~tau_1-
insert NewModel:DecayParticles 17 /Herwig/Particles/~nu_tauL
insert NewModel:DecayParticles 18 /Herwig/Particles/~e_R-
insert NewModel:DecayParticles 19 /Herwig/Particles/~mu_R-
insert NewModel:DecayParticles 20 /Herwig/Particles/~tau_2-
insert NewModel:DecayParticles 21 /Herwig/Particles/~g
insert NewModel:DecayParticles 22 /Herwig/Particles/~chi_10
insert NewModel:DecayParticles 23 /Herwig/Particles/~chi_20
insert NewModel:DecayParticles 24 /Herwig/Particles/~chi_30
insert NewModel:DecayParticles 25 /Herwig/Particles/~chi_40
insert NewModel:DecayParticles 26 /Herwig/Particles/~chi_1+
insert NewModel:DecayParticles 27 /Herwig/Particles/~chi_2+
insert NewModel:DecayParticles 28 /Herwig/Particles/h0
insert NewModel:DecayParticles 29 /Herwig/Particles/H0
insert NewModel:DecayParticles 30 /Herwig/Particles/A0
insert NewModel:DecayParticles 31 /Herwig/Particles/H+
###################################################
#
# Shower stuff for coloured sparticles
#
###################################################
cd /Herwig/Shower
create Herwig::PhitoPhiGSplitFn PhitoPhiGSplitFn
create Herwig::GluinotoGluinoGSplitFn GluinotoGluinoGSplitFn
cp SudakovCommon PhitoPhiGSudakov
set PhitoPhiGSudakov:SplittingFunction PhitoPhiGSplitFn
set PhitoPhiGSudakov:PDFmax 35.0
cp SudakovCommon GluinotoGluinoGSudakov
set GluinotoGluinoGSudakov:SplittingFunction GluinotoGluinoGSplitFn
-set SplittingGenerator:AddFinalSplitting ~u_L->~u_L,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~d_L->~d_L,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~s_L->~s_L,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~c_L->~c_L,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~b_1->~b_1,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~t_1->~t_1,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~u_R->~u_R,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~d_R->~d_R,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~s_R->~s_R,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~c_R->~c_R,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~b_2->~b_2,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~t_2->~t_2,g; PhitoPhiGSudakov
-set SplittingGenerator:AddFinalSplitting ~g->~g,g; GluinotoGluinoGSudakov
+do SplittingGenerator:AddFinalSplitting ~u_L->~u_L,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~d_L->~d_L,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~s_L->~s_L,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~c_L->~c_L,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~b_1->~b_1,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~t_1->~t_1,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~u_R->~u_R,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~d_R->~d_R,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~s_R->~s_R,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~c_R->~c_R,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~b_2->~b_2,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~t_2->~t_2,g; PhitoPhiGSudakov
+do SplittingGenerator:AddFinalSplitting ~g->~g,g; GluinotoGluinoGSudakov
###################################################
# Set up the bsm framework
###################################################
cd /Herwig/NewPhysics
set MSSM/Model:ModelGenerator NewModel
###################################################
#
# Choose MSSM over SM
#
###################################################
cd /Herwig/Generators
set LEPGenerator:StandardModelParameters /Herwig/NewPhysics/MSSM/Model
set LHCGenerator:StandardModelParameters /Herwig/NewPhysics/MSSM/Model
###################################################
#
# Get Shower to decay SUSY particles
#
###################################################
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000001 # SUSY_d_L
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000002 # SUSY_u_L
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000003 # SUSY_s_L
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000004 # SUSY_c_L
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000005 # SUSY_b_1
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000006 # SUSY_t_1
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000011 # SUSY_e_Lminus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000012 # SUSY_nu_eL
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000013 # SUSY_mu_Lminus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000014 # SUSY_nu_muL
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000015 # SUSY_tau_1minus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000016 # SUSY_nu_tauL
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000021 # SUSY_g
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000022 # SUSY_chi_10
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000023 # SUSY_chi_20
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000024 # SUSY_chi_1plus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000025 # SUSY_chi_30
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000035 # SUSY_chi_40
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000037 # SUSY_chi_2plus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 1000039 # SUSY_gravitino
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000001 # SUSY_d_R
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000002 # SUSY_u_R
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000003 # SUSY_s_R
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000004 # SUSY_c_R
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000005 # SUSY_b_2
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000006 # SUSY_t_2
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000011 # SUSY_e_Rminus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000012 # SUSY_nu_eR
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000013 # SUSY_mu_Rminus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000014 # SUSY_nu_muR
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000015 # SUSY_tau_2minus
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 2000016 # SUSY_nu_tauR
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 35 # H0
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 36 # A0
insert /Herwig/Shower/ShowerHandler:DecayInShower 0 37 # H+
\ No newline at end of file
diff --git a/src/MUED.model b/src/MUED.model
--- a/src/MUED.model
+++ b/src/MUED.model
@@ -1,329 +1,329 @@
##################################################
# Common setup for Universal extra dimensions
#
# See LHC-MUED.in or ILC-MUED.in for example usage
#
# This file does not contain anything that
# users need to touch. User settings are in
# ???-MUED.in
#
###################################################
#
# Create particle content
#
###################################################
# The UED level-1 particles
cd /Herwig/Particles
create ThePEG::ParticleData KK1_d_L
setup KK1_d_L 5100001 KK1_d_L 500. 0.0 0.0 0.0 -1 3 2 0
create ThePEG::ParticleData KK1_d_Lbar
setup KK1_d_Lbar -5100001 KK1_d_Lbar 500. 0.0 0.0 0.0 1 -3 2 0
makeanti KK1_d_L KK1_d_Lbar
create ThePEG::ParticleData KK1_u_L
setup KK1_u_L 5100002 KK1_u_L 500. 0.0 0.0 0.0 2 3 2 0
create ThePEG::ParticleData KK1_u_Lbar
setup KK1_u_Lbar -5100002 KK1_u_Lbar 500. 0.0 0.0 0.0 -2 -3 2 0
makeanti KK1_u_L KK1_u_Lbar
create ThePEG::ParticleData KK1_s_L
setup KK1_s_L 5100003 KK1_s_L 500. 0.0 0.0 0.0 -1 3 2 0
create ThePEG::ParticleData KK1_s_Lbar
setup KK1_s_Lbar -5100003 KK1_s_Lbar 500. 0.0 0.0 0.0 1 -3 2 0
makeanti KK1_s_L KK1_s_Lbar
create ThePEG::ParticleData KK1_c_L
setup KK1_c_L 5100004 KK1_c_L 500. 0.0 0.0 0.0 2 3 2 0
create ThePEG::ParticleData KK1_c_Lbar
setup KK1_c_Lbar -5100004 KK1_c_Lbar 500. 0.0 0.0 0.0 -2 -3 2 0
makeanti KK1_c_L KK1_c_Lbar
create ThePEG::ParticleData KK1_b_1
setup KK1_b_1 5100005 KK1_b_1 500. 0.0 0.0 0.0 -1 3 2 0
create ThePEG::ParticleData KK1_b_1bar
setup KK1_b_1bar -5100005 KK1_b_1bar 500. 0.0 0.0 0.0 1 -3 2 0
makeanti KK1_b_1 KK1_b_1bar
create ThePEG::ParticleData KK1_t_1
setup KK1_t_1 5100006 KK1_t_1 500. 0.0 0.0 0.0 2 3 2 0
create ThePEG::ParticleData KK1_t_1bar
setup KK1_t_1bar -5100006 KK1_t_1bar 500. 0.0 0.0 0.0 -2 -3 2 0
makeanti KK1_t_1 KK1_t_1bar
# Right
create ThePEG::ParticleData KK1_d_R
setup KK1_d_R 6100001 KK1_d_R 500. 0.0 0.0 0.0 -1 3 2 0
create ThePEG::ParticleData KK1_d_Rbar
setup KK1_d_Rbar -6100001 KK1_d_Rbar 500. 0.0 0.0 0.0 1 -3 2 0
makeanti KK1_d_R KK1_d_Rbar
create ThePEG::ParticleData KK1_u_R
setup KK1_u_R 6100002 KK1_u_R 500. 0.0 0.0 0.0 2 3 2 0
create ThePEG::ParticleData KK1_u_Rbar
setup KK1_u_Rbar -6100002 KK1_u_Rbar 500. 0.0 0.0 0.0 -2 -3 2 0
makeanti KK1_u_R KK1_u_Rbar
create ThePEG::ParticleData KK1_s_R
setup KK1_s_R 6100003 KK1_s_R 500. 0.0 0.0 0.0 -1 3 2 0
create ThePEG::ParticleData KK1_s_Rbar
setup KK1_s_Rbar -6100003 KK1_s_Rbar 500. 0.0 0.0 0.0 1 -3 2 0
makeanti KK1_s_R KK1_s_Rbar
create ThePEG::ParticleData KK1_c_R
setup KK1_c_R 6100004 KK1_c_R 500. 0.0 0.0 0.0 2 3 2 0
create ThePEG::ParticleData KK1_c_Rbar
setup KK1_c_Rbar -6100004 KK1_c_Rbar 500. 0.0 0.0 0.0 -2 -3 2 0
makeanti KK1_c_R KK1_c_Rbar
create ThePEG::ParticleData KK1_b_2
setup KK1_b_2 6100005 KK1_b_2 500. 0.0 0.0 0.0 -1 3 2 0
create ThePEG::ParticleData KK1_b_2bar
setup KK1_b_2bar -6100005 KK1_b_2bar 500. 0.0 0.0 0.0 1 -3 2 0
makeanti KK1_b_2 KK1_b_2bar
create ThePEG::ParticleData KK1_t_2
setup KK1_t_2 6100006 KK1_t_2 500. 0.0 0.0 0.0 2 3 2 0
create ThePEG::ParticleData KK1_t_2bar
setup KK1_t_2bar -6100006 KK1_t_2bar 500. 0.0 0.0 0.0 -2 -3 2 0
makeanti KK1_t_2 KK1_t_2bar
create ThePEG::ParticleData KK1_e_L-
setup KK1_e_L- 5100011 KK1_e_L- 500. 0.0 0.0 0.0 -3 0 2 0
create ThePEG::ParticleData KK1_e_L+
setup KK1_e_L+ -5100011 KK1_e_L+ 500. 0.0 0.0 0.0 3 0 2 0
makeanti KK1_e_L- KK1_e_L+
create ThePEG::ParticleData KK1_nu_eL
setup KK1_nu_eL 5100012 KK1_nu_eL 500. 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData KK1_nu_eLbar
setup KK1_nu_eLbar -5100012 KK1_nu_eLbar 500. 0.0 0.0 0.0 0 0 2 0
makeanti KK1_nu_eL KK1_nu_eLbar
create ThePEG::ParticleData KK1_mu_L-
setup KK1_mu_L- 5100013 KK1_mu_L- 500. 0.0 0.0 0.0 -3 0 2 0
create ThePEG::ParticleData KK1_mu_L+
setup KK1_mu_L+ -5100013 KK1_mu_L+ 500. 0.0 0.0 0.0 3 0 2 0
makeanti KK1_mu_L- KK1_mu_L+
create ThePEG::ParticleData KK1_nu_muL
setup KK1_nu_muL 5100014 KK1_nu_muL 500. 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData KK1_nu_muLbar
setup KK1_nu_muLbar -5100014 KK1_nu_muLbar 500. 0.0 0.0 0.0 0 0 2 0
makeanti KK1_nu_muL KK1_nu_muLbar
create ThePEG::ParticleData KK1_tau_1-
setup KK1_tau_1- 5100015 KK1_tau_1- 500. 0.0 0.0 0.0 -3 0 2 0
create ThePEG::ParticleData KK1_tau_1+
setup KK1_tau_1+ -5100015 KK1_tau_1+ 500. 0.0 0.0 0.0 3 0 2 0
makeanti KK1_tau_1- KK1_tau_1+
create ThePEG::ParticleData KK1_nu_tauL
setup KK1_nu_tauL 5100016 KK1_nu_tauL 500. 0.0 0.0 0.0 0 0 2 0
create ThePEG::ParticleData KK1_nu_tauLbar
setup KK1_nu_tauLbar -5100016 KK1_nu_tauLbar 500. 0.0 0.0 0.0 0 0 2 0
makeanti KK1_nu_tauL KK1_nu_tauLbar
create ThePEG::ParticleData KK1_e_R-
setup KK1_e_R- 6100011 KK1_e_R- 500. 0.0 0.0 0.0 -3 0 2 0
create ThePEG::ParticleData KK1_e_R+
setup KK1_e_R+ -6100011 KK1_e_R+ 500. 0.0 0.0 0.0 3 0 2 0
makeanti KK1_e_R- KK1_e_R+
create ThePEG::ParticleData KK1_mu_R-
setup KK1_mu_R- 6100013 KK1_mu_R- 500. 0.0 0.0 0.0 -3 0 2 0
create ThePEG::ParticleData KK1_mu_R+
setup KK1_mu_R+ -6100013 KK1_mu_R+ 500. 0.0 0.0 0.0 3 0 2 0
makeanti KK1_mu_R- KK1_mu_R+
create ThePEG::ParticleData KK1_tau_2-
setup KK1_tau_2- 6100015 KK1_tau_2- 500. 0.0 0.0 0.0 -3 0 2 0
create ThePEG::ParticleData KK1_tau_2+
setup KK1_tau_2+ -6100015 KK1_tau_2+ 500. 0.0 0.0 0.0 3 0 2 0
makeanti KK1_tau_2- KK1_tau_2+
create ThePEG::ParticleData KK1_g
setup KK1_g 5100021 KK1_g 500. 0.0 0.0 0.0 0 8 3 0
create ThePEG::ParticleData KK1_gamma
setup KK1_gamma 5100022 KK1_gamma 500. 0.0 0.0 0.0 0 0 3 0
create ThePEG::ParticleData KK1_Z0
setup KK1_Z0 5100023 KK1_Z0 500. 0.0 0.0 0.0 0 0 3 0
create ThePEG::ParticleData KK1_W+
setup KK1_W+ 5100024 KK1_W+ 500. 0.0 0.0 0.0 3 0 3 0
create ThePEG::ParticleData KK1_W-
setup KK1_W- -5100024 KK1_W- 500. 0.0 0.0 0.0 -3 0 3 0
makeanti KK1_W+ KK1_W-
create ThePEG::ParticleData KK1_h0
setup KK1_h0 5100025 KK1_h0 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData KK1_A0
setup KK1_A0 5100036 KK1_A0 500.0 0.0 0.0 0.0 0 0 1 0
create ThePEG::ParticleData KK1_H+
setup KK1_H+ 5100037 KK1_H+ 500.0 0.0 0.0 0.0 3 0 1 0
create ThePEG::ParticleData KK1_H-
setup KK1_H- -5100037 KK1_H- 500.0 0.0 0.0 0.0 -3 0 1 0
makeanti KK1_H+ KK1_H-
###################################################
#
# Main directory and model object
#
###################################################
mkdir /Herwig/NewPhysics/MUED
cd /Herwig/NewPhysics/MUED
create Herwig::UEDBase Model HwUED.so
# SM couplings
set Model:QCD/RunningAlphaS /Herwig/AlphaS
set Model:EW/RunningAlphaEM /Herwig/AlphaEM
set Model:EW/CKM /Herwig/CKM
set Model:RunningMass /Herwig/RunningMass
###################################################
#
# Vertices
#
###################################################
mkdir /Herwig/Vertices/MUED
cd /Herwig/Vertices/MUED
# create MUED vertices
library HwUED.so
create Herwig::UEDF1F1Z0Vertex UED_F1F1Z
create Herwig::UEDF1F1P0Vertex UED_F1F1P
create Herwig::UEDF1F1W0Vertex UED_F1F1W
create Herwig::UEDF1F1G0Vertex UED_F1F1G0
create Herwig::UEDF1F0G1Vertex UED_F1F0G1
create Herwig::UEDF1F0W1Vertex UED_F1F0W1
create Herwig::UEDF1F0H1Vertex UED_F1F0H1
create Herwig::UEDG1G1G0Vertex UED_G1G1G0
create Herwig::UEDG0G0G1G1Vertex UED_G0G0G1G1
create Herwig::UEDP0H1H1Vertex UED_P0H1H1
create Herwig::UEDZ0H1H1Vertex UED_Z0H1H1
create Herwig::UEDW0A1H1Vertex UED_W0A1H1
create Herwig::UEDZ0A1h1Vertex UED_Z0A1h1
create Herwig::UEDW0W1W1Vertex UED_W0W1W1
# SM vertices
cd /Herwig/NewPhysics/MUED
set Model:Vertex/FFZ /Herwig/Vertices/FFZVertex
set Model:Vertex/FFW /Herwig/Vertices/FFWVertex
set Model:Vertex/FFH /Herwig/Vertices/FFHVertex
set Model:Vertex/FFG /Herwig/Vertices/FFGVertex
set Model:Vertex/FFP /Herwig/Vertices/FFPVertex
set Model:Vertex/GGG /Herwig/Vertices/GGGVertex
set Model:Vertex/GGGG /Herwig/Vertices/GGGGVertex
set Model:Vertex/WWH /Herwig/Vertices/WWHVertex
set Model:Vertex/WWW /Herwig/Vertices/WWWVertex
set Model:Vertex/WWWW /Herwig/Vertices/WWWWVertex
set Model:Vertex/HGG /Herwig/Vertices/HGGVertex
set Model:Vertex/HPP /Herwig/Vertices/HPPVertex
# MUED Feynman rules
set Model:Vertex/F1F1Z /Herwig/Vertices/MUED/UED_F1F1Z
set Model:Vertex/F1F1P /Herwig/Vertices/MUED/UED_F1F1P
set Model:Vertex/F1F1W /Herwig/Vertices/MUED/UED_F1F1W
set Model:Vertex/F1F1G0 /Herwig/Vertices/MUED/UED_F1F1G0
set Model:Vertex/F1F0G1 /Herwig/Vertices/MUED/UED_F1F0G1
set Model:Vertex/F1F0W1 /Herwig/Vertices/MUED/UED_F1F0W1
set Model:Vertex/F1F0H1 /Herwig/Vertices/MUED/UED_F1F0H1
set Model:Vertex/G1G1G0 /Herwig/Vertices/MUED/UED_G1G1G0
set Model:Vertex/G0G0G1G1 /Herwig/Vertices/MUED/UED_G0G0G1G1
set Model:Vertex/P0H1H1 /Herwig/Vertices/MUED/UED_P0H1H1
set Model:Vertex/Z0H1H1 /Herwig/Vertices/MUED/UED_Z0H1H1
set Model:Vertex/W0A1H1 /Herwig/Vertices/MUED/UED_W0A1H1
set Model:Vertex/Z0A1h1 /Herwig/Vertices/MUED/UED_Z0A1h1
set Model:Vertex/W0W1W1 /Herwig/Vertices/MUED/UED_W0W1W1
###################################################
#
# Set up spin correlation Decayers and remove SM
# Higgs related things
#
###################################################
cd /Herwig/Particles
set h0:Width_generator NULL
set h0:Mass_generator NULL
set h0/h0->b,bbar;:OnOff Off
set h0/h0->b,bbar;:BranchingRatio 0.0
set h0/h0->W+,W-;:OnOff Off
set h0/h0->W+,W-;:BranchingRatio 0.0
set h0/h0->tau-,tau+;:OnOff Off
set h0/h0->tau-,tau+;:BranchingRatio 0.0
set h0/h0->g,g;:OnOff Off
set h0/h0->g,g;:BranchingRatio 0.0
set h0/h0->c,cbar;:OnOff Off
set h0/h0->c,cbar;:BranchingRatio 0.0
set h0/h0->Z0,Z0;:OnOff Off
set h0/h0->Z0,Z0;:BranchingRatio 0.0
set h0/h0->gamma,gamma;:OnOff Off
set h0/h0->gamma,gamma;:BranchingRatio 0.0
set h0/h0->mu-,mu+;:OnOff Off
set h0/h0->mu-,mu+;:BranchingRatio 0.0
set h0/h0->t,tbar;:OnOff Off
set h0/h0->t,tbar;:BranchingRatio 0.0
cd /Herwig/NewPhysics
set TwoBodyDC:CreateDecayModes Yes
set ThreeBodyDC:CreateDecayModes Yes
insert NewModel:DecayParticles 0 /Herwig/Particles/KK1_d_L
insert NewModel:DecayParticles 1 /Herwig/Particles/KK1_u_L
insert NewModel:DecayParticles 2 /Herwig/Particles/KK1_s_L
insert NewModel:DecayParticles 3 /Herwig/Particles/KK1_c_L
insert NewModel:DecayParticles 4 /Herwig/Particles/KK1_b_1
insert NewModel:DecayParticles 5 /Herwig/Particles/KK1_t_1
insert NewModel:DecayParticles 6 /Herwig/Particles/KK1_d_R
insert NewModel:DecayParticles 7 /Herwig/Particles/KK1_u_R
insert NewModel:DecayParticles 8 /Herwig/Particles/KK1_s_R
insert NewModel:DecayParticles 9 /Herwig/Particles/KK1_c_R
insert NewModel:DecayParticles 10 /Herwig/Particles/KK1_b_2
insert NewModel:DecayParticles 11 /Herwig/Particles/KK1_t_2
insert NewModel:DecayParticles 12 /Herwig/Particles/KK1_e_L-
insert NewModel:DecayParticles 13 /Herwig/Particles/KK1_nu_eL
insert NewModel:DecayParticles 14 /Herwig/Particles/KK1_mu_L-
insert NewModel:DecayParticles 15 /Herwig/Particles/KK1_nu_muL
insert NewModel:DecayParticles 16 /Herwig/Particles/KK1_tau_1-
insert NewModel:DecayParticles 17 /Herwig/Particles/KK1_nu_tauL
insert NewModel:DecayParticles 18 /Herwig/Particles/KK1_e_R-
insert NewModel:DecayParticles 19 /Herwig/Particles/KK1_mu_R-
insert NewModel:DecayParticles 20 /Herwig/Particles/KK1_tau_2-
insert NewModel:DecayParticles 21 /Herwig/Particles/KK1_g
insert NewModel:DecayParticles 22 /Herwig/Particles/KK1_Z0
insert NewModel:DecayParticles 23 /Herwig/Particles/KK1_W+
insert NewModel:DecayParticles 24 /Herwig/Particles/h0
insert NewModel:DecayParticles 25 /Herwig/Particles/KK1_h0
insert NewModel:DecayParticles 26 /Herwig/Particles/KK1_A0
insert NewModel:DecayParticles 27 /Herwig/Particles/KK1_H+
###################################################
#
# Shower stuff for coloured sparticles
#
###################################################
cd /Herwig/Shower
insert ShowerHandler:DecayInShower 0 5100001
insert ShowerHandler:DecayInShower 1 5100002
insert ShowerHandler:DecayInShower 2 5100003
insert ShowerHandler:DecayInShower 3 5100004
insert ShowerHandler:DecayInShower 4 5100005
insert ShowerHandler:DecayInShower 5 5100006
insert ShowerHandler:DecayInShower 6 5100011
insert ShowerHandler:DecayInShower 7 5100012
insert ShowerHandler:DecayInShower 8 5100013
insert ShowerHandler:DecayInShower 9 5100014
insert ShowerHandler:DecayInShower 10 5100015
insert ShowerHandler:DecayInShower 11 5100016
insert ShowerHandler:DecayInShower 12 6100001
insert ShowerHandler:DecayInShower 13 6100002
insert ShowerHandler:DecayInShower 14 6100003
insert ShowerHandler:DecayInShower 15 6100004
insert ShowerHandler:DecayInShower 16 6100005
insert ShowerHandler:DecayInShower 17 6100006
insert ShowerHandler:DecayInShower 18 6100011
insert ShowerHandler:DecayInShower 19 6100013
insert ShowerHandler:DecayInShower 20 6100015
insert ShowerHandler:DecayInShower 21 5100021
insert ShowerHandler:DecayInShower 22 5100022
insert ShowerHandler:DecayInShower 23 5100023
insert ShowerHandler:DecayInShower 24 5100024
insert ShowerHandler:DecayInShower 25 5100025
insert ShowerHandler:DecayInShower 26 5100036
insert ShowerHandler:DecayInShower 27 5100037
-set SplittingGenerator:AddFinalSplitting KK1_u_L->KK1_u_L,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_d_L->KK1_d_L,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_s_L->KK1_s_L,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_c_L->KK1_c_L,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_b_1->KK1_b_1,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_t_1->KK1_t_1,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_u_R->KK1_u_R,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_d_R->KK1_d_R,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_s_R->KK1_s_R,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_c_R->KK1_c_R,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_b_2->KK1_b_2,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting KK1_t_2->KK1_t_2,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_u_L->KK1_u_L,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_d_L->KK1_d_L,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_s_L->KK1_s_L,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_c_L->KK1_c_L,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_b_1->KK1_b_1,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_t_1->KK1_t_1,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_u_R->KK1_u_R,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_d_R->KK1_d_R,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_s_R->KK1_s_R,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_c_R->KK1_c_R,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_b_2->KK1_b_2,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting KK1_t_2->KK1_t_2,g; QtoQGSudakov
###################################################
# Set up the model framework
###################################################
cd /Herwig/NewPhysics
set MUED/Model:ModelGenerator NewModel
###################################################
#
# Choose MSSM over SM
#
###################################################
cd /Herwig/Generators
set LEPGenerator:StandardModelParameters /Herwig/NewPhysics/MUED/Model
set LHCGenerator:StandardModelParameters /Herwig/NewPhysics/MUED/Model
diff --git a/src/defaults/MatrixElements.in b/src/defaults/MatrixElements.in
--- a/src/defaults/MatrixElements.in
+++ b/src/defaults/MatrixElements.in
@@ -1,190 +1,190 @@
##############################################################################
# Setup of default matrix elements.
#
# Only one ME is activated by default, but this file lists
# some alternatives. All available MEs can be found in the
# 'include/Herwig++/MatrixElements' subdirectory of your Herwig++
# installation.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Instead of editing this file directly, you should reset
# the matrix elements in your own input files:
#
# - create your custom SubProcessHandler
# - insert the MEs you need
# - set your SubProcessHandler instead of the default (see HerwigDefaults.in)
##############################################################################
mkdir /Herwig/MatrixElements
cd /Herwig/MatrixElements
library HwMELepton.so
library HwMEHadron.so
library HwMEDIS.so
############################################################
# e+e- matrix elements
############################################################
# e+e- > q qbar
create Herwig::MEee2gZ2qq MEee2gZ2qq
set MEee2gZ2qq:MinimumFlavour 1
set MEee2gZ2qq:MaximumFlavour 5
# e+e- -> l+l-
create Herwig::MEee2gZ2ll MEee2gZ2ll
set MEee2gZ2ll:Allowed Charged
# e+e- -> W+W- ZZ
create Herwig::MEee2VV MEee2VV
# e+e- -> ZH
create Herwig::MEee2ZH MEee2ZH
# e+e- -> e+e-H/nu_enu_ebarH
create Herwig::MEee2HiggsVBF MEee2HiggsVBF
############################################################
# hadron-hadron matrix elements
############################################################
###################################
# Electroweak processes
###################################
# q qbar -> gamma/Z -> l+l-
create Herwig::MEqq2gZ2ff MEqq2gZ2ff
set MEqq2gZ2ff:Process 3
# q qbar to W -> l nu
create Herwig::MEqq2W2ff MEqq2W2ff
set MEqq2W2ff:Process 2
# W+jet
create Herwig::MEPP2WJet MEWJet
set MEWJet:WDecay Leptons
# Z+jet
create Herwig::MEPP2ZJet MEZJet
set MEZJet:ZDecay ChargedLeptons
# PP->WW/WZ/ZZ
create Herwig::MEPP2VV MEPP2VV
# PP->WZ gamma
create Herwig::MEPP2VGamma MEPP2VGamma
###################################
# Photon and jet processes
###################################
# qqbar/gg -> gamma gamma
create Herwig::MEPP2GammaGamma MEGammaGamma
# hadron-hadron to gamma+jet
create Herwig::MEPP2GammaJet MEGammaJet
# QCD 2-to-2
create Herwig::MEQCD2to2 MEQCD2to2
# MinBias
create Herwig::MEMinBias MEMinBias
# qqbar/gg -> t tbar
create Herwig::MEPP2QQ MEHeavyQuark
###################################
# Higgs processes
###################################
# hadron-hadron to higgs
create Herwig::MEPP2Higgs MEHiggs
set MEHiggs:ShapeScheme MassGenerator
set MEHiggs:Process gg
# hadron-hadron to higgs+jet
create Herwig::MEPP2HiggsJet MEHiggsJet
# PP->ZH
create Herwig::MEPP2ZH MEPP2ZH
# PP->WH
create Herwig::MEPP2WH MEPP2WH
# PP -> Higgs via VBF
create Herwig::MEPP2HiggsVBF MEPP2HiggsVBF
# PP -> t tbar Higgs
create Herwig::MEPP2QQHiggs MEPP2ttbarH
set MEPP2ttbarH:QuarkType Top
# PP -> b bbar Higgs
create Herwig::MEPP2QQHiggs MEPP2bbbarH
set MEPP2bbbarH:QuarkType Bottom
##########################################################
# Hadron-Hadron NLO matrix elements in the Powheg scheme
##########################################################
library HwPowhegME.so
# q qbar -> gamma/Z -> l+l-
create Herwig::MEqq2gZ2ffPowheg PowhegMEqq2gZ2ff
set PowhegMEqq2gZ2ff:Process 3
# q qbar to W -> l nu
create Herwig::MEqq2W2ffPowheg PowhegMEqq2W2ff
-set PowhegMEqq2gZ2ff:Process 2
+set PowhegMEqq2W2ff:Process 2
# PP->ZH
create Herwig::MEPP2ZHPowheg PowhegMEPP2ZH
# PP->WH
create Herwig::MEPP2WHPowheg PowhegMEPP2WH
# hadron-hadron to higgs
create Herwig::MEPP2HiggsPowheg PowhegMEHiggs
set PowhegMEHiggs:ShapeScheme MassGenerator
set PowhegMEHiggs:Process gg
##########################################################
# DIS matrix elements
##########################################################
# neutral current
create Herwig::MENeutralCurrentDIS MEDISNC
# charged current
create Herwig::MEChargedCurrentDIS MEDISCC
##########################################################
# Gamma-Gamma matrix elements
##########################################################
# fermion-antiferimon
create Herwig::MEGammaGamma2ff MEgg2ff HwMEGammaGamma.so
# W+ W-
create Herwig::MEGammaGamma2WW MEgg2WW HwMEGammaGamma.so
##########################################################
# Gamma-Hadron matrix elements
##########################################################
# gamma parton -> 2 jets
create Herwig::MEGammaP2Jets MEGammaP2Jets HwMEGammaHadron.so
##########################################################
# Set up the Subprocesses
#
# For e+e-
##########################################################
create ThePEG::SubProcessHandler SimpleEE
set SimpleEE:PartonExtractor /Herwig/Partons/EEExtractor
##########################################################
# For hadron-hadron (by default only gamma/Z switched on)
##########################################################
create ThePEG::SubProcessHandler SimpleQCD
set SimpleQCD:PartonExtractor /Herwig/Partons/QCDExtractor
##########################################################
# For DIS only neutral current on by default
##########################################################
create ThePEG::SubProcessHandler SimpleDIS
set SimpleDIS:PartonExtractor /Herwig/Partons/DISExtractor
diff --git a/src/defaults/Shower.in b/src/defaults/Shower.in
--- a/src/defaults/Shower.in
+++ b/src/defaults/Shower.in
@@ -1,197 +1,197 @@
############################################################
# Setup of default parton shower
#
# Useful switches for users are marked near the top of
# this file.
#
# Don't edit this file directly, but reset the switches
# in your own input files!
############################################################
library HwMPI.so
library HwShower.so
mkdir /Herwig/Shower
cd /Herwig/Shower
create Herwig::ShowerHandler ShowerHandler
set ShowerHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler
set ShowerHandler:RemDecayer /Herwig/Partons/RemnantDecayer
#####################################
# initial setup, don't change these!
#####################################
create Herwig::SplittingGenerator SplittingGenerator
create Herwig::ShowerAlphaQCD AlphaQCD
create Herwig::Evolver Evolver
create Herwig::QTildeModel ShowerModel
create Herwig::QTildeFinder PartnerFinder
create Herwig::QTildeReconstructor KinematicsReconstructor
set KinematicsReconstructor:ReconstructionOption Colour
set /Herwig/Partons/RemnantDecayer:AlphaS AlphaQCD
set ShowerHandler:Evolver Evolver
set ShowerModel:PartnerFinder PartnerFinder
set ShowerModel:KinematicsReconstructor KinematicsReconstructor
set Evolver:ShowerModel ShowerModel
set Evolver:SplittingGenerator SplittingGenerator
##################################################################
# Intrinsic pT
#
# Recommended:
# 1.9 GeV for Tevatron W/Z production.
# 2.1 GeV for LHC W/Z production at 10 TeV
# 2.2 GeV for LHC W/Z production at 14 TeV
#
# Set all parameters to 0 to disable
##################################################################
set Evolver:IntrinsicPtGaussian 1.9*GeV
set Evolver:IntrinsicPtBeta 0
set Evolver:IntrinsicPtGamma 0*GeV
set Evolver:IntrinsicPtIptmax 0*GeV
#############################################################
# Main control switches for the parton shower.
#############################################################
set SplittingGenerator:ISR Yes
set SplittingGenerator:FSR Yes
#############################################################
#############################################################
# End of interesting user servicable section.
#
# Anything that follows below should only be touched if you
# know what you're doing.
#
# Really.
#############################################################
#
# create the matrix element corrections
#
# vector boson decay
create Herwig::VectorBosonQQBarMECorrection qqbarg
insert ShowerModel:MECorrections 0 qqbarg
set qqbarg:Coupling AlphaQCD
# top decay
create Herwig::TopDecayMECorrection TopME
insert ShowerModel:MECorrections 1 TopME
set TopME:Coupling AlphaQCD
# drell-yan
create Herwig::DrellYanMECorrection DrellYan
insert ShowerModel:MECorrections 2 DrellYan
set DrellYan:Coupling AlphaQCD
# higgs
create Herwig::GGtoHMECorrection GGtoHME
insert ShowerModel:MECorrections 3 GGtoHME
set GGtoHME:Coupling AlphaQCD
#
# a few default values
set Evolver:MECorrMode 1
set AlphaQCD:ScaleFactor 1.0
set AlphaQCD:NPAlphaS 2
set AlphaQCD:Qmin 0.935
set AlphaQCD:NumberOfLoops 3
set AlphaQCD:InputOption 1
set AlphaQCD:AlphaMZ 0.120
#
#
# Lets set up all the splittings
create Herwig::QtoQGSplitFn QtoQGSplitFn
create Herwig::GtoQQbarSplitFn GtoQQbarSplitFn
create Herwig::GtoGGSplitFn GtoGGSplitFn
create Herwig::QtoGQSplitFn QtoGQSplitFn
#
# Now the Sudakovs
create Herwig::QTildeSudakov SudakovCommon
set SudakovCommon:Alpha AlphaQCD
set SudakovCommon:cutoffKinScale 2.650*GeV
set SudakovCommon:PDFmax 1.0
cp SudakovCommon QtoQGSudakov
set QtoQGSudakov:SplittingFunction QtoQGSplitFn
set QtoQGSudakov:PDFmax 1.9
cp SudakovCommon GtoGGSudakov
set GtoGGSudakov:SplittingFunction GtoGGSplitFn
set GtoGGSudakov:PDFmax 2.0
cp SudakovCommon GtoQQbarSudakov
set GtoQQbarSudakov:SplittingFunction GtoQQbarSplitFn
set GtoQQbarSudakov:PDFmax 120.0
cp SudakovCommon GtobbbarSudakov
set GtobbbarSudakov:SplittingFunction GtoQQbarSplitFn
set GtobbbarSudakov:PDFmax 40000.0
cp SudakovCommon GtoccbarSudakov
set GtoccbarSudakov:SplittingFunction GtoQQbarSplitFn
set GtoccbarSudakov:PDFmax 2000.0
cp SudakovCommon QtoGQSudakov
set QtoGQSudakov:SplittingFunction QtoGQSplitFn
cp SudakovCommon utoGuSudakov
set utoGuSudakov:SplittingFunction QtoGQSplitFn
set utoGuSudakov:PDFFactor OverOneMinusZ
set utoGuSudakov:PDFmax 5.0
cp SudakovCommon dtoGdSudakov
set dtoGdSudakov:SplittingFunction QtoGQSplitFn
set dtoGdSudakov:PDFFactor OverOneMinusZ
#
# Now add the final splittings
#
-set SplittingGenerator:AddFinalSplitting u->u,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting d->d,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting s->s,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting c->c,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting b->b,g; QtoQGSudakov
-set SplittingGenerator:AddFinalSplitting t->t,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting u->u,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting d->d,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting s->s,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting c->c,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting b->b,g; QtoQGSudakov
+do SplittingGenerator:AddFinalSplitting t->t,g; QtoQGSudakov
#
-set SplittingGenerator:AddFinalSplitting g->g,g; GtoGGSudakov
+do SplittingGenerator:AddFinalSplitting g->g,g; GtoGGSudakov
#
-set SplittingGenerator:AddFinalSplitting g->u,ubar; GtoQQbarSudakov
-set SplittingGenerator:AddFinalSplitting g->d,dbar; GtoQQbarSudakov
-set SplittingGenerator:AddFinalSplitting g->s,sbar; GtoQQbarSudakov
-set SplittingGenerator:AddFinalSplitting g->c,cbar; GtoccbarSudakov
-set SplittingGenerator:AddFinalSplitting g->b,bbar; GtobbbarSudakov
-set SplittingGenerator:AddFinalSplitting g->t,tbar; GtoQQbarSudakov
+do SplittingGenerator:AddFinalSplitting g->u,ubar; GtoQQbarSudakov
+do SplittingGenerator:AddFinalSplitting g->d,dbar; GtoQQbarSudakov
+do SplittingGenerator:AddFinalSplitting g->s,sbar; GtoQQbarSudakov
+do SplittingGenerator:AddFinalSplitting g->c,cbar; GtoccbarSudakov
+do SplittingGenerator:AddFinalSplitting g->b,bbar; GtobbbarSudakov
+do SplittingGenerator:AddFinalSplitting g->t,tbar; GtoQQbarSudakov
#
# Now lets add the initial splittings. Remember the form a->b,c; means
# that particle a is the particle given and we backward branch to
# particle b which is initial state and particle c which is final state
#
-set SplittingGenerator:AddInitialSplitting u->u,g; QtoQGSudakov
-set SplittingGenerator:AddInitialSplitting d->d,g; QtoQGSudakov
-set SplittingGenerator:AddInitialSplitting s->s,g; QtoQGSudakov
-set SplittingGenerator:AddInitialSplitting c->c,g; QtoQGSudakov
-set SplittingGenerator:AddInitialSplitting b->b,g; QtoQGSudakov
-set SplittingGenerator:AddInitialSplitting t->t,g; QtoQGSudakov
+do SplittingGenerator:AddInitialSplitting u->u,g; QtoQGSudakov
+do SplittingGenerator:AddInitialSplitting d->d,g; QtoQGSudakov
+do SplittingGenerator:AddInitialSplitting s->s,g; QtoQGSudakov
+do SplittingGenerator:AddInitialSplitting c->c,g; QtoQGSudakov
+do SplittingGenerator:AddInitialSplitting b->b,g; QtoQGSudakov
+do SplittingGenerator:AddInitialSplitting t->t,g; QtoQGSudakov
#
-set SplittingGenerator:AddInitialSplitting g->g,g; GtoGGSudakov
+do SplittingGenerator:AddInitialSplitting g->g,g; GtoGGSudakov
#
-set SplittingGenerator:AddInitialSplitting g->d,dbar; GtoQQbarSudakov
-set SplittingGenerator:AddInitialSplitting g->u,ubar; GtoQQbarSudakov
-set SplittingGenerator:AddInitialSplitting g->s,sbar; GtoQQbarSudakov
-set SplittingGenerator:AddInitialSplitting g->c,cbar; GtoccbarSudakov
-set SplittingGenerator:AddInitialSplitting g->b,bbar; GtobbbarSudakov
-set SplittingGenerator:AddInitialSplitting g->t,tbar; GtoQQbarSudakov
+do SplittingGenerator:AddInitialSplitting g->d,dbar; GtoQQbarSudakov
+do SplittingGenerator:AddInitialSplitting g->u,ubar; GtoQQbarSudakov
+do SplittingGenerator:AddInitialSplitting g->s,sbar; GtoQQbarSudakov
+do SplittingGenerator:AddInitialSplitting g->c,cbar; GtoccbarSudakov
+do SplittingGenerator:AddInitialSplitting g->b,bbar; GtobbbarSudakov
+do SplittingGenerator:AddInitialSplitting g->t,tbar; GtoQQbarSudakov
#
-set SplittingGenerator:AddInitialSplitting d->g,d; dtoGdSudakov
-set SplittingGenerator:AddInitialSplitting u->g,u; utoGuSudakov
-set SplittingGenerator:AddInitialSplitting s->g,s; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting c->g,c; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting b->g,b; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting t->g,t; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting dbar->g,dbar; dtoGdSudakov
-set SplittingGenerator:AddInitialSplitting ubar->g,ubar; utoGuSudakov
-set SplittingGenerator:AddInitialSplitting sbar->g,sbar; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting cbar->g,cbar; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting bbar->g,bbar; QtoGQSudakov
-set SplittingGenerator:AddInitialSplitting tbar->g,tbar; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting d->g,d; dtoGdSudakov
+do SplittingGenerator:AddInitialSplitting u->g,u; utoGuSudakov
+do SplittingGenerator:AddInitialSplitting s->g,s; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting c->g,c; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting b->g,b; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting t->g,t; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting dbar->g,dbar; dtoGdSudakov
+do SplittingGenerator:AddInitialSplitting ubar->g,ubar; utoGuSudakov
+do SplittingGenerator:AddInitialSplitting sbar->g,sbar; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting cbar->g,cbar; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting bbar->g,bbar; QtoGQSudakov
+do SplittingGenerator:AddInitialSplitting tbar->g,tbar; QtoGQSudakov
diff --git a/src/defaults/mesons.in b/src/defaults/mesons.in
--- a/src/defaults/mesons.in
+++ b/src/defaults/mesons.in
@@ -1,756 +1,780 @@
#
# file containing the particle data for the mesons
#
#
# the 1^1S_0 multiplet
#
create ThePEG::ParticleData pi+
setup pi+ 211 pi+ 0.13957018 2.5283740149914E-17 0 7804.5 3 0 1 1
create ThePEG::ParticleData pi0
setup pi0 111 pi0 0.1349776 7.8616314741036E-9 0 2.51E-5 0 0 1 0
create ThePEG::ParticleData pi-
setup pi- -211 pi- 0.13957018 2.5283740149914E-17 0 7804.5 -3 0 1 1
makeanti pi- pi+
create ThePEG::ParticleData eta
setup eta 221 eta 0.54751 1.3E-6 1.3E-5 0 0 0 1 0
create ThePEG::ParticleData eta'
setup eta' 331 eta' 0.95778 0.000203 0.00203 0 0 0 1 0
create ThePEG::ParticleData eta_c
setup eta_c 441 eta_c 2.9804 0.0255 0.255 0 0 0 1 0
create ThePEG::ParticleData eta_b
setup eta_b 551 eta_b 9.397 0.0082 0.082 0 0 0 1 0
create ThePEG::ParticleData K+
setup K+ 321 K+ 0.493677 5.3144882844061E-17 0 3713 3 0 1 1
create ThePEG::ParticleData K0
setup K0 311 K0 0.497648 1.e300 0 0 0 0 1 0
create ThePEG::ParticleData K-
setup K- -321 K- 0.493677 5.3144882844061E-17 0 3713 -3 0 1 1
makeanti K- K+
create ThePEG::ParticleData Kbar0
setup Kbar0 -311 Kbar0 0.497648 1.e300 0 0 0 0 1 0
makeanti Kbar0 K0
create ThePEG::ParticleData D0
setup D0 421 D0 1.8645 1.6042841463415E-12 0 0.123 0 0 1 0
create ThePEG::ParticleData D+
setup D+ 411 D+ 1.8693 6.3286385503528E-13 0 0.3118 3 0 1 0
create ThePEG::ParticleData Dbar0
setup Dbar0 -421 Dbar0 1.8645 1.6042841463415E-12 0 0.123 0 0 1 0
makeanti Dbar0 D0
create ThePEG::ParticleData D-
setup D- -411 D- 1.8693 6.3286385503528E-13 0 0.3118 -3 0 1 0
makeanti D- D+
create ThePEG::ParticleData D_s+
setup D_s+ 431 D_s+ 1.9682 1.315513E-12 0 0.15 3 0 1 0
create ThePEG::ParticleData D_s-
setup D_s- -431 D_s- 1.9682 1.315513E-12 0 0.15 -3 0 1 0
makeanti D_s- D_s+
-create ThePEG::ParticleData B0
-setup B0 511 B0 5.2794 4.2897163043478E-13 0 0.46 0 0 1 0
+create ThePEG::MixedParticleData B0
+setup B0 511 B0 5.2794 4.2897163043478E-13 0 0.46 0 0 1 0
+set B0:DeltaM 3.337134e-13*GeV
+set B0:DeltaGamma 0.*GeV
+set B0:PQMagnitude 1.
+set B0:PQPhase 1.
+set B0:ZMagnitude 0.
+set B0:ZPhase 0.
create ThePEG::ParticleData B+
setup B+ 521 B+ 5.279 3.9386616766467E-13 0 0.501 3 0 1 0
-create ThePEG::ParticleData Bbar0
+create ThePEG::MixedParticleData Bbar0
setup Bbar0 -511 Bbar0 5.2794 4.2897163043478E-13 0 0.46 0 0 1 0
+set Bbar0:DeltaM 3.337134e-13*GeV
+set Bbar0:DeltaGamma 0.*GeV
+set Bbar0:PQMagnitude 1.
+set Bbar0:PQPhase 1.
+set Bbar0:ZMagnitude 0.
+set Bbar0:ZPhase 0.
makeanti Bbar0 B0
set Bbar0:Synchronized 0
create ThePEG::ParticleData B-
setup B- -521 B- 5.279 3.9386616766467E-13 0 0.501 -3 0 1 0
makeanti B- B+
set B-:Synchronized 0
-create ThePEG::ParticleData B_s0
+create ThePEG::MixedParticleData B_s0
setup B_s0 531 B_s0 5.3675 4.5051815068493E-13 0 0.438 0 0 1 0
-create ThePEG::ParticleData B_sbar0
+set B_s0:DeltaM 1.169642e-11*GeV
+set B_s0:DeltaGamma 6.676243e-14*GeV
+set B_s0:PQMagnitude 1.
+set B_s0:PQPhase 1.
+set B_s0:ZMagnitude 0.
+set B_s0:ZPhase 0.
+create ThePEG::MixedParticleData B_sbar0
setup B_sbar0 -531 B_sbar0 5.3675 4.5051815068493E-13 0 0.438 0 0 1 0
+set B_sbar0:DeltaM 1.169642e-11*GeV
+set B_sbar0:DeltaGamma 6.676243e-14*GeV
+set B_sbar0:PQMagnitude 1.
+set B_sbar0:PQPhase 1.
+set B_sbar0:ZMagnitude 0.
+set B_sbar0:ZPhase 0.
makeanti B_sbar0 B_s0
set B_sbar0:Synchronized 0
create ThePEG::ParticleData B_c+
setup B_c+ 541 B_c+ 6.286 1.4299054347826E-12 0 0.138 3 0 1 0
create ThePEG::ParticleData B_c-
setup B_c- -541 B_c- 6.286 1.4299054347826E-12 0 0.138 -3 0 1 0
makeanti B_c- B_c+
#
# the 1^3S_1 multiplet
#
create ThePEG::ParticleData rho+
setup rho+ 213 rho+ 0.7755 0.1494 0.45 0 3 0 3 0
set rho+:WidthLoCut 0.4
set rho+:WidthUpCut 0.5
create ThePEG::ParticleData rho0
setup rho0 113 rho0 0.7755 0.1494 0.45 0 0 0 3 0
set rho0:WidthLoCut 0.4
set rho0:WidthUpCut 0.5
create ThePEG::ParticleData rho-
setup rho- -213 rho- 0.7755 0.1494 0.45 0 -3 0 3 0
makeanti rho- rho+
set rho-:WidthLoCut 0.4
set rho-:WidthUpCut 0.5
create ThePEG::ParticleData omega
setup omega 223 omega 0.78265 0.00849 0.0849 0 0 0 3 0
create ThePEG::ParticleData phi
setup phi 333 phi 1.01946 0.00426 0.0363 0 0 0 3 0
set phi:WidthLoCut 0.03
set phi:WidthUpCut 0.0426
create ThePEG::ParticleData Jpsi
setup Jpsi 443 Jpsi 3.096916 9.34E-5 0.000934 0 0 0 3 0
create ThePEG::ParticleData Upsilon
setup Upsilon 553 Upsilon 9.4603 5.4E-5 0.00054 0 0 0 3 0
create ThePEG::ParticleData K*+
setup K*+ 323 K*+ 0.89166 0.0508 0.379 0 3 0 3 0
set K*+:WidthLoCut 0.25
set K*+:WidthUpCut 0.508
create ThePEG::ParticleData K*0
setup K*0 313 K*0 0.896 0.0503 0.3765 0 0 0 3 0
set K*0:WidthLoCut 0.25
set K*0:WidthUpCut 0.503
create ThePEG::ParticleData K*-
setup K*- -323 K*- 0.89166 0.0508 0.379 0 -3 0 3 0
makeanti K*- K*+
set K*-:WidthLoCut 0.25
set K*-:WidthUpCut 0.508
create ThePEG::ParticleData K*bar0
setup K*bar0 -313 K*bar0 0.896 0.0503 0.3765 0 0 0 3 0
makeanti K*bar0 K*0
set K*bar0:WidthLoCut 0.25
set K*bar0:WidthUpCut 0.503
create ThePEG::ParticleData D*0
setup D*0 423 D*0 2.0067 6.8E-5 0.00068 0 0 0 3 0
create ThePEG::ParticleData D*+
setup D*+ 413 D*+ 2.01 9.6E-5 0.00096 0 3 0 3 0
create ThePEG::ParticleData D*bar0
setup D*bar0 -423 D*bar0 2.0067 6.8E-5 0.00068 0 0 0 3 0
makeanti D*bar0 D*0
create ThePEG::ParticleData D*-
setup D*- -413 D*- 2.01 9.6E-5 0.00096 0 -3 0 3 0
makeanti D*- D*+
create ThePEG::ParticleData D_s*+
setup D_s*+ 433 D_s*+ 2.112 4.4E-5 0.00044 0 3 0 3 0
create ThePEG::ParticleData D_s*-
setup D_s*- -433 D_s*- 2.112 4.4E-5 0.00044 0 -3 0 3 0
makeanti D_s*- D_s*+
create ThePEG::ParticleData B*0
setup B*0 513 B*0 5.325 2.4E-7 2.4E-6 0 0 0 3 0
create ThePEG::ParticleData B*+
setup B*+ 523 B*+ 5.325 7.8E-7 7.8E-6 0 3 0 3 0
create ThePEG::ParticleData B*bar0
setup B*bar0 -513 B*bar0 5.325 2.4E-7 2.4E-6 0 0 0 3 0
makeanti B*bar0 B*0
create ThePEG::ParticleData B*-
setup B*- -523 B*- 5.325 7.8E-7 7.8E-6 0 -3 0 3 0
makeanti B*- B*+
create ThePEG::ParticleData B_s*0
setup B_s*0 533 B_s*0 5.4128 1.5E-7 1.5E-6 0 0 0 3 0
create ThePEG::ParticleData B_s*bar0
setup B_s*bar0 -533 B_s*bar0 5.4128 1.5E-7 1.5E-6 0 0 0 3 0
makeanti B_s*bar0 B_s*0
create ThePEG::ParticleData B_c*+
setup B_c*+ 543 B_c*+ 6.321 8.0E-8 8.0E-7 0 3 0 3 0
create ThePEG::ParticleData B_c*-
setup B_c*- -543 B_c*- 6.321 8.0E-8 8.0E-7 0 -3 0 3 0
makeanti B_c*- B_c*+
#
# the 1^1P_1 multiplet
#
create ThePEG::ParticleData b_1+
setup b_1+ 10213 b_1+ 1.2295 0.142 0.505 0 3 0 3 0
set b_1+:WidthLoCut 0.3
set b_1+:WidthUpCut 0.71
create ThePEG::ParticleData b_10
setup b_10 10113 b_10 1.2295 0.142 0.505 0 0 0 3 0
set b_10:WidthLoCut 0.3
set b_10:WidthUpCut 0.71
create ThePEG::ParticleData b_1-
setup b_1- -10213 b_1- 1.2295 0.142 0.505 0 -3 0 3 0
makeanti b_1- b_1+
set b_1-:WidthLoCut 0.3
set b_1-:WidthUpCut 0.71
create ThePEG::ParticleData h_1
setup h_1 10223 h_1 1.17 0.36 0.36 0 0 0 3 0
create ThePEG::ParticleData h'_1
setup h'_1 10333 h'_1 1.386 0.091 0.182 0 0 0 3 0
create ThePEG::ParticleData h_c
setup h_c 10443 h_c 3.52593 0.0009 0.009 0 0 0 3 0
create ThePEG::ParticleData h_b
setup h_b 10553 h_b 9.873 8.94E-5 0.000894 0 0 0 3 0
create ThePEG::ParticleData K_1+
setup K_1+ 10323 K_1+ 1.272 0.09 0.18 0 3 0 3 0
set K_1+:VariableRatio 1
create ThePEG::ParticleData K_10
setup K_10 10313 K_10 1.272 0.09 0.18 0 0 0 3 0
set K_10:VariableRatio 1
create ThePEG::ParticleData K_1-
setup K_1- -10323 K_1- 1.272 0.09 0.18 0 -3 0 3 0
makeanti K_1- K_1+
set K_1-:VariableRatio 1
create ThePEG::ParticleData K_1bar0
setup K_1bar0 -10313 K_1bar0 1.272 0.09 0.18 0 0 0 3 0
makeanti K_1bar0 K_10
set K_1bar0:VariableRatio 1
create ThePEG::ParticleData D_10
setup D_10 10423 D_10 2.4223 0.0204 0.102 0 0 0 3 0
create ThePEG::ParticleData D_1+
setup D_1+ 10413 D_1+ 2.4234 0.025 0.125 0 3 0 3 0
create ThePEG::ParticleData D_1bar0
setup D_1bar0 -10423 D_1bar0 2.4223 0.0204 0.102 0 0 0 3 0
makeanti D_1bar0 D_10
create ThePEG::ParticleData D_1-
setup D_1- -10413 D_1- 2.4234 0.025 0.125 0 -3 0 3 0
makeanti D_1- D_1+
create ThePEG::ParticleData D_s1+
setup D_s1+ 10433 D_s1+ 2.4589 3.82E-5 0.000382 0 3 0 3 0
create ThePEG::ParticleData D_s1-
setup D_s1- -10433 D_s1- 2.4589 3.82E-5 0.000382 0 -3 0 3 0
makeanti D_s1- D_s1+
create ThePEG::ParticleData B_10
setup B_10 10513 B_10 5.7206 0.01 0.1 0 0 0 3 0
create ThePEG::ParticleData B_1+
setup B_1+ 10523 B_1+ 5.7206 0.01 0.1 0 3 0 3 0
create ThePEG::ParticleData B_1bar0
setup B_1bar0 -10513 B_1bar0 5.7206 0.01 0.1 0 0 0 3 0
makeanti B_1bar0 B_10
create ThePEG::ParticleData B_1-
setup B_1- -10523 B_1- 5.7206 0.01 0.1 0 -3 0 3 0
makeanti B_1- B_1+
create ThePEG::ParticleData B_s10
setup B_s10 10533 B_s10 5.8294 0.0003 0.003 0 0 0 3 0
create ThePEG::ParticleData B_s1bar0
setup B_s1bar0 -10533 B_s1bar0 5.8294 0.0003 0.003 0 0 0 3 0
makeanti B_s1bar0 B_s10
create ThePEG::ParticleData B_c1+
setup B_c1+ 10543 B_c1+ 6.743 7.3E-5 0.00073 0 3 0 3 0
create ThePEG::ParticleData B_c1-
setup B_c1- -10543 B_c1- 6.743 7.3E-5 0.00073 0 -3 0 3 0
makeanti B_c1- B_c1+
#
# the 1^3P_0 multiplet
#
create ThePEG::ParticleData a'_0+
setup a'_0+ 10211 a'_0+ 1.474 0.265 0.265 0 3 0 1 0
create ThePEG::ParticleData a'_00
setup a'_00 10111 a'_00 1.474 0.265 0.265 0 0 0 1 0
create ThePEG::ParticleData a'_0-
setup a'_0- -10211 a'_0- 1.474 0.265 0.265 0 -3 0 1 0
makeanti a'_0- a'_0+
create ThePEG::ParticleData f'_0
setup f'_0 10221 f'_0 1.395 0.275 0.275 0 0 0 1 0
create ThePEG::ParticleData f_0(1710)
setup f_0(1710) 10331 f_0(1710) 1.718 0.137 0.411 0 0 0 1 0
create ThePEG::ParticleData chi_c0
setup chi_c0 10441 chi_c0 3.41476 0.0104 0.104 0 0 0 1 0
create ThePEG::ParticleData chi_b0
setup chi_b0 10551 chi_b0 9.85944 0.000817 0.00817 0 0 0 1 0
create ThePEG::ParticleData K*_0+
setup K*_0+ 10321 K*_0+ 1.414 0.29 0.82 0 3 0 1 0
set K*_0+:WidthLoCut 0.77
set K*_0+:WidthUpCut 0.87
create ThePEG::ParticleData K*_00
setup K*_00 10311 K*_00 1.414 0.29 0.82 0 0 0 1 0
set K*_00:WidthLoCut 0.77
set K*_00:WidthUpCut 0.87
create ThePEG::ParticleData K*_0-
setup K*_0- -10321 K*_0- 1.414 0.29 0.82 0 -3 0 1 0
makeanti K*_0- K*_0+
set K*_0-:WidthLoCut 0.77
set K*_0-:WidthUpCut 0.87
create ThePEG::ParticleData K*_0bar0
setup K*_0bar0 -10311 K*_0bar0 1.414 0.29 0.82 0 0 0 1 0
makeanti K*_0bar0 K*_00
set K*_0bar0:WidthLoCut 0.77
set K*_0bar0:WidthUpCut 0.87
create ThePEG::ParticleData D_0*+
setup D_0*+ 10411 D_0*+ 2.369 0.274 0.548 0 3 0 1 0
set D_0*+:WidthLoCut 0.274
set D_0*+:WidthUpCut 0.822
create ThePEG::ParticleData D_0*0
setup D_0*0 10421 D_0*0 2.369 0.274 0.548 0 0 0 1 0
set D_0*0:WidthLoCut 0.274
set D_0*0:WidthUpCut 0.822
create ThePEG::ParticleData D_0*-
setup D_0*- -10411 D_0*- 2.369 0.274 0.548 0 -3 0 1 0
makeanti D_0*- D_0*+
set D_0*-:WidthLoCut 0.274
set D_0*-:WidthUpCut 0.822
create ThePEG::ParticleData D_0*bar0
setup D_0*bar0 -10421 D_0*bar0 2.369 0.274 0.548 0 0 0 1 0
makeanti D_0*bar0 D_0*0
set D_0*bar0:WidthLoCut 0.274
set D_0*bar0:WidthUpCut 0.822
create ThePEG::ParticleData D_s0+
setup D_s0+ 10431 D_s0+ 2.3173 2.32E-5 0.000232 0 3 0 1 0
create ThePEG::ParticleData D_s0-
setup D_s0- -10431 D_s0- 2.3173 2.32E-5 0.000232 0 -3 0 1 0
makeanti D_s0- D_s0+
create ThePEG::ParticleData B*_00
setup B*_00 10511 B*_00 5.726 0.14 0.28 0 0 0 1 0
create ThePEG::ParticleData B*_0+
setup B*_0+ 10521 B*_0+ 5.726 0.14 0.28 0 3 0 1 0
create ThePEG::ParticleData B*_0bar0
setup B*_0bar0 -10511 B*_0bar0 5.726 0.14 0.28 0 0 0 1 0
makeanti B*_0bar0 B*_00
create ThePEG::ParticleData B*_0-
setup B*_0- -10521 B*_0- 5.726 0.14 0.28 0 -3 0 1 0
makeanti B*_0- B*_0+
create ThePEG::ParticleData B*_s00
setup B*_s00 10531 B*_s00 5.818 0.07 0.0875 0 0 0 1 0
set B*_s00:WidthLoCut 0.035
set B*_s00:WidthUpCut 0.14
create ThePEG::ParticleData B*_s0bar0
setup B*_s0bar0 -10531 B*_s0bar0 5.818 0.07 0.0875 0 0 0 1 0
makeanti B*_s0bar0 B*_s00
set B*_s0bar0:WidthLoCut 0.035
set B*_s0bar0:WidthUpCut 0.14
create ThePEG::ParticleData B*_c0+
setup B*_c0+ 10541 B*_c0+ 6.727 5.5E-5 0.00055 0 3 0 1 0
create ThePEG::ParticleData B*_c0-
setup B*_c0- -10541 B*_c0- 6.727 5.5E-5 0.00055 0 -3 0 1 0
makeanti B*_c0- B*_c0+
#
# the 1^3P_1 multiplet
#
create ThePEG::ParticleData a_1+
setup a_1+ 20213 a_1+ 1.24 0.56 0.56 0 3 0 3 0
set a_1+:VariableRatio 1
create ThePEG::ParticleData a_10
setup a_10 20113 a_10 1.24 0.56 0.56 0 0 0 3 0
set a_10:VariableRatio 1
create ThePEG::ParticleData a_1-
setup a_1- -20213 a_1- 1.24 0.56 0.56 0 -3 0 3 0
makeanti a_1- a_1+
set a_1-:VariableRatio 1
create ThePEG::ParticleData f_1
setup f_1 20223 f_1 1.2818 0.0242 0.242 0 0 0 3 0
create ThePEG::ParticleData f'_1
setup f'_1 20333 f'_1 1.4263 0.0549 0.41175 0 0 0 3 0
set f'_1:WidthLoCut 0.2745
set f'_1:WidthUpCut 0.549
create ThePEG::ParticleData chi_c1
setup chi_c1 20443 chi_c1 3.51066 0.00089 0.0089 0 0 0 3 0
create ThePEG::ParticleData chi_b1
setup chi_b1 20553 chi_b1 9.89278 7.1E-5 0.00071 0 0 0 3 0
create ThePEG::ParticleData K'_1+
setup K'_1+ 20323 K'_1+ 1.402 0.174 0.348 0 3 0 3 0
set K'_1+:VariableRatio 1
create ThePEG::ParticleData K'_10
setup K'_10 20313 K'_10 1.402 0.174 0.348 0 0 0 3 0
set K'_10:VariableRatio 1
create ThePEG::ParticleData K'_1-
setup K'_1- -20323 K'_1- 1.402 0.174 0.348 0 -3 0 3 0
makeanti K'_1- K'_1+
set K'_1-:VariableRatio 1
create ThePEG::ParticleData K'_1bar0
setup K'_1bar0 -20313 K'_1bar0 1.402 0.174 0.348 0 0 0 3 0
makeanti K'_1bar0 K'_10
set K'_1bar0:VariableRatio 1
create ThePEG::ParticleData D'_10
setup D'_10 20423 D'_10 2.438 0.329 0.454 0 0 0 3 0
set D'_10:WidthLoCut 0.25
set D'_10:WidthUpCut 0.658
create ThePEG::ParticleData D'_1+
setup D'_1+ 20413 D'_1+ 2.438 0.329 0.454 0 3 0 3 0
set D'_1+:WidthLoCut 0.25
set D'_1+:WidthUpCut 0.658
create ThePEG::ParticleData D'_1bar0
setup D'_1bar0 -20423 D'_1bar0 2.438 0.329 0.454 0 0 0 3 0
makeanti D'_1bar0 D'_10
set D'_1bar0:WidthLoCut 0.25
set D'_1bar0:WidthUpCut 0.658
create ThePEG::ParticleData D'_1-
setup D'_1- -20413 D'_1- 2.438 0.329 0.454 0 -3 0 3 0
makeanti D'_1- D'_1+
set D'_1-:WidthLoCut 0.25
set D'_1-:WidthUpCut 0.658
create ThePEG::ParticleData D'_s1+
setup D'_s1+ 20433 D'_s1+ 2.53535 0.0013 0.013 0 3 0 3 0
create ThePEG::ParticleData D'_s1-
setup D'_s1- -20433 D'_s1- 2.53535 0.0013 0.013 0 -3 0 3 0
makeanti D'_s1- D'_s1+
create ThePEG::ParticleData B'_10
setup B'_10 20513 B'_10 5.762 0.13 0.26 0 0 0 3 0
create ThePEG::ParticleData B'_1+
setup B'_1+ 20523 B'_1+ 5.762 0.13 0.26 0 3 0 3 0
create ThePEG::ParticleData B'_1bar0
setup B'_1bar0 -20513 B'_1bar0 5.762 0.13 0.26 0 0 0 3 0
makeanti B'_1bar0 B'_10
create ThePEG::ParticleData B'_1-
setup B'_1- -20523 B'_1- 5.762 0.13 0.26 0 -3 0 3 0
makeanti B'_1- B'_1+
create ThePEG::ParticleData B'_s10
setup B'_s10 20533 B'_s10 5.856 0.06 0.075 0 0 0 3 0
set B'_s10:WidthLoCut 0.03
set B'_s10:WidthUpCut 0.12
create ThePEG::ParticleData B'_s1bar0
setup B'_s1bar0 -20533 B'_s1bar0 5.856 0.06 0.075 0 0 0 3 0
makeanti B'_s1bar0 B'_s10
set B'_s1bar0:WidthLoCut 0.03
set B'_s1bar0:WidthUpCut 0.12
create ThePEG::ParticleData B'_c1+
setup B'_c1+ 20543 B'_c1+ 6.765 9.1E-5 0.00091 0 3 0 3 0
create ThePEG::ParticleData B'_c1-
setup B'_c1- -20543 B'_c1- 6.765 9.1E-5 0.00091 0 -3 0 3 0
makeanti B'_c1- B'_c1+
#
# the 1^3P_2 multiplet
#
create ThePEG::ParticleData a_2+
setup a_2+ 215 a_2+ 1.3183 0.107 0.214 0 3 0 5 0
create ThePEG::ParticleData a_20
setup a_20 115 a_20 1.3183 0.107 0.214 0 0 0 5 0
create ThePEG::ParticleData a_2-
setup a_2- -215 a_2- 1.3183 0.107 0.214 0 -3 0 5 0
makeanti a_2- a_2+
create ThePEG::ParticleData f_2
setup f_2 225 f_2 1.2754 0.1852 0.1801 0 0 0 5 0
set f_2:WidthLoCut 0.175
set f_2:WidthUpCut 0.1852
create ThePEG::ParticleData f'_2
setup f'_2 335 f'_2 1.525 0.073 0.365 0 0 0 5 0
create ThePEG::ParticleData chi_c2
setup chi_c2 445 chi_c2 3.5562 0.00206 0.0206 0 0 0 5 0
create ThePEG::ParticleData chi_b2
setup chi_b2 555 chi_b2 9.91221 0.00017 0.0017 0 0 0 5 0
create ThePEG::ParticleData K*_2+
setup K*_2+ 325 K*_2+ 1.4256 0.0985 0.197 0 3 0 5 0
create ThePEG::ParticleData K*_20
setup K*_20 315 K*_20 1.4324 0.109 0.218 0 0 0 5 0
create ThePEG::ParticleData K*_2-
setup K*_2- -325 K*_2- 1.4256 0.0985 0.197 0 -3 0 5 0
makeanti K*_2- K*_2+
create ThePEG::ParticleData K*_2bar0
setup K*_2bar0 -315 K*_2bar0 1.4324 0.109 0.218 0 0 0 5 0
makeanti K*_2bar0 K*_20
create ThePEG::ParticleData D*_20
setup D*_20 425 D*_20 2.4611 0.043 0.215 0 0 0 5 0
create ThePEG::ParticleData D*_2+
setup D*_2+ 415 D*_2+ 2.459 0.029 0.29 0 3 0 5 0
create ThePEG::ParticleData D*_2bar0
setup D*_2bar0 -425 D*_2bar0 2.4611 0.043 0.215 0 0 0 5 0
makeanti D*_2bar0 D*_20
create ThePEG::ParticleData D*_2-
setup D*_2- -415 D*_2- 2.459 0.029 0.29 0 -3 0 5 0
makeanti D*_2- D*_2+
create ThePEG::ParticleData D_s2+
setup D_s2+ 435 D_s2+ 2.5735 0.015 0.105 0 3 0 5 0
set D_s2+:WidthLoCut 0.06
set D_s2+:WidthUpCut 0.15
create ThePEG::ParticleData D_s2-
setup D_s2- -435 D_s2- 2.5735 0.015 0.105 0 -3 0 5 0
makeanti D_s2- D_s2+
set D_s2-:WidthLoCut 0.06
set D_s2-:WidthUpCut 0.15
create ThePEG::ParticleData B_20
setup B_20 515 B_20 5.7468 0.01 0.1 0 0 0 5 0
create ThePEG::ParticleData B_2+
setup B_2+ 525 B_2+ 5.7468 0.01 0.1 0 3 0 5 0
create ThePEG::ParticleData B_2bar0
setup B_2bar0 -515 B_2bar0 5.7468 0.01 0.1 0 0 0 5 0
makeanti B_2bar0 B_20
create ThePEG::ParticleData B_2-
setup B_2- -525 B_2- 5.7468 0.01 0.1 0 -3 0 5 0
makeanti B_2- B_2+
create ThePEG::ParticleData B_s20
setup B_s20 535 B_s20 5.8396 0.0007 0.007 0 0 0 5 0
create ThePEG::ParticleData B_s2bar0
setup B_s2bar0 -535 B_s2bar0 5.8396 0.0007 0.007 0 0 0 5 0
makeanti B_s2bar0 B_s20
create ThePEG::ParticleData B_c2+
setup B_c2+ 545 B_c2+ 6.783 8.3E-5 0.00083 0 3 0 5 0
create ThePEG::ParticleData B_c2-
setup B_c2- -545 B_c2- 6.783 8.3E-5 0.00083 0 -3 0 5 0
makeanti B_c2- B_c2+
#
# the 1^1D_2 multiplet
#
create ThePEG::ParticleData pi_2+
setup pi_2+ 10215 pi_2+ 1.6724 0.259 0.259 0 3 0 5 0
create ThePEG::ParticleData pi_20
setup pi_20 10115 pi_20 1.6724 0.259 0.259 0 0 0 5 0
create ThePEG::ParticleData pi_2-
setup pi_2- -10215 pi_2- 1.6724 0.259 0.259 0 -3 0 5 0
makeanti pi_2- pi_2+
create ThePEG::ParticleData eta_2
setup eta_2 10225 eta_2 1.617 0.181 0.362 0 0 0 5 0
create ThePEG::ParticleData eta'_2
setup eta'_2 10335 eta'_2 1.842 0.225 0.225 0 0 0 5 0
create ThePEG::ParticleData eta_b2
setup eta_b2 10555 eta_b2 10.158 3.2E-5 0.00032 0 0 0 5 0
create ThePEG::ParticleData K_2(1770)+
setup K_2(1770)+ 10325 K_2(1770)+ 1.773 0.186 0.558 0 3 0 5 0
create ThePEG::ParticleData K_2(1770)0
setup K_2(1770)0 10315 K_2(1770)0 1.773 0.186 0.558 0 0 0 5 0
create ThePEG::ParticleData K_2(1770)-
setup K_2(1770)- -10325 K_2(1770)- 1.773 0.186 0.558 0 -3 0 5 0
makeanti K_2(1770)- K_2(1770)+
create ThePEG::ParticleData K_2(1770)bar0
setup K_2(1770)bar0 -10315 K_2(1770)bar0 1.773 0.186 0.558 0 0 0 5 0
makeanti K_2(1770)bar0 K_2(1770)0
#
# the 1^3D_1 multiplet
#
create ThePEG::ParticleData rho''+
setup rho''+ 30213 rho''+ 1.72 0.25 0.5 0 3 0 3 0
create ThePEG::ParticleData rho''0
setup rho''0 30113 rho''0 1.72 0.25 0.5 0 0 0 3 0
create ThePEG::ParticleData rho''-
setup rho''- -30213 rho''- 1.72 0.25 0.5 0 -3 0 3 0
makeanti rho''- rho''+
create ThePEG::ParticleData omega''
setup omega'' 30223 omega'' 1.67 0.315 0.63 0 0 0 3 0
create ThePEG::ParticleData psi(3770)
setup psi(3770) 30443 psi(3770) 3.7711 0.023 0.1305 0 0 0 3 0
set psi(3770):WidthLoCut 0.031
set psi(3770):WidthUpCut 0.23
create ThePEG::ParticleData Upsilon_1(1D)
setup Upsilon_1(1D) 30553 Upsilon_1(1D) 10.1551 3.56E-5 0.000356 0 0 0 3 0
create ThePEG::ParticleData K''*+
setup K''*+ 30323 K''*+ 1.717 0.322 0.322 0 3 0 3 0
create ThePEG::ParticleData K''*0
setup K''*0 30313 K''*0 1.717 0.322 0.322 0 0 0 3 0
create ThePEG::ParticleData K''*-
setup K''*- -30323 K''*- 1.717 0.322 0.322 0 -3 0 3 0
makeanti K''*- K''*+
create ThePEG::ParticleData K''*bar0
setup K''*bar0 -30313 K''*bar0 1.717 0.322 0.322 0 0 0 3 0
makeanti K''*bar0 K''*0
#
# the 1^3D_2 multiplet
#
create ThePEG::ParticleData Upsilon_2(1D)
setup Upsilon_2(1D) 20555 Upsilon_2(1D) 10.1611 2.8E-5 0.00028 0 0 0 5 0
create ThePEG::ParticleData K_2(1820)+
setup K_2(1820)+ 20325 K_2(1820)+ 1.816 0.276 0.552 0 3 0 5 0
create ThePEG::ParticleData K_2(1820)0
setup K_2(1820)0 20315 K_2(1820)0 1.816 0.276 0.552 0 0 0 5 0
create ThePEG::ParticleData K_2(1820)-
setup K_2(1820)- -20325 K_2(1820)- 1.816 0.276 0.552 0 -3 0 5 0
makeanti K_2(1820)- K_2(1820)+
create ThePEG::ParticleData K_2(1820)bar0
setup K_2(1820)bar0 -20315 K_2(1820)bar0 1.816 0.276 0.552 0 0 0 5 0
makeanti K_2(1820)bar0 K_2(1820)0
#
# the 1^3D_3 multiplet
#
create ThePEG::ParticleData rho_3+
setup rho_3+ 217 rho_3+ 1.6888 0.161 0.592 0 3 0 7 0
set rho_3+:WidthLoCut 0.54
set rho_3+:WidthUpCut 0.644
create ThePEG::ParticleData rho_30
setup rho_30 117 rho_30 1.6888 0.161 0.592 0 0 0 7 0
set rho_30:WidthLoCut 0.54
set rho_30:WidthUpCut 0.644
create ThePEG::ParticleData rho_3-
setup rho_3- -217 rho_3- 1.6888 0.161 0.592 0 -3 0 7 0
makeanti rho_3- rho_3+
set rho_3-:WidthLoCut 0.54
set rho_3-:WidthUpCut 0.644
create ThePEG::ParticleData omega_3
setup omega_3 227 omega_3 1.667 0.168 0.336 0 0 0 7 0
create ThePEG::ParticleData phi_3
setup phi_3 337 phi_3 1.854 0.087 0.435 0 0 0 7 0
create ThePEG::ParticleData Upsilon_3(1D)
setup Upsilon_3(1D) 557 Upsilon_3(1D) 10.1651 2.55E-5 0.000255 0 0 0 7 0
create ThePEG::ParticleData K_3*+
setup K_3*+ 327 K_3*+ 1.776 0.159 0.477 0 3 0 7 0
create ThePEG::ParticleData K_3*0
setup K_3*0 317 K_3*0 1.776 0.159 0.477 0 0 0 7 0
create ThePEG::ParticleData K_3*-
setup K_3*- -327 K_3*- 1.776 0.159 0.477 0 -3 0 7 0
makeanti K_3*- K_3*+
create ThePEG::ParticleData K_3*bar0
setup K_3*bar0 -317 K_3*bar0 1.776 0.159 0.477 0 0 0 7 0
makeanti K_3*bar0 K_3*0
#
# the 1^3F_4 multiplet
#
#
# the 2^1S_0 multiplet
#
create ThePEG::ParticleData pi'+
setup pi'+ 100211 pi'+ 1.3 0.4 0.4 0 3 0 1 0
create ThePEG::ParticleData pi'0
setup pi'0 100111 pi'0 1.3 0.4 0.4 0 0 0 1 0
create ThePEG::ParticleData pi'-
setup pi'- -100211 pi'- 1.3 0.4 0.4 0 -3 0 1 0
makeanti pi'- pi'+
create ThePEG::ParticleData eta(1295)
setup eta(1295) 100221 eta(1295) 1.294 0.055 0.395 0 0 0 1 0
set eta(1295):WidthLoCut 0.24
set eta(1295):WidthUpCut 0.55
create ThePEG::ParticleData eta(1475)
setup eta(1475) 100331 eta(1475) 1.476 0.087 0.174 0 0 0 1 0
create ThePEG::ParticleData eta_c(2S)
setup eta_c(2S) 100441 eta_c(2S) 3.638 0.014 0.14 0 0 0 1 0
create ThePEG::ParticleData eta_b(2S)
setup eta_b(2S) 100551 eta_b(2S) 9.996 0.0041 0.041 0 0 0 1 0
create ThePEG::ParticleData K'+
setup K'+ 100321 K'+ 1.46 0.26 0.26 0 3 0 1 0
create ThePEG::ParticleData K'0
setup K'0 100311 K'0 1.46 0.26 0.26 0 0 0 1 0
create ThePEG::ParticleData K'-
setup K'- -100321 K'- 1.46 0.26 0.26 0 -3 0 1 0
makeanti K'- K'+
create ThePEG::ParticleData K'bar0
setup K'bar0 -100311 K'bar0 1.46 0.26 0.26 0 0 0 1 0
makeanti K'bar0 K'0
#
# the 2^3S_1 multiplet
#
create ThePEG::ParticleData rho'+
setup rho'+ 100213 rho'+ 1.459 0.147 0.294 0 3 0 3 0
create ThePEG::ParticleData rho'0
setup rho'0 100113 rho'0 1.459 0.147 0.294 0 0 0 3 0
create ThePEG::ParticleData rho'-
setup rho'- -100213 rho'- 1.459 0.147 0.294 0 -3 0 3 0
makeanti rho'- rho'+
create ThePEG::ParticleData omega'
setup omega' 100223 omega' 1.425 0.215 0.3225 0 0 0 3 0
set omega':WidthLoCut 0.215
set omega':WidthUpCut 0.43
create ThePEG::ParticleData phi'
setup phi' 100333 phi' 1.68 0.15 0.3 0 0 0 3 0
create ThePEG::ParticleData psi(2S)
setup psi(2S) 100443 psi(2S) 3.686093 0.000337 0.00337 0 0 0 3 0
create ThePEG::ParticleData Upsilon(2S)
setup Upsilon(2S) 100553 Upsilon(2S) 10.02326 3.198E-5 0.0003198 0 0 0 3 0
create ThePEG::ParticleData K'*+
setup K'*+ 100323 K'*+ 1.414 0.232 0.464 0 3 0 3 0
create ThePEG::ParticleData K'*0
setup K'*0 100313 K'*0 1.414 0.232 0.464 0 0 0 3 0
create ThePEG::ParticleData K'*-
setup K'*- -100323 K'*- 1.414 0.232 0.464 0 -3 0 3 0
makeanti K'*- K'*+
create ThePEG::ParticleData K'*bar0
setup K'*bar0 -100313 K'*bar0 1.414 0.232 0.464 0 0 0 3 0
makeanti K'*bar0 K'*0
#
# the 2^1P_1 multiplet
#
create ThePEG::ParticleData h_b(2P)
setup h_b(2P) 110553 h_b(2P) 10.258 8.0E-5 0.0008 0 0 0 3 0
#
# the 2^3P_0 multiplet
#
create ThePEG::ParticleData chi_b0(2P)
setup chi_b0(2P) 110551 chi_b0(2P) 10.2325 0.000887 0.00887 0 0 0 1 0
#
# the 2^3P_1 multiplet
#
create ThePEG::ParticleData chi_b1(2P)
setup chi_b1(2P) 120553 chi_b1(2P) 10.25546 7.87E-5 0.000787 0 0 0 3 0
#
# the 2^3P_2 multiplet
#
create ThePEG::ParticleData chi_c2(2P)
setup chi_c2(2P) 100445 chi_c2(2P) 3.929 0.029 0.29 0 0 0 5 0
create ThePEG::ParticleData chi_b2(2P)
setup chi_b2(2P) 100555 chi_b2(2P) 10.26865 0.0001847 0.001847 0 0 0 5 0
#
# the 2^1D_2 multiplet
#
#
# the 2^3D_1 multiplet
#
create ThePEG::ParticleData Upsilon_1(2D)
setup Upsilon_1(2D) 130553 Upsilon_1(2D) 10.435 2.64E-5 0.000264 0 0 0 3 0
#
# the 2^3D_2 multiplet
#
create ThePEG::ParticleData Upsilon_2(2D)
setup Upsilon_2(2D) 120555 Upsilon_2(2D) 10.441 2.23E-5 0.000223 0 0 0 5 0
#
# the 2^3D_3 multiplet
#
create ThePEG::ParticleData Upsilon_3(2D)
setup Upsilon_3(2D) 100557 Upsilon_3(2D) 10.444 2.02E-5 0.000202 0 0 0 7 0
#
# the 3^1S_0 multiplet
#
create ThePEG::ParticleData eta_b(3S)
setup eta_b(3S) 200551 eta_b(3S) 10.337 0.0027 0.027 0 0 0 1 0
#
# the 3^3S_1 multiplet
#
create ThePEG::ParticleData Upsilon(3S)
setup Upsilon(3S) 200553 Upsilon(3S) 10.3552 2.032E-5 0.0002032 0 0 0 3 0
#
# the 3^1P_1 multiplet
#
#
# the 3^3P_0 multiplet
#
create ThePEG::ParticleData chi_b0(3P)
setup chi_b0(3P) 210551 chi_b0(3P) 10.5007 0.00071 0.0071 0 0 0 1 0
#
# the 3^3P_1 multiplet
#
create ThePEG::ParticleData chi_b1(3P)
setup chi_b1(3P) 220553 chi_b1(3P) 10.516 6.6E-5 0.00066 0 0 0 3 0
#
# the 3^3P_2 multiplet
#
create ThePEG::ParticleData chi_b2(3P)
setup chi_b2(3P) 200555 chi_b2(3P) 10.5264 0.000146 0.00146 0 0 0 5 0
#
# the 4^3S_1 multiplet
#
create ThePEG::ParticleData Upsilon(4S)
setup Upsilon(4S) 300553 Upsilon(4S) 10.5794 0.0205 0.11275 0 0 0 3 0
set Upsilon(4S):WidthLoCut 0.0205
set Upsilon(4S):WidthUpCut 0.205
#
# the 5^3S_1 multiplet
#
#
# The meson which are not part of a multiplet
#
create ThePEG::ParticleData f_0(1500)
setup f_0(1500) 9030221 f_0(1500) 1.507 0.109 0.327 0 0 0 1 0
set f_0(1500):VariableRatio 1
create ThePEG::ParticleData sigma
setup sigma 9000221 sigma 0.86 0.88 1.155 0 0 0 1 0
set sigma:WidthLoCut 0.55
set sigma:WidthUpCut 1.76
create ThePEG::ParticleData f_0
setup f_0 9010221 f_0 0.965 0.1635 0.384 0 0 0 1 0
set f_0:VariableRatio 1
set f_0:WidthLoCut 0.256
set f_0:WidthUpCut 0.512
create ThePEG::ParticleData a_00
setup a_00 9000111 a_00 0.999 0.1778 0.4 0 0 0 1 0
set a_00:VariableRatio 1
set a_00:WidthLoCut 0.24
set a_00:WidthUpCut 0.56
create ThePEG::ParticleData a_0+
setup a_0+ 9000211 a_0+ 0.999 0.1778 0.4 0 3 0 1 0
set a_0+:VariableRatio 1
set a_0+:WidthLoCut 0.24
set a_0+:WidthUpCut 0.56
create ThePEG::ParticleData a_0-
setup a_0- -9000211 a_0- 0.999 0.1778 0.4 0 -3 0 1 0
makeanti a_0- a_0+
set a_0-:VariableRatio 1
set a_0-:WidthLoCut 0.24
set a_0-:WidthUpCut 0.56
create ThePEG::ParticleData eta(1405)
setup eta(1405) 9020221 eta(1405) 1.4098 0.0511 0.38325 0 0 0 1 0
set eta(1405):WidthLoCut 0.2555
set eta(1405):WidthUpCut 0.511
create ThePEG::ParticleData K_S0
setup K_S0 310 K_S0 0.497648 7.3514250055883E-15 0 26.842 0 0 1 0
create ThePEG::ParticleData K_L0
setup K_L0 130 K_L0 0.497648 1.2871947162427E-17 0 15330 0 0 1 1
create ThePEG::ParticleData kappa0
setup kappa0 9000311 kappa0 0.841 0.618 0.7215 0 0 0 1 0
set kappa0:WidthLoCut 0.207
set kappa0:WidthUpCut 1.236
create ThePEG::ParticleData kappabar0
setup kappabar0 -9000311 kappabar0 0.841 0.618 0.7215 0 0 0 1 0
makeanti kappabar0 kappa0
set kappabar0:WidthLoCut 0.207
set kappabar0:WidthUpCut 1.236
create ThePEG::ParticleData kappa-
setup kappa- -9000321 kappa- 0.841 0.618 0.7215 0 -3 0 1 0
set kappa-:WidthLoCut 0.207
set kappa-:WidthUpCut 1.236
create ThePEG::ParticleData kappa+
setup kappa+ 9000321 kappa+ 0.841 0.618 0.7215 0 3 0 1 0
makeanti kappa+ kappa-
set kappa+:WidthLoCut 0.207
set kappa+:WidthUpCut 1.236

File Metadata

Mime Type
text/x-diff
Expires
Mon, Jan 20, 9:56 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4222930
Default Alt Text
(859 KB)

Event Timeline