Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7878360
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
23 KB
Subscribers
None
View Options
diff --git a/Hadronization/Cluster.h b/Hadronization/Cluster.h
--- a/Hadronization/Cluster.h
+++ b/Hadronization/Cluster.h
@@ -1,326 +1,331 @@
// -*- C++ -*-
//
// Cluster.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_Cluster_H
#define HERWIG_Cluster_H
#include <ThePEG/Pointer/Ptr.h>
#include <ThePEG/Pointer/PtrTraits.h>
#include <ThePEG/Pointer/RCPtr.h>
#include <ThePEG/EventRecord/Particle.h>
#include "Herwig++/Utilities/EnumParticles.h"
#include <iostream>
#include "CluHadConfig.h"
#include "ClusterHadronizationHandler.fh"
#include "Cluster.fh"
namespace Herwig {
using namespace ThePEG;
/** \ingroup Hadronization
* \class Cluster
* \brief This class describes a cluster object.
* \author Philip Stephens
* \author Alberto Ribon
*
* This class represents a cluster, which is a colour singlet made usually
* of two components (quark-antiquark, quark-diquark, antiquark-antidiquark)
* or rarely by three components (quark-quark-quark, antiquark-antiquark-
* antiquark). A reference to the container with the pointers to its
* Components is provided.
*
* The class provides access to the pointers which point to:
*
* - The cluster parent. In the case that the cluster it is a fission
* product of a heavy cluster the parent is a cluster. If the cluster
* is formed from the perturbative partons then the parents will be
* the colour connected partons that formed the cluster.
* - The children (usually two). In the case the cluster is a
* heavy cluster that undergoes fission the children are clusters.
* Occasionally the cluster has been "redefined" (re-interpreted). For
* example in the case that three quark or anti-quark components
* have been redefined as two components (quark+diquark, or antiquark+
* antidiquark).
* - The (eventual) reshuffling partner, necessary for energy-momentum
* conservation when light clusters are decayed into single hadron. Not
* all clusters will have a reshuffling partner.
*
* Notice that in order to determine the cluster position from the positions
* of the components, the Cluster class needs some parameters.
* Because the Cluster class is neither interfaced nor persistent,
* a static pointer to the ClusterHadronizationHandler class instance,
* where the parameters are, is used. This static pointer is
* set via the method setPointerClusterHadHandler(), during the
* run initialization, doinitrun() of ClusterHadronizationHandler.
*
* @see ClusterHadronizationHandler
*/
class Cluster : public Particle {
public:
+
+ /**
+ * ColourReconnector needs access to the _original constituents.
+ */
+ friend class ColourReconnector;
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
Cluster();
/**
* Constructor with a particleData pointer
*/
Cluster(tcEventPDPtr);
/**
* This creates a cluster from 2 (or 3) partons.
*/
Cluster(tPPtr part1, tPPtr part2, tPPtr part3 = tPPtr());
/**
* Also a constructor where a particle is given not a cluster.
*/
Cluster(const Particle &);
//@}
/**
* Set the static pointer to the ClusterHadronizationHandler object.
* The pointer is set in ClusterHadronizationHandler::doinitrun().
*/
static void setPointerClusterHadHandler(tcCluHadHdlPtr gp);
/**
* Number of quark (diquark) constituents (normally two).
*/
inline int numComponents() const;
/**
* Sum of the constituent masses of the components of the cluster.
*/
Energy sumConstituentMasses() const;
/**
* Set cluster mass.
*/
inline void setMass(const Energy inputMass);
/**
* Returns the ith constituent.
*/
tPPtr particle(int i) const;
/**
* Returns whether the ith constituent is from a perturbative process.
*/
bool isPerturbative(int) const;
/**
* Sets whether the ith constituent is from a perturbative process.
*/
void setPerturbative(int,bool);
/**
* Indicates whether the ith constituent is a beam remnant.
*/
bool isBeamRemnant(int) const;
/**
* Sets whether the ith constituent is a beam remnant.
*/
void setBeamRemnant(int,bool);
/**
* Returns the clusters id, not the same as the PDG id.
*/
int clusterId() const { return _id; }
public:
/**
* Returns the cluster that was used for reshuffling.
*/
inline tClusterPtr reshufflingPartnerCluster() const;
/**
* Set the pointer to the reshuffling partner cluster.
*/
inline void reshufflingPartnerCluster(const tClusterPtr inputCluPtr);
/**
* Returns true when a constituent is a beam remnant.
*/
bool isBeamCluster() const;
/**
* Sets the component (if any) that points to "part" as a beam remnant.
*/
void isBeamCluster(tPPtr part);
/**
* Returns true if this cluster is to be handled by the hadronization.
*/
bool isAvailable() const;
/**
* Sets the value of availability.
*/
void isAvailable(bool inputAvailable);
/**
* Return true if the cluster does not have cluster parent.
*/
inline bool isStatusInitial() const;
/**
* Return true if the cluster does not have cluster children and
* it is not already decayed (i.e. it does not have hadron children)
* (to be used only after the fission of heavy clusters).
*/
inline bool isReadyToDecay() const;
/**
* Return true if the cluster has one and only one cluster children
* and no hadron children: that means either that its three quarks or
* anti-quarks components have been redefined as two components
* (quark+diquark, or antiquark+antidiquark), or that the cluster
* has been used as a partner for the momentum reshuffling necessary
* to conserve energy-momentum when a light cluster is decayed into
* a single hadron (notice that this latter light cluster has
* isRedefined() false, because it has an hadron child).
* In both cases, the unique cluster children is the new redefined
* cluster. The two cases can be distinguish by the next method.
*/
inline bool isRedefined() const;
/**
* Return true when it has a reshuffling partner.
* Notice that a cluster can have hasBeenReshuffled() true but
* isRedefined() false: this is the case of a light cluster
* that decays into a single hadron.
*/
inline bool hasBeenReshuffled() const;
/**
* Return true if the cluster has hadron children.
*/
bool isStatusFinal() const;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
inline virtual PPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
inline virtual PPtr fullclone() const;
//@}
private:
/**
* Private and non-existent assignment operator.
*/
Cluster & operator=(const Cluster &);
/**
* Calculate the 5-momentum vector of the cluster
* The 5-momentum of the cluster is given by
* \f[ P = \sum_i p_i \f]
* and the mass of the cluster is \f$m^2 = P^2\f$
*/
void calculateP();
/**
* Calculate the 4-position vector of the cluster
* Displacement of the ith constituent given by momentum \f$p_i\f$
* vertex \f$x_i\f$ and mass \f$m_i\f$ is
* \f[ D_i = -C \log(r) \frac{p_i}{\sqrt{(p_i^2 - m_i^2)^2 + v^4}} \f]
* where \f$r\f$ is a random number [0,1],
* \f$v\f$ is the minimum virtuality and \f$C\f$ is
* a conversion factor from GeV to millimeters. We can then find the
* difference in \f$s\f$ factors as
* \f[ (s_1-s_2) = \frac{(\vec{p}_1 + \vec{p}_2) \cdot (\vec{x}_2 -
* \vec{x}_1)}{(\vec{p}_1 + \vec{p}_2) \cdot \vec{D}_1}.
* \f]
* if \f$s_2>s_1\f$ then \f$s_1 = 1.0\f$ otherwise \f$s_2 = 1.0\f$.
* These are then used to determine the value of the clusters vertex as
* \f[ X = \frac{1}{2} ( x_1 +x_2 + s_1 D_1 + s_2 D_2). \f]
*/
void calculateX();
/**
* Determines whether constituent p is perturbative or not.
*/
inline bool initPerturbative(tPPtr p);
/**
* This is needed to determine if a cluster is from a perturbative quark.
*/
static tcCluHadHdlPtr _clusterHadHandler;
/**
* The gluon mass is needed to determine if a cluster is from a perturbative quark
*/
static Energy2 _mg2;
/**
* Describe an abstract base class with persistent data.
*/
static ClassDescription<Cluster> initCluster;
bool _isAvailable; //!< Whether the cluster is hadronizing
tClusterPtr _reshufflingPartner; //!< The partner used in reshuffling
ParticleVector _component; //!< The constituent partons
tParticleVector _original; //!< The original components
vector<bool> _isBeamRemnant; //!< Whether a parton is a beam remnant
vector<bool> _isPerturbative; //!< Whether a parton is perturbative
int _numComp; //!< The number of constituents
long _id; //!< The id of this cluster
};
} // end namespace Herwig
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* The following template specialization informs ThePEG about the
* base class of Cluster.
*/
template <>
struct BaseClassTrait<Herwig::Cluster,1> {
/** Typedef of the base class of Cluster. */
typedef Particle NthBase;
};
/**
* The following template specialization informs ThePEG about the
* name of this class and the shared object where it is defined.
*/
template <>
struct ClassTraits<Herwig::Cluster>:
public ClassTraitsBase<Herwig::Cluster> {
/** Return the class name. */
static string className() { return "Herwig::Cluster"; }
};
/** @endcond */
}
#include "Cluster.icc"
#endif // HERWIG_Cluster_H
diff --git a/Hadronization/ColourReconnector.cc b/Hadronization/ColourReconnector.cc
--- a/Hadronization/ColourReconnector.cc
+++ b/Hadronization/ColourReconnector.cc
@@ -1,64 +1,212 @@
// -*- C++ -*-
//
// ColourReconnector.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 ColourReconnector class.
//
#include "ColourReconnector.h"
+#include "Cluster.h"
+
#include <ThePEG/Interface/ClassDocumentation.h>
#include <ThePEG/Interface/Switch.h>
+#include "ThePEG/Interface/Parameter.h"
#include <ThePEG/Persistency/PersistentOStream.h>
#include <ThePEG/Persistency/PersistentIStream.h>
-#include <ThePEG/Repository/EventGenerator.h>
+#include <ThePEG/Repository/UseRandom.h>
+
+#include <algorithm>
using namespace Herwig;
+
+void ColourReconnector::rearrange(EventHandler & ch,
+ ClusterVector & clusters) {
+ if (_clreco == 0) return;
+
+ ClusterVector newClusters = clusters;
+
+ // try avoiding systematic errors by randomizing the reconnection order
+ long (*p_irnd)(long) = UseRandom::irnd;
+ random_shuffle( newClusters.begin(), newClusters.end(), p_irnd );
+
+ // iterate over all clusters
+ for (ClusterVector::iterator currentCl=newClusters.begin();
+ currentCl != newClusters.end(); currentCl++) {
+
+ // find cluster, where the new clusters are lighter
+ ClusterPtr candidate = _findRecoPartner(*currentCl, newClusters);
+
+ // skip this cluster if no possible reshuffling partner can be found
+ if (candidate == *currentCl) {
+ continue;
+ }
+
+ // accept the reconnection with probability _preco.
+ if (UseRandom::rnd() < _preco) {
+
+ pair <ClusterPtr,ClusterPtr> reconnected =
+ _reconnect(*currentCl, candidate);
+
+ // reset children-parents relations:
+ _get3(*currentCl)->abandonChild(*currentCl);
+ _get3(*currentCl)->addChild(reconnected.first);
+ _getAnti3(*currentCl)->abandonChild(*currentCl);
+ _getAnti3(*currentCl)->addChild(reconnected.second);
+ _get3(candidate)->abandonChild(candidate);
+ _get3(candidate)->addChild(reconnected.second);
+ _getAnti3(candidate)->abandonChild(candidate);
+ _getAnti3(candidate)->addChild(reconnected.first);
+
+ // Replace the clusters in the ClusterVector. The order of the partons in
+ // the cluster vector carrying colour (i.e. not anticolour) is preserved.
+
+ // replace *currentCl by reconnected.first
+ replace( newClusters.begin(), newClusters.end(), *currentCl,
+ reconnected.first );
+
+ // replace candidate by reconnected.second
+ replace( newClusters.begin(), newClusters.end(), candidate,
+ reconnected.second );
+ }
+ }
+
+ // override pristine clusters with the new ones
+ swap(clusters,newClusters);
+}
+
+
+ClusterPtr ColourReconnector::_findRecoPartner(ClusterPtr cl,
+ ClusterVector cv) const {
+
+ ClusterPtr candidate = cl;
+ Energy minMass = 1*TeV;
+ for (ClusterVector::const_iterator cit=cv.begin(); cit != cv.end(); ++cit) {
+
+ // don't allow colour octet clusters
+ if ( _isColour8( _get3(cl),
+ _getAnti3(*cit) ) ||
+ _isColour8( _get3(*cit),
+ _getAnti3(cl) ) ) {
+ continue;
+ }
+
+ // momenta of the old clusters
+ Lorentz5Momentum p1 = _get3(cl)->momentum() +
+ _getAnti3(cl)->momentum();
+ Lorentz5Momentum p2 = _get3(*cit)->momentum() +
+ _getAnti3(*cit)->momentum();
+
+ // momenta of the new clusters
+ Lorentz5Momentum p3 = _get3(cl)->momentum() +
+ _getAnti3(*cit)->momentum();
+ Lorentz5Momentum p4 = _get3(*cit)->momentum() +
+ _getAnti3(cl)->momentum();
+
+ Energy oldMass = abs( p1.m() ) + abs( p2.m() );
+ Energy newMass = abs( p3.m() ) + abs( p4.m() );
+
+ if ( newMass < oldMass && newMass < minMass ) {
+ minMass = newMass;
+ candidate = *cit;
+ }
+ }
+ return candidate;
+}
+
+
+tPPtr ColourReconnector::_getAnti3(ClusterPtr cl) const {
+ if ( cl->_original[0]->hasAntiColour() ) {
+ return cl->_original[0];
+ } else if ( cl->_original[1]->hasAntiColour() ) {
+ return cl->_original[1];
+ } else {
+ return tPPtr();
+ }
+}
+
+
+tPPtr ColourReconnector::_get3(ClusterPtr cl) const {
+ if ( cl->_original[0]->hasColour() ) {
+ return cl->_original[0];
+ } else if ( cl->_original[1]->hasColour() ) {
+ return cl->_original[1];
+ } else {
+ return tPPtr();
+ }
+}
+
+
+bool ColourReconnector::_isColour8(tPPtr p1, tPPtr p2) const {
+ bool octet = false;
+ // make sure we have a triplet and an anti-triplet
+ if ( ( p1->hasColour() && p2->hasAntiColour() ) ||
+ ( p1->hasAntiColour() && p2->hasColour() ) ) {
+ if ( p1->parents().size()>0 && p2->parents().size()>0 ) {
+ // true if p1 and p2 are originated from the same gluon
+ octet = ( p1->parents()[0] == p2->parents()[0] ) &&
+ ( p1->parents()[0]->data().iColour() == PDT::Colour8 );
+ }
+ }
+ return octet;
+}
+
+
+pair <ClusterPtr,ClusterPtr> ColourReconnector::_reconnect(ClusterPtr c1,
+ ClusterPtr c2) const {
+ // choose the other possibility to form two clusters, that have no netto
+ // colour
+ ClusterPtr newCluster1 = new_ptr( Cluster( _get3(c1),
+ _getAnti3(c2) ) );
+ ClusterPtr newCluster2 = new_ptr( Cluster( _get3(c2),
+ _getAnti3(c1) ) );
+ return pair <ClusterPtr,ClusterPtr> (newCluster1,newCluster2);
+}
+
+
void ColourReconnector::persistentOutput(PersistentOStream & os) const {
- os << _clreco;
+ os << _clreco << _preco;
}
void ColourReconnector::persistentInput(PersistentIStream & is, int) {
- is >> _clreco;
+ is >> _clreco >> _preco;
}
ClassDescription<ColourReconnector> ColourReconnector::initColourReconnector;
// Definition of the static class description member.
void ColourReconnector::Init() {
static ClassDocumentation<ColourReconnector> documentation
("This class is responsible of the colour reconnection.");
static Switch<ColourReconnector,int> interfaceColourReconnection
("ColourReconnection",
"Colour reconnections",
&ColourReconnector::_clreco, 0, true, false);
static SwitchOption interfaceColourReconnectionOff
(interfaceColourReconnection,
"No",
"Colour reconnections off",
0);
static SwitchOption interfaceColourReconnectionOn
(interfaceColourReconnection,
"Yes",
"Colour reconnections on",
1);
+ static Parameter<ColourReconnector,double> interfaceRecoProb
+ ("ReconnectionProbability",
+ "Probability that a found reconnection possibility is actually accepted",
+ &ColourReconnector::_preco, 0.5, 0.0, 1.0,
+ false, false, Interface::limited);
+
}
-
-
-void ColourReconnector::rearrange(EventHandler &,
- ClusterVector &)
- {
- if (_clreco != 0)
- throw Exception("Colour reconnection not implemented.",Exception::abortnow);
-}
diff --git a/Hadronization/ColourReconnector.h b/Hadronization/ColourReconnector.h
--- a/Hadronization/ColourReconnector.h
+++ b/Hadronization/ColourReconnector.h
@@ -1,154 +1,191 @@
// -*- C++ -*-
//
// ColourReconnector.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_ColourReconnector_H
#define HERWIG_ColourReconnector_H
#include <ThePEG/Interface/Interfaced.h>
#include "CluHadConfig.h"
#include "ColourReconnector.fh"
namespace Herwig {
using namespace ThePEG;
/** \ingroup Hadronization
* \class ColourReconnector
* \brief Class for changing colour reconnections of partons.
* \author Alberto Ribon
*
* This class does the nonperturbative colour rearrangement, after the
* nonperturbative gluon splitting and the "normal" cluster formation.
* It uses the list of particles in the event record, and the collections of
* "usual" clusters which is passed to the main method. If the colour
* reconnection is actually accepted, then the previous collections of "usual"
* clusters is first deleted and then the new one is created.
*
- * Note: by default this class does nothing. It can be inherited and overridden
- * in future hadronization models.
* * @see \ref ColourReconnectorInterfaces "The interfaces"
* defined for ColourReconnector.
*/
class ColourReconnector: public Interfaced {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
inline ColourReconnector();
//@}
/**
* Does the colour rearrangment.
*
* Does the colour rearrangement, starting from the list of particles
* in the event record, and the collection of "usual" clusters passed
* in input. If the actual rearrangement is accepted, the new collection
* of clusters is overriden to the intial one.
*/
void rearrange(EventHandler & ch,
ClusterVector & clusters);
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* Standard Init function used to initialize the interfaces.
*/
static void Init();
protected:
/** @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;
//@}
private:
/**
* Describe a concrete class with persistent data.
*/
static ClassDescription<ColourReconnector> initColourReconnector;
/**
* Private and non-existent assignment operator.
*/
ColourReconnector & operator=(const ColourReconnector &);
/**
* Do we do colour reconnections?
*/
int _clreco;
+
+ /**
+ * Probability that a found reconnection possibility is actually accepted.
+ */
+ double _preco;
+
+
+private:
+
+ /** Returns the Cluster (within the ClusterVector cv) where the sum of the
+ * invariant Cluster masses becomes minimal in the case of a colour
+ * reconnection with cl. If no reconnection partner can be found, a pointer to
+ * the original Cluster cl is returned.
+ */
+ ClusterPtr _findRecoPartner(ClusterPtr cl, ClusterVector cv) const;
+
+ /**
+ * @return the anticoloured constituent of a cluster, i.e. an antiquark or
+ * a diquark
+ */
+ tPPtr _getAnti3(ClusterPtr cl) const;
+
+ /**
+ * @return the coloured constituent of a cluster, i.e. a quark or an
+ * antidiquark
+ */
+ tPPtr _get3(ClusterPtr cl) const;
+
+ /**
+ * @return true, if the the two partons are splitting products of the same
+ * gluon
+ */
+ bool _isColour8(tPPtr p1, tPPtr p2) const;
+
+ /** Reconnects the constituents of the given clusters to the (only)other
+ * possible cluster combination.
+ */
+ pair <ClusterPtr,ClusterPtr> _reconnect(ClusterPtr c1, ClusterPtr c2) const;
+
};
}
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
template <>
/**
* The following template specialization informs ThePEG about the
* base class of ColourReconnector.
*/
struct BaseClassTrait<Herwig::ColourReconnector,1> {
/** Typedef of the base class of ColourReconnector. */
typedef Interfaced NthBase;
};
template <>
/**
* The following template specialization informs ThePEG about the
* name of this class and the shared object where it is defined.
*/
struct ClassTraits<Herwig::ColourReconnector>
: public ClassTraitsBase<Herwig::ColourReconnector> {
/** Return the class name.*/
static string className() { return "Herwig::ColourReconnector"; }
};
/** @endcond */
}
#include "ColourReconnector.icc"
#endif /* HERWIG_ColourReconnector_H */
diff --git a/Hadronization/ColourReconnector.icc b/Hadronization/ColourReconnector.icc
--- a/Hadronization/ColourReconnector.icc
+++ b/Hadronization/ColourReconnector.icc
@@ -1,26 +1,28 @@
// -*- C++ -*-
//
// ColourReconnector.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the inlined member functions of
// the ColourReconnector class.
//
namespace Herwig {
-inline ColourReconnector::ColourReconnector() : _clreco( 0 )
+inline ColourReconnector::ColourReconnector() :
+ _clreco( 0 ),
+ _preco( 0.5 )
{}
inline IBPtr ColourReconnector::clone() const {
return new_ptr(*this);
}
inline IBPtr ColourReconnector::fullclone() const {
return new_ptr(*this);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 5:58 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805472
Default Alt Text
(23 KB)
Attached To
rHERWIGHG herwighg
Event Timeline
Log In to Comment