Warning, /geant4/examples/extended/parameterisations/Par03/README.md is written in an unsupported language. File is not indexed.
0001 \page ExamplePar03 Example Par03
0002
0003 This example demonstrates how to use G4FastSimHitMaker helper class
0004 to create multiple energy deposits from the fast simulation model.
0005
0006 It requires sensitive detector class to inherit from both base classes:
0007 - G4VSensitiveDetector: for processing of detailed/non-fast simulation hits
0008 - G4VFastSimSensitiveDetector: for processing of fast sim (G4FastSim) hits
0009 Hits are placed in the same hit collection, so they can be used to
0010 compare between the full and the fast simulation.
0011
0012 The geometry used in the example is a homogeneous cylinder of lead, with
0013 3D readout geometry (cylindrical). Analysis of energy deposits is done
0014 in the event action.
0015
0016 ## Detector description
0017
0018 The detector is a homogeneous cylinder of lead. It is segmented along
0019 z, R and phi to create a readout geometry in the cylindrical coordinates.
0020
0021 Fast simulation is attached to the region of the detector.
0022
0023
0024 ## Sensitive detector
0025
0026 Sensitive detector (Par03SensitiveDetector) inherits from both base classes:
0027 - G4VSensitiveDetector: for processing of detailed/non-fast simulation hits
0028 - G4VFastSimSensitiveDetector: for processing of fast sim (G4FastSim) hits.
0029 Hits are placed in the same hit collection, with a different flag to distinguish
0030 between those originated in the full simulation, and those from the fast
0031 simulation.
0032 During visualisation, hits are represented as volumes of different colour:
0033 green for full simulation and red for fast simulation.
0034
0035 ## Primary generation
0036
0037 Particle gun is used as a primary generator. The direction of particles is along
0038 the axis of symmetry of the detector (cylinder). It is positioned 10 cm in front
0039 of the entrance to the detector. 10 GeV electron is used by default. Those values
0040 can be changed using /gun/ UI commands.
0041
0042 ## Physics List
0043
0044 FTFP_BERT modular physics list is used. On top of it, fast simulation physics
0045 is registered for selected particles (electrons, positrons, and photons).
0046
0047
0048 ## User actions
0049
0050 - Par03RunAction : run action used for initialization and termination
0051 of the run. Histograms for analysis of shower development
0052 in the detector are created.
0053
0054 - Par03EventAction : event action used for initialization and termination
0055 of the event. Analysis of shower development is performed
0056 on event-by-event basis.
0057
0058 ## Output
0059
0060 The execution of the program (examplePar03) produces an output with histograms.
0061
0062 The macro file examplePar03.in specifies three runs. Each run is made of 100
0063 events, for single 10 GeV electron beams. The first run is executed with fast
0064 simulation model activated with defualt parameters. The second run executes fast
0065 simulation with modified parameters. For the third run the fast simulation model
0066 is disactivated.
0067 Three output files are produced: two with shower development from the fast
0068 simulation (with different parameters), and from the full simulation.
0069
0070 ## How to build and run the example
0071
0072 - Compile and link to generate the executable (in your CMAKE build directory):
0073 ```
0074 % cmake <PAR03_SOURCE>
0075 % make
0076 ```
0077
0078 - Execute the application (in batch mode):
0079 ```
0080 % ./examplePar03 -m examplePar03.in
0081 ```
0082 which produces three root files: Par03_fastsim_100events.root,
0083 Par03_fastsimModified_100events.root, and Par03_fullsim_100events.root.
0084
0085 - Execute the application (in interactive mode):
0086 ```
0087 % ./examplePar03
0088 ```
0089 which allows to visualize hits.
0090
0091 ## UI commands
0092
0093 UI commands useful in this example:
0094
0095 - activation/disactivation of the fast simulation model:
0096 ```
0097 /param/ActivateModel model
0098 /param/InActivateModel model
0099 ```
0100
0101 - particle gun commands
0102 ```
0103 /gun/particle e+
0104 /gun/energy 50 GeV
0105 /gun/direction 0 0.2 1
0106 /gun/position 0 0 0
0107 ```
0108
0109 UI commands defined in this example:
0110 - detector settings
0111 ```
0112 /Par03/detector/print
0113 /Par03/detector/setDetectorRadius 10 cm
0114 /Par03/detector/setDetectorLength 30 cm
0115 /Par03/detector/setDetectorMaterial G4_Pb
0116 /Par03/detector/setNbOfLayers 100
0117 /Par03/detector/setNbOfPhiCells 20
0118 /Par03/detector/setNbOfRhoCells 100
0119 ```
0120
0121 - fast simulation settings
0122 ```
0123 /Par03/fastSim/print
0124 /Par03/fastSim/transverseProfile/sigma 20 mm
0125 /Par03/fastSim/longitudinalProfile/beta 0.6
0126 /Par03/fastSim/longitudinalProfile/alpha 2.
0127 /Par03/fastSim/longitudinalProfile/maxDepth 20
0128 /Par03/fastSim/numberOfHits 500
0129 /Par03/fastSim/print
0130 ```