VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E06
run_g4.C
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2007 - 2014 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 E06
11
/// \file E06/run_g4.C
12
/// \brief Macro for running Example06 with Geant4.
13
14
#include "TVirtualMC.h"
15
16
//#include "optPhoton.C"
17
18
void
run_g4
(
const
TString& configMacro =
"g4Config.C"
)
19
{
20
/// Macro function for running Example06 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 E06/g4Config.C
25
26
// MC application
27
Ex06MCApplication
* appl
28
=
new
Ex06MCApplication
(
"Example06"
,
"The example06 MC application"
);
29
30
appl->
GetPrimaryGenerator
()->
SetNofPrimaries
(10);
31
//appl->SetVerboseLevel(3);
32
33
// Macro to run with primary = polarized optical photon
34
//optPhoton();
35
36
// Initialize MC
37
appl->
InitMC
(configMacro);
38
39
// Customise Geant4 setting after initialization:
40
// Physics list
41
((TGeant4*)gMC)->ProcessGeantMacro(
"g4config2.in"
);
42
// Visualization settings
43
((TGeant4*)gMC)->ProcessGeantMacro(
"g4vis.in"
);
44
45
// Enter in Geant4 interactive session
46
//((TGeant4*)gMC)->StartGeantUI();
47
48
// Run MC
49
appl->
RunMC
(5);
50
51
delete
appl;
52
}
run_g4
void run_g4(const TString &configMacro="g4Config.C")
Definition
run_g4.C:16
Ex06MCApplication
Implementation of the TVirtualMCApplication.
Definition
Ex06MCApplication.h:38
Ex06MCApplication::RunMC
void RunMC(Int_t nofEvents)
Definition
Ex06MCApplication.cxx:167
Ex06MCApplication::InitMC
void InitMC(const char *setup)
Definition
Ex06MCApplication.cxx:143
Ex06MCApplication::GetPrimaryGenerator
Ex06PrimaryGenerator * GetPrimaryGenerator() const
Definition
Ex06MCApplication.h:118
Ex06PrimaryGenerator::SetNofPrimaries
void SetNofPrimaries(Int_t nofPrimaries)
Definition
Ex06PrimaryGenerator.h:91
Generated on
for VMC Examples by
1.17.0