Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/DIPSY/Dipole.cc b/DIPSY/Dipole.cc
--- a/DIPSY/Dipole.cc
+++ b/DIPSY/Dipole.cc
@@ -1,321 +1,338 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the Dipole class.
//
#include "Dipole.h"
#include "DipoleState.h"
#include "DipoleEventHandler.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Utilities/Throw.h"
#include "ThePEG/Repository/UseRandom.h"
using namespace DIPSY;
Dipole::~Dipole() {
if ( effmap ) delete effmap;
}
Ariadne5::ClonePtr Dipole::clone() const {
return new_ptr(*this);
}
void Dipole::fillReferences(CloneSet & cs) const {
cs.insert(thePartons.first);
cs.insert(thePartons.second);
cs.insert(theGeneratedGluon);
}
void Dipole::rebind(const TranslationMap & trans) {
thePartons.first = trans.translate(thePartons.first);
thePartons.second = trans.translate(thePartons.second);
theNeighbors.first = trans.translate(theNeighbors.first);
theNeighbors.second = trans.translate(theNeighbors.second);
theChildren.first = trans.translate(theChildren.first);
theChildren.second = trans.translate(theChildren.second);
theGeneratedGluon = trans.translate(theGeneratedGluon);
theSwingDipole = trans.translate(theSwingDipole);
}
-void Dipole::interact(Dipole & x) {
+void Dipole::interact(Dipole & x, bool onegluon) {
theInteracted = &x;
+ if ( onegluon && partons().first && partons().second ) {
+ InvEnergy2 d11 = x.partons().first?
+ partons().first->dist2(*x.partons().first): InvEnergy2();
+ InvEnergy2 d12 = x.partons().second?
+ partons().first->dist2(*x.partons().second): InvEnergy2();
+ InvEnergy2 d21 = x.partons().first?
+ partons().second->dist2(*x.partons().first): InvEnergy2();
+ InvEnergy2 d22 = x.partons().second?
+ partons().second->dist2(*x.partons().second): InvEnergy2();
+ if ( UseRandom::rndbool((d11 + d12)/(d11 + d12 + d21 + d22)) )
+ partons().first->interact(true);
+ else
+ partons().second->interact(true);
+ return;
+ }
if ( partons().first ) partons().first->interact();
if ( partons().second ) partons().second->interact();
}
pair <InvEnergy, InvEnergy> Dipole::interactionLengths() const {
if ( !interacted() ) return make_pair( 0.0/GeV, 0.0/GeV );
return make_pair( sqrt(partons().first->dist2
(*(interacted()->partons().second))),
sqrt(partons().second->dist2
(*(interacted()->partons().first))) );
}
InvEnergy Dipole::rMax() const {
return theDipoleState->handler().rMax();
}
void Dipole::reset() {
theGeneratedGluon = PartonPtr();
theSwingDipole = tDipolePtr();
theGeneratedY = Constants::MaxRapidity;
swingCache = -1.0/GeV2;
if ( effmap ) delete effmap;
effmap = 0;
}
void Dipole::colExtract(vector< vector<tDipolePtr> > & colvec) {
if ( children().first ) children().first->colExtract(colvec);
if ( children().second ) children().second->colExtract(colvec);
if ( !children().first && !children().second )
forceAt(colvec, colour()).push_back(this);
}
tDipolePtr Dipole::getFSSwinger(double miny, double maxy) {
// *** TODO *** Check if dead-end before recursion
if ( children().first && children().second ) {
tDipolePtr em1 = children().first->getFSSwinger(miny, maxy);
tDipolePtr em2 = children().second->getFSSwinger(miny, maxy);
return em1->generatedY() < em2->generatedY()? em1: em2;
} else if ( children().first ) {
return children().first->getFSSwinger(miny, maxy);
} else if ( children().second ) { //dead end??
// return children().second->getFSSwinger(miny, maxy);
}
generateFSRec(miny, maxy);
return this;
}
void Dipole::generateFSRec(double miny, double maxy) {
if ( dipoleState().handler().swingPtr() && participating() &&
!children().second )
dipoleState().handler().swinger().generateFS(*this, miny, maxy);
}
tDipolePtr Dipole::getEmitter(double miny, double maxy) {
if ( !isOn ) return DipolePtr();
if ( children().first && children().second ) {
tDipolePtr em1 = children().first->getEmitter(miny, maxy);
tDipolePtr em2 = children().second->getEmitter(miny, maxy);
if ( !em1 ) return em2? em2:em1;
else if ( !em2 ) return em1;
return em1->generatedY() < em2->generatedY()? em1: em2;
} else if ( children().first ) {
return children().first->getEmitter(miny, maxy);
} else if ( children().second ) {
return DipolePtr();
}
if ( !hasGen() || effectivePartonsChanged() ) {
generate(miny, maxy);
}
else {
generateRec(miny, min(generatedY(), maxy), false);
}
return this;
}
void Dipole::generate(double miny, double maxy) {
reset();
dipoleState().handler().emitter().generate(*this, miny, maxy);
generateRec(miny, min(generatedY(), maxy), true);
}
void Dipole::generateRec(double miny, double maxy, bool force) {
if ( dipoleState().handler().swingPtr() )
dipoleState().handler().swinger().generate(*this, miny, maxy, force);
}
bool Dipole::forceGenerateRec(double ymax) {
return dipoleState().handler().swingPtr()?
dipoleState().handler().swinger().forceGenerate(*this, ymax): false;
}
void Dipole::recombine() {
if ( dipoleState().handler().swingPtr() )
dipoleState().handler().swinger().recombine(*this);
}
void Dipole::absorb() {
PartonPtr p = new_ptr(Parton());
PartonPtr p1 = partons().first;
PartonPtr p2 = partons().second;
DipolePtr d1 = neighbors().first;
DipolePtr d2 = neighbors().second;
p->pT( p1->pT() + p2->pT() );
p->plus( p1->plus() + p2->plus() );
p->y( log(p->pT().pt()/p->plus()) );
p->minus( p->pT().pt()*exp(p->y()) );
d1->neighbors( make_pair( d1->neighbors().first, d2 ) );
d2->neighbors( make_pair( d1, d2->neighbors().second ) );
d1->partons( make_pair( d1->partons().first, p ) );
d2->partons( make_pair( p, d2->partons().second ) );
p->dipoles( make_pair( d1, d2 ) );
theChildren.second = d2;
}
void Dipole::emit() {
if ( swingDipole() ) {
recombine();
return;
}
dipoleState().handler().emitter().emit(*this);
// splitDipole();
// *** ATTENTION *** implement this.
}
void Dipole::splitDipole(double colsel) {
if ( !generatedGluon() )
Throw<NothingGenerated>()
<< "Tried to perform an emission where none was generated."
<< Exception::abortnow;
theChildren = make_pair(dipoleState().createDipole(),
dipoleState().createDipole());
thePartons.first->theChildren.insert(generatedGluon());
thePartons.second->theChildren.insert(generatedGluon());
if ( neighbors().first ) {
children().first->theNeighbors.first = neighbors().first;
neighbors().first->theNeighbors.second = children().first;
neighbors().first->reset();
neighbors().first->touch();
}
children().first->theNeighbors.second = children().second;
children().second->theNeighbors.first = children().first;
partons().first->theDipoles.second = children().first;
partons().second->theDipoles.first = children().second;
if ( neighbors().second ) {
children().second->theNeighbors.second = neighbors().second;
neighbors().second->theNeighbors.first = children().second;
neighbors().second->reset();
neighbors().second->touch();
}
children().first->partons(make_pair(partons().first,generatedGluon()));
children().second->partons(make_pair(generatedGluon(),partons().second));
generatedGluon()->parents(partons());
generatedGluon()->dipoles(children());
generatedGluon()->rightMoving( partons().first->rightMoving() );
if ( UseRandom::rndbool(colsel) ) {
children().first->theColour = theColour;
dipoleState().generateColourIndex(children().second);
+ generatedGluon()->mainParent(partons().second);
} else {
children().second->theColour = theColour;
dipoleState().generateColourIndex(children().first);
+ generatedGluon()->mainParent(partons().first);
}
}
int Dipole::colourSystem() const {
return colour()/Current<DipoleEventHandler>()->nColours();
}
void Dipole::colourSystem(int sys) {
colour(colour()%Current<DipoleEventHandler>()->nColours() +
sys*Current<DipoleEventHandler>()->nColours());
}
tEffectivePartonPtr Dipole::getEff(tPartonPtr p, InvEnergy range) const {
tEffectivePartonPtr ret;
if ( Current<DipoleEventHandler>()->effectivePartonMode() == 3 ) {
if ( p == partons().first ) {
effectivePartons().first->setRange(range);
return effectivePartons().first;
}
if ( p == partons().second ) {
effectivePartons().second->setRange(range);
return effectivePartons().second;
}
}
if ( !effmap ) buildEffMap();
if ( p == partons().first ) {
EffMap::const_iterator it = effmap->first.begin();
ret = it->second;
while ( ++it != effmap->first.end() && it->first < range ) ret = it->second;
}
if ( p == partons().second ) {
EffMap::const_iterator it = effmap->second.begin();
ret = it->second;
while ( ++it != effmap->second.end() && it->first < range ) ret = it->second;
}
return ret;
}
void Dipole::buildEffMap() const {
if ( effmap ) delete effmap;
effmap = new pair<EffMap,EffMap>();
// First take the first partonand create the largest one immaginable.
EffectivePartonPtr ep =
EffectiveParton::create(*partons().first, size()/2.0);
// Then we loop through the included partons in order and create all
// sub effective partons.
set<tPartonPtr> intp = ep->internalPartons();
set<InvEnergy> dists;
if ( intp.empty() ) {
const vector<tPartonPtr> & intp = ep->cachedPartons();
for ( vector<tPartonPtr>::const_iterator it = intp.begin();
it != intp.end(); ++it )
dists.insert(sqrt(ep->originalParton()->dist2(**it)));
} else {
for ( set<tPartonPtr>::iterator it = intp.begin(); it != intp.end(); ++it )
dists.insert(sqrt(ep->originalParton()->dist2(**it)));
}
effmap->first.resize(intp.size());
for ( set<InvEnergy>::iterator it = dists.begin();
it != dists.end(); ++it ) {
effmap->first.push_back
(make_pair(*it, EffectiveParton::create(*partons().first, *it)));
}
// Then do the same for the second
ep = EffectiveParton::create(*partons().second, size()/2.0);
// Then we loop through the included partons in order and create all
// sub effective partons.
intp = ep->internalPartons();
dists.clear();
if ( intp.empty() ) {
const vector<tPartonPtr> & intp = ep->cachedPartons();
for ( vector<tPartonPtr>::const_iterator it = intp.begin();
it != intp.end(); ++it )
dists.insert(sqrt(ep->originalParton()->dist2(**it)));
} else {
for ( set<tPartonPtr>::iterator it = intp.begin(); it != intp.end(); ++it )
dists.insert(sqrt(ep->originalParton()->dist2(**it)));
}
effmap->second.reserve(intp.size());
for ( set<InvEnergy>::iterator it = dists.begin(); it != dists.end(); ++it ) {
effmap->second.push_back
(make_pair(*it, EffectiveParton::create(*partons().second, *it)));
}
}
void Dipole::persistentOutput(PersistentOStream & os) const {
os << theDipoleState << thePartons << theNeighbors << theChildren
<< theGeneratedGluon << theSwingDipole << theGeneratedY << theColour
<< theInteracted << isParticipating << isRecoilSwing << isTouched
<< isOn << ounit(swingCache, 1.0/GeV2);
}
void Dipole::persistentInput(PersistentIStream & is, int) {
if ( effmap ) delete effmap;
is >> theDipoleState >> thePartons >> theNeighbors >> theChildren
>> theGeneratedGluon >> theSwingDipole >> theGeneratedY >> theColour
>> theInteracted >> isParticipating >> isRecoilSwing >> isTouched
>> isOn >> iunit(swingCache, 1.0/GeV2);
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<Dipole,PersistentBase>
describeDIPSYDipole("DIPSY::Dipole", "libAriadne5.so libDIPSY.so");
void Dipole::Init() {}
diff --git a/DIPSY/Dipole.h b/DIPSY/Dipole.h
--- a/DIPSY/Dipole.h
+++ b/DIPSY/Dipole.h
@@ -1,561 +1,651 @@
// -*- C++ -*-
#ifndef DIPSY_Dipole_H
#define DIPSY_Dipole_H
//
// This is the declaration of the Dipole class.
//
#include "ThePEG/Config/ThePEG.h"
#include "Ariadne/Config/CloneBase.h"
#include "Dipole.fh"
#include "Parton.h"
#include "EffectiveParton.h"
#include "DipoleState.fh"
namespace DIPSY {
using namespace ThePEG;
/**
* Here is the documentation of the Dipole class.
*/
class Dipole: public Ariadne5::CloneBase {
public:
/**
* A pair of dipoles
*/
typedef pair<tDipolePtr,tDipolePtr> tDipolePair;
/**
* A pair of partons.
*/
typedef pair<PartonPtr,PartonPtr> PartonPair;
/**
* The DipoleState is a friend.
*/
friend class DipoleState;
/**
* A map for stoing effective partons.
*/
typedef vector< pair<InvEnergy,EffectivePartonPtr> > EffMap;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline Dipole();
+ inline Dipole()
+ : theDipoleState(tDipoleStatePtr()), thePartons(PartonPair()),
+ theNeighbors(tDipolePair()),
+ theChildren(tDipolePair()), theGeneratedGluon(PartonPtr()),
+ theSwingDipole(tDipolePtr()), theGeneratedY(Constants::MaxRapidity),
+ theColour(-1),
+ theInteracted(tDipolePtr()), theGLAPsafe(false), isParticipating(true),
+ isRecoilSwing(false), isTouched(true), isOn(true), swingCache(-1.0/GeV2),
+ effmap(0) {}
/**
* The copy constructor.
*/
- inline Dipole(const Dipole &);
+ inline Dipole(const Dipole & x)
+ : theDipoleState(x.theDipoleState), thePartons(x.thePartons),
+ theNeighbors(x.theNeighbors),
+ theChildren(x.theChildren), theGeneratedGluon(x.theGeneratedGluon),
+ theSwingDipole(x.theSwingDipole), theGeneratedY(x.theGeneratedY),
+ theColour(x.theColour), theInteracted(x.theInteracted),
+ theGLAPsafe(x.theGLAPsafe), isParticipating(x.isParticipating),
+ isRecoilSwing(x.isRecoilSwing), isTouched(true), isOn(x.isOn),
+ swingCache(x.swingCache), effmap(0) {}
/**
* The destructor.
*/
virtual ~Dipole();
//@}
protected:
/** @name The virtual functions to be overridden in sub-classes. */
//@{
/**
* Return a simple clone of this object. Should be implemented as
* <code>return new_ptr(*this);</code> by a derived class.
*/
virtual Ariadne5::ClonePtr clone() const;
/**
* Fill the provided set with all pointers to CloneBase objects used
* in this object.
*/
virtual void fillReferences(CloneSet &) const;
/**
* Rebind pointers to other CloneBase objects. Called after a number
* of interconnected CloneBase objects have been cloned, so that
* the cloned objects will refer to the cloned copies afterwards.
*
* @param trans a TranslationMap relating the original objects to
* their respective clones.
*/
virtual void rebind(const TranslationMap & trans);
//@}
public:
/** @name Simple access functions. */
//@{
/**
* rMax for the dipoles handler.
*/
InvEnergy rMax() const;
/**
* The DipoleState to which this Dipole belongs.
*/
- inline DipoleState & dipoleState() const;
+ inline DipoleState & dipoleState() const {
+ return *theDipoleState;
+ }
/**
* Set the DipoleState to which this Dipole belongs.
* added by CF to access from emitter.
*/
- inline void dipoleState(tDipoleStatePtr);
+ inline void dipoleState(tDipoleStatePtr dipst) {
+ theDipoleState = dipst;
+ }
/**
*/
- inline const PartonPair & partons() const;
+ inline const PartonPair & partons() const {
+ return thePartons;
+ }
/**
* Get the effective parton.
*/
inline const pair< EffectivePartonPtr, EffectivePartonPtr > &
- effectivePartons() const;
+ effectivePartons() const {
+ return theEffectivePartons;
+ }
/**
* Get an effective parton corresponding to one of the partons in
* the original dipole given a range.
*/
tEffectivePartonPtr getEff(tPartonPtr p, InvEnergy range) const;
/**
* Set the effective parton.
*/
- inline void effectivePartons( tEffectivePartonPtr, tEffectivePartonPtr );
+ inline void effectivePartons(tEffectivePartonPtr g1, tEffectivePartonPtr g2) {
+ theEffectivePartons = make_pair( g1, g2 );
+ }
/**
* controls if any of the effective partons have been changed by emissions.
*/
- inline const bool effectivePartonsChanged() const;
+ inline const bool effectivePartonsChanged() const {
+ return (effectivePartons().first->changed() ||
+ effectivePartons().second->changed());
+ }
/**
* Set the neighboring dipoles.
*/
- inline const tDipolePair & neighbors() const;
+ inline const tDipolePair & neighbors() const {
+ return theNeighbors;
+ }
/**
* Get the child dipoles.
*/
- inline const tDipolePair & children() const;
+ inline const tDipolePair & children() const {
+ return theChildren;
+ }
/**
* Get the child dipoles.
*/
- inline tDipolePair & children();
+ inline tDipolePair & children() {
+ return theChildren;
+ }
/**
* Get the generated gluon to be emitted. Returns null if none has
* been generated.
*/
- inline tPartonPtr generatedGluon() const;
+ inline tPartonPtr generatedGluon() const {
+ return theGeneratedGluon;
+ }
/**
* Set the generated gluon to be emitted.
* Added by CF to get access from emitter.
*/
- inline void generatedGluon(tPartonPtr);
+ inline void generatedGluon(tPartonPtr p) {
+ theGeneratedGluon = p;
+ }
/**
* Get the dipole to swing with. Return null if no swing has been
* generated.
*/
- inline tDipolePtr swingDipole() const;
+ inline tDipolePtr swingDipole() const {
+ return theSwingDipole;
+ }
/**
* Set the dipole to swing with.
* Aded by CF
*/
- inline void swingDipole(tDipolePtr);
+ inline void swingDipole(tDipolePtr d) {
+ theSwingDipole = d;
+ }
/**
* Return true if this dipole has generated an emission or a swing.
*/
- inline bool hasGen();
+ inline bool hasGen() {
+ return (generatedGluon() || swingDipole()) &&
+ !(swingDipole() && swingDipole()->children().first);
+ }
/**
* The rapidity of the generated emission or swing.
*/
- inline double generatedY() const;
+ inline double generatedY() const {
+ return theGeneratedY;
+ }
/**
* Set the rapidity of the generated emission or swing.
* Added by CF to access from emitter.
*/
- inline void generatedY(double);
+ inline void generatedY(double y) {
+ theGeneratedY = y;
+ }
/**
* Get a pointer to a Dipole in another DipoleState with which this
* Dipole has interacted. @return null if Dipole has not interacted.
*/
- inline tDipolePtr interacted() const;
+ inline tDipolePtr interacted() const {
+ return theInteracted;
+ }
/**
* Returns the lengths that the new dipoles will have when it has
* swinged with the interacted() dipole. returns 0 if not interacting.
*/
pair <InvEnergy, InvEnergy> interactionLengths() const;
/**
* Set the partons.
*/
- inline void partons(PartonPair);
+ inline void partons(PartonPair x) {
+ thePartons = x;
+ }
/**
* Set the neighboring dipoles.
*/
- inline void neighbors(tDipolePair);
+ inline void neighbors(tDipolePair x) {
+ theNeighbors = x;
+ }
/**
* Set the neighboring dipole.
*/
- inline void firstNeighbor(tDipolePtr);
+ inline void firstNeighbor(tDipolePtr d) {
+ theNeighbors.first = d;
+ }
/**
* Set the neighboring dipole.
*/
- inline void secondNeighbor(tDipolePtr);
+ inline void secondNeighbor(tDipolePtr d) {
+ theNeighbors.second = d;
+ }
/**
* Get the colour.
*/
- inline int colour() const;
+ inline int colour() const {
+ return theColour;
+ }
/**
* Set the colour.
*/
- inline void colour(int c, int sys = 0);
+ inline void colour(int c, int sys = 0) {
+ theColour = c;
+ if ( sys > 0 ) colourSystem(sys);
+ }
/**
* Get the colour system.
*/
int colourSystem() const;
/**
* Set the colour system.
*/
void colourSystem(int sys);
/**
* says if the dipole is part of a DGLAP chain, and thus should not be absorbed.
*/
- inline bool DGLAPsafe();
+ inline bool DGLAPsafe() {
+ return theGLAPsafe;
+ }
/**
* Sets if the dipole is part of a DGLAP chain or not.
*/
- inline void DGLAPsafe(bool);
+ inline void DGLAPsafe(bool safe) {
+ theGLAPsafe = safe;
+ }
/**
* says if the (initial) dipole is participating in the interaction.
*/
- inline bool participating();
+ inline bool participating() {
+ return isParticipating;
+ }
/**
* Sets if the (initial) dipole is participating in the interaction.
*/
- inline void participating(bool);
+ inline void participating(bool b) {
+ isParticipating = b;
+ }
/**
* gets if the generated swing is a gluon exchange.
*/
inline bool recoilSwing() const {
return isRecoilSwing;
}
/**
* sets if the generated swing is a gluon exchange.
*/
inline void recoilSwing(bool recoil) {
isRecoilSwing = recoil;
}
/**
* Indicate that the Dipole has interacted with the given Dipole in
- * another DipoleState.
+ * another DipoleState. If \a onegluon is true, only one of the
+ * gluons in this dipole is flagged as interacted.
*/
- void interact(Dipole &);
+ void interact(Dipole &, bool onegluon = false);
+
+ /**
+ * Set the pointer to the dipole with which this dipole has
+ * interacted. Do not mark partons as interacted.
+ */
+ void interacted(tDipolePtr d) {
+ theInteracted = d;
+ }
/**
* Get the squared transverse size of this Dipole.
*/
- inline InvEnergy2 size2() const;
+ inline InvEnergy2 size2() const {
+ return partons().first->dist2(*partons().second);
+ }
/**
* Get the transverse size of this Dipole.
*/
- inline InvEnergy size() const;
+ inline InvEnergy size() const {
+ return sqrt(size2());
+ }
//@}
/** @name Functions for extracting final dipoles. */
//@{
/**
* Given an output iterator fill the corresponding container with
* final, undecayed dipoles. This is done recursively, ie. if this
* dipole has decayed, the extract methods of the two children are
* called instead.
*/
template <typename OutputIterator>
- void extract(OutputIterator it);
+ void extract(OutputIterator it) {
+ //an absorbed (dead end) dipole has only second child
+ if ( !children().first && children().second ) return;
+ if ( children().first ) children().first->extract(it);
+ if ( children().second ) children().second->extract(it);
+ if ( !children().first && !children().second ) *it++ = this;
+ }
/**
* Extract all undecayed dipoles into the vector according to colour
* index.
*/
void colExtract(vector< vector<tDipolePtr> > &);
//@}
/**
* Recursively find the dipole which is next to swing in final state.
*/
tDipolePtr getFSSwinger(double miny, double maxy);
/**
* Generate a possible emission or a swing from this Dipole in the
* given rapidity interval [\a miny,\a maxy].
*/
void generateFSRec(double miny, double maxy);
/** @name Functions for shower generation. */
//@{
/**
* Recursively find the dipole which is next to emit or swing in the
* given rapidity interval [\a miny,\a maxy].
*/
tDipolePtr getEmitter(double miny, double maxy);
/**
* Generate a possible emission or a swing from this Dipole in the
* given rapidity interval [\a miny,\a maxy].
*/
void generate(double miny, double maxy);
/**
* Generate a swing for this Dipole in the given rapidity interval
* [\a miny,\a maxy]. If \a force is true, always generate a swing,
* otherwise only check if a swing is possible with dipoles which
* are new or has changed.
*/
void generateRec(double miny, double maxy, bool force);
/**
* Try really hard to generates a swing, but not with higher rapdity step
* than /a ymax. /a ymax = 0 means no limit.
* If no swing found, return false.
*/
bool forceGenerateRec(double ymax);
/**
* Perform a recombination previously generated by generateRec().
*/
void recombine();
/**
* absorb the dipole, replacing it with a single parton.
*/
void absorb();
/**
* Perform the emission previously generated for this \a dipole. If
* no emission has been generated a runtime_error is thrown.
*/
void emit();
//@}
public:
/**
* Split this dipole by emitting the generated gluon. \a colsel
* gives the probability that the first child dipole inherits the
* colour index of the mother.
*/
void splitDipole(double colsel);
/**
* Reset any emission or swong generated for this dipole.
*/
void reset();
/**
* Check if conditions for this dipole has changed since last
* generated emission or swing.
*/
bool touched() const {
return isTouched;
}
/**
* Flag that conditions for this dipole has changed since last
* generated emission or swing.
*/
void touch() {
isTouched = true;
}
/**
* Flag that this dipole no has generated emission or swing.
*/
void untouch() {
isTouched = false;
}
/**
* Flag that this dipole should no longer emit.
*/
void turnOff() {
isOn = false;
}
protected:
struct NothingGenerated: public Exception {};
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();
private:
/**
* The DipoleState to which this Dipole belongs.
*/
tDipoleStatePtr theDipoleState;
/**
* The partons.
*/
PartonPair thePartons;
/**
* The neighboring dipoles.
*/
tDipolePair theNeighbors;
/**
* The child dipoles.
*/
tDipolePair theChildren;
/**
* The generated gluon to be emitted. Null if none has been generated.
*/
PartonPtr theGeneratedGluon;
/**
* the effective partons.
*/
pair< EffectivePartonPtr, EffectivePartonPtr > theEffectivePartons;
/**
* The dipole to swing with. Null if no swing has been generated.
*/
tDipolePtr theSwingDipole;
/**
* The rapidity of the generated emission or swing.
*/
double theGeneratedY;
/**
* The colour index of this Dipole.
*/
int theColour;
/**
* If non-null, pointer to a Dipole in another DipoleState with which
* this Dipole has interacted.
*/
tDipolePtr theInteracted;
/**
* If the dipole is part of a DGLAP chain or not in the final state.
*/
bool theGLAPsafe;
/**
* if the (initial) dipole is part of a participating nucleon in a
* heavy ion collision.
*/
bool isParticipating;
/**
* If the generated swing is gluon exchange or quadrupole swing.
*/
bool isRecoilSwing;
/**
* Indicate if conditions for this dipole has changed since last
* generated emission or swing.
*/
bool isTouched;
/**
* This can be set to false to manually turn a dipole of, ie disallow
* emissions or swings.
**/
bool isOn;
public:
/**
* Cache values needed for (FS) swing.
*/
mutable InvEnergy2 swingCache;
/**
* A pair of maps where the effective partons are stored.
*/
mutable pair<EffMap,EffMap> * effmap;
/**
* Build the map of effective partons.
*/
void buildEffMap() const;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Dipole & operator=(const Dipole &);
};
}
-#include "Dipole.icc"
-
#endif /* DIPSY_Dipole_H */
diff --git a/DIPSY/Dipole.icc b/DIPSY/Dipole.icc
deleted file mode 100644
--- a/DIPSY/Dipole.icc
+++ /dev/null
@@ -1,162 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the Dipole class.
-//
-
-namespace DIPSY {
-
-inline Dipole::Dipole()
- : theDipoleState(tDipoleStatePtr()), thePartons(PartonPair()),
- theNeighbors(tDipolePair()),
- theChildren(tDipolePair()), theGeneratedGluon(PartonPtr()),
- theSwingDipole(tDipolePtr()), theGeneratedY(Constants::MaxRapidity),
- theColour(-1),
- theInteracted(tDipolePtr()), theGLAPsafe(false), isParticipating(true),
- isRecoilSwing(false), isTouched(true), isOn(true), swingCache(-1.0/GeV2),
- effmap(0) {}
-
-inline Dipole::Dipole(const Dipole & x)
- : theDipoleState(x.theDipoleState), thePartons(x.thePartons),
- theNeighbors(x.theNeighbors),
- theChildren(x.theChildren), theGeneratedGluon(x.theGeneratedGluon),
- theSwingDipole(x.theSwingDipole), theGeneratedY(x.theGeneratedY),
- theColour(x.theColour), theInteracted(x.theInteracted),
- theGLAPsafe(x.theGLAPsafe), isParticipating(x.isParticipating),
- isRecoilSwing(x.isRecoilSwing), isTouched(true), isOn(x.isOn),
- swingCache(x.swingCache), effmap(0) {}
-
-template <typename OutputIterator>
-void Dipole::extract(OutputIterator it) {
- //an absorbed (dead end) dipole has only second child
- if ( !children().first && children().second ) return;
- if ( children().first ) children().first->extract(it);
- if ( children().second ) children().second->extract(it);
- if ( !children().first && !children().second ) *it++ = this;
-}
-
-inline DipoleState & Dipole::dipoleState() const {
- return *theDipoleState;
-}
-
-//added by CF to access from emitter
-inline void Dipole::dipoleState(tDipoleStatePtr dipst) {
- theDipoleState = dipst;
-}
-
-inline const Dipole::PartonPair & Dipole::partons() const {
- return thePartons;
-}
-
-inline void Dipole::partons(PartonPair x) {
- thePartons = x;
-}
-
-inline const bool Dipole::effectivePartonsChanged() const {
- return (effectivePartons().first->changed() || effectivePartons().second->changed());
-}
-
-inline const pair< EffectivePartonPtr, EffectivePartonPtr > &
-Dipole::effectivePartons() const {
- return theEffectivePartons;
-}
-
-inline void Dipole::
-effectivePartons( tEffectivePartonPtr g1, tEffectivePartonPtr g2 ) {
- theEffectivePartons = make_pair( g1, g2 );
-}
-
-inline tDipolePtr Dipole::interacted() const {
- return theInteracted;
-}
-
-inline const Dipole::tDipolePair & Dipole::children() const {
- return theChildren;
-}
-
-inline Dipole::tDipolePair & Dipole::children() {
- return theChildren;
-}
-
-inline const Dipole::tDipolePair & Dipole::neighbors() const {
- return theNeighbors;
-}
-
-inline void Dipole::neighbors(tDipolePair x) {
- theNeighbors = x;
-}
-
-inline void Dipole::firstNeighbor(tDipolePtr d) {
- theNeighbors.first = d;
-}
-
-inline void Dipole::secondNeighbor(tDipolePtr d) {
- theNeighbors.second = d;
-}
-
-inline tPartonPtr Dipole::generatedGluon() const {
- return theGeneratedGluon;
-}
-
-//added by CF to get access from emitter class
-inline void Dipole::generatedGluon(tPartonPtr p) {
- theGeneratedGluon = p;
-}
-
-inline tDipolePtr Dipole::swingDipole() const {
- return theSwingDipole;
-}
-
-//aded by CF to access from swinger
-inline void Dipole::swingDipole(tDipolePtr d) {
- theSwingDipole = d;
-}
-
-inline double Dipole::generatedY() const {
- return theGeneratedY;
-}
-
-//added by CF to get access from emitter class
-inline void Dipole::generatedY(double y) {
- theGeneratedY = y;
-}
-
-inline bool Dipole::DGLAPsafe() {
- return theGLAPsafe;
-}
-
-inline void Dipole::DGLAPsafe(bool safe) {
- theGLAPsafe = safe;
-}
-
-inline void Dipole::participating(bool b) {
- isParticipating = b;
-}
-
-inline bool Dipole::participating() {
- return isParticipating;
-}
-
-inline bool Dipole::hasGen() {
- return (generatedGluon() || swingDipole()) &&
- !(swingDipole() && swingDipole()->children().first);
-}
-
-inline InvEnergy2 Dipole::size2() const {
- return partons().first->dist2(*partons().second);
-}
-
-inline InvEnergy Dipole::size() const {
- return sqrt(size2());
-}
-
-inline int Dipole::colour() const {
- return theColour;
-}
-
-inline void Dipole::colour(int c, int sys) {
- theColour = c;
- if ( sys > 0 ) colourSystem(sys);
-}
-
-}
diff --git a/DIPSY/DipoleEventHandler.cc b/DIPSY/DipoleEventHandler.cc
--- a/DIPSY/DipoleEventHandler.cc
+++ b/DIPSY/DipoleEventHandler.cc
@@ -1,841 +1,849 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the DipoleEventHandler class.
//
#include "DipoleEventHandler.h"
#include "SimpleProtonState.h"
#include "PhotonDipoleState.h"
#include "Parton.h"
#include "OldStyleEmitter.h"
#include "ThePEG/Interface/Switch.h"
#include "PT1DEmitter.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Handlers/LuminosityFunction.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/RefVector.h"
#include "ThePEG/Config/algorithm.h"
#include "gsl/gsl_sf_bessel.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Cuts/Cuts.h"
#include "ThePEG/PDF/PartonExtractor.h"
#include "ThePEG/Utilities/Debug.h"
#include "ThePEG/Utilities/DebugItem.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "CPUTimer.h"
#include <iostream>
#include <fstream>
using namespace DIPSY;
DipoleEventHandler::DipoleEventHandler()
: EventHandler(false), theNColours(9), theRMax(3.5*InvGeV),
theBaryonSize(0.0*InvGeV),
theCoherenceRange(0.5*InvGeV), theEffectivePartonMode(0), theCollisionType(0),
doShowHistory(false), theLambdaQCD(0.22*GeV), theNF(0),
theFixedAlphaS(0.0), theExternalAlphaS(ASPtr()),
theWFR(WaveFunctionPtr()), theWFL(WaveFunctionPtr()),
- theBGen(ImpactParameterGeneratorPtr()), theYFrame(0.5), theFudgeME(false),
+ theBGen(ImpactParameterGeneratorPtr()), theYFrame(0.5), theFudgeME(false), theFudgeFactorME(1.0),
thePreSamples(1000), thePreSampleL(1), thePreSampleR(1), thePreSampleB(1),
theXSecFn(DipoleXSecPtr()), theEmitter(EmitterPtr()),
theSwinger(SwingerPtr()) {}
DipoleEventHandler::~DipoleEventHandler() {}
IBPtr DipoleEventHandler::clone() const {
return new_ptr(*this);
}
IBPtr DipoleEventHandler::fullclone() const {
return new_ptr(*this);
}
double DipoleEventHandler::elapsed() {
static long last = 0;
long el = clock() - last;
last += el;
return double(el)*0.000001;
}
void DipoleEventHandler::presample() {
//redirect diffractive runs, as the cross section calculation
//then requires more than a single loop over collisions.
if ( collisionType() == 1 ) return diffractivePresample();
//Set up before the loop
Current<DipoleEventHandler> current(this);
for_each(analyses, mem_fun(&DipoleAnalysisHandler::initialize));
CrossSection xmax = 0.0*picobarn;
CrossSection xnmax = 0.0*picobarn;
elapsed();
generator()->log()
<< endl << "Starting DIPSY run at CoM energy "
<< lumiFn().maximumCMEnergy()/GeV << " GeV" << endl;
//Loop over collisions
for ( int i = 0, N = preSamples(); i < N; ++i ) {
//Setup before collision. Energy, jacobian, luminosity.
Energy W = lumiFn().maximumCMEnergy();
double jac = 1.0;
pair<double,double> ll(1.0, 1.0);
if ( int ndim = lumiFn().nDim(make_pair(WFL().particle(), WFR().particle())) ) {
vector<double> r = UseRandom::rndvec(ndim);
ll = lumiFn().generateLL(&(r[0]), jac);
W *= exp(-0.5*(ll.first + ll.second));
}
//Find the p+ (or p-) of each state.
Energy2 a = WFL().m2() - WFR().m2() + sqr(W);
Energy PL = (a + sqrt(sqr(a) - WFL().m2()*sqr(W)))*0.5/W;
a = WFR().m2() - WFL().m2() + sqr(W);
Energy PR = (a + sqrt(sqr(a) - WFR().m2()*sqr(W)))*0.5/W;
//Create the dipole states and impact parameters.
vector<DipoleStatePtr> vl(preSampleL());
vector<DipoleStatePtr> vr(preSampleR());
vector<ImpactParameters> vb(preSampleB());
vector< vector< vector<double> > >
probs(preSampleL(),
vector< vector<double> >(preSampleR(), vector<double>(preSampleB(), 0.0)));
// Setup a number of left- and right-moving states
double highYL = 0.0;
for ( int il = 0; il < preSampleL(); ++il ) {
DipoleStatePtr dl = WFL().generate(*this, PL);
vl[il] = dl;
dl->collidingEnergy(PR);
highYL += dl->highestY();
}
double highYR = 0.0;
for ( int ir = 0; ir < preSampleR(); ++ir ) {
DipoleStatePtr dr = WFR().generate(*this, PR);
vr[ir] = dr;
dr->collidingEnergy(PL);
highYR += dr->highestY();
}
// Evolve the states
double y0 = interactionFrame(highYL/double(preSampleL()), -highYR/double(preSampleR()));
for ( int il = 0; il < preSampleL(); ++il ) {
vl[il]->evolve(vl[il]->lowestY(), y0);
vl[il]->unifyColourSystems();
}
for ( int ir = 0; ir < preSampleR(); ++ir ) {
vr[ir]->evolve(vr[ir]->lowestY(), -y0);
vr[ir]->unifyColourSystems();
}
for ( int ib = 0; ib < preSampleB(); ++ib ) {
ImpactParameters b = bGen().generate();
vb[ib] = b;
}
for ( int il = 0; il < preSampleL(); ++il )
for ( int ir = 0; ir < preSampleR(); ++ir )
for ( int ib = 0; ib < preSampleB(); ++ib ) {
DipoleStatePtr dl =vl[il];
DipoleStatePtr dr =vr[ir];
ImpactParameters b = vb[ib];
//Calculate interaction probability, and apply all the weights
double prob = xSecFn().sumf(*dr, *dl, b);
probs[il][ir][ib] = prob;
CrossSection weight = sqr(hbarc)*dr->weight()*dl->weight()*b.weight()*jac;
//This is the contribution to the non-diffractive
//cross section 1 - exp(-2(amp)^2)
CrossSection x = weight*xSecFn().unitarize(2.0*prob);
if ( x > xmax ) {
xnmax = xmax;
xmax = x;
} else
xnmax = max(x, xnmax);
//Call the analysis (which calculates cross sections)
for ( int i = 0, N = analyses.size(); i < N; ++i )
analyses[i]->analyze(*dr, *dl, b, xSecFn(), prob, weight);
}
// Call the analysis (which calculates cross sections) for all
// systems and impact parameters.
for ( int i = 0, N = analyses.size(); i < N; ++i )
analyses[i]->analyze(vr, vl, vb, xSecFn(), probs, jac);
}
//Write output (also from the called analyses) to log file.
if ( preSamples() > 0 ) {
generator()->log()
<< "Presampled " << preSamples() << " collisions ("
<< elapsed()/max(preSamples(),0) << " seconds per collisions)" << endl
<< "Maximum cross section: "
<< ouniterr(xmax, xmax-xnmax, nanobarn) << " nb." <<endl;
for_each(analyses,
bind2nd(mem_fun(&DipoleAnalysisHandler::finalize),
preSamples()*preSampleL()*preSampleR()*preSampleB()));
generator()->log() << endl;
}
stats = XSecStat(xmax > 0.0*nanobarn? xmax: 1.0*millibarn);
}
void DipoleEventHandler::diffractivePresample() {
//Setup before
Current<DipoleEventHandler> current(this);
for_each(analyses, mem_fun(&DipoleAnalysisHandler::initialize));
CrossSection xmax = 0.0*picobarn;
CrossSection xnmax = 0.0*picobarn;
elapsed();
generator()->log()
<< endl << "Starting Diffractive DIPSY run at CoM energy "
<< lumiFn().maximumCMEnergy()/GeV << " GeV" << endl;
Energy W = lumiFn().maximumCMEnergy();
double jac = 1.0;
pair<double,double> ll(1.0, 1.0);
//Create the starting states from their wavefunction.
if ( int ndim = lumiFn().nDim(make_pair(WFL().particle(), WFR().particle())) ) {
vector<double> r = UseRandom::rndvec(ndim);
ll = lumiFn().generateLL(&(r[0]), jac);
W *= exp(-0.5*(ll.first + ll.second));
}
//Calculate the energy of each incoming state in this frame.
Energy2 a = WFL().m2() - WFR().m2() + sqr(W);
Energy PL = (a + sqrt(sqr(a) - WFL().m2()*sqr(W)))*0.5/W;
a = WFR().m2() - WFL().m2() + sqr(W);
Energy PR = (a + sqrt(sqr(a) - WFR().m2()*sqr(W)))*0.5/W;
//Set up rapidity intervals to evolve over.
double y0 = interactionFrame(-log(PL/sqrt(abs(WFL().m2()))), log(PR/sqrt(abs(WFR().m2()))));
//Pre-generate the virtual cascade, ie the ones from the
//elastic side (right side by default).
vector<DipoleStatePtr> virtualCascades;
for ( int i = 0, N = preSamples(); i < N; i ++ ) {
DipoleStatePtr virt = WFR().generate(*this, PR);
virt->collidingEnergy(PL);
virt->evolve(virt->lowestY(), -y0);
virtualCascades.push_back(virt);
}
CrossSection sigmaSD = ZERO;
QTY<4,0,0>::Type sigmaSD2 = ZERO;
//Now run main loop over the real (excited in final state) cascades.
for ( int i = 0, N = preSamples(); i < N; ++i ) {
DipoleStatePtr dl = WFL().generate(*this, PL);
dl->collidingEnergy(PR);
dl->evolve(dl->lowestY(), y0);
ImpactParameters b = bGen().generate();
double sum = 0.0;
double sumWeights = 0.0;
//Loop over the pregenerated virtual elastic
for ( int j = 0; j < N; j ++ ) {
double amp = xSecFn().unitarize(xSecFn().sumf(*virtualCascades[j], *dl, b));
sum += amp*virtualCascades[j]->weight();
sumWeights += virtualCascades[j]->weight();
}
double average = sum/sumWeights;
//Take statistics on inclusive single diffractive cross section.
CrossSection weight = sqr(hbarc)*dl->weight()*b.weight()*jac;
CrossSection x = weight*average;
sigmaSD += weight*sqr(average);
sigmaSD2 += sqr(weight*sqr(average));
if ( x > xmax ) {
xnmax = xmax;
xmax = x;
} else
xnmax = max(x, xnmax);
//Pass on to analysers.
for ( int j = 0, M = analyses.size(); j < M; ++j )
analyses[j]->analyze(*WFR().generate(*this, PR), *dl, b, xSecFn(), average, weight);
}
//Output results to log file.
if ( preSamples() > 0 ) {
sigmaSD /= preSamples();
sigmaSD2 /= preSamples();
//Estimate error from the fluctuations.
CrossSection err = sqrt((sigmaSD2 - sqr(sigmaSD))/preSamples());
generator()->log()
<< "Presampled " << preSamples() << " real cascades, collided with "
<< preSamples() << " virtual cascades ("
<< elapsed()/max(preSamples(),0) << " seconds per real cascade)" << endl
<< "Maximum cross section: "
<< ouniterr(xmax, xmax-xnmax, nanobarn) << " nb." <<endl
<< "Integrated single diffractive cross section up to y = " << y0
<< " is " << ouniterr(sigmaSD, err, nanobarn) << " nb." <<endl;
for_each(analyses,
bind2nd(mem_fun(&DipoleAnalysisHandler::finalize), preSamples()));
generator()->log() << endl;
}
stats = XSecStat(xmax > 0.0*nanobarn? xmax: 1.0*millibarn);
}
void DipoleEventHandler::initialize() {
Current<DipoleEventHandler> current(this);
theWFL->initialize(*this);
theWFR->initialize(*this);
}
EventPtr DipoleEventHandler::generateEvent() {
//Redirect diffractive events.
if ( collisionType() == 1 ) return generateDiffractiveEvent();
while ( true ) {
Current<DipoleEventHandler> current(this);
//Set up energy, jacobians and wavefunctions.
Energy W = lumiFn().maximumCMEnergy();
double jac = 1.0;
pair<double,double> ll(1.0, 1.0);
if ( int ndim = lumiFn().nDim(make_pair(WFL().particle(), WFR().particle())) ) {
vector<double> r = UseRandom::rndvec(ndim);
ll = lumiFn().generateLL(&(r[0]), jac);
}
//Find lightcone momenta.
Energy2 a = WFL().m2() - WFR().m2() + sqr(W);
Energy PL = (a + sqrt(sqr(a) - 4.0*WFL().m2()*sqr(W)))*0.5/W;
a = WFR().m2() - WFL().m2() + sqr(W);
Energy PR = (a + sqrt(sqr(a) - 4.0*WFR().m2()*sqr(W)))*0.5/W;
PPair inc(WFL().particle()->produceParticle(lightCone(PL, WFL().m2()/PL)),
WFR().particle()->produceParticle(lightCone(WFR().m2()/PR, PR)));
LorentzRotation cmboost =
lumiFn().getBoost()*LorentzRotation(0.0, 0.0, tanh(0.5*(ll.second - ll.first)));
inc.first->transform(cmboost);
inc.second->transform(cmboost);
//Create dipole states.
DipoleStatePtr dr = WFR().generate(*this, PR);
DipoleStatePtr dl = WFL().generate(*this, PL);
//in some settings, the states need to know about the
//energy of the other state.
dr->collidingEnergy(PL);
dl->collidingEnergy(PR);
double y0 = interactionFrame(dl->highestY(), -dr->highestY());
dr->evolve(dr->lowestY(), -y0);
dr->unifyColourSystems();
dl->evolve(dl->lowestY(), y0);
dl->unifyColourSystems();
// This generates the impact parameter depending on the position
//of the partons. Intention was to generate high-pt events more
//often by selecting a b such that two partons would end up
//very close to each other more often. Should work in theory, but
//didn't make as big difference as hoped, maybe due to too many
//of the high pTs coming from the cascade.
// vector<pair<Parton::Point, InvEnergy> > points1 = dl->points();
// vector<pair<Parton::Point, InvEnergy> > points2 = dr->points();
// ImpactParameters b = bGen().generateDynamic(points1, points2);
//Standard impact parameter generation.
ImpactParameters b = bGen().generate();
inc.first->setVertex
(LorentzPoint(hbarc*b.bVec().x()/2, hbarc*b.bVec().y()/2, ZERO, ZERO));
inc.second->setVertex
(LorentzPoint(-hbarc*b.bVec().x()/2, -hbarc*b.bVec().y()/2, ZERO, ZERO));
currentEvent(new_ptr(Event(inc, this, generator()->runName(),
generator()->currentEventNumber(), 1.0)));
currentCollision(new_ptr(Collision(inc, currentEvent(), this)));
if ( currentEvent() ) currentEvent()->addCollision(currentCollision());
currentStep(new_ptr(Step(currentCollision())));
currentCollision()->addStep(currentStep());
double genweight = sqr(hbarc)*dr->weight()*dl->weight()*b.weight()*jac/
stats.maxXSec();
//Pass to filler. This is where the final state is decided.
double prob = eventFiller().fill(*currentStep(), *this, inc, *dl, *dr, b);
double weight = prob*genweight;
stats.select(weight);
currentEvent()->weight(weight);
if ( weight <= 0.0 ) continue;
stats.accept();
try {
initGroups();
continueCollision();
return currentEvent();
}
catch (Veto) {
stats.reject(weight);
}
catch (Stop) {
break;
}
catch (Exception &) {
stats.reject(weight);
throw;
}
}
return currentEvent();
}
EventPtr DipoleEventHandler::generateDiffractiveEvent() {
//Very similar to generateEvent.
while ( true ) {
//Same setup as in the non-diffractive case.
Current<DipoleEventHandler> current(this);
Energy W = lumiFn().maximumCMEnergy();
double jac = 1.0;
pair<double,double> ll(1.0, 1.0);
if ( int ndim = lumiFn().nDim(make_pair(WFL().particle(), WFR().particle())) ) {
vector<double> r = UseRandom::rndvec(ndim);
ll = lumiFn().generateLL(&(r[0]), jac);
}
Energy2 a = WFL().m2() - WFR().m2() + sqr(W);
Energy PL = (a + sqrt(sqr(a) - 4.0*WFL().m2()*sqr(W)))*0.5/W;
a = WFR().m2() - WFL().m2() + sqr(W);
Energy PR = (a + sqrt(sqr(a) - 4.0*WFR().m2()*sqr(W)))*0.5/W;
PPair inc(WFL().particle()->produceParticle(lightCone(PL, WFL().m2()/PL)),
WFR().particle()->produceParticle(lightCone(WFL().m2()/PR, PR)));
LorentzRotation cmboost =
lumiFn().getBoost()*LorentzRotation(0.0, 0.0, tanh(0.5*(ll.second - ll.first)));
inc.first->transform(cmboost);
inc.second->transform(cmboost);
//create real excited valence. Evolution is done in diffFill.
DipoleStatePtr dr = WFL().generate(*this, PL);
//create elastic
DipoleStatePtr de = WFR().generate(*this, PR);
ImpactParameters b = bGen().generate();
inc.first->setVertex
(LorentzPoint(hbarc*b.bVec().x()/2, hbarc*b.bVec().y()/2, ZERO, ZERO));
inc.second->setVertex
(LorentzPoint(-hbarc*b.bVec().x()/2, -hbarc*b.bVec().y()/2, ZERO, ZERO));
currentEvent(new_ptr(Event(inc, this, generator()->runName(),
generator()->currentEventNumber(), 1.0)));
currentCollision(new_ptr(Collision(inc, currentEvent(), this)));
if ( currentEvent() ) currentEvent()->addCollision(currentCollision());
currentStep(new_ptr(Step(currentCollision())));
currentCollision()->addStep(currentStep());
double genweight = sqr(hbarc)*dr->weight()*de->weight()*b.weight()*jac/
stats.maxXSec();
//Call filler, which will be redirected to diffractive version.
double prob = eventFiller().fill(*currentStep(), *this, inc, *dr, *de, b);
double weight = prob*genweight;
if ( weight <= 0.0 ) continue;
if ( isnan(weight) ) {
continue;
}
stats.select(weight);
currentEvent()->weight(weight);
stats.accept();
try {
initGroups();
continueCollision();
return currentEvent();
}
catch (Veto) {
stats.reject(weight);
}
catch (Stop) {
break;
}
catch (Exception &) {
stats.reject(weight);
throw;
}
}
return currentEvent();
}
CrossSection DipoleEventHandler::integratedXSec() const {
return stats.xSec();
}
CrossSection DipoleEventHandler::integratedXSecErr() const {
return stats.xSecErr();
}
CrossSection DipoleEventHandler::maxXSec() const {
return stats.maxXSec();
}
CrossSection DipoleEventHandler::histogramScale() const {
return stats.xSec()/stats.sumWeights();
}
void DipoleEventHandler::statistics(ostream & os) const {
string line = "======================================="
"=======================================\n";
if ( stats.accepted() <= 0 ) {
os << line << "No events generated by event handler '" << name() << "'."
<< endl;
return;
}
os << line << "Statistics for event handler \'" << name() << "\':\n"
<< " "
<< "generated number of Cross-section\n"
<< " "
<< " events attempts (nb)\n";
os << line << "Total:" << setw(42) << stats.accepted() << setw(13)
<< stats.attempts() << setw(17)
<< ouniterr(stats.xSec(), stats.xSecErr(), nanobarn)
<< endl << line;
}
void DipoleEventHandler::doinit() throw(InitException) {
Current<DipoleEventHandler> current(this);
EventHandler::doinit();
}
void DipoleEventHandler::dofinish() {
generator()->log() << endl << "Ending DIPSY run at CoM energy "
<< lumiFn().maximumCMEnergy()/GeV << " GeV" << endl;
theEventFiller->finish();
EventHandler::dofinish();
CPUClock::dump(generator()->log());
}
void DipoleEventHandler::doinitrun() {
Current<DipoleEventHandler> current(this);
EventHandler::doinitrun();
theNErr = 0;
for_each(analyses, mem_fun(&DipoleAnalysisHandler::initrun));
if ( theSwinger ) theSwinger->initrun();
theEmitter->initrun();
theBGen->initrun();
theXSecFn->initrun();
theEventFiller->initrun();
theWFL->initrun();
theWFR->initrun();
if ( externalAlphaS() ) externalAlphaS()->initrun();
presample();
// Fix up a dummy XComb object
Energy emax = lumiFn().maximumCMEnergy();
cuts()->initialize(sqr(emax), 0.0);
cPDPair incoming = make_pair(WFL().particle(), WFR().particle());
PartonPairVec bins = partonExtractor()->getPartons(emax, incoming, *cuts());
theLastXComb = new_ptr(XComb(emax, incoming, this, partonExtractor(),
tCascHdlPtr(), bins[0], cuts()));
theLastXComb->lastSHat(sqr(emax));
theLastXComb->lastY(0.0);
theLastXComb->lastP1P2(make_pair(0.0, 0.0));
theLastXComb->lastL1L2(make_pair(0.0, 0.0));
theLastXComb->lastX1X2(make_pair(1.0, 1.0));
theLastXComb->lastScale(sqr(emax));
theLastXComb->lastAlphaS(1.0);
theLastXComb->lastAlphaEM(1.0/137.0);
partonExtractor()->select(theLastXComb);
}
void DipoleEventHandler::rebind(const TranslationMap & trans) throw(RebindException) {
// dummy = trans.translate(dummy);
EventHandler::rebind(trans);
}
IVector DipoleEventHandler::getReferences() {
IVector ret = EventHandler::getReferences();
// ret.push_back(dummy);
return ret;
}
double DipoleEventHandler::alphaS(InvEnergy r) const {
if ( fixedAlphaS() > 0.0 )
return fixedAlphaS();
else if ( LambdaQCD() > 0.0*GeV && LambdaQCD() < 2.0/rMax() )
return 6.0*Constants::pi/((33.0 - 2.0*nF())*
log(2.0/(min(r,rMax())*LambdaQCD())));
else if ( externalAlphaS() )
return externalAlphaS()->value(sqr(2.0/min(r,rMax())), SM());
else
return SM().alphaS(sqr(2.0/min(r,rMax())));
}
double DipoleEventHandler::interactionFrame(double ymin, double ymax) const {
double yframe = yFrame();
if ( yFrame() < -1.0 && yFrame() >= -1.5 ) {
double dum = -(yFrame() + 1.0);
yframe = UseRandom::rnd(dum, 1.0 - dum);
}
double y0 = ymin + yframe*(ymax - ymin);
if ( y0 > ymax ) y0 = max(ymin, ymax + (1.0 - yframe));
else if ( y0 < ymin ) y0 = min(ymax, ymin + yframe);
return y0;
}
void DipoleEventHandler::persistentOutput(PersistentOStream & os) const {
os << theNColours << ounit(theRMax, InvGeV) << ounit(theBaryonSize, InvGeV)
<< ounit(theCoherenceRange, InvGeV)
<< theEffectivePartonMode << theCollisionType << doShowHistory
<< ounit(theLambdaQCD, GeV) << theNF << theFixedAlphaS << theExternalAlphaS
- << theWFR << theWFL << theBGen << theYFrame << theFudgeME << thePreSamples << thePreSampleL
+ << theWFR << theWFL << theBGen << theYFrame << theFudgeME << theFudgeFactorME << thePreSamples << thePreSampleL
<< thePreSampleR << thePreSampleB << theXSecFn << theEmitter << theSwinger
<< theEventFiller << analyses << stats;
}
void DipoleEventHandler::persistentInput(PersistentIStream & is, int) {
is >> theNColours >> iunit(theRMax, InvGeV) >> iunit(theBaryonSize, InvGeV)
>> iunit(theCoherenceRange, InvGeV)
>> theEffectivePartonMode >> theCollisionType >> doShowHistory
>> iunit(theLambdaQCD, GeV) >> theNF >> theFixedAlphaS >> theExternalAlphaS
- >> theWFR >> theWFL >> theBGen >> theYFrame >> theFudgeME >> thePreSamples >> thePreSampleL
+ >> theWFR >> theWFL >> theBGen >> theYFrame >> theFudgeME >> theFudgeFactorME >> thePreSamples >> thePreSampleL
>> thePreSampleR >> thePreSampleB >> theXSecFn >> theEmitter >> theSwinger
>> theEventFiller >> analyses >> stats;
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<DipoleEventHandler,EventHandler>
describeDIPSYDipoleEventHandler("DIPSY::DipoleEventHandler",
"libAriadne5.so libDIPSY.so");
void DipoleEventHandler::Init() {
static ClassDocumentation<DipoleEventHandler> documentation
("The DipoleEventHandler is a special EventHandler capable of generating "
"minimum-bias events using the Lund version of the Mueller dipole model.");
static Parameter<DipoleEventHandler,int> interfaceNColours
("NColours",
"The number of different colour indices in the swing mechanism. Should be "
"\\f$N_c^2\\f$ but can be varied to investigate swing effects.",
&DipoleEventHandler::theNColours, 9, 3, 0,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,InvEnergy> interfaceRMax
("RMax",
"The general hadronic size in units of inverse GeV.",
&DipoleEventHandler::theRMax, InvGeV, 3.5*InvGeV, 0.0*InvGeV, 0*InvGeV,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,InvEnergy> interfaceCoherenceRange
("CoherenceRange",
"The maximum range at which partons are allowed to emit coherently."
"This is also used as maximum range in the DGLAP suppression",
&DipoleEventHandler::theCoherenceRange, InvGeV, 0.5*InvGeV, 0.0*InvGeV, 0*InvGeV,
true, false, Interface::lowerlim);
static Switch<DipoleEventHandler,int> interfaceEffectivePartonMode
("EffectivePartonMode",
"How the partons are grouped inteo effective partons.",
&DipoleEventHandler::theEffectivePartonMode, 0, true, false);
static SwitchOption interfaceEffectivePartonModeColours
(interfaceEffectivePartonMode,
"Colours",
"Groups with colour neighbours. Makes more sence since the "
"colour flow determines how the emissions are made, but the "
"swing makes this mode not always group up recoiling partons, "
"which can mess up availible phase space and ordering. "
"This is default.",
0);
static SwitchOption interfaceEffectivePartonModeFastColours
(interfaceEffectivePartonMode,
"FastColours",
"Groups with colour neighbours as for the \"Colour\" option, "
"but speed up the generation by caching different ranges for "
"the same parton.",
2);
static SwitchOption interfaceEffectivePartonModeFastColours2
(interfaceEffectivePartonMode,
"FastColours2",
"Groups with colour neighbours as for the \"FastColour\" option, "
"but speed up the generation by caching different ranges for "
"the same parton.",
3);
static SwitchOption interfaceEffectivePartonModeRelatives
(interfaceEffectivePartonMode,
"Relatives",
"Groups with parents and childs. Always pairs up with the "
"recoiling pt, and should get the phase space and ordering "
"correct, but makes the emissions depend on the history"
", not only current state.",
1);
static Switch<DipoleEventHandler,int> interfaceCollisionType
("CollisionType",
"What type of collison.",
&DipoleEventHandler::theCollisionType, 0, true, false);
static SwitchOption interfaceCollisionTypeNonDiffractive
(interfaceCollisionType,
"NonDiffractive",
"Should be self explanatory. :P",
0);
static SwitchOption interfaceTypeSingleDiffractive
(interfaceCollisionType,
"SingleDiffractive",
"Should be self explanatory. :P",
1);
static Parameter<DipoleEventHandler,bool> interfaceShowHistory
("ShowHistory",
"If the history of every event should be studied manually."
"Note that only final state events get studied, not the presamples.",
&DipoleEventHandler::doShowHistory, false, false, false,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,Energy> interfaceLambdaQCD
("LambdaQCD",
"The value of \\f$\\Lambda_{QCD}\\f$ to be used in the running coupling. "
"If zero, the <interface>AlphaS</interface> object will be used for the "
"coupling instead.",
&DipoleEventHandler::theLambdaQCD, GeV, 0.22*GeV, 0.0*GeV, 0*GeV,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,double> interfaceFixedAlphaS
("FixedAlphaS",
"The value of the constant coupling. If zero, a running coupling is "
"assumed.",
&DipoleEventHandler::theFixedAlphaS, 0.0, 0.0, 0,
true, false, Interface::lowerlim);
static Reference<DipoleEventHandler,AlphaSBase> interfaceExternalAlphaS
("ExternalAlphaS",
"An external \\f$\\alpha_S\\f$ object to be used if "
"<interface>LambdaQCD</interface> is zero. If null the object "
"specified in the overall StandardModel object will be used insted.",
&DipoleEventHandler::theExternalAlphaS, true, false, true, true, false);
static Parameter<DipoleEventHandler,int> interfaceNF
("NF",
"The number of flavours to be used in the running coupling. Not active "
"if an external running coupling (<interface>ExternalAlphaS</interface> "
"is used.",
&DipoleEventHandler::theNF, 3, 1, 0,
true, false, Interface::lowerlim);
static Reference<DipoleEventHandler,WaveFunction> interfaceWFR
("WFR",
"The wave function of the incoming particle along the positive z-axis.",
&DipoleEventHandler::theWFR, true, false, true, false, false);
static Reference<DipoleEventHandler,WaveFunction> interfaceWFL
("WFL",
"The wave function of the incoming particle along the negative z-axis.",
&DipoleEventHandler::theWFL, true, false, true, false, false);
static Parameter<DipoleEventHandler,double> interfaceYFrame
("YFrametest",
"Indicate in which frame the dipole systems should collide. A value of "
"0.5 means that both systems will be evolved an equal rapidity distance. "
"0.0 (1.0) means that the right(left)-moving system will not be evolved "
"at all while the left(right)-moving system will be evolved as much as "
"possible. A value larger than 1.0 (less than 0.0) means the right-(left-)moving "
"system will be evolved a fixed rapidity interval YFrametest - 1 (-YFrametest)",
&DipoleEventHandler::theYFrame, 0.5, 0.0, 1.0,
true, false, Interface::nolimits);
static Switch<DipoleEventHandler,bool> interfaceFudgeME
("FudgeME",
"Indicate whether a fudge factor should be included to tame the high-pt tail "
"according to an approximate matrix element correction.",
&DipoleEventHandler::theFudgeME, false, true, false);
static SwitchOption interfaceFudgeMEFudge
(interfaceFudgeME,
"Fudge",
"Include fudge factor",
true);
static SwitchOption interfaceFudgeMENoFudge
(interfaceFudgeME,
"NoFudge",
"Do not include fudge factor",
false);
+
+ static Parameter<DipoleEventHandler,double> interfaceFudgeFactorME
+ ("FudgeFactorME",
+ "Extra factor to be applied for high-pt scattering in interactions.",
+ &DipoleEventHandler::theFudgeFactorME, 1.0, 0.0, 0,
+ true, false, Interface::lowerlim);
+
+
static Parameter<DipoleEventHandler,int> interfacePreSamples
("PreSamples",
"The number of collisions to analyze in the presampling.",
&DipoleEventHandler::thePreSamples, 1000, 0, 0,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,int> interfacePreSampleL
("PreSampleL",
"The number of left-moving systems to generate for each presample.",
&DipoleEventHandler::thePreSampleL, 1, 1, 0,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,int> interfacePreSampleR
("PreSampleR",
"The number of right-moving systems to generate for each presample.",
&DipoleEventHandler::thePreSampleR, 1, 1, 0,
true, false, Interface::lowerlim);
static Parameter<DipoleEventHandler,int> interfacePreSampleB
("PreSampleB",
"The number ofimpact parameters to generate for each presample.",
&DipoleEventHandler::thePreSampleB, 1, 1, 0,
true, false, Interface::lowerlim);
static Reference<DipoleEventHandler,DipoleXSec> interfaceXSecFn
("XSecFn",
"The object responsible for calculating the cross section for two "
"colliding dipole systems.",
&DipoleEventHandler::theXSecFn, true, false, true, false, false);
static Reference<DipoleEventHandler,ImpactParameterGenerator> interfaceBGen
("BGen",
"The object responsible for generating the impact parameters.",
&DipoleEventHandler::theBGen, true, false, true, false, false);
static Reference<DipoleEventHandler,Emitter> interfaceEmitter
("Emitter",
"The object responsible for generating and performing dipole emissions "
"of gluons.",
&DipoleEventHandler::theEmitter, true, false, true, false, false);
static Reference<DipoleEventHandler,Swinger> interfaceSwinger
("Swinger",
"The object responsible for generating and performing dipole swings.",
&DipoleEventHandler::theSwinger, true, false, true, true, false);
static Reference<DipoleEventHandler,EventFiller> interfaceEventFiller
("EventFiller",
"The object responsible for filling an event with final state gluons.",
&DipoleEventHandler::theEventFiller, true, false, true, false, false);
static RefVector<DipoleEventHandler,DipoleAnalysisHandler>
interfaceAnalysisHandlers
("AnalysisHandlers",
"A list of analysis to be performed in the presample phase.",
&DipoleEventHandler::analyses, -1, true, false, true, false, false);
static Parameter<DipoleEventHandler,InvEnergy> interfaceBaryonSize
("BaryonSize",
"The typical size of a baryon to be used by wave functions not "
"defining their own. If zero, <interface>RMax</interface> will "
"be used instead.",
&DipoleEventHandler::theBaryonSize, InvGeV, 0.0*InvGeV, 0.0*InvGeV, 0*InvGeV,
true, false, Interface::lowerlim);
}
diff --git a/DIPSY/DipoleEventHandler.h b/DIPSY/DipoleEventHandler.h
--- a/DIPSY/DipoleEventHandler.h
+++ b/DIPSY/DipoleEventHandler.h
@@ -1,602 +1,617 @@
// -*- C++ -*-
#ifndef DIPSY_DipoleEventHandler_H
#define DIPSY_DipoleEventHandler_H
//
// This is the declaration of the DipoleEventHandler class.
//
#include "ThePEG/Handlers/EventHandler.h"
#include "DipoleEventHandler.fh"
#include "WaveFunction.h"
#include "DipoleXSec.h"
#include "Emitter.h"
#include "Swinger.h"
#include "EventFiller.h"
// #include "DiffractiveEventFiller.h"
#include "ImpactParameterGenerator.h"
#include "DipoleAnalysisHandler.h"
#include "ThePEG/StandardModel/AlphaSBase.h"
#include "ThePEG/StandardModel/StandardModelBase.h"
#include "ThePEG/Utilities/XSecStat.h"
namespace DIPSY {
using namespace ThePEG;
/**
* Here is the documentation of the DipoleEventHandler class.
*
* @see \ref DipoleEventHandlerInterfaces "The interfaces"
* defined for DipoleEventHandler.
*/
class DipoleEventHandler: public EventHandler {
public:
/** Declare a pointer to an AlphaSBase object. */
typedef Ptr<AlphaSBase>::pointer ASPtr;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
DipoleEventHandler();
/**
* The destructor.
*/
virtual ~DipoleEventHandler();
//@}
public:
/**
* Initialize this event handler and all related objects needed to
* generate events.
*/
virtual void initialize();
/**
* Pre-sample the cross section before generating events.
* This does inclusive cross section for non-diffractive collisions.
* Diffractive inclusive cross sections are redirected.
*/
void presample();
/**
* Pre-sample the single diffractive cross section before
* generating events. This requires a different method, as it
* needs a double loop over events.
*/
void diffractivePresample();
/**
* Generate an event.
*/
virtual EventPtr generateEvent();
/**
* Generate a diffractive event.
*/
virtual EventPtr generateDiffractiveEvent();
/**
* Write out statistics.
*/
virtual void statistics(ostream &) const;
/**
* The total integrated cross section of the processes generated in
* this run.
* @return 0 if no integrated cross section could be estimated.
*/
virtual CrossSection integratedXSec() const;
/**
* The error total integrated cross section of the processes
* generated in this run.
* @return 0 if no integrated cross section could be estimated.
*/
virtual CrossSection integratedXSecErr() const;
/**
* The overestimated cross section ised in the generation.
*/
CrossSection maxXSec() const;
/**
* Histogram scale. A histogram bin which has been filled with the
* weights associated with the Event objects should be scaled by
* this factor to give the correct cross section.
*/
virtual CrossSection histogramScale() const;
/**
* Return the running coupling for the given size (scale).
*/
double alphaS(InvEnergy r) const;
/** @name Simple access functions. */
//@{
/**
* The number of different colour indices.
*/
inline int nColours() const {
return theNColours;
}
/**
* The general hadronic size.
*/
inline InvEnergy rMax() const {
return theRMax;
}
/**
* Get the typical size of a baryon to be used by wave functions not
* defining their own.
*/
inline InvEnergy baryonSize() const {
return theBaryonSize > ZERO? theBaryonSize: rMax();
}
/**
* The maximum range at which coherent emissions are allowed.
*/
inline InvEnergy coherenceRange() const {
return theCoherenceRange;
}
/**
* Return the effective parton mode.
*/
inline int effectivePartonMode() const {
return theEffectivePartonMode;
}
/**
* Return the collision type.
*/
inline int collisionType() const {
return theCollisionType;
}
/**
* The value of \f$\Lambda_{QCD}\f$ to be used in the running coupling.
*/
inline Energy LambdaQCD() const {
return theLambdaQCD;
}
/**
* The number of flavours to be used in the running coupling.
*/
inline int nF() const {
return theNF;
}
/**
* The value of the constant coupling. If zero, a running coupling is assumed.
*/
inline double fixedAlphaS() const {
return theFixedAlphaS;
}
/**
* An external \f$\alpha_S\f$ object to be used if LambdaQCD() is zero.
*/
inline ASPtr externalAlphaS() const {
return theExternalAlphaS;
}
/**
* Alpha bar = alphas*Nc/pi
*/
inline double alphaBar(InvEnergy r) const {
return alphaS(r)*3.0/M_PI;
}
/**
* Get the wave function of the incoming particle along the positive z-axis.
*/
inline WaveFunction & WFR() const {
return *theWFR;
}
/**
* Get the wave function of the incoming particle along the negative z-axis.
*/
inline WaveFunction & WFL() const {
return *theWFL;
}
/**
* Get the object responsible for generating the impact parameters.
*/
inline const ImpactParameterGenerator & bGen() const {
return *theBGen;
}
/**
* Indicate whether a fudge factor should be included to tame the
* high-pt tail according to an approximate matrix element
* correction.
*/
inline bool fudgeME() const {
return theFudgeME;
}
/**
+ * Indicate whether an additional fudge factor should be included to tame the
+ * high-pt tail in the interactions.
+ */
+ inline double fudgeFactorME() const {
+ return theFudgeFactorME;
+ }
+
+ /**
* Indicate in which frame the dipole systems should collide.
*/
inline double yFrame() const {
return theYFrame;
}
/**
* Return the rapidity to use for the interaction frame.
*/
double interactionFrame(double ymin, double ymax) const;
/**
* Get the number of collisions to analyze in the presampling.
*/
inline int preSamples() const {
return thePreSamples;
}
/**
* The number of left-moving systems to generate for each presample.
*/
inline int preSampleL() const {
return thePreSampleL;
}
/**
* The number of right-moving systems to generate for each presample.
*/
inline int preSampleR() const {
return thePreSampleR;
}
/**
* The number of impact parameters to generate for each presample.
*/
inline int preSampleB() const {
return thePreSampleB;
}
/**
* Get the object responsible for calculating the cross section for
* two colliding dipole systems.
*/
inline const DipoleXSec & xSecFn() const {
return *theXSecFn;
}
/**
* Get the object responsible for generating and performing dipole
* emissions of gluons.
*/
inline const Emitter & emitter() const {
return *theEmitter;
}
/**
* Set the object responsible for generating and performing dipole
* emissions of gluons.
* Added by CF to access from emitter.
*/
inline void emitter(EmitterPtr em) {
theEmitter = em;
}
/**
* Set the object responsible for generating and performing dipole
* swings.
* Added by CF to access from emitter.
*/
inline void swinger(SwingerPtr sw) {
theSwinger = sw;
}
/**
* Get the object responsible for generating and performing dipole swings.
*/
inline const Swinger & swinger() const {
return *theSwinger;
}
/**
* Get the object responsible for generating and performing dipole swings.
*/
inline tSwingerPtr swingPtr() const {
return theSwinger;
}
/**
* Get the object responsible for filling an event with final state gluons.
*/
inline const EventFiller & eventFiller() const {
return *theEventFiller;
}
// /**
// * Get the object responsible for filling an event with final state gluons.
// */
// inline const DiffractiveEventFiller & diffractiveEventFiller() const {
// return *theDiffractiveEventFiller;
// };
/**
* adds an error to the counter
**/
inline void err() const {
theNErr++;
};
/**
* returns teh number of errors so far.
**/
inline const long nErr() const {
return theNErr;
};
//@}
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;
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
private:
/**
* The number of different colour indices.
*/
int theNColours;
/**
* The general hadronic size.
*/
InvEnergy theRMax;
/**
* The typical size of a baryon to be used by wave functions not
* defining their own. If zero, theRMax will be used instead.
*/
InvEnergy theBaryonSize;
/**
* The maximum range at which partons can emit coherently as effective partons.
*/
InvEnergy theCoherenceRange;
/**
* The way the partons are grouped into effective partons.
*/
int theEffectivePartonMode;
/**
* The type of collison. 0: non diffractive, 1: single diffractive
*/
int theCollisionType;
/**
* if the history of every event should be studied manually.
*/
bool doShowHistory;
/**
* The value of \f$\Lambda_{QCD}\f$ to be used in the running coupling.
*/
Energy theLambdaQCD;
/**
* The number of flavours to be used in the running coupling.
*/
int theNF;
/**
* The value of the constant coupling. If zero, a running coupling is assumed.
*/
double theFixedAlphaS;
/**
* An external \f$\alpha_S\f$ object to be used if LambdaQCD() is zero.
*/
ASPtr theExternalAlphaS;
/**
* The wave function of the incoming particle along the positive z-axis.
*/
WaveFunctionPtr theWFR;
/**
* The wave function of the incoming particle along the negative z-axis.
*/
WaveFunctionPtr theWFL;
/**
* The object responsible for generating the impact parameters.
*/
ImpactParameterGeneratorPtr theBGen;
/**
* Indicate in which frame the dipole systems should collide.
*/
double theYFrame;
/**
* Indicate whether a fudge factor should be included to tame the
* high-pt tail according to an approximate matrix element correction.
*/
bool theFudgeME;
/**
+ * Indicate whether an extra fudge factor should be included to tame
+ * the high-pt tail in the interactions according to an approximate
+ * matrix element correction.
+ */
+ double theFudgeFactorME;
+
+ /**
* The number of collisions to analyze in the presampling.
*/
int thePreSamples;
/**
* The number of left-moving systems generated for each presample.
*/
int thePreSampleL;
/**
* The number of right-moving systems generated for each presample.
*/
int thePreSampleR;
/**
* The number of impact parameters generated for each presample.
*/
int thePreSampleB;
/**
* The object responsible for calculating the cross section for two
* colliding dipole systems.
*/
DipoleXSecPtr theXSecFn;
/**
* The object responsible for generating and performing dipole
* emissions of gluons.
*/
EmitterPtr theEmitter;
/**
* The object responsible for generating and performing dipole swings.
*/
SwingerPtr theSwinger;
/**
* The object responsible for filling an event with final state gluons.
*/
EventFillerPtr theEventFiller;
// /**
// * The object responsible for filling an event with diffractive final state gluons.
// */
// DiffractiveEventFillerPtr theDiffractiveEventFiller;
/**
* A list of analysis objects to be applied in the presample phase.
*/
vector<DipoleAnalysisHandlerPtr> analyses;
/**
* Collect statistics.
*/
XSecStat stats;
/**
* The number of error messages.
**/
mutable long theNErr;
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() throw(InitException);
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
virtual void dofinish();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans) throw(RebindException);
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
public:
/** Return the elapsed number of seconds since lat call. */
static double elapsed();
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
DipoleEventHandler & operator=(const DipoleEventHandler &);
};
}
#endif /* DIPSY_DipoleEventHandler_H */
diff --git a/DIPSY/DipoleEventHandler.icc b/DIPSY/DipoleEventHandler.icc
deleted file mode 100644
--- a/DIPSY/DipoleEventHandler.icc
+++ /dev/null
@@ -1,13 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the DipoleEventHandler class.
-//
-
-namespace DIPSY {
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/DIPSY/DipoleState.cc b/DIPSY/DipoleState.cc
--- a/DIPSY/DipoleState.cc
+++ b/DIPSY/DipoleState.cc
@@ -1,1415 +1,1392 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the DipoleState class.
//
#include "DipoleState.h"
#include "DipoleEventHandler.h"
#include "EventFiller.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Utilities/Throw.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Utilities/Debug.h"
#include "ThePEG/Utilities/MaxCmp.h"
#include "ThePEG/Utilities/ObjectIndexer.h"
#include "ThePEG/Utilities/UtilityBase.h"
#include "ThePEG/Utilities/SimplePhaseSpace.h"
#include "ParticleInfo.h"
#include "CPUTimer.h"
#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace DIPSY;
DipoleState::DipoleState(const DipoleState & x)
: thePlus(x.thePlus), theMinus(x.theMinus), theMinusDeficit(x.theMinusDeficit),
theHandler(x.theHandler), theInitialDipoles(x.theInitialDipoles),
theSwingCandidates(x.theSwingCandidates),
theTouchedSwingCandidates(x.theTouchedSwingCandidates),
theWFInfo(x.theWFInfo),
theWeight(x.theWeight), doTakeHistory(x.doTakeHistory), theYmax(x.theYmax),
theCollidingEnergy(x.theCollidingEnergy), theHistory(x.theHistory),
allDipoles(x.allDipoles), theIncoming(x.theIncoming), theProducedParticles(x.theProducedParticles) {
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); ++it )
(**it).theDipoleState = this;
}
DipoleState::~DipoleState() {}
DipoleStatePtr DipoleState::clone() {
DipoleStatePtr copy = new_ptr(*this);
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); ++it )
(**it).theDipoleState = this;
Dipole::CloneSet toclone;
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); ++it ) {
toclone.insert(*it);
(**it).fillReferences(toclone);
}
Dipole::TranslationMap trans;
vector<Ariadne5::ClonePtr> clones;
for ( Dipole::CloneSet::iterator it = toclone.begin();
it != toclone.end(); ++it )
if ( *it ) clones.push_back(trans[*it] = (**it).clone());
for ( int i = 0, N = clones.size(); i < N; ++i ) {
clones[i]->rebind(trans);
if ( tDipolePtr d = dynamic_ptr_cast<tDipolePtr>(clones[i]) ) {
d->theDipoleState = copy;
}
}
copy->allDipoles.clear();
trans.translate(inserter(copy->allDipoles),
allDipoles.begin(), allDipoles.end());
copy->theInitialDipoles.clear();
trans.translate(inserter(copy->theInitialDipoles),
theInitialDipoles.begin(), theInitialDipoles.end());
for ( int i = 0, N = theSwingCandidates.size(); i < N; ++i ) {
copy->theSwingCandidates =
vector< vector<tDipolePtr> >(theSwingCandidates.size());
trans.translate(inserter(copy->theSwingCandidates[i]),
theSwingCandidates[i].begin(), theSwingCandidates[i].end());
}
for ( int i = 0, N = theTouchedSwingCandidates.size(); i < N; ++i ) {
copy->theTouchedSwingCandidates =
vector< vector<tDipolePtr> >(theTouchedSwingCandidates.size());
trans.translate(inserter(copy->theTouchedSwingCandidates[i]),
theTouchedSwingCandidates[i].begin(),
theTouchedSwingCandidates[i].end());
}
return copy;
}
void DipoleState::sortDipolesFS() {
theSwingCandidates.clear();
theTouchedSwingCandidates.clear();
theSwingCandidates.resize(Current<DipoleEventHandler>()->nColours());
theTouchedSwingCandidates.resize(Current<DipoleEventHandler>()->nColours());
list<DipolePtr> dips = getDipoles();
for ( list<DipolePtr>::const_iterator it = dips.begin(); it != dips.end(); it++ ) {
sortDipoleFS(**it);
}
}
void dummycollect(const Dipole & d, int & ndip, Energy & sump, Energy & summ,
TransverseMomentum & sumpt, set<tcDipolePtr> & dips) {
if ( d.children().first && d.children().second ) {
dummycollect(*d.children().first, ndip, sump, summ, sumpt, dips);
dummycollect(*d.children().second, ndip, sump, summ, sumpt, dips);
} else if ( d.children().first ) {
dummycollect(*d.children().first, ndip, sump, summ, sumpt, dips);
} else if ( d.children().second ) { //dead end??
// dummycollect(*d.children().second, ndip, sump, summ, sumpt, dips);
} else {
++ndip;
dips.insert(&d);
if ( d.partons().first->flavour() == ParticleID::g ) {
sumpt += d.partons().first->pT()/2.0;
sump += d.partons().first->plus()/2.0;
summ += d.partons().first->minus()/2.0;
} else {
sumpt += d.partons().first->pT();
sump += d.partons().first->plus();
summ += d.partons().first->minus();
}
if ( d.partons().second->flavour() == ParticleID::g ) {
sumpt += d.partons().second->pT()/2.0;
sump += d.partons().second->plus()/2.0;
summ += d.partons().second->minus()/2.0;
} else {
sumpt += d.partons().second->pT();
sump += d.partons().second->plus();
summ += d.partons().second->minus();
}
}
}
pair<double,int> DipoleState::lambdaMeasure(Energy2 scale,
FactoryBase::tH1DPtr histlength,
FactoryBase::tH1DPtr histmass) const {
pair<double,int> lam (0.0, 0);
for ( set<DipolePtr>::const_iterator it = allDipoles.begin();
it != allDipoles.end(); it++ ) {
Dipole & d = **it;
if ( !d.children().first && !d.children().second && d.participating() ) {
Energy2 m2 = (d.partons().first->momentum() +
d.partons().second->momentum()).m2();
if ( m2 > ZERO ) lam.first += log(m2/scale);
++lam.second;
if ( histmass && m2 >= ZERO ) histmass->fill(sqrt(m2/GeV2));
if ( histlength )
histlength->fill((d.partons().first->position() -
d.partons().second->position()).pt()*GeV);
}
}
return lam;
}
void DipoleState::sortFSDipoles() {
theSwingCandidates.clear();
theSwingCandidates.resize(Current<DipoleEventHandler>()->nColours());
for ( set<DipolePtr>::const_iterator it = allDipoles.begin();
it != allDipoles.end(); it++ ) {
Dipole & d = **it;
if ( !d.children().first && !d.children().second && d.participating() ) {
if ( ( d.neighbors().first &&
d.neighbors().first->colour() == d.colour() ) ||
( d.neighbors().second &&
d.neighbors().second->colour() == d.colour() ) )
generateColourIndex(&d);
forceAt(theSwingCandidates, (**it).colour()).push_back(*it);
}
}
if ( theSwingCandidates.size() != 0 ) return;
set<tcDipolePtr> dipset1;
TransverseMomentum sumpt;
Energy sump = ZERO;
Energy summ = ZERO;
int ndip = 0;
for ( int ic = 0, Nc = theSwingCandidates.size(); ic < Nc; ++ ic )
for ( int i = 0, N = theSwingCandidates[ic].size(); i < N; ++i ) {
const Dipole & d = *theSwingCandidates[ic][i];
dipset1.insert(&d);
++ndip;
if ( d.partons().first->flavour() == ParticleID::g ) {
sumpt += d.partons().first->pT()/2.0;
sump += d.partons().first->plus()/2.0;
summ += d.partons().first->minus()/2.0;
} else {
sumpt += d.partons().first->pT();
sump += d.partons().first->plus();
summ += d.partons().first->minus();
}
if ( d.partons().second->flavour() == ParticleID::g ) {
sumpt += d.partons().second->pT()/2.0;
sump += d.partons().second->plus()/2.0;
summ += d.partons().second->minus()/2.0;
} else {
sumpt += d.partons().second->pT();
sump += d.partons().second->plus();
summ += d.partons().second->minus();
}
}
cerr << "<DIPSY> total momentum in sortFSDipoles." << endl
<< " Plus: " << sump/GeV << endl
<< " Minus: " << summ/GeV << endl
<< " x: " << sumpt.x()/GeV << endl
<< " y: " << sumpt.y()/GeV << endl
<< " Ndip: " << ndip << " (" << dipset1.size() << ")" << endl;
sump = ZERO;
summ = ZERO;
sumpt = TransverseMomentum();
ndip = 0;
set<tcDipolePtr> dipset2;
for ( int i = 0, N = initialDipoles().size(); i < N; ++i )
dummycollect(*initialDipoles()[i], ndip, sump, summ, sumpt, dipset2);
cerr << "<DIPSY> total momentum in getFSSwinger." << endl
<< " Plus: " << sump/GeV << endl
<< " Minus: " << summ/GeV << endl
<< " x: " << sumpt.x()/GeV << endl
<< " y: " << sumpt.y()/GeV << endl
<< " Ndip: " << ndip << " (" << dipset2.size() << ")" << endl;
set<tcDipolePtr> diffset;
set_difference(dipset1.begin(), dipset1.end(), dipset2.begin(), dipset2.end(),
inserter(diffset));
cerr << " " << diffset.size()
<< " dipoles are in sortFSDipoles but not in getFSSwinger" << endl;
diffset.clear();
set_difference(dipset2.begin(), dipset2.end(), dipset1.begin(), dipset1.end(),
inserter(diffset));
cerr << " " << diffset.size()
<< " dipoles are in getFSSwinger but not in sortFSDipoles" << endl;
}
void DipoleState::sortDipoleFS(Dipole & d){
if(d.children().second && d.children().first) {
sortDipole(*(d.children().first));
sortDipole(*(d.children().second)); }
else if(d.children().first)
sortDipole(*(d.children().first));
else if ( d.children().second );
else if ( !(d.participating()) );
else forceAt(theSwingCandidates, d.colour()).push_back(&d);
}
void DipoleState::sortDipoles() {
theSwingCandidates.clear();
theSwingCandidates.resize(Current<DipoleEventHandler>()->nColours());
theTouchedSwingCandidates.clear();
theTouchedSwingCandidates.resize(Current<DipoleEventHandler>()->nColours());
for ( int i = 0, N = theInitialDipoles.size(); i < N; ++i ) {
sortDipole(*(theInitialDipoles[i]));
}
}
void DipoleState::sortDipole(Dipole & d){
if(d.children().second && d.children().first) {
sortDipole(*(d.children().first));
sortDipole(*(d.children().second)); }
else if(d.children().first)
sortDipole(*(d.children().first));
else if ( d.children().second );
else if ( d.interacted() );
else if ( !(d.participating()) );
else if ( !(d.isOn) );
else {
forceAt(theSwingCandidates, d.colour()).push_back(& d);
if ( !d.hasGen() )
forceAt(theTouchedSwingCandidates, d.colour()).push_back(& d);
}
}
void DipoleState::evolve(double ymin, double ymax) {
save();
for ( set<DipolePtr>::const_iterator it = allDipoles.begin(); it != allDipoles.end(); it++ ) {
(*it)->reset();
(*it)->touch();
}
while ( true ) {
sortDipoles();
tDipolePtr sel = tDipolePtr();
for ( int i = 0, N = initialDipoles().size(); i < N; ++i ) {
tDipolePtr si = initialDipoles()[i]->getEmitter(ymin, ymax);
if ( si && si->generatedY() < ymax && si->hasGen() &&
( !sel || si->generatedY() < sel->generatedY() ))
sel = si;
}
if ( sel ) {
ymin = sel->generatedY();
sel->emit();
save();
continue;
}
break;
}
theYmax = ymax;
}
void DipoleState::swingFS(double ymin, double ymax) {
if ( !handler().swingPtr() ) return;
const Swinger & swinger = handler().swinger();
for ( set<DipolePtr>::const_iterator it = allDipoles.begin();
it != allDipoles.end(); it++ ) {
(*it)->reset();
(*it)->touch();
}
sortFSDipoles();
double miny = ymin;
int lastcol = -1;
while ( true ) {
MinCmp<double, Dipole *> sel;
for ( int ic = 0, Nc = theSwingCandidates.size(); ic < Nc; ++ic ) {
const vector<tDipolePtr> & candidates = swingCandidates(ic);
if ( lastcol < 0 || lastcol == ic )
for ( int i = 0, N = candidates.size(); i < N; ++i ) {
Dipole & d = *candidates[i];
InvEnergy2 saver = d.swingCache;
if ( saver < ZERO )
saver = swinger.swingDistanceFS(*d.partons().first,
*d.partons().second, ymin/GeV2);
if ( d.swingDipole() && d.swingDipole()->touched() ) d.reset();
d.swingCache = saver;
}
for ( int i = 0, N = candidates.size(); i < N - 1; ++i ) {
Dipole & d1 = *candidates[i];
bool safe = d1.hasGen();
if ( lastcol < 0 || lastcol == ic )
for ( int j = i + 1; j < N; ++j ) {
Dipole & d2 = *candidates[j];
if ( safe && !d2.touched() ) continue;
InvEnergy2 c =
swinger.swingDistanceFS(*d1.partons().first,
*d2.partons().second, ymin/GeV2);
InvEnergy2 d =
swinger.swingDistanceFS(*d2.partons().first,
*d1.partons().second, ymin/GeV2);
double R = -log( UseRandom::rnd() );
double amp = swinger.swingAmpFS(d1.swingCache, d2.swingCache, c, d);
double yi = Constants::MaxRapidity;
if ( miny*amp + R < Constants::MaxRapidity*amp ) yi = miny + R/amp;
if ( yi < d1.generatedY() || !d1.hasGen() ) {
d1.swingDipole(&d2);
d1.generatedY(yi);
d1.recoilSwing(false);
}
}
sel(d1.generatedY(), &d1);
d1.untouch();
}
if ( candidates.size() ) candidates.back()->untouch();
}
if ( !sel.index() || sel > ymax ) break;
miny = sel;
lastcol = sel.index()->colour();
swinger.recombineFS(*sel.index());
static DebugItem tupleswing("DIPSY::SwingTuple", 6);
static ofstream swingtuple;
static bool isopen = false;
static long lastevent = 0;
if ( tupleswing ) {
if ( !isopen ) {
string filename = CurrentGenerator::current().filename() + "-swing.tuple";
swingtuple.open(filename.c_str());
isopen = true;
}
if ( lastevent != CurrentGenerator::current().currentEventNumber() ) {
lastevent = CurrentGenerator::current().currentEventNumber();
swingtuple << "# " << lastevent << endl;
}
double lrho = -log10(sqrt(miny));
pair<double,int> lam = lambdaMeasure(0.36*GeV2);
swingtuple << lrho << '\t' << lam.first/lam.second << '\t' << lam.first << endl;
}
}
theYmax = ymax;
}
void DipoleState::restoreNonparticipants() {
for ( int i = 0; i < int(theInitialDipoles.size()); i++ ) {
tPartonPtr p1 = theInitialDipoles[i]->partons().first;
tPartonPtr p2 = theInitialDipoles[i]->partons().second;
tPartonPtr p3;
if ( i != int(theInitialDipoles.size())-1 &&
theInitialDipoles[i+1]->partons().first == p2 )
p3 = theInitialDipoles[i+1]->partons().second;
else if ( i != int(theInitialDipoles.size())-1 &&
theInitialDipoles[i+1]->partons().second == p1 )
p3 = theInitialDipoles[i+1]->partons().first;
else if ( i != 0 && theInitialDipoles[i-1]->partons().first == p2 )
p3 = theInitialDipoles[i-1]->partons().second;
else if ( i != 0 && theInitialDipoles[i-1]->partons().second == p1 )
p3 = theInitialDipoles[i-1]->partons().first;
if ( !(p1->interacted()) &&
!(p2->interacted()) &&
!( p3 && p3->interacted() ) ) {
theInitialDipoles[i]->participating(false);
restoreDipole(p1, p2);
}
else
theInitialDipoles[i]->participating(true);
}
}
bool DipoleState::restoreDipole(PartonPtr p1, PartonPtr p2) {
//there must be dipoles to reconnect.
if ( !p1->dipoles().second || !p2->dipoles().first ) return false;
//if already connect, do nothing
if ( p1->dipoles().second == p2->dipoles().first ) return true;
//if p1 and p2 are connected to different partons, just swing.
if ( p1->dipoles().second->partons().second != p2->dipoles().first->partons().first ) {
p1->dipoles().second->swingDipole(p2->dipoles().first);
p1->dipoles().second->recombine();
return true;
}
//if p1 and p2 are separated by only one parton, then first swing away one of
//the dipoles, then repeat.
else {
sortDipoles();
//if no swing can be found, then leave it.
if ( !forceSwing(p1->dipoles().second->partons().second, 0.0, 0.0) ) return false;
//otherwise go ahead and reconnect the dipoles.
p1->dipoles().second->swingDipole(p2->dipoles().first);
p1->dipoles().second->recombine();
return true;
}
}
void DipoleState::normaliseValenceCharge(int mode) {
if ( mode == 0 ) return;
if ( double(int(theInitialDipoles.size())/3) != double(theInitialDipoles.size())/3.0 ) {
return;
}
if ( mode == 1 ) {
set<pair<tPartonPtr, tPartonPtr> > valencePartons;
for ( int i = 0; i < int(theInitialDipoles.size()); i++) {
tPartonPtr p1 = theInitialDipoles[i]->partons().first;
tPartonPtr p2 = theInitialDipoles[i]->partons().second;
//if there are no dipoles to swing, do nothing
if ( !p1->dipoles().second || !p2->dipoles().first )
continue;
//if already connected, do nothing.
if ( p1->dipoles().second->partons().second == p2 )
continue;
//if connected to the same parton, do nothing.
if ( p1->dipoles().second->partons().second == p2->dipoles().first->partons().first )
continue;
//otherwise swing with 50% prob
if ( UseRandom::rnd() > 0.5 ) {
p1->dipoles().second->swingDipole(p2->dipoles().first);
p1->dipoles().second->recombine();
}
}
}
}
void DipoleState::generateColourIndex(tDipolePtr d) {
int isys = -1;
if ( d->neighbors().first )
isys = d->neighbors().first->colourSystem();
if ( d->neighbors().second ) {
int isys2 = d->neighbors().second->colourSystem();
if ( isys >= 0 && isys2 != isys )
cerr << "Dipole bewteen different colour systems!" << endl;
isys = isys2;
}
do {
d->colour(UseRandom::irnd(handler().nColours()), isys);
} while ( ( d->neighbors().first &&
d->colour() == d->neighbors().first->colour() ) ||
( d->neighbors().second &&
d->colour() == d->neighbors().second->colour() ) );
}
const list<PartonPtr> DipoleState::virtualPartons() const {
list<PartonPtr> partons;
for ( set<DipolePtr>::const_iterator it = allDipoles.begin() ; it != allDipoles.end(); it++ ) {
if ( (*it)->children().first || (*it)->children().second ) continue;
if ( !((*it)->neighbors().first) && !((*it)->partons().first->interacted()) )
if ( !((*it)->partons().first->valence()) )
partons.push_back((*it)->partons().first);
if ( !((*it)->partons().second->interacted()) && !((*it)->partons().second->valence()) )
partons.push_back((*it)->partons().second);
}
return partons;
}
const set< list<PartonPtr> > DipoleState::loops() const {
list<PartonPtr> partonsList = getPartons();
set<PartonPtr> partons;
set< list<PartonPtr> > ret;
for( list<PartonPtr>::const_iterator it = partonsList.begin();
it != partonsList.end(); it++ ) {
partons.insert(*it);
}
//go through all partons and add them to colour chains.
while ( !partons.empty() ) {
list<PartonPtr> loop;
PartonPtr head = *partons.begin();
bool forward = true;
PartonPtr p = head;
//follow the colour flow first in forward direction from head until it comes back to the start
//if a quark is hit, then continue in other direction.
do {
//add at end/start of list depending of if we are moving forward or beckwards in colour
if ( forward ) {
loop.push_back(p);
}
else {
loop.push_front(p);
}
//remove from partons, so we know its added.
//could potentially be better to do this without destroy the dipoleState...
if ( !partons.erase(p) ) {
Throw<DipoleConnectionException>()
<< "DIPSY found inconsistent DipoleState when extracting "
"colour singlets!" << Exception::eventerror;
}
//move forward in colour if there are more partons, otherwise turn around
if ( forward ) {
if ( p->dipoles().second ) {
p = p->dipoles().second->partons().second;
if ( Debug::level > 5 ) cout << " continue forward to " << p->y() << endl;
}
else {
if ( head->dipoles().first ) {
//continue at other side, going in other direction
p = head->dipoles().first->partons().first;
}
else {
//want to turn around, but "head" is at the other end, so we are done.
p = head;
}
forward = false;
}
}
else {
if ( p->dipoles().first ) {
p = p->dipoles().first->partons().first;
}
else {
break;
}
}
} while ( p!= head );
ret.insert(loop);
}
return ret;
}
const double DipoleState::highestY() const {
MaxCmp<double> ret;
list< PartonPtr > partons = getPartons();
for ( list<PartonPtr>::const_iterator it = partons.begin();
it != partons.end(); it++ ) {
ret((*it)->y());
ret((*it)->y());
}
return ret;
}
const double DipoleState::lowestY() const {
MinCmp<double> ret;
list< PartonPtr > partons = getPartons();
for ( list<PartonPtr>::const_iterator it = partons.begin();
it != partons.end(); it++ ) {
ret((*it)->y());
ret((*it)->y());
}
return ret;
}
const double DipoleState::ymax() const {
return theYmax;
}
const Energy DipoleState::collidingEnergy() const {
return theCollidingEnergy;
}
void DipoleState::collidingEnergy(Energy E) {
theCollidingEnergy = E;
}
bool DipoleState::diagnosis(bool print) const {
bool ok = true;
int activeDipoles = 0;
int partons = 0;
int interactingDips = 0;
Energy plus = 0.0*GeV;
Energy minus = 0.0*GeV;
Energy plusNeeded = 0.0*GeV;
Energy minusNeeded = 0.0*GeV;
Energy plusMissing = 0.0*GeV;
Energy minusMissing = 0.0*GeV;
bool hasQuark = false;
TransverseMomentum totalpT;
Energy maxpT = 0.0*GeV;
InvEnergy dipSize = ZERO;
for(set< DipolePtr >::iterator it = allDipoles.begin();
it != allDipoles.end(); it++) {
if( ((*it)->children().first || (*it)->children().second) )
continue;
activeDipoles++;
dipSize += (*it)->size();
if ( (*it)->DGLAPsafe() ) {
if ( (*it)->neighbors().first &&
(*it)->neighbors().first->size() > (*it)->size() &&
!((*it)->neighbors().first->DGLAPsafe()) )
Throw<DipoleDGLAPSafeException>()
<< "DIPSY found broken DGLAPchain!" << Exception::eventerror;
if ( (*it)->neighbors().second &&
(*it)->neighbors().second->size() > (*it)->size() &&
!((*it)->neighbors().second->DGLAPsafe()) )
Throw<DipoleDGLAPSafeException>()
<< "DIPSY found broken DGLAPchain!" << Exception::eventerror;
}
if ( (*it)->interacted() ) interactingDips++;
if ( ((*it)->neighbors().first &&
(*it)->neighbors().first->children().first) ||
((*it)->neighbors().first &&
(*it)->neighbors().first->children().second) )
Throw<DipoleConnectionException>()
<< "DIPSY found dipole where negiboring dipole has decayed!"
<< Exception::eventerror;
if( (*it)->partons().first->dipoles().second != (*it) )
Throw<DipoleConnectionException>()
<< "DIPSY found dipole where first parton "
<< "doesn't point back at the dipole!" << Exception::eventerror;
if( (*it)->partons().second->dipoles().first != (*it) )
Throw<DipoleConnectionException>()
<< "DIPSY found dipole where second parton "
<< "doesn't point back at the dipole!" << Exception::eventerror;
if ( (*it)->neighbors().first &&
(*it)->neighbors().first->neighbors().second != (*it) )
Throw<DipoleConnectionException>()
<< "DIPSY found dipole where neighbouring dipole "
<< "doesn't point back at the dipole!" << Exception::eventerror;
if ( (*it)->neighbors().second &&
(*it)->neighbors().second->neighbors().first != (*it) )
Throw<DipoleConnectionException>()
<< "DIPSY found dipole where neighbouring dipole "
<< "doesn't point back at the dipole!" << Exception::eventerror;
if ( (*it)->partons().first == (*it)->partons().second )
Throw<DipoleConnectionException>()
<< "DIPSY found dipole looping back to itself!" << Exception::eventerror;
PartonPtr p = (*it)->partons().first;
partons++;
if ( p->dipoles().first && p->dipoles().first->partons().second != p )
Throw<DipoleConnectionException>()
<< "DIPSY found parton where first dipole "
<< "doesn't point back at the parton!" << Exception::eventerror;
if ( p->dipoles().second && p->dipoles().second->partons().first != p )
Throw<DipoleConnectionException>()
<< "DIPSY found parton where second dipole "
<< "doesn't point back at the parton!" << Exception::eventerror;
if ( p->dipoles().first && p->dipoles().second &&
p->dipoles().first == p->dipoles().second )
Throw<DipoleConnectionException>()
<< "DIPSY found parton colour connected to itself!"
<< Exception::eventerror;
if ( p->dipoles().first && (p->dipoles().first->children().first ||
p->dipoles().first->children().second) )
Throw<DipoleConnectionException>()
<< "DIPSY found parton where first dipole has decayed!"
<< Exception::eventerror;
if ( p->dipoles().second && (p->dipoles().second->children().first ||
p->dipoles().second->children().second) )
Throw<DipoleConnectionException>()
<< "DIPSY found parton where second dipole has decayed!"
<< Exception::eventerror;
if ( p->y() < -100.0 || p->y() > 100.0 )
Throw<DipoleKinematicsException>()
<< "DIPSY found parton impossible rapidity!" << Exception::eventerror;
if ( p->plus() < ZERO )
Throw<DipoleKinematicsException>()
<< "DIPSY found parton at oY " << p->oY() << " has negative plus "
<< p->plus()/GeV << "!" << Exception::eventerror;
if ( p->minus() < ZERO )
Throw<DipoleKinematicsException>()
<< "DIPSY found parton at oY " << p->oY() << " has negative minus "
<< p->minus()/GeV << "!" << Exception::eventerror;
totalpT += p->pT();
if ( p->pT().pt() > maxpT ) {
maxpT = p->pT().pt();
if ( maxpT > 1000.0*GeV )
Throw<DipoleKinematicsException>()
<< "DIPSY found parton with very large transverse momentum: "
<< maxpT/GeV << " (p+ = " << p->plus()/GeV << ", p- = "
<< p->minus()/GeV << ", y = " << p->y() << ")" << Exception::warning;
}
if( abs((p->plus()*p->minus() - sqr(p->pT().pt()))/sqr(GeV)) >
0.001*sqr(p->pT().pt())/sqr(GeV) ) {
Throw<DipoleKinematicsException>()
<< "DIPSY found off-shell parton with invariant mass square "
<< (p->plus()*p->minus() - sqr(p->pT().pt()))/sqr(GeV)
<< "!" << Exception::eventerror;
ok = false;
}
if( p->rightMoving() ) {
plus += p->plus();
minusMissing += p->minus();
minusNeeded += p->pT().pt()*exp( p->y() );
}
else {
minus += p->minus();
plusMissing += p->plus();
plusNeeded += p->pT().pt()*exp( -p->y() );
}
if( !((*it)->neighbors().second) ) {
hasQuark = true;
p = (*it)->partons().second;
partons++;
totalpT += p->pT();
if( p->rightMoving() ) {
plus += p->plus();
minusMissing += p->minus();
minusNeeded += p->pT().pt()*exp( p->y() );
}
else {
minus += p->minus();
plusMissing += p->plus();
plusNeeded += p->pT().pt()*exp( -p->y() );
}
}
}
if( totalpT.pt() > 0.00000001*GeV ) {
Throw<DipoleKinematicsException>()
<< "DIPSY found transverse momentum imbalance: " << totalpT.pt()/GeV
<< Exception::warning;
ok = false;
}
Energy acceptableError = 0.1*GeV;
if ( handler().eventFiller().mode() == 1 )
acceptableError = 0.000001*GeV;
if ( abs(plus - thePlus) > 2.0*acceptableError &&
abs(plus + minus + minusMissing + plusMissing - thePlus - theMinus) >
2.0*acceptableError ) {
Throw<DipoleKinematicsException>()
<< "DIPSY found energy non-conservation: "
<< (plus + minus + minusMissing + plusMissing
- thePlus - theMinus)/GeV/2.0 << " GeV" << Exception::warning;
ok = false;
}
if ( isnan(plus/GeV) || isnan(minus/GeV) )
Throw<DipoleKinematicsException>()
<< "DIPSY found parton with nan kinematics!" << Exception::runerror;
if ( print ) {
cout << "------------------ state " << this << " ------------------------------\n";
if (!ok )
cout << "| NOT OK!!!" << endl;
cout << setprecision(10);
cout <<
"| original plus = " << thePlus/GeV << endl <<
"| originl minus = " << theMinus/GeV << endl <<
"| plus = " << plus/GeV << endl <<
"| minus = " << minus/GeV << endl <<
"| missing minus = " << minusMissing/GeV << endl <<
"| needed minus = " << minusNeeded/GeV << endl <<
"| missing plus = " << plusMissing/GeV << endl <<
"| needed plus = " << plusNeeded/GeV << endl <<
"| total plus = " << (plus + plusNeeded - plusMissing)/GeV << endl <<
"| total minus = " << (minus + minusNeeded - minusMissing)/GeV << endl <<
"| total pT = " << "( "<<totalpT.x()/GeV<<", "<<totalpT.y()/GeV<<" )" << endl <<
"| originl enrgy = " << (thePlus + theMinus)/GeV/2.0 << endl <<
"| total energy = " << (plus + minus + minusMissing + plusMissing)/GeV/2.0 << endl <<
"| missing enrgy = " << (plus+minus+minusMissing+plusMissing-thePlus-theMinus)/GeV/2.0 << endl <<
"| allDipoles has " << allDipoles.size() << " dipoles." << endl <<
"| number of active dipoles: " << activeDipoles << endl <<
"| number of partons " << partons << endl <<
"| hasQuark: " << hasQuark << endl <<
"| number of interacting dipoles: " << interactingDips << endl <<
"| max pT : " << maxpT/GeV << endl <<
"| average dipole size: " << GeV*dipSize/double(activeDipoles) << endl;
cout << "----------------------------------------------------------------------\n";
if (ok ) cout << "| Found no errors! :)\n";
else cout << "| STATE NOT OK!! :o\n";
cout << "----------------------------------------------------------------------\n";
}
return ok;
}
bool DipoleState::forceSwing(PartonPtr p, double ymax1, double ymax2) {
DipolePtr d1 = p->dipoles().first;
DipolePtr d2 = p->dipoles().second;
if ( !d1 || !d2 )
cout << "forcing a swing for a parton that doesnt have 2 dipoles!" << endl;
//check for swings of same colour up to ymax1
d1->reset();
d1->touch();
bool foundFirstDipole = d1->forceGenerateRec(ymax1);
d2->reset();
d2->touch();
bool foundSecondDipole = d2->forceGenerateRec(ymax1);
if( foundFirstDipole || foundSecondDipole ) {
if ( !foundFirstDipole )
d2->recombine();
else if ( !foundSecondDipole )
d1->recombine();
else {
if ( d1->generatedY() < d2->generatedY() )
d1->recombine();
else
d2->recombine();
}
return true;
}
//check for swings of other colours up to ymax2
int trueColour = d1->colour();
int trueSys = d1->colourSystem();
for ( int c=0;c < Current<DipoleEventHandler>()->nColours();c++ ) {
d1->colour(c, trueSys);
d1->forceGenerateRec(ymax2);
}
d1->colour(trueColour);
foundFirstDipole = d1->swingDipole();
trueColour = d2->colour();
trueSys = d2->colourSystem();
for ( int c=0;c < Current<DipoleEventHandler>()->nColours();c++ ) {
d2->colour(c, trueSys);
d2->forceGenerateRec(ymax2);
}
d2->colour(trueColour);
foundSecondDipole = d2->swingDipole();
if( foundFirstDipole || foundSecondDipole ) {
if ( !foundFirstDipole )
d2->recombine();
else if ( !foundSecondDipole )
d1->recombine();
else {
if ( d1->generatedY() < d2->generatedY() )
d1->recombine();
else
d2->recombine();
return true;
}
}
return false;
}
DipoleStatePtr DipoleState::merge(DipoleStatePtr otherState) {
//reasign all other dipoles to belong to this state.
for( set< DipolePtr >::iterator it = otherState->allDipoles.begin();
it != otherState->allDipoles.end(); it++ ) {
(*it)->dipoleState(this);
}
//fill up initialDipoles and allDipoles with the other state.
theInitialDipoles.insert(theInitialDipoles.begin(),
otherState->initialDipoles().begin(),
otherState->initialDipoles().end());
theIncoming.insert(otherState->incoming().begin(), otherState->incoming().end());
allDipoles.insert(otherState->allDipoles.begin(),otherState->allDipoles.end());
theProducedParticles.insert(otherState->theProducedParticles.begin(),
otherState->theProducedParticles.end());
//add up the original particles momenta
thePlus += otherState->thePlus;
theMinus += otherState->theMinus;
return this;
}
DipoleStatePtr DipoleState::collide( DipoleStatePtr otherState,
const vector<FList::const_iterator> & sel,
const ImpactParameters & b ) {
//mirror the other state in y
otherState->mirror(0.0);
//move the other state according to the impact parameter
otherState->translate(b);
//reasign all other dipoles to belong to this state.
for( set< DipolePtr >::iterator it = otherState->allDipoles.begin();
it != otherState->allDipoles.end(); it++ ) {
(*it)->dipoleState(this);
}
//fill up initialDipoles and allDipoles with the other state.
theInitialDipoles.insert(theInitialDipoles.begin(),
otherState->initialDipoles().begin(),
otherState->initialDipoles().end());
allDipoles.insert(otherState->allDipoles.begin(),otherState->allDipoles.end());
//decide if each collision in sel is elastic or not, and recouple the non-elastic ones
for( vector< FList::const_iterator>::const_iterator it = sel.begin();
it != sel.end(); it++ ) {
if( (*it)->first.second < 2.0*UseRandom::rnd() ) {
(*it)->second.first->swingDipole( (*it)->second.second );
(*it)->second.first->recombine();
}
}
return this;
}
void DipoleState::mirror(double y0) {
for ( set< DipolePtr >::iterator it = allDipoles.begin();
it != allDipoles.end(); it++) {
if ( !((*it)->children().first || (*it)->children().second) ) {
- PartonPtr p = (*it)->partons().first;
- p->y( 2.0*y0 - p->y() );
- Energy plus = p->plus();
- p->plus( p->minus() );
- p->minus( plus );
- p->rightMoving( !(p->rightMoving()) );
- if ( !((*it)->neighbors().second) ) {
- PartonPtr p2 = (*it)->partons().second;
- p2->y( 2.0*y0 - p2->y() );
- p2->plus( p2->pT().pt()*exp(-p2->y()) );
- p2->minus( p2->pT().pt()*exp(p2->y()) );
- p->rightMoving( !(p->rightMoving()) );
- }
+ (*it)->partons().first->mirror(y0);
+ if ( !((*it)->neighbors().second) ) (*it)->partons().second->mirror(y0);
}
}
- Energy x = thePlus;
- thePlus = theMinus;
- theMinus = x;
+
+ swap(thePlus, theMinus);
for ( map<PPtr, vector<PartonPtr> >::iterator it = theIncoming.begin();
it != theIncoming.end(); ++it )
it->first->setMomentum(lightCone(it->first->momentum().minus(),
it->first->momentum().plus()));
}
void DipoleState::translate(const ImpactParameters & b) {
for(set< DipolePtr >::iterator it = allDipoles.begin();
it != allDipoles.end(); it++) {
if( !((*it)->children().first || (*it)->children().second) ) {
- (*it)->partons().first->position( Parton::Point
- ((*it)->partons().first->position().x()*cos(b.phi()) +
- (*it)->partons().first->position().y()*sin(b.phi()) + b.bVec().x() ,
- (*it)->partons().first->position().y()*cos(b.phi()) -
- (*it)->partons().first->position().x()*sin(b.phi()) + b.bVec().y() ) );
- (*it)->partons().first->pT( b.rotatePT((*it)->partons().first->pT()));
- if( !((*it)->neighbors().second) ) {
- (*it)->partons().second->position( Parton::Point
- ((*it)->partons().second->position().x()*cos(b.phi()) +
- (*it)->partons().second->position().y()*sin(b.phi()) + b.bVec().x() ,
- (*it)->partons().second->position().y()*cos(b.phi()) -
- (*it)->partons().second->position().x()*sin(b.phi()) + b.bVec().y() ) );
- (*it)->partons().second->pT( b.rotatePT((*it)->partons().second->pT()));
- }
+ b.translate((*it)->partons().first);
+ if( !((*it)->neighbors().second) )
+ b.translate((*it)->partons().second);
}
}
}
void DipoleState::fixValence(Step & step) const {
for ( map<PPtr, vector<PartonPtr> >::const_iterator it = theIncoming.begin();
it != theIncoming.end(); ++it ) {
tcWFInfoPtr wfi = WFInfo::getWFInfo(*it->first);
if ( !wfi ) continue;
PVector valence;
for ( int i = 0, N = it->second.size(); i < N; ++i ) {
valence.push_back(getParticle(it->second[i], true));
if ( !valence.back() ) valence.pop_back();
}
wfi->wf().fixValence(step, it->first, valence);
}
LorentzRotation Rshift = Utilities::boostToCM(step.collision()->incoming());
Utilities::transform(step.particles(), Rshift);
}
LorentzMomentum DipoleState::changeMass(LorentzMomentum p, Energy m, LorentzMomentum ref,
LorentzRotation * Rshift) {
Energy2 s = (p + ref).m2();
LorentzRotation R(0.0, 0.0, -(p.z() + ref.z())/(p.e() + ref.e()));
Energy z = Math::sign(SimplePhaseSpace::getMagnitude(s, ref.mt(), sqrt(sqr(m) + p.perp2())), (R*p).z());
LorentzMomentum pnew(p.x(), p.y(), z, sqrt(sqr(m) + sqr(z) + p.perp2()));
LorentzMomentum refnew(ref.x(), ref.y(), -z, sqrt(sqr(z) + ref.mt2()));
s = (pnew + refnew).m2();
LorentzRotation shift = LorentzRotation(0.0, 0.0, ref.z()/ref.e())*
LorentzRotation(0.0, 0.0, -refnew.z()/refnew.e());
pnew *= shift;
refnew *= shift;
if ( Rshift ) *Rshift = R.boostZ((pnew.z() + ref.z())/(pnew.e() + ref.e()));
return pnew;
}
vector<pair<Parton::Point, InvEnergy> > DipoleState::points() {
list< PartonPtr > partons = getPartons();
vector<pair<Parton::Point, InvEnergy> > ret;
for ( list<PartonPtr>::iterator it = partons.begin(); it != partons.end(); it++) {
InvEnergy r = max((*it)->dipoles().first->size(), (*it)->dipoles().first->size());
ret.push_back(make_pair((*it)->position(), r));
}
return ret;
}
list< PartonPtr > DipoleState::getPartons() const {
list<PartonPtr> partons;
for ( set<DipolePtr>::const_iterator it = allDipoles.begin() ; it != allDipoles.end(); it++ ) {
if ( (*it)->children().first || (*it)->children().second ) continue;
partons.push_back((*it)->partons().first);
if ( !((*it)->neighbors().second) ) //end of chain --> add also right parton
partons.push_back((*it)->partons().second);
}
return partons;
}
list< DipolePtr > DipoleState::getDipoles() const {
list<DipolePtr> dipoles;
for ( set<DipolePtr>::const_iterator it = allDipoles.begin() ; it != allDipoles.end(); it++ ) {
if ( (*it)->children().first || (*it)->children().second ) continue;
dipoles.push_back(*it);
}
return dipoles;
}
void DipoleState::makeOriginal() {
//clear the original dipoles
theInitialDipoles.clear(); //owns the dipoles
theSwingCandidates.clear(); //trancient
theTouchedSwingCandidates.clear(); //trancient
//go through allDipoles and set them to on or off.
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); it++ ) {
DipolePtr d = *it;
if ( d->children().first || d->children().second ) d->isOn = false;
else d->isOn = true;
}
//go through allDipoles again
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); it++ ) {
DipolePtr d = *it;
//remove neighbors that are off, both from dipole and parton
if ( d->isOn ) {
if ( d->neighbors().first && !d->neighbors().first->isOn ) {
d->neighbors(make_pair(DipolePtr(), d->neighbors().second));
d->partons().first->dipoles(make_pair(DipolePtr(), d->partons().first->dipoles().second) );
}
if ( d->neighbors().second && !d->neighbors().second->isOn ) {
d->neighbors(make_pair(d->neighbors().first, DipolePtr()));
d->partons().second->dipoles(make_pair(d->partons().second->dipoles().first, DipolePtr()) );
}
}
}
//go through allDipoles again
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); ) {
DipolePtr d = *it;
//remove all pointers to off dipoles (not needed, as transient pointers)
//insert in original dipoles if the dipole is on.
if ( d->isOn ) {
theInitialDipoles.push_back(d);
d->partons().first->parents() = make_pair(PartonPtr(), PartonPtr());
d->partons().second->parents() = make_pair(PartonPtr(), PartonPtr());
d->partons().first->removeAllChildren();
d->partons().second->removeAllChildren();
d->reset();
it++;
}
//remove the dipole from allDipoles if it is off.
if ( !d->isOn ) {
set<DipolePtr>::iterator jt = it;
it++;
allDipoles.erase(jt);
}
}
//set parton data as if they were valence partons
list<PartonPtr> partons = getPartons();
int i = 0;
for( list<PartonPtr>::iterator it = partons.begin();
it != partons.end(); it++ ) {
PartonPtr p = *it;
p->number(i);
p->ordered(true);
p->valencePlus(p->plus());
p->valencePT(p->pT());
p->oY(p->y());
p->parents(make_pair(PartonPtr(), PartonPtr()));
i++;
}
}
vector<DipoleState::String> DipoleState::strings() {
set< list<PartonPtr> > colourLoops = loops();
vector<DipoleState::String> ret;
for ( set< list<PartonPtr> >::const_iterator loop = colourLoops.begin();
loop != colourLoops.end(); loop++ ) {
DipoleState::String s;
for ( list<PartonPtr>::const_iterator p = (*loop).begin(); p != (*loop).end(); p++ ) {
s.push_back( *p );
}
if ( Debug::level > 5 ) cout << "new string of size " << s.size() << endl;
ret.push_back( s );
}
return ret;
}
//Assume incoming particles massless for now. Valid as long higest pT
//is much larger than the mass.
void DipoleState::balanceMomenta() {
//Sum up how much p-/p+ is needed on the left/right side.
//Assumes that no particles got pushed over to the other side during reabsorbtion.
Energy PlmMissing = 0.0*GeV;
Energy PlmNeeded = 0.0*GeV;
Energy PrpMissing = 0.0*GeV;
Energy PrpNeeded = 0.0*GeV;
Energy Plp = 0.0*GeV;
Energy Prm = 0.0*GeV;
PartonPtr p;
for(set< DipolePtr >::iterator it = allDipoles.begin();
it != allDipoles.end(); it++) {
if( ((*it)->children().first || (*it)->children().second) )
continue;
//Do first parton always
p = (*it)->partons().first;
if( p->rightMoving() ) {
PlmMissing += p->minus();
PlmNeeded += p->pT().pt()*exp( p->y() );
Plp += p->plus();
}
else {
Prm += p->minus();
PrpMissing += p->plus();
PrpNeeded += p->pT().pt()*exp( -p->y() );
}
if( !((*it)->neighbors().second) ) {
//do second parton as well if at the end of a chain
p = (*it)->partons().second;
if( p->rightMoving() ) {
PlmMissing += p->minus();
PlmNeeded += p->pT().pt()*exp( p->y() );
Plp += p->plus();
}
else {
Prm += p->minus();
PrpMissing += p->plus();
PrpNeeded += p->pT().pt()*exp( -p->y() );
}
}
}
Energy PpShuffled = PrpNeeded - PrpMissing;
Energy PmShuffled = PlmNeeded - PlmMissing;
double a = -(1 + PmShuffled/Prm);
double b = -PlmNeeded/Prm;
double c = -(1 + PpShuffled/Plp);
double d = -PrpNeeded/Plp;
double e = (b - d)/c + a;
//how much p+/p- has to be scaled down on left/right side.
double q2 = - e/2 + sqrt( sqr(e)/4 + d*a/c );
double q1 = (d - c*q2)/q2;
if( max(abs(log(q1)),abs(log(q2))) > 0.1 ) {
cout << "yl shifted " << log(q2) << endl <<
"yr shifted " << log(q1) << endl;
}
if ( PlmMissing > Prm ) {
cout << "not enough p- in right state! VETO!" << endl;
}
else if ( PrpMissing > Plp ) {
cout << "not enough p+ in left state! VETO!" << endl;
}
//now shift all the partons in rapidity with ln q1 or ln q2 on left/right side.
for(set< DipolePtr >::iterator it = allDipoles.begin();
it != allDipoles.end(); it++) {
if( ((*it)->children().first || (*it)->children().second) )
continue;
//Do first parton always
p = (*it)->partons().first;
if( p->rightMoving() ) {
p->plus( p->plus()*q1 );
p->y( log(p->pT().pt()/p->plus() ) );
p->minus( p->pT().pt()*exp( p->y() ) );
}
else {
p->minus( p->minus()*q2 );
p->y( log( p->minus()/p->pT().pt() ) );
p->plus( p->pT().pt()*exp( -p->y() ) );
}
if( !((*it)->neighbors().second) ) {
//do second parton as well if at the end of a chain
p = (*it)->partons().second;
if( p->rightMoving() ) {
p->plus( p->plus()*q1 );
p->y( log(p->pT().pt()/p->plus() ) );
p->minus( p->pT().pt()*exp( p->y() ) );
}
else {
p->minus( p->minus()*q2 );
p->y( log( p->minus()/p->pT().pt() ) );
p->plus( p->pT().pt()*exp( -p->y() ) );
}
}
}
}
void DipoleState::saveGluonsToFile(double weight) const {
EventPtr event = handler().currentEvent();
string filename = handler().generator()->filename();
//set up outfile
ostringstream os;
PPair incoming = event->incoming();
LorentzPoint p1 = incoming.first->vertex();
LorentzPoint p2 = incoming.second->vertex();
double bx = (p1-p2).x()/femtometer;
double by = (p1-p2).y()/femtometer;
//TODO: interface!
os << "/home/christoffer/DIPSYevents/" << filename << "/event" << event->number() << ".dat";
// os << "/scratch/parton/christof/DIPSY/events/" << filename << "/event" << weight << ".dat";
weight = 2.0*int(sqrt(sqr(bx)+sqr(by))) + 1.0;
ofstream outfile (os.str().c_str());
//general information
outfile << "Generated with DIPSY 1.1" << endl;
outfile << "These are the real gluons only. No FSR or hadronisation has been done." << endl;
//print weight and impact parameter.
outfile << endl << "eventweight: " << weight << endl << endl;
outfile << "impact_parameter(fm):" << " " << bx << " " << by << endl;
vector<PartonPtr> partonVector;
int n = 0;
for(set< DipolePtr >::iterator it = allDipoles.begin();
it != allDipoles.end(); it++) {
if( ((*it)->children().first || (*it)->children().second) )
continue;
PartonPtr p = (*it)->partons().first;
if ( p->y() < -3 || p->y() > 3 ) continue;
partonVector.push_back(p);
p->number(n);
n++;
}
outfile << "number_of_particles:" << " " << partonVector.size() << endl;
outfile << "number of spectating nucleons: " << numberOfSpectators() << endl << endl;
//print gluons
outfile << "particle_number" << " "
<< "transverse_position_x(fm)" << " "
<< "transverse_position_y(fm)" << " "
<< "transverse_momentum_x(GeV)" << " "
<< "transverse_momentum_y(GeV)" << " "
<< "rapidity" << " "
<< "colour_neighbour_number" << " "
<< "anticolour_neighbour_number" << endl << endl;
for(int i = 0; i < int(partonVector.size()); i++) {
PartonPtr p = partonVector[i];
outfile << p->number() << " "
<< p->position().x()*hbarc/femtometer << " "
<< p->position().y()*hbarc/femtometer << " "
<< p->pT().x()/GeV << " "
<< p->pT().y()/GeV << " "
<< p->y() << " ";
if ( p->dipoles().first )
outfile << p->dipoles().first->partons().first->number() << " ";
else outfile << -1 << " ";
if ( p->dipoles().second )
outfile << p->dipoles().second->partons().second->number() << " ";
else outfile << -1 << " ";
outfile << endl;
}
outfile.close();
cout << "printed gluons to file " << os.str().c_str() << endl;
}
int DipoleState::numberOfSpectators() const {
int nSpectators = 0;
for ( int i = 0; i < int(theInitialDipoles.size()); i++ ) {
tPartonPtr p1 = theInitialDipoles[i]->partons().first;
tPartonPtr p2 = theInitialDipoles[i]->partons().second;
tPartonPtr p3;
if ( i != int(theInitialDipoles.size())-1 &&
theInitialDipoles[i+1]->partons().first == p2 )
p3 = theInitialDipoles[i+1]->partons().second;
else if ( i != int(theInitialDipoles.size())-1 &&
theInitialDipoles[i+1]->partons().second == p1 )
p3 = theInitialDipoles[i+1]->partons().first;
else if ( i != 0 && theInitialDipoles[i-1]->partons().first == p2 )
p3 = theInitialDipoles[i-1]->partons().second;
else if ( i != 0 && theInitialDipoles[i-1]->partons().second == p1 )
p3 = theInitialDipoles[i-1]->partons().first;
if ( !(p1->interacted()) &&
!(p2->interacted()) &&
!( p3 && p3->interacted() ) ) {
nSpectators++;
}
}
return nSpectators/3;
}
void DipoleState::unifyColourSystems(int sys) {
for ( set<DipolePtr>::iterator it = allDipoles.begin();
it != allDipoles.end(); ++it ) (**it).colourSystem(sys);
}
tPPtr DipoleState::getParticle(tcPartonPtr parton, bool nocreate) const {
map<tcPartonPtr,PPtr>::iterator pit = theProducedParticles.find(parton);
if ( pit != theProducedParticles.end() ) return pit->second;
if ( nocreate ) return tPPtr();
if( parton->plus() <= 0.0*GeV ) cout << "p+ is not positive :(" << endl <<
"p+ = " << parton->plus()/GeV << endl <<
"p- = " << parton->minus()/GeV << endl <<
"pt = " << parton->pT().pt()/GeV << endl <<
"y = " << parton->y() << endl;
PPtr p = CurrentGenerator::current().getParticle(parton->flavour());
p->setMomentum(parton->momentum());
p->setVertex(LorentzPoint(parton->position().x()*hbarc, parton->position().y()*hbarc,
ZERO, ZERO));
p->getInfo().push_back(new_ptr(ParticleInfo(parton)));
theProducedParticles[parton] = p;
return p;
}
void DipoleState::persistentOutput(PersistentOStream & os) const {
os << ounit(thePlus, GeV) << ounit(theMinus, GeV)
<< ounit(theMinusDeficit, GeV) << theHandler << theInitialDipoles
<< theSwingCandidates << theTouchedSwingCandidates
<< theWFInfo << theWeight << doTakeHistory
<< theYmax << ounit(theCollidingEnergy, GeV) << allDipoles << theIncoming
<< theProducedParticles;
}
void DipoleState::persistentInput(PersistentIStream & is, int) {
is >> iunit(thePlus, GeV)>> iunit(theMinus, GeV)
>> iunit(theMinusDeficit, GeV) >> theHandler >> theInitialDipoles
>> theSwingCandidates >> theTouchedSwingCandidates
>> theWFInfo >> theWeight >> doTakeHistory
>> theYmax >> iunit(theCollidingEnergy, GeV) >> allDipoles >> theIncoming
>> theProducedParticles;
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<DipoleState,PersistentBase>
describeDIPSYDipoleState("DIPSY::DipoleState", "libAriadne5.so libDIPSY.so");
void DipoleState::Init() {}
diff --git a/DIPSY/DipoleState.h b/DIPSY/DipoleState.h
--- a/DIPSY/DipoleState.h
+++ b/DIPSY/DipoleState.h
@@ -1,587 +1,625 @@
// -*- C++ -*-
#ifndef DIPSY_DipoleState_H
#define DIPSY_DipoleState_H
//
// This is the declaration of the DipoleState class.
//
#include "ThePEG/Config/ThePEG.h"
#include "DipoleState.fh"
#include "Dipole.h"
#include "DipoleEventHandler.fh"
#include "WFInfo.h"
#include "DipoleXSec.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Analysis/FactoryBase.h"
#ifndef LWH_AIAnalysisFactory_H
#ifndef LWH
#define LWH ThePEGLWH
#endif
#include "ThePEG/Analysis/LWH/AnalysisFactory.h"
#endif
namespace DIPSY {
using namespace ThePEG;
/**
* Here is the documentation of the DipoleState class.
*/
class DipoleState: public PersistentBase {
public:
/**
* Copy FList typedef from DipoleXSec.
*/
typedef DipoleXSec::FList FList;
/**
* A String is simply a vector of colour-connected partons.
*/
typedef vector<PartonPtr> String;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The standard constructor taking the controlling
* DipoleEventHandler as argument.
*/
- inline DipoleState(const DipoleEventHandler &, WFInfoPtr wf = WFInfoPtr());
+ inline DipoleState(const DipoleEventHandler & h, WFInfoPtr wf = WFInfoPtr())
+ : thePlus(ZERO), theMinus(ZERO), theMinusDeficit(ZERO), theHandler(&h),
+ theWFInfo(wf), theWeight(1.0), doTakeHistory(false), theYmax(0.0),
+ theCollidingEnergy(ZERO) {}
/**
* The default constructor.
*/
- inline DipoleState();
+ inline DipoleState()
+ : thePlus(ZERO), theMinus(ZERO), theMinusDeficit(ZERO), theWeight(1.0),
+ doTakeHistory(false), theYmax(0.0), theCollidingEnergy(ZERO) {}
/**
* The copy constructor.
*/
DipoleState(const DipoleState &);
/**
* The destructor.
*/
virtual ~DipoleState();
//@}
public:
/**
* Runs through a final state evolution checking for swings only.
*/
void swingFS(double ymin, double ymax);
/**
* Does some colour recconection for the valence partons to account for
* original 3 colour colour structure of a proton.
*/
void normaliseValenceCharge(int mode);
/**
* Makes sure the non-participating nucleons of an AA collision have the
* colour flow of the original triangles.
*/
void restoreNonparticipants();
/**
* counts and returns the number of spectating nucleons.
*/
int numberOfSpectators() const;
/**
* Makes sure the the two partons are conected by a dipole with p1 as first parton.
* returns false if it fails, and they are left not connected.
*/
bool restoreDipole(PartonPtr p1, PartonPtr p2);
/**
* Evolve this state from the given minimum to the given maximum
* rapidity, assuming there will be p- coming from the other state.
*/
void evolve(double ymin, double ymax);
/**
* Makes the state merge with another colliding state.
*/
DipoleStatePtr collide(DipoleStatePtr otherState,
const vector<FList::const_iterator> & sel,
const ImpactParameters & b);
/**
* Makes the state merge with another colliding state.
*/
DipoleStatePtr merge(DipoleStatePtr otherState);
/**
* mirrors the state in rapidity around y0.
*/
void mirror(double y0);
/**
* moves all partons and their pT according to the imparctparameter b.
*/
void translate(const ImpactParameters & b );
/**
* Fix up valens partons if they were not of the correct flavour or
* if they should collapse into a hadron.
*/
virtual void fixValence(Step & step) const;
/**
* returns the positions of all partons in the state,
* together with the size of the largest neighbouring dipole.
*/
vector<pair<Parton::Point, InvEnergy> > points();
/**
* Checks through all partons and reabsorbs the ones which are
* considered enough gain in some kind of virtuality.
*/
void absorbSmallDipoles();
/**
* Removes all the parents of the dipoles, and sets the currently
* active dipoles as the initial ones.
**/
void makeOriginal();
/**
* returns teh average distance in rapidity of the interacting dipoles.
*/
double avYInInt() const;
/**
* Controls and couts various info about the state. Returns false
* if something is too wrong.
*/
bool diagnosis(bool print) const;
/**
* Prints the state to file.
*/
void saveGluonsToFile(double weight) const;
/**
* Returns the partons sorted in Strings.
*/
vector<DipoleState::String> strings();
/**
* Returns the active partons.
*/
list<PartonPtr> getPartons() const;
/**
* Returns the active dipoles.
*/
list<DipolePtr> getDipoles() const;
/**
* Returns all dipoles.
*/
set<DipolePtr> getAllDipoles() const {
return allDipoles;
}
/**
* Makes the state reabsorb a parton.
*/
void reabsorb(PartonPtr p);
/**
* Makes the state reabsorb a parton, and continues to absorb as
* long as the dipoles gets smaller along the colour chain.
*/
void recursiveReabsorb(PartonPtr p);
/**
* Forces one of the dipoles connected to the parton
* to immediately swing. But not with higher rapdity
* step than /a ymax1 of same colour, or /a ymax2 of
* another colour if same colour cant be found.
* /a ymax = 0 mean no limit.
*/
bool forceSwing(PartonPtr d, double ymax1, double ymax2);
/**
* Shuffles p+ and p- between the left and right part of the state
* so that the particles are really on shell. Assumes m=0 atm.
*/
void balanceMomenta();
/**
* Get the weight associated with the generation of this dipole state.
*/
- inline double weight() const;
+ inline double weight() const {
+ return theWeight;
+ }
/**
* Set the weight associated with the generation of this dipole state.
*/
- inline void weight(double);
+ inline void weight(double x) {
+ theWeight = x;
+ }
/**
* Get the p+ that the original particle brought.
*/
inline Energy plus() const {
return thePlus;
}
/**
* Set the p+ that the original particle brought.
*/
inline void plus(Energy E) {
thePlus = E;
}
/**
* Get the p- that the original particle brought.
*/
inline Energy minus() const {
return theMinus;
}
/**
* Set the p- that the original particle brought.
*/
inline void minus(Energy E) {
theMinus = E;
}
/**
* Get the p- that the original particle was missing.
*/
inline Energy minusDeficit() const {
return theMinusDeficit;
}
/**
* Set if the state should save its history or not.
*/
- inline void takeHistory(bool);
+ inline void takeHistory(bool b) {
+ doTakeHistory = b;
+ }
/**
* saves the current state into the states history, but only if
* doTakeHistory is true.
*/
- inline void save();
+ inline void save() {
+ if ( doTakeHistory ) theHistory.push_back( clone() );
+ }
/**
* The list of initial dipoles.
*/
- inline const vector<DipolePtr> & initialDipoles() const;
+ inline const vector<DipolePtr> & initialDipoles() const {
+ return theInitialDipoles;
+ }
/**
* Adds a dipole to the initial Dipoles.
* Mainly for testing purposes.
*/
- inline void addDipole(Dipole & dip);
+ inline void addDipole(Dipole & dip) {
+ theInitialDipoles.push_back(& dip);
+ }
/**
* Get additional info about the wavefunction used to create this state.
*/
- inline WFInfoPtr WFInfo() const;
+ inline WFInfoPtr WFInfo() const {
+ return theWFInfo;
+ }
/**
* Get additional info about the wavefunction used to create this state.
*/
- inline const WaveFunction & wf() const;
+ inline const WaveFunction & wf() const {
+ return WFInfo()->wf();
+ }
/**
* Set additional info about the wavefunction used to create this state.
*/
- inline void WFInfo(WFInfoPtr);
+ inline void WFInfo(WFInfoPtr x) {
+ theWFInfo = x;
+ }
/**
* The controlling DipoleEventHandler.
*/
- inline const DipoleEventHandler & handler() const;
+ inline const DipoleEventHandler & handler() const {
+ return *theHandler;
+ }
/**
* Set the controlling DipoleEventHandler.
* added by CF to access from emitter.
*/
- inline void handler(tcDipoleEventHandlerPtr);
+ inline void handler(tcDipoleEventHandlerPtr hdl) {
+ theHandler = hdl;
+ }
/**
* Create a Dipole belonging to this state.
*/
- inline tDipolePtr createDipole();
+ inline tDipolePtr createDipole() {
+ DipolePtr d = new_ptr(Dipole());
+ d->theDipoleState = this;
+ allDipoles.insert(d);
+ return d;
+ }
/**
* Generate a consistent colour index for the given Dipole.
*/
void generateColourIndex(tDipolePtr);
/**
* Make all colours belong to the same system.
*/
void unifyColourSystems(int isys = 0);
/**
* Returns all active dipoles of a certain colour. Optionally only
* return dipoles which have been touched since the last emission.
*/
inline const vector<tDipolePtr> &
- swingCandidates(int, bool touched = false) const;
+ swingCandidates(int c, bool touched = false) const {
+ static vector<tDipolePtr> dummy;
+ if ( !touched ) return theSwingCandidates[c];
+ if ( c >= int(theTouchedSwingCandidates.size()) ) return dummy;
+ return theTouchedSwingCandidates[c];
+ }
/**
* adds the dipole, and all its children, to theSwingCandidates list.
* includes interacting dipoles.
*/
void sortDipoleFS(Dipole &);
/**
* Sort in colour all the dipoles originating from initialDipoles.
* includes interacting dipoles.
*/
void sortDipolesFS();
/**
* Sort in colour all the dipoles originating from initialDipoles.
* includes interacting dipoles.
*/
void sortFSDipoles();
/**
* Return the total lambda measure for all final state dipoles.
*/
pair<double,int> lambdaMeasure(Energy2 scale = 1.0*GeV2,
FactoryBase::tH1DPtr histlength = 0,
FactoryBase::tH1DPtr histmass = 0) const;
/**
* adds the dipole, and all its children, to theSwingCandidates list.
*/
void sortDipole(Dipole &);
/**
* Sort in colour all the dipoles originating from initialDipoles.
*/
void sortDipoles();
/**
* Returns a list of all the active nonvalence partons that has not interacted.
*/
const list<PartonPtr> virtualPartons() const;
/**
* Calculates and returns the set of the loops in the state.
*/
const set< list<PartonPtr> > loops() const;
/**
* Returns the highest rapidity in any parton in the state.
*/
const double highestY() const;
/**
* Returns the highest rapidity in any parton in the state.
*/
const double lowestY() const;
/**
* Returns the rapidity the state has been evolved to.
*/
const double ymax() const;
/**
* Gets the energy the colliding state will supply.
*/
const Energy collidingEnergy() const;
/**
* Sets the energy the colliding state will supply.
*/
void collidingEnergy(Energy);
/**
* Return the incoming particle(s) mapped to the corresponding valence particles.
*/
inline const map<PPtr, vector<PartonPtr> > & incoming() const {
return theIncoming;
}
/**
* Return a ThePEG::Particle produced from the given
* DIPSY::Parton. I nocreate is true, only return a particle which
* has previously been created, do not create any new ones.
*/
tPPtr getParticle(tcPartonPtr parton, bool nocreate = false) const;
/**
* Given an output iterator fill the corresponding container with
* final, undecayed dipoles. This is done recursively, ie. if this
* dipole has decayed, the extract methods of the two children are
* called instead.
*/
template <typename OutputIterator>
- inline void extract(OutputIterator it) const;
+ inline void extract(OutputIterator it) const {
+ for ( int i = 0, N = initialDipoles().size(); i < N; ++i )
+ initialDipoles()[i]->extract(it);
+ }
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();
public:
/**
* Clone this state and all the dipoles and partons in it.
*/
DipoleStatePtr clone();
protected:
/**
* The p+ and p- that the original particle had.
*/
Energy thePlus;
Energy theMinus;
/**
* Keeps track of extra missing p- that is not reflected in the
* valence partons.
*/
Energy theMinusDeficit;
/**
* The controlling DipoleEventHandler.
*/
tcDipoleEventHandlerPtr theHandler;
/**
* The list of initial dipoles.
*/
vector<DipolePtr> theInitialDipoles;
/**
* The active dipoles sorted by colour. /CF
*/
vector< vector<tDipolePtr> > theSwingCandidates;
/**
* The active dipoles which have been touched since the last
* emission, sorted by colour
*/
vector< vector<tDipolePtr> > theTouchedSwingCandidates;
/**
* Additional info about the wavefunction used to create this state.
*/
WFInfoPtr theWFInfo;
/**
* The weight associated with the generation of this dipole state.
*/
double theWeight;
/**
* If the history should be saved and displayed or not.
*/
bool doTakeHistory;
/**
* The rapidity the state has been evolved to.
*/
double theYmax;
/**
* How much energy the meeting particle have.
*/
Energy theCollidingEnergy;
/**
* The history of this state.
*/
vector<DipoleStatePtr> theHistory;
/**
* The set of all dipoles belonging to this state.
*/
set<DipolePtr> allDipoles;
/**
* A map relating incoming particles with the valens partons.
*/
map<PPtr, vector<PartonPtr> > theIncoming;
/**
* A map relating a produced ThePEG::Particle to its DIPSY::Parton.
*/
mutable map<tcPartonPtr,PPtr> theProducedParticles;
protected:
/**
* Exception class for badly connected dipoles.
*/
struct DipoleConnectionException: public Exception {};
/**
* Exception class for bad kinematics.
*/
struct DipoleKinematicsException: public Exception {};
/**
* Exception class for bad DGLAP checks.
*/
struct DipoleDGLAPSafeException: public Exception {};
public:
/**
* Helper function for fixValence implementation. Take the momentum
* \a p and return a new momentum with the mass \a m, such that the
* total rest massof the system when combined with a fererence
* momentum, \a ref, and the reference momentum itself is
* preserved. Note that this will change the total momentum of the
* system, but this is fixed in the end by a simple global boost in
* the fixValence method. If \a Rshift is non-null, the
* corresponding object is set to the boost from the old total frame
* to the current one.
*/
static LorentzMomentum changeMass(LorentzMomentum p, Energy m, LorentzMomentum ref,
LorentzRotation * Rshift = 0);
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
DipoleState & operator=(const DipoleState &);
};
}
-#include "DipoleState.icc"
-
#endif /* DIPSY_DipoleState_H */
diff --git a/DIPSY/DipoleState.icc b/DIPSY/DipoleState.icc
deleted file mode 100644
--- a/DIPSY/DipoleState.icc
+++ /dev/null
@@ -1,86 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the DipoleState class.
-//
-
-namespace DIPSY {
-
-inline DipoleState::DipoleState()
- : thePlus(ZERO), theMinus(ZERO), theMinusDeficit(ZERO), theWeight(1.0),
- doTakeHistory(false), theYmax(0.0), theCollidingEnergy(ZERO) {}
-
-inline DipoleState::DipoleState(const DipoleEventHandler & h, WFInfoPtr wf)
- : thePlus(ZERO), theMinus(ZERO), theMinusDeficit(ZERO), theHandler(&h),
- theWFInfo(wf), theWeight(1.0), doTakeHistory(false), theYmax(0.0),
- theCollidingEnergy(ZERO) {}
-
-inline const DipoleEventHandler & DipoleState::handler() const {
- return *theHandler;
-}
-
-//added by CF to access from emitter
-inline void DipoleState::handler(tcDipoleEventHandlerPtr handler) {
- theHandler = handler;
-}
-
-inline tDipolePtr DipoleState::createDipole() {
- DipolePtr d = new_ptr(Dipole());
- d->theDipoleState = this;
- allDipoles.insert(d);
- return d;
-}
-
-template <typename OutputIterator>
-inline void DipoleState::extract(OutputIterator it) const {
- for ( int i = 0, N = initialDipoles().size(); i < N; ++i )
- initialDipoles()[i]->extract(it);
-}
-
-//to access the dipoles of a cetain colour. /CF
-inline const vector<tDipolePtr> &
-DipoleState::swingCandidates(int c, bool touched) const {
- static vector<tDipolePtr> dummy;
- if ( !touched ) return theSwingCandidates[c];
- if ( c >= int(theTouchedSwingCandidates.size()) ) return dummy;
- return theTouchedSwingCandidates[c];
-}
-
-inline const vector<DipolePtr> & DipoleState::initialDipoles() const {
- return theInitialDipoles;
-}
-
-inline void DipoleState::addDipole(Dipole & dip) {
- theInitialDipoles.push_back(& dip);
-}
-
-inline double DipoleState::weight() const {
- return theWeight;
-}
-
-inline void DipoleState::weight(double x) {
- theWeight = x;
-}
-
-inline void DipoleState::takeHistory(bool b) {
- doTakeHistory = b;
-}
-
-inline void DipoleState::save() {
- if ( doTakeHistory )
- theHistory.push_back( clone() );
-}
-
-inline WFInfoPtr DipoleState::WFInfo() const {
- return theWFInfo;
-}
-
-inline const WaveFunction & DipoleState::wf() const {
- return WFInfo()->wf();
-}
-
-inline void DipoleState::WFInfo(WFInfoPtr x) {
- theWFInfo = x;
-}
-
-}
diff --git a/DIPSY/DipoleXSec.cc b/DIPSY/DipoleXSec.cc
--- a/DIPSY/DipoleXSec.cc
+++ b/DIPSY/DipoleXSec.cc
@@ -1,1519 +1,1541 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the DipoleXSec class.
//
#include "DipoleXSec.h"
#include "Dipole.h"
#include "DipoleState.h"
#include "Parton.h"
#include "DipoleEventHandler.h"
#include "RealParton.h"
#include "RealPartonState.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/Utilities/Debug.h"
#include "ThePEG/Utilities/DebugItem.h"
#include "ThePEG/Utilities/Throw.h"
#ifdef ThePEG_TEMPLATES_IN_CC_FILE
// #include "DipoleXSec.tcc"
#endif
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "gsl/gsl_sf_bessel.h"
using namespace ThePEG;
using namespace DIPSY;
DipoleXSec::~DipoleXSec() {}
+DipoleXSec::DipoleInteraction::DipoleInteraction(const Dipole & dlin, const Dipole & drin)
+ : dips(&dlin, &drin), f(0.0), uf(0.0), kt(ZERO) {
+ ints.first.first = UseRandom::rndbool();
+ ints.first.second = !ints.first.first;
+ ints.second.first = UseRandom::rndbool();
+ ints.second.second = !ints.second.first;
+}
+
InvEnergy DipoleXSec::rMax() const {
return theRMax > 0.0*InvGeV? theRMax: Current<DipoleEventHandler>()->rMax();
}
double DipoleXSec::
fij(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b, bool veto) const {
Nfij++;
tcPartonPtr p11 = left.first;
tcPartonPtr p12 = left.second;
tcPartonPtr p21 = right.first;
tcPartonPtr p22 = right.second;
//TODO: keep only interaction 0, as that is the only one supported anyway
if ( theInteraction == 0 || theInteraction == 1 || theInteraction == 3 || theInteraction == 4 ) {
InvEnergy2 rr11 = b.dist2(*p11, *p21);
InvEnergy2 rr21 = b.dist2(*p12, *p21);
InvEnergy2 rr12 = b.dist2(*p11, *p22);
InvEnergy2 rr22 = b.dist2(*p12, *p22);
if ( veto && kinematicsVeto(left, right, b) ) {
return 0.0;
}
TransverseMomentum pt;
double pTScale = Current<DipoleEventHandler>()->emitter().pTScale();
InvEnergy rscale = sqrt(min(min(min(rr12, rr21),min(rr11, rr22)),
min(p11->dist2(*p12), p21->dist2(*p22))));
double fudgeME = 1.0;
if ( theInteraction == 0 ) {
pair<bool, bool> ints;
ints = int0Partons(p11, p12, p21, p22, b);
Parton::Point r1 = b.difference((ints.first ? p11->position():p12->position()),
(ints.second ? p21->position():p22->position()));
if ( r1.pt2() < min(p11->dist2(*p12), p21->dist2(*p22)) &&
Current<DipoleEventHandler>()->fudgeME() ) {
- double deltay = ( ints.first? p11->y(): p12->y() ) -
+ double deltay = ( ints.first? p11->y(): p12->y() ) +
( ints.second? p21->y(): p22->y() );
fudgeME = 1.0 - 1.0/(1.0 + cosh(deltay));
+ fudgeME *= Current<DipoleEventHandler>()->fudgeFactorME();
}
pt = pTScale*r1/r1.pt2();
rscale = sqrt(min(min(r1.pt2(),p11->dist2(*p12)), p21->dist2(*p22)));
}
if ( theInteraction == 1 ) { //4 parton distance
Parton::Point r1 = b.difference(p11->position(), p21->position());
Parton::Point r2 = b.difference(p11->position(), p22->position());
Parton::Point r3 = b.difference(p12->position(), p21->position());
Parton::Point r4 = b.difference(p12->position(), p22->position());
pt = pTScale*(r1/sqr(r1.pt()) + r2/sqr(r2.pt()) +
r3/sqr(r3.pt()) + r4/sqr(r4.pt()))*0.35;
}
if ( theInteraction == 3 ) { //2 parton distance
Parton::Point r1 = b.difference(p11->position(), p22->position());
Parton::Point r2 = b.difference(p12->position(), p21->position());
pt = pTScale*(r1/sqr(r1.pt()) + r2/sqr(r2.pt()))*0.6;
}
Parton::Point rho1 = (p12->position() - p11->position())/2.0;
Parton::Point rho2 = (p22->position() - p21->position())/2.0;
double s1 = pt.x()*rho1.x() + pt.y()*rho1.y();
double s2 = pt.x()*rho2.x() + pt.y()*rho2.y();
return 8.0*fudgeME*sqr(Current<DipoleEventHandler>()->alphaS(rscale))*
sqr(sin(s1)*sin(s2))*
sqr(sqr(pt.pt()))/sqr(sqr(pt.pt()) + sqr(pTScale/rMax()));
}
return 0.0;
}
-double DipoleXSec::
-fij(const Dipole & dleft, const Dipole & dright,
- const ImpactParameters & b, bool veto) const {
+DipoleXSec::DipoleInteraction DipoleXSec::
+fij(const ImpactParameters & b, const Dipole & dleft, const Dipole & dright,
+ bool veto) const {
+ DipoleInteraction di(dleft, dright);
pair<tPartonPtr, tPartonPtr> left = dleft.partons();
pair<tPartonPtr, tPartonPtr> right = dright.partons();
- pair<bool, bool> ints;
+ pair<bool, bool> ints(di.ints.first.first, di.ints.second.first);
Nfij++;
double fudgeME = 1.0;
tcPartonPtr p11 = left.first;
tcPartonPtr p12 = left.second;
tcPartonPtr p21 = right.first;
tcPartonPtr p22 = right.second;
- ints = int0Partons(p11, p12, p21, p22, b);
- //TODO: keep only interaction 0, as that is the only one supported anyway
- if ( theInteraction == 0 || theInteraction == 1 || theInteraction == 3 || theInteraction == 4 ) {
- InvEnergy2 rr11 = b.dist2(*p11, *p21);
- InvEnergy2 rr21 = b.dist2(*p12, *p21);
- InvEnergy2 rr12 = b.dist2(*p11, *p22);
- InvEnergy2 rr22 = b.dist2(*p12, *p22);
- if ( veto && kinematicsVeto(dleft, dright, b, ints) ) {
- return 0.0;
- }
-
- TransverseMomentum pt;
- double pTScale = Current<DipoleEventHandler>()->emitter().pTScale();
-
- InvEnergy rscale = sqrt(min(min(min(rr12, rr21),min(rr11, rr22)),
- min(p11->dist2(*p12), p21->dist2(*p22))));
-
- if ( theInteraction == 0 ) {
-
- Parton::Point r1 = b.difference((ints.first ? p11->position():p12->position()),
- (ints.second ? p21->position():p22->position()));
-
- if ( r1.pt2() < min(p11->dist2(*p12), p21->dist2(*p22)) &&
- Current<DipoleEventHandler>()->fudgeME() ) {
- double deltay = ( ints.first? p11->y(): p12->y() ) -
- ( ints.second? p21->y(): p22->y() );
- fudgeME = 1.0 - 1.0/(1.0 + cosh(deltay));
- }
-
- pt = pTScale*r1/sqr(r1.pt());
- rscale = sqrt(min(min(sqr(r1.pt()),p11->dist2(*p12)), p21->dist2(*p22)));
- }
-
- if ( theInteraction == 1 ) { //4 parton distance
- Parton::Point r1 = b.difference(p11->position(), p21->position());
- Parton::Point r2 = b.difference(p11->position(), p22->position());
- Parton::Point r3 = b.difference(p12->position(), p21->position());
- Parton::Point r4 = b.difference(p12->position(), p22->position());
- pt = pTScale*(r1/sqr(r1.pt()) + r2/sqr(r2.pt()) +
- r3/sqr(r3.pt()) + r4/sqr(r4.pt()))*0.35;
- }
-
- if ( theInteraction == 3 ) { //2 parton distance
- Parton::Point r1 = b.difference(p11->position(), p22->position());
- Parton::Point r2 = b.difference(p12->position(), p21->position());
- pt = pTScale*(r1/sqr(r1.pt()) + r2/sqr(r2.pt()))*0.6;
- }
-
- Parton::Point rho1 = (p12->position() - p11->position())/2.0;
- Parton::Point rho2 = (p22->position() - p21->position())/2.0;
-
- double s1 = pt.x()*rho1.x() + pt.y()*rho1.y();
- double s2 = pt.x()*rho2.x() + pt.y()*rho2.y();
-
- return 8.0*fudgeME*sqr(Current<DipoleEventHandler>()->alphaS(rscale))*
- sqr(sin(s1)*sin(s2))*
- sqr(sqr(pt.pt()))/sqr(sqr(pt.pt()) + sqr(pTScale/rMax()));
+ if ( veto && kinematicsVeto(dleft, dright, b, ints) ) {
+ return di;
}
- return 0.0;
+ double pTScale = Current<DipoleEventHandler>()->emitter().pTScale();
+
+
+ Parton::Point r1 = b.difference((ints.first ? p11->position():p12->position()),
+ (ints.second ? p21->position():p22->position()));
+
+ if ( r1.pt2() < min(p11->dist2(*p12), p21->dist2(*p22)) &&
+ Current<DipoleEventHandler>()->fudgeME() ) {
+ double deltay = ( ints.first? p11->y(): p12->y() ) +
+ ( ints.second? p21->y(): p22->y() );
+ fudgeME = 1.0 - 1.0/(1.0 + cosh(deltay));
+ fudgeME *= Current<DipoleEventHandler>()->fudgeFactorME();
+ }
+
+ di.pt = pTScale*r1/sqr(r1.pt());
+ InvEnergy rscale = sqrt(min(min(sqr(r1.pt()),p11->dist2(*p12)), p21->dist2(*p22)));
+
+ Parton::Point rho1 = (p12->position() - p11->position())/2.0;
+ Parton::Point rho2 = (p22->position() - p21->position())/2.0;
+
+ double s1 = di.pt.x()*rho1.x() + di.pt.y()*rho1.y();
+ double s2 = di.pt.x()*rho2.x() + di.pt.y()*rho2.y();
+
+ di.f = 8.0*fudgeME*sqr(Current<DipoleEventHandler>()->alphaS(rscale))*
+ sqr(sin(s1)*sin(s2))*sqr(sqr(di.pt.pt()))/sqr(sqr(di.pt.pt()) + sqr(pTScale/rMax()));
+ di.uf = unitarize(di.f);
+ di.kt = 1.0/rscale;
+
+ return di;
}
bool DipoleXSec::kinematicsVeto(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b) const {
pair<pair<bool, bool>, pair<bool, bool> > ints = doesInt(left, right, b);
InteractionRecoil recs = recoil(left, right, b, ints);
if ( theInteraction == 0 ) {
//the key partons for f_ij
pair<bool, bool> ints0 = int0Partons(left.first, left.second, right.first, right.second, b);
//first set up effective partons with range etc
tPartonPtr p1 = (ints0.first ? left.first:left.second);
tPartonPtr p2 = (ints0.second ? right.first:right.second);
//there MAY be secondary partons in the interaction, decided by ints.
tPartonPtr p1sec, p2sec;
if ( ints.first.first && ints.first.second )
p1sec = (ints0.first ? left.second:left.first);
if ( ints.second.first && ints.second.second )
p2sec = (ints0.second ? right.second:right.first);
//only distance between key partons will affect range (reasonable?)
InvEnergy range1 = sqrt(min(left.first->dist2(*left.second)/4.0, b.dist2(*p1, *p2)));
InvEnergy range2 = sqrt(min(right.first->dist2(*right.second)/4.0, b.dist2(*p1, *p2)));
if ( Current<DipoleEventHandler>()->emitter().rangeMode() == 1 ) {
range1 = sqrt(left.first->dist2(*left.second)/4.0);
range2 = sqrt(right.first->dist2(*right.second)/4.0);
}
EffectivePartonPtr ep1 = EffectiveParton::create(*p1, range1);
EffectivePartonPtr ep2 = EffectiveParton::create(*p2, range2);
EffectivePartonPtr ep1sec, ep2sec;
if ( p1sec ) ep1sec = EffectiveParton::create(*p1sec, range1);
if ( p2sec ) ep2sec = EffectiveParton::create(*p2sec, range2);
TransverseMomentum rec1 = (ints0.first ? recs.first.first:recs.first.second);
TransverseMomentum rec2 = (ints0.second ? recs.second.first:recs.second.second);
Energy pt1 = (ep1->pT() + rec1).pt();
Energy minus1 = sqr(pt1)/ep1->plus();
Energy pt2 = (ep2->pT() + rec2).pt();
Energy minus2 = sqr(pt2)/ep2->plus();
//sum up total supplied and needed LC momentum from each side
Energy leftPlus = ep1->plus() + (p1sec ? ep1sec->plus():ZERO);
Energy leftMinus = minus1;
if ( p1sec ) {
TransverseMomentum rec1sec = (ints0.first ? recs.first.second:recs.first.first);
Energy pt1sec = (ep1sec->pT() + rec1sec).pt();
Energy minus1sec = sqr(pt1sec)/ep1sec->plus();
leftMinus += minus1sec;
}
Energy rightPlus = ep2->plus() + (p2sec ? ep2sec->plus():ZERO);
Energy rightMinus = minus2 + (p2sec ? ep2sec->minus():ZERO);
if ( p2sec ) {
TransverseMomentum rec2sec = (ints0.second ? recs.second.second:recs.second.first);
Energy pt2sec = (ep2sec->pT() + rec2sec).pt();
Energy minus2sec = sqr(pt2sec)/ep2sec->plus();
rightMinus += minus2sec;
}
if ( theIntOrdering == 2 ) {
Energy maxRec = max(max(recs.first.first.pt() ,recs.first.second.pt()),
max(recs.second.first.pt() ,recs.second.second.pt()));
if ( leftPlus*rightPlus < 16.0*sqr(maxRec) ) return true;
else return false;
}
//check enough energy to set all on shell
if ( leftPlus*rightPlus < 16.0*leftMinus*rightMinus ) {
return true;
}
//take LC momentum transfers in account
Energy plus1 = ep1->plus()*(1.0 - rightMinus/leftPlus);
minus1 /= 1.0 - rightMinus/leftPlus;
Energy plus2 = ep2->plus()*(1.0 - leftMinus/rightPlus);
minus2 /= 1.0 - leftMinus/rightPlus;
//check ordering of the key partons (secondaries can be unordered if they want)
double PSInf = Current<DipoleEventHandler>()->emitter().PSInflation();
if ( theIntOrdering == 0 ) {
//just check plus and minus ordering after recoils
if ( plus1*PSInf < minus2 ) return true;
if ( plus2*PSInf < minus1 ) return true;
}
else if ( theIntOrdering == 1 ) {
//check p- ordering from both sides, as if it was evolution.
//that is, as if no future recoils.
double PMOrd = Current<DipoleEventHandler>()->emitter().PMinusOrdering();
TransverseMomentum rec1 = (ints0.first ? recs.first.first:recs.first.second);
TransverseMomentum rec2 = (ints0.second ? recs.second.first:recs.second.second);
if ( sqr(max(rec1.pt(), rec2.pt())*PSInf) < minus1*minus2*PMOrd )
return true;
}
//check that the partons stay on their side, to avoid doublecounting
double yInt = 0;
if ( p1->dipoles().first ) yInt = p1->dipoles().first->dipoleState().ymax();
else if ( p1->dipoles().second ) yInt = p1->dipoles().second->dipoleState().ymax();
double y1 = 0.5*log(minus1/plus1);
if ( y1 > yInt ) return true;
double y2 = 0.5*log(plus2/minus2);
if ( y2 < yInt ) return true;
//should we check secondaries as well here?
//if no veto triggered, it should not be vetoed
return false;
}
else {
cerr << "only interaction 0 is supported in kinematics veto atm, sorry" << endl;
}
return false;
}
bool DipoleXSec::kinematicsVeto(const Dipole & dleft,
const Dipole & dright,
const ImpactParameters & b,
const pair<bool,bool> & ints0) const {
pair<tPartonPtr, tPartonPtr> left = dleft.partons();
pair<tPartonPtr, tPartonPtr> right = dright.partons();
pair<pair<bool, bool>, pair<bool, bool> > ints = doesInt(left, right, b);
InteractionRecoil recs = recoil(left, right, b, ints, ints0);
if ( theInteraction == 0 ) {
//first set up effective partons with range etc
tPartonPtr p1 = (ints0.first ? left.first:left.second);
tPartonPtr p2 = (ints0.second ? right.first:right.second);
//there MAY be secondary partons in the interaction, decided by ints.
tPartonPtr p1sec, p2sec;
if ( ints.first.first && ints.first.second )
p1sec = (ints0.first ? left.second:left.first);
if ( ints.second.first && ints.second.second )
p2sec = (ints0.second ? right.second:right.first);
//only distance between key partons will affect range (reasonable?)
InvEnergy range1 = sqrt(min(left.first->dist2(*left.second)/4.0, b.dist2(*p1, *p2)));
InvEnergy range2 = sqrt(min(right.first->dist2(*right.second)/4.0, b.dist2(*p1, *p2)));
if ( Current<DipoleEventHandler>()->emitter().rangeMode() == 1 ) {
range1 = sqrt(left.first->dist2(*left.second)/4.0);
range2 = sqrt(right.first->dist2(*right.second)/4.0);
}
EffectivePartonPtr ep1 = dleft.getEff(p1, range1);
EffectivePartonPtr ep2 = dright.getEff(p2, range2);
EffectivePartonPtr ep1sec, ep2sec;
if ( p1sec ) ep1sec = dleft.getEff(p1sec, range1);
if ( p2sec ) ep2sec = dright.getEff(p2sec, range2);
TransverseMomentum rec1 = (ints0.first ? recs.first.first:recs.first.second);
TransverseMomentum rec2 = (ints0.second ? recs.second.first:recs.second.second);
Energy pt1 = (ep1->pT() + rec1).pt();
Energy minus1 = sqr(pt1)/ep1->plus();
Energy pt2 = (ep2->pT() + rec2).pt();
Energy minus2 = sqr(pt2)/ep2->plus();
//sum up total supplied and needed LC momentum from each side
Energy leftPlus = ep1->plus() + (p1sec ? ep1sec->plus():ZERO);
Energy leftMinus = minus1;
if ( p1sec ) {
TransverseMomentum rec1sec = (ints0.first ? recs.first.second:recs.first.first);
Energy pt1sec = (ep1sec->pT() + rec1sec).pt();
Energy minus1sec = sqr(pt1sec)/ep1sec->plus();
leftMinus += minus1sec;
}
Energy rightPlus = ep2->plus() + (p2sec ? ep2sec->plus():ZERO);
Energy rightMinus = minus2 + (p2sec ? ep2sec->minus():ZERO);
if ( p2sec ) {
TransverseMomentum rec2sec = (ints0.second ? recs.second.second:recs.second.first);
Energy pt2sec = (ep2sec->pT() + rec2sec).pt();
Energy minus2sec = sqr(pt2sec)/ep2sec->plus();
rightMinus += minus2sec;
}
if ( theIntOrdering == 2 ) {
Energy maxRec = max(max(recs.first.first.pt() ,recs.first.second.pt()),
max(recs.second.first.pt() ,recs.second.second.pt()));
if ( leftPlus*rightPlus < 16.0*sqr(maxRec) ) return true;
else return false;
}
//check enough energy to set all on shell
if ( leftPlus*rightPlus < 16.0*leftMinus*rightMinus ) {
return true;
}
//take LC momentum transfers in account
Energy plus1 = ep1->plus()*(1.0 - rightMinus/leftPlus);
minus1 /= 1.0 - rightMinus/leftPlus;
Energy plus2 = ep2->plus()*(1.0 - leftMinus/rightPlus);
minus2 /= 1.0 - leftMinus/rightPlus;
//check ordering of the key partons (secondaries can be unordered if they want)
double PSInf = Current<DipoleEventHandler>()->emitter().PSInflation();
if ( theIntOrdering == 0 ) {
//just check plus and minus ordering after recoils
if ( plus1*PSInf < minus2 ) return true;
if ( plus2*PSInf < minus1 ) return true;
}
else if ( theIntOrdering == 1 ) {
//check p- ordering from both sides, as if it was evolution.
//that is, as if no future recoils.
double PMOrd = Current<DipoleEventHandler>()->emitter().PMinusOrdering();
TransverseMomentum rec1 = (ints0.first ? recs.first.first:recs.first.second);
TransverseMomentum rec2 = (ints0.second ? recs.second.first:recs.second.second);
if ( sqr(max(rec1.pt(), rec2.pt())*PSInf) < minus1*minus2*PMOrd )
return true;
}
//check that the partons stay on their side, to avoid doublecounting
double yInt = 0;
if ( p1->dipoles().first ) yInt = p1->dipoles().first->dipoleState().ymax();
else if ( p1->dipoles().second ) yInt = p1->dipoles().second->dipoleState().ymax();
double y1 = 0.5*log(minus1/plus1);
if ( y1 > yInt ) return true;
double y2 = 0.5*log(plus2/minus2);
if ( y2 < yInt ) return true;
//should we check secondaries as well here?
//if no veto triggered, it should not be vetoed
return false;
}
else {
cerr << "only interaction 0 is supported in kinematics veto atm, sorry" << endl;
}
return false;
}
double DipoleXSec::
sumf(const DipoleState & sl, const DipoleState & sr,
const ImpactParameters & b) const {
Nfij = 0;
NBVeto = 0;
NScalVeto = 0;
scalVeto = 0.0;
bVeto = 0.0;
vector<tDipolePtr> dl;
sl.extract(back_inserter(dl));
vector<tDipolePtr> dr;
sr.extract(back_inserter(dr));
double sum = 0.0;
for ( int i = 0, N = dl.size(); i < N; ++i )
for ( int j = 0, M = dr.size(); j < M; ++j )
sum += fij(*dl[i], *dr[j], b);
return sum;
}
DipoleXSec::FList
DipoleXSec::flist(const DipoleState & sl, const DipoleState & sr,
const ImpactParameters & b) const {
FList ret;
vector<tDipolePtr> dl;
sl.extract(back_inserter(dl));
vector<tDipolePtr> dr;
sr.extract(back_inserter(dr));
//dont save the lowest fij. Otherwise the FList for LHC PbPb will take too much memory.
double cutoff = min(0.00000001, 1.0/double(dl.size()*dr.size()));
if ( dl.size()*dr.size() < 1000000 ) cutoff = 0.0000000001;
int total = 0;
int skipped = 0;
for ( int i = 0, N = dl.size(); i < N; ++i ) {
for ( int j = 0, M = dr.size(); j < M; ++j ) {
double f = fij(dl[i]->partons(), dr[j]->partons(), b, false)*2.0;
//extra 2 added from the non-diffractive interaction probability.
total++;
if ( f > cutoff &&
!kinematicsVeto(dl[i]->partons(), dr[j]->partons(), b) )
ret.insert(make_pair(make_pair(f, unitarize(f)), make_pair(dl[i], dr[j])));
else skipped++;
}
}
return ret;
}
DipoleXSec::FList
DipoleXSec::effectiveFlist(const DipoleState & sl, const DipoleState & sr,
const ImpactParameters & b) const {
FList ret;
vector<tDipolePtr> dl;
sl.extract(back_inserter(dl));
vector<tDipolePtr> dr;
sr.extract(back_inserter(dr));
set< pair<pair<tPartonPtr, tPartonPtr>, pair<tPartonPtr, tPartonPtr> > >
backChecks;
double cutoff = min(0.00000001, 1.0/double(dl.size()*dr.size()));
if ( dl.size()*dr.size() < 1000000 ) cutoff = 0.0000000001;
for ( int i = 0, N = dl.size(); i < N; ++i ) {
for ( int j = 0, M = dr.size(); j < M; ++j ) {
double f = fij(dl[i]->partons(), dr[j]->partons(), b)*2.0;
//extra 2 added from the non-diffractive interaction probability.
//if vetoed, go check the previous dipoles until non-zero fij is found
tPartonPtr p11 = dl[i]->partons().first;
tPartonPtr p12 = dl[i]->partons().second;
tPartonPtr p21 = dr[j]->partons().first;
tPartonPtr p22 = dr[j]->partons().second;
while ( f == 0.0 ) {
//replace the most forward parton on each side by its parent.
bool changed = false;
if ( p11->y() > p12->y() && p11->y() > p21->y() && p11->y() > p22->y() &&
p11->parents().first ) {
p11 = p11->parents().first;
changed = true;
}
else if ( p12->y() > p21->y() && p12->y() > p22->y() && p12->parents().second ) {
p12 = p12->parents().second;
changed = true;
}
else if ( p21->y() > p22->y() && p21->parents().first ) {
p21 = p21->parents().first;
changed = true;
}
else if ( p22->parents().second ) {
p22 = p22->parents().second;
changed = true;
}
//if no replacements found, return 0
if ( !changed ) break;
//if the 4 new partons are not already checked from another fij,
//then calculate and return the new fij
pair<tPartonPtr, tPartonPtr> lp = make_pair(p11, p12);
pair<tPartonPtr, tPartonPtr> rp = make_pair(p21, p22);
if ( backChecks.find(make_pair(lp, rp)) == backChecks.end() ) {
f = fij(lp, rp, b)*2.0;
backChecks.insert(make_pair(lp, rp));
}
else {
break;
}
}
//if f is large enough to bother, save it in the flist
if ( f > cutoff )
ret.insert(make_pair(make_pair(f, unitarize(f)), make_pair(dl[i], dr[j])));
}
}
return ret;
}
DipoleXSec::InteractionRecoil
DipoleXSec::recoil(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b,
pair<pair<bool, bool>, pair<bool, bool> > doesInt) const {
return recoil(left, right, b, doesInt, int0Partons(left.first, left.second,
right.first, right.second, b));
}
DipoleXSec::InteractionRecoil
DipoleXSec::recoil(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b,
pair<pair<bool, bool>, pair<bool, bool> > doesInt,
pair<bool, bool> ints) const {
tPartonPtr p1 = left.first;
tPartonPtr p2 = left.second;
tPartonPtr p3 = right.first;
tPartonPtr p4 = right.second;
double pTScale = Current<DipoleEventHandler>()->emitter().pTScale();
if ( theInteraction == 2 ) { //swing recoil, only new dips
TransverseMomentum rec14 = -pTScale*b.difference(p1->position(), p4->position())/
( b.dist2(*p1,*p4) );
TransverseMomentum rec23 = -pTScale*b.difference(p2->position(), p3->position())/
( b.dist2(*p2,*p3) );
return make_pair(make_pair(rec14, rec23),
make_pair(-rec23, -rec14));
}
//4 parton-parton recoils (full diagonals)
if ( theInteraction == 1 ) {
TransverseMomentum rec13 = -pTScale*b.difference(p1->position(), p3->position())/
(b.dist2(*p1,*p3) );
TransverseMomentum rec14 = -pTScale*b.difference(p1->position(), p4->position())/
(b.dist2(*p1,*p4) );
TransverseMomentum rec23 = -pTScale*b.difference(p2->position(), p3->position())/
(b.dist2(*p2,*p3) );
TransverseMomentum rec24 = -pTScale*b.difference(p2->position(), p4->position())/
(b.dist2(*p2,*p4) );
return make_pair(make_pair(rec14 + rec13, rec23 + rec24),
make_pair(b.invRotatePT(-rec23 - rec13),
b.invRotatePT(-rec14 - rec24)));
}
//2 parton-parton recoils (no diagonals)
if ( theInteraction == 3 ) {
TransverseMomentum rec13 = -pTScale*b.difference(p1->position(), p3->position())/
(b.dist2(*p1,*p3) );
TransverseMomentum rec14 = -pTScale*b.difference(p1->position(), p4->position())/
(b.dist2(*p1,*p4) );
TransverseMomentum rec23 = -pTScale*b.difference(p2->position(), p3->position())/
(b.dist2(*p2,*p3) );
TransverseMomentum rec24 = -pTScale*b.difference(p2->position(), p4->position())/
(b.dist2(*p2,*p4) );
if ( doesInt.first.first && doesInt.first.second &&
doesInt.second.first && doesInt.second.second )
return make_pair(make_pair(rec14, rec23),
make_pair(b.invRotatePT(-rec23), b.invRotatePT(-rec14)));
else {
TransverseMomentum rec11 = TransverseMomentum();
if ( doesInt.first.first && doesInt.second.first ) rec11 += rec13;
if ( doesInt.first.first && doesInt.second.second ) rec11 += rec14;
TransverseMomentum rec12 = TransverseMomentum();
if ( doesInt.first.second && doesInt.second.first ) rec12 += rec23;
if ( doesInt.first.second && doesInt.second.second ) rec12 += rec24;
TransverseMomentum rec21 = TransverseMomentum();
if ( doesInt.second.first && doesInt.first.first ) rec21 -= rec13;
if ( doesInt.second.first && doesInt.first.second ) rec21 -= rec23;
TransverseMomentum rec22 = TransverseMomentum();
if ( doesInt.second.second && doesInt.first.first ) rec22 -= rec14;
if ( doesInt.second.second && doesInt.first.second ) rec22 -= rec24;
return make_pair(make_pair(rec11, rec12),
make_pair(b.invRotatePT(rec21), b.invRotatePT(rec22)));
}
}
if ( theInteraction == 0 ) { //dip-dip recoil
TransverseMomentum rec13 = -pTScale*b.difference(p1->position(), p3->position())/
(b.dist2(*p1,*p3) );
TransverseMomentum rec14 = -pTScale*b.difference(p1->position(), p4->position())/
(b.dist2(*p1,*p4) );
TransverseMomentum rec23 = -pTScale*b.difference(p2->position(), p3->position())/
(b.dist2(*p2,*p3) );
TransverseMomentum rec24 = -pTScale*b.difference(p2->position(), p4->position())/
(b.dist2(*p2,*p4) );
if ( p1->oY() + p3->oY() > p2->oY() + p4->oY() ) rec24 = TransverseMomentum();
else rec13 = TransverseMomentum();
+ // if ( p1->flavour() == ParticleID::g ) {
+ // rec13 /= 2.0;
+ // rec14 /= 2.0;
+ // }
+ // if ( p2->flavour() == ParticleID::g ) {
+ // rec23 /= 2.0;
+ // rec24 /= 2.0;
+ // }
+ // if ( p3->flavour() == ParticleID::g ) {
+ // rec13 /= 2.0;
+ // rec23 /= 2.0;
+ // }
+ // if ( p4->flavour() == ParticleID::g ) {
+ // rec14 /= 2.0;
+ // rec24 /= 2.0;
+ // }
+
TransverseMomentum rec11 = TransverseMomentum();
if ( doesInt.first.first && doesInt.second.first ) rec11 += rec13;
if ( doesInt.first.first && doesInt.second.second ) rec11 += rec14;
TransverseMomentum rec12 = TransverseMomentum();
if ( doesInt.first.second && doesInt.second.first ) rec12 += rec23;
if ( doesInt.first.second && doesInt.second.second ) rec12 += rec24;
TransverseMomentum rec21 = TransverseMomentum();
if ( doesInt.second.first && doesInt.first.first ) rec21 -= rec13;
if ( doesInt.second.first && doesInt.first.second ) rec21 -= rec23;
TransverseMomentum rec22 = TransverseMomentum();
if ( doesInt.second.second && doesInt.first.first ) rec22 -= rec14;
if ( doesInt.second.second && doesInt.first.second ) rec22 -= rec24;
return make_pair(make_pair(rec11, rec12),
make_pair(b.invRotatePT(rec21), b.invRotatePT(rec22)));
}
return make_pair(make_pair(TransverseMomentum(), TransverseMomentum()),
make_pair(TransverseMomentum(), TransverseMomentum()));
}
DipoleXSec::RealInteraction
DipoleXSec::initialiseInteraction(const pair<DipolePtr, DipolePtr> inter,
RealPartonStatePtr lrs, RealPartonStatePtr rrs,
pair<pair<bool, bool>, pair<bool, bool> > doesInt,
const ImpactParameters & b) const {
RealInteraction ret;
ret.lrs = lrs;
ret.rrs = rrs;
ret.d1 = inter.first;
ret.d2 = inter.second;
if ( doesInt.first.first ) ret.p11 = lrs->getReal(ret.d1->partons().first);
else ret.p11 = RealPartonPtr();
if ( doesInt.first.second ) ret.p12 = lrs->getReal(ret.d1->partons().second);
else ret.p12 = RealPartonPtr();
if ( doesInt.second.first ) ret.p21 = rrs->getReal(inter.second->partons().first);
else ret.p21 = RealPartonPtr();
if ( doesInt.second.second ) ret.p22 = rrs->getReal(inter.second->partons().second);
else ret.p22 = RealPartonPtr();
if ( ret.p11 && ret.p11->fluct != -1 && ret.p12 && ret.p12->fluct == ret.p11->fluct )
lrs->splitFluct(ret.p11, ret.p12);
if ( ret.p21 && ret.p21->fluct != -1 && ret.p22 && ret.p22->fluct == ret.p21->fluct )
rrs->splitFluct(ret.p21, ret.p22);
ret.range11 = sqrt(min(min(inter.first->partons().first->dist2
(*inter.second->partons().first),
inter.first->partons().first->dist2
(*inter.second->partons().second)),
inter.first->partons().first->dist2
(*inter.first->partons().second)/4.0));
ret.range12 = sqrt(min(min(inter.first->partons().second->dist2
(*inter.second->partons().first),
inter.first->partons().second->dist2
(*inter.second->partons().second)),
inter.first->partons().second->dist2
(*inter.first->partons().first)/4.0));
ret.range21 = sqrt(min(min(inter.second->partons().first->dist2
(*inter.first->partons().first),
inter.second->partons().first->dist2
(*inter.first->partons().second)),
inter.second->partons().first->dist2
(*inter.second->partons().second)/4.0));
ret.range22 = sqrt(min(min(inter.second->partons().second->dist2
(*inter.first->partons().first),
inter.second->partons().second->dist2
(*inter.first->partons().second)),
inter.second->partons().second->dist2
(*inter.second->partons().first)/4.0));
if ( theInteraction == 3 ) {
ret.range11 = sqrt(min(inter.first->partons().first->dist2
(*inter.second->partons().second),
inter.first->partons().first->dist2
(*inter.first->partons().second)/4.0));
ret.range12 = sqrt(min(inter.first->partons().second->dist2
(*inter.second->partons().first),
inter.first->partons().second->dist2
(*inter.first->partons().first)/4.0));
ret.range21 = sqrt(min(inter.second->partons().first->dist2
(*inter.first->partons().second),
inter.second->partons().first->dist2
(*inter.second->partons().second)/4.0));
ret.range22 = sqrt(min(inter.second->partons().second->dist2
(*inter.first->partons().first),
inter.second->partons().second->dist2
(*inter.second->partons().first)/4.0));
}
if ( theInteraction == 0 ) {
pair<bool, bool> ints;
ints = int0Partons(ret.d1->partons().first, ret.d1->partons().second,
inter.second->partons().first, inter.second->partons().second, b);
InvEnergy2 range2;
if ( ints.first && ints.second ) range2 = b.dist2(*ret.p11->theParton,*ret.p21->theParton);
if ( !ints.first && ints.second ) range2 = b.dist2(*ret.p12->theParton,*ret.p21->theParton);
if ( ints.first && !ints.second ) range2 = b.dist2(*ret.p11->theParton,*ret.p22->theParton);
if ( !ints.first && !ints.second ) range2 = b.dist2(*ret.p12->theParton,*ret.p22->theParton);
InvEnergy range = sqrt(range2);
ret.range11 = min(range, ret.d1->size()/2.0);
ret.range12 = min(range, ret.d1->size()/2.0);
ret.range21 = min(range, ret.d2->size()/2.0);
ret.range22 = min(range, ret.d2->size()/2.0);
if ( Current<DipoleEventHandler>()->emitter().rangeMode() == 1 ) {
ret.range11 = ret.d1->size()/2.0;
ret.range12 = ret.d1->size()/2.0;
ret.range21 = ret.d2->size()/2.0;
ret.range22 = ret.d2->size()/2.0;
}
}
InvEnergy2 rr11 = (ret.p11 && ret.p21) ? ret.p11->theParton->dist2(*ret.p21->theParton):ZERO;
InvEnergy2 rr12 = (ret.p11 && ret.p22) ? ret.p11->theParton->dist2(*ret.p22->theParton):ZERO;
InvEnergy2 rr21 = (ret.p12 && ret.p21) ? ret.p12->theParton->dist2(*ret.p21->theParton):ZERO;
InvEnergy2 rr22 = (ret.p12 && ret.p22) ? ret.p12->theParton->dist2(*ret.p22->theParton):ZERO;
InvEnergy2 rm11 = (ret.p11 && ret.p11->mothers.first ?
ret.p11->theParton->dist2(*ret.p11->mothers.first->theParton):ZERO);
InvEnergy2 rm12 = (ret.p12 && ret.p12->mothers.first ?
ret.p12->theParton->dist2(*ret.p12->mothers.first->theParton):ZERO);
InvEnergy2 rm21 = (ret.p21 && ret.p21->mothers.first ?
ret.p21->theParton->dist2(*ret.p21->mothers.first->theParton):ZERO);
InvEnergy2 rm22 = (ret.p22 && ret.p22->mothers.first ?
ret.p22->theParton->dist2(*ret.p22->mothers.first->theParton):ZERO);
ret.max11 = rr11 < rm11 && rr11 < rm21;
ret.max12 = rr12 < rm11 && rr12 < rm22;
ret.max21 = rr21 < rm12 && rr21 < rm21;
ret.max22 = rr22 < rm12 && rr22 < rm22;
Energy2 den = ((ret.p11 ? 1./rr11:ZERO) + (ret.p12 ? 1./rr12:ZERO)
+ (ret.p21 ? 1./rr21:ZERO) + (ret.p22 ? 1./rr22:ZERO));
ret.P11 = ret.p11 ? (1./rr11)/den:ZERO;
ret.P12 = ret.p12 ? (1./rr12)/den:ZERO;
ret.P21 = ret.p21 ? (1./rr21)/den:ZERO;
ret.P22 = ret.p22 ? (1./rr22)/den:ZERO;
//look only at the new dipole pairs, the cross pairs get zero weight.
if ( theInteraction == 3 ) {
den = (1./rr12 + 1./rr21);
ret.P12 = (1./rr12)/den;
ret.P21 = (1./rr21)/den;
ret.P11 = 0.0;
ret.P22 = 0.0;
}
//set only the selected pair to weight 1, the others to 0.
if ( theInteraction == 0 ) {
pair<bool, bool> ints;
ints = int0Partons(inter.first->partons().first, inter.first->partons().second,
inter.second->partons().first, inter.second->partons().second, b);
ret.P11 = 0.0;
ret.P22 = 0.0;
ret.P21 = 0.0;
ret.P12 = 0.0;
if ( ints.first && ints.second ) ret.P11 = 1.0;
if ( ints.first && !ints.second ) ret.P12 = 1.0;
if ( !ints.first && ints.second ) ret.P21 = 1.0;
if ( !ints.first && !ints.second ) ret.P22 = 1.0;
}
return ret;
}
pair<pair<bool, bool>, pair<bool, bool> >
DipoleXSec::doesInt(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b) const {
//decide which of the 4 partons will end up on shell
return make_pair(make_pair(true, true), make_pair(true, true));
if ( Current<DipoleEventHandler>()->eventFiller().singleMother() ) {
//when single mother not all are chosen
pair<pair<bool, bool>, pair<bool, bool> > ret =
make_pair(make_pair(false, false), make_pair(false, false));
if ( theInteraction == 0 ) {
//if interaction 0, then always keep the same partons used in fij
pair<bool, bool> ints;
ints = int0Partons(left.first, left.second, right.first, right.second, b);
if ( ints.first ) ret.first.first = true;
else ret.first.second = true;
if ( ints.second ) ret.second.first =true;
else ret.second.second = true;
}
else {
//select which two partons the gluons are exchanged between,
//weighted by 1/distance^2
InvEnergy2 r11 = b.dist2(*left.first, *right.first);
InvEnergy2 r12 = b.dist2(*left.first, *right.second);
InvEnergy2 r21 = b.dist2(*left.second, *right.first);
InvEnergy2 r22 = b.dist2(*left.second, *right.second);
Selector<int, double> sel;
sel.insert(1./r11/(1./r11 + 1./r12 + 1./r21 + 1./r22), 1);
sel.insert(1./r12/(1./r11 + 1./r12 + 1./r21 + 1./r22), 2);
sel.insert(1./r21/(1./r11 + 1./r12 + 1./r21 + 1./r22), 3);
sel.insert(1./r22/(1./r11 + 1./r12 + 1./r21 + 1./r22), 4);
double dummy = (r11 + r22 + r12 + r21)*sqr(GeV);
double pseudoRnd = 10000.0*dummy - int(10000.0*dummy);
switch ( sel[pseudoRnd] ) {
case 1:
ret.first.first = true;
ret.second.first = true;
break;
case 2:
ret.first.first = true;
ret.second.second = true;
break;
case 3:
ret.first.second = true;
ret.second.first = true;
break;
case 4:
ret.first.second = true;
ret.second.second = true;
break;
}
}
//check for swinged emission, in which case both partons are real
if ( !(left.first->parents().second == left.second ||
left.second->parents().first == left.first) ) {
ret.first.first = true;
ret.first.second = true;
}
if ( !(right.first->parents().second == right.second ||
right.second->parents().first == right.first) ) {
ret.second.first = true;
ret.second.second = true;
}
return ret;
}
//if not single mother, all partons are on shell
return make_pair(make_pair(true, true), make_pair(true, true));
}
pair<bool, bool> DipoleXSec::int0Partons(tcPartonPtr p11, tcPartonPtr p12,
tcPartonPtr p21, tcPartonPtr p22,
const ImpactParameters & b) const {
//chose partons (pseudo-)randomly
InvEnergy2 rr11 = b.dist2(*p11, *p21);
InvEnergy2 rr22 = b.dist2(*p12, *p22);
double dummy = (rr11 + rr22)*GeV2;
while ( dummy > 100 ) dummy /= 10;
bool firstDipole = (1000000.0*dummy - long(1000000.0*dummy) > 0.5 );
bool secondDipole = (10000000.0*dummy - long(10000000.0*dummy) > 0.5 );
return make_pair(firstDipole, secondDipole);
}
void DipoleXSec::updateMomenta(RealInteraction * i) const {
if ( i->p11 ) {
pair<Energy, Energy> pm11 = i->p11->effectivePlusMinus(i->range11, true);
i->effectivePlus11 = pm11.first;
i->effectiveMinus11 = pm11.second;
}
if ( i->p12 ) {
pair<Energy, Energy> pm12 = i->p12->effectivePlusMinus(i->range12, false);
i->effectivePlus12 = pm12.first;
i->effectiveMinus12 = pm12.second;
}
if ( i->p21 ) {
pair<Energy, Energy> pm21 = i->p21->effectivePlusMinus(i->range21, true);
i->effectivePlus21 = pm21.first;
i->effectiveMinus21 = pm21.second;
}
if ( i->p22 ) {
pair<Energy, Energy> pm22 = i->p22->effectivePlusMinus(i->range22, false);
i->effectivePlus22 = pm22.first;
i->effectiveMinus22 = pm22.second;
}
}
void DipoleXSec::doTransverseRecoils(RealInteraction i, InteractionRecoil recs) const {
if ( Current<DipoleEventHandler>()->eventFiller().mode() != 1 ) {
i.lrs->totalRecoil += recs.first.first + recs.first.second;
i.rrs->totalRecoil += recs.second.first + recs.second.second;
if ( i.p11 ) i.p11->intRecoil += recs.first.first;
if ( i.p12 ) i.p12->intRecoil += recs.first.second;
if ( i.p21 ) i.p21->intRecoil += recs.second.first;
if ( i.p22 ) i.p22->intRecoil += recs.second.second;
}
if ( i.p11 ) {
if ( i.p22 ) i.p22->doEffectiveRecoil(i.p11, i.range11, true, ZERO, -recs.first.first);
else i.p21->doEffectiveRecoil(i.p11, i.range11, true, ZERO, -recs.first.first);
}
if ( i.p12 ) {
if ( i.p22 ) i.p22->doEffectiveRecoil(i.p12, i.range12, false, ZERO, -recs.first.second);
else i.p21->doEffectiveRecoil(i.p12, i.range12, false, ZERO, -recs.first.second);
}
if ( i.p21 ) {
if ( i.p12 ) i.p12->doEffectiveRecoil(i.p21, i.range21, true, ZERO, -recs.second.first);
else i.p11->doEffectiveRecoil(i.p21, i.range21, true, ZERO, -recs.second.first);
}
if ( i.p22 ) {
if ( i.p11 ) i.p11->doEffectiveRecoil(i.p22, i.range22, false, ZERO, -recs.second.second);
else i.p12->doEffectiveRecoil(i.p22, i.range22, false, ZERO, -recs.second.second);
}
}
pair<double, double> DipoleXSec::findBoosts(RealInteraction i) const {
Energy neededMinus = ZERO;
if ( checkOffShell ) neededMinus += i.lrs->neededValenceMinus();
if ( i.p11 ) neededMinus += i.p11->effectiveGiveMinus(i.range11, true);
if ( i.p12 ) neededMinus += i.p12->effectiveGiveMinus(i.range12, false);
Energy neededPlus = ZERO;
if ( checkOffShell ) neededPlus += i.rrs->neededValenceMinus();
if ( i.p21 ) neededPlus += i.p21->effectiveGiveMinus(i.range21, true);
if ( i.p22 ) neededPlus += i.p22->effectiveGiveMinus(i.range22, false);
Energy intPlus1 = ZERO;
if ( i.p11 ) intPlus1 += i.effectivePlus11;
if ( i.p12 ) intPlus1 += i.effectivePlus12;
Energy intPlus2 = ZERO;
if ( i.p21 ) intPlus2 += i.p21->inRangeMinus(i.range21, true);
if ( i.p22 ) intPlus2 += i.p22->inRangeMinus(i.range22, false);
Energy intMinus1 = ZERO;
if ( i.p11 ) intMinus1 += i.p11->inRangeMinus(i.range11, true);
if ( i.p12 ) intMinus1 += i.p12->inRangeMinus(i.range12, false);
Energy intMinus2 = ZERO;
if ( i.p21 ) intMinus2 += i.effectivePlus21;
if ( i.p22 ) intMinus2 += i.effectivePlus22;
Energy evoPlus2 = neededPlus - intPlus2;
Energy evoMinus1 = neededMinus - intMinus1;
pair<double, double> boosts = findBoosts(intPlus1, intPlus2, intMinus1, intMinus2, evoPlus2, evoMinus1);
if ( boosts.first == 0.0 || isnan(boosts.first) || isnan(boosts.second) ) {
return make_pair(0.0,0.0);
}
if ( boosts.second < 0.0 || boosts.first < 0.0 ) {
//can be over 1.0 if the valenceminus is more than needed
return make_pair(0.0,0.0);;
}
return boosts;
}
void DipoleXSec::doBoosts(RealInteraction i, pair<double, double> boosts) const {
doBoost(i.p11, i.range11, i.p12, i.range12, boosts.first);
doBoost(i.p21, i.range21, i.p22, i.range22, boosts.second);
}
void DipoleXSec::reduceRecoil(RealInteraction RI, InteractionRecoil recs) const {
//check if the interacting partons have passed each other
while ( max((RI.p11 ? RI.p11->y:RI.p12->y), (RI.p12 ? RI.p12->y:RI.p11->y)) >
-max((RI.p21 ? RI.p21->y:RI.p22->y), (RI.p22 ? RI.p22->y:RI.p21->y)) ) {
//and if the recoil is larger than 1 GeV
if ( max(max(recs.first.first.pt(), recs.first.second.pt()),
max(recs.second.first.pt(), recs.second.second.pt())) < 1*GeV ) {
break;
}
//then undo the recoil and redo 90% of it.
recs = make_pair(make_pair(-recs.first.first, -recs.first.second),
make_pair(-recs.second.first, -recs.second.second));
doTransverseRecoils(RI, recs);
recs = make_pair(make_pair(-recs.first.first*0.9, -recs.first.second*0.9),
make_pair(-recs.second.first*0.9, -recs.second.second*0.9));
doTransverseRecoils(RI, recs);
}
}
bool DipoleXSec::doInteraction(InteractionRecoil recs, const FList::const_iterator inter,
RealPartonStatePtr lrs, RealPartonStatePtr rrs,
pair<pair<bool, bool>, pair<bool, bool> > doesInt,
const ImpactParameters & b) const {
static DebugItem checkkinematics("DIPSY::CheckKinematics", 6);
if ( checkkinematics && lrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found at start of interaction!" << Exception::warning;
if ( checkkinematics && rrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found at start of interaction!" << Exception::warning;
RealInteraction RI = initialiseInteraction(inter->second, lrs, rrs, doesInt, b);
doTransverseRecoils(RI, recs);
if ( checkkinematics && lrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after transverse recoil in interaction!" << Exception::warning;
if ( checkkinematics && rrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after transverse recoil in interaction!" << Exception::warning;
if ( theRecoilReduction ) {
reduceRecoil(RI, recs);
}
if ( checkkinematics && lrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after recoil reduction in interaction!" << Exception::warning;
if ( checkkinematics && rrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after recoil reduction in interaction!" << Exception::warning;
updateMomenta(& RI);
if ( checkkinematics && lrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after update in interaction!" << Exception::warning;
if ( checkkinematics && rrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after update in interaction!" << Exception::warning;
pair<double, double> boosts = findBoosts(RI);
if ( boosts.first == 0.0 ) {
return false;
}
doBoosts(RI, boosts);
if ( checkkinematics && lrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after boost in interaction!" << Exception::warning;
if ( checkkinematics && rrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found after boost in interaction!" << Exception::warning;
if ( ordered(RI, recs, b) ) {
setOnShell(RI);
if ( checkkinematics && lrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found at end of interaction!" << Exception::warning;
if ( checkkinematics && rrs->checkForNegatives() )
Throw<InteractionKinematicException>()
<< "negatives found at end of interaction!" << Exception::warning;
return true;
}
return false;
}
bool DipoleXSec::checkInteractions(DipolePairVector & ints, RealPartonStatePtr lrs,
RealPartonStatePtr rrs, const ImpactParameters & b) const {
bool ok = true;
list<pair<RealInteraction, pair<double, double> > > boostList;
for ( int i = 0; i < int(ints.size()); i++ ) {
RealInteraction RI = initialiseInteraction(ints[i]->second, lrs, rrs,
make_pair(make_pair(true, true),make_pair(true, true)), b);
InteractionRecoil recs = recoil(ints[i]->second.first->partons(),
ints[i]->second.second->partons(), b,
make_pair(make_pair(true, true), make_pair(true, true)));
doTransverseRecoils(RI, recs);
updateMomenta(& RI);
pair<double, double> boosts = findBoosts(RI);
if ( boosts.first == 0.0 ) {
undoPTRecoils(RI);
ok = false;
break;
}
doBoosts(RI, boosts);
boostList.push_back(make_pair(RI, boosts));
if ( !ordered(RI, recs, b) ) {
ok = false;
break;
}
}
for ( list<pair<RealInteraction, pair<double, double> > >::iterator it = boostList.begin();
it != boostList.end(); it++ ) {
pair<double, double> inverse = make_pair(1.0/it->second.first, 1.0/it->second.second);
doBoosts(it->first, inverse);
undoPTRecoils(it->first);
}
return ok;
}
void DipoleXSec::undoPTRecoils(RealInteraction RI) const {
RI.p11->undoInteractionRecoils();
RI.p12->undoInteractionRecoils();
RI.p21->undoInteractionRecoils();
RI.p22->undoInteractionRecoils();
}
bool DipoleXSec::performInteractions(DipolePairVector & ints, RealPartonStatePtr lrs,
RealPartonStatePtr rrs, const ImpactParameters & b) const {
return true;
}
bool DipoleXSec::ordered(RealInteraction i, InteractionRecoil recs,
const ImpactParameters & b) const {
//this options means only momentum conservation, and that is already checked by
//finding a boost. no extra ordering wanted.
if ( theIntOrdering == 2 ) {
return true;
}
double PSInf = Current<DipoleEventHandler>()->emitter().PSInflation();
bool ordered = true;
bool both = Current<DipoleEventHandler>()->emitter().bothOrderedFS();
//if not a local pt max, check p+- ordering
if ( theIntOrdering == 0 ) {
if ( theInteraction == 0 ) {
//check ordering only for the key partons
pair<bool, bool> ints0 = int0Partons(i.d1->partons().first, i.d1->partons().second,
i.d2->partons().first, i.d2->partons().second, b);
Energy effMinus1 = (ints0.first ? i.effectiveMinus11:i.effectiveMinus12);
Energy effMinus2 = (ints0.second ? i.effectiveMinus21:i.effectiveMinus22);
Energy effPlus1 = (ints0.first ? i.effectivePlus11:i.effectivePlus12);
Energy effPlus2 = (ints0.second ? i.effectivePlus21:i.effectivePlus22);
if ( effPlus1*PSInf < effMinus2 ) ordered = false;
if ( effPlus2*PSInf < effMinus1 ) ordered = false;
}
else {
if ( !i.max11 && i.p11 && i.p21 ) {
if ( i.effectivePlus11*PSInf < i.effectiveMinus21*(both ? 1.0:i.P11) ) ordered = false;
if ( (both ? 1.0:i.P11)*i.effectiveMinus11/PSInf > i.effectivePlus21 ) ordered = false;
}
if ( !i.max12 && i.p11 && i.p22 ) {
if ( i.effectivePlus11*PSInf < i.effectiveMinus22*(both ? 1.0:i.P12) ) ordered = false;
if ( (both ? 1.0:i.P12)*i.effectiveMinus11/PSInf > i.effectivePlus22 ) ordered = false;
}
if ( !i.max21 && i.p12 && i.p21 ) {
if ( i.effectivePlus12*PSInf < i.effectiveMinus21*(both ? 1.0:i.P21) ) ordered = false;
if ( (both ? 1.0:i.P21)*i.effectiveMinus12/PSInf > i.effectivePlus21 ) ordered = false;
}
if ( !i.max22 && i.p12 && i.p22 ) {
if ( i.effectivePlus12*PSInf < i.effectiveMinus22*(both ? 1.0:i.P22) ) ordered = false;
if ( (both ? 1.0:i.P22)*i.effectiveMinus12/PSInf > i.effectivePlus22 ) ordered = false;
}
}
}
if ( theIntOrdering == 1 && theInteraction == 0 ) {
double PMOrd = Current<DipoleEventHandler>()->emitter().PMinusOrdering();
//check ordering only for the key partons
pair<bool, bool> ints0 = int0Partons(i.d1->partons().first, i.d1->partons().second,
i.d2->partons().first, i.d2->partons().second, b);
Energy effMinus1 = (ints0.first ? i.effectiveMinus11:i.effectiveMinus12);
Energy effMinus2 = (ints0.second ? i.effectiveMinus21:i.effectiveMinus22);
Energy rec1 = (ints0.first ? recs.first.first.pt():recs.first.second.pt());
Energy rec2 = (ints0.second ? recs.second.first.pt():recs.second.second.pt());
if ( sqr(max(rec1, rec2)*PSInf) < effMinus1*effMinus2*PMOrd ) ordered = false;
}
if ( (i.p11 && i.p11->searchNegative(i.range11, true)) ||
(i.p12 && i.p12->searchNegative(i.range12, false)) ||
(i.p21 && i.p21->searchNegative(i.range21, true)) ||
(i.p22 && i.p22->searchNegative(i.range22, false)) )
ordered = false;
return ordered;
}
void DipoleXSec::setOnShell(RealInteraction i) const {
if ( i.p11 ) i.p11->effectiveGiveMinus(i.range11, true);
if ( i.p12 ) i.p12->effectiveGiveMinus(i.range12, false);
if ( i.p21 ) i.p21->effectiveGiveMinus(i.range21, true);
if ( i.p22 ) i.p22->effectiveGiveMinus(i.range22, false);
}
bool DipoleXSec::checkOrderedInteraction(tRealPartonPtr p11, tRealPartonPtr p12,
tRealPartonPtr p21, tRealPartonPtr p22) const {
InvEnergy range11 = sqrt(min(min(p11->theParton->dist2(*p21->theParton),
p11->theParton->dist2(*p22->theParton)),
p11->theParton->dist2(*p12->theParton)/4.0));
InvEnergy range12 = sqrt(min(min(p12->theParton->dist2(*p21->theParton),
p12->theParton->dist2(*p22->theParton)),
p12->theParton->dist2(*p11->theParton)/4.0));
InvEnergy range21 = sqrt(min(min(p21->theParton->dist2(*p11->theParton),
p21->theParton->dist2(*p12->theParton)),
p21->theParton->dist2(*p22->theParton)/4.0));
InvEnergy range22 = sqrt(min(min(p22->theParton->dist2(*p11->theParton),
p22->theParton->dist2(*p12->theParton)),
p22->theParton->dist2(*p21->theParton)/4.0));
pair<Energy, Energy> pm11 = p11->effectivePlusMinus(range11, true);
pair<Energy, Energy> pm12 = p12->effectivePlusMinus(range12, false);
pair<Energy, Energy> pm21 = p21->effectivePlusMinus(range21, true);
pair<Energy, Energy> pm22 = p22->effectivePlusMinus(range22, false);
InvEnergy2 rr11 = p11->theParton->dist2(*p21->theParton);
InvEnergy2 rr12 = p11->theParton->dist2(*p22->theParton);
InvEnergy2 rr21 = p12->theParton->dist2(*p21->theParton);
InvEnergy2 rr22 = p12->theParton->dist2(*p22->theParton);
bool max11 = p11->mothers.first && rr11 < p11->theParton->dist2(*p11->mothers.first->theParton) &&
p21->mothers.first && rr11 < p21->theParton->dist2(*p21->mothers.first->theParton);
bool max12 = p11->mothers.first && rr12 < p11->theParton->dist2(*p11->mothers.first->theParton) &&
p22->mothers.first && rr12 < p22->theParton->dist2(*p22->mothers.first->theParton);
bool max21 = p12->mothers.first && rr21 < p21->theParton->dist2(*p21->mothers.first->theParton) &&
p21->mothers.first && rr21 < p21->theParton->dist2(*p21->mothers.first->theParton);
bool max22 = p12->mothers.first && rr22 < p12->theParton->dist2(*p12->mothers.first->theParton) &&
p22->mothers.first && rr22 < p22->theParton->dist2(*p22->mothers.first->theParton);
Energy2 den = (1./rr11 + 1./rr12 + 1./rr21 + 1./rr22);
double P11 = (1./rr11)/den;
double P12 = (1./rr12)/den;
double P21 = (1./rr21)/den;
double P22 = (1./rr22)/den;
double PSInf = Current<DipoleEventHandler>()->emitter().PSInflation();
bool ordered = true;
//if p11-p22 is not a local pt max, check p+- ordering
if ( !max11 ) {
if ( pm11.first*PSInf/P11 < pm21.second ) ordered = false;
if ( P11*pm11.second/PSInf > pm21.first ) ordered = false;
}
if ( !max12 ) {
if ( pm11.first*PSInf/P12 < pm22.second ) ordered = false;
if ( P12*pm11.second/PSInf > pm22.first ) ordered = false;
}
if ( !max21 ) {
if ( pm12.first*PSInf/P21 < pm21.second ) ordered = false;
if ( P21*pm12.second/PSInf > pm21.first ) ordered = false;
}
if ( !max22 ) {
if ( pm12.first*PSInf/P22 < pm22.second ) ordered = false;
if ( P22*pm12.second/PSInf > pm22.first ) ordered = false;
}
return ordered;
}
bool DipoleXSec::reconnect(tDipolePtr d1, tDipolePtr d2) const {
if ( d1->children().second && !d1->children().first ) {
return reconnect(d1->children().second, d2);
}
if ( d2->children().second && !d2->children().first ) {
return reconnect(d1, d2->children().second);
}
if ( !d1->children().first && !d2->children().first ) { //none has rescattered
d1->swingDipole(d2);
Current<DipoleEventHandler>()->swinger().recombine(*d1);
- d1->children().first->interact(*d2->children().first);
- d2->children().first->interact(*d1->children().first);
+ interact(*d1->children().first, *d2->children().first);
+ // d1->children().first->interact(*d2->children().first);
+ // d2->children().first->interact(*d1->children().first);
return true;
}
tPartonPtr p11 = d1->partons().first;
tPartonPtr p12 = d1->partons().second;
tPartonPtr p21 = d2->partons().first;
tPartonPtr p22 = d2->partons().second;
tDipolePtr d11 = p11->dipoles().second;
tDipolePtr d12 = p12->dipoles().first;
tDipolePtr d21 = p21->dipoles().second;
tDipolePtr d22 = p22->dipoles().first;
tDipolePtr swing1;
tDipolePtr swing2;
if ( d11 == d12 ) d1 = d11; //dipole has swinged back
if ( d21 == d22 ) d2 = d21;
if ( !d1->children().first && !d2->children().first ) { //both are original dipole
swing1 = d1;
swing2 = d2;
}
else if ( d1->children().first && !d2->children().first ) { //one dip d1 is rescattering
tDipolePtr temp = d1;
d1 = d2;
d2 = temp;
p11 = d1->partons().first;
p12 = d1->partons().second;
p21 = d2->partons().first;
p22 = d2->partons().second;
d11 = p11->dipoles().second;
d12 = p12->dipoles().first;
d21 = p21->dipoles().second;
d22 = p22->dipoles().first;
}
if ( !d1->children().first && d2->children().first ) { //one dip d2 is rescattering
if ( p11 != d21->partons().second && p12 != d22->partons().first ) {
//no connections, swing with one of the two randomly
swing1 = d1;
if ( UseRandom::rnd() > 0.5 ) swing2 = d21;
else swing2 = d22;
}
else if ( p11 == d21->partons().second && p12 != d22->partons().first ) {
//share one swinged dip, swing with the other
swing1 = d1;
swing2 = d22;
}
else if ( p11 != d21->partons().second && p12 == d22->partons().first ) {
//share other swinged dip, swing with the first
swing1 = d1;
swing2 = d21;
}
else if ( p11 == d21->partons().second && p12 == d22->partons().first ) {
//share both swinged dip, swing back to original
swing1 = d21;
swing2 = d22;
}
}
else if ( d1->children().first && d2->children().first ) { //both dips are rescattering
bool found = false;
int i = 0;
while ( !found && i < 1000 ) {
if ( UseRandom::rnd() > 0.5 ) swing1 = d11;
else swing1 = d12;
if ( UseRandom::rnd() > 0.5 ) swing2 = d21;
else swing2 = d22;
if ( swing1 != swing2 && swing1->partons().first != swing2->partons().second &&
swing2->partons().first != swing1->partons().second )
found = true;
}
}
if ( !swing1 || !swing2 ) {
d1->dipoleState().diagnosis(true);
return false;
}
swing1->swingDipole(swing2);
Current<DipoleEventHandler>()->swinger().recombine(*swing1);
- swing1->children().first->interact(*swing2->children().first);
- swing2->children().first->interact(*swing1->children().first);
+ interact(*swing1->children().first, *swing2->children().first);
+ // swing1->children().first->interact(*swing2->children().first);
+ // swing2->children().first->interact(*swing1->children().first);
return true;
}
- vector<pair<DipolePtr, DipolePtr> >
- DipoleXSec::getColourExchanges(tRealPartonStatePtr lrs, tRealPartonStatePtr rrs) const {
- vector<pair<DipolePtr, DipolePtr> > ret;
- while ( ret.empty() ) {
- list<tDipolePtr>::iterator rightDip = rrs->interactions.begin();
- for ( list<tDipolePtr>::iterator leftDip = lrs->interactions.begin();
- leftDip != lrs->interactions.end(); leftDip++, rightDip++ ) {
+void DipoleXSec::interact(Dipole & d1, Dipole & d2) const {
+ d1.interact(d2, partonicInteraction());
+ d2.interact(d1, partonicInteraction());
+}
+
+vector<pair<DipolePtr, DipolePtr> >
+DipoleXSec::getColourExchanges(tRealPartonStatePtr lrs, tRealPartonStatePtr rrs) const {
+ vector<pair<DipolePtr, DipolePtr> > ret;
+ while ( ret.empty() ) {
+ list<tDipolePtr>::iterator rightDip = rrs->interactions.begin();
+ for ( list<tDipolePtr>::iterator leftDip = lrs->interactions.begin();
+ leftDip != lrs->interactions.end(); leftDip++, rightDip++ ) {
if ( unitarize(fij((*leftDip)->partons(), (*rightDip)->partons(),
ImpactParameters(), false))*0.99
- < UseRandom::rnd() || true )
- ret.push_back(make_pair(*leftDip, *rightDip));
- }
+ < UseRandom::rnd() || true )
+ ret.push_back(make_pair(*leftDip, *rightDip));
}
- return ret;
}
+ return ret;
+}
pair< double, double> DipoleXSec::findBoosts(Energy intPlus1, Energy intPlus2,
Energy intMinus1, Energy intMinus2,
Energy evoPlus2, Energy evoMinus1) const {
Energy2 A = (intPlus1 - evoPlus2)*intMinus2;
Energy2 B = intPlus1*(evoMinus1 + intMinus1 - intMinus2) -
evoPlus2*(evoMinus1 - intMinus2) - intPlus2*intMinus2;
Energy2 C = -intPlus2*(evoMinus1 - intMinus2);
if ( sqr(B/(2*A)) - C/A < 0.0 ) return make_pair(0.0, 0.0);
double y = -B/(2*A) + sqrt(sqr(B/(2*A)) - C/A); //is the + sqrt() always the right solution?
double x = 1.0 - intPlus2/(y*intPlus1) - evoPlus2/intPlus1;
return make_pair(x, y);
}
void DipoleXSec::doBoost(tRealPartonPtr p1, InvEnergy range1,
tRealPartonPtr p2, InvEnergy range2, double x) const {
//we here have to use the plusweighted recoil to fit the x, y above.
//Other weights get a lot more complicated equations for the boosts.
if ( p1 ) {
pair<Energy, Energy> pm1 = p1->effectivePlusMinus(range1, true);
p1->doPlusWeightedRecoil(p1, range1, true, (1.0 - x)*pm1.first, TransverseMomentum());
}
if ( p2 ) {
pair<Energy, Energy> pm2 = p2->effectivePlusMinus(range2, false);
p2->doPlusWeightedRecoil(p2, range2, false, (1.0 - x)*pm2.first, TransverseMomentum());
}
}
double DipoleXSec::unitarize(double f) const {
return Math::exp1m(-f);
}
void DipoleXSec::persistentOutput(PersistentOStream & os) const {
- os << ounit(theRMax, InvGeV) << theInteraction << theIntOrdering
- << theRecoilReduction << checkOffShell;
+ os << ounit(theRMax, InvGeV) << theInteraction << usePartonicInteraction
+ << theIntOrdering << theRecoilReduction << checkOffShell;
}
void DipoleXSec::persistentInput(PersistentIStream & is, int) {
- is >> iunit(theRMax, InvGeV) >> theInteraction >> theIntOrdering
- >> theRecoilReduction >> checkOffShell;
+ is >> iunit(theRMax, InvGeV) >> theInteraction >> usePartonicInteraction
+ >> theIntOrdering >> theRecoilReduction >> checkOffShell;
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<DipoleXSec,HandlerBase>
describeDIPSYDipoleXSec("DIPSY::DipoleXSec", "libAriadne5.so libDIPSY.so");
void DipoleXSec::Init() {
static ClassDocumentation<DipoleXSec> documentation
("There is no documentation for the DipoleXSec class");
static Parameter<DipoleXSec,InvEnergy> interfaceRMax
("RMax",
"The confinement scale (in iverse GeV). If set to zero, "
"the value of <interface>DipoleEventHandler::RMax</interface> of the "
"controlling event handler will be used.",
&DipoleXSec::theRMax, InvGeV, 0.0*InvGeV, 0.0*InvGeV, 0*InvGeV,
true, false, Interface::lowerlim);
static Parameter<DipoleXSec, int> interfaceInteraction
("Interaction",
"Which interaction to be used. Determines f_{ij} and recoils. "
"0 is the sinus interaction with 4 identical recoils"
"1 is the sinus interaction with recoils between all 4 parton pairs"
"2 is the swing interaction"
"3 is the sinus interaction with recoils between the 2 parton pairs"
" that get the new dipoles",
&DipoleXSec::theInteraction, 1, 1, 0, 0,
true, false, Interface::lowerlim);
static Switch<DipoleXSec,int> interfaceIntOrdering
("IntOrdering",
"How the real state is found from the virtual cascade. Speed versus consistency.",
&DipoleXSec::theIntOrdering, 0, true, false);
static SwitchOption interfaceIntOrderingDefault
(interfaceIntOrdering,
"Default",
"plus and minus reuired to be ordered after all recoils.",
0);
static SwitchOption interfaceIntOrderingAsEvo
(interfaceIntOrdering,
"AsEvo",
"Try to emulate the ordering in the evolution by requesting ordering"
" on the colliding particle if it would've been part of the cascade."
" That is, ignore recoils from the colliding cascade.",
1);
static SwitchOption interfaceIntOrderingVeryOpen
(interfaceIntOrdering,
"VeryOpen",
"Only checks that there is enough energy to put the interaction recoil on shell."
" Does not care about ordering, or setting evolution pt on shell. Same as Emils code.",
2);
static Switch<DipoleXSec,int> interfaceRecoilReduction
("RecoilReduction",
"What to do with large recoils",
&DipoleXSec::theRecoilReduction, 0, true, false);
static SwitchOption interfaceRecoilReductionOff
(interfaceRecoilReduction,
"Off",
"Do nothing special.",
0);
static SwitchOption interfaceRecoilReductionRapidityOrdered
(interfaceRecoilReduction,
"RapidityOrdered",
"Reduce the recoil until all interacting partons are rapidity ordered with each other.",
1);
static Switch<DipoleXSec,bool> interfaceCheckOffShell
("CheckOffShell",
"Make sure there is energy available to put incoming particles on-shell. Only necessary for virtual photons.",
&DipoleXSec::checkOffShell, true, true, false);
static SwitchOption interfaceCheckOffShellYes
(interfaceCheckOffShell,
"Yes",
"Do the check",
true);
static SwitchOption interfaceCheckOffShellNo
(interfaceCheckOffShell,
"No",
"No check is made.",
false);
+ static Switch<DipoleXSec,bool> interfacePartonicInteraction
+ ("PartonicInteraction",
+ "Flag determining if only one parton in each dipole is considered interacting or both.",
+ &DipoleXSec::usePartonicInteraction, false, true, false);
+ static SwitchOption interfacePartonicInteractionDipole
+ (interfacePartonicInteraction,
+ "Dipole",
+ "The both partons in a dipole interact.",
+ false);
+ static SwitchOption interfacePartonicInteractionParton
+ (interfacePartonicInteraction,
+ "Parton",
+ "Only one parton in a dipole interacts.",
+ true);
+
}
diff --git a/DIPSY/DipoleXSec.h b/DIPSY/DipoleXSec.h
--- a/DIPSY/DipoleXSec.h
+++ b/DIPSY/DipoleXSec.h
@@ -1,430 +1,554 @@
// -*- C++ -*-
#ifndef DIPSY_DipoleXSec_H
#define DIPSY_DipoleXSec_H
//
// This is the declaration of the DipoleXSec class.
//
#include "ThePEG/Handlers/HandlerBase.h"
#include "DipoleXSec.fh"
#include "Dipole.fh"
#include "DipoleState.fh"
#include "ImpactParameters.h"
#include "RealPartonState.fh"
#include "RealParton.fh"
#include "EffectiveParton.h"
namespace DIPSY {
using namespace ThePEG;
/**
* DipoleXSec is the base class of all objects capable of calculating
* the scattering probability for two colliding dipoles. The main
* virtual functions to be overridden are called fij, sumf and flist.
*
* @see \ref DipoleXSecInterfaces "The interfaces"
* defined for DipoleXSec.
*/
class DipoleXSec: public HandlerBase {
public:
/**
* A maptype used to store an ordered list of scattering
* probabilities (the bare one paired with the unitarized one)
* between dipoles in colliding dipole systems.
*/
typedef multimap<pair<double,double>, pair<tDipolePtr,tDipolePtr>,
std::greater< pair<double,double> > > FList;
/**
* Interaction pT of the four partons involved in an interaction. Default order is
* the first and second parton in colour order from the left state first,
* then the first and second parton from right state.
*/
typedef pair< pair<TransverseMomentum, TransverseMomentum>,
pair<TransverseMomentum, TransverseMomentum> > InteractionRecoil;
/**
* A vector of dipole pairs represented as iterators into an FList.
*/
typedef vector<FList::const_iterator> DipolePairVector;
/**
* An ordered map of dipole pairs represented as iterators into an
* FList.
*/
typedef multimap<double,FList::const_iterator,std::greater<double> >
DipolePairMap;
+
+ /**
+ * A dipole-dipole interaction used for book keeping.
+ */
+ struct DipoleInteraction {
+
+ /**
+ * Constructor taking two dipoles.
+ */
+ DipoleInteraction(const Dipole & dlin, const Dipole & drin);
+
+ /**
+ * The two dipoles.
+ */
+ pair<tcDipolePtr,tcDipolePtr> dips;
+
+ /**
+ * Which partons are actually interacting?
+ */
+ pair< pair<bool,bool>, pair<bool,bool> > ints;
+
+ /**
+ * The interaction strength.
+ */
+ double f;
+
+ /**
+ * The unitarized interaction strength.
+ */
+ double uf;
+
+ /**
+ * The transverse momentum associated with the interaction.
+ */
+ TransverseMomentum pt;
+
+ /**
+ * The transverse momentum scale associated with the interactions.
+ */
+ Energy kt;
+
+ /** Struct for ordering by dipoles. */
+ struct DipoleOrder {
+ /** Main operator */
+ bool operator()(const DipoleInteraction & i1, const DipoleInteraction & i2) const {
+ return i1.dips.first < i2.dips.first ||
+ ( i1.dips.first == i2.dips.first && i1.dips.second < i2.dips.second );
+ }
+ };
+
+ /** Struct for ordering by dipoles. */
+ struct StrengthOrder {
+ /** Main operator */
+ bool operator()(const DipoleInteraction & i1, const DipoleInteraction & i2) const {
+ return i1.f > i2.f;
+ }
+ };
+
+ /** Struct for ordering by dipoles. */
+ struct PTOrder {
+ /** Main operator */
+ bool operator()(const DipoleInteraction & i1, const DipoleInteraction & i2) const {
+ return i1.kt > i2.kt;
+ }
+ };
+
+ };
+
+ /**
+ * A settype used to store an ordered list of potential interactions
+ * between dipoles in colliding dipole systems. Ordered in
+ * decreasing interaction strength.
+ */
+ typedef multiset<DipoleInteraction,DipoleInteraction::StrengthOrder> InteractionList;
+
+ /**
+ * A settype used to store an ordered list of potential interactions
+ * between dipoles in colliding dipole systems. Ordered in
+ * decreasing interaction strength.
+ */
+ typedef multiset<DipoleInteraction,DipoleInteraction::PTOrder> InteractionPTList;
+
+ /**
+ * A settype used to store a list of potential interactions
+ * between dipoles in colliding dipole systems.
+ */
+ typedef set<DipoleInteraction,DipoleInteraction::DipoleOrder> InteractionDipList;
+
/**
* A interaction of RealPartons, with all needed information about the interaction.
*/
struct RealInteraction {
RealPartonStatePtr lrs, rrs;
DipolePtr d1, d2;
RealPartonPtr p11, p12, p21, p22;
InvEnergy range11, range12, range21, range22;
Energy effectivePlus11, effectivePlus12, effectivePlus21, effectivePlus22;
Energy effectiveMinus11, effectiveMinus12, effectiveMinus21, effectiveMinus22;
bool max11, max12, max21, max22;
double P11, P12, P21, P22;
};
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline DipoleXSec();
+ inline DipoleXSec()
+ : theRMax(0.0*InvGeV), theInteraction(0), usePartonicInteraction(false),
+ theIntOrdering(0), theRecoilReduction(0), checkOffShell(true) {}
/**
* The copy constructor.
*/
- inline DipoleXSec(const DipoleXSec &);
+ inline DipoleXSec(const DipoleXSec & x)
+ : HandlerBase(x), theRMax(x.theRMax), theInteraction(x.theInteraction),
+ usePartonicInteraction(x.usePartonicInteraction),
+ theIntOrdering(x.theIntOrdering),theRecoilReduction(x.theRecoilReduction),
+ checkOffShell(x.checkOffShell) {}
/**
* The destructor.
*/
virtual ~DipoleXSec();
//@}
public:
/** @name Virtual functions to be overridden by subclasses. */
//@{
/**
* Calculate the scattering probability for the two given dipoles
* using the given ImpactParameters.
*/
virtual double fij(const pair<tPartonPtr, tPartonPtr>,
const pair<tPartonPtr, tPartonPtr>,
const ImpactParameters & b,
bool veto = true) const;
/**
* Calculate the scattering probability for the two given dipoles
* using the given ImpactParameters.
*/
virtual double fij(const Dipole &,
const Dipole &,
const ImpactParameters & b,
bool veto = true) const;
/**
+ * Calculate the scattering probability for the two given dipoles
+ * using the given ImpactParameters.
+ */
+ virtual DipoleInteraction fij(const ImpactParameters & b,
+ const Dipole &,
+ const Dipole &,
+ bool veto = true) const;
+
+ /**
* Return false if an interaction would be kinematically forbidden.
*/
virtual bool kinematicsVeto(const pair<tPartonPtr, tPartonPtr>,
const pair<tPartonPtr, tPartonPtr>,
const ImpactParameters & b) const;
/**
* Return false if an interaction would be kinematically forbidden.
*/
virtual bool kinematicsVeto(const Dipole &,
const Dipole &,
const ImpactParameters & b,
const pair<bool,bool> & ints) const;
/**
* Calculate the total scattering probability for the two given
* dipole systems using the given ImpactParameters.
*/
virtual double sumf(const DipoleState &, const DipoleState &,
const ImpactParameters &) const;
/**
* Calculate the total scattering probability all dipole pairs
* the two given dipole systems using the given ImpactParameters.
*/
virtual FList flist(const DipoleState &, const DipoleState &,
const ImpactParameters &) const;
/**
* Calculate the total scattering probability all dipole pairs
* the two given dipole systems using the given ImpactParameters.
* This version backtrack vetoed dipoles pairs and checks the parents.
*/
virtual FList effectiveFlist(const DipoleState &, const DipoleState &,
const ImpactParameters &) const;
/**
* Return a unitarized scattering probability, given the
* ununitarized one.
*/
virtual double unitarize(double f) const;
/**
* Returns the recoils the interaction would like to give the 4 involved partons.
* Assumes the states are not yet rotated.
*/
virtual InteractionRecoil
recoil(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b,
pair<pair<bool, bool>, pair<bool, bool> > doesInt,
pair<bool,bool> ints0) const;
/**
* Returns the recoils the interaction would like to give the 4 involved partons.
* Assumes the states are not yet rotated.
*/
virtual InteractionRecoil
recoil(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b,
pair<pair<bool, bool>, pair<bool, bool> > doesInt =
make_pair(make_pair(true, true), make_pair(true, true))) const;
/**
* Does the transverse recoil on the four partons.
*/
void doTransverseRecoils(RealInteraction i, InteractionRecoil recs) const;
/**
* creates and initialises a RealInteraction with realpartons, ranges and max.
*/
virtual RealInteraction
initialiseInteraction(const pair<DipolePtr, DipolePtr> inter,
RealPartonStatePtr lrs, RealPartonStatePtr rrs,
pair<pair<bool, bool>, pair<bool, bool> > doesInt,
const ImpactParameters & b) const;
/**
* Decides which of the four partons actually interact.
*/
virtual pair<pair<bool, bool>, pair<bool, bool> >
doesInt(const pair<tPartonPtr, tPartonPtr> left,
const pair<tPartonPtr, tPartonPtr> right,
const ImpactParameters & b) const;
/**
* Selects the two partons (out of the four) that are used in theInteraction == 0.
*/
virtual pair<bool, bool> int0Partons(tcPartonPtr p11, tcPartonPtr p12,
tcPartonPtr p21, tcPartonPtr p22,
const ImpactParameters & b) const;
/**
* calculates and sets the effective plus and minus of the partons of the interaction
**/
virtual void updateMomenta(RealInteraction * interaction) const;
// /**
// * undoes the last recoil for each of the four partons.
// */
// virtual void undoLastRecoil(RealPartonPtr p11, RealPartonPtr p12,
// RealPartonPtr p21, RealPartonPtr p22) const;
/**
* Does the transverse recoil on the real partons with the pT supplied in recs.
* Does the p+ alt. p- transfer of neededPlus nad neededMinus to put the
* other state on shell. If not consistent, return false.
* Also updates p_mu for the 4 effective partons. Assumes all are rightmoving.
*/
virtual bool doInteraction(InteractionRecoil recs, const FList::const_iterator inter,
RealPartonStatePtr lrs, RealPartonStatePtr rrs,
pair<pair<bool, bool>, pair<bool, bool> > doesInt,
const ImpactParameters & b) const;
/**
* Tests the provided interactions in the same way doInteraction does, but
* without transfering any momenta between the states.
*/
virtual bool checkInteractions(DipolePairVector & ints, RealPartonStatePtr lrs,
RealPartonStatePtr rrs, const ImpactParameters & b) const;
/**
* undoes the recoils to the other state stored in all partons involved in the
* interaction. Note that the p+- boosts are stored as recoils against themselves, and
* does not trigger here.
**/
virtual void undoPTRecoils(RealInteraction RI) const;
/**
* Performs the interactions provided. Returns false if something goes wrong.
*/
virtual bool performInteractions(DipolePairVector & ints, RealPartonStatePtr lrs,
RealPartonStatePtr rrs, const ImpactParameters & b) const;
/**
* checks if the four interacting partns are ordered.
* It is assumed that p2 not yet is mirrored in y=0.
* The booleans indicate if the parton pairs are local max in pT.
**/
virtual bool checkOrderedInteraction(tRealPartonPtr p11, tRealPartonPtr p12,
tRealPartonPtr p21, tRealPartonPtr p22) const;
/**
* reconnects the colour flow in an interaction, taking care that rescatterings are
* treated properly.
*/
virtual bool reconnect(tDipolePtr d1, tDipolePtr d2) const;
/**
* checks the interactions in the two real states, ans picks out the ones that
* did non-colour singlet exchanges.
*/
virtual vector<pair<DipolePtr, DipolePtr> >
getColourExchanges(tRealPartonStatePtr lrs, tRealPartonStatePtr rrs) const;
/**
+ * Mark two dipoles as having interacted with eachother.
+ */
+ virtual void interact(Dipole & d1, Dipole & d2) const;
+
+ //@}
+
+ /**
* Return the interaction
**/
inline int interaction() const {
return theInteraction;
}
- //@}
+ /**
+ * Flag determining if only one parton in each dipole is considered
+ * interacting or both.
+ */
+ inline bool partonicInteraction() const {
+ return usePartonicInteraction;
+ }
/**
* The confinement scale.
*/
InvEnergy rMax() const;
/**
* for debugging
*/
mutable int Nfij;
mutable int NScalVeto;
mutable int NBVeto;
mutable double scalVeto;
mutable double bVeto;
private:
/**
* return the fractions of p+ and p- to be transfered to put everything on shell.
*/
pair<double, double> findBoosts(Energy intPlus1, Energy intPlus2,
Energy intMinus1, Energy intMinus2,
Energy evoPlus2, Energy evoMinus1) const;
/**
* return the fractions of p+ and p- to be transfered to put everything on shell.
**/
pair<double, double> findBoosts(RealInteraction i) const;
/**
* boosts the interacting particles with the scales provided
**/
void doBoosts(RealInteraction i, pair<double, double> boosts) const;
/**
* boosts the affective partons with the scale x.
*/
void doBoost(tRealPartonPtr p1, InvEnergy range1,
tRealPartonPtr p2, InvEnergy range2, double x) const;
/**
* reduce the recoil until the interacting partons are ordered in rapidity.
**/
void reduceRecoil(RealInteraction RI, InteractionRecoil recs) const;
/**
* checks if the interaction is ordered or not
**/
bool ordered(RealInteraction i, InteractionRecoil recs, const ImpactParameters & b) const;
/**
* sets all particles in the backwards cone on shell
**/
void setOnShell(RealInteraction i) const;
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.
*/
- inline virtual IBPtr clone() const;
+ inline virtual IBPtr clone() const {
+ return new_ptr(*this);
+ }
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
- inline virtual IBPtr fullclone() const;
+ inline virtual IBPtr fullclone() const {
+ return new_ptr(*this);
+ }
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
protected:
/**
* Exception class to signal bad kinematics.
*/
struct InteractionKinematicException: public Exception {};
private:
/**
* The confinement scale.
*/
InvEnergy theRMax;
/**
* Flag determining which interaction to be used.
*/
int theInteraction;
/**
+ * Flag determining if only one parton in each dipole is considered
+ * interacting or both.
+ */
+ bool usePartonicInteraction;
+
+ /**
* What kind of kinematical ordering is requeired in the interaction.
*/
int theIntOrdering;
/**
* What to do with large recoils, if anything.
*/
int theRecoilReduction;
/**
* Check for off-shell incoming particles.
*/
bool checkOffShell;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
DipoleXSec & operator=(const DipoleXSec &);
};
}
-#include "DipoleXSec.icc"
-
#endif /* DIPSY_DipoleXSec_H */
diff --git a/DIPSY/DipoleXSec.icc b/DIPSY/DipoleXSec.icc
deleted file mode 100644
--- a/DIPSY/DipoleXSec.icc
+++ /dev/null
@@ -1,30 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the DipoleXSec class.
-//
-
-namespace DIPSY {
-
- inline DipoleXSec::DipoleXSec()
- : theRMax(0.0*InvGeV), theInteraction(0), theIntOrdering(0),
- theRecoilReduction(0), checkOffShell(true) {}
-
-inline DipoleXSec::DipoleXSec(const DipoleXSec & x)
- : HandlerBase(x), theRMax(x.theRMax), theInteraction(x.theInteraction),
- theIntOrdering(x.theIntOrdering),theRecoilReduction(x.theRecoilReduction),
- checkOffShell(x.checkOffShell) {}
-
-inline IBPtr DipoleXSec::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr DipoleXSec::fullclone() const {
- return new_ptr(*this);
-}
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/DIPSY/Emitter.h b/DIPSY/Emitter.h
--- a/DIPSY/Emitter.h
+++ b/DIPSY/Emitter.h
@@ -1,325 +1,345 @@
// -*- C++ -*-
#ifndef DIPSY_Emitter_H
#define DIPSY_Emitter_H
//
// This is the declaration of the Emitter class.
//
#define THEPEG_NEW_CLASS_DESCRIPTION
#include "ThePEG/Handlers/HandlerBase.h"
#include "Emitter.fh"
#include "Dipole.fh"
#include "Parton.h"
namespace DIPSY {
using namespace ThePEG;
/**
* The Emitter class is responsible for generating and performing
* emissions from dipoles. This base class does the standard thing. Any
* non-standard thing must be implemented in a sub-class overriding
* the generate() and/or emit() functions.
*
* @see \ref EmitterInterfaces "The interfaces"
* defined for Emitter.
*/
class Emitter: public HandlerBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline Emitter();
+ inline Emitter()
+ : testingPS(false), fixY(0.0), thePSInflation(1.0), thePMinusOrdering(1.0),
+ thePTScale(1.0), theRScale(1.0*InvGeV), theRMax(0.0*InvGeV),
+ theBothOrderedEvo(true), theBothOrderedInt(true), theBothOrderedFS(true),
+ theRangeMode(0),theMinusOrderingMode(0), thestMode(false) {}
/**
* The destructor.
*/
virtual ~Emitter();
//@}
public:
/** @name Virtual functions which may be overridden by sub-classes. */
//@{
/**
* Return the running coupling for the given size (scale). /CF
*/
double alphaS(InvEnergy r) const;
/**
* if pT is 1/r or 2/r.
*/
- inline double pTScale() const;
+ inline double pTScale() const {
+ return thePTScale;
+ }
/**
* Alpha bar = alphas*Nc/pi /CF
*/
- inline double alphaBar(InvEnergy r) const;
+ inline double alphaBar(InvEnergy r) const {
+ return alphaS(r)*3.0/M_PI;
+ }
/**
* Sets the shape of the overestimate in the genreation.
* The cross section does not (should not) depend on rScale. /CF
*/
- inline void rScale(InvEnergy rScale);
+ inline void rScale(InvEnergy rScale) {
+ theRScale = rScale;
+ }
/**
* Get bothordered.
*/
inline bool bothOrderedEvo() const {
return theBothOrderedEvo;
};
inline bool bothOrderedInt() const {
return theBothOrderedInt;
};
inline bool bothOrderedFS() const {
return theBothOrderedFS;
};
/**
* Set PSInfaltion
*/
- inline void PSInflation(double PSInflation);
+ inline void PSInflation(double PSInflation) {
+ thePSInflation = PSInflation;
+ }
/**
* Get PSInfaltion
*/
- inline double PSInflation() const;
+ inline double PSInflation() const {
+ return thePSInflation;
+ }
/**
- * Set PSInfaltion
+ * Set PMinusOrdering
*/
- inline void PMinusOrdering(double PMinusOrdering);
+ inline void PMinusOrdering(double x) {
+ thePMinusOrdering = x;
+ }
/**
- * Get PSInfaltion
+ * Get PMinusOrdering
*/
- inline double PMinusOrdering() const;
+ inline double PMinusOrdering() const {
+ return thePMinusOrdering;
+ }
/**
* get the rangeMode
**/
inline int rangeMode() const {
return theRangeMode;
}
/**
* get the minusOrderingMode
**/
inline int minusOrderingMode() const {
return theMinusOrderingMode;
}
/**
* The confinement scale.
*/
InvEnergy rMax() const;
/**
* Generate a possible emission or a swing from a given dipole in the
* given rapidity interval [\a miny,\a maxy].
*/
virtual void generate(Dipole & dipole, double miny, double maxy) const;
/**
* Perform the emission previously generated for the given \a
* dipole. If no emission has been generated a runtime_error is
* thrown.
*/
virtual void emit(Dipole & dipole) const;
//@}
protected:
/**
* Internal function.
*/
virtual bool OEVeto(DipolePtr dip, double y0, Parton::Point p) const;
/**
* Internal function.
*/
virtual bool YVeto(double y, DipolePtr dip, double Coe, double rateOE) const;
/**
* Internal function.
*/
virtual double generateY(DipolePtr dip, double ymin, double ymax) const;
/**
* Internal function.
*/
virtual Parton::Point generateXT(DipolePtr dip, double y0) const;
public:
/**
* Debugging and testing
*/
mutable bool testingPS;
mutable double fixY;
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.
*/
- inline virtual IBPtr clone() const;
+ inline virtual IBPtr clone() const {
+ return new_ptr(*this);
+ }
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
- inline virtual IBPtr fullclone() const;
+ inline virtual IBPtr fullclone() const {
+ return new_ptr(*this);
+ }
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
protected:
/**
* How much P+- ordering should be required. 1 is nomral ordering
* high values are no ordering, low number are strong ordering.
*/
double thePSInflation;
/**
* Controls the strength of the p- ordering in the evolution.
*/
double thePMinusOrdering;
/**
* if pt is 1/r or 2/r.
*/
double thePTScale;
/**
* the scale in the distribution of transverse r. /CF
*/
InvEnergy theRScale;
/**
* The confinement scale.
*/
InvEnergy theRMax;
/**
* If the plus/minus ordering should be full strenght
* for both parents in teh cascade, interaction and final state.
*/
bool theBothOrderedEvo;
bool theBothOrderedInt;
bool theBothOrderedFS;
/**
* How the range is determined.
**/
int theRangeMode;
/**
* How the minus ordering is made in the cascade.
**/
int theMinusOrderingMode;
/**
* If test-modification to evolution should be on. /CF
*/
bool thestMode;
private:
#ifndef THEPEG_NEW_CLASS_DESCRIPTION
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<Emitter> initEmitter;
#endif
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Emitter & operator=(const Emitter &);
};
}
#ifndef THEPEG_NEW_CLASS_DESCRIPTION
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of Emitter. */
template <>
struct BaseClassTrait<DIPSY::Emitter,1> {
/** Typedef of the first base class of Emitter. */
typedef HandlerBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the Emitter class and the shared object where it is defined. */
template <>
struct ClassTraits<DIPSY::Emitter>
: public ClassTraitsBase<DIPSY::Emitter> {
/** Return a platform-independent class name */
static string className() { return "DIPSY::Emitter"; }
/**
* The name of a file containing the dynamic library where the class
* Emitter is implemented. It may also include several, space-separated,
* libraries if the class Emitter 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 "libAriadne5.so libDIPSY.so"; }
};
/** @endcond */
}
#endif
-#include "Emitter.icc"
-
#endif /* DIPSY_Emitter_H */
diff --git a/DIPSY/Emitter.icc b/DIPSY/Emitter.icc
deleted file mode 100644
--- a/DIPSY/Emitter.icc
+++ /dev/null
@@ -1,55 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the Emitter class.
-//
-
-namespace DIPSY {
-
- inline Emitter::Emitter():
- testingPS(false), fixY(0.0), thePSInflation(1.0), thePMinusOrdering(1.0),
- thePTScale(1.0), theRScale(1.0*InvGeV), theRMax(0.0*InvGeV),
- theBothOrderedEvo(true), theBothOrderedInt(true), theBothOrderedFS(true),
- theRangeMode(0),theMinusOrderingMode(0), thestMode(false) {}
-
-inline IBPtr Emitter::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr Emitter::fullclone() const {
- return new_ptr(*this);
-}
-
-inline double Emitter::alphaBar(InvEnergy r) const{
- return alphaS(r)*3.0/M_PI;
-}
-
-inline double Emitter::pTScale() const{
- return thePTScale;
-}
-
-inline void Emitter::rScale(InvEnergy rScale) {
- theRScale = rScale;
-}
-
-inline void Emitter::PSInflation(double PSInflation) {
- thePSInflation = PSInflation;
-}
-
-inline double Emitter::PSInflation() const {
- return thePSInflation;
-}
-
-inline void Emitter::PMinusOrdering(double x) {
- thePMinusOrdering = x;
-}
-
-inline double Emitter::PMinusOrdering() const {
- return thePMinusOrdering;
-}
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/DIPSY/EventFiller.cc b/DIPSY/EventFiller.cc
--- a/DIPSY/EventFiller.cc
+++ b/DIPSY/EventFiller.cc
@@ -1,1032 +1,1058 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the EventFiller class.
//
#include "DipoleEventHandler.h"
#include "EventFiller.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Utilities/Throw.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/EventRecord/Step.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/EventRecord/SubProcess.h"
#include "RealPartonState.h"
#include "ParticleInfo.h"
#include "ThePEG/Utilities/Debug.h"
#include "ThePEG/Utilities/DebugItem.h"
#include "ThePEG/Utilities/UtilityBase.h"
#include "ThePEG/Utilities/SimplePhaseSpace.h"
#include "ThePEG/Handlers/LuminosityFunction.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "../Cascade/EmitterBase.h"
#include <iostream>
#include <fstream>
using namespace DIPSY;
EventFiller::EventFiller()
: currentWeight(0.0), theRecoilScheme(0), theSingleMother(0),
theDGLAPinPT(0), theEffectiveWeights(0), theFSSwingTime(0.0),
theFSSwingTimeStep(0.1),
- theValenceChargeNormalisation(0), thePTCut(ZERO), theSoftRemove(1) {}
+ theValenceChargeNormalisation(0), thePTCut(ZERO), theSoftRemove(1), onlyOnce(false) {}
EventFiller::~EventFiller() {}
IBPtr EventFiller::clone() const {
return new_ptr(*this);
}
IBPtr EventFiller::fullclone() const {
return new_ptr(*this);
}
double EventFiller::fill(Step & step, DipoleEventHandler & eh, tPPair inc,
DipoleState & dl, DipoleState & dr,
const ImpactParameters & b) const {
// Get a list of possible dipole-dipole interactions
FList fl = eh.xSecFn().flist(dl, dr, b);
//Sum over the (ununitarised) interaction probabilities 2*f_{ij}.
//Note that the factor 2 is included in flist(), to give the correct
//ND interaction probability.
double sum = 0.0;
for ( FList::iterator it = fl.begin(); it != fl.end(); ++it )
sum += it->first.first;
//Just check that they are not all 0.
if ( sum == 0.0 ) {
return 0.0;
}
//Non-diffractive interaction probability is 1 - exp(-Sum(2*f_{ij}))
double weight = eh.xSecFn().unitarize(sum);
//Combine the weights from all the sources.
currentWeight =
weight*sqr(hbarc)*dr.weight()*dl.weight()*b.weight()/eh.maxXSec();
// Select the interactions which should be performed.
pair<RealPartonStatePtr, RealPartonStatePtr> realStates =
selectInteractions(fl, b, eh.xSecFn());
//If no interactions found, discard event.
if ( realStates.first->interactions.empty() ) {
return 0.0;
}
//Counts the number of participants in a HI event.
//TODO: interface, or trigger on AA.
countParticipants(dl, dr, b.bVec().pt());
//Figure out which partons to keep, and which to remove.
//Also sort out colour flow, momenta etc.
vector<String> strings = extractStrings(dl, dr, realStates, b);
DipoleState & finalState = dl;
//Discard event if no final state partons were found.
if ( strings.empty() || ! fillStep(step, inc, strings) ) {
weight = 0.0;
currentWeight = 0.0;
return weight;
}
// The last thing we do is to fix up valens configurations.
finalState.fixValence(step);
return weight;
}
void EventFiller::countParticipants(const DipoleState & dl,
const DipoleState & dr, const InvEnergy b) const {
//The initial dipoles. Note that these will in general have emitted
//something, and thus no longer be active. They may have been
//reconnected by a new dipole in the absorption process though.
vector<DipolePtr> valenceDip = dl.initialDipoles();
valenceDip.insert(valenceDip.end(),
dr.initialDipoles().begin(), dr.initialDipoles().end());
//count the nonparticipating nucleons
int untouchedNucleons = 0;
for ( int i = 0; i < int(valenceDip.size()); i++ ) {
//First find the three valence partons in the nucleon that
//the dipole belongs to.
//Two are connected to the dipole, easy.
tPartonPtr p1 = valenceDip[i]->partons().first;
tPartonPtr p2 = valenceDip[i]->partons().second;
//The three dipoles in valenceDip are always after each other,
//so the third parton can be found in the dipole before or
//after (or both).
tPartonPtr p3;
if ( i != int(valenceDip.size())-1 &&
valenceDip[i+1]->partons().first == p2 )
p3 = valenceDip[i+1]->partons().second;
else if ( i != int(valenceDip.size())-1 &&
valenceDip[i+1]->partons().second == p1 )
p3 = valenceDip[i+1]->partons().first;
else if ( i != 0 && valenceDip[i-1]->partons().first == p2 )
p3 = valenceDip[i-1]->partons().second;
else if ( i != 0 && valenceDip[i-1]->partons().second == p1 )
p3 = valenceDip[i-1]->partons().first;
//If none of the valence partons have interacted
//ie (have children that interacted), the nucleon is considered
//to not have interacted. Note that with swings, a single interaction
//can make several nucleons participating.
if ( !(p1->interacted()) &&
!(p2->interacted()) &&
!( p3 && p3->interacted() ) ) {
valenceDip[i]->participating(false);
untouchedNucleons++;
}
else
valenceDip[i]->participating(true);
}
//We will triple count, as we loop through all 3 dipoles in
//each nucleon. Divide by 3 to make up for this.
untouchedNucleons /= 3;
}
/*
* This is the probability that a parton is interacting, given that
* the state interacts, but the partons is not selected as primary.
*
* Prob of p interacting: p
* Prob of p interacting, given that the state interacts: x = p/totalP
* Prob of p being selected as primary, given state interacts: y = p/sumP
* Prob of p being selected as non-primary, given state
* interacts: z
* x = y + z ==> z = p/totalP - p/sumP
* Prob of p not being primary, given state interacts: A = (sumP-p)/sumP
* And now what we are looking for:
* Prob of p being selected as non-primary, given state interacts
* and not selected as primary: B
* z = A*B ==> B = z/A = p(1/totalP - 1/sumP)/((sumP-p)/sumP) =
* = p(sumP/totalP - 1)/(sumP-p)
*/
double correctedProb(double totalP, double sumP, double p) {
return p*(sumP/totalP - 1.0)/(sumP - p);
}
pair<RealPartonStatePtr, RealPartonStatePtr>
EventFiller::selectInteractions(const FList & fl, const ImpactParameters & b,
const DipoleXSec & xSec) const {
DipolePairVector interactions;
double sumfij = 0.0; //the sum of the individual nonuntarised int probs
double sumUP = 0.0; //The sum of the individual unitarised int probs
//Set up a selector, and a map sorted on pt of the interaction.
Selector<FList::const_iterator, double> sel;
DipolePairMap ordered;
//Loop through all possible interactions and fill
//@sel and @ordered.
for ( FList::const_iterator it = fl.begin(); it != fl.end(); ++it ) {
//If no interaction probability, don't bother.
if ( it->first.second == 0.0 ) continue;
//insert into the selector.
sel.insert(it->first.second, it);
sumfij += it->first.first;
sumUP += it->first.second;
//Calculate interaction recoils by calling the DipoleXSec object.
DipoleXSec::InteractionRecoil rec =
xSec.recoil(it->second.first->partons(), it->second.second->partons(), b);
//Insert in @ordered, sorting on max pt recoil.
double pt = max(max(rec.first.first.pt(), rec.first.second.pt()),
max(rec.second.first.pt(), rec.second.second.pt()))/GeV;
ordered.insert(make_pair(pt, it));
+ // ordered.insert(make_pair(it->first.first, it));
}
//interaction probability (for at least one interaction)
//of the two states.
double totalP = Current<DipoleEventHandler>()->xSecFn().unitarize(sumfij);
//create the real states.
RealPartonStatePtr rrs = new_ptr(RealPartonState());
RealPartonStatePtr lrs = new_ptr(RealPartonState());
//Add the valence partons (as they are always real) and save.
lrs->addValence(fl.begin()->second.first->dipoleState());
rrs->addValence(fl.begin()->second.second->dipoleState());
lrs->saveState();
rrs->saveState();
DipolePairMap potential;
DipolePairMap failedPrims;
bool found = false;
int counter = 0;
while ( !found ) {
potential.clear();
//select a first interaction (since there has to be at least one).
FList::const_iterator prim = sel[UseRandom::rnd()];
//Go through the other interactions and check if they are also
//interacting. A modified probability is used, to make up for the
//bias introduced in selecting a primary interaction.
for ( FList::const_iterator it = fl.begin(); it != fl.end(); ++it )
if ( it == prim || correctedProb(totalP,sumUP,it->first.second)
- > UseRandom::rnd() ) {
+ > UseRandom::rnd() ) {
DipoleXSec::InteractionRecoil rec =
- xSec.recoil(it->second.first->partons(), it->second.second->partons(), b);
- double pt = max(max(rec.first.first.pt(), rec.first.second.pt()),
- max(rec.second.first.pt(), rec.second.second.pt()))/GeV;
+ xSec.recoil(it->second.first->partons(), it->second.second->partons(), b);
+ double pt = max(max(rec.first.first.pt(), rec.first.second.pt()),
+ max(rec.second.first.pt(), rec.second.second.pt()))/GeV;
- //If the interaction passed the amplitude test, add it to the list
- //of potential interations.
+ //If the interaction passed the amplitude test, add it to the list
+ //of potential interations.
potential.insert(make_pair(pt, it));
+ // potential.insert(make_pair(it->first.first, it));
}
//Keep track on how many times we have tried to find a consistent
//set of interactions. Give up after 10 tries.
counter++;
if ( counter > 10 ) {
overTenEvents += currentWeight;
return make_pair(lrs, rrs);
}
//test all potetential interactions in order, skipping already failed dips.
//failed first interactions inserted in failedprims,
//and from sel and ordered if first in ordered.
int i = 0;
+ set<tDipolePtr> ldips, rdips;
for ( DipolePairMap::iterator it = potential.begin(); it != potential.end(); ++it ) {
i++;
//Check first interaction, and already failed as first.
//Then autofail without checking again.
if ( failedPrims.find(it->first) != failedPrims.end() && !found ) {
continue;
}
+ if ( onlyOnce && ( ldips.find(it->second->second.first) != ldips.end() ||
+ rdips.find(it->second->second.second) != rdips.end() ) ) continue;
+
//Try to add the interaction.
if (addInteraction(it->second, lrs, rrs, interactions, b, xSec)) {
found = true;
+ ldips.insert(it->second->second.first);
+ rdips.insert(it->second->second.second);
}
else {
//remember if it was first interaction and failed, to not
//try it again later.
if ( !found ) {
failedPrims.insert(*it);
if ( it == ordered.begin() ) {
ordered.erase(it);
sel.erase(it->second);
}
}
}
}
//if sel (or ordered) empty, give up event. no int can be first.
if ( sel.empty() ) return make_pair(lrs, rrs);
}
//Make sure that the real state partons are on-shell.
//May not actually be needed, not sure... TODO: check!
for( DipolePairVector::iterator it = interactions.begin();
it != interactions.end(); it++ ) {
lrs->setOnShell((*it)->second.first);
rrs->setOnShell((*it)->second.second);
}
for ( RealParton::RealPartonSet::iterator it = lrs->valence.begin();
it != lrs->valence.end(); it++ )
(*it)->setOnShell();
for ( RealParton::RealPartonSet::iterator it = rrs->valence.begin();
it != rrs->valence.end(); it++ )
(*it)->setOnShell();
//return the real states.
return make_pair(lrs, rrs);
}
bool EventFiller::
addInteraction(FList::const_iterator inter, RealPartonStatePtr lrs,
RealPartonStatePtr rrs, DipolePairVector & inters,
const ImpactParameters & b, const DipoleXSec & xSec) const {
rescatter += currentWeight;
//With some settings, only some of the partons actually interact.
//Check which here. Other tunes will just return 4x true.
pair<pair<bool, bool>, pair<bool, bool> > doesInt =
xSec.doesInt(inter->second.first->partons(),
inter->second.second->partons(), b);
//Calculate the recoils from the interaction.
DipoleXSec::InteractionRecoil recs =
xSec.recoil(inter->second.first->partons(),
inter->second.second->partons(), b, doesInt);
//Add the interacting partons and their parents to the real state
//and go through the evolution checking for ordering, local pt-max, etc.
if ( !lrs->fullControlEvolution
(inter->second.first, inter->second.second,
doesInt.first.first, doesInt.first.second,
recs.first.first.pt(), recs.first.second.pt()) ) {
return false;
}
//Add the interaction to the other state, and check that as well.
if ( !rrs->fullControlEvolution
(inter->second.second, inter->second.first,
doesInt.second.first, doesInt.second.second,
recs.second.first.pt(), recs.second.second.pt()) ) {
//If this second evolution failed, remove the interaction from
//the first
//state by reverting it to the previously saved state.
lrs->revertToPrevious(inter->second.first);
return false;
}
//If both evolutions could accomodate the interacting partons,
//add the interaction recoil as well,
//and check that things still are ok.
inters.push_back(inter);
if ( !controlRecoils(inters, lrs, rrs, b, xSec, doesInt) ) {
//If failed, remove the interaction from the evolutions.
lrs->revertToPrevious(inter->second.first);
rrs->revertToPrevious(inter->second.second);
inters.pop_back();
return false;
}
//If the interactions was ok, mark the dipoles as interacting
//and save the real states.
- inter->second.first->interact(*inter->second.second);
- inter->second.second->interact(*inter->second.first);
+ xSec.interact(*inter->second.first, *inter->second.second);
+ // inter->second.first->interact(*inter->second.second);
+ // inter->second.second->interact(*inter->second.first);
lrs->saveState();
rrs->saveState();
return true;
}
vector<EventFiller::String>
EventFiller::extractStrings(DipoleState & dl, DipoleState & dr,
pair<RealPartonStatePtr, RealPartonStatePtr> realStates,
const ImpactParameters & b ) const {
//Just rename a bit for convenience.
DipoleStatePtr rightState = &dr;
DipoleStatePtr leftState = &dl;
RealPartonStatePtr lrs = realStates.first;
RealPartonStatePtr rrs = realStates.second;
//grow back the partons marked as virtuals.
//This will be the ones without interacting children, but not the
//ones removed during ordering/pt-max-fixing.
removeVirtuals(leftState);
removeVirtuals(rightState);
//The unordered and not-ok pt-max were removed by pairing them
//up with other partons that should stay. Now merge all the momentum
//into a single parton, and flag the others as virtual.
lrs->mergeVirtuals();
rrs->mergeVirtuals();
//Save to update the parton information from the realPartons.
lrs->saveState();
rrs->saveState();
//A high-pt parton (so very localised in x_T) can not recoil all
//of a low-pt (so smeared out in x_T) parent, but will rather shoot
//out a recoiling part of the parent. Fix this by replacing recoiled
//low-pt parents by a remnant, and a recoiler.
lrs->addRecoilers();
rrs->addRecoilers();
//Save states to update partons.
lrs->saveState();
rrs->saveState();
//balance p+/p- by moving the entire state. Was first done in the
//interaction (where the interacting partons had to provide the
//energy), but the modifications here changes kinematics so that
//some more balancing may be needed. Should very rarely be
//large changes.
fixBoost(lrs, rrs);
//Translate the right state to it's right place in x_T,
//and mirror it in rapidity so that it actually comes from the
//other side. Finally merge the two cascades into one state.
rightState->translate(b);
rightState->mirror(0.0);
DipoleStatePtr finalState = leftState->merge(rightState);
vector<pair<DipolePtr, DipolePtr> > swinging =
Current<DipoleEventHandler>()->xSecFn().getColourExchanges(lrs, rrs);
//swing the interacting dipoles.
for ( int i = 0; i < int(swinging.size()); i++ ) {
Current<DipoleEventHandler>()->
xSecFn().reconnect(swinging[i].first, swinging[i].second);
}
//now remove the partons that were made virtual by mergeVirtuals.
//This is so that it should be easier to reconnect the colour
//through the interacting dipoles with the state from the other side.
removeVirtuals(finalState);
//do final state swings, aka pythias colour reconnection.
double yrange = FSSwingTime();
double ystep = FSSwingTimeStep();
for ( double y = 0.0; y < yrange; y += ystep ) {
finalState->swingFS(y, y + ystep);
}
// finalState->lambdaMeasure(0.36*GeV2, histDipLength2, histDipMass2);
//compensate for the 6 valence charges in the proton
finalState->normaliseValenceCharge(theValenceChargeNormalisation);
//make sure the non-particpating nucleons (if AA) have the
//original colour flow.
finalState->restoreNonparticipants();
//try to find and fix any problems or inconsistencies that may have
//popped up. Error messages are sent if anything is found.
dodgeErrors(finalState);
//If you want to save the initial state event to file (mainly AA).
//TODO: interface!
//TODO: stop event after this.
//finalState->saveGluonsToFile(currentWeight);
//If you want to make a fancy movie in mathematica of your event. :)
// finalState->printForMovie(0, 1000);
//Sort the remaining partons in strings.
vector<String> ret = finalState->strings();
return ret;
}
bool EventFiller::fillStep (Step & step, tPPair incoming,
const vector<String> & strings) const {
Direction<0> dir(true);
vector< vector<PPtr> > particles(strings.size());
SubProPtr sub = new_ptr(SubProcess(incoming));
for ( int is = 0, NS = strings.size(); is < NS; ++is ) {
int N = strings[is].size();
vector<bool> removed(N, false);
if ( theSoftRemove && pT2Cut() > ZERO && N > 2 ) {
bool changed = true;
while ( changed ) {
changed = false;
for ( int i = 0; i < N; ++i ) {
if ( removed[i] ) continue;
if ( strings[is][i]->valence() && theSoftRemove == 2 ) continue;
if ( strings[is][i]->flavour() != ParticleID::g ) continue;
int i1 = (N + i - 1)%N;
while ( removed[i1] ) i1 = (N + i1 - 1)%N;
int i3 = (i + 1)%N;
while ( removed[i3] ) i3 = (i3 + 1)%N;
if ( i1 == i3 ) continue;
if ( invPT2(strings[is], i1, i, i3) < pT2Cut() ) {
if ( removeGluon(strings[is], i1, i, i3) ) {
removed[i] = changed = true;
} else {
return false;
}
}
}
}
}
particles[is].resize(N);
for ( int i = 0; i < N; ++i ) {
if ( removed[i] ) continue;
particles[is][i] = strings[is][i]->produceParticle();
int ip = i - 1;
while ( ip >= 0 && removed[ip] ) --ip;
if ( ip >= 0 )
particles[is][i]->colourConnect(particles[is][ip]);
if ( i == N - 1 && strings[is][i]->flavour() == ParticleID::g ) {
int i0 = 0;
while ( i0 < i && removed[i0] ) ++i0;
particles[is][i0]->colourConnect(particles[is][i]);
}
sub->addOutgoing(particles[is][i]);
}
if ( strings[is][0]->flavour() == ParticleID::g ) {
int i0 = 0;
int in = N - 1;
while ( i0 < in && removed[i0] ) ++i0;
while ( in > i0 && removed[in] ) --in;
particles[is][i0]->colourConnect(particles[is][in]);
}
}
step.addSubProcess(sub);
return true;
}
void EventFiller::fixBoost(RealPartonStatePtr lrs, RealPartonStatePtr rrs) const {
//access the CoM energy, through a kindof roundabout path...
//TODO: must be a better way! Current?
PartonPtr dummy = lrs->partons.begin()->first;
Energy sqrtS = ((dummy->dipoles().first) ? dummy->dipoles().first:dummy->dipoles().second)->dipoleState().handler().lumiFn().maximumCMEnergy();
//sum left and right p+ and p-.
Energy leftPlus = ZERO;
Energy leftMinus = ZERO;
Energy rightPlus = ZERO;
Energy rightMinus = ZERO;
//loop and sum over the to-keep partons.
for ( map<tPartonPtr,RealPartonPtr>::const_iterator
it =lrs->partons.begin();
it != lrs->partons.end(); it++ ) {
if ( it->second->keep == RealParton::NO ) continue;
leftPlus += it->second->plus;
leftMinus += it->second->minus;
}
for ( map<tPartonPtr,RealPartonPtr>::const_iterator
it = rrs->partons.begin();
it != rrs->partons.end(); it++ ) {
if ( it->second->keep == RealParton::NO ) continue;
rightPlus += it->second->minus;
rightMinus += it->second->plus;
}
//Solve the 2:nd degree equation for how much energy has to be
//transfered to set both states on shell.
double A = (- rightPlus*rightMinus - sqr(sqrtS) + leftPlus*leftMinus)/(2.0*rightMinus*sqrtS);
double B = rightPlus/rightMinus;
double y1 = -1.0;
double x1 = -1.0;
if ( sqr(A) - B > 0.0 ) {
//the factor to change right p- with.
y1 = - A + sqrt(sqr(A) - B);
// double y2 = - A - sqrt(sqr(A) - B);
//The factor to change left p+ with.
x1 = (y1*sqrtS - rightPlus)/(y1*leftPlus);
// double x2 = (y2*sqrtS - rightPlus)/(y2*leftPlus);
}
//error handling
if ( x1 < 0 || y1 < 0 ) {
Throw<SpaceLikeGluons>()
<< "EventFiller::fixBoost gave negative or nan solution to boost equation, "
<< "will not balance momentum.\n"
<< "This is probably caused by a rouge gluon being far too virtual.\n"
<< Exception::warning;
return;
}
//loop again, scaling the p+ and p- according to the solution above.
for ( map<tPartonPtr,RealPartonPtr>::const_iterator it = lrs->partons.begin();
it != lrs->partons.end(); it++) {
if ( it->second->keep == RealParton::NO ) continue;
it->second->plus *= x1;
it->second->minus /= x1;
}
for ( map<tPartonPtr,RealPartonPtr>::const_iterator it = rrs->partons.begin();
it != rrs->partons.end(); it++) {
if ( it->second->keep == RealParton::NO ) continue;
it->second->minus /= y1;
it->second->plus *= y1;
}
//Save state to transfer the changes to the partons.
lrs->saveState();
rrs->saveState();
}
// void EventFiller::fixValence(Step & step, DipoleState & dl, DipoleState & dr) const {
// list<PartonPtr> alll = dl.getPartons();
// set<tcPartonPtr> vall;
// for ( list<PartonPtr>::iterator pit = alll.begin(); pit != alll.end(); ++pit )
// if ( (**pit).valence() ) vall.insert(*pit);
// list<PartonPtr> allr = dr.getPartons();
// set<tcPartonPtr> valr;
// for ( list<PartonPtr>::iterator pit = allr.begin(); pit != allr.end(); ++pit )
// if ( (**pit).valence() ) valr.insert(*pit);
// vector<PPtr> lval;
// vector<PPtr> rval;
// for ( ParticleSet::iterator pit = step.particles().begin();
// pit != step.particles().end(); ++pit ) {
// tcPartonPtr p = ParticleInfo::getParton(**pit);
// if ( !p ) continue;
// if ( member(vall, p) ) lval.push_back(*pit);
// else if ( member(valr, p) ) rval.push_back(*pit);
// }
// if ( UseRandom::rndbool() ) {
// dl.fixValence(step, lval);
// dr.fixValence(step, rval);
// } else {
// dr.fixValence(step, rval);
// dl.fixValence(step, lval);
// }
// }
void EventFiller::dodgeErrors(DipoleStatePtr finalState) const {
list<PartonPtr> partons = finalState->getPartons();
for ( list<PartonPtr>::iterator it = partons.begin(); it != partons.end(); it++ ) {
PartonPtr p = *it;
//check for empty pointers
if ( !p ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found empty pointer from getPartons()! :o" << Exception::warning;
continue;
}
//check for colour flow to itself
//check for 0 monetum
if ( p->pT().pt() == ZERO ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found 0 pt gluon." << Exception::warning;
p->pT(TransverseMomentum(UseRandom::rnd()*GeV,UseRandom::rnd()*GeV));
}
if ( p->plus() == ZERO || p->minus() == ZERO ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found 0 lightcone momentum." << Exception::warning;
p->minus(UseRandom::rnd()*GeV);
p->plus(UseRandom::rnd()*GeV);
}
//check for nan momentum
if ( isnan(p->pT().pt()/GeV) ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found NAN pt gluon, fix pt." << Exception::warning;
p->pT(TransverseMomentum(UseRandom::rnd()*GeV,UseRandom::rnd()*GeV));
}
if ( isnan(p->plus()/GeV) || isnan(p->minus()/GeV) ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found NAN lightcone momentum, fix plus, minus." << Exception::warning;
p->minus(UseRandom::rnd()*GeV);
p->plus(UseRandom::rnd()*GeV);
}
//check for negative momentum
if ( p->pT().pt() < ZERO ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found negative pt gluon.... >_>, fix pt." << Exception::warning;
p->pT(TransverseMomentum(UseRandom::rnd()*GeV,UseRandom::rnd()*GeV));
}
if ( p->plus() < ZERO || p->minus() < ZERO ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found negative lightcone momentum, fix plus,minus." << Exception::warning;
p->minus(UseRandom::rnd()*GeV);
p->plus(UseRandom::rnd()*GeV);
//check for off-shell momentum
if ( sqr(p->plus()*p->minus() - p->pT().pt2() - sqr(p->mass())) > sqr(sqr(0.01*GeV)) ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found off-shell parton, fix pt." << Exception::warning;
if ( p->plus()*p->minus() < sqr(p->mass()) ) {
Throw<SpaceLikeGluons>()
<< "dodgeError found insufficient energy for mass, fix plus,minus." << Exception::warning;
double ratio = 2.0*sqr(p->mass())/(p->plus()*p->minus()); //give a bit extra for pt
p->plus(p->plus()*sqrt(ratio));
p->minus(p->minus()*sqrt(ratio));
}
double mod = sqrt(p->plus()*p->minus() - sqr(p->mass()))/p->pT().pt();
p->pT(p->pT()*mod);
}
}
}
}
bool EventFiller::
controlRecoils(DipolePairVector & sel,
RealPartonStatePtr lrs, RealPartonStatePtr rrs,
const ImpactParameters & b, const DipoleXSec & xSec,
pair<pair<bool, bool>, pair<bool, bool> > doesInt) const {
//Keep track on which partons are interacting.
list<pair<bool, bool> >::const_iterator
leftDoesInt = lrs->doesInts.begin();
list<pair<bool, bool> >::const_iterator
rightDoesInt = rrs->doesInts.begin();
//Loop through the interaction, and
for ( DipolePairVector::const_iterator inter = sel.begin();
inter != sel.end(); inter++ ) {
//Which partons are interacting in this dip-dip interaction
pair<pair<bool, bool>, pair<bool, bool> >
trueDoesInt = make_pair(*leftDoesInt, *rightDoesInt);
//calculate recoils
DipoleXSec::InteractionRecoil recoil =
xSec.recoil((*inter)->second.first->partons(),
(*inter)->second.second->partons(), b, trueDoesInt);
//call the DipoleXSec object to check kinematics and vetos
//for the interaction. If things don't work, undo the changes.
if ( !xSec.doInteraction(recoil, *inter, lrs, rrs, trueDoesInt, b) ) {
//revert the total recoil between the states.
lrs->totalRecoil -= recoil.first.first + recoil.first.second;
rrs->totalRecoil -= recoil.second.first + recoil.second.second;
}
}
return true;
}
void EventFiller::removeVirtuals(DipoleStatePtr state) const {
list<PartonPtr> vP = state->getPartons();
//loop through the partons, and remove the off shell ones.
//this only does colour flow. RealPartonState does the kinematics
//in mergeVirtuals.
for ( list<PartonPtr>::iterator it = vP.begin(); it != vP.end(); it++) {
tPartonPtr p = *it;
//only handle off-shell parton.
if ( !(p->onShell()) ) {
//if there are only 2 or fewer on-shell partons in the colour chain,
//it has to be swinged at some point, and better early than late,
//as last-second forced swings can lead to silly colour connections.
if ( p->nOnShellInChain() < 2 ) {
//tell the absorber to find a swing anywhere in the colour chain
if ( p->dipoles().first ) absorber()->swingLoop(p->dipoles().first, *state);
else absorber()->swingLoop(p->dipoles().second, *state);
}
//once off-shell loops are handled, absorb the parton.
absorber()->removeParton(p);
}
}
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void EventFiller::doinit() throw(InitException) {
HandlerBase::doinit();
}
void EventFiller::dofinish() {}
void EventFiller::doinitrun() {
HandlerBase::doinitrun();
}
double EventFiller::pTScale(DipoleState & state) const {
return state.handler().emitter().pTScale();
}
Energy2 EventFiller::invPT2(const String & str, int i1, int i2, int i3) {
LorentzMomentum p1 = str[i1]->momentum();
LorentzMomentum p2 = str[i2]->momentum();
LorentzMomentum p3 = str[i3]->momentum();
Energy2 s = (p1 + p2 + p3).m2();
if ( s < sqr(str[i1]->mass() + str[i3]->mass() ) )
Throw<SpaceLikeGluons>()
<< "DIPSY produced space-like gluons. Three neighboring ones had "
<< "negative mass squared. This cannot be fixed at the moment. "
<< "Event discarded." << Exception::eventerror;
Energy2 s12 = (p1 + p2).m2();
Energy2 s23 = (p2 + p3).m2();
if ( s12 < ZERO || s23 < ZERO ) return -1.0*GeV2;
return s12*s23/s;
}
bool EventFiller::removeGluon(const String & str, int i1, int i2, int i3) {
LorentzMomentum p1 = str[i1]->momentum();
LorentzMomentum p2 = str[i2]->momentum();
LorentzMomentum p3 = str[i3]->momentum();
LorentzMomentum ptest = p1 + p2;
if ( ptest.m2() < Constants::epsilon*1000.0*sqr(ptest.e()) ) {
str[i1]->plus(ptest.plus());
str[i1]->pT(TransverseMomentum(ptest.x(), ptest.y()));
return true;
}
ptest = p3 + p2;
if ( ptest.m2() < Constants::epsilon*1000.0*sqr(ptest.e()) ) {
str[i3]->plus(ptest.plus());
str[i3]->pT(TransverseMomentum(ptest.x(), ptest.y()));
return true;
}
Energy2 S = (p1 + p2 + p3).m2();
if ( S <= ZERO ) return false;
LorentzRotation R = Utilities::boostToCM(makeTriplet(&p1, &p2, &p3));
double Psi = Constants::pi - p3.theta();
double beta = 0.0;
Energy W = sqrt(S);
double x1 = 2.0*p1.e()/W;
double x3 = 2.0*p3.e()/W;
bool g1 = str[i1]->flavour() == ParticleID::g;
bool g3 = str[i3]->flavour() == ParticleID::g;
if ( ( g1 && g3 ) || (!g1 && !g3 ) )
beta = Psi*sqr(x3)/(sqr(x1) + sqr(x3)); // minimize pt
else if ( g1 )
beta = Psi;
R.rotateY(-beta);
R.invert();
Lorentz5Momentum p1n(p1.m());
Lorentz5Momentum p3n(p3.m());
try {
SimplePhaseSpace::CMS(p1n, p3n, S, 1.0, 0.0);
} catch ( ImpossibleKinematics ) {
return false;
}
p1n.transform(R);
p3n.transform(R);
str[i1]->plus(p1n.plus());
str[i1]->pT(TransverseMomentum(p1n.x(), p1n.y()));
str[i3]->plus(p3n.plus());
str[i3]->pT(TransverseMomentum(p3n.x(), p3n.y()));
return true;
}
void EventFiller::persistentOutput(PersistentOStream & os) const {
os << theAbsorber << theRecoilScheme << theMode << theSingleMother
<< theDGLAPinPT << theEffectiveWeights << theFSSwingTime
<< theFSSwingTimeStep << theValenceChargeNormalisation
- << ounit(thePTCut, GeV) << theSoftRemove;
+ << ounit(thePTCut, GeV) << theSoftRemove << onlyOnce;
}
void EventFiller::persistentInput(PersistentIStream & is, int) {
is >> theAbsorber >> theRecoilScheme >> theMode >> theSingleMother
>> theDGLAPinPT >> theEffectiveWeights >> theFSSwingTime
>> theFSSwingTimeStep >> theValenceChargeNormalisation
- >> iunit(thePTCut, GeV) >> theSoftRemove;
+ >> iunit(thePTCut, GeV) >> theSoftRemove >> onlyOnce;
}
DescribeClass<EventFiller,HandlerBase>
describeDIPSYEventFiller("DIPSY::EventFiller", "libAriadne5.so libDIPSY.so");
void EventFiller::Init() {
static ClassDocumentation<EventFiller> documentation
("The EventFiller class is able to produce an initial ThePEG::Step "
"from two colliding DipoleStates.");
static Reference<EventFiller,DipoleAbsorber> interfaceDipoleAbsorber
("DipoleAbsorber",
"The object used to absorb non-interacting dipoles.",
&EventFiller::theAbsorber, true, false, true, true, false);
static Switch<EventFiller,int> interfaceMode
("Mode",
"How the real state is found from the virtual cascade. Speed versus consistency.",
&EventFiller::theMode, 0, true, false);
static SwitchOption interfaceModeMode
(interfaceMode,
"Consistent",
"The fully consistent version. Not currently reccomended.",
0);
static SwitchOption interfaceModeFast
(interfaceMode,
"Fast",
"Checking only the new real partons introduced by each new interaction, rather than rechecking them all. Good for heavy ions. Not currently reccomended.",
1);
static SwitchOption interfaceModeSingle
(interfaceMode,
"SingleSweep",
"Checking all partons, but sweeping just once in each direction, making it a lot faster. Good for heavy ions. May give an occasional unordered chain, but hopefully not too often. The recommended option.",
2);
static SwitchOption interfaceModeNonRecursive
(interfaceMode,
"NonRecursive",
"Does all evo no matter what. Then removes biggest problem, and does it all over again. Never turns partons back on once switched off.",
3);
static Switch<EventFiller,int> interfaceEffectiveWeights
("EffectiveWeights",
"How the p+ and pT recoils are distributed among the single partons in an effective parton.",
&EventFiller::theEffectiveWeights, 0, true, false);
static SwitchOption interfaceEffectiveWeightsPlusWeighted
(interfaceEffectiveWeights,
"PlusWeighted",
"Weight pt and plus according to p+ of the individual partons.",
0);
static SwitchOption interfaceEffectiveWeightsPlusEvenWeighted
(interfaceEffectiveWeights,
"PlusEvenWeighted",
"The plus is distibuted according to the plus of the partons, but the pt is shared evenly among the partons.",
1);
static SwitchOption interfaceEffectiveWeightsPlusSingleWeighted
(interfaceEffectiveWeights,
"PlusSingleWeighted",
"The plus is distibuted according to the plus of the partons, but the pt is taken only by the colour connected parton",
2);
static Switch<EventFiller,int> interfaceRecoilScheme
("RecoilScheme",
"How to give tread the positive light-cone momentum of a recoiling parton.",
&EventFiller::theRecoilScheme, 0, true, false);
static SwitchOption interfaceRecoilSchemePreservePlus
(interfaceRecoilScheme,
"PreservePlus",
"blaha",
0);
static SwitchOption interfaceRecoilSchemeFixedY
(interfaceRecoilScheme,
"FixedY",
"blahaaa",
1);
static SwitchOption interfaceRecoilSchemeFrameFan
(interfaceRecoilScheme,
"FrameFan",
"dssklajhls",
2);
static Parameter<EventFiller,int> interfaceSingleMother
("SingleMother",
"If an emission is regarded to come from a single parton rather than both "
" partons in the emitting dipole.",
&EventFiller::theSingleMother, 1, 1, 0, 0,
true, false, Interface::lowerlim);
static Parameter<EventFiller,int> interfaceDGLAPinPT
("DGLAPinPT",
"If the DGLAP supression should be made in terms of pt rather than r. "
" partons in the emitting dipole.",
&EventFiller::theDGLAPinPT, 1, 1, 0, 0,
true, false, Interface::lowerlim);
static Parameter<EventFiller,double> interfaceFSSwingTimeStep
("FSSwingTimeStep",
"How long time steps is are to be used for FS colour reconnections.",
&EventFiller::theFSSwingTimeStep, 0.1, 0.0, 0,
true, false, Interface::lowerlim);
static Parameter<EventFiller,double> interfaceFSSwingTime
("FSSwingTime",
"How long time is allowed for FS colour reconnections. 0 turns it off.",
&EventFiller::theFSSwingTime, 0.0, 0.0, 0,
true, false, Interface::lowerlim);
static Switch<EventFiller,int> interfaceValenceChargeNormalisation
("ValenceChargeNormalisation",
"How to treat the (too large) colour charge of the valence partons.",
&EventFiller::theValenceChargeNormalisation, 0, true, false);
static SwitchOption interfaceValenceChargeNormalisationNone
(interfaceValenceChargeNormalisation,
"None",
"Dont do anything.",
0);
static SwitchOption interfaceValenceChargeNormalisationSwing
(interfaceValenceChargeNormalisation,
"Swing",
"Swing some of the dipoles going to the valence partons",
1);
static Parameter<EventFiller,Energy> interfacePTCut
("PTCut",
"The minimum invariant transverse momentum allowed for a gluon. "
"Gluons below the cut will be removed from the final state. "
"If zero, no gluons will be removed.",
&EventFiller::thePTCut, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
true, false, Interface::lowerlim);
static Switch<EventFiller,int> interfaceSoftRemove
("SoftRemove",
"Determines if gluons with invariant transverse momentum below "
"<interface>PTCut</interface> should be reabsorbed.",
&EventFiller::theSoftRemove, 1, true, false);
static SwitchOption interfaceSoftRemoveOff
(interfaceSoftRemove,
"Off",
"No gluons are absorbed",
0);
static SwitchOption interfaceSoftRemoveAll
(interfaceSoftRemove,
"All",
"All soft gluons below the cut are absorbed.",
1);
static SwitchOption interfaceSoftRemoveNoValence
(interfaceSoftRemove,
"NoValence",
"All except valence gluons are absorbed if below the cut.",
2);
+
+ static Switch<EventFiller,bool> interfaceOnlyOnce
+ ("OnlyOnce",
+ "Do not allow a dipole to interact more than once.",
+ &EventFiller::onlyOnce, false, true, false);
+ static SwitchOption interfaceOnlyOnceManyInteractionsPerDipole
+ (interfaceOnlyOnce,
+ "ManyInteractionsPerDipole",
+ "Allow a dipole to interact several times.",
+ false);
+ static SwitchOption interfaceOnlyOnceOneInteractionPerDipole
+ (interfaceOnlyOnce,
+ "OneInteractionPerDipole",
+ "Only one interaction per dipole.",
+ true);
+
+
}
diff --git a/DIPSY/EventFiller.h b/DIPSY/EventFiller.h
--- a/DIPSY/EventFiller.h
+++ b/DIPSY/EventFiller.h
@@ -1,478 +1,483 @@
// -*- C++ -*-
#ifndef DIPSY_EventFiller_H
#define DIPSY_EventFiller_H
//
// This is the declaration of the EventFiller class.
//
#include "EventFiller.fh"
#include "ThePEG/Handlers/HandlerBase.h"
#include "DipoleEventHandler.fh"
#include "RealPartonState.fh"
#include "RealParton.fh"
#include "DipoleState.h"
#include "ImpactParameters.h"
#include "DipoleXSec.h"
#include "DipoleAbsorber.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Analysis/FactoryBase.h"
#ifndef LWH_AIAnalysisFactory_H
#ifndef LWH
#define LWH ThePEGLWH
#endif
#include "ThePEG/Analysis/LWH/AnalysisFactory.h"
#endif
namespace DIPSY {
using namespace ThePEG;
/**
* The EventFiller class is able to produce an initial
* ThePEG::Collision from two colliding DipoleStates.
*
* @see \ref EventFillerInterfaces "The interfaces"
* defined for EventFiller.
*/
class EventFiller: public HandlerBase {
public:
/**
* Copy FList typedef from DipoleXSec.
*/
typedef DipoleXSec::FList FList;
/**
* A String is simply a vector of colour-connected partons.
*/
typedef DipoleState::String String;
/**
* A vector of dipole pairs represented as iterators into an FList.
*/
typedef DipoleXSec::DipolePairVector DipolePairVector;
/**
* An ordered map of dipole pairs represented as iterators into an
* FList.
*/
typedef DipoleXSec::DipolePairMap DipolePairMap;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
EventFiller();
/**
* The destructor.
*/
virtual ~EventFiller();
//@}
public:
/** @name Virtual functions which can be overridden in subclasses. */
//@{
/**
* Fill the current collision object in the given DipoleEventHandler
* with the final state gluons produced when dipole states \a dl and
* \a dr collides with impact parameters \a b.
* @return the total interaction probability.
*/
virtual double fill(Step & step, DipoleEventHandler & eh, tPPair inc,
DipoleState & dl, DipoleState & dr,
const ImpactParameters & b) const;
/**
* Select which dipole pairs should interact, and return them in the
* order in which they should be processed.
*/
virtual pair<RealPartonStatePtr, RealPartonStatePtr>
selectInteractions(const FList & fl, const ImpactParameters & b, const DipoleXSec & xSec) const;
/**
* Tries to do the interaction between the real states lrs and rrs with the two dipoles
* pointed to by inter, assuming that the interactions in inters already has been tested
* and accepted. States collide at impact paramter b and using the recoils in xSec.
*/
bool addInteraction(FList::const_iterator inter,
RealPartonStatePtr lrs, RealPartonStatePtr rrs,
DipolePairVector & inters,
const ImpactParameters & b, const DipoleXSec & xSec) const ;
/**
* Extract all strings after according to the given interactions.
*/
virtual vector<String>
extractStrings(DipoleState & dl, DipoleState & dr,
pair<RealPartonStatePtr, RealPartonStatePtr>,
const ImpactParameters & b) const;
/**
* Fill the given Step with a SubProcess object using the given
* incoming particles and list of strings.
*/
virtual bool fillStep(Step & step, tPPair incoming,
const vector<String> & strings) const;
/**
* Fix up valens partons if they were not of the correct flavour or
* if they should collapse into a hadron.
*/
// virtual void fixValence(Step & step, DipoleState & dl, DipoleState & dr) const;
/**
* get the recoil scheme.
*/
inline int recoilScheme() const {
return theRecoilScheme;
}
/**
* set the recoil scheme.
*/
inline void recoilScheme(int x) {
theRecoilScheme = x;
}
/**
* get the mode.
*/
inline int mode() const {
return theMode;
}
/**
* set the mode.
*/
inline void mode(int x) {
theMode = x;
}
/**
* get the singleMother.
*/
inline int singleMother() const {
return theSingleMother;
}
/**
* set the singleMother.
*/
inline void singleMother(int x) {
theSingleMother = x;
}
/**
* get the DGLAPinPT.
*/
inline int DGLAPinPT() const {
return theDGLAPinPT;
}
/**
* set the DGLAPinPT.
*/
inline void DGLAPinPT(int x) {
theDGLAPinPT = x;
}
/**
* get the ValenceChargeNormalisation
**/
inline int valenceChargeNormalisation() const {
return theValenceChargeNormalisation;
}
/**
* The minimum squared invariant transverse momentum allowed for a
* gluon in a string.
*/
Energy2 pT2Cut() const {
return sqr(thePTCut);
}
/**
* Return the squared invariant transverse momentum of gluon \a i2
* in a string given its colour-neighbours \a i1 and \a i3.
*/
static Energy2 invPT2(const String & str, int i1, int i2, int i3);
/**
* Remove a gluon \a i2 in a string shuffling its momenum to its
* colour-neighbours \a i1 and \a i3.
*/
static bool removeGluon(const String & str, int i1, int i2, int i3);
/**
* get the effectiveWeights.
*/
inline int effectiveWeights() const {
return theEffectiveWeights;
}
/**
* get the FS swing time.
*/
inline double FSSwingTime() const {
return theFSSwingTime;
}
/**
* get the step size for the FS swing time.
*/
inline double FSSwingTimeStep() const {
return theFSSwingTimeStep;
}
//@}
public:
/**
* Get the object used to absorb non-interacting dipoles.
*/
inline DipoleAbsorberPtr absorber() const {
return theAbsorber;
}
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;
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
protected:
/**
* The weight which will be used for the event being generated.
*/
mutable double currentWeight;
mutable bool fail;
/**
* Debug/testing
*/
protected:
mutable double nInt;
mutable double nInt1;
mutable double nTried;
mutable double nEvents;
mutable double nTestedInts;
mutable double foundInt;
mutable double failedEvo;
mutable double failedRec;
mutable double rescatter;
mutable double overTenEvents;
mutable double rejectedEvents;
mutable double nLoops;
mutable double nYes;
mutable double nNo;
mutable double avYInEvo;
mutable double avYInInt;
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() throw(InitException);
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Is this where this should be declared?? :o
*/
virtual void dofinish();
private:
protected:
/**
* balances p+/p- by moving the entire state in rapidity. Assumed to be
* UNMIRRORED states, ie, plus and minus are flipped for the right state.
**/
void fixBoost(RealPartonStatePtr lrs, RealPartonStatePtr rrs) const;
/**
* Checks through the final state and tries to fix the most blatant errors.
* Specially tries to catch bad momenta that can cause crashes.
**/
void dodgeErrors(DipoleStatePtr finalState) const;
/**
* Checks if the interacting partons in the current states have enough
* p+- to set the other state on shell.
*/
bool controlRecoils(DipolePairVector & sel,
RealPartonStatePtr rrs, RealPartonStatePtr lrs,
const ImpactParameters & b, const DipoleXSec & xSec,
pair<pair<bool, bool>, pair<bool, bool> > doesInt) const;
/**
* Removes the off shell partons and recouples colour flow. p_mu unchanged.
*/
void removeVirtuals(DipoleStatePtr state) const;
/**
* Removes the parton and recouples colour flow. p_mu unchanegd.
*/
void removeParton(tPartonPtr p) const;
/**
* find the pT scale through the dipolestates eventhandlers emitter object.
*/
double pTScale(DipoleState &) const;
/**
* Takes statistics on the number of participants
* in a heavy ion collision.
*/
void countParticipants(const DipoleState & dl, const DipoleState & dr, const InvEnergy b) const;
/**
* The object used to absorb non-interacting dipoles.
*/
DipoleAbsorberPtr theAbsorber;
/**
* What scheme to use when doing recoils.
*/
int theRecoilScheme;
/**
* In what mode to create the real state. Fast vs consistent.
*/
int theMode;
/**
* If partons have one or two mothers.
*/
int theSingleMother;
/**
* If DGLAP supression is made in terms of pt rather than r.
*/
int theDGLAPinPT;
/**
* How to distribute recoil among the members of an effective parton.
*/
int theEffectiveWeights;
/**
* How long time (in GeV-1) the FS get's to do colour reconnections.
*/
double theFSSwingTime;
/**
* How large time steps (in GeV-1) used in the FS colour
* reconnections.
*/
double theFSSwingTimeStep;
/**
* How the valence charge is handled.
**/
int theValenceChargeNormalisation;
/**
* The minimum invariant transverse momentum allowed for a gluon in a string.
*/
Energy thePTCut;
/**
* Options for removing gluons with too small invariant transverse
* momentum.
*/
int theSoftRemove;
+ /**
+ * Do not allow a dipole to interact more than once.
+ */
+ bool onlyOnce;
+
public:
/**
* Exception class for space-like gluon momenta.
*/
struct SpaceLikeGluons: public Exception {};
/**
* Exception class for failed gluon removal.
*/
struct RemoveGluonException: public Exception {};
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
EventFiller & operator=(const EventFiller &);
};
}
#endif /* DIPSY_EventFiller_H */
diff --git a/DIPSY/ImpactParameters.h b/DIPSY/ImpactParameters.h
--- a/DIPSY/ImpactParameters.h
+++ b/DIPSY/ImpactParameters.h
@@ -1,170 +1,204 @@
// -*- C++ -*-
#ifndef DIPSY_ImpactParameters_H
#define DIPSY_ImpactParameters_H
//
// This is the declaration of the ImpactParameters class.
//
#include "Parton.h"
namespace DIPSY {
using namespace ThePEG;
/**
* When two <code>DipoleState</code>s have been generated w.r.t.
* origo in the transverse, one of them may be displaced and rotated
* according to an object of the ImpactParameters class before
* collision. The ImpactParameters are typically generated using an
* ImpactParameterGenerator object. If not generated according to a
* flat distribution, a weight may be specified in the
* ImpactParameters object.
*/
class ImpactParameters {
public:
/**
* Use the same Point class as the Parton.
*/
typedef Parton::Point Point;
public:
/** @name Standard constructors. */
//@{
/**
* The default constructor, taking the displacement \a b and
* rotation \a angle as optional arguments. If generated with a
* non-flat distribution an optional weight \a w can be supplied.
*/
inline ImpactParameters(const Point & b = Point(), double angle = 0.0,
- InvEnergy2 w = 1.0/GeV2);
+ InvEnergy2 w = 1.0/GeV2)
+ : theBVec(b), thePhi(angle), theCosPhi(cos(angle)),
+ theSinPhi(sin(angle)), theWeight(w) {}
/**
* The assignment operator
*/
- inline ImpactParameters & operator=(const ImpactParameters &);
+ inline ImpactParameters & operator=(const ImpactParameters & x) {
+ theBVec = x.theBVec;
+ thePhi = x.thePhi;
+ theCosPhi = x.theCosPhi;
+ theSinPhi = x.theSinPhi;
+ theWeight = x.theWeight;
+ return *this;
+ }
//@}
/** @name Simple access functions. */
//@{
/**
* The transverse displacement in impact parameter space of one
* dipole system w.r.t. the other.
*/
- inline const Point & bVec() const;
+ inline const Point & bVec() const {
+ return theBVec;
+ }
/**
* The azimuthal rotation of one dipole system w.r.t. the other.
*/
- inline double phi() const;
+ inline double phi() const {
+ return thePhi;
+ }
/**
* The cosine of the azimuthal rotation of one dipole system w.r.t. the other.
*/
inline double cosPhi() const {
return theCosPhi;
}
/**
* The sine of the azimuthal rotation of one dipole system w.r.t. the other.
*/
inline double sinPhi() const {
return theSinPhi;
}
/**
* The weight associated with generating these ImpactParameters.
*/
- inline InvEnergy2 weight() const;
+ inline InvEnergy2 weight() const {
+ return theWeight;
+ }
//@}
/**
* Calculate the squared distance between two partons, assuming the second
* has been rotated and displaced according to these
* ImpactParameters.
*/
- inline InvEnergy2 dist2(const Parton &, const Parton &) const;
+ inline InvEnergy2 dist2(const Parton & pi, const Parton & pj) const {
+ return sqr(pi.position().x() - bVec().x()
+ - pj.position().x()*cosPhi() - pj.position().y()*sinPhi()) +
+ sqr(pi.position().y() - bVec().y()
+ - pj.position().y()*cosPhi() + pj.position().x()*sinPhi());
+ }
/**
* Calculate the squared distance between two partons, assuming the second
* has been rotated and displaced according to these
* ImpactParameters.
*/
- inline InvEnergy dist(const Parton &, const Parton &) const;
+ inline InvEnergy dist(const Parton & pi, const Parton & pj) const {
+ return sqrt(dist2(pi, pj));
+ }
/**
- * Rotates the momentum with the azimuthal angle of the second system wrt the first.
+ * Rotates the momentum with the azimuthal angle of the second
+ * system wrt the first.
*/
inline TransverseMomentum rotatePT(const TransverseMomentum p) const {
return TransverseMomentum( p.x()*cosPhi() + p.y()*sinPhi(),
-p.x()*sinPhi() + p.y()*cosPhi() );
}
/**
+ * Rotate and translate the given parton.
+ */
+ inline void translate(tPartonPtr p) const {
+ p->position(rotate(p->position()) + bVec());
+ p->pT(rotatePT(p->pT()));
+ }
+
+ /**
* Rotates the point with the azimuthal angle of the second system wrt the first.
*/
inline Point rotate(const Point p) const {
- return Point( p.x()*cosPhi() + p.y()*sinPhi(),
- -p.x()*sinPhi() + p.y()*cosPhi() );
+ return Point(p.x()*cosPhi() + p.y()*sinPhi(),
+ -p.x()*sinPhi() + p.y()*cosPhi());
}
/**
* Rotates the momentum with the azimuthal angle of the first system wrt the second.
*/
inline TransverseMomentum invRotatePT(const TransverseMomentum p) const {
return TransverseMomentum( p.x()*cosPhi() - p.y()*sinPhi(),
p.x()*sinPhi() + p.y()*cosPhi() );
}
/**
* Rotates the momentum with the azimuthal angle of the first system wrt the second.
*/
inline Point invRotate(const Point p) const {
return Point( p.x()*cosPhi() - p.y()*sinPhi(),
p.x()*sinPhi() + p.y()*cosPhi() );
}
/**
* Calculate the vector from the first to the second point, assuming the second
* has been rotated and displaced according to these ImpactParamters.
*/
- inline Point difference(const Point, const Point) const;
+ inline Point difference(const Point pi, const Point pj) const {
+ return ImpactParameters::Point(- pi.x() + bVec().x()
+ + pj.x()*cosPhi() + pj.y()*sinPhi(),
+ - pi.y() + bVec().y()
+ + pj.y()*cosPhi() - pj.x()*sinPhi());
+ }
private:
/**
* The transverse displacement in impact parameter space of one
* dipole system w.r.t. the other.
*/
Point theBVec;
/**
* The azimuthal rotation of one dipole system w.r.t. the other.
*/
double thePhi;
/**
* The cosine of the azimuthal rotation of one dipole system w.r.t. the other.
*/
double theCosPhi;
/**
* The sine of the azimuthal rotation of one dipole system w.r.t. the other.
*/
double theSinPhi;
/**
* The weight associated with generating these ImpactParameters.
*/
InvEnergy2 theWeight;
};
}
-#include "ImpactParameters.icc"
-
#endif /* DIPSY_ImpactParameters_H */
diff --git a/DIPSY/ImpactParameters.icc b/DIPSY/ImpactParameters.icc
deleted file mode 100644
--- a/DIPSY/ImpactParameters.icc
+++ /dev/null
@@ -1,57 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the ImpactParameters class.
-//
-
-namespace DIPSY {
-
-inline ImpactParameters::
-ImpactParameters(const Point & newBVec, double newPhi, InvEnergy2 newWeight)
- : theBVec(newBVec), thePhi(newPhi), theCosPhi(cos(newPhi)),
- theSinPhi(sin(newPhi)), theWeight(newWeight) {}
-
-inline ImpactParameters & ImpactParameters::
-operator=(const ImpactParameters & x) {
- theBVec = x.theBVec;
- thePhi = x.thePhi;
- theCosPhi = x.theCosPhi;
- theSinPhi = x.theSinPhi;
- theWeight = x.theWeight;
- return *this;
-}
-
-inline const ImpactParameters::Point & ImpactParameters::bVec() const {
- return theBVec;
-}
-
-inline double ImpactParameters::phi() const {
- return thePhi;
-}
-
-inline InvEnergy2 ImpactParameters::
-dist2(const Parton & pi, const Parton & pj) const {
- return sqr(pi.position().x() - bVec().x()
- - pj.position().x()*cosPhi() - pj.position().y()*sinPhi()) +
- sqr(pi.position().y() - bVec().y()
- - pj.position().y()*cosPhi() + pj.position().x()*sinPhi());
-}
-
-inline InvEnergy ImpactParameters::
-dist(const Parton & pi, const Parton & pj) const {
- return sqrt(dist2(pi, pj));
-}
-
-inline ImpactParameters::Point ImpactParameters::
-difference(const ImpactParameters::Point pi, const ImpactParameters::Point pj) const {
- return ImpactParameters::Point(- pi.x() + bVec().x()
- + pj.x()*cosPhi() + pj.y()*sinPhi(),
- - pi.y() + bVec().y()
- + pj.y()*cosPhi() - pj.x()*sinPhi());
-}
-
-inline InvEnergy2 ImpactParameters::weight() const {
- return theWeight;
-}
-
-}
diff --git a/DIPSY/Makefile.am b/DIPSY/Makefile.am
--- a/DIPSY/Makefile.am
+++ b/DIPSY/Makefile.am
@@ -1,147 +1,147 @@
AUTOMAKE_OPTIONS = -Wno-portability
mySOURCES = DipoleEventHandler.cc WaveFunction.cc SimpleProton.cc \
VirtualPhoton.cc DipoleState.cc Dipole.cc Parton.cc DipoleXSec.cc \
ImpactParameterGenerator.cc WFInfo.cc PhotonWFInfo.cc \
VectorMesonBase.cc PhotonDipoleState.cc SimpleProtonState.cc \
Emitter.cc Swinger.cc DipoleAnalysisHandler.cc \
TotalXSecAnalysis.cc EventFiller.cc DipoleAbsorber.cc \
SmallDipoleAbsorber.cc EffectiveParton.cc RealParton.cc \
RealPartonState.cc DiffractiveEventFiller.cc ParticleInfo.cc \
NucleusData.cc
DOCFILES = DipoleEventHandler.h WaveFunction.h SimpleProton.h VirtualPhoton.h \
DipoleState.h Dipole.h Parton.h DipoleXSec.h ImpactParameters.h \
ImpactParameterGenerator.h WFInfo.h PhotonWFInfo.h VectorMesonBase.h \
PhotonDipoleState.h SimpleProtonState.h Emitter.h Swinger.h \
DipoleAnalysisHandler.h TotalXSecAnalysis.h EventFiller.h \
DipoleAbsorber.h SmallDipoleAbsorber.h EffectiveParton.h \
RealParton.h RealPartonState.h DiffractiveEventFiller.h ParticleInfo.h \
NucleusData.h
-INCLUDEFILES = $(DOCFILES) DipoleEventHandler.fh \
- WaveFunction.icc WaveFunction.fh \
- VirtualPhoton.icc DipoleState.fh DipoleState.icc Dipole.fh \
- Dipole.icc Parton.fh Parton.icc DipoleXSec.fh DipoleXSec.icc \
- ImpactParameters.icc ImpactParameterGenerator.fh WFInfo.fh \
- PhotonWFInfo.icc VectorMesonBase.icc PhotonDipoleState.icc \
- SimpleProtonState.icc Emitter.fh Emitter.icc Swinger.fh \
- Swinger.icc DipoleAnalysisHandler.fh EventFiller.fh \
+INCLUDEFILES = $(DOCFILES) DipoleEventHandler.fh WaveFunction.fh \
+ DipoleState.fh Dipole.fh Parton.fh DipoleXSec.fh \
+ ImpactParameterGenerator.fh WFInfo.fh \
+ Emitter.fh Swinger.fh DipoleAnalysisHandler.fh EventFiller.fh \
DipoleAbsorber.fh EffectiveParton.fh \
RealParton.fh RealPartonState.fh CPUTimer.h
pkglib_LTLIBRARIES = libDIPSY.la OldStyleEmitter.la PT1DEmitter.la \
ElasticXSecAnalysis.la LargePTDipoleAbsorber.la \
SimpleNucleus.la RecoilSwinger.la \
- FSDipole5Ordering.la FSAnalysis.la GapAnalysis.la HIAnalysis.la \
- FixedImpactGenerator.la NoFluctXSecAnalysis.la GlauberAnalysis.la \
+ FSDipole5Ordering.la FSAnalysis.la GapAnalysis.la \
+ HIAnalysis.la FixedImpactGenerator.la \
+ NoFluctXSecAnalysis.la GlauberAnalysis.la \
AnalysisProgress.la SemiInclusiveXSecAnalysis.la \
- GaussianImpactGenerator.la
+ GaussianImpactGenerator.la PTAnalysis.la
INPUTFILES = TestXSecs.in RivetAnalyses.in DIPSYRemove.in DIPSYDefaults.in CurrentTune.in Tune27.in
CLEANFILES = done-all-links
dist_pkgdata_DATA = $(INPUTFILES)
rpodir = $(pkglibdir)
nodist_rpo_DATA = DIPSYDefaults.rpo
# Version info should be updated if any interface or persistent I/O
# function is changed
libDIPSY_la_LDFLAGS = -module -version-info 1:0:0
# libDIPSY_la_LIBADD = ../Config/libAriadne5Config.la
libDIPSY_la_SOURCES = $(mySOURCES) $(INCLUDEFILES)
OldStyleEmitter_la_LDFLAGS = -module -version-info 1:0:0
OldStyleEmitter_la_SOURCES = OldStyleEmitter.cc OldStyleEmitter.h
FSDipole5Ordering_la_LDFLAGS = -module -version-info 1:0:0
FSDipole5Ordering_la_SOURCES = FSDipole5Ordering.cc FSDipole5Ordering.h
FSAnalysis_la_LDFLAGS = -module -version-info 1:0:0
FSAnalysis_la_SOURCES = FSAnalysis.cc FSAnalysis.h
+PTAnalysis_la_LDFLAGS = -module -version-info 1:0:0
+PTAnalysis_la_SOURCES = PTAnalysis.cc PTAnalysis.h
+
GapAnalysis_la_LDFLAGS = -module -version-info 1:0:0
GapAnalysis_la_SOURCES = GapAnalysis.cc GapAnalysis.h
HIAnalysis_la_LDFLAGS = -module -version-info 1:0:0
HIAnalysis_la_SOURCES = HIAnalysis.cc HIAnalysis.h
PT1DEmitter_la_LDFLAGS = -module -version-info 1:0:0
PT1DEmitter_la_SOURCES = PT1DEmitter.cc PT1DEmitter.h
ElasticXSecAnalysis_la_LDFLAGS = -module -version-info 1:0:0
ElasticXSecAnalysis_la_SOURCES = ElasticXSecAnalysis.cc ElasticXSecAnalysis.h
NoFluctXSecAnalysis_la_LDFLAGS = -module -version-info 1:0:0
NoFluctXSecAnalysis_la_SOURCES = NoFluctXSecAnalysis.cc NoFluctXSecAnalysis.h
SemiInclusiveXSecAnalysis_la_LDFLAGS = -module -version-info 1:0:0
SemiInclusiveXSecAnalysis_la_SOURCES = SemiInclusiveXSecAnalysis.cc SemiInclusiveXSecAnalysis.h
GlauberAnalysis_la_LDFLAGS = -module -version-info 1:0:0
GlauberAnalysis_la_SOURCES = GlauberAnalysis.cc GlauberAnalysis.h
AnalysisProgress_la_LDFLAGS = -module -version-info 1:0:0
AnalysisProgress_la_SOURCES = AnalysisProgress.cc AnalysisProgress.h
LargePTDipoleAbsorber_la_LDFLAGS = -module -version-info 1:0:0
LargePTDipoleAbsorber_la_SOURCES = LargePTDipoleAbsorber.cc LargePTDipoleAbsorber.h
SimpleNucleus_la_LDFLAGS = -module -version-info 1:0:0
SimpleNucleus_la_SOURCES = SimpleNucleus.cc SimpleNucleus.h \
SimpleNucleusState.cc SimpleNucleusState.h
RecoilSwinger_la_LDFLAGS = -module -version-info 1:0:0
RecoilSwinger_la_SOURCES = RecoilSwinger.cc RecoilSwinger.h
FixedImpactGenerator_la_LDFLAGS = -module -version-info 1:0:0
FixedImpactGenerator_la_SOURCES = FixedImpactGenerator.cc FixedImpactGenerator.h
GaussianImpactGenerator_la_LDFLAGS = -module -version-info 1:0:0
GaussianImpactGenerator_la_SOURCES = GaussianImpactGenerator.cc GaussianImpactGenerator.h
EXTRACLASSES = OldStyleEmitter.la PT1DEmitter.la ElasticXSecAnalysis.la \
LargePTDipoleAbsorber.la RecoilSwinger.la SimpleNucleus.la \
FSAnalysis.la GapAnalysis.la HIAnalysis.la \
FixedImpactGenerator.la FSDipole5Ordering.la
done-all-links:
@EMPTY@ifdef SHOWCOMMAND
for file in $(INPUTFILES); do \
if test ! -f $$file; then $(LN_S) $(srcdir)/$$file $$file; fi; done
echo "stamp" > done-all-links
@EMPTY@else
@echo "sym-linking input files files..."
@for file in $(INPUTFILES); do \
if test ! -f $$file; then $(LN_S) $(srcdir)/$$file $$file; fi; done
@echo "stamp" > done-all-links
@EMPTY@endif
DIPSYDefaults.rpo: done-all-links DIPSYDefaults.in libDIPSY.la $(EXTRACLASSES) $(THEPEGLIB)/ThePEGDefaults.rpo ../lib/Ariadne5Defaults.rpo
$(SETUPTHEPEG) -L../lib -L$(THEPEGLIB) -L ../../TheP8I/lib -L .libs -L ../src/.libs --exitonerror --init -r ../lib/Ariadne5Defaults.rpo -o DIPSYDefaults.rpo DIPSYDefaults.in
cd ../lib; $(LN_S) -f ../DIPSY/DIPSYDefaults.rpo .
Test5%.run: Test5%.in DIPSYDefaults.rpo CurrentTune.in RivetAnalyses.in
$(SETUPTHEPEG) --exitonerror -L .libs -L ../../Pythia7/src/.libs -r DIPSYDefaults.rpo $<
%.run: %.in DIPSYDefaults.rpo CurrentTune.in RivetAnalyses.in
$(SETUPTHEPEG) -L../lib --exitonerror -L .libs -r DIPSYDefaults.rpo $<
%.out: %.run
time $(RUNTHEPEG) --tics -d 0 $<
valgrind:
valgrind --leak-check=full --num-callers=25 --track-fds=yes --freelist-vol=100000000 --leak-resolution=med --trace-children=yes $(top_builddir)/../ThePEG/src/setupThePEG -L ../../ThePEG/lib -L../../Pythia7/lib --exitonerror -L../../TheP8I/lib -L .libs -L ../lib -r ../lib/Ariadne5Defaults.rpo TestFull.in &> /tmp/valgrind.out
valgrind --leak-check=full --num-callers=25 --track-fds=yes --freelist-vol=100000000 --leak-resolution=med --trace-children=yes $(top_builddir)/../ThePEG/src/runThePEG -N 10 TestFull.run >> /tmp/valgrind.out 2>&1
install-data-local:
LD_LIBRARY_PATH=$(DESTDIR)$(pkglibdir):$$LD_LIBRARY_PATH $(DESTDIR)$(bindir)/setupThePEG --exitonerror --init -i $(DESTDIR)$(pkgdatadir) -r $(DESTDIR)$(pkglibdir)/ThePEGDefaults.rpo -o $(DESTDIR)$(pkglibdir)/ThePEGDefaults.rpo $(srcdir)/DIPSYDefaults.in
unregister-from-repo:
LD_LIBRARY_PATH=$(DESTDIR)$(pkglibdir):$$LD_LIBRARY_PATH $(DESTDIR)$(bindir)/setupThePEG --exitonerror --init -r $(DESTDIR)$(pkglibdir)/ThePEGDefaults.rpo -o $(DESTDIR)$(pkglibdir)/ThePEGDefaults.rpo $(srcdir)/DIPSYRemove.in
include $(top_srcdir)/Config/Makefile.aminclude
diff --git a/DIPSY/NewSwinger.cc b/DIPSY/NewSwinger.cc
--- a/DIPSY/NewSwinger.cc
+++ b/DIPSY/NewSwinger.cc
@@ -1,425 +1,427 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the Swinger class.
//
#include "Swinger.h"
#include "Dipole.h"
#include "DipoleState.h"
#include "DipoleEventHandler.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Utilities/Throw.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Interface/Parameter.h"
#include "CPUTimer.h"
#ifdef ThePEG_TEMPLATES_IN_CC_FILE
// #include "Swinger.tcc"
#endif
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace DIPSY;
Swinger::~Swinger() {}
void Swinger::testGenerate(set<DipolePtr> & dips,double miny, double maxy) {
cout << "Testing Swinger....." << endl;
set<DipolePtr>::iterator it;
DipoleState testState = DipoleState();
for(it = dips.begin();it!=dips.end();it++) {
testState.addDipole(*(*it));
(*it)->dipoleState(& testState);
}
testState.sortDipoles();
thestMode = true;
ofstream youtput("SwingerTest.dat");
int ysteps = 100;
double ystepsize = 0.1;
vector<int> ybin(ysteps,0);
double y;
it=dips.begin();
for(int i=0;i<1000000;i++) {
(*it)->generatedY(maxy);
generate(*(*it),miny, maxy,true);
if((*it)->swingDipole()) {
y = (*it)->generatedY();
if(y-miny<ysteps*ystepsize)
ybin[int((y-miny)/ystepsize)]++;
}
(*it)->reset();
}
for(int i=0;i<ysteps;i++) {
youtput << (i+0.5)*ystepsize << '\t' << ybin[i] << endl;
}
youtput.close();
thestMode = false;
cout << "Done testing Swinger."
<< endl;
}
bool Swinger::forceGenerate(Dipole & dipole, double ymax) const {
const vector<tDipolePtr> & candidates =
dipole.dipoleState().swingCandidates(dipole.colour());
for (vector<tDipolePtr>::size_type i = 0; i < candidates.size(); i++ ) {
if ( candidates[i] == & dipole ) continue;
if ( candidates[i]->neighbors().first == & dipole ||
candidates[i]->neighbors().second == & dipole ) continue;
InvEnergy2 a = dipole.partons().first->dist2(*dipole.partons().second);
InvEnergy2 b = candidates[i]->partons().first->dist2(*(candidates[i]->partons().second));
InvEnergy2 c = dipole.partons().second->dist2(*candidates[i]->partons().first);
InvEnergy2 d = dipole.partons().first->dist2(*candidates[i]->partons().second);
a = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(a)/Current<DipoleEventHandler>()->rMax()) - 1.0);
b = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(b)/Current<DipoleEventHandler>()->rMax()) - 1.0);
c = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(c)/Current<DipoleEventHandler>()->rMax()) - 1.0);
d = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(d)/Current<DipoleEventHandler>()->rMax()) - 1.0);
double yi = -log( UseRandom::rnd() )*c*d/(a*b);
if ( yi < dipole.generatedY() || !(dipole.swingDipole()) ) {
if( yi < ymax || ymax == 0.0 ) { //Don't do ridiculously improbable swings.
dipole.swingDipole(candidates[i]);
dipole.generatedY(yi);
}
}
}
if( (dipole.swingDipole()) ) return true;
else return false;
}
void Swinger::generateFS(Dipole & dipole, double miny, double maxy) const {
//old implementation
bool force = !dipole.hasGen();
const vector<tDipolePtr> & candidates =
dipole.dipoleState().swingCandidates(dipole.colour());
vector<tDipolePtr>::size_type i = 0;
while ( i < candidates.size() && candidates[i++] != & dipole );
if ( i == candidates.size() && candidates[i - 1] != & dipole )
Throw<SwingConsistencyException>()
<< "FSswinger not found among candidates" << Exception::abortnow;
for (; i < candidates.size(); ++i ) {
if(candidates[i]->children().first)
cout << "OH NOES, parents among the swing candidates!!!! O_o" << endl;
if ( dipole.neighbors().first == candidates[i] ||
dipole.neighbors().second == candidates[i] )
continue;
if ( !force && candidates[i]->hasGen() ) continue;
// Generate a y
double R = -log( UseRandom::rnd() );
double amp = swingAmpFS(dipole.partons(),
candidates[i]->partons(), miny/GeV2);
// double amp = swingAmpFS(dipole, *candidates[i], miny/GeV2);
double yi = Constants::MaxRapidity;
if ( miny*amp + R < Constants::MaxRapidity*amp ) yi = miny + R/amp;
if ( yi < dipole.generatedY() || !dipole.hasGen() ) {
dipole.swingDipole(candidates[i]);
dipole.generatedY(yi);
dipole.recoilSwing(false);
}
}
}
InvEnergy2 Swinger::
swingDistanceFS(const Parton & p1, const Parton & p2, InvEnergy2 time) const {
// static CPUClock cpuclock("DIPSY::Swinger::swingDinstanceFS");
// CPUTimer timer(cpuclock);
static DebugItem notime("DIPSY::NoSwingTime", 60);
if ( notime ) time = ZERO;
Energy2 E2 = p1.plus()*p2.minus() + p1.minus()*p2.plus();
Parton::Point x1 = p1.position() - p2.position() + time*p1.pT();
Parton::Point x2 = p1.position() - p2.position() - time*p2.pT();
InvEnergy2 xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
Energy2 ppScalar = p1.pT().x()*p2.pT().x() + p1.pT().y()*p2.pT().y();
InvEnergy2 a = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
if ( a <= ZERO ) return ZERO;
double asa = Current<DipoleEventHandler>()->alphaS(sqrt(a));
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
return sqr(rmax)/asa*sqr(exp(sqrt(a)/rmax) - 1.0);
}
double Swinger::
swingAmpFS(InvEnergy2 a, InvEnergy2 b, InvEnergy2 c, InvEnergy2 d) const {
static double eps = 0.0000000000001;
if ( a <= ZERO || b <= ZERO || c <= ZERO || d <= ZERO ) return eps;
if ( sqrt(a*b) < sqrt(c)*sqrt(d)*sqrt(theLambda*eps) ) return eps;
return a*b/(c*d)*theLambda;
}
double Swinger::swingAmpFS(const pair<tPartonPtr, tPartonPtr> firstDip,
const pair<tPartonPtr, tPartonPtr> secondDip,
InvEnergy2 time) const {
//parton start in their original transverse position and z = 0, then move at
//lightspeed in a direction determined by the momentum.
static double eps = 0.0000000000001;
tPartonPtr p11 = firstDip.first;
tPartonPtr p12 = firstDip.second;
tPartonPtr p21 = secondDip.first;
tPartonPtr p22 = secondDip.second;
//these squared distances a,b,c,d between partons goes as (x1+t*pt1) - (x2+t*pt2) for small t,
//and as invariant mass times t for large t
Energy2 E2 = p11->plus()*p12->minus() + p11->minus()*p12->plus();
Parton::Point x1 = p11->position() - p12->position() + time*p11->pT();
Parton::Point x2 = p11->position() - p12->position() - time*p12->pT();
InvEnergy2 xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
Energy2 ppScalar = p11->pT().x()*p12->pT().x() + p11->pT().y()*p12->pT().y();
InvEnergy2 a = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
E2 = p21->plus()*p22->minus() + p21->minus()*p22->plus();
x1 = p21->position() - p22->position() + time*p21->pT();
x2 = p21->position() - p22->position() - time*p22->pT();
xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
ppScalar = p21->pT().x()*p22->pT().x() + p21->pT().y()*p22->pT().y();
InvEnergy2 b = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
E2 = p21->plus()*p12->minus() + p21->minus()*p12->plus();
x1 = p21->position() - p12->position() + time*p21->pT();
x2 = p21->position() - p12->position() - time*p12->pT();
xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
ppScalar = p21->pT().x()*p12->pT().x() + p21->pT().y()*p12->pT().y();
InvEnergy2 c = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
E2 = p11->plus()*p22->minus() + p11->minus()*p22->plus();
x1 = p11->position() - p22->position() + time*p11->pT();
x2 = p11->position() - p22->position() - time*p22->pT();
xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
ppScalar = p11->pT().x()*p22->pT().x() + p11->pT().y()*p22->pT().y();
InvEnergy2 d = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
if ( a <= ZERO || b <= ZERO || c <= ZERO || d <= ZERO ) return eps;
//normal confinement correction
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
double asa = Current<DipoleEventHandler>()->alphaS(sqrt(a));
double asb = Current<DipoleEventHandler>()->alphaS(sqrt(b));
double asc = Current<DipoleEventHandler>()->alphaS(sqrt(c));
double asd = Current<DipoleEventHandler>()->alphaS(sqrt(d));
a = sqr(rmax)/asa*sqr(exp(sqrt(a)/rmax) - 1.0);
b = sqr(rmax)/asb*sqr(exp(sqrt(b)/rmax) - 1.0);
c = sqr(rmax)/asc*sqr(exp(sqrt(c)/rmax) - 1.0);
d = sqr(rmax)/asd*sqr(exp(sqrt(d)/rmax) - 1.0);
//normal amplitude
if ( sqrt(a*b) < sqrt(c)*sqrt(d)*sqrt(theLambda*eps) ) return eps;
return a*b/(c*d)*theLambda;
}
void Swinger::generate(Dipole & dipole, double miny, double maxy, bool force) const {
//old implementation
double yi = max(max(dipole.partons().first->y(),
dipole.partons().second->y()), miny);
if ( dipole.partons().second == dipole.partons().first )
Throw<ColourIndexException>()
<< "Found inconsistent colour indices in DIPSY. Event discarded."
<< Exception::eventerror;
if( dipole.children().first)
Throw<SwingConsistencyException>()
<< "OH NOES, parents among the swing candidates!!!! O_o"
<< Exception::abortnow;
const vector<tDipolePtr> & candidates =
dipole.dipoleState().swingCandidates(dipole.colour());
vector<tDipolePtr>::size_type i = 0;
while ( i < candidates.size() && candidates[i++] != &dipole );
for (; i < candidates.size(); ++i ) {
if ( !force && candidates[i]->hasGen() ) continue;
double yn = yi - log(UseRandom::rnd())/swingAmp(dipole, *candidates[i]);
if ( yn < dipole.generatedY() ) {
dipole.swingDipole(candidates[i]);
dipole.generatedY(yn);
dipole.recoilSwing(false);
}
}
}
double Swinger::swingAmp(const Dipole & firstDip,
const Dipole & secondDip) const {
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
InvEnergy2 a = firstDip.swingCache;
if ( a < ZERO ) {
a = firstDip.partons().first->dist2(*firstDip.partons().second);
a = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(a)))*
sqr(exp(sqrt(a)/rmax) - 1.0);
firstDip.swingCache = a;
}
InvEnergy2 b = secondDip.swingCache;
if ( b < ZERO ) {
b = secondDip.partons().first->dist2(*(secondDip.partons().second));
b = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(b)))*
sqr(exp(sqrt(b)/rmax) - 1.0);
secondDip.swingCache = b;
}
InvEnergy2 c = firstDip.partons().second->dist2(*secondDip.partons().first);
c = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(c)))*
sqr(exp(sqrt(c)/rmax) - 1.0);
InvEnergy2 d = firstDip.partons().first->dist2(*secondDip.partons().second);
d = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(d)))*
sqr(exp(sqrt(d)/rmax) - 1.0);
return a*b/(c*d)*theLambda;
}
double Swinger::swingAmp(const pair<tPartonPtr, tPartonPtr> firstDip,
const pair<tPartonPtr, tPartonPtr> secondDip) const {
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
InvEnergy2 a = firstDip.first->dist2(*firstDip.second);
InvEnergy2 b = secondDip.first->dist2(*(secondDip.second));
InvEnergy2 c = firstDip.second->dist2(*secondDip.first);
InvEnergy2 d = firstDip.first->dist2(*secondDip.second);
a = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(a)))*
sqr(exp(sqrt(a)/rmax) - 1.0);
b = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(b)))*
sqr(exp(sqrt(b)/rmax) - 1.0);
c = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(c)))*
sqr(exp(sqrt(c)/rmax) - 1.0);
d = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(d)))*
sqr(exp(sqrt(d)/rmax) - 1.0);
return a*b/(c*d)*theLambda;
}
bool Swinger::checkMaxY(DipolePtr d1, DipolePtr d2, double maxy) const {
tPartonPtr p1 = d1->partons().first;
tPartonPtr p2 = d1->partons().second;
tPartonPtr p3 = d2->partons().first;
tPartonPtr p4 = d2->partons().second;
TransverseMomentum rec12 = (p1->position() - p2->position())/
(p1->position() - p2->position()).pt2();
TransverseMomentum rec34 = (p3->position() - p4->position())/
(p3->position() - p4->position()).pt2();
TransverseMomentum rec14 = (p1->position() - p4->position())/
(p1->position() - p4->position()).pt2();
TransverseMomentum rec32 = (p3->position() - p2->position())/
(p3->position() - p2->position()).pt2();
if ( log( (p1->pT() - rec12 + rec14).pt()/p1->plus()) > maxy )
return false;
if ( log( (p2->pT() + rec12 - rec32).pt()/p2->plus()) > maxy )
return false;
if ( log( (p3->pT() - rec34 + rec32).pt()/p3->plus()) > maxy )
return false;
if ( log( (p4->pT() + rec34 - rec14).pt()/p4->plus()) > maxy )
return false;
return true;
}
void Swinger::recombineFS(Dipole & d1) const {
Dipole & d2 = *d1.swingDipole();
pair<tPartonPtr, tPartonPtr> d1p = d1.partons();
pair<tPartonPtr, tPartonPtr> d2p = d2.partons();
pair<tDipolePtr, tDipolePtr> d1n = d1.neighbors();
pair<tDipolePtr, tDipolePtr> d2n = d2.neighbors();
d1.partons(make_pair(d1p.first, d2p.second));
d1.neighbors(make_pair(d1n.first, d2n.second));
if ( d1n.first ) d1n.first->secondNeighbor(&d1);
if ( d2n.second ) d2n.second->firstNeighbor(&d1);
d2.partons(make_pair(d2p.first, d1p.second));
d2.neighbors(make_pair(d2n.first, d1n.second));
if ( d2n.first ) d2n.first->secondNeighbor(&d2);
if ( d1n.second ) d1n.second->firstNeighbor(&d2);
d1.partons().first->dipoles(make_pair(d1.neighbors().first, &d1));
d1.partons().second->dipoles(make_pair(&d1, d1.neighbors().second));
d2.partons().first->dipoles(make_pair(d2.neighbors().first, &d2));
d2.partons().second->dipoles(make_pair(&d2, d2.neighbors().second));
d1.reset();
d2.reset();
d1.touch();
d2.touch();
}
void Swinger::recombine(Dipole & d1) const {
DipoleState & state = d1.dipoleState();
Dipole & d2 = *d1.swingDipole();
if(d2.children().second) {
Throw<SwingConsistencyException>()
<< "swinging with someone thats emitted already (second child). "
<< "(partons at " << d1.partons().first->y() << ", "
<< d1.partons().second->y() << "; " << d2.partons().first->y()
<< ", " << d2.partons().second->y() << ")" << Exception::eventerror;
state.diagnosis(true);
}
else if(d2.children().first) {
Throw<SwingConsistencyException>()
<< "swinging with someone thats emitted already (first child). "
<< "(partons at " << d1.partons().first->y() << ", "
<< d1.partons().second->y() << "; " << d2.partons().first->y()
<< ", " << d2.partons().second->y() << ")" << Exception::eventerror;
state.diagnosis(true);
}
DipolePtr d11 = d1.children().first = state.createDipole();
DipolePtr d22 = d2.children().first = state.createDipole();
d11->partons(make_pair(d1.partons().first, d2.partons().second));
d11->neighbors(make_pair(d1.neighbors().first, d2.neighbors().second));
if ( d1.neighbors().first ) d1.neighbors().first->secondNeighbor(d11);
if ( d2.neighbors().second ) d2.neighbors().second->firstNeighbor(d11);
d22->partons(make_pair(d2.partons().first, d1.partons().second));
d22->neighbors(make_pair(d2.neighbors().first, d1.neighbors().second));
if ( d2.neighbors().first ) d2.neighbors().first->secondNeighbor(d22);
if ( d1.neighbors().second ) d1.neighbors().second->firstNeighbor(d22);
d11->colour(d1.colour());
d22->colour(d2.colour());
d11->partons().first->dipoles(make_pair(d11->neighbors().first,d11));
d11->partons().second->dipoles(make_pair(d11,d11->neighbors().second));
d22->partons().first->dipoles(make_pair(d22->neighbors().first,d22));
d22->partons().second->dipoles(make_pair(d22,d22->neighbors().second));
if (d1.DGLAPsafe() || d2.DGLAPsafe() ) {
d11->DGLAPsafe(true);
d22->DGLAPsafe(true);
}
- if ( d1.interacted() ) d11->interact(*d1.interacted());
- if ( d2.interacted() ) d22->interact(*d2.interacted());
+ if ( d1.interacted() ) d11->interacted(d1.interacted());
+ if ( d2.interacted() ) d22->interacted(d2.interacted());
+ // if ( d1.interacted() ) d11->interact(*d1.interacted());
+ // if ( d2.interacted() ) d22->interact(*d2.interacted());
d1.reset();
d2.reset(); //are these really needed?
}
void Swinger::persistentOutput(PersistentOStream & os) const {
os << ounit(theLambda, 1.0);
}
void Swinger::persistentInput(PersistentIStream & is, int) {
is >> iunit(theLambda, 1.0);
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<Swinger,HandlerBase>
describeDIPSYSwinger("DIPSY::Swinger", "libAriadne5.so libDIPSY.so");
void Swinger::Init() {
static ClassDocumentation<Swinger> documentation
("There is no documentation for the Swinger class");
static Parameter<Swinger,double> interfaceLambda
("Lambda",
"The frequency of the swings.",
&Swinger::theLambda, 1.0, 1.0, 0.0, 0.0,
true, false, Interface::lowerlim);
}
diff --git a/DIPSY/PPTune/PP01XSEC.weights b/DIPSY/PPTune/PP01XSEC.weights
deleted file mode 100644
--- a/DIPSY/PPTune/PP01XSEC.weights
+++ /dev/null
@@ -1,12 +0,0 @@
-/TOTALXSEC/d01-x01-y01 1.0
-/TOTALXSEC/d01-x01-y02 1.0
-/TOTALXSEC/d01-x81-y01 1.0
-/TOTALXSEC/d01-x81-y02 1.0
-/TOTALXSEC/d02-x01-y01 1.0
-/TOTALXSEC/d02-x01-y02 1.0
-/TOTALXSEC/d02-x81-y01 1.0
-/TOTALXSEC/d02-x81-y02 1.0
-/TOTALXSEC/d03-x01-y02 1.0
-/TOTALXSEC/d03-x81-y02 1.0
-/TOTALXSEC/d04-x01-y01 1.0
-/TOTALXSEC/d04-x81-y01 1.0
diff --git a/DIPSY/PPTune/PPTune.inc b/DIPSY/PPTune/PPTune.inc
--- a/DIPSY/PPTune/PPTune.inc
+++ b/DIPSY/PPTune/PPTune.inc
@@ -1,1422 +1,967 @@
# HOW TO TUNE
#
# We need to generate a number of yoda files for different energies
# different observables and different parameter settings. This can be
# done in an semi-automated way.
#
# For the total and elastic cross sections we do not need to generate
# final states and these runs can in principle be done once and for
# all. In fact running PP16XSECYM??.run (generated in the SAVERUNYM
# just after the line "# 16 inclusive observables" below) will produce
# all necessary data.
#
# This input file is (to make a gross understatement) a terrible
# mess. It needs to beprocessed by the script ./expand.pl before going
# to setupThePEG and it will produce an awfull amount of .run
# files. However doing eg.
# > make blaha
# in this directory yo will only produce the .run files matching "blaha".
#
# For the final state you have to run the files generated after the
# line "# 16 final state observables" below. You will have one run per
# energy in PP16XSECYM@??.run (where @ is some arbitrary letter used
# to differentiate between settings). The 7TeV will take quite a while
# so it is best to divide it up in smaller runs. Using the scripts
# "sub" and "runtag" in ~leif/bin you can start the programs as
# follows:
#
# > sub runtag ./runThePEG, PP16XSECYM@02, PP16XSECYM@09,
# PP16XSECYM@71_61-80, PP16XSECYM@71_41-60,
# PP16XSECYM@71_21-40, PP16XSECYM@71_1-20
# PP16XSECYM@71_81-100
#
# After these runs are done you can start the actual tuning with
# professor. First you need to copy the relevant files from the
# inclusive runs to match the names of the final states runs as
# follows:
# > cp PP16XSECYM01.log PP16XSECYM@01.log
# > cp PP16XSECYM05.log PP16XSECYM@05.log
# > cp PP16XSECYM18.log PP16XSECYM@18.log
# > cp PP16XSECYM70.log PP16XSECYM@70.log
# then run the mkprof.pl script as follows to get a "global" tune
#
# > ./mkprof.pl -t -w PPTuneFS00.weights -o PP16XSECYM@00.prof PP16XSECYM@
# preferably redirecting both stdout and stderr to some file (there
# will be a lot of output). Similarly
# > ./mkprof.pl -t -w PPTuneFS70.weights -o PP16XSECYM@70.prof PP16XSECYM@
# will give the tune restricting the final state data to 7TeV, and
# changing all "70" to "09" or "02" will give 900 GeV or 200 GeV to
# look at the result check the file
# PP16XSECYM@00.prof/tunes/results.pkl or use the following script
# > ./profsum.pl PP16XSECYM@00.prof/tunes/results.pkl
# To get just a summary.
#
# After the line "# 16 pipeing the tunes" below you can then pipe the
# different tunes, just set the parameters according to the fit, do
# > make PPT16XSECYM@
# and run eg.
# > sub runtag ./runThePEG, PPT16XSECYM@02, PPT16XSECYM@09, PPT16XSECYM@71,
# PPT16XSECYM@0202, PPT16XSECYM@0909, PPT16XSECYM@7170
#
#
#
#
cd /DIPSY
## First we setup some previously tuned tuned parameters
#read CurrentTune.in
read ../Tune31.in
## Now we set up an event generator.
cp EventHandler PPEventHandler
set stdProton:R0 0.0
set stdAntiProton:R0 0.0
set Proton:R0 0.0
set AntiProton:R0 0.0
set PPEventHandler:WFL stdProton
set PPEventHandler:WFR stdProton
set PPEventHandler:ConsistencyLevel 0
set PPEventHandler:XSecFn:CheckOffShell false
set PPEventHandler:CascadeHandler NULL
set PPEventHandler:HadronizationHandler NULL
set PPEventHandler:DecayHandler NULL
create ThePEG::FixedCMSLuminosity PPLumi
set PPEventHandler:LuminosityFunction PPLumi
cp Generator PPGenerator
erase PPGenerator:AnalysisHandlers[0]
set PPGenerator:HistogramFactory NULL
set PPGenerator:EventHandler PPEventHandler
-set PPGenerator:NumberOfEvents 0
-set PPGenerator:EventHandler:EventFiller:PTCut 0.6
set PPEventHandler:BGen:Width 5
-set PPEventHandler:EffectivePartonMode Colours
## These are the analysess we will run
## Some semi-inclusive cross section for DIPSY which need at least
## four combinations of left- and right-moving cascades.
erase PPEventHandler:AnalysisHandlers[0]
erase PPEventHandler:AnalysisHandlers[0]
create DIPSY::SemiInclusiveXSecAnalysis SemiIncl SemiInclusiveXSecAnalysis.so
insert PPEventHandler:AnalysisHandlers[0] SemiIncl
set PPEventHandler:PreSampleL 2
set PPEventHandler:PreSampleR 2
## This is just to keep track of the progress of a run
create DIPSY::AnalysisProgress AnaLog AnalysisProgress.so
set AnaLog:Interval 600
insert PPEventHandler:AnalysisHandlers[0] AnaLog
## The sample rates need to be adjusted so that we get a reasonable
## statistics in a reasonable time. It is typically efficient to
## sample a number of impact parameter values for each pair of DIPSY
## cascades.
set PPEventHandler:PreSampleB 1
## But we need a good sample of cascades
set PPEventHandler:PreSamples 1000
## We need the same set of parameters for all different energies, so
## we use a separate random generator.
cp /Defaults/Random RandomArg
set PPGenerator:SeparateRandom RandomArg
## These are the parameters we want to tune
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:RMax 100 2.0 4.0 2.9 0.3
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:LambdaQCD 1 0.10 0.3 0.22 0.04
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:BaryonSize 1 2.0 4.0 2.9 0.3
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PMinusOrdering 1 0.5 2.0 1.0 0.2
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PSInflation 1 0.5 2.0 1.0 0.2
## Now we want to run for all energies and two values for YFrametest
-SAVERUN PP01XSEC PPGenerator
-
-## Set the pp energy and interaction frame we want to run with
-
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:BaryonSize
-set /DIPSY/PPEventHandler:BaryonSize 0.0
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PSInflation 1 0.5 2.0 1.0 0.2
-
-SAVERUN PP02XSEC PPGenerator
-
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:Emitter:PSInflation
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Swinger:Lambda 1 0.5 4.0 1.0 0.5
-
-SAVERUN PP05XSEC PPGenerator
-
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:Swinger:Lambda
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Swinger:Lambda 2 0.0 6.0
-
-SAVERUN PP06XSEC PPGenerator
-
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:Swinger:Lambda
-set PPEventHandler:Swinger:Lambda 5.0
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:RMax
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:RMax 100 1.0 5.0 2.9 0.6
-SAVERUN PP07XSEC PPGenerator
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:BaryonSize 1 2.0 4.0 2.9 0.5
-SAVERUN PP08XSEC PPGenerator
-set PPEventHandler:Swinger:Lambda 2.0
-
-# 09
-
-SAVERUN PP09XSEC PPGenerator
-SAVERUNYR PP09XSECYR PPGenerator
set PPGenerator:EventHandler:DecayHandler /Defaults/Handlers/StandardDecayHandler
set PPGenerator:EventHandler:HadronizationHandler Frag8
-set PPGenerator:EventHandler:CascadeHandler AriadneCascade
-set PPGenerator:EventHandler:PreSamples 0
-set PPGenerator:NumberOfEvents 10000
-create ThePEG::ProgressLog Logger ProgressLog.so
-set Logger:Interval 600
-insert PPGenerator:AnalysisHandlers[0] Logger
-create ThePEG::RivetAnalysis RivetTune RivetAnalysis.so
-insert RivetTune:Paths[0] .
-insert RivetTune:Analyses[0] ATLAS_2010_S8918562
-insert RivetTune:Analyses[0] STAR_2008_S7869363
-insert RivetTune:Analyses[0] CMS_2011_S8978280
-insert RivetTune:Analyses[0] PYTHIA_TUNING
-insert PPGenerator:AnalysisHandlers[0] RivetTune
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP09XSECYR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP09XSECYR71 PPGenerator
-set PPGenerator:EventHandler:YFrametest 0.5
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP09XSEC09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP09XSEC71 PPGenerator
-saverun dPP09XSEC71 PPGenerator
-
-# 10
set Frag8:StringZ_aLund 0.42
set Frag8:StringZ_bLund 0.40
set Frag8:StringPT_sigma 0.32
set Frag8:StringFlav_probQQtoQ 0.084
set Frag8:StringFlav_probStoUD 0.22
set Frag8:Collapser /Ariadne5/Defaults/Collapser
cp Frag8 Frag8Sw0
set Frag8Sw0:StringZ_aLund 0.30
set Frag8Sw0:StringZ_bLund 0.36
set Frag8Sw0:StringPT_sigma 0.32
set Frag8Sw0:StringFlav_probQQtoQ 0.082
set Frag8Sw0:StringFlav_probStoUD 0.22
cp Frag8 Frag8Sw2
set Frag8Sw2:StringZ_aLund 0.45
set Frag8Sw2:StringZ_bLund 0.42
set Frag8Sw2:StringPT_sigma 0.32
set Frag8Sw2:StringFlav_probQQtoQ 0.085
set Frag8Sw2:StringFlav_probStoUD 0.22
cp Frag8 Frag8Rope
set Frag8Rope:FragmentationScheme dipole
set Frag8Rope:StringR0 1.0
set Frag8Rope:Stringm0 0.2
set Frag8Rope:Average false
set Frag8Rope:ThrowAway true
set Frag8Rope:BaryonSuppression 0.25
set Frag8Rope:StringZ_aLund 0.41
set Frag8Rope:StringZ_bLund 0.37
set Frag8Rope:StringPT_sigma 0.31
set Frag8Rope:StringFlav_probQQtoQ 0.073
set Frag8Rope:StringFlav_probStoUD 0.21
set PPEventHandler:WFL Proton
set PPEventHandler:WFR Proton
set PPEventHandler:EventFiller:SoftRemove NoValence
-set PPGenerator:EventHandler:YFrametest 0.5
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP10XSEC09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP10XSEC71 PPGenerator
-set PPGenerator:EventHandler:YFrametest -1.2
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP10XSECYR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP10XSECYR71 PPGenerator
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP10XSECYRR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP10XSECYRR71 PPGenerator
-set Frag8:FragmentationScheme none
-# 11
+cp PPGenerator PPTestTune
+set PPTestTune:NumberOfEvents 100000
-set PPEventHandler:EventFiller:PTCut 1.0
-set PPEventHandler:Swinger:Lambda 1.0
-set PPEventHandler:EffectivePartonMode Colours
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:BaryonSize
-set /DIPSY/PPEventHandler:BaryonSize 0.0
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:CoherenceRange 1 0.2 5.0 3.0 2.0
-erase PPGenerator:AnalysisHandlers[0]
-erase PPGenerator:AnalysisHandlers[0]
-set PPGenerator:EventHandler:PreSamples 1000
-set PPGenerator:NumberOfEvents 0
-SAVERUNYR PP11XSECYR PPGenerator
-SAVERUNYM PP11XSECYM PPGenerator
-set PPGenerator:EventHandler:FudgeME true
-SAVERUNYM PP11XSECYm PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 2.0
-SAVERUNYM PP11XSECYP PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 0.5
-SAVERUNYM PP11XSECYp PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 1.4
-SAVERUNYM PP11XSECYs PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 1.0
-set PPGenerator:EventHandler:FudgeME false
+
+
+
+
+erase AriadneCascade:Emitters[0]
+insert AriadneCascade:Emitters[0] FSSwinger
+set PPGenerator:EventHandler:CascadeHandler AriadneCascade
+
+create ThePEG::ProgressLog Logger ProgressLog.so
+set Logger:Interval 600
+create ThePEG::RivetAnalysis RivetTune RivetAnalysis.so
+insert RivetTune:Paths[0] .
+insert RivetTune:Analyses[0] ATLAS_2010_S8918562
+insert RivetTune:Analyses[0] STAR_2008_S7869363
+insert RivetTune:Analyses[0] CMS_2011_S8978280
+insert RivetTune:Analyses[0] PYTHIA_TUNING
+
insert PPGenerator:AnalysisHandlers[0] Logger
insert PPGenerator:AnalysisHandlers[0] RivetTune
set PPGenerator:EventHandler:PreSamples 0
set PPGenerator:NumberOfEvents 10000
-
-
-set PPGenerator:EventHandler:YFrametest -1.2
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYR09 PPGenerator
+set PPGenerator:EventHandler:YFrametest 0.5
set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYR71 PPGenerator
-
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYRR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYRR71 PPGenerator
set Frag8:FragmentationScheme none
-
-set PPGenerator:EventHandler:YFrametest 0.5
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYM09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYM71 PPGenerator
-set PPGenerator:EventHandler:FudgeME true
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYm09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYm71 PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 2.0
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYP09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYP71 PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 1.0
-set PPGenerator:EventHandler:FudgeME false
-
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYMR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYMR71 PPGenerator
-set PPGenerator:EventHandler:FudgeME true
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYmR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYmR71 PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 2.0
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYPR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYPR71 PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 0.5
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYpR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYpR71 PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 1.4
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYsR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYsR71 PPGenerator
-set PPGenerator:EventHandler:Emitter:PTScale 1.0
-set PPGenerator:EventHandler:FudgeME false
-
-set FSSwinger:SetRmax -2.0
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYMr09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYMr71 PPGenerator
+set /DIPSY/PPEventHandler:BaryonSize 0.0
set FSSwinger:SetRmax -2.7
-set Frag8:FragmentationScheme none
-erase AriadneCascade:Emitters[0]
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYN09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYN71 PPGenerator
-insert AriadneCascade:Emitters[0] FSSwinger
-set PPGenerator:EventHandler:CascadeHandler NULL
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP11XSECYn09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP11XSECYn71 PPGenerator
-set PPGenerator:EventHandler:CascadeHandler AriadneCascade
-
-cp PPGenerator PPTestTune
-do PPTestTune:RemoveInterface /DIPSY/PPEventHandler:CoherenceRange
-do PPTestTune:RemoveInterface /DIPSY/PPEventHandler:LambdaQCD
-do PPTestTune:RemoveInterface /DIPSY/PPEventHandler:RMax
-do PPTestTune:RemoveInterface /DIPSY/stdEmitter:PMinusOrdering
-set PPTestTune:NumberOfEvents 100000
-
-set PPEventHandler:CoherenceRange 2.7
-set PPEventHandler:LambdaQCD 0.26
-set PPEventHandler:RMax 2.7
-set PPEventHandler:Emitter:PMinusOrdering 0.73
-set PPTestTune:EventHandler:LuminosityFunction:Energy 900
-saverun PPT11XSECYM09 PPTestTune
-set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
-saverun PPT11XSECYM71 PPTestTune
-
-set PPTestTune:NumberOfEvents 10000
-saverun PPT11XSECYM710 PPTestTune
-saverun PPT11XSECYM711 PPTestTune
-set PPTestTune:EventHandler:FudgeME true
-saverun PPT11XSECYM712 PPTestTune
-saverun PPT11XSECYM713 PPTestTune
-set PPEventHandler:CoherenceRange 2.2
-set PPEventHandler:LambdaQCD 0.27
-set PPEventHandler:RMax 3.0
-set PPEventHandler:Emitter:PMinusOrdering 0.77
-set PPTestTune:NumberOfEvents 100000
-saverun PPT11XSECYm71 PPTestTune
-
-set PPTestTune:EventHandler:FudgeME false
-set PPEventHandler:CoherenceRange 2.7
-set PPEventHandler:LambdaQCD 0.26
-set PPEventHandler:RMax 2.7
-set PPEventHandler:Emitter:PMinusOrdering 0.73
-
-set PPEventHandler:CoherenceRange 3.0
-set PPEventHandler:LambdaQCD 0.27
-set PPEventHandler:RMax 2.7
-set PPEventHandler:Emitter:PMinusOrdering 0.76
-set Frag8:FragmentationScheme pipe
-set PPTestTune:EventHandler:LuminosityFunction:Energy 900
-saverun PPT11XSECYMR09 PPTestTune
-set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
-saverun PPT11XSECYMR71 PPTestTune
-
-set PPTestTune:EventHandler:FudgeME true
-set PPEventHandler:CoherenceRange 2.5
-set PPEventHandler:LambdaQCD 0.27
-set PPEventHandler:RMax 3.0
-set PPEventHandler:Emitter:PMinusOrdering 0.81
-saverun PPT11XSECYmR71 PPTestTune
-set PPEventHandler:CoherenceRange 2.4
-set PPEventHandler:LambdaQCD 0.12
-set PPEventHandler:RMax 3.3
-set PPEventHandler:Emitter:PMinusOrdering 0.93
-set PPGenerator:EventHandler:Emitter:PTScale 2.0
-saverun PPT11XSECYPR71 PPTestTune
-set PPEventHandler:CoherenceRange 2.5
-set PPEventHandler:LambdaQCD 0.18
-set PPEventHandler:RMax 3.2
-set PPEventHandler:Emitter:PMinusOrdering 0.71
-set PPGenerator:EventHandler:Emitter:PTScale 1.4
-saverun PPT11XSECYsR71 PPTestTune
-
-set PPTestTune:EventHandler:FudgeME false
-set PPEventHandler:CoherenceRange 3.0
-set PPEventHandler:LambdaQCD 0.27
-set PPEventHandler:RMax 2.7
-set PPEventHandler:Emitter:PMinusOrdering 0.76
-set Frag8:FragmentationScheme none
-
-erase AriadneCascade:Emitters[0]
-set PPEventHandler:CoherenceRange 3.9
-set PPEventHandler:LambdaQCD 0.26
-set PPEventHandler:RMax 2.78
-set PPEventHandler:Emitter:PMinusOrdering 1.1
-set PPTestTune:EventHandler:LuminosityFunction:Energy 900
-saverun PPT11XSECYN09 PPTestTune
-set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
-saverun PPT11XSECYN71 PPTestTune
-insert AriadneCascade:Emitters[0] FSSwinger
-set PPGenerator:EventHandler:CascadeHandler NULL
-saverun PPT11XSECYn71 PPTestTune
-set PPGenerator:EventHandler:CascadeHandler AriadneCascade
-
-
-
-set PPEventHandler:EventFiller:PTCut 0.6
-
-
-
-# 12
-
-set PPEventHandler:Swinger:Lambda 3.0
-set PPEventHandler:CoherenceRange 1.0
-set PPEventHandler:EffectivePartonMode Colours
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:CoherenceRange
-set PPEventHandler:CoherenceRange 1.0
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PSInflation 1 0.5 2.0 1.0 0.2
-erase PPGenerator:AnalysisHandlers[0]
-erase PPGenerator:AnalysisHandlers[0]
-set PPGenerator:EventHandler:PreSamples 1000
-set PPGenerator:NumberOfEvents 0
-SAVERUNYR PP12XSECYR PPGenerator
-insert PPGenerator:AnalysisHandlers[0] Logger
-insert PPGenerator:AnalysisHandlers[0] RivetTune
-set PPGenerator:EventHandler:PreSamples 0
-set PPGenerator:NumberOfEvents 10000
-
-
-set PPGenerator:EventHandler:YFrametest -1.2
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP12XSECYR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP12XSECYR71 PPGenerator
-
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP12XSECYRR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP12XSECYRR71 PPGenerator
-set Frag8:FragmentationScheme none
-
-# 13
-
-set PPEventHandler:EventFiller:PTCut 0.6
-set PPEventHandler:Swinger:Lambda 3.0
-set PPEventHandler:CoherenceRange 1.0
-set PPEventHandler:EffectivePartonMode Colours
-#do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:CoherenceRange
-set PPEventHandler:CoherenceRange 1.0
-#do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PSInflation 1 0.5 2.0 1.0 0.2
-erase PPGenerator:AnalysisHandlers[0]
-erase PPGenerator:AnalysisHandlers[0]
-set PPGenerator:EventHandler:PreSamples 1000
-set PPGenerator:NumberOfEvents 0
-SAVERUNYR PP13XSECYR PPGenerator
-insert PPGenerator:AnalysisHandlers[0] Logger
-insert PPGenerator:AnalysisHandlers[0] RivetTune
-set PPGenerator:EventHandler:PreSamples 0
-set PPGenerator:NumberOfEvents 10000
-
-
-set PPGenerator:EventHandler:YFrametest -1.2
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP13XSECYR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP13XSECYR71 PPGenerator
-
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP13XSECYRR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP13XSECYRR71 PPGenerator
-set Frag8:FragmentationScheme none
-
-# 14
-
-set PPEventHandler:EventFiller:PTCut 1.0
-set PPEventHandler:Swinger:Lambda 3.0
-set PPEventHandler:CoherenceRange 1.0
-set PPEventHandler:EffectivePartonMode Colours
-#do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:CoherenceRange
-set PPEventHandler:CoherenceRange 1.0
-#do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PSInflation 1 0.5 2.0 1.0 0.2
-erase PPGenerator:AnalysisHandlers[0]
-erase PPGenerator:AnalysisHandlers[0]
-set PPGenerator:EventHandler:PreSamples 1000
-set PPGenerator:NumberOfEvents 0
-SAVERUNYR PP14XSECYR PPGenerator
-insert PPGenerator:AnalysisHandlers[0] Logger
-insert PPGenerator:AnalysisHandlers[0] RivetTune
-set PPGenerator:EventHandler:PreSamples 0
-set PPGenerator:NumberOfEvents 10000
-
-
-set PPGenerator:EventHandler:YFrametest -1.2
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP14XSECYR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP14XSECYR71 PPGenerator
-
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP14XSECYRR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP14XSECYRR71 PPGenerator
-set Frag8:FragmentationScheme none
-
-# 15
-
-#set PPEventHandler:EventFiller:PTCut 1.0
-set PPEventHandler:Emitter:PSInflation 1.0
-set PPEventHandler:Swinger:Lambda 3.0
-set PPEventHandler:CoherenceRange 1.0
-set PPEventHandler:EffectivePartonMode Colours
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:Emitter:PSInflation
-set PPEventHandler:CoherenceRange 1.0
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:EventFiller:PTCut 1 0.3 1.7 1.0 0.5
-erase PPGenerator:AnalysisHandlers[0]
-erase PPGenerator:AnalysisHandlers[0]
-set PPGenerator:EventHandler:PreSamples 1000
-set PPGenerator:NumberOfEvents 0
-SAVERUNYR PP15XSECYR PPGenerator
-insert PPGenerator:AnalysisHandlers[0] Logger
-insert PPGenerator:AnalysisHandlers[0] RivetTune
-set PPGenerator:EventHandler:PreSamples 0
-set PPGenerator:NumberOfEvents 10000
-
-
-set PPGenerator:EventHandler:YFrametest -1.2
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP15XSECYR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP15XSECYR71 PPGenerator
-
-set Frag8:FragmentationScheme pipe
-set PPGenerator:EventHandler:LuminosityFunction:Energy 900
-saverun PP15XSECYRR09 PPGenerator
-set PPGenerator:EventHandler:LuminosityFunction:Energy 7000
-saverun PP15XSECYRR71 PPGenerator
-set Frag8:FragmentationScheme none
# 16 inclusive observables
+do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:RMax 100 1.0 5.0 2.9 0.6
+do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:LambdaQCD 1 0.10 0.3 0.22 0.04
+do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PTScale 1 0.5 2.0 1.4 0.5
+do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PMinusOrdering 1 0.5 2.0 1.0 0.2
+
set PPGenerator:EventHandler:FudgeME true
set PPEventHandler:EventFiller:PTCut 1.0
set PPEventHandler:Emitter:PSInflation 1.0
set PPEventHandler:Swinger:Lambda 1.0
set PPEventHandler:CoherenceRange 2.5
set PPEventHandler:EffectivePartonMode Colours
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:EventFiller:PTCut
set PPEventHandler:CoherenceRange 2.5
-do PPGenerator:AddRndInterface /DIPSY/PPEventHandler:Emitter:PTScale 1 0.5 2.0 1.4 0.5
erase PPGenerator:AnalysisHandlers[0]
erase PPGenerator:AnalysisHandlers[0]
set PPGenerator:EventHandler:PreSamples 1000
set PPGenerator:NumberOfEvents 0
SAVERUNYM PP16XSECYM PPGenerator
SAVERUNYM PP16XSECxM PPGenerator
SAVERUNYM PP16XSEC4M PPGenerator
set PPTestTune:EventHandler:XSecFn:PartonicInteraction Parton
SAVERUNYM PP16XSECgM PPGenerator
set PPTestTune:EventHandler:XSecFn:PartonicInteraction Dipole
SAVERUNY8 PP16XSECyM PPGenerator
insert PPGenerator:AnalysisHandlers[0] Logger
insert PPGenerator:AnalysisHandlers[0] RivetTune
+insert PPTestTune:AnalysisHandlers[0] Logger
+insert PPTestTune:AnalysisHandlers[0] RivetTune
set PPGenerator:EventHandler:PreSamples 0
set PPGenerator:NumberOfEvents 10000
# 16 final state observables
set PPGenerator:EventHandler:YFrametest 0.5
SAVERUNFS PP16XSECYM PPGenerator
set Frag8:FragmentationScheme dep2
set PPGenerator:EventHandler:LuminosityFunction:Energy 200
SAVERUNFS PP16XSECYMQ PPGenerator
SAVERUNFS PP16XSECYMq PPGenerator
SAVERUNFS PP16XSECYMo PPGenerator
set Frag8:FragmentationScheme dipole
set Frag8:ThrowAway true
set PPGenerator:DumpPeriod 0
set Frag8:StringR0 0.8
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.22
SAVERUNFS PP16XSECYMF PPGenerator
set Frag8:BaryonSuppression 0.33
SAVERUNFS PP16XSECYMf PPGenerator
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.167
SAVERUNFS PP16XSECYMK PPGenerator
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.22
SAVERUNFS PP16XSECYMJ PPGenerator
SAVERUNFS PP16XSECYMW PPGenerator
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.25
SAVERUNFS PP16XSECYMV PPGenerator
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.25
set Frag8:Average false
SAVERUNFS PP16XSECYMX PPGenerator
SAVERUNFS PP16XSECYXX PPGenerator
SAVERUNFS PP16XSEC4XX PPGenerator
set PPTestTune:EventHandler:XSecFn:PartonicInteraction Parton
SAVERUNFS PP16XSECgXX PPGenerator
set PPTestTune:EventHandler:EventFiller:SingleMother 1
SAVERUNFS PP16XSECmXX PPGenerator
set PPTestTune:EventHandler:EventFiller:SingleMother 0
set PPTestTune:EventHandler:XSecFn:PartonicInteraction Dipole
set PPGenerator:EventHandler:YFrametest 0.8
SAVERUNFS PP16XSECyXX PPGenerator
set PPGenerator:EventHandler:YFrametest 0.5
set Frag8:BaryonSuppression 0.5
SAVERUNFS PP16XSECYXX PPGenerator
set Frag8:StringR0 0.8
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.2
set Frag8:Average false
set PPGenerator:EventHandler:HadronizationHandler Frag8Rope
SAVERUNFS PP16XSECYXR PPGenerator
set PPGenerator:EventHandler:HadronizationHandler Frag8
SAVERUNFS PP16XSECYMx PPGenerator
set Frag8:Average true
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.5
SAVERUNFS PP16XSECYMj PPGenerator
SAVERUNFS PP16XSECYMw PPGenerator
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.5
SAVERUNFS PP16XSECYMv PPGenerator
set Frag8:FragmentationScheme average
set Frag8:ThrowAway true
set PPGenerator:DumpPeriod 0
set Frag8:StringR0 1.0
set Frag8:Stringm0 1.0
SAVERUNFS PP16XSECYMD PPGenerator
set Frag8:StringR0 0.5
set Frag8:Stringm0 0.5
SAVERUNFS PP16XSECYMd PPGenerator
set Frag8:Stringm0 1.0
set PPGenerator:EventHandler:LuminosityFunction:Energy 200
SAVERUNFS PP16XSECYMt PPGenerator
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.6
set Frag8:BaryonSuppression 0.33
SAVERUNFS PP16XSECYMT PPGenerator
set Frag8:ThrowAway false
SAVERUNFS PP16XSECYMu PPGenerator
set Frag8:StringR0 0.5
set Frag8:Stringm0 1.0
set Frag8:BaryonSuppression 0.5
set Frag8:FragmentationScheme pipe
set Frag8:ThrowAway false
SAVERUNFS PP16XSECYMR PPGenerator
SAVERUNFS PP16XSECYMr PPGenerator
SAVERUNFS PP16XSECYOr PPGenerator
set FSSwinger:SizeOpt 2
set FSOrdering:HardSuppression 2
set PPGenerator:EventHandler:LuminosityFunction:Energy 200
SAVERUNFS PP16XSECYoR PPGenerator
set FSSwinger:MaxRho 1.0
set PPGenerator:EventHandler:HadronizationHandler Frag8Sw2
SAVERUNFS PP16XSECY2R PPGenerator
set PPGenerator:EventHandler:HadronizationHandler Frag8
set FSSwinger:MaxRho -2.0
erase AriadneCascade:Emitters[0]
SAVERUNFS PP16XSECYsR PPGenerator
set PPGenerator:EventHandler:HadronizationHandler Frag8Sw0
SAVERUNFS PP16XSECYMS PPGenerator
SAVERUNFS PP16XSECYOS PPGenerator
SAVERUNFS PP16XSECYoS PPGenerator
set PPGenerator:EventHandler:HadronizationHandler Frag8
insert AriadneCascade:Emitters[0] FSSwinger
set FSSwinger:SizeOpt 1
set FSOrdering:HardSuppression 0
set Frag8:FragmentationScheme none
set Frag8:ThrowAway false
# 16 testing the tunes
set PPEventHandler:LambdaQCD 0.225
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.67
set PPEventHandler:Emitter:PTScale 1.25
-SAVERUNTUNE PPT16XSECYMp PPTestTune PP16XSECYM
+# SAVERUNTUNE PPT16XSECYMp PPTestTune PP16XSECYM
set Frag8:FragmentationScheme pipe
set PPEventHandler:CoherenceRange 2.5
set PPEventHandler:LambdaQCD 0.25
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.69
set PPEventHandler:Emitter:PTScale 1.22
saverun PPT16XSECYMR71 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMR02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMR09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.25
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.71
set PPEventHandler:Emitter:PTScale 1.22
saverun PPT16XSECYMr71 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMr02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMr09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set Frag8:FragmentationScheme dep2
-SAVERUNTUNE PPT16XSECYMo PPTestTune PP16XSECYMo
+# SAVERUNTUNE PPT16XSECYMo PPTestTune PP16XSECYMo
set Frag8:FragmentationScheme dipole
set Frag8:ThrowAway true
set PPGenerator:DumpPeriod 0
set Frag8:StringR0 0.8
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.22
-SAVERUNTUNE PPT16XSECYMF PPTestTune PP16XSECYMF
+# SAVERUNTUNE PPT16XSECYMF PPTestTune PP16XSECYMF
set Frag8:FragmentationScheme dipole
set Frag8:ThrowAway true
set PPGenerator:DumpPeriod 0
set Frag8:StringR0 0.8
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.33
-SAVERUNTUNE PPT16XSECYMf PPTestTune PP16XSECYMf
+# SAVERUNTUNE PPT16XSECYMf PPTestTune PP16XSECYMf
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
set Frag8:FragmentationScheme dep1
set PPTestTune:NumberOfEvents 1000
saverun quicktest PPTestTune
set Frag8:FragmentationScheme dipole
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPTestTune:NumberOfEvents 100000
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.167
-SAVERUNTUNE PPT16XSECYMk PPTestTune PP16XSECYMK
+# SAVERUNTUNE PPT16XSECYMk PPTestTune PP16XSECYMK
-SAVERUNTUNE PPT16XSECYMK PPTestTune PP16XSECYMK
+# SAVERUNTUNE PPT16XSECYMK PPTestTune PP16XSECYMK
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.22
-SAVERUNTUNE PPT16XSECYMJ PPTestTune PP16XSECYMJ
-SAVERUNTUNE PPT16XSECYMI PPTestTune PP16XSECYMJ
-SAVERUNTUNE PPT16XSECYMi PPTestTune PP16XSECYMF
-SAVERUNTUNE PPT16XSECYMW PPTestTune PP16XSECYMW
+# SAVERUNTUNE PPT16XSECYMJ PPTestTune PP16XSECYMJ
+# SAVERUNTUNE PPT16XSECYMI PPTestTune PP16XSECYMJ
+# SAVERUNTUNE PPT16XSECYMi PPTestTune PP16XSECYMF
+# SAVERUNTUNE PPT16XSECYMW PPTestTune PP16XSECYMW
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.25
SAVERUNTUNE PPT16XSECYMV PPTestTune PP16XSECYMV
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.25
set Frag8:Average false
#set PPTestTune:LogNonDefault Yes
-SAVERUNTUNE PPT16XSECYMX PPTestTune PP16XSECYMX
-SAVERUNTUNE PPT16XSECYMXX PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXP PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXB PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXT PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXO PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXL PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMX PPTestTune PP16XSECYMX
+# SAVERUNTUNE PPT16XSECYMXX PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXP PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXB PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXT PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXO PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXL PPTestTune PP16XSECYXX
create ThePEG::LWHFactory LWHFactory LWHFactory.so
set LWHFactory:Suffix dat
set LWHFactory:StoreType flat
set PPTestTune:HistogramFactory LWHFactory
create DIPSY::PTAnalysis PTAnalysis PTAnalysis.so
insert PPTestTune:AnalysisHandlers[0] PTAnalysis
-SAVERUNTUNE PPT16XSECYMXU PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXU PPTestTune PP16XSECYXX
set PPGenerator:EventHandler:FudgeFactorME 4.0
-SAVERUNTUNE PPT16XSECYMXuU PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXuU PPTestTune PP16XSECYXX
set PPGenerator:EventHandler:FudgeFactorME 0.25
-SAVERUNTUNE PPT16XSECYMXdU PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXdU PPTestTune PP16XSECYXX
set PPGenerator:EventHandler:FudgeFactorME 1.0
-SAVERUNTUNE PPT16XSECYMX0U PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMX4U PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMX0U PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMX4U PPTestTune PP16XSECYXX
SAVERUNTUNE PPT16XSECYMx4U PPTestTune PP16XSEC4XX
+set PPTestTune:EventHandler:EventFiller:OnlyOnce true
+SAVERUNTUNE PPT16XSECYMx4O PPTestTune PP16XSEC4XX
set PPTestTune:EventHandler:XSecFn:PartonicInteraction Parton
-SAVERUNTUNE PPT16XSECYMXg PPTestTune PP16XSECgXX
+# SAVERUNTUNE PPT16XSECYMXg PPTestTune PP16XSECgXX
set PPTestTune:EventHandler:EventFiller:SingleMother 1
-SAVERUNTUNE PPT16XSECYMXm PPTestTune PP16XSECmXX
+# SAVERUNTUNE PPT16XSECYMXm PPTestTune PP16XSECmXX
set PPTestTune:EventHandler:EventFiller:SingleMother 0
-read PP16XSECgXX71.prin
+# read PP16XSECgXX71.prin
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMXg7171 PPTestTune
set PPTestTune:EventHandler:XSecFn:PartonicInteraction Dipole
-SAVERUNTUNE PPT16XSECYMXd PPTestTune PP16XSECgXX
+# SAVERUNTUNE PPT16XSECYMXd PPTestTune PP16XSECgXX
set PPGenerator:EventHandler:YFrametest 0.8
-SAVERUNTUNE PPT16XSECYMXy PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECyMXy PPTestTune PP16XSECyXX
+# SAVERUNTUNE PPT16XSECYMXy PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECyMXy PPTestTune PP16XSECyXX
set PPGenerator:EventHandler:YFrametest 0.5
erase PPTestTune:AnalysisHandlers[0]
set Frag8:StringR0 0.8
-SAVERUNTUNE PPT16XSECYMXE PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXE PPTestTune PP16XSECYXX
set Frag8:StringR0 0.9
-SAVERUNTUNE PPT16XSECYMXN PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXN PPTestTune PP16XSECYXX
set Frag8:StringR0 1.0
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.1
-SAVERUNTUNE PPT16XSECYMXb PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXp PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXt PPTestTune PP16XSECYXX
-SAVERUNTUNE PPT16XSECYMXo PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXb PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXp PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXt PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXo PPTestTune PP16XSECYXX
set Frag8:Stringm0 0.135
-SAVERUNTUNE PPT16XSECYMXq PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXq PPTestTune PP16XSECYXX
set Frag8:Stringm0 0.2
set Frag8:StringFlav_popcornRate 0.8
-SAVERUNTUNE PPT16XSECYMXx PPTestTune PP16XSECYXX
+# SAVERUNTUNE PPT16XSECYMXx PPTestTune PP16XSECYXX
set Frag8:StringFlav_popcornRate 0.5
set Frag8:BaryonSuppression 0.5
-SAVERUNTUNE PPT16XSECYMXZ PPTestTune PP16XSECYXZ
+# SAVERUNTUNE PPT16XSECYMXZ PPTestTune PP16XSECYXZ
set Frag8:BaryonSuppression 0.25
set PPGenerator:EventHandler:HadronizationHandler Frag8Rope
-SAVERUNTUNE PPT16XSECYMXR PPTestTune PP16XSECYXR
+# SAVERUNTUNE PPT16XSECYMXR PPTestTune PP16XSECYXR
set PPGenerator:EventHandler:HadronizationHandler Frag8
set Frag8:StringR0 0.8
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.2
set Frag8:Average false
#set PPTestTune:LogNonDefault Yes
-SAVERUNTUNE PPT16XSECYMx PPTestTune PP16XSECYMx
+# SAVERUNTUNE PPT16XSECYMx PPTestTune PP16XSECYMx
set Frag8:Average true
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.5
-SAVERUNTUNE PPT16XSECYMj PPTestTune PP16XSECYMj
-SAVERUNTUNE PPT16XSECYMw PPTestTune PP16XSECYMw
+# SAVERUNTUNE PPT16XSECYMj PPTestTune PP16XSECYMj
+# SAVERUNTUNE PPT16XSECYMw PPTestTune PP16XSECYMw
set Frag8:StringR0 1.0
set Frag8:Stringm0 0.2
set Frag8:BaryonSuppression 0.5
SAVERUNTUNE PPT16XSECYMv PPTestTune PP16XSECYMv
set Frag8:FragmentationScheme average
set Frag8:ThrowAway true
set PPGenerator:DumpPeriod 0
set Frag8:StringR0 1.0
set Frag8:Stringm0 1.0
set Frag8:BaryonSuppression 0.5
set PPEventHandler:LambdaQCD 0.245
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.69
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMD02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMD09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMD71 PPTestTune
set PPEventHandler:LambdaQCD 0.245
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.88
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMD02z PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMD09z PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMD71z PPTestTune
set PPEventHandler:LambdaQCD 0.21
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.75
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMD0202 PPTestTune
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 3.05
set PPEventHandler:Emitter:PMinusOrdering 0.78
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMD0202z PPTestTune
set PPEventHandler:LambdaQCD 0.255
set PPEventHandler:RMax 3.05
set PPEventHandler:Emitter:PMinusOrdering 0.85
set PPEventHandler:Emitter:PTScale 1.1
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMD0909 PPTestTune
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 3.15
set PPEventHandler:Emitter:PMinusOrdering 0.97
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMD0909z PPTestTune
set PPEventHandler:LambdaQCD 0.245
set PPEventHandler:RMax 2.95
set PPEventHandler:Emitter:PMinusOrdering 0.66
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMD7170 PPTestTune
set PPEventHandler:LambdaQCD 0.245
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.95
set PPEventHandler:Emitter:PTScale 1.4
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMD7170z PPTestTune
set Frag8:StringR0 0.5
set Frag8:Stringm0 0.5
set PPEventHandler:LambdaQCD 0.26
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.73
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMd02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMd09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMd71 PPTestTune
set PPEventHandler:LambdaQCD 0.215
set PPEventHandler:RMax 3.05
set PPEventHandler:Emitter:PMinusOrdering 0.64
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMd02z PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMd09z PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMd71z PPTestTune
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.74
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMd0202 PPTestTune
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.05
set PPEventHandler:Emitter:PMinusOrdering 0.795
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMd0202z PPTestTune
set PPEventHandler:LambdaQCD 0.205
set PPEventHandler:RMax 3.25
set PPEventHandler:Emitter:PMinusOrdering 0.89
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMd0909 PPTestTune
set PPEventHandler:LambdaQCD 0.19
set PPEventHandler:RMax 3.25
set PPEventHandler:Emitter:PMinusOrdering 0.795
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMd0909z PPTestTune
set PPEventHandler:LambdaQCD 0.255
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.69
set PPEventHandler:Emitter:PTScale 1.26
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMd7170 PPTestTune
set PPEventHandler:LambdaQCD 0.25
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.65
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMd7170z PPTestTune
set Frag8:StringR0 1.2
set Frag8:Stringm0 0.6
set Frag8:BaryonSuppression 0.33
set PPEventHandler:LambdaQCD 0.25
set PPEventHandler:RMax 2.95
set PPEventHandler:Emitter:PMinusOrdering 0.72
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMT02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMT09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMT71 PPTestTune
set PPEventHandler:LambdaQCD 0.255
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.67
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMT02z PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMT09z PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMT71z PPTestTune
set PPEventHandler:LambdaQCD 0.225
set PPEventHandler:RMax 3.05
set PPEventHandler:Emitter:PMinusOrdering 0.78
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMT0202 PPTestTune
set PPEventHandler:LambdaQCD 0.215
set PPEventHandler:RMax 3.15
set PPEventHandler:Emitter:PMinusOrdering 0.805
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMT0202z PPTestTune
set PPEventHandler:LambdaQCD 0.245
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.78
set PPEventHandler:Emitter:PTScale 1.15
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMT0909 PPTestTune
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.15
set PPEventHandler:Emitter:PMinusOrdering 0.73
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMT0909z PPTestTune
set PPEventHandler:LambdaQCD 0.25
set PPEventHandler:RMax 2.95
set PPEventHandler:Emitter:PMinusOrdering 0.68
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMT7170 PPTestTune
set PPEventHandler:LambdaQCD 0.265
set PPEventHandler:RMax 2.85
set PPEventHandler:Emitter:PMinusOrdering 0.685
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMT7170z PPTestTune
set Frag8:ThrowAway false
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.705
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMu02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMu09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMu71 PPTestTune
set PPEventHandler:LambdaQCD 0.215
set PPEventHandler:RMax 3.15
set PPEventHandler:Emitter:PMinusOrdering 0.82
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMu0202 PPTestTune
set PPEventHandler:LambdaQCD 0.195
set PPEventHandler:RMax 3.3
set PPEventHandler:Emitter:PMinusOrdering 0.83
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMu0909 PPTestTune
set PPEventHandler:LambdaQCD 0.245
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.675
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMu7170 PPTestTune
# set PPTestTune:NumberOfEvents 10000
set Frag8:StringyCut 0.0
saverun QuickRun0 PPTestTune
set Frag8:StringyCut 1.0
saverun QuickRun1 PPTestTune
set Frag8:StringyCut 0.0
set Frag8:BaryonSuppression 1.0
saverun QuickRun2 PPTestTune
set Frag8:BaryonSuppression 0.5
saverun QuickRun3 PPTestTune
set PPTestTune:NumberOfEvents 100000
set Frag8:StringR0 0.5
set Frag8:Stringm0 1.0
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.67
set PPEventHandler:Emitter:PTScale 1.5
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMt02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMt09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMt71 PPTestTune
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.80
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMt0202 PPTestTune
set PPEventHandler:LambdaQCD 0.21
set PPEventHandler:RMax 3.2
set PPEventHandler:Emitter:PMinusOrdering 0.82
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMt0909 PPTestTune
set PPEventHandler:LambdaQCD 0.235
set PPEventHandler:RMax 2.95
set PPEventHandler:Emitter:PMinusOrdering 0.63
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYMt7170 PPTestTune
set Frag8:FragmentationScheme pipe
set Frag8:ThrowAway false
set Frag8:StringR0 0.5
set PPEventHandler:LambdaQCD 0.24
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.68
set PPEventHandler:Emitter:PTScale 1.24
saverun PPT16XSECYMR7102 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMR0902 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMR0202 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.78
set PPEventHandler:Emitter:PTScale 1.21
saverun PPT16XSECYMr7102 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMr0902 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYMr0202 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.19
set PPEventHandler:RMax 3.3
set PPEventHandler:Emitter:PMinusOrdering 0.87
set PPEventHandler:Emitter:PTScale 1.22
saverun PPT16XSECYMR7109 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMR0909 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.17
set PPEventHandler:RMax 3.4
set PPEventHandler:Emitter:PMinusOrdering 0.93
set PPEventHandler:Emitter:PTScale 1.30
saverun PPT16XSECYMr7109 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMr0909 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.25
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.67
set PPEventHandler:Emitter:PTScale 1.28
saverun PPT16XSECYMR7170 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMR0970 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.24
set PPEventHandler:RMax 2.9
set PPEventHandler:Emitter:PMinusOrdering 0.65
set PPEventHandler:Emitter:PTScale 1.28
saverun PPT16XSECYMr7170 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMr0970 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set PPEventHandler:LambdaQCD 0.215
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.64
set PPEventHandler:Emitter:PTScale 1.27
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYOr02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYOr09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYOr71 PPTestTune
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.15
set PPEventHandler:Emitter:PMinusOrdering 0.8
set PPEventHandler:Emitter:PTScale 1.2
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYOr0202 PPTestTune
set PPEventHandler:LambdaQCD 0.18
set PPEventHandler:RMax 3.35
set PPEventHandler:Emitter:PMinusOrdering 0.91
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYOr0909 PPTestTune
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 2.95
set PPEventHandler:Emitter:PMinusOrdering 0.65
set PPEventHandler:Emitter:PTScale 1.3
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYOr7170 PPTestTune
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 3.3
set PPEventHandler:Emitter:PMinusOrdering 0.65
set PPEventHandler:Emitter:PTScale 1.25
saverun PPT16XSECYMR71FS PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYMR09FS PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
set FSSwinger:SizeOpt 2
set FSOrdering:HardSuppression 2
set PPEventHandler:LambdaQCD 0.22
set PPEventHandler:RMax 3.0
set PPEventHandler:Emitter:PMinusOrdering 0.63
set PPEventHandler:Emitter:PTScale 1.27
saverun PPT16XSECYoR71 PPTestTune
set FSSwinger:MaxRho 1.0
set PPEventHandler:LambdaQCD 0.20
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.67
set PPEventHandler:Emitter:PTScale 1.31
set PPGenerator:EventHandler:HadronizationHandler Frag8Sw2
saverun PPT16XSECY2R71 PPTestTune
set FSSwinger:MaxRho -2.0
set PPGenerator:EventHandler:HadronizationHandler Frag8
erase AriadneCascade:Emitters[0]
set PPEventHandler:LambdaQCD 0.17
set PPEventHandler:RMax 3.3
set PPEventHandler:Emitter:PMinusOrdering 1.0
set PPEventHandler:Emitter:PTScale 1.42
saverun PPT16XSECYsR71 PPTestTune
set PPGenerator:EventHandler:HadronizationHandler Frag8Sw0
set PPEventHandler:LambdaQCD 0.16
set PPEventHandler:RMax 3.3
set PPEventHandler:Emitter:PMinusOrdering 1.0
set PPEventHandler:Emitter:PTScale 1.44
saverun PPT16XSECYSR71 PPTestTune
SAVERUNTUNE PPT16XSECYoS PPTestTune PP16XSECYoS
set PPEventHandler:LambdaQCD 0.16
set PPEventHandler:RMax 3.3
set PPEventHandler:Emitter:PMinusOrdering 1.05
set PPEventHandler:Emitter:PTScale 1.45
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYOS02 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYOS09 PPTestTune
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYOS71 PPTestTune
set PPEventHandler:LambdaQCD 0.23
set PPEventHandler:RMax 3.1
set PPEventHandler:Emitter:PMinusOrdering 0.8
set PPEventHandler:Emitter:PTScale 1.15
set PPTestTune:EventHandler:LuminosityFunction:Energy 200
saverun PPT16XSECYOS0202 PPTestTune
set PPEventHandler:LambdaQCD 0.17
set PPEventHandler:RMax 3.5
set PPEventHandler:Emitter:PMinusOrdering 1.15
set PPEventHandler:Emitter:PTScale 1.25
set PPTestTune:EventHandler:LuminosityFunction:Energy 900
saverun PPT16XSECYOS0909 PPTestTune
set PPEventHandler:LambdaQCD 0.17
set PPEventHandler:RMax 3.2
set PPEventHandler:Emitter:PMinusOrdering 1.25
set PPEventHandler:Emitter:PTScale 1.6
set PPTestTune:EventHandler:LuminosityFunction:Energy 7000
saverun PPT16XSECYOS7170 PPTestTune
set Frag8:FragmentationScheme none
saverun PPT16XSECYOD7170 PPTestTune
#
-
-set PPGenerator:EventHandler:YFrametest 0.5
-erase PPGenerator:AnalysisHandlers[0]
-erase PPGenerator:AnalysisHandlers[0]
-set PPGenerator:EventHandler:PreSamples 1000
-set PPGenerator:NumberOfEvents 0
-set PPEventHandler:WFL stdProton
-set PPEventHandler:WFR stdProton
-
-
-
-
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:Swinger:Lambda
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:Emitter:PMinusOrdering
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:RMax
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:LambdaQCD
-do PPGenerator:RemoveInterface /DIPSY/PPEventHandler:BaryonSize
-set PPEventHandler:RMax 2.95
-set PPEventHandler:Swinger:Lambda 1.3
-set PPEventHandler:Emitter:PMinusOrdering 0.52
-set PPEventHandler:LambdaQCD 0.20
-SAVERUN PP05XSECt PPGenerator
-
-set PPEventHandler:RMax 2.24
-set PPEventHandler:BaryonSize 3.45
-set PPEventHandler:Emitter:PMinusOrdering 0.55
-set PPEventHandler:LambdaQCD 0.25
-set PPEventHandler:Swinger:Lambda 2.0
-SAVERUN PP09XSECt PPGenerator
-
-set PPEventHandler:RMax 2.04
-set PPEventHandler:BaryonSize 3.64
-set PPEventHandler:Emitter:PMinusOrdering 0.69
-set PPEventHandler:LambdaQCD 0.28
-set PPEventHandler:Swinger:Lambda 2.0
-SAVERUN PP09XSECT PPGenerator
-
-
-set PPEventHandler:RMax 3.0
-set PPEventHandler:Swinger:Lambda 2.0
-set PPEventHandler:Emitter:PMinusOrdering 0.48
-set PPEventHandler:LambdaQCD 0.20
-SAVERUN PP03XSECt PPGenerator
-
-set Frag8:StringZ_aLund 0.42
-set Frag8:StringZ_bLund 0.40
-set Frag8:StringPT_sigma 0.32
-set Frag8:StringFlav_probQQtoQ 0.084
-set Frag8:StringFlav_probStoUD 0.22
-
-set PPGenerator:EventHandler:YFrametest 0.5
-set PPGenerator:EventHandler:DecayHandler /Defaults/Handlers/StandardDecayHandler
-set PPGenerator:EventHandler:HadronizationHandler Frag8
-set PPGenerator:EventHandler:CascadeHandler AriadneCascade
-set PPGenerator:EventHandler:PreSamples 0
-set PPGenerator:NumberOfEvents 100000
-create ThePEG::ProgressLog Logger ProgressLog.so
-set Logger:Interval 600
-insert PPGenerator:AnalysisHandlers[0] Logger
-create ThePEG::RivetAnalysis RivetLHC RivetAnalysis.so
-insert RivetLHC:Analyses[0] ATLAS_2010_S8918562
-insert PPGenerator:AnalysisHandlers[0] RivetLHC
-
-saverun PP01Full70 PPGenerator
-set PPEventHandler:WFL:RemnantDecayer /Defaults/Partons/BaryonRemnantDecayer
-set PPEventHandler:EventFiller:SoftRemove NoValence
-saverun PP03Full70 PPGenerator
-
-set PPEventHandler:WFL Proton
-set PPEventHandler:WFR Proton
-set PPEventHandler:EventFiller:SoftRemove NoValence
-# set PPEventHandler:EventFiller:ValenceChargeNormalisation None
-insert RivetLHC:Paths[0] .
-insert RivetLHC:Analyses[0] MC_MYFB
-set PPGenerator:NumberOfEvents 1000000
-saverun PP02Full70 PPGenerator
-
-
diff --git a/DIPSY/PPTune/archive b/DIPSY/PPTune/archive
new file mode 100755
--- /dev/null
+++ b/DIPSY/PPTune/archive
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+
+for ( @ARGV ) {
+ if ( /^(\w+)\.run$/ ) {
+ my $base = $1;
+ print "Files from run $base -> archives/$base.run.tgz\n";
+ my @files;
+ for my $file ( glob("$base.* $base#*.* $base:*.*") ) {
+ if ( $file =~ /^$base\.(run|log|dat|tex|yoda|out)$/ ) {
+ push @files, $file;
+ }
+ if ( $file =~ /^$base#.+\.(run|log|dat|tex|yoda|out)$/ ) {
+ push @files, $file;
+ }
+ if ( $file =~ /^$base:.+\.(run|log|dat|tex|yoda|out)$/ ) {
+ push @files, $file;
+ }
+ }
+ system("tar czf archives/$base.run.tgz @files; rm @files");
+ }
+ if ( /^(\w+)\.prof$/ ) {
+ my $base = $1;
+ print "Files from proftune $base -> archives/$base.prof.tgz\n";
+ system("mv $base.prout $base.prof") if -e "$base.prout";
+ system("mv $base.prin $base.prof") if -e "$base.prin";
+ system("tar czf archives/$base.prof.tgz $base.prof; rm -rf $base.prof");
+ }
+}
diff --git a/DIPSY/PPTune/expand.pl b/DIPSY/PPTune/expand.pl
--- a/DIPSY/PPTune/expand.pl
+++ b/DIPSY/PPTune/expand.pl
@@ -1,129 +1,142 @@
#!/usr/bin/perl
sub checkrun($$);
use strict;
use Getopt::Std;
my %opts;
getopts('p:',\%opts);
my $pattern = $opts{'p'} if defined($opts{'p'});
while (<>) {
if ( /^saverun\s+(\S+)\s+(\S+)/ ) {
my $saverun = checkrun($1, $pattern);
print "$saverun ${1} $2\n";
}
elsif ( /^SAVERUN\s+(\S+)\s+(\S+)/ ) {
my $saverun = checkrun($1, $pattern);
print "set $2:EventHandler:YFrametest 0.5\n";
print "set $2:EventHandler:LuminosityFunction:Energy 140\n";
print "$saverun ${1}01 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 540\n";
print "$saverun ${1}05 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 1800\n";
print "$saverun ${1}18 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}70 $2\n";
print "set $2:EventHandler:YFrametest 0.8\n";
print "set $2:EventHandler:LuminosityFunction:Energy 140\n";
print "$saverun ${1}01Y8 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 540\n";
print "$saverun ${1}05Y8 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 1800\n";
print "$saverun ${1}18Y8 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}70Y8 $2\n";
}
elsif ( /^SAVERUNYR\s+(\S+)\s+(\S+)/ ) {
my $saverun = checkrun($1, $pattern);
print "set $2:EventHandler:YFrametest -1.2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 140\n";
print "$saverun ${1}01 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 540\n";
print "$saverun ${1}05 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 1800\n";
print "$saverun ${1}18 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}70 $2\n";
}
elsif ( /^SAVERUNYM\s+(\S+)\s+(\S+)/ ) {
my $saverun = checkrun($1, $pattern);
print "set $2:EventHandler:YFrametest 0.5\n";
print "set $2:EventHandler:LuminosityFunction:Energy 140\n";
print "$saverun ${1}01 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 540\n";
print "$saverun ${1}05 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 1800\n";
print "$saverun ${1}18 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}70 $2\n";
}
+ elsif ( /^SAVERUNY8\s+(\S+)\s+(\S+)/ ) {
+ my $saverun = checkrun($1, $pattern);
+ print "set $2:EventHandler:YFrametest 0.8\n";
+ print "set $2:EventHandler:LuminosityFunction:Energy 140\n";
+ print "$saverun ${1}01 $2\n";
+ print "set $2:EventHandler:LuminosityFunction:Energy 540\n";
+ print "$saverun ${1}05 $2\n";
+ print "set $2:EventHandler:LuminosityFunction:Energy 1800\n";
+ print "$saverun ${1}18 $2\n";
+ print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
+ print "$saverun ${1}70 $2\n";
+ print "set $2:EventHandler:YFrametest 0.5\n";
+ }
elsif ( /^SAVERUNFS\s+(\S+)\s+(\S+)/ ) {
my $saverun = checkrun($1, $pattern);
print "set $2:EventHandler:LuminosityFunction:Energy 200\n";
print "$saverun ${1}02 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 900\n";
print "$saverun ${1}09 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 2760\n";
print "$saverun ${1}28 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}71 $2\n";
}
elsif ( /^SAVERUNTUNE\s+(\S+)\s+(\S+)\s+(\S+)/ ) {
print "# expanded from SAVERUNTUNE $1 $2 $3\n";
my $saverun = checkrun($1, $pattern);
if ( -e "${3}00.prin" ) {
print "read ${3}00.prin\n";
print "set $2:EventHandler:LuminosityFunction:Energy 200\n";
print "$saverun ${1}02 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 900\n";
print "$saverun ${1}09 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 2760\n";
print "$saverun ${1}28 $2\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}71 $2\n";
}
if ( -e "${3}02.prin" ) {
print "read ${3}02.prin\n";
print "set $2:EventHandler:LuminosityFunction:Energy 200\n";
print "$saverun ${1}0202 $2\n";
}
if ( -e "${3}09.prin" ) {
print "read ${3}09.prin\n";
print "set $2:EventHandler:LuminosityFunction:Energy 900\n";
print "$saverun ${1}0909 $2\n";
}
if ( -e "${3}28.prin" ) {
print "read ${3}28.prin\n";
print "set $2:EventHandler:LuminosityFunction:Energy 2760\n";
print "$saverun ${1}2828 $2\n";
}
if ( -e "${3}70.prin" ) {
print "read ${3}70.prin\n";
print "set $2:EventHandler:LuminosityFunction:Energy 7000\n";
print "$saverun ${1}7170 $2\n";
}
}
else {
print;
}
}
sub checkrun($$) {
my $runname = $_[0];
my $pattern = $_[1];
if ( !$pattern ) {
return "saverun";
}
if ( $pattern eq "all" ) {
return "saverun";
}
if ( $runname =~ /$pattern/ ) {
return "saverun";
}
return "# saverun";
}
diff --git a/DIPSY/PPTune/mkprof.pl b/DIPSY/PPTune/mkprof.pl
--- a/DIPSY/PPTune/mkprof.pl
+++ b/DIPSY/PPTune/mkprof.pl
@@ -1,112 +1,112 @@
#! /usr/bin/perl -w
use strict;
use Getopt::Std;
print "@ARGV\n";
my %opts;
getopts('trw:c:o:s',\%opts);
my $weights = "";
$weights = $opts{'w'} if defined($opts{'w'});
my $combinations = "30:100";
$combinations = $opts{'c'} if defined($opts{'c'});
die "No filetag specified" if !@ARGV;
my $tag = $ARGV[0];
my $profdir = "$tag.prof";
$profdir = $opts{'o'} if defined($opts{'o'});
mkdir $profdir;
mkdir "$profdir/mc";
my @files = glob("$tag\[0-9\]*.log");
foreach my $file ( @files ) {
if ( system("./seminc.pl $file") ) {
next;
}
my $YF = 0;
if ( $file =~ /Y(\d)\.log/ ) {
$YF = $1;
print "Processing $file (shifted frame $YF)... ";
} else {
print "Processing $file... ";
}
open(LOGFILE, "<$file");
my $nruns = 0;
while ( <LOGFILE> ) {
if ( /^>> (\S+) sub-run number (\d+)/ ) {
++$nruns;
my $dir = "$profdir/mc/$tag-$2";
my $runno = $2;
my $runname = $1;
my $fullrunname = $1;
if ( $runname =~ /^(.*)#/ ) {
$runname = $1;
}
mkdir $dir;
my $yodafile = "$fullrunname:$runno.yoda";
my $destyodafile = "$runname:$runno.yoda";
my $copy = "cp $yodafile $dir/$yodafile";
if ( $YF ) {
system("sed -e 's/\-x0/-x8/' $yodafile > $dir/$destyodafile");
} else {
system("cp $yodafile $dir/$destyodafile");
}
if ( defined($opts{'r'}) ) {
system("rm $yodafile");
}
my $params = "$dir/used_params";
$params = "$dir/new_params" if -e $params;
while ( <LOGFILE> ) {
if ( /^\s+set\s+(\S+)\s+(\S+)/ ) {
system("echo $1 $2 >> $params");
} else {
last;
}
}
if ( -e "$dir/new_params" ) {
if ( system("diff -q $dir/new_params $dir/used_params") ) {
die "Warning: inconsistent parameters in $dir/used_params";
}
system("rm $dir/new_params");
}
}
}
print "$nruns runs\n";
}
foreach my $dir ( glob("$profdir/mc/$tag-*") ) {
system("cd $dir; rm -f out.yoda; cat *.yoda > out.yoda; yoda2aida out.yoda out.aida");
}
-system ("cd $profdir; ln -s ../refs ref");
+system ("cd $profdir; rm -f ref; ln -s ../refs ref");
if ( $weights ) {
die "Cannot find weights file $weights"
if system("cp $weights $profdir/weights");
}
elsif ( -e "$tag.weights" ) {
system("cp $tag.weights $profdir/weights");
}
else {
system("cd $profdir; prof-lsobs --mcdir mc --weight=1.0 > weights");
}
system("cd $profdir; prof-runcombs --mcdir mc -c $combinations -o runcombs.dat; prof-interpolate --datadir . --weights weights --runs runcombs.dat");
if ( defined($opts{'t'}) ) {
system("cd $profdir; prof-tune --datadir . --weights weights --runs runcombs.dat");
}
if ( defined($opts{'s'}) ) {
system("./profsum.pl $profdir/tunes/results.pkl");
}
diff --git a/DIPSY/PPTune/runThePEG.tags b/DIPSY/PPTune/runThePEG.tags
--- a/DIPSY/PPTune/runThePEG.tags
+++ b/DIPSY/PPTune/runThePEG.tags
@@ -1,5 +1,6 @@
(.+)(%\d+): --tag=%2 --seed %R %1.run
(.+)_(.*): --tag=#%2 %1.run
+(.+):(.*): --tag=%2 %1.run
.+\.run: %t
.+: %t.run
diff --git a/DIPSY/Parton.cc b/DIPSY/Parton.cc
--- a/DIPSY/Parton.cc
+++ b/DIPSY/Parton.cc
@@ -1,250 +1,256 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the Parton class.
//
#include "Parton.h"
#include "DipoleState.h"
#include "DipoleEventHandler.h"
#include "Dipole.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/CurrentGenerator.h"
#include "ThePEG/Utilities/Debug.h"
#include "ThePEG/Utilities/Throw.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Utilities/DescribeClass.h"
using namespace DIPSY;
Parton::~Parton() {}
Ariadne5::ClonePtr Parton::clone() const {
return new_ptr(*this);
}
void Parton::rebind(const TranslationMap & trans) {
theParents.first = trans.translate(theParents.first);
theParents.second = trans.translate(theParents.second);
+ theMainParent = trans.translate(theMainParent);
theDipoles.first = trans.translate(theDipoles.first);
theDipoles.second = trans.translate(theDipoles.second);
set<tPartonPtr> kids;
kids.swap(theChildren);
trans.translate(inserter(theChildren), kids.begin(), kids.end());
}
-void Parton::interact() {
+void Parton::interact(bool onegluon) {
if ( interacted() ) return;
hasInteracted = true;
+ if ( onegluon && mainParent() ) {
+ mainParent()->interact(true);
+ return;
+ }
if ( parents().first ) parents().first->interact();
if ( parents().second ) parents().second->interact();
}
bool Parton::inInteractingLoop() const {
//search in one direction
DipolePtr d = dipoles().first;
while ( d && d != dipoles().second && !(d->interacted()) ) {
if ( d->neighbors().first )
d = d->neighbors().first;
else
break;
}
if ( !d ) { //if stopped at a quark, look also in other direction
d = dipoles().second;
while ( d && d != dipoles().second && !(d->interacted()) ) {
if ( d->neighbors().first )
d = d->neighbors().first;
else
break;
}
}
if ( d && d->interacted() )
return true;
else
return false;
}
int Parton::nOnShellInChain() const {
int ret = 0;
DipolePtr d = dipoles().first;
if ( onShell() ) ret++;
while ( d && d != dipoles().second ) {
if ( d->partons().first->onShell() ) ret++;
d = d->neighbors().first;
}
if ( !d ) {
d = dipoles().second;
while ( d ) {
if ( d->partons().second->valence() ) ret++;
d = d->neighbors().second;
}
}
return ret;
}
DipoleState& Parton::dipoleState() const {
if ( dipoles().first ) return dipoles().first->dipoleState();
else return dipoles().second->dipoleState();
}
bool Parton::valenceParton() const {
DipoleState & state = dipoleState();
for ( int i = 0, N = state.initialDipoles().size(); i < N; i++ ) {
if ( state.initialDipoles()[i]->partons().first == this ||
state.initialDipoles()[i]->partons().second == this )
return true;
}
return false;
}
bool Parton::inValenceChain() const {
//search in one direction
DipolePtr d = dipoles().first;
if ( valence() ) {
if ( !d )
cout << "found valence quark" << endl;
return true;
}
while ( d && d != dipoles().second ) {
if ( d->partons().first->valence() ) {
return true;
}
d = d->neighbors().first;
}
if ( !d ) { //if stopped at a quark, look also in other direction
cout << "found non-valence quark at x =" << position().x()*GeV
<< ", y = " << position().y()*GeV << endl;
DipoleState & state = dipoleState();
for ( int i = 0, N = state.initialDipoles().size(); i < N; i++ ) {
cout << "valence partons at x = "
<< state.initialDipoles()[i]->partons().first->position().x()*GeV
<< ", y = " << state.initialDipoles()[i]->partons().first->position().y()*GeV << endl;
cout << "valence partons at x = "
<< state.initialDipoles()[i]->partons().second->position().x()*GeV
<< ", y = "
<< state.initialDipoles()[i]->partons().second->position().y()*GeV << endl;
}
d = dipoles().second;
while ( d && d != dipoles().second ) {
if ( d->partons().second->valence() ) {
return true;
}
d = d->neighbors().second;
}
}
return false;
}
bool Parton::swingedEmission() const {
if ( !parents().first || !parents().second ) return false;
else if ( parents().first->parents().second == parents().second ) return false;
else if ( parents().second->parents().first == parents().first ) return false;
if ( Debug::level > 5 ) cout << "parton at " << oY() << " is a swinged emission" << endl;
return true;
}
bool Parton::absorbed() const {
return dipoles().first->children().first || dipoles().first->children().second ||
dipoles().second->children().first || dipoles().second->children().second;
}
double Parton::pTScale() const {
return dipoleState().handler().emitter().pTScale();
}
void Parton::updateMomentum() {
if ( dipoles().first && dipoles().second ) {
tPartonPtr p1 = dipoles().first->partons().first;
tPartonPtr p2 = dipoles().second->partons().second;
pT( pTScale()*((position() - p1->position())/(position() - p1->position()).pt2() +
(position() - p2->position())/(position() - p2->position()).pt2()) );
}
else if ( dipoles().first ) {
tPartonPtr p1 = dipoles().first->partons().first;
pT( pTScale()*(position() - p1->position())/(position() - p1->position()).pt2());
}
else if ( dipoles().second ) {
tPartonPtr p2 = dipoles().second->partons().second;
pT( pTScale()*(position() - p2->position())/(position() - p2->position()).pt2() );
}
else
cout << "Parton without any dipoles?? :o" << endl;
if ( isRightMoving ) {
y( log(pT().pt()/plus()) );
minus( pT().pt()*exp(y()) );
}
else {
y( log(minus()/pT().pt()) );
plus( pT().pt()*exp(-y()) );
}
}
TransverseMomentum Parton::recoil(tPartonPtr p) const {
return pTScale()*(position() - p->position())/dist2(*p);
}
Energy Parton::mass() const {
if ( theMass < ZERO )
theMass = CurrentGenerator::current().getParticleData(flavour())->mass();
return theMass;
}
PPtr Parton::produceParticle() const {
return dipoleState().getParticle(this);
}
void Parton::coutData() {
cout << "data for Parton " << this << endl;
cout << "thePosition1: " << thePosition.first*GeV
<< ", thePosition2: " << thePosition.second*GeV
<< ", thePlus: " << thePlus/GeV
<< ", theOriginalY: " << theOriginalY
<< ", thePT: " << thePT.pt()/GeV
<< ", theValencePT: " << theValencePT.pt()/GeV
<< ", theValencePlus: " << theValencePlus/GeV
<< ", theMinus: " << theMinus/GeV
<< ", theY: " << theY
<< ", isRightMoving: " << isRightMoving
<< ", theFlavour: " << theFlavour
<< ", theParents1: " << theParents.first
<< ", theParents2: " << theParents.second
+ << ", theMainParent: " << theMainParent
<< ", theChildren: ";
for( set<tPartonPtr>::iterator it = theChildren.begin();
it != theChildren.end();it++)
cout << *it << ", ";
cout << "theDipoles1: " << theDipoles.first
<< ", theDipoles2: " << theDipoles.second
<< ", hasInteracted: " << hasInteracted
<< ", isOrdered: " << isOrdered
<< ", isOnShell: " << isOnShell
<< ", isValence: " << isValence
<< ", theNumber: " << theNumber
<< ", theMass: " << theMass/GeV << endl;
}
void Parton::persistentOutput(PersistentOStream & os) const {
os << ounit(thePosition, InvGeV) << ounit(thePlus, GeV) << theOriginalY
<< ounit(thePT, GeV) << ounit(theValencePT, GeV)
<< ounit(theValencePlus, GeV) << ounit(theMinus, GeV) << theY
- << isRightMoving << theFlavour << theParents << theDipoles
+ << isRightMoving << theFlavour << theParents << theMainParent << theDipoles
<< hasInteracted << isOrdered << isOnShell << isValence
<< ounit(theMass, GeV);
}
void Parton::persistentInput(PersistentIStream & is, int) {
is >> iunit(thePosition, InvGeV) >> iunit(thePlus, GeV) >> theOriginalY
>> iunit(thePT, GeV) >> iunit(theValencePT, GeV)
>> iunit(theValencePlus, GeV) >> iunit(theMinus, GeV) >> theY
- >> isRightMoving >> theFlavour >> theParents >> theDipoles
+ >> isRightMoving >> theFlavour >> theParents >> theMainParent >> theDipoles
>> hasInteracted >> isOrdered >> isOnShell >> isValence
>> iunit(theMass, GeV);
}
DescribeClass<Parton,Ariadne5::CloneBase>
describeDIPSYParton("DIPSY::Parton", "libAriadne5.so libDIPSY.so");
// Definition of the static class description member.
void Parton::Init() {}
diff --git a/DIPSY/Parton.h b/DIPSY/Parton.h
--- a/DIPSY/Parton.h
+++ b/DIPSY/Parton.h
@@ -1,539 +1,647 @@
// -*- C++ -*-
#ifndef DIPSY_Parton_H
#define DIPSY_Parton_H
//
// This is the declaration of the Parton class.
//
#include "ThePEG/Config/ThePEG.h"
#include "ThePEG/Vectors/Transverse.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "Ariadne/Config/CloneBase.h"
#include "Parton.fh"
#include "Dipole.fh"
namespace DIPSY {
using namespace ThePEG;
/**
* Here is the documentation of the Parton class.
*/
class Parton: public Ariadne5::CloneBase {
public:
friend class RealParton;
/**
* Typedef for position in transverse coordinate space.
*/
typedef Transverse<InvEnergy> Point;
/**
* A pair of partons.
*/
typedef pair<tPartonPtr,tPartonPtr> tPartonPair;
/**
* A pair of dipoles.
*/
typedef pair<tDipolePtr,tDipolePtr> tDipolePair;
/**
* The Dipole is a friend.
*/
friend class Dipole;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline Parton();
+ inline Parton()
+ : thePosition(Point()), thePlus(0.0*GeV), theOriginalY(0.0),
+ thePT(TransverseMomentum()),
+ theValencePT(TransverseMomentum()),theValencePlus(ZERO),
+ theMinus(0*GeV), theY(0), isRightMoving(true), theFlavour(ParticleID::g),
+ theParents(tPartonPair()), theDipoles(tDipolePair()), hasInteracted(false),
+ isOnShell(false), isValence(false), theMass(-1*GeV) {}
/**
* The copy constructor.
*/
- inline Parton(const Parton &);
+ inline Parton(const Parton & x)
+ : thePosition(x.thePosition), thePlus(x.thePlus),theOriginalY(x.theOriginalY),
+ thePT(x.thePT),
+ theValencePT(x.theValencePT),theValencePlus(x.theValencePlus),
+ theMinus(x.theMinus), theY(x.theY), isRightMoving(x.isRightMoving),
+ theFlavour(x.theFlavour),theParents(x.theParents),
+ theChildren(x.theChildren), theDipoles(x.theDipoles),
+ hasInteracted(x.hasInteracted), isOrdered(x.isOrdered),
+ isOnShell(x.isOnShell), isValence(x.isValence), theMass(x.theMass) {}
/**
* The destructor.
*/
virtual ~Parton();
//@}
protected:
/** @name The virtual functions to be overridden in sub-classes. */
//@{
/**
* Return a simple clone of this object. Should be implemented as
* <code>return new_ptr(*this);</code> by a derived class.
*/
virtual Ariadne5::ClonePtr clone() const;
/**
* Rebind pointers to other CloneBase objects. Called after a number
* of interconnected CloneBase objects have been cloned, so that
* the cloned objects will refer to the cloned copies afterwards.
*
* @param trans a TranslationMap relating the original objects to
* their respective clones.
*/
virtual void rebind(const TranslationMap & trans);
//@}
public:
/**
* Return the DipoleState to which this parton belongs. If it was
* originally belonged to one state which was subsequently merged
* into another, the parton will belong to the latter state.
*/
DipoleState & dipoleState() const;
/**
* finds the pTscale through the dipolestates emitter.
*/
double pTScale() const;
/**
* Calculate the squared transverse distance to the given parton.
*/
- inline InvEnergy2 dist2(const Parton &) const;
+ inline InvEnergy2 dist2(const Parton & p) const {
+ return (position() - p.position()).pt2();
+ }
/**
* Produce a ThePEG::Particle corresponding to this parton.
*/
PPtr produceParticle() const;
/**
* The mass of this parton.
*/
Energy mass() const;
/**
* The final-state momentum of this particle.
*/
LorentzMomentum momentum() const {
return lightCone(plus(), (pT().pt2() + sqr(mass()))/plus(), pT());
}
/** @name Simple access functions. */
//@{
/**
* Get the position in impact parameter space.
*/
- inline const Point & position() const;
+ inline const Point & position() const {
+ return thePosition;
+ }
/**
* Get the positive light-cone momentum.
*/
- inline Energy plus() const;
+ inline Energy plus() const {
+ return thePlus;
+ }
/**
* Get the transverse momentum.
*/
- inline TransverseMomentum pT() const;
+ inline TransverseMomentum pT() const {
+ return thePT;
+ }
/**
* Get the transverse valence momentum. 0 if not a valence parton.
*/
- inline TransverseMomentum valencePT() const;
+ inline TransverseMomentum valencePT() const {
+ if (isValence)
+ return theValencePT;
+ return TransverseMomentum();
+ }
/**
* Get the valence energy. 0 if not a valence parton.
*/
- inline Energy valencePlus() const;
+ inline Energy valencePlus() const {
+ if (isValence)
+ return theValencePlus;
+ return ZERO;
+ }
/**
* Get the accumulated negative light-cone momentum deficit.
*/
- inline Energy minus() const;
+ inline Energy minus() const {
+ return theMinus;
+ }
/**
* Get the rapidity.
*/
- inline double y() const;
+ inline double y() const {
+ return theY;
+ }
/**
* Get the flavour of this parton.
*/
- inline long flavour() const;
+ inline long flavour() const {
+ return theFlavour;
+ }
/**
* Get the parent partons.
*/
- inline tPartonPair parents() const;
+ inline tPartonPair parents() const {
+ return theParents;
+ }
+
+ /**
+ * Get the main parent.
+ */
+ inline tPartonPtr mainParent() const {
+ return theMainParent;
+ }
/**
* Get the children partons.
*/
inline const set<tPartonPtr> & children() const {
return theChildren;
};
/**
* Remove a child
**/
inline void removeChild(PartonPtr child) {
theChildren.erase(child);
};
/**
* Remove all children
**/
inline void removeAllChildren() {
theChildren.clear();
};
/**
* Get the connecting dipoles.
*/
- inline tDipolePair dipoles() const;
+ inline tDipolePair dipoles() const {
+ return theDipoles;
+ }
/**
* Indicate if this parton has interacted.
*/
- inline bool interacted() const;
+ inline bool interacted() const {
+ return hasInteracted;
+ }
/**
* Indicate if this parton is ordered.
*/
- inline bool ordered() const;
+ inline bool ordered() const {
+ return isOrdered;
+ }
/**
* Set if this parton is ordered.
*/
- inline void ordered(bool);
+ inline void ordered(bool b) {
+ isOrdered = b;
+ }
/**
* Return if this parton is on shell.
*/
- inline bool onShell() const;
+ inline bool onShell() const {
+ return isOnShell;
+ }
/**
* Set if this parton is on shell.
*/
- inline void onShell(bool);
+ inline void onShell(bool b) {
+ isOnShell = b;
+ }
/**
* Return if this parton is a valence parton.
*/
- inline bool valence() const;
+ inline bool valence() const {
+ return isValence;
+ }
/**
* Returns true if the parton is absorbed.
*/
bool absorbed() const;
/**
* Set if this parton is a valence parton.
*/
- inline void valence(bool);
+ inline void valence(bool b) {
+ isValence = b;
+ }
/**
* Set the position in impact parameter space.
*/
- inline void position(const Point &);
+ inline void position(const Point & x) {
+ thePosition = x;
+ }
/**
* Set the positive light-cone momentum.
*/
- inline void plus(Energy);
+ inline void plus(Energy x) {
+ thePlus = x;
+ }
/**
* Set the transverse momentum.
*/
- inline void pT(TransverseMomentum);
+ inline void pT(TransverseMomentum x) {
+ thePT = x;
+ }
/**
* Set the transverse valence momentum, and set isValence to true.
*/
- inline void valencePT(TransverseMomentum);
+ inline void valencePT(TransverseMomentum x) {
+ isValence = true;
+ theValencePT = x;
+ }
/**
* Set the valence energy.
*/
- inline void valencePlus(Energy);
+ inline void valencePlus(Energy E) {
+ theValencePlus = E;
+ }
/**
* Set the accumulated negative light-cone momentum deficit.
*/
- inline void minus(Energy);
+ inline void minus(Energy x) {
+ theMinus = x;
+ }
/**
* Set the rapidity.
*/
- inline void y(double);
+ inline void y(double x) {
+ theY = x;
+ }
/**
* Set the flavour of this parton.
*/
- inline void flavour(long);
+ inline void flavour(long x) {
+ theFlavour = (x == 0? ParticleID::g: x);
+ }
/**
* Set the parent partons.
*/
- inline void parents(tPartonPair);
+ inline void parents(tPartonPair x) {
+ theParents = x;
+ }
+
+ /**
+ * Set the main parent parton.
+ */
+ inline void mainParent(tPartonPtr p) {
+ theMainParent = p;
+ }
/**
* Set the connecting dipoles.
*/
- inline void dipoles(tDipolePair);
+ inline void dipoles(tDipolePair x) {
+ theDipoles = x;
+ }
/**
* Get the original emission rapidity.
*/
- inline const double oY() const;
+ inline const double oY() const {
+ return theOriginalY;
+ }
/**
* Set the original emission rapidity.
*/
- inline void oY(double);
+ inline void oY(double y) {
+ theOriginalY = y;
+ }
/**
- * Indicate that this parton has interacted.
+ * Indicate that this parton has interacted. If \a onegluon is true,
+ * only the main parent is recursively flagged as interacted.
*/
- void interact();
+ void interact(bool onegluon = false);
/**
* Returns true if the parton comes from a rightmoving state.
*/
- inline bool rightMoving() const;
+ inline bool rightMoving() const {
+ return isRightMoving;
+ }
/**
* Set the direction of the original state.
*/
- inline void rightMoving(bool);
+ inline void rightMoving(bool rM) {
+ isRightMoving = rM;
+ }
/**
* Get and set the number of the parton.
*/
inline int number() {
return theNumber;
}
+
inline void number(int N) {
theNumber = N;
}
/**
* Checks if the parton is colour connected (in many steps if
* needed) to an interacting dipole.
*/
bool inInteractingLoop() const;
/**
* counts the number of on shell partons in this partons colour chain.
*/
int nOnShellInChain() const;
/**
* Checks if the parton is part of on of its states original dipoles.
*/
bool valenceParton() const;
/**
* Checks if the parton is in a colour chain containing a valenceparton.
*/
bool inValenceChain() const;
/**
* Returns true if the dipole the parton was emitted from is the result of a swing.
**/
bool swingedEmission() const;
/**
* Updates pT according to the colour neighbours, and changes y and
* plus/minus for right/left moving. minus/plus unchanged.
*/
void updateMomentum();
/**
* Updates y and p- from plus and pT.
*/
inline void updateYMinus() {
theY = log(thePT.pt()/thePlus);
theMinus = thePT.pt()*exp(theY);
}
+ inline void mirror(double y0) {
+ y(2.0*y0 - y());
+ swap(thePlus, theMinus);
+ rightMoving(!rightMoving());
+ }
+
/**
* Prints all the member variables to cout.
*/
void coutData();
/**
* Returns the recoil this parton would get from the argument parton.
*/
TransverseMomentum recoil(tPartonPtr) const;
//@}
public:
/**
* debugging
*/
mutable TransverseMomentum m1pT, m2pT;
mutable Energy m1plus, m2plus;
mutable InvEnergy minr1, minr2, maxr1, maxr2;
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();
private:
/**
* The position in impact parameter space.
*/
Point thePosition;
/**
* The positive light-cone momentum.
*/
Energy thePlus;
/**
* The enumeration of this emission.
*/
double theOriginalY;
/**
* The transverse momentum.
*/
TransverseMomentum thePT;
/**
* The transverse momentum and energy a valenceparton got at creation.
*/
TransverseMomentum theValencePT;
Energy theValencePlus;
/**
* The accumulated negative light-cone momentum deficit.
*/
Energy theMinus;
/**
* The rapidity.
*/
double theY;
/**
* The original direction of the particle.
*/
bool isRightMoving;
/**
* The flavour of this parton.
*/
long theFlavour;
/**
* The parent partons.
*/
tPartonPair theParents;
/**
+ * The main parent parton.
+ */
+ tPartonPtr theMainParent;
+
+ /**
* The children
**/
set<tPartonPtr> theChildren;
/**
* The connecting dipoles.
*/
tDipolePair theDipoles;
/**
* Indicate if this parton has interacted.
*/
bool hasInteracted;
/**
* Indicate if this parton is ordered with respect to its colour neighbours.
*/
bool isOrdered;
/**
* Indicate if this parton is on shell, that is if it has
* been supplied with the neccesary p+ or p- for left or rightmoving
* particles respectively.
*/
bool isOnShell;
/**
* Indicate if this parton is a valence parton.
*/
bool isValence;
/**
* A number that identifies the parton in a dipole state.
*/
int theNumber;
/**
* The mass of this parton.
*/
mutable Energy theMass;
protected:
/**
* Exception class for bad kinematics.
*/
struct PartonKinematicsException: public Exception {};
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Parton & operator=(const Parton &);
};
}
template <typename T, typename Alloc>
std::vector<T,Alloc> &
expandToFit(std::vector<T,Alloc> & v,
typename std::vector<T,Alloc>::size_type indx) {
if ( indx >= v.size() ) v.resize(indx + 1);
return v;
}
template <typename T, typename Alloc>
T & forceAt(std::vector<T,Alloc> & v,
typename std::vector<T,Alloc>::size_type indx) {
return expandToFit(v, indx)[indx];
}
-#include "Parton.icc"
-
#endif /* DIPSY_Parton_H */
diff --git a/DIPSY/Parton.icc b/DIPSY/Parton.icc
deleted file mode 100644
--- a/DIPSY/Parton.icc
+++ /dev/null
@@ -1,160 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the Parton class.
-//
-
-namespace DIPSY {
-
-inline Parton::Parton()
- : thePosition(Point()), thePlus(0.0*GeV), theOriginalY(0.0),
- thePT(TransverseMomentum()),
- theValencePT(TransverseMomentum()),theValencePlus(ZERO),
- theMinus(0*GeV), theY(0), isRightMoving(true), theFlavour(ParticleID::g),
- theParents(tPartonPair()), theDipoles(tDipolePair()), hasInteracted(false),
- isOnShell(false), isValence(false), theMass(-1*GeV) {}
-
-inline Parton::Parton(const Parton & x)
- : thePosition(x.thePosition), thePlus(x.thePlus),theOriginalY(x.theOriginalY),
- thePT(x.thePT),
- theValencePT(x.theValencePT),theValencePlus(x.theValencePlus),
- theMinus(x.theMinus), theY(x.theY), isRightMoving(x.isRightMoving),
- theFlavour(x.theFlavour),theParents(x.theParents),
- theChildren(x.theChildren), theDipoles(x.theDipoles),
- hasInteracted(x.hasInteracted), isOrdered(x.isOrdered),
- isOnShell(x.isOnShell), isValence(x.isValence), theMass(x.theMass) {}
-
-inline const Parton::Point & Parton::position() const {
- return thePosition;
-}
-
-inline void Parton::position(const Point & x) {
- thePosition = x;
-}
-
-inline Energy Parton::plus() const {
- return thePlus;
-}
-
-inline void Parton::plus(Energy x) {
- thePlus = x;
-}
-
-inline TransverseMomentum Parton::pT() const {
- return thePT;
-}
-
-inline void Parton::pT(TransverseMomentum x) {
- thePT = x;
-}
-
-inline const double Parton::oY() const {
- return theOriginalY;
-}
-
-inline void Parton::oY(double y) {
- theOriginalY = y;
-}
-
-inline TransverseMomentum Parton::valencePT() const {
- if (isValence)
- return theValencePT;
- return TransverseMomentum();
-}
-
-inline void Parton::valencePT(TransverseMomentum x) {
- isValence = true;
- theValencePT = x;
-}
-
-inline Energy Parton::valencePlus() const {
- if (isValence)
- return theValencePlus;
- return ZERO;
-}
-
-inline void Parton::valencePlus(Energy E) {
- theValencePlus = E;
-}
-
-inline Energy Parton::minus() const {
- return theMinus;
-}
-
-inline void Parton::minus(Energy x) {
- theMinus = x;
-}
-
-inline double Parton::y() const {
- return theY;
-}
-
-inline void Parton::y(double x) {
- theY = x;
-}
-
-inline Parton::tPartonPair Parton::parents() const {
- return theParents;
-}
-
-inline void Parton::parents(tPartonPair x) {
- theParents = x;
-}
-
-inline Parton::tDipolePair Parton::dipoles() const {
- return theDipoles;
-}
-
-inline void Parton::dipoles(tDipolePair x) {
- theDipoles = x;
-}
-
-inline bool Parton::rightMoving() const {
- return isRightMoving;
-}
-
-inline void Parton::rightMoving(bool rM) {
- isRightMoving = rM;
-}
-
-inline bool Parton::interacted() const {
- return hasInteracted;
-}
-
-inline bool Parton::ordered() const {
- return isOrdered;
-}
-
-inline void Parton::ordered(bool b) {
- isOrdered = b;
-}
-
-inline bool Parton::onShell() const {
- return isOnShell;
-}
-
-inline void Parton::onShell(bool b) {
- isOnShell = b;
-}
-
-inline bool Parton::valence() const {
- return isValence;
-}
-
-inline void Parton::valence(bool b) {
- isValence = b;
-}
-
-inline InvEnergy2 Parton::dist2(const Parton & p) const {
- return (position() - p.position()).pt2();
-}
-
-inline long Parton::flavour() const {
- return theFlavour;
-}
-
-inline void Parton::flavour(long x) {
- theFlavour = (x == 0? ParticleID::g: x);
-}
-
-}
diff --git a/DIPSY/PhotonDipoleState.h b/DIPSY/PhotonDipoleState.h
--- a/DIPSY/PhotonDipoleState.h
+++ b/DIPSY/PhotonDipoleState.h
@@ -1,73 +1,72 @@
// -*- C++ -*-
#ifndef DIPSY_PhotonDipoleState_H
#define DIPSY_PhotonDipoleState_H
//
// The PhotonDipoleState class is a simple wrapper sub-class of
// DipoleState for easy construction of an initial simple q-qbar
// dipole.
//
#include "DipoleState.h"
#include "PhotonWFInfo.h"
namespace DIPSY {
using namespace ThePEG;
/**
* Here is the documentation of the PhotonDipoleState class.
*/
class PhotonDipoleState: public DipoleState {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline PhotonDipoleState();
+ inline PhotonDipoleState() {}
/**
* The standard constructor taking an event handler, the total
* positive light-cone momentum and a PhotonWFInfo as argument.
*/
PhotonDipoleState(const DipoleEventHandler & eh, Energy plus, Energy minus,
Ptr<PhotonWFInfo>::pointer wfi, double weight);
/**
* The copy constructor.
*/
- inline PhotonDipoleState(const PhotonDipoleState &);
+ inline PhotonDipoleState(const PhotonDipoleState & x)
+ : DipoleState(x) {}
/**
* The destructor.
*/
virtual ~PhotonDipoleState();
//@}
public:
/**
* 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();
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
PhotonDipoleState & operator=(const PhotonDipoleState &);
};
}
-#include "PhotonDipoleState.icc"
-
#endif /* DIPSY_PhotonDipoleState_H */
diff --git a/DIPSY/PhotonDipoleState.icc b/DIPSY/PhotonDipoleState.icc
deleted file mode 100644
--- a/DIPSY/PhotonDipoleState.icc
+++ /dev/null
@@ -1,14 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the PhotonDipoleState class.
-//
-
-namespace DIPSY {
-
-inline PhotonDipoleState::PhotonDipoleState() {}
-
-inline PhotonDipoleState::PhotonDipoleState(const PhotonDipoleState & x)
- : DipoleState(x) {}
-
-}
diff --git a/DIPSY/PhotonWFInfo.h b/DIPSY/PhotonWFInfo.h
--- a/DIPSY/PhotonWFInfo.h
+++ b/DIPSY/PhotonWFInfo.h
@@ -1,141 +1,153 @@
// -*- C++ -*-
#ifndef DIPSY_PhotonWFInfo_H
#define DIPSY_PhotonWFInfo_H
//
// This is the declaration of the PhotonWFInfo class.
//
#include "Ariadne/DIPSY/WFInfo.h"
namespace DIPSY {
using namespace ThePEG;
/**
* The PhotonWFInfo class describes the polarizations and energy
* sharing of a DipoleState constructed from a VirtualPhoton
* wavefunction.
*/
class PhotonWFInfo: public WFInfo {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor, giving the size, \a rini, energy
* sharing, \a zini, the photon polarization, \a polini, the quark
* and anti-quark helicities, \a hini and \a hbarini, and the quark
* flavour, \a flini, as arguments
*/
inline PhotonWFInfo(tcWaveFunctionPtr wfin = tcWaveFunctionPtr(),
InvEnergy rini = 0.0*InvGeV, double zini = 0.0,
int polini = 0, int hini = 0, int hbarini = 0,
- int flini = 0);
+ int flini = 0)
+ : WFInfo(wfin, rini), theZ(zini), thePol(polini),
+ theH(hini), theHbar(hbarini), theFlav(flini) {}
/**
* The copy constructor.
*/
- inline PhotonWFInfo(const PhotonWFInfo &);
-
+ inline PhotonWFInfo(const PhotonWFInfo & x)
+ : WFInfo(x), theZ(x.theZ), thePol(x.thePol),
+ theH(x.theH), theHbar(x.theHbar), theFlav(x.theFlav) {}
+
/**
* The destructor.
*/
virtual ~PhotonWFInfo();
//@}
public:
/**
* The energy fraction of the quark.
*/
- inline double z() const;
+ inline double z() const {
+ return theZ;
+ }
/**
* The polarization (-1, 0 or 1) of the photon.
*/
- inline int pol() const;
+ inline int pol() const {
+ return thePol;
+ }
/**
* The helicity (+-1) of the quark.
*/
- inline int h() const;
+ inline int h() const {
+ return theH;
+ }
/**
* The helicity (+-1) of the antiquark.
*/
- inline int hbar() const;
+ inline int hbar() const {
+ return theHbar;
+ }
/**
* Get the flavour of the quark.
*/
- inline int flav() const;
+ inline int flav() const {
+ return theFlav;
+ }
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();
private:
/**
* The energy fraction of the quark.
*/
double theZ;
/**
* The polarization (-1, 0 or 1) of the photon.
*/
int thePol;
/**
* The helicity (+-1) of the quark.
*/
int theH;
/**
* The helicity (+-1) of the antiquark.
*/
int theHbar;
/**
* The flavour of the quark.
*/
int theFlav;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
PhotonWFInfo & operator=(const PhotonWFInfo &);
};
}
-#include "PhotonWFInfo.icc"
-
#endif /* DIPSY_PhotonWFInfo_H */
diff --git a/DIPSY/PhotonWFInfo.icc b/DIPSY/PhotonWFInfo.icc
deleted file mode 100644
--- a/DIPSY/PhotonWFInfo.icc
+++ /dev/null
@@ -1,39 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the PhotonWFInfo class.
-//
-
-namespace DIPSY {
-
-inline PhotonWFInfo::PhotonWFInfo(tcWaveFunctionPtr wfin, InvEnergy rini,
- double zini, int polini,
- int hini, int hbarini, int flini)
- : WFInfo(wfin, rini), theZ(zini), thePol(polini),
- theH(hini), theHbar(hbarini), theFlav(flini) {}
-
-inline PhotonWFInfo::PhotonWFInfo(const PhotonWFInfo & x)
- : WFInfo(x), theZ(x.theZ), thePol(x.thePol),
- theH(x.theH), theHbar(x.theHbar), theFlav(x.theFlav) {}
-
-inline double PhotonWFInfo::z() const {
- return theZ;
-}
-
-inline int PhotonWFInfo::pol() const {
- return thePol;
-}
-
-inline int PhotonWFInfo::h() const {
- return theH;
-}
-
-inline int PhotonWFInfo::hbar() const {
- return theHbar;
-}
-
-inline int PhotonWFInfo::flav() const {
- return theFlav;
-}
-
-}
diff --git a/DIPSY/SemiInclusiveXSecAnalysis.cc b/DIPSY/SemiInclusiveXSecAnalysis.cc
--- a/DIPSY/SemiInclusiveXSecAnalysis.cc
+++ b/DIPSY/SemiInclusiveXSecAnalysis.cc
@@ -1,206 +1,206 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the SemiInclusiveXSecAnalysis class.
//
#include "SemiInclusiveXSecAnalysis.h"
#include "DipoleXSec.h"
#include "DipoleState.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "gsl/gsl_sf_bessel.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace DIPSY;
-SemiInclusiveXSecAnalysis::SemiInclusiveXSecAnalysis() {}
+SemiInclusiveXSecAnalysis::SemiInclusiveXSecAnalysis(): ntot(0) {}
SemiInclusiveXSecAnalysis::~SemiInclusiveXSecAnalysis() {}
void SemiInclusiveXSecAnalysis::initialize() {
ntot = 0;
sigtot = signd = sigel = sigdt = sigdr = sigdl = sigdd = ZERO;
sigtot2 = signd2 = sigel2 = sigdt2 = sigdr2 = sigdl2 = sigdd2 = ZERO;
}
void SemiInclusiveXSecAnalysis::
analyze(const vector<DipoleStatePtr> & vr, const vector<DipoleStatePtr> & vl,
const vector<ImpactParameters> & vb, const DipoleXSec & xsec,
const Vec3D & probs, double jac) {
int Nr = vr.size();
int Nl = vl.size();
if ( Nr*Nl*vb.size() == 0 ) return;
for ( int ib = 0, Nb = vb.size(); ib < Nb; ++ib ) {
CrossSection bweight = sqr(hbarc)*vb[ib].weight()*jac;
double sumLR = 0.0; // T averaged over L and R
int nLR = 0;
double sum2LR = 0.0; // T^2 average over L and R
int n2LR = 0;
double sumLR2 = 0.0; // (T averaged over L and R )^2
int nLR2 = 0;
double sumL2R = 0.0; // (T averaged over L)^2 averaged over R
int nL2R = 0;
double sumR2L = 0.0; // (T averaged over R)^2 averaged over L
int nR2L = 0;
for ( int ir1 = 0; ir1 < Nr; ++ir1 ) for ( int il1 = 0; il1 < Nl; ++il1 ) {
double T1 = probs[il1][ir1][ib];
double w1 = vr[ir1]->weight()*vl[il1]->weight();
double UT1 = xsec.unitarize(T1);
sumLR += UT1*w1;
++nLR;
sum2LR += sqr(UT1*w1);
++n2LR;
for ( int ir2 = 0; ir2 < Nr; ++ir2 ) for ( int il2 = 0; il2 < Nl; ++il2 ) {
double T2 = probs[il2][ir2][ib];
double w2 = vr[ir2]->weight()*vl[il2]->weight();
double UT2 = xsec.unitarize(T2);
double UT = UT1*w1*UT2*w2;
if ( il1 != il2 && ir1 != ir2 ){
sumLR2 += UT;
++nLR2;
}
if ( il1 != il2 && ir1 == ir2 ) {
sumL2R += UT;
++nL2R;
}
if ( il1 == il2 && ir1 != ir2 ) {
sumR2L += UT;
++nR2L;
}
}
}
sumLR /=double(nLR);
sum2LR /=double(n2LR);
sumL2R /=double(nL2R);
sumR2L /=double(nR2L);
sumLR2 /=double(nLR2);
CrossSection bw = bweight;
CrossSection2 bw2 = sqr(bw);
sigtot += 2.0*sumLR*bw;
sigtot2 += sqr(2.0*sumLR)*bw2;
signd += (2.0*sumLR - sum2LR)*bw;
signd2 += sqr(2.0*sumLR - sum2LR)*bw2;
sigel += sumLR2*bw;
sigel2 += sqr(sumLR2)*bw2;
sigdl += (sumL2R - sumLR2)*bw;
sigdl2 += sqr(sumL2R - sumLR2)*bw2;
sigdr += (sumR2L - sumLR2)*bw;
sigdr2 += sqr(sumR2L - sumLR2)*bw2;
sigdd += (sum2LR - sumR2L - sumL2R + sumLR2)*bw;
sigdd2 += sqr(sum2LR - sumR2L - sumL2R + sumLR2)*bw2;
sigdt += (sum2LR - sumLR2)*bw;
sigdt2 += sqr(sum2LR - sumLR2)*bw2;
++ntot;
}
}
void SemiInclusiveXSecAnalysis::finalize(long neve) {
if ( neve <= 0 ) return;
sigtot /= double(ntot);
sigtot2 /= double(ntot);
CrossSection err = sqrt((sigtot2 - sqr(sigtot))/double(ntot));
stub(": Total:") << ouniterr(sigtot, err, nanobarn) << " nb." << endl;
signd /= double(ntot);
signd2 /= double(ntot);
err = sqrt((signd2 - sqr(signd))/double(ntot));
stub(": Inelastic (ND):") << ouniterr(signd, err, nanobarn) << " nb." << endl;
if ( sigel2 > ZERO ) {
sigel /= double(ntot);
sigel2 /= double(ntot);
err = sqrt((sigel2 - sqr(sigel))/double(ntot));
stub(": Elastic:") << ouniterr(sigel, err, nanobarn) << " nb." << endl;
}
if ( sigdt2 > ZERO ) {
sigdt /= double(ntot);
sigdt2 /= double(ntot);
err = sqrt((sigdt2 - sqr(sigdt))/double(ntot));
stub(": Diffractive total:") << ouniterr(sigdt, err, nanobarn) << " nb." << endl;
}
if ( sigdr2 > ZERO ) {
sigdr /= double(ntot);
sigdr2 /= double(ntot);
err = sqrt((sigdr2 - sqr(sigdr))/double(ntot));
stub(": Diffractive excitation (R):")
<< ouniterr(sigdr, err, nanobarn) << " nb." << endl;
}
if ( sigdl2 > ZERO ) {
sigdl /= double(ntot);
sigdl2 /= double(ntot);
err = sqrt((sigdl2 - sqr(sigdl))/double(ntot));
stub(": Diffractive excitation (L):")
<< ouniterr(sigdl, err, nanobarn) << " nb." << endl;
}
if ( sigdd2 > ZERO ) {
sigdd /= double(ntot);
sigdd2 /= double(ntot);
err = sqrt((sigdd2 - sqr(sigdd))/double(ntot));
stub(": Double diffractive excitation:")
<< ouniterr(sigdd, err, nanobarn) << " nb." << endl;
}
}
IBPtr SemiInclusiveXSecAnalysis::clone() const {
return new_ptr(*this);
}
IBPtr SemiInclusiveXSecAnalysis::fullclone() const {
return new_ptr(*this);
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void SemiInclusiveXSecAnalysis::persistentOutput(PersistentOStream & os) const {
const CrossSection nb = nanobarn;
const CrossSection2 nb2= sqr(nb);
os << ntot << ounit(sigtot, nb) << ounit(signd, nb) << ounit(sigel, nb)
<< ounit(sigdt, nb) << ounit(sigdl, nb) << ounit(sigdr, nb) << ounit(sigdd, nb)
<< ounit(sigtot2, nb2) << ounit(signd2, nb2) << ounit(sigel2, nb2)
<< ounit(sigdt2, nb2) << ounit(sigdl2, nb2) << ounit(sigdr2, nb2) << ounit(sigdd2, nb2);
}
void SemiInclusiveXSecAnalysis::persistentInput(PersistentIStream & is, int) {
const CrossSection nb = nanobarn;
const CrossSection2 nb2= sqr(nb);
is >> ntot >> iunit(sigtot, nb) >> iunit(signd, nb) >> iunit(sigel, nb)
>> iunit(sigdt, nb) >> iunit(sigdl, nb) >> iunit(sigdr, nb) >> iunit(sigdd, nb)
>> iunit(sigtot2, nb2) >> iunit(signd2, nb2) >> iunit(sigel2, nb2)
>> iunit(sigdt2, nb2) >> iunit(sigdl2, nb2) >> iunit(sigdr2, nb2) >> iunit(sigdd2, nb2);
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<SemiInclusiveXSecAnalysis,DIPSY::DipoleAnalysisHandler>
describeDIPSYSemiInclusiveXSecAnalysis("DIPSY::SemiInclusiveXSecAnalysis",
"SemiInclusiveXSecAnalysis.so");
void SemiInclusiveXSecAnalysis::Init() {
static ClassDocumentation<SemiInclusiveXSecAnalysis> documentation
("There is no documentation for the SemiInclusiveXSecAnalysis class");
}
diff --git a/DIPSY/SimpleNucleus.icc b/DIPSY/SimpleNucleus.icc
deleted file mode 100644
--- a/DIPSY/SimpleNucleus.icc
+++ /dev/null
@@ -1,24 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the SimpleNucleus class.
-//
-
-namespace DIPSY {
-
-inline SimpleNucleus::SimpleNucleus()
- : A(208), Z(82), R(6.68*femtometer), a(0.546*femtometer), w(0.0),
- wf(WaveFunctionPtr()), Rn(1.3*femtometer) {}
-
-inline SimpleNucleus::SimpleNucleus(const SimpleNucleus & x)
- : A(x.A), Z(x.Z), R(x.R), a(x.a), w(x.w), wf(x.wf), Rn(x.Rn) {}
-
-inline IBPtr SimpleNucleus::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr SimpleNucleus::fullclone() const {
- return new_ptr(*this);
-}
-
-}
diff --git a/DIPSY/SimpleProton.icc b/DIPSY/SimpleProton.icc
deleted file mode 100644
--- a/DIPSY/SimpleProton.icc
+++ /dev/null
@@ -1,15 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the SimpleProton class.
-//
-
-namespace DIPSY {
-
-
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/DIPSY/SimpleProtonState.h b/DIPSY/SimpleProtonState.h
--- a/DIPSY/SimpleProtonState.h
+++ b/DIPSY/SimpleProtonState.h
@@ -1,70 +1,69 @@
// -*- C++ -*-
#ifndef DIPSY_SimpleProtonState_H
#define DIPSY_SimpleProtonState_H
//
// This is the declaration of the SimpleProtonState class.
//
#include "DipoleState.h"
namespace DIPSY {
using namespace ThePEG;
/**
* Here is the documentation of the SimpleProtonState class.
*/
class SimpleProtonState: public DipoleState {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline SimpleProtonState();
+ inline SimpleProtonState() {}
/**
* The standard constructor.
*/
SimpleProtonState(const DipoleEventHandler & eh, Energy plus, Energy minus,
double angleWidth, double rapWidth, int connected,
WFInfoPtr wfi, double weight);
/**
* The copy constructor.
*/
- inline SimpleProtonState(const SimpleProtonState &);
+ inline SimpleProtonState(const SimpleProtonState & x)
+ : DipoleState(x) {}
/**
* The destructor.
*/
virtual ~SimpleProtonState();
//@}
public:
/**
* 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();
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
SimpleProtonState & operator=(const SimpleProtonState &);
};
}
-#include "SimpleProtonState.icc"
-
#endif /* DIPSY_SimpleProtonState_H */
diff --git a/DIPSY/SimpleProtonState.icc b/DIPSY/SimpleProtonState.icc
deleted file mode 100644
--- a/DIPSY/SimpleProtonState.icc
+++ /dev/null
@@ -1,14 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the SimpleProtonState class.
-//
-
-namespace DIPSY {
-
-inline SimpleProtonState::SimpleProtonState() {}
-
-inline SimpleProtonState::SimpleProtonState(const SimpleProtonState & x)
- : DipoleState(x) {}
-
-}
diff --git a/DIPSY/Swinger.cc b/DIPSY/Swinger.cc
--- a/DIPSY/Swinger.cc
+++ b/DIPSY/Swinger.cc
@@ -1,424 +1,424 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the Swinger class.
//
#include "Swinger.h"
#include "Dipole.h"
#include "DipoleState.h"
#include "DipoleEventHandler.h"
#include "ThePEG/Utilities/Current.h"
#include "ThePEG/Utilities/Throw.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Interface/Parameter.h"
#include "CPUTimer.h"
#ifdef ThePEG_TEMPLATES_IN_CC_FILE
// #include "Swinger.tcc"
#endif
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace DIPSY;
Swinger::~Swinger() {}
void Swinger::testGenerate(set<DipolePtr> & dips,double miny, double maxy) {
cout << "Testing Swinger....." << endl;
set<DipolePtr>::iterator it;
DipoleState testState = DipoleState();
for(it = dips.begin();it!=dips.end();it++) {
testState.addDipole(*(*it));
(*it)->dipoleState(& testState);
}
testState.sortDipoles();
thestMode = true;
ofstream youtput("SwingerTest.dat");
int ysteps = 100;
double ystepsize = 0.1;
vector<int> ybin(ysteps,0);
double y;
it=dips.begin();
for(int i=0;i<1000000;i++) {
(*it)->generatedY(maxy);
generate(*(*it),miny, maxy,true);
if((*it)->swingDipole()) {
y = (*it)->generatedY();
if(y-miny<ysteps*ystepsize)
ybin[int((y-miny)/ystepsize)]++;
}
(*it)->reset();
}
for(int i=0;i<ysteps;i++) {
youtput << (i+0.5)*ystepsize << '\t' << ybin[i] << endl;
}
youtput.close();
thestMode = false;
cout << "Done testing Swinger."
<< endl;
}
bool Swinger::forceGenerate(Dipole & dipole, double ymax) const {
const vector<tDipolePtr> & candidates =
dipole.dipoleState().swingCandidates(dipole.colour());
for (vector<tDipolePtr>::size_type i = 0; i < candidates.size(); i++ ) {
if ( candidates[i] == & dipole ) continue;
if ( candidates[i]->neighbors().first == & dipole ||
candidates[i]->neighbors().second == & dipole ) continue;
InvEnergy2 a = dipole.partons().first->dist2(*dipole.partons().second);
InvEnergy2 b = candidates[i]->partons().first->dist2(*(candidates[i]->partons().second));
InvEnergy2 c = dipole.partons().second->dist2(*candidates[i]->partons().first);
InvEnergy2 d = dipole.partons().first->dist2(*candidates[i]->partons().second);
a = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(a)/Current<DipoleEventHandler>()->rMax()) - 1.0);
b = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(b)/Current<DipoleEventHandler>()->rMax()) - 1.0);
c = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(c)/Current<DipoleEventHandler>()->rMax()) - 1.0);
d = sqr(Current<DipoleEventHandler>()->rMax())*
sqr(exp(sqrt(d)/Current<DipoleEventHandler>()->rMax()) - 1.0);
double yi = -log( UseRandom::rnd() )*c*d/(a*b);
if ( yi < dipole.generatedY() || !(dipole.swingDipole()) ) {
if( yi < ymax || ymax == 0.0 ) { //Don't do ridiculously improbable swings.
dipole.swingDipole(candidates[i]);
dipole.generatedY(yi);
}
}
}
if( (dipole.swingDipole()) ) return true;
else return false;
}
void Swinger::generateFS(Dipole & dipole, double miny, double maxy) const {
//old implementation
bool force = !dipole.hasGen();
const vector<tDipolePtr> & candidates =
dipole.dipoleState().swingCandidates(dipole.colour());
vector<tDipolePtr>::size_type i = 0;
while ( i < candidates.size() && candidates[i++] != & dipole );
if ( i == candidates.size() && candidates[i - 1] != & dipole )
Throw<SwingConsistencyException>()
<< "FSswinger not found among candidates" << Exception::abortnow;
for (; i < candidates.size(); ++i ) {
if(candidates[i]->children().first)
cout << "OH NOES, parents among the swing candidates!!!! O_o" << endl;
if ( dipole.neighbors().first == candidates[i] ||
dipole.neighbors().second == candidates[i] )
continue;
if ( !force && candidates[i]->hasGen() ) continue;
// Generate a y
double R = -log( UseRandom::rnd() );
double amp = swingAmpFS(dipole.partons(),
candidates[i]->partons(), miny/GeV2);
// double amp = swingAmpFS(dipole, *candidates[i], miny/GeV2);
double yi = Constants::MaxRapidity;
if ( miny*amp + R < Constants::MaxRapidity*amp ) yi = miny + R/amp;
if ( yi < dipole.generatedY() || !dipole.hasGen() ) {
dipole.swingDipole(candidates[i]);
dipole.generatedY(yi);
dipole.recoilSwing(false);
}
}
}
InvEnergy2 Swinger::
swingDistanceFS(const Parton & p1, const Parton & p2, InvEnergy2 time) const {
// static CPUClock cpuclock("DIPSY::Swinger::swingDinstanceFS");
// CPUTimer timer(cpuclock);
static DebugItem notime("DIPSY::NoSwingTime", 60);
if ( notime ) time = ZERO;
Energy2 E2 = p1.plus()*p2.minus() + p1.minus()*p2.plus();
Parton::Point x1 = p1.position() - p2.position() + time*p1.pT();
Parton::Point x2 = p1.position() - p2.position() - time*p2.pT();
InvEnergy2 xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
Energy2 ppScalar = p1.pT().x()*p2.pT().x() + p1.pT().y()*p2.pT().y();
InvEnergy2 a = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
if ( a <= ZERO ) return ZERO;
double asa = Current<DipoleEventHandler>()->alphaS(sqrt(a));
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
return sqr(rmax)/asa*sqr(exp(sqrt(a)/rmax) - 1.0);
}
double Swinger::
swingAmpFS(InvEnergy2 a, InvEnergy2 b, InvEnergy2 c, InvEnergy2 d) const {
static double eps = 0.0000000000001;
if ( a <= ZERO || b <= ZERO || c <= ZERO || d <= ZERO ) return eps;
if ( sqrt(a*b) < sqrt(c)*sqrt(d)*sqrt(theLambda*eps) ) return eps;
return a*b/(c*d)*theLambda;
}
double Swinger::swingAmpFS(const pair<tPartonPtr, tPartonPtr> firstDip,
const pair<tPartonPtr, tPartonPtr> secondDip,
InvEnergy2 time) const {
//parton start in their original transverse position and z = 0, then move at
//lightspeed in a direction determined by the momentum.
static double eps = 0.0000000000001;
tPartonPtr p11 = firstDip.first;
tPartonPtr p12 = firstDip.second;
tPartonPtr p21 = secondDip.first;
tPartonPtr p22 = secondDip.second;
//these squared distances a,b,c,d between partons goes as (x1+t*pt1) - (x2+t*pt2) for small t,
//and as invariant mass times t for large t
Energy2 E2 = p11->plus()*p12->minus() + p11->minus()*p12->plus();
Parton::Point x1 = p11->position() - p12->position() + time*p11->pT();
Parton::Point x2 = p11->position() - p12->position() - time*p12->pT();
InvEnergy2 xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
Energy2 ppScalar = p11->pT().x()*p12->pT().x() + p11->pT().y()*p12->pT().y();
InvEnergy2 a = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
E2 = p21->plus()*p22->minus() + p21->minus()*p22->plus();
x1 = p21->position() - p22->position() + time*p21->pT();
x2 = p21->position() - p22->position() - time*p22->pT();
xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
ppScalar = p21->pT().x()*p22->pT().x() + p21->pT().y()*p22->pT().y();
InvEnergy2 b = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
E2 = p21->plus()*p12->minus() + p21->minus()*p12->plus();
x1 = p21->position() - p12->position() + time*p21->pT();
x2 = p21->position() - p12->position() - time*p12->pT();
xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
ppScalar = p21->pT().x()*p12->pT().x() + p21->pT().y()*p12->pT().y();
InvEnergy2 c = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
E2 = p11->plus()*p22->minus() + p11->minus()*p22->plus();
x1 = p11->position() - p22->position() + time*p11->pT();
x2 = p11->position() - p22->position() - time*p22->pT();
xxScalar = x1.x()*x2.x() + x1.y()*x2.y();
ppScalar = p11->pT().x()*p22->pT().x() + p11->pT().y()*p22->pT().y();
InvEnergy2 d = sqr(time)*E2 + xxScalar - sqr(time)*ppScalar;
if ( a <= ZERO || b <= ZERO || c <= ZERO || d <= ZERO ) return eps;
//normal confinement correction
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
double asa = Current<DipoleEventHandler>()->alphaS(sqrt(a));
double asb = Current<DipoleEventHandler>()->alphaS(sqrt(b));
double asc = Current<DipoleEventHandler>()->alphaS(sqrt(c));
double asd = Current<DipoleEventHandler>()->alphaS(sqrt(d));
a = sqr(rmax)/asa*sqr(exp(sqrt(a)/rmax) - 1.0);
b = sqr(rmax)/asb*sqr(exp(sqrt(b)/rmax) - 1.0);
c = sqr(rmax)/asc*sqr(exp(sqrt(c)/rmax) - 1.0);
d = sqr(rmax)/asd*sqr(exp(sqrt(d)/rmax) - 1.0);
//normal amplitude
if ( sqrt(a*b) < sqrt(c)*sqrt(d)*sqrt(theLambda*eps) ) return eps;
return a*b/(c*d)*theLambda;
}
void Swinger::generate(Dipole & dipole, double miny, double maxy, bool force) const {
double yi = max(max(dipole.partons().first->y(),
dipole.partons().second->y()), miny);
if ( dipole.partons().second == dipole.partons().first )
Throw<ColourIndexException>()
<< "Found inconsistent colour indices in DIPSY. Event discarded."
<< Exception::eventerror;
if( dipole.children().first)
Throw<SwingConsistencyException>()
<< "OH NOES, parents among the swing candidates!!!! O_o"
<< Exception::abortnow;
const vector<tDipolePtr> & candidates =
dipole.dipoleState().swingCandidates(dipole.colour(), !force);
vector<tDipolePtr>::const_iterator it = candidates.begin();
if ( force ) while ( it != candidates.end() && *it++ != &dipole );
for (; it != candidates.end(); ++it ) {
if ( !force && (**it).hasGen() ) continue;
double yn = yi - log(UseRandom::rnd())/swingAmp(dipole, **it);
if ( yn < dipole.generatedY() ) {
dipole.swingDipole(*it);
dipole.generatedY(yn);
dipole.recoilSwing(false);
}
}
}
double Swinger::swingAmp(const Dipole & firstDip,
const Dipole & secondDip) const {
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
InvEnergy2 a = firstDip.swingCache;
if ( a < ZERO ) {
a = firstDip.partons().first->dist2(*firstDip.partons().second);
a = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(a)))*
sqr(exp(sqrt(a)/rmax) - 1.0);
firstDip.swingCache = a;
}
InvEnergy2 b = secondDip.swingCache;
if ( b < ZERO ) {
b = secondDip.partons().first->dist2(*(secondDip.partons().second));
b = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(b)))*
sqr(exp(sqrt(b)/rmax) - 1.0);
secondDip.swingCache = b;
}
InvEnergy2 c = firstDip.partons().second->dist2(*secondDip.partons().first);
c = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(c)))*
sqr(exp(sqrt(c)/rmax) - 1.0);
InvEnergy2 d = firstDip.partons().first->dist2(*secondDip.partons().second);
d = sqr(rmax)/(Current<DipoleEventHandler>()->alphaS(sqrt(d)))*
sqr(exp(sqrt(d)/rmax) - 1.0);
return a*b/(c*d)*theLambda;
}
double Swinger::swingAmp(const pair<tPartonPtr, tPartonPtr> firstDip,
const pair<tPartonPtr, tPartonPtr> secondDip) const {
InvEnergy rmax = Current<DipoleEventHandler>()->rMax();
InvEnergy2 a = firstDip.first->dist2(*firstDip.second);
InvEnergy2 b = secondDip.first->dist2(*(secondDip.second));
InvEnergy2 c = firstDip.second->dist2(*secondDip.first);
InvEnergy2 d = firstDip.first->dist2(*secondDip.second);
a = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(a)))*
sqr(exp(sqrt(a)/rmax) - 1.0);
b = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(b)))*
sqr(exp(sqrt(b)/rmax) - 1.0);
c = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(c)))*
sqr(exp(sqrt(c)/rmax) - 1.0);
d = sqr(rmax)/
(Current<DipoleEventHandler>()->alphaS(sqrt(d)))*
sqr(exp(sqrt(d)/rmax) - 1.0);
return a*b/(c*d)*theLambda;
}
bool Swinger::checkMaxY(DipolePtr d1, DipolePtr d2, double maxy) const {
tPartonPtr p1 = d1->partons().first;
tPartonPtr p2 = d1->partons().second;
tPartonPtr p3 = d2->partons().first;
tPartonPtr p4 = d2->partons().second;
TransverseMomentum rec12 = (p1->position() - p2->position())/
(p1->position() - p2->position()).pt2();
TransverseMomentum rec34 = (p3->position() - p4->position())/
(p3->position() - p4->position()).pt2();
TransverseMomentum rec14 = (p1->position() - p4->position())/
(p1->position() - p4->position()).pt2();
TransverseMomentum rec32 = (p3->position() - p2->position())/
(p3->position() - p2->position()).pt2();
if ( log( (p1->pT() - rec12 + rec14).pt()/p1->plus()) > maxy )
return false;
if ( log( (p2->pT() + rec12 - rec32).pt()/p2->plus()) > maxy )
return false;
if ( log( (p3->pT() - rec34 + rec32).pt()/p3->plus()) > maxy )
return false;
if ( log( (p4->pT() + rec34 - rec14).pt()/p4->plus()) > maxy )
return false;
return true;
}
void Swinger::recombineFS(Dipole & d1) const {
Dipole & d2 = *d1.swingDipole();
pair<tPartonPtr, tPartonPtr> d1p = d1.partons();
pair<tPartonPtr, tPartonPtr> d2p = d2.partons();
pair<tDipolePtr, tDipolePtr> d1n = d1.neighbors();
pair<tDipolePtr, tDipolePtr> d2n = d2.neighbors();
d1.partons(make_pair(d1p.first, d2p.second));
d1.neighbors(make_pair(d1n.first, d2n.second));
if ( d1n.first ) d1n.first->secondNeighbor(&d1);
if ( d2n.second ) d2n.second->firstNeighbor(&d1);
d2.partons(make_pair(d2p.first, d1p.second));
d2.neighbors(make_pair(d2n.first, d1n.second));
if ( d2n.first ) d2n.first->secondNeighbor(&d2);
if ( d1n.second ) d1n.second->firstNeighbor(&d2);
d1.partons().first->dipoles(make_pair(d1.neighbors().first, &d1));
d1.partons().second->dipoles(make_pair(&d1, d1.neighbors().second));
d2.partons().first->dipoles(make_pair(d2.neighbors().first, &d2));
d2.partons().second->dipoles(make_pair(&d2, d2.neighbors().second));
d1.reset();
d2.reset();
d1.touch();
d2.touch();
}
void Swinger::recombine(Dipole & d1) const {
DipoleState & state = d1.dipoleState();
Dipole & d2 = *d1.swingDipole();
if(d2.children().second) {
Throw<SwingConsistencyException>()
<< "swinging with someone thats emitted already (second child). "
<< "(partons at " << d1.partons().first->y() << ", "
<< d1.partons().second->y() << "; " << d2.partons().first->y()
<< ", " << d2.partons().second->y() << ")" << Exception::eventerror;
state.diagnosis(true);
}
else if(d2.children().first) {
Throw<SwingConsistencyException>()
<< "swinging with someone thats emitted already (first child). "
<< "(partons at " << d1.partons().first->y() << ", "
<< d1.partons().second->y() << "; " << d2.partons().first->y()
<< ", " << d2.partons().second->y() << ")" << Exception::eventerror;
state.diagnosis(true);
}
DipolePtr d11 = d1.children().first = state.createDipole();
DipolePtr d22 = d2.children().first = state.createDipole();
d11->partons(make_pair(d1.partons().first, d2.partons().second));
d11->neighbors(make_pair(d1.neighbors().first, d2.neighbors().second));
if ( d1.neighbors().first ) d1.neighbors().first->secondNeighbor(d11);
if ( d2.neighbors().second ) d2.neighbors().second->firstNeighbor(d11);
d22->partons(make_pair(d2.partons().first, d1.partons().second));
d22->neighbors(make_pair(d2.neighbors().first, d1.neighbors().second));
if ( d2.neighbors().first ) d2.neighbors().first->secondNeighbor(d22);
if ( d1.neighbors().second ) d1.neighbors().second->firstNeighbor(d22);
d11->colour(d1.colour());
d22->colour(d2.colour());
d11->partons().first->dipoles(make_pair(d11->neighbors().first,d11));
d11->partons().second->dipoles(make_pair(d11,d11->neighbors().second));
d22->partons().first->dipoles(make_pair(d22->neighbors().first,d22));
d22->partons().second->dipoles(make_pair(d22,d22->neighbors().second));
if (d1.DGLAPsafe() || d2.DGLAPsafe() ) {
d11->DGLAPsafe(true);
d22->DGLAPsafe(true);
}
- if ( d1.interacted() ) d11->interact(*d1.interacted());
- if ( d2.interacted() ) d22->interact(*d2.interacted());
+ if ( d1.interacted() ) d11->interacted(d1.interacted());
+ if ( d2.interacted() ) d22->interacted(d2.interacted());
d1.reset();
d2.reset(); //are these really needed?
}
void Swinger::persistentOutput(PersistentOStream & os) const {
os << ounit(theLambda, 1.0);
}
void Swinger::persistentInput(PersistentIStream & is, int) {
is >> iunit(theLambda, 1.0);
}
// Static variable needed for the type description system in ThePEG.
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<Swinger,HandlerBase>
describeDIPSYSwinger("DIPSY::Swinger", "libAriadne5.so libDIPSY.so");
void Swinger::Init() {
static ClassDocumentation<Swinger> documentation
("There is no documentation for the Swinger class");
static Parameter<Swinger,double> interfaceLambda
("Lambda",
"The frequency of the swings.",
&Swinger::theLambda, 1.0, 1.0, 0.0, 0.0,
true, false, Interface::lowerlim);
}
diff --git a/DIPSY/Swinger.h b/DIPSY/Swinger.h
--- a/DIPSY/Swinger.h
+++ b/DIPSY/Swinger.h
@@ -1,230 +1,233 @@
// -*- C++ -*-
#ifndef DIPSY_Swinger_H
#define DIPSY_Swinger_H
//
// This is the declaration of the Swinger class.
//
#include "ThePEG/Handlers/HandlerBase.h"
#include "Parton.h"
#include "Swinger.fh"
#include "Dipole.fh"
namespace DIPSY {
using namespace ThePEG;
/**
* The Swinger class is responsible for generating and performing a
* swing for a dipole. This base class does the standard thing. Any
* non-standard thing must be implemented in a sub-class overriding
* the generateRec() and/or recombine() functions.
*
* @see \ref SwingerInterfaces "The interfaces"
* defined for Swinger.
*/
class Swinger: public HandlerBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline Swinger();
+ inline Swinger(): theLambda(1.0) {}
/**
* The copy constructor.
*/
- inline Swinger(const Swinger &);
+ inline Swinger(const Swinger & x)
+ : HandlerBase(x), theLambda(x.theLambda) {}
/**
* The destructor.
*/
virtual ~Swinger();
//@}
public:
/** @name Virtual functions which may be overridden by sub-classes. */
//@{
/**
* Generate a swing for FS colour reconnection.
*/
virtual void generateFS(Dipole & dipole, double miny, double maxy) const;
/**
* The FS amplitude for swinging, taking time and rapidity distance into account
*/
virtual double swingAmpFS(const pair<tPartonPtr, tPartonPtr>,
const pair<tPartonPtr, tPartonPtr>,
InvEnergy2 time) const;
/**
* Calculate the distance between partons entering in the FS swing.
*/
virtual InvEnergy2
swingDistanceFS(const Parton & p1, const Parton & p2, InvEnergy2 time) const;
/**
* The FS amplitude for swinging, taking distances calculated by
* swingDistanceFS().
*/
virtual double
swingAmpFS(InvEnergy2 a, InvEnergy2 b, InvEnergy2 c, InvEnergy2 d) const;
/**
* Generate a swing for the given \a dipole in the given rapidity
* interval [\a miny,\a maxy]. If \a force is true, always generate
* a swing, otherwise only check if a swing is possible with dipoles
* which are new or has changed.
*/
virtual void generate(Dipole & dipole,
double miny, double maxy, bool force) const;
/**
* Try really hard to generate a swing. But if larger rapidity gap
* than /a ymax, then don't bother. /a ymax = 0 means no limit.
*/
virtual bool forceGenerate(Dipole & d, double ymax) const;
/**
* Perform a recombination previously generated by generateRec().
*/
virtual void recombine(Dipole & dipole) const;
/**
* Perform a recombination previously generated by swingFS. Does not
* produce new dipoles, just recombines the current ones.
*/
virtual void recombineFS(Dipole & dipole) const;
/**
* The probability per rapidity for a swing to happen between the two dipoles.
*/
virtual double swingAmp(const Dipole & d1, const Dipole & d2) const;
/**
* The probability per rapidity for a swing to happen between the two dipoles.
*/
virtual double swingAmp(const pair<tPartonPtr, tPartonPtr>,
const pair<tPartonPtr, tPartonPtr>) const;
/**
* Tests the distribution in generated y - miny for a swing between two dipoles.
*/
virtual void testGenerate(set<DipolePtr> & dips,double miny, double maxy);
//inline functions
/**
* get lambda.
*/
inline double lambda() const {
return theLambda;
}
/**
* set lambda.
*/
inline void lambda(double x) {
theLambda = x;
}
//@}
protected:
/**
* Checks that a swing doesnt push any parton above maxy, using the pT
* definition that depends on the two colour neighbours.
* Internal function.
*/
virtual bool checkMaxY(DipolePtr dip, DipolePtr swingDip, double maxY ) const;
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.
*/
- inline virtual IBPtr clone() const;
+ inline virtual IBPtr clone() const {
+ return new_ptr(*this);
+ }
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
- inline virtual IBPtr fullclone() const;
+ inline virtual IBPtr fullclone() const {
+ return new_ptr(*this);
+ }
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
protected:
/**
* If testing mode is active. /CF
*/
bool thestMode;
/**
* Exception indicating inconsistent colour lines.
*/
struct ColourIndexException: public Exception {};
/**
* Exception swinging decayed dipole.
*/
struct SwingConsistencyException: public Exception {};
private:
/**
* Controls how fast the swings are. default is 1.
*/
double theLambda;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Swinger & operator=(const Swinger &);
};
}
-#include "Swinger.icc"
-
#endif /* DIPSY_Swinger_H */
diff --git a/DIPSY/Swinger.icc b/DIPSY/Swinger.icc
deleted file mode 100644
--- a/DIPSY/Swinger.icc
+++ /dev/null
@@ -1,27 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the Swinger class.
-//
-
-namespace DIPSY {
-
- inline Swinger::Swinger(): theLambda(1.0) {}
-
-inline Swinger::Swinger(const Swinger & x)
- : HandlerBase(x), theLambda(x.theLambda) {}
-
-inline IBPtr Swinger::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr Swinger::fullclone() const {
- return new_ptr(*this);
-}
-
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/DIPSY/VectorMesonBase.h b/DIPSY/VectorMesonBase.h
--- a/DIPSY/VectorMesonBase.h
+++ b/DIPSY/VectorMesonBase.h
@@ -1,158 +1,164 @@
// -*- C++ -*-
#ifndef DIPSY_VectorMesonBase_H
#define DIPSY_VectorMesonBase_H
//
// This is the declaration of the VectorMesonBase class.
//
#include "Ariadne/DIPSY/WaveFunction.h"
namespace DIPSY {
using namespace ThePEG;
/**
* The VectorMesonBase class inherits from WaveFunction and is the
* base class of all vector meson wave functions. It includes abstract
* functions for different polarization and helicity components.
*
* @see \ref VectorMesonBaseInterfaces "The interfaces"
* defined for VectorMesonBase.
*/
class VectorMesonBase: public WaveFunction {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline VectorMesonBase();
+ inline VectorMesonBase()
+ : theMaxFlav(4), qmass(7, -1.0*GeV) {}
/**
* The copy constructor.
*/
- inline VectorMesonBase(const VectorMesonBase &);
+ inline VectorMesonBase(const VectorMesonBase & x)
+ : WaveFunction(x), theMaxFlav(x.theMaxFlav), qmass(x.qmass) {}
/**
* The destructor.
*/
virtual ~VectorMesonBase();
//@}
public:
/** @name Abstract functions for different wave function components. */
//@{
/**
* Return (the absolute value of) the wave function for the given
* polarization \a pol, quark and antiquark helicities, \a h and \a
* hbar, quark flavour \a flav, energy fraction \a z and transverse
* size \a r.
*/
virtual Energy psi(int pol, int h, int hbar, int flav,
InvEnergy r, double z) = 0;
/**
* Return the square of the wavefunction summed over flavours and
* helicities.
*/
virtual Energy2 psi2(InvEnergy r, double z);
//@}
public:
/** @name Simple access functions. */
//@{
/**
* Get the maxumim number of flavours considered. If negative only
* the corresponding flavour will be considered.
*/
- inline int maxFlav() const;
+ inline int maxFlav() const {
+ return theMaxFlav;
+ }
//@}
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();
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
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() throw(InitException);
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
- inline virtual void doinitrun();
+ inline virtual void doinitrun() {
+ WaveFunction::doinitrun();
+ }
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
- inline virtual void dofinish();
+ inline virtual void dofinish() {
+ WaveFunction::dofinish();
+ }
//@}
private:
/**
* The maxumim number of flavours considered. If negative only the
* corresponding flavour will be considered.
*/
int theMaxFlav;
protected:
/**
* The quark masses to be used (zero'th component is always ignored).
*/
vector<Energy> qmass;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
VectorMesonBase & operator=(const VectorMesonBase &);
};
}
-#include "VectorMesonBase.icc"
-
#endif /* DIPSY_VectorMesonBase_H */
diff --git a/DIPSY/VectorMesonBase.icc b/DIPSY/VectorMesonBase.icc
deleted file mode 100644
--- a/DIPSY/VectorMesonBase.icc
+++ /dev/null
@@ -1,27 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the VectorMesonBase class.
-//
-
-namespace DIPSY {
-
-inline VectorMesonBase::VectorMesonBase()
- : theMaxFlav(4), qmass(7, -1.0*GeV) {}
-
-inline VectorMesonBase::VectorMesonBase(const VectorMesonBase & x)
- : WaveFunction(x), theMaxFlav(x.theMaxFlav), qmass(x.qmass) {}
-
-inline void VectorMesonBase::dofinish() {
- WaveFunction::dofinish();
-}
-
-inline void VectorMesonBase::doinitrun() {
- WaveFunction::doinitrun();
-}
-
-inline int VectorMesonBase::maxFlav() const {
- return theMaxFlav;
-}
-
-}
diff --git a/DIPSY/VirtualPhoton.h b/DIPSY/VirtualPhoton.h
--- a/DIPSY/VirtualPhoton.h
+++ b/DIPSY/VirtualPhoton.h
@@ -1,269 +1,283 @@
// -*- C++ -*-
#ifndef DIPSY_VirtualPhoton_H
#define DIPSY_VirtualPhoton_H
//
// This is the declaration of the VirtualPhoton class.
//
#include "Ariadne/DIPSY/VectorMesonBase.h"
namespace DIPSY {
using namespace ThePEG;
/**
* The VirtualPhoton class represents the perturbative
* quark--anti-quark dipole wave function of a virtual photon with a
* given virtuality.
*
* @see \ref VirtualPhotonInterfaces "The interfaces"
* defined for VirtualPhoton.
*/
class VirtualPhoton: public VectorMesonBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline VirtualPhoton();
+ inline VirtualPhoton()
+ : theQ2(0.0*GeV2), theShrinkR(0.0*InvGeV),thePolarisation(0),
+ theVMDLightA(0.0), theVMDLightR(0.0*InvGeV),
+ theVMDLightW(0.0*InvGeV), theVMDCharmA(0.0), theVMDCharmR(0.0*InvGeV),
+ theVMDCharmW(0.0*InvGeV), rMax(ZERO), r2Psi2Int(ZERO), r2Psi2Max(ZERO) {}
/**
* The copy constructor.
*/
- inline VirtualPhoton(const VirtualPhoton &);
+ inline VirtualPhoton(const VirtualPhoton & x)
+ : VectorMesonBase(x), theQ2(x.theQ2), theShrinkR(x.theShrinkR),
+ thePolarisation(x.thePolarisation), theVMDLightA(x.theVMDLightA),
+ theVMDLightR(x.theVMDLightR), theVMDLightW(x.theVMDLightW),
+ theVMDCharmA(x.theVMDCharmA), theVMDCharmR(x.theVMDCharmR),
+ theVMDCharmW(x.theVMDCharmW), rMax(x.rMax),
+ r2Psi2Int(x.r2Psi2Int), r2Psi2Max(x.r2Psi2Max) {}
/**
* The destructor.
*/
virtual ~VirtualPhoton();
//@}
public:
/** @name Main virtual functions to be overridden in sub-classes. */
//@{
/**
* Initialize the wavefunction for the given DipoleEventHandler.
*/
virtual void initialize(const DipoleEventHandler &);
/**
* Generate a dipole state according to this wavefunction, given an
* event handler and a positive light-cone momentum component.
*/
virtual DipoleStatePtr generate(const DipoleEventHandler & eh, Energy plus);
/**
* Generate a dipole state according to this wavefunction, given an
* event handler and a positive light-cone momentum component.
*/
virtual DipoleStatePtr generate2(const DipoleEventHandler & eh, Energy plus);
/**
* Return (the absolute value of) the wave function for the given
* polarization \a pol, quark and antiquark helicities, \a h and \a
* hbar, quark flavour \a flav, energy fraction \a z and transverse
* size \a r.
*/
virtual Energy psi(int pol, int h, int hbar, int flav,
InvEnergy r, double z);
/**
* The purely perturbative version of the wavefunction.
*/
virtual Energy pertPsi(int pol, int h, int hbar, int flav,
InvEnergy r, double z);
/**
* r*2*pi*(sum_i Psi_i^2(r,z)) with sum i over helicities. this describes
* the weight to get a dipole with certain r and z.
**/
virtual Energy sumPsi2(InvEnergy r, double z);
/**
* returns the correction on the wavefunction due to vector meson resonance
* at a given dipole size for a given quark flavour.
**/
virtual double VMDCorr(InvEnergy r, int flav);
/**
* Return the invariant mass squared of the particle.
*/
virtual Energy2 m2() const;
//@}
/**
* The virtuality of the photon.
*/
- inline Energy2 Q2() const;
+ inline Energy2 Q2() const {
+ return theQ2;
+ }
/**
* The confinement range.
*/
inline InvEnergy shrinkR() const {
return theShrinkR;
};
/**
* The amplitude of the vector meson resonance for light quarks.
*/
inline double VMDLightA() const {
return theVMDLightA;
};
/**
* A flag showing which polarisation the photon has.
*/
inline int polarisation() const {
return thePolarisation;
};
/**
* The typical dipole size of the vector meson resonance for light quarks.
*/
inline InvEnergy VMDLightR() const {
return theVMDLightR;
};
/**
* The width in dipole size of the vector meson resonance for light quarks.
*/
inline InvEnergy VMDLightW() const {
return theVMDLightW;
};
/**
* The amplitude of the vector meson resonance for charm quarks.
*/
inline double VMDCharmA() const {
return theVMDCharmA;
};
/**
* The typical dipole size of the vector meson resonance for charm quarks.
*/
inline InvEnergy VMDCharmR() const {
return theVMDCharmR;
};
/**
* The width in dipole size of the vector meson resonance for charm quarks.
*/
inline InvEnergy VMDCharmW() const {
return theVMDCharmW;
};
/**
* Set the corresponding particle. Check that it is actually a
* photon.
*/
virtual void setParticle(PDPtr);
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.
*/
- inline virtual IBPtr clone() const;
+ inline virtual IBPtr clone() const {
+ return new_ptr(*this);
+ }
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
- inline virtual IBPtr fullclone() const;
+ inline virtual IBPtr fullclone() const {
+ return new_ptr(*this);
+ }
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
private:
/**
* The virtuality of the photon.
*/
Energy2 theQ2;
/**
* Parameter for the confinement range
*/
InvEnergy theShrinkR;
/**
* 0: both T and L, 1: Transverse only, 2: Longitudinal only
*/
int thePolarisation;
/**
* Parameter for the vector meson resonance for light and charm quarks.
*/
double theVMDLightA;
InvEnergy theVMDLightR;
InvEnergy theVMDLightW;
double theVMDCharmA;
InvEnergy theVMDCharmR;
InvEnergy theVMDCharmW;
/**
* The maximum dipole size that will be considered.
*/
InvEnergy rMax;
/**
* The integral of r^2 times the sum of the square of all wavefunctions, up to rMax.
**/
InvEnergy2 r2Psi2Int;
/**
* The max of r^2 times the sum of the square of all the wavefunctions, up to rMax.
**/
InvEnergy r2Psi2Max;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
VirtualPhoton & operator=(const VirtualPhoton &);
};
}
-#include "VirtualPhoton.icc"
-
#endif /* DIPSY_VirtualPhoton_H */
diff --git a/DIPSY/VirtualPhoton.icc b/DIPSY/VirtualPhoton.icc
deleted file mode 100644
--- a/DIPSY/VirtualPhoton.icc
+++ /dev/null
@@ -1,38 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the VirtualPhoton class.
-//
-
-namespace DIPSY {
-
-inline VirtualPhoton::VirtualPhoton()
- : theQ2(0.0*GeV2), theShrinkR(0.0*InvGeV),thePolarisation(0),
- theVMDLightA(0.0), theVMDLightR(0.0*InvGeV),
- theVMDLightW(0.0*InvGeV), theVMDCharmA(0.0), theVMDCharmR(0.0*InvGeV),
- theVMDCharmW(0.0*InvGeV), rMax(ZERO), r2Psi2Int(ZERO), r2Psi2Max(ZERO) {}
-
-inline VirtualPhoton::VirtualPhoton(const VirtualPhoton & x)
- : VectorMesonBase(x), theQ2(x.theQ2), theShrinkR(x.theShrinkR),
- thePolarisation(x.thePolarisation), theVMDLightA(x.theVMDLightA),
- theVMDLightR(x.theVMDLightR), theVMDLightW(x.theVMDLightW), theVMDCharmA(x.theVMDCharmA),
- theVMDCharmR(x.theVMDCharmR), theVMDCharmW(x.theVMDCharmW), rMax(x.rMax),
- r2Psi2Int(x.r2Psi2Int), r2Psi2Max(x.r2Psi2Max) {}
-
-inline IBPtr VirtualPhoton::clone() const {
- return new_ptr(*this);
-}
-
-inline IBPtr VirtualPhoton::fullclone() const {
- return new_ptr(*this);
-}
-
-inline Energy2 VirtualPhoton::Q2() const {
- return theQ2;
-}
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/DIPSY/WFInfo.icc b/DIPSY/WFInfo.icc
deleted file mode 100644
--- a/DIPSY/WFInfo.icc
+++ /dev/null
@@ -1,23 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the WFInfo class.
-//
-
-namespace DIPSY {
-
-inline WFInfo::WFInfo(tcWaveFunctionPtr wfin, InvEnergy rini)
- : theWF(wfin), theR(rini) {}
-
-inline WFInfo::WFInfo(const WFInfo & x)
- : Base(x), theWF(x.theWF), theR(x.theR) {}
-
-inline const WaveFunction & WFInfo::wf() const {
- return *theWF;
-}
-
-inline InvEnergy WFInfo::r() const {
- return theR;
-}
-
-}
diff --git a/DIPSY/WaveFunction.h b/DIPSY/WaveFunction.h
--- a/DIPSY/WaveFunction.h
+++ b/DIPSY/WaveFunction.h
@@ -1,149 +1,154 @@
// -*- C++ -*-
#ifndef DIPSY_WaveFunction_H
#define DIPSY_WaveFunction_H
//
// This is the declaration of the WaveFunction class.
//
#include "ThePEG/Handlers/HandlerBase.h"
#include "ThePEG/PDT/ParticleData.h"
#include "WaveFunction.fh"
#include "DipoleState.h"
#include "DipoleEventHandler.fh"
namespace DIPSY {
using namespace ThePEG;
/**
* WaveFunction is the base class for wavefunction objects capable of
* generating initial DipoleState objects.
*
* @see \ref WaveFunctionInterfaces "The interfaces"
* defined for WaveFunction.
*/
class WaveFunction: public HandlerBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
- inline WaveFunction();
+ inline WaveFunction()
+ : theEventHandler(tcDipoleEventHandlerPtr()), theParticle(PDPtr()) {}
/**
* The copy constructor.
*/
- inline WaveFunction(const WaveFunction &);
+ inline WaveFunction(const WaveFunction & x)
+ : HandlerBase(x), theEventHandler(x.theEventHandler),
+ theParticle(x.theParticle) {}
/**
* The destructor.
*/
virtual ~WaveFunction();
//@}
public:
/** @name Main virtual functions to be overridden in sub-classes. */
//@{
/**
* Initialize the wavefunction for the given DipoleEventHandler.
*/
virtual void initialize(const DipoleEventHandler &);
/**
* Generate a dipole state according to this wavefunction, given an
* event handler and a positive light-cone momentum component.
*/
virtual DipoleStatePtr
generate(const DipoleEventHandler & eh, Energy plus) = 0;
/**
* Fix up valens partons if they were not of the correct flavour or
* if they should collapse into a hadron.
*/
virtual void fixValence(Step & step, tPPtr particle, const vector<PPtr> & valence) const;
/**
* Return the invariant mass squared of the particle.
*/
virtual Energy2 m2() const = 0;
//@}
/**
* The DipoleEventHandler in charge of the generation.
*/
- inline tcDipoleEventHandlerPtr eventHandler() const;
+ inline tcDipoleEventHandlerPtr eventHandler() const {
+ return theEventHandler;
+ }
/**
* Get the corresponding particle.
*/
- inline tcPDPtr particle() const;
+ inline tcPDPtr particle() const {
+ return theParticle;
+ }
/**
* Set the corresponding particle. May be overridden by sub classes
* to check the particle is relevant for the particular wave
* function.
*/
virtual void setParticle(PDPtr);
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();
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
private:
/**
* The DipoleEventHandler in charge of the generation.
*/
tcDipoleEventHandlerPtr theEventHandler;
/**
* The corresponding particle.
*/
PDPtr theParticle;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
WaveFunction & operator=(const WaveFunction &);
};
}
-#include "WaveFunction.icc"
-
#endif /* DIPSY_WaveFunction_H */
diff --git a/DIPSY/WaveFunction.icc b/DIPSY/WaveFunction.icc
deleted file mode 100644
--- a/DIPSY/WaveFunction.icc
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- C++ -*-
-//
-// This is the implementation of the inlined member functions of
-// the WaveFunction class.
-//
-
-namespace DIPSY {
-
-inline WaveFunction::WaveFunction()
- : theEventHandler(tcDipoleEventHandlerPtr()), theParticle(PDPtr()) {}
-
-inline WaveFunction::WaveFunction(const WaveFunction & x)
- : HandlerBase(x), theEventHandler(x.theEventHandler),
- theParticle(x.theParticle) {}
-
-inline tcDipoleEventHandlerPtr WaveFunction::eventHandler() const {
- return theEventHandler;
-}
-
-inline tcPDPtr WaveFunction::particle() const {
- return theParticle;
-}
-
-// If needed, insert default implementations of virtual function defined
-// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-
-
-}
diff --git a/include/Makefile.am b/include/Makefile.am
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,42 +1,42 @@
BUILT_SOURCES = done-all-links
AUTOMAKE_OPTIONS = -Wno-portability
DIRLINKS = $(top_srcdir)/DipoleCascade $(top_srcdir)/Cascade $(top_srcdir)/DIPSY
CONFIGHEADERS = $(top_srcdir)/Config/Ariadne.h \
$(top_srcdir)/Config/Ariadne5.h \
$(top_srcdir)/Config/CloneBase.fh \
$(top_srcdir)/Config/CloneBase.h \
$(top_srcdir)/Config/CloneBase.icc \
$(top_srcdir)/Config/UnitFO.h
CLEANFILES = done-all-links
done-all-links: $(CONFIGHEADERS) $(DIRLINKS)
@EMPTY@ifdef SHOWCOMMAND
mkdir -p Ariadne/Config
$(LN_S) -f $(addprefix ../, $(DIRLINKS)) Ariadne
$(LN_S) -f $(addprefix ../../, $(CONFIGHEADERS)) Ariadne/Config
$(LN_S) -f ../../../Config/config.h Ariadne/Config
touch done-all-links
@EMPTY@else
@echo "sym-linking header files..."
@mkdir -p Ariadne/Config
@$(LN_S) -f $(addprefix ../, $(DIRLINKS)) Ariadne
@$(LN_S) -f $(addprefix ../../, $(CONFIGHEADERS)) Ariadne/Config
@$(LN_S) -f ../../../Config/config.h Ariadne/Config
@touch done-all-links
@EMPTY@endif
install-data-local:
- find Ariadne -follow \( -name '*.h' -or -name '*.icc' \
+ find Ariadne -maxdepth 2 -follow \( -name '*.h' -or -name '*.icc' \
-or -name '*.tcc' -or -name '*.fh' -or -name '*.xh' \) \
-exec $(install_sh_DATA) \{\} $(DESTDIR)$(includedir)/\{\} \;
uninstall-local:
rm -rf $(DESTDIR)$(includedir)/Ariadne
if test -x $(DESTDIR)$(bindir)/setupThePEG; then $(DESTDIR)$(bindir)/setupThePEG -init -r $(DESTDIR)$(pkglibdir)/ThePEGDefaults.rpo -o $(DESTDIR)$(pkglibdir)/ThePEGDefaults.rpo $(top_srcdir)/src/AriadneRemove.in; fi
clean-local:
rm -rf Ariadne

File Metadata

Mime Type
text/x-diff
Expires
Sat, May 3, 6:15 AM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4982959
Default Alt Text
(476 KB)

Event Timeline