Beam Shape
The Beam Parameters
page explains how you can set a momentum spread of the two incoming
beams, and a spread and offset for the location of the interaction
vertex. The spread is based on a simple parametrization in terms of
independent Gaussians, however, which is likely to be too primitive
for realistic applications.
It is therefore possible to define your own class, derived from the
BeamShape
base class, and hand it in to Pythia with the
pythia.setBeamShapePtr( BeamShape*)
method.
Below we describe what such a class has to do. An explicit toy example
is shown in main27.cc
.
The BeamShape
base class has a very simple structure.
It only has two virtual methods. The first, init()
, is
used for initialization. The second, pick()
, selects
beam momentum and production vertex in the current event.
The base-class init()
method simply reads in the values
stored in the Settings
data base. You are free to
write your own derived initialization routine, or use the existing one.
In the latter case you can then give your own modified interpretation
to the beam spread parameters defined there.
The two flags Beams:allowMomentumSpread
and
Beams:allowVertexSpread
should not be tampered with,
however. These are checked elsewhere to determine whether the beam
shape should be set or not, whereas the other momentum-spread
and vertex-spread parameters are local to this class.
The pick()
method is the key one to supply in the derived
class. Here you are free to pick whatever parametrization you desire
for beam momenta and vertex position, including correlations between
the two. At the end of the day, you should set
deltaPxA, deltaPyA, deltaPzA
for the three-momentum
deviation of the first incoming beam, relative to the nominal values;
deltaPxB, deltaPyB, deltaPzB
for the three-momentum
deviation of the second incoming beam, relative to the nominal values;
vertexX, vertexY, vertexZ, vertexT
for the
production-vertex position and time.
These values will then be read out with the three base-class methods
deltaPA()
, deltaPB()
and vertex()
.