State

A container for the state of Monte Carlo particles.

Attributes

Name Type Description
charge number Electric charge, i.e. 1 or -1.
energy number Kinetic energy, in GeV.
position double [3] Cartesian coordinates of the position in the simulation frame, in m.
direction double [3] Cartesian coordinates of the momentum direction in the simulation frame.
distance number Travelled distance, in m.
grammage number Travelled grammage distance, in kg/m2.
time number Spent proper time, in m/c.
weight number Monte Carlo weight.
decayed boolean Flag indicating if the particle has decayed (true) or not (false).

Constructor

The Monte Carlo State constructors has three forms as indicated in the synopsis below. The first form takes no argument and returns an blank state with all atributes equal to zero. The second form is a copy constructor for another State. The third form allows to specify attribute values and provide defaults if not specified.

Synopsis

pumas.State()

pumas.State(state)

pumas.State{(charge)=, (energy)=, (position)=, (direction)=, (distance)=,
    (grammage)=, (time)=, (weight)=, (decayed)=}

Arguments

Name Type Description
state State Another State instance to copy.
(charge) number Electric charge, i.e. 1 or -1. Defaults to -1.
(energy) number Initial kinetic energy, in GeV. Defaults to 1 GeV.
(position) Coordinates Initial position, in m. Defaults to the origin of the simulation frame.
(direction) Coordinates Initial momentum direction. Defaults to the vertical of the simulation frame.
(distance) number Initial travelled distance, in m. Defaults to 0 m.
(grammage) number Initial ravelled grammage, in kg/m2. Defaults to 0 kg/m2.
(time) number Initial proper time, in m/c. Defaults to 0 m/c.
(weight) number Initial Monte Carlo weight. Defaults to 0.
(decayed) boolean Flag indicating if the particle has decayed (true) or not (false).

Warning

Default argument values are only set when using the third form of the constructor, i.e. when providing a table argument. When no argument is provided a blank state is returned with all attributes equal to zero.

See also

Context, Event, Mode, Recorder.

State.clear

Clear the Monte Carlo state reseting all its attributes to zero.


Synopsis

State:clear()

Arguments

None, except self.

Returns

Type Description
State Reference to the updated Monte Carlo state.

See also

clone, set.

State.clone

Get a copy (clone) of the State instance.


Synopsis

State:clone()

Arguments

None, except self.

Returns

Type Description
State Copy of the Monte Carlo state.

See also

clear, set.

State.set

Set the Monte Carlo state from another State instance.


Synopsis

State:set(state)

Arguments

Name Type Description
state State Monte Carlo state to copy.

Returns

Type Description
State Reference to the updated Monte Carlo state.

See also

clear, clone.