Page MenuHomeHEPForge

No OneTemporary

diff --git a/MatrixElement/BlobDiagram.cc b/MatrixElement/BlobDiagram.cc
--- a/MatrixElement/BlobDiagram.cc
+++ b/MatrixElement/BlobDiagram.cc
@@ -1,184 +1,104 @@
// -*- 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/Utilities/Exception.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);
- return *this;
-}
-
-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();
+ if ( in.first->dataPtr() != partons()[0] ||
+ in.second->dataPtr() != partons()[1] )
+ throw Exception() << "incoming partons in XComb do not match incoming partons in BlobDiagram"
+ << Exception::setuperror;
/* 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());
+ PVector tlike(partons().size() - 2);
//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]);
+ for ( int i = partons().size() - 1; i >= 2; --i ) {
+ int it = i - 2; //it is a counter that should start at the number of time-like partons and count down to zero.
+ tlike[it] = partons()[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.
+ //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::persistentInput(PersistentIStream &, int) {}
-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);
-}
-
+void BlobDiagram::persistentOutput(PersistentOStream &) const {}
diff --git a/MatrixElement/BlobDiagram.h b/MatrixElement/BlobDiagram.h
--- a/MatrixElement/BlobDiagram.h
+++ b/MatrixElement/BlobDiagram.h
@@ -1,295 +1,188 @@
// -*- 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$
+ * The BlobDiagram class inherits from DiagramBase and represents a general
+ * Feynman diagram of which no further substructure is assumed.
*
* @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.
+ * Default constructor
*/
- BlobDiagram()
- : theNSpace(2), theNOutgoing(0), nextOrig(0) {}
+ BlobDiagram()
+ : DiagramBase() {}
+
+ /**
+ * Constructor specifiying incoming partons
+ */
+ BlobDiagram(int id, tcPDPtr first, tcPDPtr second)
+ : DiagramBase() {
+ thePartons.push_back(first);
+ thePartons.push_back(second);
+ diagramInfo(2,id);
+ }
/**
* Destructor.
*/
~BlobDiagram();
-
- /**
- * The standard constructor giving the number of \a space-like
- * propagators.
- */
- //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.
+ * Add a space- or time-like parton.
*/
- BlobDiagram & operator,(int o) {
- nextOrig = o - 1;
- if ( o < 0 ) check();
- return *this;
- }
+ BlobDiagram& operator,(PDPtr pd) { addParton(pd); return *this; }
/**
* Add a space- or time-like parton.
*/
- BlobDiagram & operator,(PDPtr pd) { return add(pd); }
+ BlobDiagram& operator,(cPDPtr pd) { addParton(pd); return *this; }
/**
* Add a space- or time-like parton.
*/
- BlobDiagram & operator,(cPDPtr pd) { return add(pd); }
+ BlobDiagram& operator,(tPDPtr pd) { addParton(pd); return *this; }
/**
* 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); }
+ BlobDiagram& operator,(tcPDPtr pd) { addParton(pd); return *this; }
/**
* 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;
+ 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; }
+ tcPDPair incoming() const {
+ return tcPDPair(partons()[0],partons()[1]);
+ }
/**
* Return the outgoing parton types of this tree diagram.
*/
- tcPDVector outgoing() const;
+ tcPDVector outgoing() const {
+ return tcPDVector(partons().begin()+2,partons().end());
+ }
/**
* 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; }
+ tcPDVector external() const {
+ return tcPDVector(partons().begin(),partons().end());
+ }
/**
* 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);
+ size_type nOutgoing() const { return thePartons.size() - 2; }
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 */
diff --git a/MatrixElement/BlobDiagram.xh b/MatrixElement/BlobDiagram.xh
deleted file mode 100644
--- a/MatrixElement/BlobDiagram.xh
+++ /dev/null
@@ -1,31 +0,0 @@
-// -*- C++ -*-
-//
-// BlobDiagram.xh 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_XH
-#define ThePEG_BlobDiagram_XH
-//
-// This is the declarations of the exception classes used by the
-// BlobDiagram class.
-//
-
-#include "ThePEG/Utilities/Exception.h"
-
-namespace ThePEG {
-
-/** @cond EXCEPTIONCLASSES */
-/** Exception class used by BlobDiagram to signal inconsistencies. */
-struct BlobDiagramError: public Exception {
- /** Default constructor. */
- BlobDiagramError();
-};
-/** @endcond */
-
-}
-
-#endif /* ThePEG_BlobDiagram_XH */
-
diff --git a/MatrixElement/DiagramBase.h b/MatrixElement/DiagramBase.h
--- a/MatrixElement/DiagramBase.h
+++ b/MatrixElement/DiagramBase.h
@@ -1,221 +1,235 @@
// -*- C++ -*-
//
// DiagramBase.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_DiagramBase_H
#define ThePEG_DiagramBase_H
// This is the declaration of the DiagramBase class.
#include "ThePEG/Config/ThePEG.h"
#include "ThePEG/PDT/ParticleData.h"
#include "ThePEG/MatrixElement/ColourLines.h"
#include "ThePEG/Handlers/StandardXComb.fh"
#include "DiagramBase.fh"
#include "DiagramBase.xh"
namespace ThePEG {
/**
* DiagramBase is the base class of all classes which describes
* Feynman diagrams which can be generated by a matrix element class
* inheriting from MEBase, as reported by the
* MEBase::includedDiagrams() method.
*
* To work properly, a sub-class must in its constructor report the
* incoming and outgoing parton types with the partons(int, const
* cPDVector &, int) method. Also an id number should be given to be
* used internally by the matrix element class. In addition, the
* construct() method must be implemented to construct the actual
* partons and connect them together in a SubProcess object, also
* performing the colour connections using a given ColourLines object.
*
* @see MEBase
* @see SubProcess
* @see ColourLines
*
*/
class DiagramBase: public Base {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
DiagramBase() : theNIncoming(-1), theId(0) {}
/**
* Destructor.
*/
virtual ~DiagramBase();
//@}
public:
/** @name Main virtual function to be overridden in sub-classes. */
//@{
/**
* 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 = 0;
//@}
/** @name Access the underlying information. */
//@{
/**
* Return the number of incoming partons for this diagram. I.e. the
* incoming partons plus the number of space-like lines.
*/
int nIncoming() const { return theNIncoming; }
/**
* Return the incoming, followed by the outgoing partons for this
* diagram.
*/
- const cPDVector & partons() const { return thePartons; }
+ const cPDVector& partons() const { return thePartons; }
/**
* Return the id number of this diagram.
*/
int id() const { return theId; }
/**
* Generate a tag which is unique for diagrams with the same
* type of incoming and outgoing partons.
*/
string getTag() const;
/**
* Compare this diagram to another one modulo
* the ids of the diagrams.
*/
virtual bool isSame (tcDiagPtr other) const {
return
nIncoming() == other->nIncoming() &&
partons() == other->partons();
}
//@}
protected:
/**
* To be used by sub classes to report the incoming and outgoing
* particle types, and an id number.
*
* @param ninc the number of incoming and other space-like lines in
* the diagram.
*
* @param parts the types of partons for each external line in the
* diagram.
*
* @param newId the id number of this diagram.
*/
void partons(int ninc, const cPDVector & parts, int newId) {
theNIncoming = ninc;
thePartons = parts;
theId = newId;
}
/**
+ * Complete the missing information, provided partons() has already been
+ * filled
+ */
+ void diagramInfo(int ninc, int newId) {
+ theNIncoming = ninc;
+ theId = newId;
+ }
+
+ /**
* Returns true if the partons(int, const cPDVector &, int) function
* has been called properly from the sub class.
*/
bool done() const { return nIncoming() >= 0; }
+ /**
+ * Add to the partons
+ */
+ void addParton(tcPDPtr pd) { thePartons.push_back(pd); }
+
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* Standard Init function.
*/
static void Init();
private:
/**
* The number of incoming partons for this diagram.
*/
int theNIncoming;
/**
* The incoming, followed by the outgoing partons for this
* diagram.
*/
cPDVector thePartons;
/**
* The id number of this diagram.
*/
int theId;
private:
/**
* Describe an abstract base class with persistent data.
*/
static AbstractClassDescription<DiagramBase> initDiagramBase;
/**
* Private and non-existent assignment operator.
*/
DiagramBase & operator=(const DiagramBase &);
};
}
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* This template specialization informs ThePEG about the
* base class of DiagramBase.
*/
template <>
struct BaseClassTrait<DiagramBase,1>: public ClassTraitsType {
/** Typedef of the base class of DiagramBase. */
typedef Base NthBase;
};
/**
* This template specialization informs ThePEG about the name of the
* DiagramBase class.
*/
template <>
struct ClassTraits<DiagramBase>: public ClassTraitsBase<DiagramBase> {
/** Return the class name. */
static string className() { return "ThePEG::DiagramBase"; }
};
/** @endcond */
}
#endif /* ThePEG_DiagramBase_H */

File Metadata

Mime Type
text/x-diff
Expires
Wed, May 14, 10:05 AM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5111045
Default Alt Text
(23 KB)

Event Timeline