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 - 2015 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 TR
11/// \file TR/run_g4.C
12/// \brief Macro for running Example TR 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 TR 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 TR/g4Config.C
25
26 // MC application
28 = new VMC::TR::MCApplication("ExampleTR", "The exampleTR MC application");
30 appl->SetPrintModulo(10000);
31
32 appl->InitMC(configMacro);
33
34 // Customise Geant4 setting after initialization:
35 ((TGeant4*)gMC)->ProcessGeantMacro("g4config2.in");
36
37 // Visualization setting
38 // set_g4_vis();
39
40 // Enter in Geant4 interactive session
41 //((TGeant4*)gMC)->StartGeantUI();
42
43 appl->RunMC(5000);
44
45 delete appl;
46}
void run_g4(const TString &configMacro="g4Config.C")
Definition run_g4.C:16
Macro for setting G4 visualization for Example TR.
Implementation of the TVirtualMCApplication.
PrimaryGenerator * GetPrimaryGenerator() const
void SetPrintModulo(Int_t value)
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)
void SetNofPrimaries(Int_t nofPrimaries)