VMC Examples Version 6.6
Loading...
Searching...
No Matches
run_g4.C
Go to the documentation of this file.
1//------------------------------------------------
2// The Virtual Monte Carlo examples
3// Copyright (C) 2007 - 2016 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
10/// \ingroup ExGarfield
11/// \file ExGarfield/run_g4.C
12/// \brief Macro for running Example ExGarfield with Geant4.
13
14#include "TVirtualMC.h"
15
16#include "set_g4_vis.C"
17
18void run_g4(const TString& configMacro = "g4Config.C")
19{
20/// Macro function for running Example ExGarfield 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 ExGarfield/g4Config.C
25
26 // MC application
28 = new VMC::ExGarfield::MCApplication("ExampleExGarfield", "The example ExGarfield MC application");
29 appl->InitMC(configMacro);
30
31 // Customise Geant4 setting after initialization:
32 ((TGeant4*)gMC)->ProcessGeantMacro("g4config2.in");
33
34 // Visualization setting
35 set_g4_vis();
36
37 // Enter in Geant4 interactive session
38 //((TGeant4*)gMC)->StartGeantUI();
39
40 appl->RunMC(5);
41
42 //delete appl;
43}
void run_g4(const TString &configMacro="g4Config.C")
Definition run_g4.C:16
void set_g4_vis()
Definition set_g4_vis.C:15
Macro for setting G4 visualization for ExGarfield example.
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)