Skip to content
정우 edited this page Aug 17, 2015 · 6 revisions

#Example 1

In this example, I tried to put the minimum information for simulating Geant4 and taking care of data.

If you want other features such as physical cuts, advanced detector definition, sensitive detector, field, messenger etc., I will try to introduce them in later examples.

###Directories

  1. Ex1
    • KUNPLEx1DetectorConstruction
    • KUNPLEx1PrimaryGeneratorAction
    • KUNPLEx1SteppingAction
    • KUNPLEx1TrackingAction
  2. Ex1/ROOT
    • KUNPLEx1ROOTSteppingAction
    • KUNPLEx1ROOTTrackingAction
    • KUNPLEx1ROOTEventAction
    • KUNPLEx1ROOTAna

###Examples

  1. KUNPLEx1
    : G4UserDetectorConstruction and G4UserPrimaryGeneratorAction is the very basic two classes for simulation. Geant4 will not work without them.
  2. KUNPLEx1_Action
    : You can do your simulation with G4UserDetectorConstruction and G4UserPrimaryGeneratorAction, but this doesn't mean that you can touch the simulation result. To actually handle the data, Geant4 needs user actions. The very direct action touching the data is G4UserSteppingAction. The UserSteppingAction(const G4Step* step) method of this G4UserSteppingAction is called every step (meaning any interaction between track and medium). Methods in G4UserTrackingAction is called every start and end of track.
  3. KUNPLEx1_ROOT
    : If you are going to analyze data with ROOT, you probability want to save data in ROOT file. This example use KUNPLEx1ROOTAna class to satisfy this feature.
Clone this wiki locally