Page MenuHomeHEPForge

No OneTemporary

diff --git a/Decay/General/GeneralTwoBodyDecayer.cc b/Decay/General/GeneralTwoBodyDecayer.cc
--- a/Decay/General/GeneralTwoBodyDecayer.cc
+++ b/Decay/General/GeneralTwoBodyDecayer.cc
@@ -1,828 +1,847 @@
// -*- C++ -*-
//
// GeneralTwoBodyDecayer.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2019 The Herwig Collaboration
//
// Herwig is licenced under version 3 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 GeneralTwoBodyDecayer class.
//
#include "GeneralTwoBodyDecayer.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/PDT/DecayMode.h"
#include "ThePEG/Utilities/Exception.h"
#include "Herwig/Shower/RealEmissionProcess.h"
#include "Herwig/Utilities/Kinematics.h"
+#include "Herwig/Shower/QTilde/Dark/HiddenValleyModel.h"
using namespace Herwig;
ParticleVector GeneralTwoBodyDecayer::decay(const Particle & parent,
const tPDVector & children) const {
// return empty vector if products heavier than parent
Energy mout(ZERO);
for(tPDVector::const_iterator it=children.begin();
it!=children.end();++it) mout+=(**it).massMin();
if(mout>parent.mass()) return ParticleVector();
// generate the decay
bool cc;
int imode=modeNumber(cc,parent.dataPtr(),children);
// generate the kinematics
ParticleVector decay=generate(generateIntermediates(),cc,imode,parent);
// make the colour connections
colourConnections(parent, decay);
// return the answer
return decay;
}
void GeneralTwoBodyDecayer::doinit() {
PerturbativeDecayer::doinit();
assert( incoming_ && outgoing_.size()==2);
//create phase space mode
addMode(new_ptr(PhaseSpaceMode(incoming_,{outgoing_[0],outgoing_[1]},
maxWeight_)));
}
int GeneralTwoBodyDecayer::modeNumber(bool & cc, tcPDPtr parent,
const tPDVector & children) const {
long parentID = parent->id();
long id1 = children[0]->id();
long id2 = children[1]->id();
cc = false;
long out1 = outgoing_[0]->id();
long out2 = outgoing_[1]->id();
if( parentID == incoming_->id() &&
((id1 == out1 && id2 == out2) ||
(id1 == out2 && id2 == out1)) ) {
return 0;
}
else if(incoming_->CC() && parentID == incoming_->CC()->id()) {
cc = true;
if( outgoing_[0]->CC()) out1 = outgoing_[0]->CC()->id();
if( outgoing_[1]->CC()) out2 = outgoing_[1]->CC()->id();
if((id1 == out1 && id2 == out2) ||
(id1 == out2 && id2 == out1)) return 0;
}
return -1;
}
void GeneralTwoBodyDecayer::
colourConnections(const Particle & parent,
const ParticleVector & out) const {
PDT::Colour incColour(parent.data().iColour());
PDT::Colour outaColour(out[0]->data().iColour());
PDT::Colour outbColour(out[1]->data().iColour());
//incoming colour singlet
if(incColour == PDT::Colour0) {
// colour triplet-colourantitriplet
if((outaColour == PDT::Colour3 && outbColour == PDT::Colour3bar) ||
(outaColour == PDT::Colour3bar && outbColour == PDT::Colour3)) {
bool ac(out[0]->id() < 0);
out[0]->colourNeighbour(out[1],!ac);
}
//colour octet
else if(outaColour == PDT::Colour8 && outbColour == PDT::Colour8) {
out[0]->colourNeighbour(out[1]);
out[0]->antiColourNeighbour(out[1]);
}
// colour singlets
else if(outaColour == PDT::Colour0 && outbColour == PDT::Colour0) {
}
// unknown
else
throw Exception() << "Unknown outgoing colours for decaying "
<< "colour singlet in "
<< "GeneralTwoBodyDecayer::colourConnections "
<< outaColour << " " << outbColour
<< Exception::runerror;
}
//incoming colour triplet
else if(incColour == PDT::Colour3) {
// colour triplet + singlet
if(outaColour == PDT::Colour3 && outbColour == PDT::Colour0) {
out[0]->incomingColour(const_ptr_cast<tPPtr>(&parent));
}
//opposite order
else if(outaColour == PDT::Colour0 && outbColour == PDT::Colour3) {
out[1]->incomingColour(const_ptr_cast<tPPtr>(&parent));
}
// octet + triplet
else if(outaColour == PDT::Colour8 && outbColour == PDT::Colour3) {
out[0]->incomingColour(const_ptr_cast<tPPtr>(&parent));
out[1]->antiColourNeighbour(out[0]);
}
//opposite order
else if(outaColour == PDT::Colour3 && outbColour == PDT::Colour8) {
out[1]->incomingColour(const_ptr_cast<tPPtr>(&parent));
out[0]->antiColourNeighbour(out[1]);
}
else if(outaColour == PDT::Colour3bar && outaColour == PDT::Colour3bar) {
tColinePtr col[2] = {ColourLine::create(out[0],true),
ColourLine::create(out[1],true)};
parent.colourLine()->setSinkNeighbours(col[0],col[1]);
}
else
throw Exception() << "Unknown outgoing colours for decaying "
<< "colour triplet in "
<< "GeneralTwoBodyDecayer::colourConnections() "
<< outaColour << " " << outbColour
<< Exception::runerror;
}
// incoming colour anti triplet
else if(incColour == PDT::Colour3bar) {
// colour antitriplet +singlet
if(outaColour == PDT::Colour3bar && outbColour == PDT::Colour0) {
out[0]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
}
//opposite order
else if(outaColour == PDT::Colour0 && outbColour == PDT::Colour3bar) {
out[1]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
}
//octet + antitriplet
else if(outaColour == PDT::Colour3bar && outbColour == PDT::Colour8) {
out[1]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
out[0]->colourNeighbour(out[1]);
}
//opposite order
else if(outaColour == PDT::Colour8 && outbColour == PDT::Colour3bar) {
out[0]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
out[1]->colourNeighbour(out[0]);
}
else if(outaColour == PDT::Colour3 && outbColour == PDT::Colour3) {
tColinePtr col[2] = {ColourLine::create(out[0]),
ColourLine::create(out[1])};
parent.antiColourLine()->setSourceNeighbours(col[0],col[1]);
}
else
throw Exception() << "Unknown outgoing colours for decaying "
<< "colour antitriplet "
<< "in GeneralTwoBodyDecayer::colourConnections() "
<< outaColour << " " << outbColour
<< Exception::runerror;
}
//incoming colour octet
else if(incColour == PDT::Colour8) {
// triplet-antitriplet
if(outaColour == PDT::Colour3&&outbColour == PDT::Colour3bar) {
out[0]->incomingColour(const_ptr_cast<tPPtr>(&parent));
out[1]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
}
// opposite order
else if(outbColour == PDT::Colour3&&outaColour == PDT::Colour3bar) {
out[0]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
out[1]->incomingColour(const_ptr_cast<tPPtr>(&parent));
}
// neutral octet
else if(outaColour == PDT::Colour0&&outbColour == PDT::Colour8) {
out[1]->incomingColour(const_ptr_cast<tPPtr>(&parent));
out[1]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
}
else if(outbColour == PDT::Colour0&&outaColour == PDT::Colour8) {
out[0]->incomingColour(const_ptr_cast<tPPtr>(&parent));
out[0]->incomingAntiColour(const_ptr_cast<tPPtr>(&parent));
}
else
throw Exception() << "Unknown outgoing colours for decaying "
<< "colour octet "
<< "in GeneralTwoBodyDecayer::colourConnections() "
<< outaColour << " " << outbColour
<< Exception::runerror;
}
else if(incColour == PDT::Colour6) {
if(outaColour == PDT::Colour3 && outbColour == PDT::Colour3) {
tPPtr tempParent = const_ptr_cast<tPPtr>(&parent);
Ptr<MultiColour>::pointer parentColour =
dynamic_ptr_cast<Ptr<MultiColour>::pointer>
(tempParent->colourInfo());
tColinePtr line1 = const_ptr_cast<tColinePtr>(parentColour->colourLines()[0]);
line1->addColoured(dynamic_ptr_cast<tPPtr>(out[0]));
tColinePtr line2 = const_ptr_cast<tColinePtr>(parentColour->colourLines()[1]);
line2->addColoured(dynamic_ptr_cast<tPPtr>(out[1]));
}
else
throw Exception() << "Unknown outgoing colours for decaying "
<< "colour sextet "
<< "in GeneralTwoBodyDecayer::colourConnections() "
<< outaColour << " " << outbColour
<< Exception::runerror;
}
else if(incColour == PDT::Colour6bar) {
if(outaColour == PDT::Colour3bar && outbColour == PDT::Colour3bar) {
tPPtr tempParent = const_ptr_cast<tPPtr>(&parent);
Ptr<MultiColour>::pointer parentColour =
dynamic_ptr_cast<Ptr<MultiColour>::pointer>
(tempParent->colourInfo());
tColinePtr line1 = const_ptr_cast<tColinePtr>(parentColour->antiColourLines()[0]);
line1->addAntiColoured(dynamic_ptr_cast<tPPtr>(out[0]));
tColinePtr line2 = const_ptr_cast<tColinePtr>(parentColour->antiColourLines()[1]);
line2->addAntiColoured(dynamic_ptr_cast<tPPtr>(out[1]));
}
else
throw Exception() << "Unknown outgoing colours for decaying "
<< "colour anti-sextet "
<< "in GeneralTwoBodyDecayer::colourConnections() "
<< outaColour << " " << outbColour
<< Exception::runerror;
}
else
throw Exception() << "Unknown incoming colour in "
<< "GeneralTwoBodyDecayer::colourConnections() "
<< incColour
<< Exception::runerror;
}
bool GeneralTwoBodyDecayer::twoBodyMEcode(const DecayMode & dm, int & mecode,
double & coupling) const {
assert(dm.parent()->id() == incoming_->id());
ParticleMSet::const_iterator pit = dm.products().begin();
long id1 = (*pit)->id();
++pit;
long id2 = (*pit)->id();
long id1t(outgoing_[0]->id()), id2t(outgoing_[1]->id());
mecode = -1;
coupling = 1.;
if( id1 == id1t && id2 == id2t ) {
return true;
}
else if( id1 == id2t && id2 == id1t ) {
return false;
}
else
assert(false);
return false;
}
void GeneralTwoBodyDecayer::persistentOutput(PersistentOStream & os) const {
os << incoming_ << outgoing_ << maxWeight_;
}
void GeneralTwoBodyDecayer::persistentInput(PersistentIStream & is, int) {
is >> incoming_ >> outgoing_ >> maxWeight_;
}
// The following static variable is needed for the type
// description system in ThePEG.
DescribeAbstractClass<GeneralTwoBodyDecayer,PerturbativeDecayer>
describeHerwigGeneralTwoBodyDecayer("Herwig::GeneralTwoBodyDecayer", "Herwig.so");
-void GeneralTwoBodyDecayer::Init() {
+void GeneralTwoBodyDecayer::Init(else if((out1->iColour()==PDT::DarkColourFundamental && out2->iColour()==PDT::DarkColourAntiFundamental) ||
++ (out1->iColour()==PDT::DarkColourAntiFundamental && out2->iColour()==PDT::DarkColourFundamental)) {
++ if(generator()){
++ auto model = generator()->standardModel();
++ if(model) {
++ output *= model->NcDark();
++ }
++ }
++ }
+) {
static ClassDocumentation<GeneralTwoBodyDecayer> documentation
("This class is designed to be a base class for all 2 body decays"
"in a general model");
}
double GeneralTwoBodyDecayer::brat(const DecayMode &, const Particle & p,
double oldbrat) const {
ParticleVector children = p.children();
if( children.size() != 2 || !p.data().widthGenerator() )
return oldbrat;
// partial width for this mode
Energy scale = p.mass();
Energy pwidth =
partialWidth( make_pair(p.dataPtr(), scale),
make_pair(children[0]->dataPtr(), children[0]->mass()),
make_pair(children[1]->dataPtr(), children[1]->mass()) );
Energy width = p.data().widthGenerator()->width(p.data(), scale);
return pwidth/width;
}
void GeneralTwoBodyDecayer::doinitrun() {
PerturbativeDecayer::doinitrun();
for(unsigned int ix=0;ix<numberModes();++ix) {
double fact = pow(1.5,int(mode(ix)->incoming().first->iSpin())-1);
mode(ix)->maxWeight(fact*mode(ix)->maxWeight());
}
}
double GeneralTwoBodyDecayer::colourFactor(tcPDPtr in, tcPDPtr out1,
tcPDPtr out2) const {
// identical particle symmetry factor
double output = out1->id()==out2->id() ? 0.5 : 1.;
// colour neutral incoming particle
if(in->iColour()==PDT::Colour0) {
// both colour neutral
if(out1->iColour()==PDT::Colour0 && out2->iColour()==PDT::Colour0)
output *= 1.;
// colour triplet/ antitriplet
else if((out1->iColour()==PDT::Colour3 && out2->iColour()==PDT::Colour3bar) ||
(out1->iColour()==PDT::Colour3bar && out2->iColour()==PDT::Colour3 ) ) {
output *= 3.;
}
// colour octet colour octet
else if(out1->iColour()==PDT::Colour8 && out2->iColour()==PDT::Colour8 ) {
output *= 8.;
}
+ else if((out1->iColour()==PDT::DarkColourFundamental
+ && out2->iColour()==PDT::DarkColourAntiFundamental) ||
+ (out1->iColour()==PDT::DarkColourAntiFundamental
+ && out2->iColour()==PDT::DarkColourFundamental)) {
+ throw Exception() << "The GeneralTwoBodyDecayer cannot yet handle "
+ << "decays to dark coloured particles. Please include these "
+ << "decays in the hard process"
+ << Exception::runerror;
+ }
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour neutral particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
}
// triplet
else if(in->iColour()==PDT::Colour3) {
// colour triplet + neutral
if((out1->iColour()==PDT::Colour0 && out2->iColour()==PDT::Colour3) ||
(out1->iColour()==PDT::Colour3 && out2->iColour()==PDT::Colour0) ) {
output *= 1.;
}
// colour triplet + octet
else if((out1->iColour()==PDT::Colour8 && out2->iColour()==PDT::Colour3) ||
(out1->iColour()==PDT::Colour3 && out2->iColour()==PDT::Colour8) ) {
output *= 4./3.;
}
// colour anti triplet anti triplet
else if(out1->iColour()==PDT::Colour3bar &&
out2->iColour()==PDT::Colour3bar) {
output *= 2.;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour triplet particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
}
// anti triplet
else if(in->iColour()==PDT::Colour3bar) {
// colour anti triplet + neutral
if((out1->iColour()==PDT::Colour0 && out2->iColour()==PDT::Colour3bar ) ||
(out1->iColour()==PDT::Colour3bar && out2->iColour()==PDT::Colour0 ) ) {
output *= 1.;
}
// colour anti triplet + octet
else if((out1->iColour()==PDT::Colour8 && out2->iColour()==PDT::Colour3bar ) ||
(out1->iColour()==PDT::Colour3bar && out2->iColour()==PDT::Colour8 ) ) {
output *= 4./3.;
}
// colour triplet triplet
else if(out1->iColour()==PDT::Colour3 &&
out2->iColour()==PDT::Colour3) {
output *= 2.;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour anti triplet particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
}
else if(in->iColour()==PDT::Colour8) {
// colour octet + neutral
if((out1->iColour()==PDT::Colour0 && out2->iColour()==PDT::Colour8 ) ||
(out1->iColour()==PDT::Colour8 && out2->iColour()==PDT::Colour0 ) ) {
output *= 1.;
}
// colour triplet/antitriplet
else if((out1->iColour()==PDT::Colour3 && out2->iColour()==PDT::Colour3bar) ||
(out1->iColour()==PDT::Colour3bar && out2->iColour()==PDT::Colour3 ) ) {
output *= 0.5;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour octet particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
}
else if(in->iColour()==PDT::Colour6) {
// colour sextet -> triplet triplet
if( out1->iColour()==PDT::Colour3 && out2->iColour()==PDT::Colour3 ) {
output *= 1.;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour sextet particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
}
else if(in->iColour()==PDT::Colour6bar) {
// colour sextet -> triplet triplet
if( out1->iColour()==PDT::Colour3bar && out2->iColour()==PDT::Colour3bar ) {
output *= 1.;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour anti-sextet particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
}
else
throw Exception() << "Unknown colour "
<< in->iColour() << " for the decaying particle in "
<< "GeneralTwoBodyDecayer::colourFactor() for "
<< in->PDGName() << " -> "
<< out1->PDGName() << " " << out2->PDGName()
<< Exception::runerror;
return output;
}
Energy GeneralTwoBodyDecayer::partialWidth(PMPair inpart, PMPair outa,
PMPair outb) const {
// select the number of the mode
tPDVector children;
children.push_back(const_ptr_cast<PDPtr>(outa.first));
children.push_back(const_ptr_cast<PDPtr>(outb.first));
bool cc;
int nmode=modeNumber(cc,inpart.first,children);
tcPDPtr newchild[2] = {mode(nmode)->outgoing()[0],
mode(nmode)->outgoing()[1]};
// make the particles
Lorentz5Momentum pparent = Lorentz5Momentum(inpart.second);
PPtr parent = inpart.first->produceParticle(pparent);
vector<Lorentz5Momentum> pout(2);
double ctheta,phi;
Kinematics::generateAngles(ctheta,phi);
Kinematics::twoBodyDecay(pparent, outa.second, outb.second,
ctheta, phi,pout[0],pout[1]);
if( ( !cc && outa.first!=newchild[0]) ||
( cc && !(( outa.first->CC() && outa.first->CC() == newchild[0])||
( !outa.first->CC() && outa.first == newchild[0]) )))
swap(pout[0],pout[1]);
tPDVector out = {const_ptr_cast<tPDPtr>(outa.first),
const_ptr_cast<tPDPtr>(outb.first)};
double me = me2(-1,*parent,out,pout,Initialize);
Energy pcm = Kinematics::pstarTwoBodyDecay(inpart.second,
outa.second, outb.second);
return me/(8.*Constants::pi)*pcm;
}
void GeneralTwoBodyDecayer::decayInfo(PDPtr incoming, PDPair outgoing) {
incoming_=incoming;
outgoing_.clear();
outgoing_.push_back(outgoing.first );
outgoing_.push_back(outgoing.second);
}
double GeneralTwoBodyDecayer::matrixElementRatio(const Particle & inpart,
const ParticleVector & decay2,
const ParticleVector & decay3,
MEOption meopt,
ShowerInteraction inter) {
// calculate R/B
tPDVector outgoing = {const_ptr_cast<tPDPtr>(decay2[0]->dataPtr()),
const_ptr_cast<tPDPtr>(decay2[1]->dataPtr())};
const vector<Lorentz5Momentum> mom = {decay2[0]->momentum(),
decay2[1]->momentum()};
double B = me2 (0, inpart, outgoing,mom, meopt);
double R = threeBodyME(0, inpart, decay3, inter, meopt);
return R/B;
}
const vector<DVector> & GeneralTwoBodyDecayer::getColourFactors(const Particle & inpart,
const ParticleVector & decay,
unsigned int & nflow) {
// calculate the colour factors for the three-body decay
vector<int> sing,trip,atrip,oct,sex,asex;
for(unsigned int it=0;it<decay.size();++it) {
if (decay[it]->dataPtr()->iColour() == PDT::Colour0 ) sing. push_back(it);
else if(decay[it]->dataPtr()->iColour() == PDT::Colour3 ) trip. push_back(it);
else if(decay[it]->dataPtr()->iColour() == PDT::Colour3bar ) atrip.push_back(it);
else if(decay[it]->dataPtr()->iColour() == PDT::Colour8 ) oct. push_back(it);
else if(decay[it]->dataPtr()->iColour() == PDT::Colour6 ) sex. push_back(it);
else if(decay[it]->dataPtr()->iColour() == PDT::Colour6bar ) asex. push_back(it);
}
// identical particle symmetry factor
double symFactor=1.;
if (( sing.size()==2 && decay[ sing[0]]->id()==decay[ sing[1]]->id()) ||
( trip.size()==2 && decay[ trip[0]]->id()==decay[ trip[1]]->id()) ||
(atrip.size()==2 && decay[atrip[0]]->id()==decay[atrip[1]]->id()) ||
( oct.size()==2 && decay[ oct[0]]->id()==decay[ oct[1]]->id()) ||
( sex.size()==2 && decay[ sex[0]]->id()==decay[ sex[1]]->id()) ||
( asex.size()==2 && decay[ asex[0]]->id()==decay[ asex[1]]->id()))
symFactor /= 2.;
else if (oct.size()==3 &&
decay[oct[0]]->id()==decay[oct[1]]->id() &&
decay[oct[0]]->id()==decay[oct[2]]->id())
symFactor /= 6.;
colour_ = vector<DVector>(1,DVector(1,symFactor*1.));
// decaying colour singlet
if(inpart.dataPtr()->iColour() == PDT::Colour0) {
if(trip.size()==1 && atrip.size()==1 && oct.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*4.));
}
else if(trip.size()==1 && atrip.size()==1 && sing.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*3.));
}
else if (oct.size()==3){
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*24.));
}
else if(sing.size()==3) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor));
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour scalar particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
}
// decaying colour triplet
else if(inpart.dataPtr()->iColour() == PDT::Colour3) {
if(trip.size()==1 && sing.size()==1 && oct.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*4./3.));
}
else if(trip.size()==1 && sing.size()==2) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor));
}
else if(trip.size()==1 && oct.size()==2) {
nflow = 2;
colour_.clear();
colour_.resize(2,DVector(2,0.));
colour_[0][0] = symFactor*16./9.; colour_[0][1] = -symFactor*2./9.;
colour_[1][0] = -symFactor*2./9.; colour_[1][1] = symFactor*16./9.;
}
else if(atrip.size()==2 && sing.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*2.));
}
else if(atrip.size()==2 && oct.size()==1) {
nflow = 2;
colour_.clear();
colour_.resize(2,DVector(2,0.));
colour_[0][0] = 8./3.*symFactor; colour_[0][1] =-4./3.*symFactor;
colour_[1][0] = -4./3.*symFactor; colour_[1][1] = 8./3.*symFactor;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour triplet particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
}
// decaying colour anti-triplet
else if(inpart.dataPtr()->iColour() == PDT::Colour3bar) {
if(atrip.size()==1 && sing.size()==1 && oct.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*4./3.));
}
else if(atrip.size()==1 && sing.size()==2) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor));
}
else if(atrip.size()==1 && oct.size()==2){
nflow = 2;
colour_.clear();
colour_ .resize(2,DVector(2,0.));
colour_[0][0] = symFactor*16./9.; colour_[0][1] = -symFactor*2./9.;
colour_[1][0] = -symFactor*2./9.; colour_[1][1] = symFactor*16./9.;
}
else if(trip.size()==2 && sing.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*2.));
}
else if(trip.size()==2 && oct.size()==1) {
nflow = 2;
colour_.clear();
colour_.resize(2,DVector(2,0.));
colour_[0][0] = 8./3.*symFactor; colour_[0][1] =-4./3.*symFactor;
colour_[1][0] = -4./3.*symFactor; colour_[1][1] = 8./3.*symFactor;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for decay colour anti-triplet particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
}
// decaying colour octet
else if(inpart.dataPtr()->iColour() == PDT::Colour8) {
if(oct.size()==1 && trip.size()==1 && atrip.size()==1) {
nflow = 2;
colour_.clear();
colour_.resize(2,DVector(2,0.));
colour_[0][0] = symFactor*2./3. ; colour_[0][1] = -symFactor*1./12.;
colour_[1][0] = -symFactor*1./12.; colour_[1][1] = symFactor*2./3. ;
}
else if (sing.size()==1 && trip.size()==1 && atrip.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*0.5));
}
else if (oct.size()==2 && sing.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor*3.));
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for a decaying colour octet particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
}
// Sextet
else if(inpart.dataPtr()->iColour() == PDT::Colour6) {
if(trip.size()==2 && sing.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor));
}
else if(trip.size()==2 && oct.size()==1) {
nflow = 2;
colour_.clear();
colour_.resize(2,DVector(2,0.));
colour_[0][0] = 4./3.*symFactor; colour_[0][1] = 1./3.*symFactor;
colour_[1][0] = 1./3.*symFactor; colour_[1][1] = 4./3.*symFactor;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for a decaying colour sextet particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
}
// anti Sextet
else if(inpart.dataPtr()->iColour() == PDT::Colour6bar) {
if(atrip.size()==2 && sing.size()==1) {
nflow = 1;
colour_ = vector<DVector>(1,DVector(1,symFactor));
}
else if(atrip.size()==2 && oct.size()==1) {
nflow = 2;
colour_.clear();
colour_.resize(2,DVector(2,0.));
colour_[0][0] = 4./3.*symFactor; colour_[0][1] = 1./3.*symFactor;
colour_[1][0] = 1./3.*symFactor; colour_[1][1] = 4./3.*symFactor;
}
else
throw Exception() << "Unknown colour for the outgoing particles"
<< " for a decaying colour anti-sextet particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
}
else
throw Exception() << "Unknown colour for the decaying particle in "
<< "GeneralTwoBodyDecayer::getColourFactors() for "
<< inpart. dataPtr()->PDGName() << " -> "
<< decay[0]->dataPtr()->PDGName() << " "
<< decay[1]->dataPtr()->PDGName() << " "
<< decay[2]->dataPtr()->PDGName()
<< Exception::runerror;
return colour_;
}
const GeneralTwoBodyDecayer::CFlow &
GeneralTwoBodyDecayer::colourFlows(const Particle & inpart,
const ParticleVector & decay) {
// static initialization of commonly used colour structures
static const CFlow init = CFlow(3, CFlowPairVec(1, make_pair(0, 1.)));
static CFlow tripflow = init;
static CFlow atripflow = init;
static CFlow octflow = init;
static CFlow sexflow = init;
static CFlow epsflow = init;
static const CFlow fpflow = CFlow(4, CFlowPairVec(1, make_pair(0, 1.)));
static bool initialized = false;
if (! initialized) {
tripflow[2].resize(2, make_pair(0,1.));
tripflow[2][0] = make_pair(0, 1.);
tripflow[2][1] = make_pair(1,-1.);
tripflow[1][0] = make_pair(1, 1.);
atripflow[1].resize(2, make_pair(0,1.));
atripflow[1][0] = make_pair(0, 1.);
atripflow[1][1] = make_pair(1,-1.);
atripflow[2][0] = make_pair(1, 1.);
octflow[0].resize(2, make_pair(0,1.));
octflow[0][0] = make_pair(0,-1.);
octflow[0][1] = make_pair(1, 1.);
octflow[2][0] = make_pair(1, 1.);
sexflow[0].resize(2, make_pair(0,1.));
sexflow[0][1] = make_pair(1,1.);
sexflow[2][0] = make_pair(1,1.);
epsflow[0].resize(2, make_pair(0,-1.));
epsflow[0][0] = make_pair(0,-1.);
epsflow[0][1] = make_pair(1,-1.);
epsflow[2][0] = make_pair(1,1.);
initialized = true;
}
// main function body
int sing=0,trip=0,atrip=0,oct=0,sex=0,asex=0;
for (size_t it=0; it<decay.size(); ++it) {
switch ( decay[it]->dataPtr()->iColour() ) {
case PDT::Colour0: ++sing; break;
case PDT::Colour3: ++trip; break;
case PDT::Colour3bar: ++atrip; break;
case PDT::Colour8: ++oct; break;
case PDT::Colour6: ++sex; break;
case PDT::Colour6bar: ++asex; break;
/// @todo: handle these better
case PDT::ColourUndefined: break;
case PDT::Coloured: break;
case PDT::DarkColoured: break;
case PDT::DarkColourNeutral: break;
case PDT::DarkColourFundamental: break;
case PDT::DarkColourAntiFundamental: break;
case PDT::DarkColourAdjoint: break;
}
}
const CFlow * retval = 0;
// decaying colour triplet
if(inpart.dataPtr()->iColour() == PDT::Colour3 &&
trip==1 && oct==2) {
retval = &tripflow;
}
// decaying colour anti-triplet
else if(inpart.dataPtr()->iColour() == PDT::Colour3bar &&
atrip==1 && oct==2){
retval = &atripflow;
}
// decaying colour octet
else if(inpart.dataPtr()->iColour() == PDT::Colour8 &&
oct==1 && trip==1 && atrip==1) {
retval = &octflow;
}
// decaying colour sextet
else if(inpart.dataPtr()->iColour() ==PDT::Colour6 &&
oct==1 && trip==2) {
retval = &sexflow;
}
// decaying anti colour sextet
else if(inpart.dataPtr()->iColour() ==PDT::Colour6bar &&
oct==1 && atrip==2) {
retval = &sexflow;
}
// decaying colour triplet (eps)
else if(inpart.dataPtr()->iColour() == PDT::Colour3 &&
atrip==2 && oct==1) {
retval = &epsflow;
}
// decaying colour anti-triplet (eps)
else if(inpart.dataPtr()->iColour() == PDT::Colour3bar &&
trip==2 && oct==1){
retval = &epsflow;
}
else {
retval = &fpflow;
}
return *retval;
}
double GeneralTwoBodyDecayer::threeBodyME(const int , const Particle &,
const ParticleVector &,
ShowerInteraction, MEOption) {
throw Exception() << "Base class GeneralTwoBodyDecayer::threeBodyME() "
<< "called, should have an implementation in the inheriting class"
<< Exception::runerror;
return 0.;
}
diff --git a/Models/General/HardProcessConstructor.cc b/Models/General/HardProcessConstructor.cc
--- a/Models/General/HardProcessConstructor.cc
+++ b/Models/General/HardProcessConstructor.cc
@@ -1,958 +1,961 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the HardProcessConstructor class.
//
#include "HardProcessConstructor.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
void HardProcessConstructor::persistentOutput(PersistentOStream & os) const {
os << debug_ << subProcess_ << model_;
}
void HardProcessConstructor::persistentInput(PersistentIStream & is, int) {
is >> debug_ >> subProcess_ >> model_;
}
// The following static variable is needed for the type
// description system in ThePEG.
DescribeAbstractClass<HardProcessConstructor,Interfaced>
describeHerwigHardProcessConstructor("Herwig::HardProcessConstructor", "Herwig.so");
void HardProcessConstructor::Init() {
static ClassDocumentation<HardProcessConstructor> documentation
("Base class for implementation of the automatic generation of hard processes");
static Switch<HardProcessConstructor,bool> interfaceDebugME
("DebugME",
"Print comparison with analytical ME",
&HardProcessConstructor::debug_, false, false, false);
static SwitchOption interfaceDebugMEYes
(interfaceDebugME,
"Yes",
"Print the debug information",
true);
static SwitchOption interfaceDebugMENo
(interfaceDebugME,
"No",
"Do not print the debug information",
false);
}
void HardProcessConstructor::doinit() {
Interfaced::doinit();
EGPtr eg = generator();
model_ = dynamic_ptr_cast<HwSMPtr>(eg->standardModel());
if(!model_)
throw InitException() << "HardProcessConstructor:: doinit() - "
<< "The model pointer is null!"
<< Exception::abortnow;
if(!eg->eventHandler()) {
throw
InitException() << "HardProcessConstructor:: doinit() - "
<< "The eventHandler pointer was null therefore "
<< "could not get SubProcessHandler pointer "
<< Exception::abortnow;
}
string subProcessName =
eg->preinitInterface(eg->eventHandler(), "SubProcessHandlers", "get","");
subProcess_ = eg->getObject<SubProcessHandler>(subProcessName);
if(!subProcess_) {
ostringstream s;
s << "HardProcessConstructor:: doinit() - "
<< "There was an error getting the SubProcessHandler "
<< "from the current event handler. ";
generator()->logWarning( Exception(s.str(), Exception::warning) );
}
}
GeneralHardME::ColourStructure HardProcessConstructor::
colourFlow(const tcPDVector & extpart) const {
PDT::Colour ina = extpart[0]->iColour();
PDT::Colour inb = extpart[1]->iColour();
PDT::Colour outa = extpart[2]->iColour();
PDT::Colour outb = extpart[3]->iColour();
// incoming colour neutral
if(ina == PDT::Colour0 && inb == PDT::Colour0) {
if( outa == PDT::Colour0 && outb == PDT::Colour0 ) {
return GeneralHardME::Colour11to11;
}
else if( outa == PDT::Colour3 && outb == PDT::Colour3bar ) {
return GeneralHardME::Colour11to33bar;
}
+ else if( outa == PDT::DarkColourFundamental && outb == PDT::DarkColourAntiFundamental) {
+ return GeneralHardME::Colour11to33bar;
+ }
else if( outa == PDT::Colour8 && outb == PDT::Colour8 ) {
return GeneralHardME::Colour11to88;
}
else
assert(false);
}
// incoming 3 3
else if(ina == PDT::Colour3 && inb == PDT::Colour3 ) {
if( outa == PDT::Colour3 && outb == PDT::Colour3 ) {
return GeneralHardME::Colour33to33;
}
else if( outa == PDT::Colour6 && outb == PDT::Colour0 ) {
return GeneralHardME::Colour33to61;
}
else if( outa == PDT::Colour0 && outb == PDT::Colour6 ) {
return GeneralHardME::Colour33to16;
}
else if ( outa == PDT::Colour0 && outb == PDT::Colour3bar) {
return GeneralHardME::Colour33to13bar;
}
else if ( outb == PDT::Colour0 && outa == PDT::Colour3bar) {
return GeneralHardME::Colour33to3bar1;
}
else if ( outa == PDT::Colour8 && outb == PDT::Colour3bar) {
return GeneralHardME::Colour33to83bar;
}
else if ( outb == PDT::Colour8 && outa == PDT::Colour3bar) {
return GeneralHardME::Colour33to3bar8;
}
else
assert(false);
}
// incoming 3bar 3bar
else if(ina == PDT::Colour3bar && inb == PDT::Colour3bar ) {
if( outa == PDT::Colour3bar && outb == PDT::Colour3bar ) {
return GeneralHardME::Colour3bar3barto3bar3bar;
}
else if( outa == PDT::Colour6bar && outb == PDT::Colour0) {
return GeneralHardME::Colour3bar3barto6bar1;
}
else if ( outa == PDT::Colour0 && outb == PDT::Colour6bar ) {
return GeneralHardME::Colour3bar3barto16bar;
}
else if ( outa == PDT::Colour0 && outb == PDT::Colour3) {
return GeneralHardME::Colour3bar3barto13;
}
else if ( outb == PDT::Colour0 && outa == PDT::Colour3) {
return GeneralHardME::Colour3bar3barto31;
}
else if ( outa == PDT::Colour8 && outb == PDT::Colour3) {
return GeneralHardME::Colour3bar3barto83;
}
else if ( outb == PDT::Colour8 && outa == PDT::Colour3) {
return GeneralHardME::Colour3bar3barto38;
}
else
assert(false);
}
// incoming 3 3bar
else if(ina == PDT::Colour3 && inb == PDT::Colour3bar ) {
if( outa == PDT::Colour0 && outb == PDT::Colour0 ) {
return GeneralHardME::Colour33barto11;
}
else if( outa == PDT::Colour3 && outb == PDT::Colour3bar ) {
return GeneralHardME::Colour33barto33bar;
}
else if( outa == PDT::Colour8 && outb == PDT::Colour8 ) {
return GeneralHardME::Colour33barto88;
}
else if( outa == PDT::Colour8 && outb == PDT::Colour0 ) {
return GeneralHardME::Colour33barto81;
}
else if( outa == PDT::Colour0 && outb == PDT::Colour8 ) {
return GeneralHardME::Colour33barto18;
}
else if( outa == PDT::Colour6 && outb == PDT::Colour6bar) {
return GeneralHardME::Colour33barto66bar;
}
else if( outa == PDT::Colour6bar && outb == PDT::Colour6) {
return GeneralHardME::Colour33barto6bar6;
}
else
assert(false);
}
// incoming 88
else if(ina == PDT::Colour8 && inb == PDT::Colour8 ) {
if( outa == PDT::Colour0 && outb == PDT::Colour0 ) {
return GeneralHardME::Colour88to11;
}
else if( outa == PDT::Colour3 && outb == PDT::Colour3bar ) {
return GeneralHardME::Colour88to33bar;
}
else if( outa == PDT::Colour8 && outb == PDT::Colour8 ) {
return GeneralHardME::Colour88to88;
}
else if( outa == PDT::Colour8 && outb == PDT::Colour0 ) {
return GeneralHardME::Colour88to81;
}
else if( outa == PDT::Colour0 && outb == PDT::Colour8 ) {
return GeneralHardME::Colour88to18;
}
else if( outa == PDT::Colour6 && outb == PDT::Colour6bar ) {
return GeneralHardME::Colour88to66bar;
}
else
assert(false);
}
// incoming 38
else if(ina == PDT::Colour3 && inb == PDT::Colour8 ) {
if(outa == PDT::Colour3 && outb == PDT::Colour0) {
return GeneralHardME::Colour38to31;
}
else if(outa == PDT::Colour0 && outb == PDT::Colour3) {
return GeneralHardME::Colour38to13;
}
else if(outa == PDT::Colour3 && outb == PDT::Colour8) {
return GeneralHardME::Colour38to38;
}
else if(outa == PDT::Colour8 && outb == PDT::Colour3) {
return GeneralHardME::Colour38to83;
}
else if(outa == PDT::Colour3bar && outb == PDT::Colour6){
return GeneralHardME::Colour38to3bar6;
}
else if(outa == PDT::Colour6 && outb == PDT::Colour3bar) {
return GeneralHardME::Colour38to63bar;
}
else if(outa == PDT::Colour3bar && outb == PDT::Colour3bar) {
return GeneralHardME::Colour38to3bar3bar;
}
else
assert(false);
}
// incoming 3bar8
else if(ina == PDT::Colour3bar && inb == PDT::Colour8 ) {
if(outa == PDT::Colour3bar && outb == PDT::Colour0 ) {
return GeneralHardME::Colour3bar8to3bar1;
}
else if(outa == PDT::Colour0 && outb == PDT::Colour3bar) {
return GeneralHardME::Colour3bar8to13bar;
}
else if(outa == PDT::Colour3bar && outb == PDT::Colour8 ) {
return GeneralHardME::Colour3bar8to3bar8;
}
else if(outa == PDT::Colour8 && outb == PDT::Colour3bar) {
return GeneralHardME::Colour3bar8to83bar;
}
else if(outa == PDT::Colour3 && outb == PDT::Colour3) {
return GeneralHardME::Colour3bar8to33;
}
else
assert(false);
}
// unknown colour flow
else
assert(false);
return GeneralHardME::UNDEFINED;
}
void HardProcessConstructor::fixFSOrder(HPDiagram & diag) {
tcPDPtr psa = getParticleData(diag.incoming.first);
tcPDPtr psb = getParticleData(diag.incoming.second);
tcPDPtr psc = getParticleData(diag.outgoing.first);
tcPDPtr psd = getParticleData(diag.outgoing.second);
//fix a spin order
if( psc->iSpin() < psd->iSpin() ) {
swap(diag.outgoing.first, diag.outgoing.second);
if(diag.channelType == HPDiagram::tChannel) {
diag.ordered.second = !diag.ordered.second;
}
return;
}
if( psc->iSpin() == psd->iSpin() &&
psc->id() < 0 && psd->id() > 0 ) {
swap(diag.outgoing.first, diag.outgoing.second);
if(diag.channelType == HPDiagram::tChannel) {
diag.ordered.second = !diag.ordered.second;
}
return;
}
}
void HardProcessConstructor::assignToCF(HPDiagram & diag) {
if(diag.channelType == HPDiagram::tChannel) {
if(diag.ordered.second) tChannelCF(diag);
else uChannelCF(diag);
}
else if(diag.channelType == HPDiagram::sChannel) {
sChannelCF(diag);
}
else if (diag.channelType == HPDiagram::fourPoint) {
fourPointCF(diag);
}
else
assert(false);
}
void HardProcessConstructor::tChannelCF(HPDiagram & diag) {
tcPDPtr ia = getParticleData(diag.incoming.first );
tcPDPtr ib = getParticleData(diag.incoming.second);
tcPDPtr oa = getParticleData(diag.outgoing.first );
tcPDPtr ob = getParticleData(diag.outgoing.second);
PDT::Colour ina = ia->iColour();
PDT::Colour inb = ib->iColour();
PDT::Colour outa = oa->iColour();
PDT::Colour outb = ob->iColour();
vector<CFPair> cfv(1, make_pair(0, 1.));
if(diag.intermediate->iColour() == PDT::Colour0) {
if(ina==PDT::Colour0) {
cfv[0] = make_pair(0, 1);
}
else if(ina==PDT::Colour3 || ina==PDT::Colour3bar) {
if( inb == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(inb==PDT::Colour3 || outb==PDT::Colour3bar) {
cfv[0] = make_pair(2, 1);
}
else if(inb==PDT::Colour8) {
cfv[0] = make_pair(2, 1);
}
}
else if(ina==PDT::Colour8) {
if( inb == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(inb==PDT::Colour3 || outb==PDT::Colour3bar) {
cfv[0] = make_pair(2, 1);
}
else if(inb==PDT::Colour8) {
cfv[0] = make_pair(7, -1);
}
}
}
else if(diag.intermediate->iColour() == PDT::Colour8) {
if(ina==PDT::Colour8&&outa==PDT::Colour8&&
inb==PDT::Colour8&&outb==PDT::Colour8) {
cfv[0]=make_pair(2, 2.);
cfv.push_back(make_pair(3, -2.));
cfv.push_back(make_pair(1, -2.));
cfv.push_back(make_pair(4, 2.));
}
else if(ina==PDT::Colour8&&outa==PDT::Colour0&&
inb==PDT::Colour8&&outb==PDT::Colour8&&
(oa->iSpin()==PDT::Spin0||oa->iSpin()==PDT::Spin1Half||
oa->iSpin()==PDT::Spin3Half)) {
cfv[0] = make_pair(0,-1);
}
else if(ina==PDT::Colour8&&outa==PDT::Colour8&&
inb==PDT::Colour8&&outb==PDT::Colour0&&
(ob->iSpin()==PDT::Spin0||ob->iSpin()==PDT::Spin1Half||
ob->iSpin()==PDT::Spin3Half)) {
cfv[0] = make_pair(0,-1);
}
}
else if(diag.intermediate->iColour() == PDT::Colour3 ||
diag.intermediate->iColour() == PDT::Colour3bar) {
if(outa == PDT::Colour0 || outb == PDT::Colour0) {
if( outa == PDT::Colour6 || outb == PDT::Colour6 ||
outa == PDT::Colour6bar || outb == PDT::Colour6bar) {
cfv[0] = make_pair(0,0.5);
cfv.push_back(make_pair(1,0.5));
}
else if ((ina==PDT::Colour3 && inb == PDT::Colour3 &&
(outa == PDT::Colour3bar || outb == PDT::Colour3bar))||
(ina==PDT::Colour3bar && inb == PDT::Colour3bar &&
(outa == PDT::Colour3 || outb == PDT::Colour3 ))) {
cfv[0] = make_pair(0,1.);
}
else {
cfv[0] = make_pair(0,1.);
}
}
else if(outa==PDT::Colour6 && outb==PDT::Colour3bar) {
cfv[0] = make_pair(4,1.);
cfv.push_back(make_pair(5,1.));
}
else if(outa==PDT::Colour6 && outb==PDT::Colour6bar) {
cfv[0] = make_pair(4, 1.);
for(unsigned int ix=5;ix<8;++ix)
cfv.push_back(make_pair(ix,1.));
}
else if(outa==PDT::Colour6 || outa ==PDT::Colour6bar ||
outb==PDT::Colour6 || outb ==PDT::Colour6bar ) {
assert(false);
}
else if(ina==PDT::Colour3 && inb==PDT::Colour3 ) {
if((outa==PDT::Colour0 && outb==PDT::Colour3bar)||
(outb==PDT::Colour0 && outa==PDT::Colour3bar))
cfv[0] = make_pair(0,1.);
else if((outa==PDT::Colour8 && outb==PDT::Colour3bar)||
(outb==PDT::Colour8 && outa==PDT::Colour3bar)) {
cfv[0] = make_pair(1,1.);
}
}
else if(ina==PDT::Colour3bar && inb==PDT::Colour3bar ) {
if((outa==PDT::Colour0 && outb==PDT::Colour3)||
(outb==PDT::Colour0 && outa==PDT::Colour3))
cfv[0] = make_pair(0,1.);
else if((outa==PDT::Colour8 && outb==PDT::Colour3)||
(outb==PDT::Colour8 && outa==PDT::Colour3)) {
double sign = diag.intermediate->iSpin()==PDT::Spin0 ? -1. : 1.;
cfv[0] = make_pair(1,sign);
}
}
else if((ina==PDT::Colour3 && inb==PDT::Colour8) ||
(ina==PDT::Colour3bar && inb==PDT::Colour8) ||
(inb==PDT::Colour3 && ina==PDT::Colour8) ||
(inb==PDT::Colour3bar && ina==PDT::Colour8) ) {
if((outa==PDT::Colour3 && outb==PDT::Colour3 ) ||
(outa==PDT::Colour3bar && outb==PDT::Colour3bar)) {
cfv[0] = make_pair(1,1.);
}
}
}
else if(diag.intermediate->iColour() == PDT::Colour6 ||
diag.intermediate->iColour() == PDT::Colour6bar) {
if(ina==PDT::Colour8 && inb==PDT::Colour8) {
cfv[0] = make_pair(0, 1.);
for(unsigned int ix=1;ix<4;++ix)
cfv.push_back(make_pair(ix,1.));
for(unsigned int ix=4;ix<8;++ix)
cfv.push_back(make_pair(ix,1.));
}
else if(outa==PDT::Colour3bar && outb==PDT::Colour6) {
cfv[0] = make_pair(0,1.);
for(unsigned int ix=1;ix<4;++ix)
cfv.push_back(make_pair(ix,1.));
}
else if(outa==PDT::Colour6 && outb==PDT::Colour3bar) {
cfv[0] = make_pair(4,1.);
cfv.push_back(make_pair(5,1.));
}
}
diag.colourFlow = cfv;
}
void HardProcessConstructor::uChannelCF(HPDiagram & diag) {
tcPDPtr ia = getParticleData(diag.incoming.first );
tcPDPtr ib = getParticleData(diag.incoming.second);
tcPDPtr oa = getParticleData(diag.outgoing.first );
tcPDPtr ob = getParticleData(diag.outgoing.second);
PDT::Colour ina = ia->iColour();
PDT::Colour inb = ib->iColour();
PDT::Colour outa = oa->iColour();
PDT::Colour outb = ob->iColour();
PDT::Colour offshell = diag.intermediate->iColour();
vector<CFPair> cfv(1, make_pair(1, 1.));
if(offshell == PDT::Colour8) {
if(outa == PDT::Colour0 &&
outb == PDT::Colour0) {
cfv[0].first = 0;
}
else if( outa != outb ) {
if(outa == PDT::Colour0 ||
outb == PDT::Colour0) {
cfv[0].first = 0;
}
else if(ina == PDT::Colour3 && inb == PDT::Colour8 &&
outb == PDT::Colour3 && outa == PDT::Colour8) {
tPDPtr off = diag.intermediate;
if(off->CC()) off=off->CC();
if(off->iSpin()!=PDT::Spin1Half ||
diag.vertices.second->allowed(off->id(),diag.outgoing.first,diag.incoming.second)) {
cfv[0].first = 0;
cfv.push_back(make_pair(1, -1.));
}
else {
cfv[0].first = 1;
cfv.push_back(make_pair(0, -1.));
}
}
else if(ina == PDT::Colour3bar && inb == PDT::Colour8 &&
outb == PDT::Colour3bar && outa == PDT::Colour8) {
tPDPtr off = diag.intermediate;
if(off->CC()) off=off->CC();
if(off->iSpin()!=PDT::Spin1Half ||
diag.vertices.second->allowed(diag.outgoing.first,off->id(),diag.incoming.second)) {
cfv[0].first = 0;
cfv.push_back(make_pair(1, -1.));
}
else {
cfv[0].first = 1;
cfv.push_back(make_pair(0, -1.));
}
}
else {
cfv[0].first = 0;
cfv.push_back(make_pair(1, -1.));
}
}
else if(outa==PDT::Colour8&&ina==PDT::Colour8) {
cfv[0]=make_pair(4, 2.);
cfv.push_back(make_pair(5, -2.));
cfv.push_back(make_pair(0, -2.));
cfv.push_back(make_pair(2, 2.));
}
}
else if(offshell == PDT::Colour3 || offshell == PDT::Colour3bar) {
if( outa == PDT::Colour0 || outb == PDT::Colour0 ) {
if( outa == PDT::Colour6 || outb == PDT::Colour6 ||
outa == PDT::Colour6bar || outb == PDT::Colour6bar) {
cfv[0] = make_pair(0,0.5);
cfv.push_back(make_pair(1,0.5));
}
else if ((ina==PDT::Colour3 && inb == PDT::Colour3 &&
(outa == PDT::Colour3bar || outb == PDT::Colour3bar))||
(ina==PDT::Colour3bar && inb == PDT::Colour3bar &&
(outa == PDT::Colour3 || outb == PDT::Colour3 ))) {
double sign = diag.intermediate->iSpin()==PDT::Spin0 ? -1. : 1.;
cfv[0] = make_pair(0,sign);
}
else {
cfv[0] = make_pair(0,1.);
}
}
else if(outa==PDT::Colour3bar && outb==PDT::Colour6) {
cfv[0] = make_pair(4,1.);
cfv.push_back(make_pair(5,1.));
}
else if(outa==PDT::Colour6 && outb==PDT::Colour3bar) {
cfv[0] = make_pair(0,1.);
for(int ix=0; ix<4;++ix)
cfv.push_back(make_pair(ix,1.));
}
else if(outa==PDT::Colour6bar && outb==PDT::Colour6) {
cfv[0] = make_pair(4,1.);
for(int ix=5; ix<8;++ix)
cfv.push_back(make_pair(ix,1.));
}
else if(ina==PDT::Colour0 && inb==PDT::Colour0) {
cfv[0] = make_pair(0,1.);
}
else if(ina==PDT::Colour3 && inb==PDT::Colour3 ) {
if((outa==PDT::Colour0 && outb==PDT::Colour3bar)||
(outb==PDT::Colour0 && outa==PDT::Colour3bar))
cfv[0] = make_pair(0,1.);
else if((outa==PDT::Colour8 && outb==PDT::Colour3bar)||
(outb==PDT::Colour8 && outa==PDT::Colour3bar)) {
double sign = diag.intermediate->iSpin()==PDT::Spin0 ? -1. : 1.;
cfv[0] = make_pair(2,sign);
}
}
else if(ina==PDT::Colour3bar && inb==PDT::Colour3bar ) {
if((outa==PDT::Colour0 && outb==PDT::Colour3)||
(outb==PDT::Colour0 && outa==PDT::Colour3))
cfv[0] = make_pair(0,1.);
else if((outa==PDT::Colour8 && outb==PDT::Colour3)||
(outb==PDT::Colour8 && outa==PDT::Colour3)) {
cfv[0] = make_pair(2,1.);
}
}
else if(((ina==PDT::Colour3 && inb==PDT::Colour8) ||
(ina==PDT::Colour3bar && inb==PDT::Colour8) ||
(inb==PDT::Colour3 && ina==PDT::Colour8) ||
(inb==PDT::Colour3bar && ina==PDT::Colour8)) &&
((outa==PDT::Colour3 && outb==PDT::Colour3 ) ||
(outa==PDT::Colour3bar && outb==PDT::Colour3bar))) {
cfv[0] = make_pair(2, 1.);
}
else if(( ina==PDT::Colour3 && inb==PDT::Colour3bar &&
outa==PDT::Colour3 && outb==PDT::Colour3bar)) {
cfv[0] = make_pair(2, 1.);
cfv.push_back(make_pair(3,-1.));
}
}
else if( offshell == PDT::Colour0 ) {
if(ina==PDT::Colour0) {
cfv[0] = make_pair(0, 1);
}
else if(ina==PDT::Colour3 || ina==PDT::Colour3bar) {
if( inb == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(inb==PDT::Colour3 || inb==PDT::Colour3bar) {
cfv[0] = make_pair(3, 1);
}
else if(inb==PDT::Colour8) {
cfv[0] = make_pair(2, 1);
}
}
else if(ina==PDT::Colour8) {
if( inb == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(inb==PDT::Colour3 || outb==PDT::Colour3bar) {
cfv[0] = make_pair(2, 1);
}
else if(inb==PDT::Colour8) {
cfv[0] = make_pair(8, -1);
}
}
}
else if(diag.intermediate->iColour() == PDT::Colour6 ||
diag.intermediate->iColour() == PDT::Colour6bar) {
if(ina==PDT::Colour8 && inb==PDT::Colour8) {
cfv[0] = make_pair(0, 1.);
for(unsigned int ix=1;ix<4;++ix)
cfv.push_back(make_pair(ix,1.));
for(unsigned int ix=8;ix<12;++ix)
cfv.push_back(make_pair(ix,1.));
}
else if(outa==PDT::Colour3bar && outb==PDT::Colour6) {
cfv[0] = make_pair(4, 1.);
cfv.push_back(make_pair(5,1.));
}
else if(outa==PDT::Colour6 && outb==PDT::Colour3bar) {
cfv[0] = make_pair(0, 1.);
for(unsigned int ix=1;ix<4;++ix)
cfv.push_back(make_pair(ix,1.));
}
}
diag.colourFlow = cfv;
}
void HardProcessConstructor::sChannelCF(HPDiagram & diag) {
tcPDPtr pa = getParticleData(diag.incoming.first);
tcPDPtr pb = getParticleData(diag.incoming.second);
PDT::Colour ina = pa->iColour();
PDT::Colour inb = pb->iColour();
PDT::Colour offshell = diag.intermediate->iColour();
tcPDPtr pc = getParticleData(diag.outgoing.first);
tcPDPtr pd = getParticleData(diag.outgoing.second);
PDT::Colour outa = pc->iColour();
PDT::Colour outb = pd->iColour();
vector<CFPair> cfv(1);
if(offshell == PDT::Colour8) {
if(ina == PDT::Colour0 || inb == PDT::Colour0 ||
outa == PDT::Colour0 || outb == PDT::Colour0) {
cfv[0] = make_pair(0, 1);
}
else {
bool incol = ina == PDT::Colour8 && inb == PDT::Colour8;
bool outcol = outa == PDT::Colour8 && outb == PDT::Colour8;
bool intrip = ina == PDT::Colour3 && inb == PDT::Colour3bar;
bool outtrip = outa == PDT::Colour3 && outb == PDT::Colour3bar;
bool outsex = outa == PDT::Colour6 && outb == PDT::Colour6bar;
bool outsexb = outa == PDT::Colour6bar && outb == PDT::Colour6;
if(incol || outcol) {
// Require an additional minus sign for a scalar/fermion
// 33bar final state due to the way the vertex rules are defined.
int prefact(1);
if( ((pc->iSpin() == PDT::Spin1Half && pd->iSpin() == PDT::Spin1Half) ||
(pc->iSpin() == PDT::Spin0 && pd->iSpin() == PDT::Spin0 ) ||
(pc->iSpin() == PDT::Spin1 && pd->iSpin() == PDT::Spin1 )) &&
(outa == PDT::Colour3 && outb == PDT::Colour3bar) )
prefact = -1;
if(incol && outcol) {
cfv[0] = make_pair(0, -2.);
cfv.push_back(make_pair(1, 2.));
cfv.push_back(make_pair(3, 2.));
cfv.push_back(make_pair(5, -2.));
}
else if(incol && outsex) {
cfv[0].first = 4;
cfv[0].second = prefact;
for(unsigned int ix=1;ix<4;++ix)
cfv.push_back(make_pair(4+ix, prefact));
for(unsigned int ix=0;ix<4;++ix)
cfv.push_back(make_pair(8+ix,-prefact));
}
else {
cfv[0].first = 0;
cfv[0].second = -prefact;
cfv.push_back(make_pair(1, prefact));
}
}
else if( ( intrip && !outtrip ) ||
( !intrip && outtrip ) ) {
if(!outsex)
cfv[0] = make_pair(0, 1);
else {
cfv[0] = make_pair(0, 1.);
for(unsigned int ix=0;ix<3;++ix)
cfv.push_back(make_pair(ix+1, 1.));
}
}
else if((intrip && outsex) || (intrip && outsexb)) {
cfv[0] = make_pair(0,1.);
for(int ix=1; ix<4; ++ix)
cfv.push_back(make_pair(ix,1.));
}
else
cfv[0] = make_pair(1, 1);
}
}
else if(offshell == PDT::Colour0) {
if( ina == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(ina==PDT::Colour3 || ina==PDT::Colour3bar) {
if( outa == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(outa==PDT::Colour3 || outa==PDT::Colour3bar) {
cfv[0] = make_pair(3, 1);
}
else if(outa==PDT::Colour8) {
cfv[0] = make_pair(2, 1);
}
else if(outa==PDT::Colour6 || outa==PDT::Colour6bar) {
cfv[0] = make_pair(8, 1.);
cfv.push_back(make_pair(9,1.));
}
else
assert(false);
}
else if(ina==PDT::Colour8) {
if( outa == PDT::Colour0 ) {
cfv[0] = make_pair(0, 1);
}
else if(outa==PDT::Colour3 || outb==PDT::Colour3bar) {
cfv[0] = make_pair(2, 1);
}
else if(outa==PDT::Colour8) {
cfv[0] = make_pair(6, 1);
}
}
}
else if(offshell == PDT::Colour3 || offshell == PDT::Colour3bar) {
if(outa == PDT::Colour6 || outa == PDT::Colour6bar ||
outb == PDT::Colour6bar || outb == PDT::Colour6) {
cfv[0] = make_pair(6, 1.);
cfv.push_back(make_pair(7,1.));
}
else if((ina == PDT::Colour3 && inb == PDT::Colour3) ||
(ina == PDT::Colour3bar && inb == PDT::Colour3bar)) {
if((outa == PDT::Colour3 && outb == PDT::Colour3 ) ||
(outa == PDT::Colour3bar && outb == PDT::Colour3bar)) {
cfv[0] = make_pair(2, 1.);
cfv.push_back(make_pair(3,-1.));
}
else
cfv[0] = make_pair(0,1.);
}
else if(((ina==PDT::Colour3 && inb==PDT::Colour8) ||
(ina==PDT::Colour3bar && inb==PDT::Colour8) ||
(inb==PDT::Colour3 && ina==PDT::Colour8) ||
(inb==PDT::Colour3bar && ina==PDT::Colour8) ) &&
((outa==PDT::Colour3 && outb==PDT::Colour3 ) ||
(outa==PDT::Colour3bar && outb==PDT::Colour3bar))) {
cfv[0] = make_pair(0,1.);
}
else {
if(outa == PDT::Colour0 || outb == PDT::Colour0)
cfv[0] = make_pair(0, 1);
else
cfv[0] = make_pair(1, 1);
}
}
else if( offshell == PDT::Colour6 || offshell == PDT::Colour6bar) {
if((ina == PDT::Colour3 && inb == PDT::Colour3 &&
outa == PDT::Colour3 && outb == PDT::Colour3 ) ||
(ina == PDT::Colour3bar && inb == PDT::Colour3bar &&
outa == PDT::Colour3bar && outb == PDT::Colour3bar)) {
cfv[0] = make_pair(2,0.5);
cfv.push_back(make_pair(3,0.5));
}
else if((ina == PDT::Colour3 && inb == PDT::Colour3 &&
((outa == PDT::Colour6 && outb == PDT::Colour0)||
(outb == PDT::Colour6 && outa == PDT::Colour0))) ||
(ina == PDT::Colour3bar && inb == PDT::Colour3bar &&
((outa == PDT::Colour6bar && outb == PDT::Colour0)||
(outb == PDT::Colour6bar && outa == PDT::Colour0)))) {
cfv[0] = make_pair(0,0.5);
cfv.push_back(make_pair(1,0.5));
}
else
assert(false);
}
else {
if(outa == PDT::Colour0 || outb == PDT::Colour0)
cfv[0] = make_pair(0, 1);
else
cfv[0] = make_pair(1, 1);
}
diag.colourFlow = cfv;
}
void HardProcessConstructor::fourPointCF(HPDiagram & diag) {
using namespace ThePEG::Helicity;
// count the colours
unsigned int noct(0),ntri(0),nsng(0),nsex(0),nf(0);
vector<tcPDPtr> particles;
for(unsigned int ix=0;ix<4;++ix) {
particles.push_back(getParticleData(diag.ids[ix]));
PDT::Colour col = particles.back()->iColour();
if(col==PDT::Colour0) ++nsng;
else if(col==PDT::Colour3||col==PDT::Colour3bar) ++ntri;
else if(col==PDT::Colour8) ++noct;
else if(col==PDT::Colour6||col==PDT::Colour6bar) ++nsex;
if(particles.back()->iSpin()==2) nf+=1;
}
if(nsng==4 || (ntri==2&&nsng==2) ||
(noct==3 && nsng==1) ||
(ntri==2 && noct==1 && nsng==1) ||
(noct == 2 && nsng == 2) ) {
vector<CFPair> cfv(1,make_pair(0,1));
diag.colourFlow = cfv;
}
else if(noct==4) {
// flows for SSVV, VVVV is handled in me class
vector<CFPair> cfv(6);
cfv[0] = make_pair(0, -2.);
cfv[1] = make_pair(1, -2.);
cfv[2] = make_pair(2, +4.);
cfv[3] = make_pair(3, -2.);
cfv[4] = make_pair(4, +4.);
cfv[5] = make_pair(5, -2.);
diag.colourFlow = cfv;
}
else if(ntri==2&&noct==2) {
vector<CFPair> cfv(2);
cfv[0] = make_pair(0, 1);
cfv[1] = make_pair(1, 1);
if(nf==2) cfv[1].second = -1.;
diag.colourFlow = cfv;
}
else if(nsex==2&&noct==2) {
vector<CFPair> cfv;
for(unsigned int ix=0;ix<4;++ix)
cfv.push_back(make_pair(ix ,2.));
for(unsigned int ix=0;ix<8;++ix)
cfv.push_back(make_pair(4+ix,1.));
diag.colourFlow = cfv;
}
else if(ntri==4) {
// get the order from the vertex
vector<long> temp;
for(unsigned int ix=0;ix<4;++ix) {
temp = diag.vertices.first->search(ix,diag.outgoing.first);
if(!temp.empty()) break;
}
// compute the mapping
vector<long> ids;
ids.push_back( particles[0]->CC() ? -diag.incoming.first : diag.incoming.first );
ids.push_back( particles[1]->CC() ? -diag.incoming.second : diag.incoming.second);
ids.push_back( diag.outgoing.first );
ids.push_back( diag.outgoing.second);
vector<unsigned int> order = {0,1,2,3};
vector<bool> matched(4,false);
for(unsigned int ix=0;ix<temp.size();++ix) {
for(unsigned int iy=0;iy<ids.size();++iy) {
if(matched[iy]) continue;
if(temp[ix]==ids[iy]) {
matched[iy] = true;
order[ix]=iy;
break;
}
}
}
// 3 3 -> 3 3
if((particles[0]->iColour()==PDT::Colour3 &&
particles[1]->iColour()==PDT::Colour3) ||
(particles[0]->iColour()==PDT::Colour3bar &&
particles[1]->iColour()==PDT::Colour3bar) ) {
if(diag.vertices.first->colourStructure()==ColourStructure::SU3I12I34) {
if( (order[0]==0 && order[1]==2) || (order[2]==0 && order[3]==2) ||
(order[0]==2 && order[1]==0) || (order[2]==2 && order[3]==0))
diag.colourFlow = vector<CFPair>(1,make_pair(2,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(3,1.));
}
else if(diag.vertices.first->colourStructure()==ColourStructure::SU3I14I23) {
if( (order[0]==0 && order[3]==2) || (order[1]==0 && order[2]==2) ||
(order[0]==2 && order[3]==0) || (order[1]==2 && order[2]==0))
diag.colourFlow = vector<CFPair>(1,make_pair(2,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(3,1.));
}
else if(diag.vertices.first->colourStructure()==ColourStructure::SU3T21T43) {
if( (order[1]==0 && order[0]==2) || (order[3]==0 && order[2]==2) ||
(order[1]==2 && order[0]==0) || (order[3]==2 && order[2]==0))
diag.colourFlow = vector<CFPair>(1,make_pair(0,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(1,1.));
}
else if(diag.vertices.first->colourStructure()==ColourStructure::SU3T23T41) {
if( (order[1]==0 && order[2]==2) || (order[3]==0 && order[0]==2) ||
(order[1]==2 && order[2]==0) || (order[3]==2 && order[0]==0))
diag.colourFlow = vector<CFPair>(1,make_pair(0,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(1,1.));
}
else
assert(false);
}
else if((particles[0]->iColour()==PDT::Colour3 &&
particles[1]->iColour()==PDT::Colour3bar) ||
(particles[0]->iColour()==PDT::Colour3bar &&
particles[1]->iColour()==PDT::Colour3)) {
if(diag.vertices.first->colourStructure()==ColourStructure::SU3I12I34) {
if( (order[0]==0 && order[1]==1) || (order[2]==0 && order[3]==0) ||
(order[0]==1 && order[1]==0) || (order[2]==1 && order[3]==1))
diag.colourFlow = vector<CFPair>(1,make_pair(3,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(2,1.));
}
else if(diag.vertices.first->colourStructure()==ColourStructure::SU3I14I23) {
if( (order[0]==0 && order[3]==1) || (order[0]==2 && order[3]==3) ||
(order[0]==1 && order[3]==0) || (order[0]==3 && order[3]==2))
diag.colourFlow = vector<CFPair>(1,make_pair(3,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(2,1.));
}
else if(diag.vertices.first->colourStructure()==ColourStructure::SU3T21T43) {
if( (order[1]==0 && order[0]==1) || (order[3]==0 && order[2]==1) ||
(order[1]==1 && order[0]==0) || (order[3]==1 && order[2]==0))
diag.colourFlow = vector<CFPair>(1,make_pair(1,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(0,1.));
}
else if(diag.vertices.first->colourStructure()==ColourStructure::SU3T23T41) {
if( (order[1]==0 && order[2]==1) || (order[1]==1 && order[2]==0) ||
(order[1]==3 && order[2]==2) || (order[1]==2 && order[2]==3))
diag.colourFlow = vector<CFPair>(1,make_pair(1,1.));
else
diag.colourFlow = vector<CFPair>(1,make_pair(2,1.));
}
else
assert(false);
}
else {
assert(false);
}
}
else {
assert(false);
}
}
namespace {
// Helper functor for find_if in duplicate function.
class SameDiagramAs {
public:
SameDiagramAs(const HPDiagram & diag) : a(diag) {}
bool operator()(const HPDiagram & b) const {
return a == b;
}
private:
HPDiagram a;
};
}
bool HardProcessConstructor::duplicate(const HPDiagram & diag,
const HPDVector & group) const {
//find if a duplicate diagram exists
HPDVector::const_iterator it =
find_if(group.begin(), group.end(), SameDiagramAs(diag));
return it != group.end();
}
bool HardProcessConstructor::checkOrder(const HPDiagram & diag) const {
for(map<string,pair<unsigned int,int> >::const_iterator it=model_->couplings().begin();
it!=model_->couplings().end();++it) {
int order=0;
if(diag.vertices.first ) order += diag.vertices.first ->orderInCoupling(it->second.first);
if(diag.vertices.second&&diag.vertices.first->getNpoint()==3)
order += diag.vertices.second->orderInCoupling(it->second.first);
if(order>it->second.second) return false;
}
return true;
}
diff --git a/Shower/QTilde/Dark/HiddenValleyAlpha.cc b/Shower/QTilde/Dark/HiddenValleyAlpha.cc
--- a/Shower/QTilde/Dark/HiddenValleyAlpha.cc
+++ b/Shower/QTilde/Dark/HiddenValleyAlpha.cc
@@ -1,370 +1,333 @@
// -*- C++ -*-
//
// HiddenValleyAlpha.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 HiddenValleyAlpha class.
//
#include "HiddenValleyAlpha.h"
#include "HiddenValleyModel.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/PDT/ParticleData.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Command.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Utilities/Throw.h"
using namespace Herwig;
IBPtr HiddenValleyAlpha::clone() const {
return new_ptr(*this);
}
IBPtr HiddenValleyAlpha::fullclone() const {
return new_ptr(*this);
}
void HiddenValleyAlpha::persistentOutput(PersistentOStream & os) const {
os << _asType << _asMaxNP << ounit(_qmin,GeV) << _nloop << _thresopt
- << ounit(_lambdain,GeV) << _alphain
- << _tolerance << _maxtry << _alphamin
+ << ounit(_lambdain,GeV) << _tolerance << _maxtry << _alphamin
<< ounit(_thresholds,GeV) << ounit(_lambda,GeV) << _ca << _cf << _tr;
}
void HiddenValleyAlpha::persistentInput(PersistentIStream & is, int) {
is >> _asType >> _asMaxNP >> iunit(_qmin,GeV) >> _nloop >> _thresopt
- >> iunit(_lambdain,GeV) >> _alphain
- >> _tolerance >> _maxtry >> _alphamin
+ >> iunit(_lambdain,GeV) >> _tolerance >> _maxtry >> _alphamin
>> iunit(_thresholds,GeV) >> iunit(_lambda,GeV) >> _ca >> _cf >> _tr;
}
ClassDescription<HiddenValleyAlpha> HiddenValleyAlpha::initHiddenValleyAlpha;
// Definition of the static class description member.
void HiddenValleyAlpha::Init() {
static ClassDocumentation<HiddenValleyAlpha> documentation
("This (concrete) class describes the QCD alpha running.");
static Switch<HiddenValleyAlpha, int> intAsType
("NPAlphaS",
"Behaviour of AlphaS in the NP region",
&HiddenValleyAlpha::_asType, 1, false, false);
static SwitchOption intAsTypeZero
(intAsType, "Zero","zero below Q_min", 1);
static SwitchOption intAsTypeConst
(intAsType, "Const","const as(qmin) below Q_min", 2);
static SwitchOption intAsTypeLin
(intAsType, "Linear","growing linearly below Q_min", 3);
static SwitchOption intAsTypeQuad
(intAsType, "Quadratic","growing quadratically below Q_min", 4);
static SwitchOption intAsTypeExx1
(intAsType, "Exx1", "quadratic from AlphaMaxNP down to as(Q_min)", 5);
static SwitchOption intAsTypeExx2
(intAsType, "Exx2", "const = AlphaMaxNP below Q_min", 6);
// default such that as(qmin) = 1 in the current parametrization.
// min = Lambda3
static Parameter<HiddenValleyAlpha,Energy> intQmin
("Qmin", "Q < Qmin is treated with NP parametrization as of (unit [GeV])",
&HiddenValleyAlpha::_qmin, GeV, 0.630882*GeV, 0.330445*GeV,
100.0*GeV,false,false,false);
static Parameter<HiddenValleyAlpha,double> interfaceAlphaMaxNP
("AlphaMaxNP",
"Max value of alpha in NP region, only relevant if NPAlphaS = 5,6",
&HiddenValleyAlpha::_asMaxNP, 1.0, 0., 100.0,
false, false, Interface::limited);
static Parameter<HiddenValleyAlpha,unsigned int> interfaceNumberOfLoops
("NumberOfLoops",
"The number of loops to use in the alpha_S calculation",
&HiddenValleyAlpha::_nloop, 2, 1, 2,
false, false, Interface::limited);
static Switch<HiddenValleyAlpha,bool> interfaceLambdaOption
("LambdaOption",
"Option for the calculation of the Lambda used in the simulation from the input"
" Lambda_MSbar",
&HiddenValleyAlpha::_lambdaopt, false, false, false);
static SwitchOption interfaceLambdaOptionfalse
(interfaceLambdaOption,
"Same",
"Use the same value",
false);
static SwitchOption interfaceLambdaOptionConvert
(interfaceLambdaOption,
"Convert",
"Use the conversion to the Herwig scheme from NPB349, 635",
true);
- static Parameter<HiddenValleyAlpha,Energy> interfaceLambdaQCD
- ("LambdaQCD",
+ static Parameter<HiddenValleyAlpha,Energy> interfaceLambdaDark
+ ("LambdaDark",
"Input value of Lambda_MSBar",
&HiddenValleyAlpha::_lambdain, GeV, 0.208364*GeV, 100.0*MeV, 100.0*GeV,
false, false, Interface::limited);
- static Parameter<HiddenValleyAlpha,double> interfaceAlphaMZ
- ("AlphaMZ",
- "The input value of the strong coupling at the Z mass ",
- &HiddenValleyAlpha::_alphain, 0.118, 0.1, 0.2,
- false, false, Interface::limited);
-
- static Switch<HiddenValleyAlpha,bool> interfaceInputOption
- ("InputOption",
- "Option for inputing the initial value of the coupling",
- &HiddenValleyAlpha::_inopt, true, false, false);
- static SwitchOption interfaceInputOptionAlphaMZ
- (interfaceInputOption,
- "AlphaMZ",
- "Use the value of alpha at MZ to calculate the coupling",
- true);
- static SwitchOption interfaceInputOptionLambdaQCD
- (interfaceInputOption,
- "LambdaQCD",
- "Use the input value of Lambda to calculate the coupling",
- false);
-
static Parameter<HiddenValleyAlpha,double> interfaceTolerance
("Tolerance",
"The tolerance for discontinuities in alphaS at thresholds.",
&HiddenValleyAlpha::_tolerance, 1e-10, 1e-20, 1e-4,
false, false, Interface::limited);
static Parameter<HiddenValleyAlpha,unsigned int> interfaceMaximumIterations
("MaximumIterations",
"The maximum number of iterations for the Newton-Raphson method to converge.",
&HiddenValleyAlpha::_maxtry, 100, 10, 1000,
false, false, Interface::limited);
static Switch<HiddenValleyAlpha,bool> interfaceThresholdOption
("ThresholdOption",
"Whether to use the consistuent or normal masses for the thresholds",
&HiddenValleyAlpha::_thresopt, true, false, false);
static SwitchOption interfaceThresholdOptionCurrent
(interfaceThresholdOption,
"Current",
"Use the current masses",
true);
static SwitchOption interfaceThresholdOptionConstituent
(interfaceThresholdOption,
"Constituent",
"Use the constitent masses.",
false);
}
double HiddenValleyAlpha::value(const Energy2 scale) const {
pair<short,Energy> nflam;
Energy q = sqrt(scale);
double val(0.);
// special handling if the scale is less than Qmin
if (q < _qmin) {
nflam = getLamNfTwoLoop(_qmin);
double val0 = alphaS(_qmin, nflam.second, nflam.first);
switch (_asType) {
case 1:
// flat, zero; the default type with no NP effects.
val = 0.;
break;
case 2:
// flat, non-zero alpha_s = alpha_s(q2min).
val = val0;
break;
case 3:
// linear in q
val = val0*q/_qmin;
break;
case 4:
// quadratic in q
val = val0*sqr(q/_qmin);
break;
case 5:
// quadratic in q, starting off at asMaxNP, ending on as(qmin)
val = (val0 - _asMaxNP)*sqr(q/_qmin) + _asMaxNP;
break;
case 6:
// just asMaxNP and constant
val = _asMaxNP;
break;
}
}
else {
// the 'ordinary' case
nflam = getLamNfTwoLoop(q);
val = alphaS(q, nflam.second, nflam.first);
}
return scaleFactor() * val;
}
double HiddenValleyAlpha::overestimateValue() const {
return scaleFactor() * _alphamin;
}
double HiddenValleyAlpha::ratio(const Energy2 scale,double) const {
pair<short,Energy> nflam;
Energy q = sqrt(scale);
double val(0.);
// special handling if the scale is less than Qmin
if (q < _qmin) {
nflam = getLamNfTwoLoop(_qmin);
double val0 = alphaS(_qmin, nflam.second, nflam.first);
switch (_asType) {
case 1:
// flat, zero; the default type with no NP effects.
val = 0.;
break;
case 2:
// flat, non-zero alpha_s = alpha_s(q2min).
val = val0;
break;
case 3:
// linear in q
val = val0*q/_qmin;
break;
case 4:
// quadratic in q
val = val0*sqr(q/_qmin);
break;
case 5:
// quadratic in q, starting off at asMaxNP, ending on as(qmin)
val = (val0 - _asMaxNP)*sqr(q/_qmin) + _asMaxNP;
break;
case 6:
// just asMaxNP and constant
val = _asMaxNP;
break;
}
} else {
// the 'ordinary' case
nflam = getLamNfTwoLoop(q);
val = alphaS(q, nflam.second, nflam.first);
}
// denominator
return val/_alphamin;
}
Energy HiddenValleyAlpha::computeLambda(Energy match,
double alpha,
unsigned int nflav) const {
Energy lamtest=200.0*MeV;
double xtest;
unsigned int ntry=0;
do {
++ntry;
xtest=log(sqr(match/lamtest));
xtest+= (alpha-alphaS(match,lamtest,nflav))/derivativealphaS(match,lamtest,nflav);
lamtest=match/exp(0.5*xtest);
}
while(abs(alpha-alphaS(match,lamtest,nflav)) > _tolerance && ntry < _maxtry);
return lamtest;
}
pair<short, Energy> HiddenValleyAlpha::getLamNfTwoLoop(Energy q) const {
unsigned int ix=1;
for(;ix<_thresholds.size();ix++) {
if(q<_thresholds[ix]) break;
}
--ix;
return pair<short,Energy>(ix+_nf_light, _lambda[ix]);
}
void HiddenValleyAlpha::doinit() {
ShowerAlpha::doinit();
// get the model for parameters
tcHiddenValleyPtr model = dynamic_ptr_cast<tcHiddenValleyPtr>
(generator()->standardModel());
if(!model) throw InitException() << "Must be using the HiddenValleyModel"
<< " in HiddenValleyAlpha::doinit()"
<< Exception::runerror;
// get the colour factors
_ca = model->CA();
_cf = model->CF();
_tr = model->TR();
// get the thresholds
_thresholds.push_back(_qmin);
_nf_light = 0;
for(unsigned int ix=1;ix<=model->NF();++ix) {
Energy qmass = getParticleData(ParticleID::darkg+long(ix))->mass();
if (qmass > _qmin) _thresholds.push_back(qmass);
else _nf_light++;
}
_lambda.resize(_thresholds.size());
- Energy mz = getParticleData(ThePEG::ParticleID::Z0)->mass();
- unsigned int nf_heavy;
- for(nf_heavy=0;nf_heavy<_thresholds.size();++nf_heavy) {
- if(mz<_thresholds[nf_heavy]) break;
- }
- nf_heavy-=1;
- unsigned int nf = _nf_light+nf_heavy;
+
+
+ unsigned int nf = _nf_light;
- // value of Lambda from alphas if needed using Newton-Raphson
- if(_inopt) {
- _lambda[nf_heavy] = computeLambda(mz,_alphain,nf-1);
- }
- // otherwise it was an input parameter
- else{_lambda[nf_heavy]=_lambdain;}
+ // Set lambda below heavy quark thresholds to input value
+ _lambda[0]=_lambdain;
// convert lambda to the Monte Carlo scheme if needed
using Constants::pi;
- if(_lambdaopt) _lambda[nf_heavy] *=exp((0.5*_ca*(67./3.-sqr(pi))-_tr*nf*10./3.)/(11*_ca-2*nf))/sqrt(2.);
+ if(_lambdaopt) _lambda[0] *=exp((0.5*_ca*(67./3.-sqr(pi))-_tr*nf*10./3.)/(11*_ca-2*nf))/sqrt(2.);
- // compute the threshold matching
- // above the Z mass
- for(int ix=nf_heavy;ix<int(_thresholds.size())-1;++ix) {
+ // Compute the threshold matching
+ for(int ix=0;ix<int(_thresholds.size())-1;++ix) {
_lambda[ix+1] = computeLambda(_thresholds[ix+1],alphaS(_thresholds[ix+1],
_lambda[ix],ix),ix+1);
}
- // below Z mass
- for(int ix=nf_heavy-1;ix>=0;--ix) {
- _lambda[ix] = computeLambda(_thresholds[ix+1],alphaS(_thresholds[ix+1],
- _lambda[ix+1],ix+1),ix);
- }
// compute the maximum value of as
if ( _asType < 5 ) _alphamin = value(sqr(_qmin)+1.0e-8*sqr(MeV)); // approx as = 1
else _alphamin = max(_asMaxNP, value(sqr(_qmin)+1.0e-8*sqr(MeV)));
// check consistency lambda_3 < qmin
if(_lambda[0]>_qmin)
Throw<InitException>() << "The value of Qmin is less than Lambda in "
<< _qmin/GeV << " < " << _lambda[0]/GeV
<< " HiddenValleyAlpha::doinit " << Exception::abortnow;
}
double HiddenValleyAlpha::derivativealphaS(Energy q, Energy lam, int nf) const {
using Constants::pi;
double lx = log(sqr(q/lam));
// N.B. b_1 is divided by 2 due Hw++ convention
double b0 = 11./3.*_ca - 4./3.*_tr*nf;
double b1 = 17./3.*sqr(_ca) - nf*_tr*(10./3.*_ca+2.*_cf);
if(_nloop==1)
return -4.*pi/(b0*sqr(lx));
else if(_nloop==2)
return -4.*pi/(b0*sqr(lx))*(1.-2.*b1/sqr(b0)/lx*(1.-2.*log(lx)));
else
assert(false);
return 0.;
}
double HiddenValleyAlpha::alphaS(Energy q, Energy lam, int nf) const {
using Constants::pi;
double lx(log(sqr(q/lam)));
// N.B. b_1 is divided by 2 due Hw++ convention
double b0 = 11./3.*_ca - 4./3.*_tr*nf;
double b1 = 17./3.*sqr(_ca) - nf*_tr*(10./3.*_ca+2.*_cf);
// one loop
if(_nloop==1)
return 4.*pi/(b0*lx);
// two loop
else if(_nloop==2) {
return 4.*pi/(b0*lx)*(1.-2.*b1/sqr(b0)*log(lx)/lx);
}
else
assert(false);
return 0.;
}
diff --git a/Shower/QTilde/Dark/HiddenValleyAlpha.h b/Shower/QTilde/Dark/HiddenValleyAlpha.h
--- a/Shower/QTilde/Dark/HiddenValleyAlpha.h
+++ b/Shower/QTilde/Dark/HiddenValleyAlpha.h
@@ -1,338 +1,333 @@
// -*- C++ -*-
//
// HiddenValleyAlpha.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_HiddenValleyAlpha_H
#define HERWIG_HiddenValleyAlpha_H
//
// This is the declaration of the HiddenValleyAlpha class.
//
#include "Herwig/Shower/ShowerAlpha.h"
#include "ThePEG/Config/Constants.h"
namespace Herwig {
using namespace ThePEG;
/** \ingroup Shower
*
* This concrete class provides the definition of the
* pure virtual function value() and overestimateValue() for the
* strong coupling.
*
* A number of different options for the running of the coupling
* and its initial definition are supported.
*
* @see \ref HiddenValleyAlphaInterfaces "The interfaces"
* defined for HiddenValleyAlpha.
*/
class HiddenValleyAlpha: public ShowerAlpha {
public:
/**
* The default constructor.
*/
HiddenValleyAlpha() : ShowerAlpha(),
_qmin(0.630882*GeV), _asType(1), _asMaxNP(1.0),
_nloop(2),_thresopt(false),
- _lambdain(0.208364*GeV),_alphain(0.118),
+ _lambdain(0.208364*GeV),
_tolerance(1e-10),
_maxtry(100),_alphamin(0.) {}
public:
/**
* Methods to return the coupling
*/
//@{
/**
* It returns the running coupling value evaluated at the input scale
* multiplied by the scale factor scaleFactor().
* @param scale The scale
* @return The coupling
*/
virtual double value(const Energy2 scale) const;
/**
* It returns the running coupling value evaluated at the input scale
* multiplied by the scale factor scaleFactor().
*/
virtual double overestimateValue() const;
/**
* Return the ratio of the coupling at the scale to the overestimated value
*/
virtual double ratio(const Energy2 scale,double factor=1.) const;
/**
* Initialize this coupling.
*/
virtual void initialize() { doinit(); }
//@}
/**
* Get the value of \f$\Lambda_{\rm QCd}\f$
* @param nf number of flavours
*/
Energy lambdaQCD(unsigned int nf) {
if (nf <= 3) return _lambda[0];
else if (nf==4 || nf==5) return _lambda[nf-3];
else return _lambda[3];
}
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 after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
private:
/**
* Member functions which calculate the coupling
*/
//@{
/**
* The 1,2,3-loop parametrization of \f$\alpha_S\f$.
* @param q The scale
* @param lam \f$\Lambda_{\rm QCD}\f$
* @param nf The number of flavours
*/
double alphaS(Energy q, Energy lam, int nf) const;
/**
* The derivative of \f$\alpha_S\f$ with respect to \f$\ln(Q^2/\Lambda^2)\f$
* @param q The scale
* @param lam \f$\Lambda_{\rm QCD}\f$
* @param nf The number of flavours
*/
double derivativealphaS(Energy q, Energy lam, int nf) const;
/**
* Compute the value of \f$Lambda\f$ needed to get the input value of
* the strong coupling at the scale given for the given number of flavours
* using the Newton-Raphson method
* @param match The scale for the coupling
* @param alpha The input coupling
* @param nflav The number of flavours
*/
Energy computeLambda(Energy match, double alpha, unsigned int nflav) const;
/**
* Return the value of \f$\Lambda\f$ and the number of flavours at the scale.
* @param q The scale
* @return The number of flavours at the scale and \f$\Lambda\f$.
*/
pair<short, Energy> getLamNfTwoLoop(Energy q) 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<HiddenValleyAlpha> initHiddenValleyAlpha;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
HiddenValleyAlpha & operator=(const HiddenValleyAlpha &);
private:
/**
* Minimum value of the scale
*/
Energy _qmin;
/**
* Parameter controlling the behaviour of \f$\alpha_S\f$ in the
* non-perturbative region.
*/
int _asType;
/**
* Another parameter, a possible (maximum) value of alpha in the
* non-perturbative region.
*/
double _asMaxNP;
/**
* Thresholds for the different number of flavours
*/
vector<Energy> _thresholds;
/**
* \f$\Lambda\f$ for the different number of flavours
*/
vector<Energy> _lambda;
/**
* Option for the number of loops
*/
unsigned int _nloop;
/**
* Option for the threshold masses
*/
bool _thresopt;
/**
* Input value of Lambda
*/
Energy _lambdain;
/**
- * Input value of \f$alpha_S(M_Z)\f$
- */
- double _alphain;
-
- /**
* Whether to convert lambda from MSbar scheme
*/
bool _lambdaopt;
/**
* Whether to use input value of alphas(MZ) or lambda
*/
bool _inopt;
/**
* Tolerance for discontinuities at the thresholds
*/
double _tolerance;
/**
* Maximum number of iterations for the Newton-Raphson method to converge
*/
unsigned int _maxtry;
/**
* Number of light flavours (below qmin)
*/
unsigned int _nf_light;
/**
* The minimum value of the coupling
*/
double _alphamin;
/**
* Colour factors
*/
//@{
/**
* \f$C_A\f$
*/
double _ca;
/**
* \f$C_A\f$
*/
double _cf;
/**
* \f$T_R\f$
*/
double _tr;
//@}
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of HiddenValleyAlpha. */
template <>
struct BaseClassTrait<Herwig::HiddenValleyAlpha,1> {
/** Typedef of the first base class of HiddenValleyAlpha. */
typedef Herwig::ShowerAlpha NthBase;
};
/** This template specialization informs ThePEG about the name of
* the HiddenValleyAlpha class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::HiddenValleyAlpha>
: public ClassTraitsBase<Herwig::HiddenValleyAlpha> {
/** Return a platform-independent class name */
static string className() { return "Herwig::HiddenValleyAlpha"; }
/**
* The name of a file containing the dynamic library where the class
* HiddenValleyAlpha is implemented. It may also include several,
* space-separated, libraries if the class HiddenValleyAlpha 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 HwHiddenValley.so"; }
};
/** @endcond */
}
#endif /* HERWIG_HiddenValleyAlpha_H */
diff --git a/Shower/QTilde/SplittingFunctions/PTCutOff.cc b/Shower/QTilde/SplittingFunctions/PTCutOff.cc
--- a/Shower/QTilde/SplittingFunctions/PTCutOff.cc
+++ b/Shower/QTilde/SplittingFunctions/PTCutOff.cc
@@ -1,66 +1,66 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the PTCutOff class.
//
#include "PTCutOff.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
IBPtr PTCutOff::clone() const {
return new_ptr(*this);
}
IBPtr PTCutOff::fullclone() const {
return new_ptr(*this);
}
void PTCutOff::persistentOutput(PersistentOStream & os) const {
os << ounit(pTmin_,GeV) << ounit(pT2min_,GeV2);
}
void PTCutOff::persistentInput(PersistentIStream & is, int) {
is >> iunit(pTmin_,GeV) >> iunit(pT2min_,GeV2);
}
// The following static variable is needed for the type
// description system in ThePEG.
DescribeClass<PTCutOff,SudakovCutOff>
describeHerwigPTCutOff("Herwig::PTCutOff", "HwShower.so");
void PTCutOff::Init() {
static ClassDocumentation<PTCutOff> documentation
("There is no documentation for the PTCutOff class");
static Parameter<PTCutOff,Energy> interfacepTmin
("pTmin",
"The minimum pT if using a cut-off on the pT",
- &PTCutOff::pTmin_, GeV, 1.0*GeV, ZERO, 100.0*GeV,
+ &PTCutOff::pTmin_, GeV, 1.0*GeV, ZERO, 1000.0*GeV,
false, false, Interface::limited);
}
void PTCutOff::doinit() {
pT2min_ = sqr(pTmin_);
SudakovCutOff::doinit();
}
const vector<Energy> & PTCutOff::virtualMasses(const IdList & ids) {
static vector<Energy> output;
output.clear();
for(auto id : ids)
output.push_back(id->mass());
return output;
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 8:05 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3801685
Default Alt Text
(88 KB)

Event Timeline