Class RMGVVertexGenerator

Inheritance Relationships

Derived Types

Class Documentation

class RMGVVertexGenerator

Abstract base class for vertex generators.

This class defines the interface for generating primary vertex positions in a simulation run. It provides hooks for run initialization (begin/end) and for generating a vertex. When BxDecay0 is available, it implements the bxdecay0::VertexGeneratorInterface.

Subclassed by RMGVertexConfinement, RMGVertexFromFile, RMGVertexFromPoint

Public Functions

inline RMGVVertexGenerator(std::string name)
virtual ~RMGVVertexGenerator() = default
RMGVVertexGenerator(RMGVVertexGenerator const&) = delete
RMGVVertexGenerator &operator=(RMGVVertexGenerator const&) = delete
RMGVVertexGenerator(RMGVVertexGenerator&&) = delete
RMGVVertexGenerator &operator=(RMGVVertexGenerator&&) = delete
inline virtual void BeginOfRunAction(const G4Run*)
inline virtual void EndOfRunAction(const G4Run*)
inline virtual bool GenerateVertex(G4ThreeVector &v)

Generate a primary vertex position.

Fills the provided vector v with the generated primary vertex position. If vertex generation is not implemented, v is set to a dummy position (0,0,0) and the function returns false.

Parameters:

v – Reference to the G4ThreeVector to hold the generated vertex.

Returns:

True if a valid vertex was generated, false otherwise.

inline void SetMaxAttempts(int val)

Set the maximum number of attempts for vertex generation.

This controls how many iterations the generator will perform before giving up.

Parameters:

val – The maximum number of attempts.

inline int GetMaxAttempts() const

Get the maximum number of attempts for vertex generation.

Returns:

The maximum number of attempts.

Protected Attributes

std::string fGeneratorName
int fMaxAttempts = 100
const G4ThreeVector kDummyPrimaryPosition = G4ThreeVector(0, 0, 0)
std::unique_ptr<G4UImessenger> fMessenger