Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F11222512
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
View Options
diff --git a/MatrixElement/BlobMEBase.cc b/MatrixElement/BlobMEBase.cc
--- a/MatrixElement/BlobMEBase.cc
+++ b/MatrixElement/BlobMEBase.cc
@@ -1,102 +1,102 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the BlobMEBase class.
//
#include "BlobMEBase.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"
using namespace ThePEG;
BlobMEBase::BlobMEBase() {}
BlobMEBase::~BlobMEBase() {}
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/MatrixElement/BlobDiagram.h"
string BlobMEBase::ColourConnection::write(size_t& sourceCount,
bool sink) const {
string res;
if ( members.size() == 2 ) {
// standard connection
for ( auto it = members.begin(); it != members.end(); ++it )
res += std::to_string(*it) + " ";
} else if ( members.size() == 3 ) {
// source or sink
for ( auto it = members.begin(); it != members.end(); ++it ) {
res += std::to_string(*it) + " " + (sink ? "-":"") + std::to_string(sourceCount);
if ( std::next(it) != members.end() )
res += ", ";
}
sourceCount += 1;
} else {
// not handled
throw Exception() << "BlobMEBase::ColourConnection::write: Invalid colour connection information."
<< Exception::runerror;
}
return res;
}
void BlobMEBase::getDiagrams() const {
multimap<tcPDPair,tcPDVector> proc = processes();
int id = 1;
for ( auto it = proc.begin(); it != proc.end(); ++it, ++id ) {
BlobDiagram diag(id,it->first.first,it->first.second);
for ( auto pit = it->second.begin(); pit != it->second.end(); ++pit )
diag.operator,(*pit);
add(new_ptr(diag));
}
}
Selector<MEBase::DiagramIndex>
BlobMEBase::diagrams(const DiagramVector & diags) const {
assert(diags.size()==1);
Selector<DiagramIndex> sel;
sel.insert(1.0, 0);
return sel;
}
Selector<const ColourLines *>
BlobMEBase::colourGeometries(tcDiagPtr diag) const {
auto connections = colourConnections();
ostringstream clines;
size_t sourceCount = diag->partons().size() + 1;
for ( auto it = connections.begin(); it != connections.end(); ++it ) {
bool sink = (it->members.size()==3 &&
(-it->members[0] > diag->nIncoming() ||
- it->members[0] < diag->nIncoming() ) );
+ it->members[0] <= diag->nIncoming() ) );
clines << it->write(sourceCount,sink);
auto nit = it; ++nit;
if ( nit != connections.end() )
clines << ",";
}
theColourLines.reset(clines.str());
Selector<const ColourLines *> sel;
sel.insert(1.0,&theColourLines);
return sel;
}
CrossSection BlobMEBase::dSigHatDR() const {
if ( !lastXCombPtr()->willPassCuts() )
return ZERO;
return
(sqr(hbarc)/(2.*lastSHat())) *
jacobian() * me2();
}
AbstractNoPIOClassDescription<BlobMEBase> BlobMEBase::initBlobMEBase;
void BlobMEBase::Init() {
static ClassDocumentation<BlobMEBase> documentation
("BlobMEBase is the base class for matrix elements producing blobs.");
}
diff --git a/MatrixElement/ColourLines.cc b/MatrixElement/ColourLines.cc
--- a/MatrixElement/ColourLines.cc
+++ b/MatrixElement/ColourLines.cc
@@ -1,142 +1,142 @@
// -*- C++ -*-
//
// ColourLines.cc is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2017 Leif Lonnblad
//
// ThePEG 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 ColourLines class.
//
#include "ColourLines.h"
#include "ColourLines.xh"
#include "ThePEG/EventRecord/ColourLine.h"
#include "ThePEG/EventRecord/MultiColour.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Utilities/StringUtils.h"
using namespace ThePEG;
ColourLines::ColourLines(string s) {
reset(s);
}
void ColourLines::reset(string s) {
theLines.clear();
while ( true ) {
string line = StringUtils::car(s, ",");
line = StringUtils::stripws(line);
Line l;
while (line!="") {
string loc = StringUtils::car(line);
string first = StringUtils::car(loc,":");
string second = StringUtils::cdr(loc,":");
if(second!="") {
int i;
istringstream is(first);
is >> i;
int j;
istringstream is2(second);
is2 >> j;
l.push_back(make_pair(i,j));
}
else {
int i;
istringstream is(first);
is >> i;
l.push_back(make_pair(i,0));
}
line = StringUtils::cdr(line);
};
if ( l.empty() ) return;
theLines.push_back(l);
s = StringUtils::cdr(s, ",");
}
}
void ColourLines::connect(const tPVector & partons) const {
VertexVector sinks;
VertexVector sources;
long np = partons.size();
// Create each line and connect the specified partons to them. Save
// all lines coming from a source or ending in a sink.
for ( LineVector::size_type il = 0; il < theLines.size(); ++il ) {
const Line & line = theLines[il];
ColinePtr cline = new_ptr(ColourLine());
for ( Line::size_type i = 0; i < line.size(); ++i ) {
if ( line[i].first > np ) {
// this is a colour source.
int is = line[i].first - np;
- sources.resize(is);
+ if(is>int(sources.size())) sources.resize(is);
sources[is - 1].push_back(cline);
} else if ( -line[i].first > np ) {
// this is a colour sink.
int is = -line[i].first - np;
- sinks.resize(is);
+ if(is>int(sinks.size())) sinks.resize(is);
sinks[is - 1].push_back(cline);
} else if ( line[i].first > 0 ) {
// This is a coloured particle.
if ( !partons[line[i].first - 1]->hasColour() )
throw ColourGeometryException(partons, line);
if(line[i].second==0) {
cline->addColoured(partons[line[i].first - 1]);
}
else {
Ptr<MultiColour>::pointer colour =
dynamic_ptr_cast<Ptr<MultiColour>::pointer>(partons[line[i].first - 1]->colourInfo());
assert(colour);
colour->colourLine(cline,line[i].second);
}
} else {
if ( !partons[-line[i].first - 1]->hasAntiColour() )
throw ColourGeometryException(partons, line);
if(line[i].second==0) {
cline->addAntiColoured(partons[-line[i].first - 1]);
}
else {
Ptr<MultiColour>::pointer colour =
dynamic_ptr_cast<Ptr<MultiColour>::pointer>(partons[-line[i].first - 1]->colourInfo());
assert(colour);
colour->antiColourLine(cline,line[i].second);
}
}
}
}
// Now connect up all lines steming from sources.
for ( VertexVector::size_type i = 0; i < sources.size(); ++i ) {
if ( sources[i].empty() ) continue;
if ( sources[i].size() != 3 ) throw ColourGeometryException(partons,
vector<pair<int,int> >() );
sources[i][0]->setSourceNeighbours(sources[i][1], sources[i][2]);
}
// Now connect up all lines ending in sinks.
for ( VertexVector::size_type i = 0; i < sinks.size(); ++i ) {
if ( sinks[i].empty() ) continue;
if ( sinks[i].size() != 3 ) throw ColourGeometryException(partons,
vector<pair<int,int> >());
sinks[i][0]->setSinkNeighbours(sinks[i][1], sinks[i][2]);
}
}
ColourGeometryException::
ColourGeometryException(const tPVector & p, const vector<pair<int,int> > & c) {
if ( c.empty() )
theMessage << "The number of colour lines steming from one colour source "
<< "or ending in one colour sink was not equal to three.\n";
else {
theMessage << "Cannot connect the following partons:\n";
for ( unsigned i = 0; i < p.size(); ++i )
theMessage << " " << p[i]->PDGName();
theMessage << "\n to the following colour line:\n";
for ( unsigned i = 0; i < c.size(); ++i ) theMessage << " (" << c[i].first << ","
<< c[i].second << ") ";
theMessage << endl;
}
severity(maybeabort);
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, May 14, 12:02 PM (59 m, 30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5111590
Default Alt Text
(7 KB)
Attached To
rTHEPEGHG thepeghg
Event Timeline
Log In to Comment