Belle II Software development
PrimaryGeneratorAction Class Reference

The PrimaryGeneratorAction class inherits from G4VuserPrimaryGeneratorAction and specifies how a primary event should be generated. More...

#include <PrimaryGeneratorAction.h>

Inheritance diagram for PrimaryGeneratorAction:

Public Member Functions

 PrimaryGeneratorAction (const std::string &mcCollectionName, MCParticleGraph &mcParticleGraph)
 The constructor of the PrimaryGeneratorAction.
 
virtual ~PrimaryGeneratorAction ()
 The destructor of the PrimaryGeneratorAction.
 
void GeneratePrimaries (G4Event *event)
 This method is called for each event by Geant4 and creates the primary particles by invoking the generators.
 

Protected Attributes

MCParticleGeneratorm_mcParticleGenerator
 The instance of the MCParticle generator.
 

Detailed Description

The PrimaryGeneratorAction class inherits from G4VuserPrimaryGeneratorAction and specifies how a primary event should be generated.

Actual generation of primary particles will be done by a concrete classes of G4VPrimaryGenerator. This class just arranges the way primary particles are generated.

Definition at line 34 of file PrimaryGeneratorAction.h.

Constructor & Destructor Documentation

◆ PrimaryGeneratorAction()

PrimaryGeneratorAction ( const std::string &  mcCollectionName,
MCParticleGraph mcParticleGraph 
)

The constructor of the PrimaryGeneratorAction.

Parameters
mcParticleGraphReference to the MCParticle Graph, which is filled by this class.
mcCollectionNameThe name of the MCParticle collection that should be used to create the MCParticle generator.

Definition at line 19 of file PrimaryGeneratorAction.cc.

20 : G4VUserPrimaryGeneratorAction()
21{
22 m_mcParticleGenerator = new MCParticleGenerator(mcCollectionName, mcParticleGraph);
23 if (false) {
24 G4Event* event = nullptr;
25 GeneratePrimaries(event);
26 }
27}
This class creates Geant4 primary particles from MCParticle list The generator assumes that each part...
void GeneratePrimaries(G4Event *event)
This method is called for each event by Geant4 and creates the primary particles by invoking the gene...
MCParticleGenerator * m_mcParticleGenerator
The instance of the MCParticle generator.

◆ ~PrimaryGeneratorAction()

~PrimaryGeneratorAction ( )
virtual

The destructor of the PrimaryGeneratorAction.

Definition at line 30 of file PrimaryGeneratorAction.cc.

31{
33}

Member Function Documentation

◆ GeneratePrimaries()

void GeneratePrimaries ( G4Event *  event)

This method is called for each event by Geant4 and creates the primary particles by invoking the generators.

Parameters
eventPointer to the G4Event.

Definition at line 36 of file PrimaryGeneratorAction.cc.

37{
39}
virtual void GeneratePrimaryVertex(G4Event *event)
Create G4 primary particles from MCParticle list.

Member Data Documentation

◆ m_mcParticleGenerator

MCParticleGenerator* m_mcParticleGenerator
protected

The instance of the MCParticle generator.

Definition at line 57 of file PrimaryGeneratorAction.h.


The documentation for this class was generated from the following files: