Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Luter 345 Experiments
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Program Structure
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Getting Started with Geant4== ===Defining the main() Program=== The contents of main() will vary according to the needs of a given simulation application and therefore must be supplied by the user First you must include all of the files you will be calling into the main() method #include "G4RunManager.hh" #include "G4UImanager.hh" #include "ExG4DetectorConstruction01.hh" #include "ExG4PhysicsList00.hh" #include "ExG4ActionInitialization01.hh" Secondly construct the default run manager G4RunManager* runManager = new G4RunManager; Then you need to set the mandatory initialization classes runManager->SetUserInitialization(new ExG4DetectorConstruction01); runManager->SetUserInitialization(new ExG4PhysicsList00); runManager->SetUserInitialization(new ExG4ActionInitialization01); //this code initializes G4DetectorConstruction, G4PhysicsList, G4ActionInitialization Initialization of the G4 kernel runManager->Initialize(); The next step for a simple main() method would be getting the pointer to the UI(User Interface) manager and set verbosities G4UImanager* UI = G4UImanager::GetUIpointer(); UI->ApplyCommand("/run/verbose 1"); UI->ApplyCommand("/event/verbose 1"); UI->ApplyCommand("/tracking/verbose 1") Starting the run process int numberOfEvent = 3; //you can put however many events you would like this example is set at 3. runManager->BeamOn(numberOfEvent); Then you need to terminate the job and close the main() method delete runManager; return 0; }
Summary:
Please note that all contributions to Luter 345 Experiments may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Luter 345 Experiments:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)