Skip to content

Commit

Permalink
Merge pull request #8 from alisw/rdev-leif-patch
Browse files Browse the repository at this point in the history
Patch from Leif to fix Angantyr when Beams:allowVertexSpread
  • Loading branch information
preghenella authored Apr 6, 2021
2 parents 1984832 + cbc800e commit 3abbf0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/Pythia8/Pythia.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ class Pythia {
// collisions.
HeavyIonsPtr getHeavyIonsPtr() { return heavyIonsPtr;}

// Possibility to access the pointer to the BeamShape object.
BeamShapePtr getBeamShapePtr() { return beamShapePtr; }

// Possibility to get the pointer to the parton-shower model.
ShowerModelPtr getShowerModelPtr() { return showerModelPtr; }

Expand Down
8 changes: 8 additions & 0 deletions src/HeavyIons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// heavy ion classes classes, and some related global functions.

#include "Pythia8/HeavyIons.h"
#include "Pythia8/BeamShape.h"
#include "Pythia8/Pythia.h"
#include <cassert>

Expand Down Expand Up @@ -408,6 +409,7 @@ bool Angantyr::init() {
for ( int i = MBIAS; i < ALL; ++i ) {
pythia[i] = new Pythia(*settingsPtr, *particleDataPtr, false);
pythia[i]->settings.mode("HeavyIon:mode", 1);
pythia[i]->settings.flag("Beams:allowVertexSpread", false);
}

sigtot.init();
Expand Down Expand Up @@ -1649,6 +1651,12 @@ bool Angantyr::next() {
}
}

if ( settingsPtr->flag("Beams:allowVertexSpread") ) {
pythia[HADRON]->getBeamShapePtr()->pick();
Vec4 vertex = pythia[HADRON]->getBeamShapePtr()->vertex();
for ( Particle & p : pythia[HADRON]->event ) p.vProdAdd( vertex);
}

hiInfo.accept();

updateInfo();
Expand Down

0 comments on commit 3abbf0e

Please sign in to comment.