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

Macro for loading libraries to run Monopole example with Geant4. More...

#include "TVirtualMC.h"
#include "set_g4_vis.C"
Include dependency graph for run_g4.C:

Go to the source code of this file.

Functions

void run_g4 (const TString &configMacro="g4Config.C")
 

Detailed Description

Macro for loading libraries to run Monopole example with Geant4.

Macro for running Monopole example with Geant4.

Definition in file run_g4.C.

Function Documentation

◆ run_g4()

void run_g4 ( const TString & configMacro = "g4Config.C")

Macro function for running Monopole example with Geant4 from Root interactive session. Note that since Root 6 the libraries have to be loaded first via load_g4.C.

Parameters
configMacroconfiguration macro name, default Monopole/g4Config.C

Definition at line 18 of file run_g4.C.

19{
20/// Macro function for running Monopole example with Geant4 from
21/// Root interactive session.
22/// Note that since Root 6 the libraries have to be loaded first
23/// via load_g4.C.
24/// \param configMacro configuration macro name, default \ref Monopole/g4Config.C
25
26 // MC application
28 = new VMC::Monopole::MCApplication("ExampleMonopole", "The example Monopole MC application");
29
30 // Set detector parameters
31 // /testex/det/setMat G4_Si
32 // /testex/det/setSizeX 10 cm
33 // /testex/det/setSizeYZ 20 cm
34 // /testex/det/setStepSize 0.2 mm
35 // /testex/run/binSize 0.2 mm
37 detector->SetAbsorberMaterial("Si");
38 detector->SetAbsorberSizeX(10);
39 detector->SetAbsorberSizeYZ(20);
40 detector->SetMaxStepSize(0.02);
41 appl->SetBinSize(0.02);
42
43 // Initialize MC
44 appl->InitMC(configMacro);
45
46 // Customise Geant4 setting after initialization:
47 // Physics list
48 ((TGeant4*)gMC)->ProcessGeantMacro("g4config2.in");
49
50 // ((TGeant4*)gMC)->StartGeantUI();
51
52 // Visualization setting
53 set_g4_vis();
54
55 // Run MC
56 TStopwatch timer;
57 timer.Start();
58 appl->RunMC(5);
59 timer.Stop();
60 timer.Print();
61
62 delete appl;
63}
void set_g4_vis()
Definition set_g4_vis.C:15
The detector construction (via TGeo )
void SetAbsorberMaterial(const TString &name)
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void SetBinSize(Double_t binSize)
void RunMC(Int_t nofEvents)
DetectorConstruction * GetDetectorConstruction() const