Belle II Software development
PrimaryGeneratorAction.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <simulation/kernel/PrimaryGeneratorAction.h>
10#include <simulation/kernel/MCParticleGenerator.h>
11
12#include <G4Event.hh>
13
14using namespace std;
15using namespace Belle2;
16using namespace Belle2::Simulation;
17
18
20 MCParticleGraph& mcParticleGraph) : G4VUserPrimaryGeneratorAction()
21{
22 m_mcParticleGenerator = new MCParticleGenerator(mcCollectionName, mcParticleGraph);
23 if (false) {
24 G4Event* event = nullptr;
25 GeneratePrimaries(event);
26 }
27}
28
29
31{
33}
34
35
37{
39}
Class to build, validate and sort a particle decay chain.
This class creates Geant4 primary particles from MCParticle list The generator assumes that each part...
virtual void GeneratePrimaryVertex(G4Event *event)
Create G4 primary particles from MCParticle list.
virtual ~PrimaryGeneratorAction()
The destructor of the PrimaryGeneratorAction.
PrimaryGeneratorAction(const std::string &mcCollectionName, MCParticleGraph &mcParticleGraph)
The constructor of the PrimaryGeneratorAction.
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.
Abstract base class for different kinds of events.
STL namespace.