Belle II Software development
|
This class creates Geant4 primary particles from MCParticle list The generator assumes that each particle in the list has exactly one mother. More...
#include <MCParticleGenerator.h>
Public Member Functions | |
MCParticleGenerator (const std::string &mcCollectionName, MCParticleGraph &mcParticleGraph) | |
The constructor of the MCParticleGenerator class. | |
virtual | ~MCParticleGenerator () |
The destructor of the MCParticleGenerator class. | |
virtual void | GeneratePrimaryVertex (G4Event *event) |
Create G4 primary particles from MCParticle list. | |
Protected Member Functions | |
void | addParticle (const MCParticle &mcParticle, G4Event *event, G4PrimaryParticle *lastG4Mother, int motherIndex, bool useTime) |
Takes a MCParticle and creates a primary particle for Geant4. | |
G4PrimaryVertex * | determineVertex (const MCParticleGraph::GraphParticle &p, double &productionTimeShift) |
Create a simulation vertex for the given particle. | |
Protected Attributes | |
G4VSolid * | m_topSolid {nullptr} |
Pointer to the top level solid to check if particles are inside the simulation volume. | |
std::string | m_mcCollectionName |
Name of the MCParticle collection. | |
MCParticleGraph & | m_mcParticleGraph |
Reference to the MCParticle graph. | |
This class creates Geant4 primary particles from MCParticle list The generator assumes that each particle in the list has exactly one mother.
Definition at line 33 of file MCParticleGenerator.h.
MCParticleGenerator | ( | const std::string & | mcCollectionName, |
MCParticleGraph & | mcParticleGraph | ||
) |
The constructor of the MCParticleGenerator class.
mcCollectionName | MCParticle collection from which MCParticles are read. |
mcParticleGraph | Reference to the MCParticle graph that will be filled |
Definition at line 32 of file MCParticleGenerator.cc.
|
virtual |
The destructor of the MCParticleGenerator class.
Definition at line 42 of file MCParticleGenerator.cc.
|
protected |
Takes a MCParticle and creates a primary particle for Geant4.
The daughters of the specified MCParticle are added recursively.
mcParticle | a reference to MCParticle |
event | a pointer to Geant4 event |
lastG4Mother | a pointer to G4 mother particle |
motherIndex | mother index from MCParticle graph |
useTime | use MCParticle decay time (as given by the generator) |
Definition at line 112 of file MCParticleGenerator.cc.
|
protected |
Create a simulation vertex for the given particle.
This checks if the particle starts inside the simulation volume. If it's inside trivially just create a vertex at the given position and time. If not check if the particle intersects with the simulation volume.
If it does intersect and will survive long enough to get there we create a vertex at the simulation volume boundary and also set productionTimeShift to the flight time to get to the simulation volume.
p | Particle to create the vertex for |
productionTimeShift | return the flight time of the particle before reaching the simulation volume |
Definition at line 74 of file MCParticleGenerator.cc.
|
virtual |
Create G4 primary particles from MCParticle list.
This method is called for each event.
event | Pointer to the G4Event. |
Definition at line 48 of file MCParticleGenerator.cc.
|
protected |
Name of the MCParticle collection.
Definition at line 59 of file MCParticleGenerator.h.
|
protected |
Reference to the MCParticle graph.
Definition at line 60 of file MCParticleGenerator.h.
|
protected |
Pointer to the top level solid to check if particles are inside the simulation volume.
Definition at line 58 of file MCParticleGenerator.h.