Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
RadioBio::PrimaryGeneratorAction Class Reference

#include <Doxymodules_medical.h>

Inheritance diagram for RadioBio::PrimaryGeneratorAction:
G4VUserPrimaryGeneratorAction

Public Member Functions

 PrimaryGeneratorAction (DetectorConstruction *det)
 
 ~PrimaryGeneratorAction () override
 
void GeneratePrimaries (G4Event *) override
 
G4GeneralParticleSourceGetGeneralParticleSource ()
 

Private Attributes

DetectorConstructionfDetector = nullptr
 
G4GeneralParticleSourcefGPS = nullptr
 

Detailed Description

Definition at line 140 of file Doxymodules_medical.h.

Constructor & Destructor Documentation

◆ PrimaryGeneratorAction()

RadioBio::PrimaryGeneratorAction::PrimaryGeneratorAction ( DetectorConstruction det)

Definition at line 44 of file PrimaryGeneratorAction.cc.

46{
48
49 G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle("proton");
50 fGPS->SetParticleDefinition(particle);
51
52 // Hard code the primary direction along X
53 // and rotate the source
54 fGPS->GetCurrentSource()->GetPosDist()->SetPosRot1(G4ThreeVector(0, 0, 1));
55 fGPS->GetCurrentSource()->GetPosDist()->SetPosRot2(G4ThreeVector(0, 1, 0));
56 fGPS->GetCurrentSource()->GetAngDist()->SetParticleMomentumDirection(G4ThreeVector(1, 0, 0));
57}

◆ ~PrimaryGeneratorAction()

RadioBio::PrimaryGeneratorAction::~PrimaryGeneratorAction ( )
override

Definition at line 61 of file PrimaryGeneratorAction.cc.

62{
63 delete fGPS;
64}

Member Function Documentation

◆ GeneratePrimaries()

void RadioBio::PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
override

Definition at line 68 of file PrimaryGeneratorAction.cc.

69{
70 // Hard code position on the side and rotatio on the corrrect axis
71 fGPS->GetCurrentSource()->GetPosDist()->SetCentreCoords(
72 G4ThreeVector(-fDetector->GetSizeX() / 2., 0., 0.));
73
74 fGPS->GeneratePrimaryVertex(anEvent);
75}

◆ GetGeneralParticleSource()

G4GeneralParticleSource * RadioBio::PrimaryGeneratorAction::GetGeneralParticleSource ( )
inline

Definition at line 53 of file PrimaryGeneratorAction.hh.

54 {
55 return fGPS;
56 }

Member Data Documentation

◆ fDetector

DetectorConstruction* RadioBio::PrimaryGeneratorAction::fDetector = nullptr
private

Definition at line 59 of file PrimaryGeneratorAction.hh.

◆ fGPS

G4GeneralParticleSource* RadioBio::PrimaryGeneratorAction::fGPS = nullptr
private

Definition at line 60 of file PrimaryGeneratorAction.hh.


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

Applications | User Support | Publications | Collaboration