Page MenuHomeHEPForge

No OneTemporary

diff --git a/MatrixElement/BlobDiagram.cc b/MatrixElement/BlobDiagram.cc
--- a/MatrixElement/BlobDiagram.cc
+++ b/MatrixElement/BlobDiagram.cc
@@ -1,179 +1,184 @@
// -*- C++ -*-
//
// BlobDiagram.cc is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG 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 BlobDiagram class.
//
#include "BlobDiagram.h"
#include "ThePEG/EventRecord/SubProcess.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Utilities/Rebinder.h"
#include "ThePEG/Utilities/UtilityBase.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "ThePEG/PDT/EnumParticles.h"
using namespace ThePEG;
BlobDiagram::~BlobDiagram() {}
BlobDiagram & BlobDiagram::add(tcPDPtr pd) {
if ( thePartons.size() < theNSpace ) addSpacelike(pd);
- else addTimelike(pd, nextOrig);
+ else addTimelike(pd);
return *this;
}
-void BlobDiagram::addTimelike(tcPDPtr pd, size_type orig) {
+void BlobDiagram::addTimelike(tcPDPtr pd) {
+ if ( allPartons().size() < theNSpace) throw BlobDiagramError();
+ thePartons.push_back(pd);
+}
+
+/*void BlobDiagram::addTimelike(tcPDPtr pd, size_type orig) {
if ( allPartons().size() < theNSpace ||
orig >= allPartons().size())
throw BlobDiagramError();
thePartons.push_back(pd);
theParents.push_back(orig);
-}
+}*/
tPVector BlobDiagram::
construct(SubProPtr sp, const StandardXComb & xc, const ColourLines & cl) const {
tPVector out;
vector<Lorentz5Momentum> pout(xc.meMomenta().begin() + 2,
xc.meMomenta().end()); //outgoing momenta
//not sure what the following 4 lines do: perhaps they order the momenta in some specific order expected later on
if ( xc.needsReshuffling() )
xc.reshuffle(pout);
tPPair in = xc.lastPartons();
if ( xc.mirror() ) swap(in.first, in.second); // in seems to be the incoming particles (?)
/*if the incoming particles from in do not match the first space-like parton
or the last space-like parton (which should be the incoming particles,
then it throws an error
*/
tPVector ret;
if ( in.first->dataPtr() != allPartons()[0] ||
in.second->dataPtr() != allPartons()[nSpace() - 1] )
throw BlobDiagramError();
/* now it starts looking at space-like partons */
PVector slike;
slike.push_back(in.first); //puts the first incoming one in
/*the following loop starts from the second space-like parton and goes up to the penultimate one:
it seems to end up in a PVector containing firstly the first incoming parton, then all the other spacelike partons and then
in the last entry the second incoming parton*/
for ( int i = 1; i < nSpace() - 1; ++i )
slike.push_back(allPartons()[i]->produceParticle()); //what exactly is produceParticle?
slike.push_back(in.second);
/* in what follows, ret seems to be a vector containing all the space-like partons,
as constructed in PVector above */
ret = tPVector(slike.begin(), slike.end());
/*for each space-like parton, starting from the first incoming, the space-like parton that follows it
is defined as its child*/
for ( size_type i = 1; i < slike.size() - 1; ++i ) {
slike[i-1]->addChild(slike[i]);
/* not quite sure what the following line does but my guess is that it
adds to the SubProPtr (subprocess pointer?) a space-like parton,
as intermediate particle, excluding the first or last one (i.e. the incoming ones) */
sp->addIntermediate(slike[xc.mirror()? i: slike.size() - 1 - i], false);
}
//the int io is simply the size of the outgoing momenta
int io = pout.size();
//the PVector tlike has the size of # of all partons minus the # of space-like ones
PVector tlike(allPartons().size() - nSpace());
//Not sure what a ParticleSet is!
ParticleSet done;
for ( int i = allPartons().size() - 1; i >= nSpace(); --i ) {
int it = i - nSpace(); //it is a counter that should start at the number of time-like partons and count down to zero.
tlike[it] = allPartons()[i]->produceParticle(pout[--io]);
done.insert(tlike[it]);
//add the time-like parton as the child of both incoming (space-like) partons.
slike[0]->addChild(tlike[it]);
slike[1]->addChild(tlike[it]);
out.push_back(tlike[it]);
}
//the next line adds the time-like partons as found above to tPVector ret.
ret.insert(ret.end(), tlike.begin(), tlike.end());
//the next line seems to loop through the tPVector out and add the particles to the SubProPtr sp as outgoing, given some condition I need to think about.
for ( int i = 0, N = out.size(); i < N; ++i )
sp->addOutgoing(out[xc.mirror()? i: out.size() - i - 1], false);
//Perform the colour connections?
cl.connect(ret);
return out;
}
tcPDPair BlobDiagram::incoming() const {
return tcPDPair(allPartons()[0], allPartons()[nSpace() - 1]);
}
tcPDVector BlobDiagram::outgoing() const {
tcPDVector pdv;
for ( size_type i = nSpace(); i < allPartons().size(); ++i )
if ( children(i)[0] < 0 ) pdv.push_back(allPartons()[i]);
return pdv;
}
tcPDVector BlobDiagram::external() const {
tcPDVector pdv;
pdv.push_back(allPartons()[0]);
pdv.push_back(allPartons()[nSpace() - 1]);
for ( size_type i = nSpace(); i < allPartons().size(); ++i )
if ( children(i)[0] < 0 ) pdv.push_back(allPartons()[i]);
return pdv;
}
vector<int> BlobDiagram::children(int ii) const {
vector<int> ret;
/*loop through all the parents and check whether particle ii is the parent of parrticle i,
if so, push it into the vector ret
*/
for ( size_type i = 0; i < theParents.size(); ++i ) {
if ( parent(i) == ii ) {
ret.push_back(i);
}
}
if(ret.size() == 0) {
ret.push_back(-1);
}
return ret;
}
void BlobDiagram::check() {
vector< pair<int,int> > children(allPartons().size(), make_pair(-1, -1));
theNOutgoing = 0;
cPDVector parts(2);
parts[0] = incoming().first;
parts[1] = incoming().second;
tcPDVector out(outgoing());
parts.insert(parts.end(), out.begin(), out.end());
partons(2, parts, nextOrig + 1);
}
ClassDescription<BlobDiagram> BlobDiagram::initBlobDiagram;
void BlobDiagram::persistentInput(PersistentIStream & is, int) {
is >> theNSpace >> theNOutgoing >> thePartons >> theParents >> nextOrig;
}
void BlobDiagram::persistentOutput(PersistentOStream & os) const {
os << theNSpace << theNOutgoing << thePartons << theParents << nextOrig;
}
BlobDiagramError::BlobDiagramError() {
theMessage << "An error occurred while setting up a diagram of class "
<< "'BlobDiagram'.";
severity(abortnow);
}
diff --git a/MatrixElement/BlobDiagram.h b/MatrixElement/BlobDiagram.h
--- a/MatrixElement/BlobDiagram.h
+++ b/MatrixElement/BlobDiagram.h
@@ -1,295 +1,295 @@
// -*- C++ -*-
//
// BlobDiagram.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef ThePEG_BlobDiagram_H
#define ThePEG_BlobDiagram_H
// This is the declaration of the BlobDiagram class.
#include "ThePEG/MatrixElement/DiagramBase.h"
#include "ThePEG/MatrixElement/ColourLines.h"
#include "ThePEG/Handlers/StandardXComb.fh"
#include "BlobDiagram.xh"
namespace ThePEG {
/**
* The BlobDiagram class inherits from DiagramBase and represents
* a Feynman tree diagram. It is represented by a chain of \f$n\f$
* space-like propagators, where one incoming particle has index 1 and
* other incoming one index \f$n\f$. For adiagram with in total
* \f$m\f$ propagators the timelike propagators are then numbered
* \f$n+1\f$ through \f$m\f$. The vector of type of the propagators
* are accessible from the partons() method, and the parents of
* propagator \f$i\f$ form the parents(int) method. The parent of a
* space-like propagator is simply the previous space-like one. The
* parent of a time-like propagator is either a previous time-like
* propagator or the first of the connecting space-like ones.
*
* A BlobDiagram is created by first constructing it with an
* integer corresponding to the number of space-like propagators. Then
* the comma operator is used to add first the particle data objects
* corresponding to the space-like propagators, then the time-like
* ones preceeded with the index of their parents. To complete a
* BlobDiagram, a negative integer is added with the comma
* operator. This number is then used as an identifier. Note that the
* parent must have been added before a child is. As an example, the
* s-channel diagram \f$e \nu_e \rightarrow u \bar{d}\f$ is created
* thus:<br>
* <code>BlobDiagram(2),eplus,nue,1,Wplus,3,u,3,dbar</code>.<br>
* Similarly the t-channel diagram \f$e d \rightarrow \nu_e u\f$ is
* created thus:<br>
* <code>BlobDiagram(3),eplus,Wplus,d,1,nu,2,u</code>. Note that
* only two chidren are allowed per propagator. This means that
* four-propagator vertices are not allowed, but must be represented
* by two three-propagator ones.
*
* Please note that for technical reasons, when specifying the
* diagrams with the comma operator the numbering of the particles is
* \f$1\ldots m\f$, while the internal representation (in the
* parent(int) and children(int) function) is using \f$0\ldots m-1\f$
*
* @see DiagramBase
* @see ColourLines
*
*/
class BlobDiagram: public DiagramBase {
public:
/** The integer type reresenting vector sizes. */
typedef cPDVector::size_type size_type;
/** A multi-set of particle data objects. */
typedef multiset<tcPDPtr> PDMSet;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
BlobDiagram()
- : theNSpace(0), theNOutgoing(0), nextOrig(0) {}
+ : theNSpace(2), theNOutgoing(0), nextOrig(0) {}
/**
* Destructor.
*/
~BlobDiagram();
/**
* The standard constructor giving the number of \a space-like
* propagators.
*/
- explicit BlobDiagram(int space)
- : theNSpace(space), theNOutgoing(0), nextOrig(-1) {}
+ //explicit BlobDiagram()
+ // : theNSpace(2), theNOutgoing(0), nextOrig(-1) {}
//@}
public:
/**
* If less than zero indicate that this tree is competed. Otherwise
* signal the parent of the next added parton.
*/
BlobDiagram & operator,(int o) {
nextOrig = o - 1;
if ( o < 0 ) check();
return *this;
}
/**
* Add a space- or time-like parton.
*/
BlobDiagram & operator,(PDPtr pd) { return add(pd); }
/**
* Add a space- or time-like parton.
*/
BlobDiagram & operator,(cPDPtr pd) { return add(pd); }
/**
* Add a space- or time-like parton.
*/
BlobDiagram & operator,(tPDPtr pd) { return add(pd); }
/**
* Add a space- or time-like parton.
*/
BlobDiagram & operator,(tcPDPtr pd) { return add(pd); }
/**
* Construct a sub process corresponding to this diagram. The
* incoming partons, and the momenta of the outgoing ones, are given
* by the XComb object. All parent/children pointers should be set
* correspondingly and the partons should be colour connected as
* specified by the ColourLines object.
*/
virtual tPVector construct(SubProPtr sb, const StandardXComb &,
const ColourLines &) const;
/**
* Return the types of the incoming partons.
*/
tcPDPair incoming() const;
/**
* Return the complete vector of partons in this tree diagram.
*/
const cPDVector & allPartons() const { return thePartons; }
/**
* Return the outgoing parton types of this tree diagram.
*/
tcPDVector outgoing() const;
/**
* Return the incoming followed by the outgoing parton types of this
* tree diagram.
*/
tcPDVector external() const;
/**
* Return the index of the parent of the given parton.
*/
int parent(int i) const { return theParents[i]; }
/**
* Return the indices of the children of the given parton.
*/
vector<int> children(int) const;
/**
* Return the number of space-like partons
*/
int nSpace() const { return theNSpace; }
/**
* Return the number of outgoing partons.
*/
int nOutgoing() const { return theNOutgoing; }
private:
/**
* Check the consistency of this tree diagram.
*/
void check();
/**
* Add a space-like parton to this diagram.
*/
void addSpacelike(tcPDPtr pd) {
if ( thePartons.size() >= theNSpace ) throw BlobDiagramError();
theParents.push_back(thePartons.size() - 1);
thePartons.push_back(pd);
}
/**
* Add a time-like parton to this diagram.
*/
void addTimelike(tcPDPtr);
/**
* Add a time-like parton to this diagram indicating its \a origin.
*/
void addTimelike(tcPDPtr, size_type origin);
/**
* Add a parton to this diagram.
*/
BlobDiagram & add(tcPDPtr);
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);
//@}
private:
/**
* The number of space-like partons
*/
size_type theNSpace;
/**
* The number of outgoing partons.
*/
int theNOutgoing;
/**
* The parent of the next added parton.
*/
int nextOrig;
/**
* The complete vector of partons in this tree diagram.
*/
cPDVector thePartons;
/**
* The index of the parents.
*/
vector<int> theParents;
private:
/**
* Describe a concrete class with persistent data.
*/
static ClassDescription<BlobDiagram> initBlobDiagram;
/**
* Private and non-existent assignment operator.
*/
BlobDiagram & operator=(const BlobDiagram &);
};
}
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* This template specialization informs ThePEG about the
* base class of BlobDiagram.
*/
template <>
struct BaseClassTrait<BlobDiagram,1>: public ClassTraitsType {
/** Typedef of the base class of BlobDiagram. */
typedef DiagramBase NthBase;
};
/**
* This template specialization informs ThePEG about the name of the
* BlobDiagram class.
*/
template <>
struct ClassTraits<BlobDiagram>: public ClassTraitsBase<BlobDiagram> {
/** Return the class name. */
static string className() { return "ThePEG::BlobDiagram"; }
};
/** @endcond */
}
#endif /* ThePEG_BlobDiagram_H */

File Metadata

Mime Type
text/x-diff
Expires
Wed, May 14, 10:51 AM (1 d, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5111275
Default Alt Text
(14 KB)

Event Timeline