VMC Examples Version 6.6
Loading...
Searching...
No Matches
g4Config1.C File Reference

Configuration macro for Geant4 VirtualMC for Example A01. More...

Go to the source code of this file.

Functions

void Config ()
 

Detailed Description

Configuration macro for Geant4 VirtualMC for Example A01.

For geometry defined with Geant4 in a user run configuration.

Definition in file g4Config1.C.

Function Documentation

◆ Config()

void Config ( )

The configuration function for Geant4 VMC for Example A01 called during MC application initialization. For geometry defined with Geant4 in a user run configuration.

Definition at line 16 of file g4Config1.C.

17{
18/// The configuration function for Geant4 VMC for Example A01
19/// called during MC application initialization.
20/// For geometry defined with Geant4 in a user run configuration.
21
22
23 // Get local magnetic field option
25 = (A01MCApplication*)TVirtualMCApplication::Instance();
26 Bool_t useLocalMagField = appl->GetUseLocalMagField();
27
28
29 // Run configuration with user geometry construction via Geant4
30 A01RunConfiguration* runConfiguration
31 = new A01RunConfiguration("FTFP_BERT");
32 runConfiguration->SetUseLocalMagField(useLocalMagField);
33
34 // Run configuration with user geometry construction via Geant4
35 // + special cuts activated
36 //A01RunConfiguration1* runConfiguration
37 // = new A01RunConfiguration1("FTFP_BERT", "specialCuts");
38
39 // TGeant4
40 TGeant4* geant4
41 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
42
43 // Customise Geant4 setting
44 // (verbose level, global range cut, ..)
45 geant4->ProcessGeantMacro("g4config.in");
46
47 cout << "Geant4 has been created." << endl;
48}
Implementation of the TVirtualMCApplication.
Bool_t GetUseLocalMagField() const
User Geant4 VMC run configuration.
void SetUseLocalMagField(Bool_t localMagField)