Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
advanced
hadrontherapy
src
HadrontherapyPrimaryGeneratorAction.cc
Go to the documentation of this file.
1
// **************************************************************************************
2
//
3
// HADRONTHERAPY: a Geant4-based application for proton/ion-therapy studies
4
// _________________________________________________________________________
5
//
6
// This is the FULL version of the Hadrontherapy application.
7
// It is based on the Geant4 toolkit classes and released under the GPL3 license.
8
//
9
// Its basic version is released and maintained inside the Geant4 code
10
// as Advanced Example.
11
//
12
// To compile and run Hadrontherapy you only require the installation of Geant4 and,
13
// if you wish, the ROOT ananlysis program.
14
//
15
// For more information see the documentation at http://sites.google.com/site/hadrontherapy/
16
// or contact cirrone@lns.infn.it
17
//
18
// **************************************************************************************
19
20
#include "
HadrontherapyPrimaryGeneratorAction.hh
"
21
#include "
HadrontherapyPrimaryGeneratorMessenger.hh
"
22
#include "
HadrontherapyAnalysisManager.hh
"
23
#include "
G4SystemOfUnits.hh
"
24
#include "
G4Event.hh
"
25
#include "
G4ParticleGun.hh
"
26
#include "
G4GeneralParticleSource.hh
"
27
#include "
G4ParticleTable.hh
"
28
#include "
G4ParticleDefinition.hh
"
29
#include "
Randomize.hh
"
30
32
HadrontherapyPrimaryGeneratorAction::HadrontherapyPrimaryGeneratorAction
()
33
{
34
35
SetDefaultPrimaryParticle();
36
37
// Definition of the General particle Source
38
particleGun =
new
G4GeneralParticleSource
();
39
}
40
42
HadrontherapyPrimaryGeneratorAction::~HadrontherapyPrimaryGeneratorAction
()
43
{
44
delete
particleGun;
45
46
}
47
49
void
HadrontherapyPrimaryGeneratorAction::SetDefaultPrimaryParticle()
50
{
51
52
}
54
void
HadrontherapyPrimaryGeneratorAction::GeneratePrimaries
(
G4Event
* anEvent)
55
{
56
#ifdef G4ANALYSIS_USE_ROOT
57
// Increment the event counter
58
HadrontherapyAnalysisManager::GetInstance
()->startNewEvent();
59
#endif
60
particleGun -> GeneratePrimaryVertex( anEvent );
61
}
62
Generated on Sat May 25 2013 14:32:10 for Geant4 by
1.8.4