44// This class represents the PrimaryGeneratorAction that is used during the entire adjoint simulation.
45// It uses the class G4AdjointPrimaryGenerator to generate randomly adjoint primary particles on a user selected
46// adjoint source (External surface of a volume or Sphere).
47// The spectrum of the primary adjoint particles is set as 1/E with user defined max and min energy.
48// The weight of the primary is set according to ReverseMC theory as w=log(Emax/Emin)*E*adjoint_source_area*pi/n, with E the energy of the
49// particle, n the number of adjoint primary particles of same type that will be generated during the simulation.
50// Different types of adjoint particles are generated event after event in order
51// to cover all the type of primaries and secondaries needed for the simulation. For example if reverse e- ionisation, brem, photo electric effect, and
52// compton are considered both adjoint gamma and adjoint e- will be considered alternatively as adjoint primary.
53// The user can decide to consider/neglect some type of particle by using the macro
54// commands /adjoint/ConsiderAsPrimary and /adjoint/NeglectAsPrimary. If an adjoint primary or its secondary has reached the external surface,
55// in the next event a fwd primary particle equivalent to the last generated adjoint primary is generated with the same position, energy but opposite direction