VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E06
test_E06.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 Tests
11
/// \file test_E06.C
12
/// \brief Example E06 Test macro
13
14
void
test_E06
(
const
TString& configMacro, Bool_t oldGeometry)
15
{
16
/// Macro function for testing example E06
17
/// \param configMacro configuration macro loaded in initialization
18
/// \param oldGeometry if true - geometry is defined via VMC, otherwise
19
/// via TGeo
20
21
22
// Create application if it does not yet exist
23
Bool_t needDelete = kFALSE;
24
if
( ! TVirtualMCApplication::Instance() ) {
25
new
Ex06MCApplication
(
"Example06"
,
"The example06 MC application"
);
26
needDelete = kTRUE;
27
}
28
29
// MC application
30
Ex06MCApplication
* appl
31
= (
Ex06MCApplication
*)TVirtualMCApplication::Instance();
32
appl->
GetPrimaryGenerator
()->
SetNofPrimaries
(100);
33
34
// Set geometry defined via VMC
35
appl->
SetOldGeometry
(oldGeometry);
36
37
38
// Initialize MC
39
appl->
InitMC
(configMacro);
40
41
if
( TString(gMC->GetName()) ==
"TGeant4"
) {
42
// Customise Geant4 setting after initialization:
43
gROOT->LoadMacro(
"g4Config2.C"
);
44
gInterpreter->ProcessLine(
"g4Config2()"
);
45
}
46
47
// Run MC
48
appl->
RunMC
(10);
49
50
if
( needDelete )
delete
appl;
51
}
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::SetOldGeometry
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
Definition
Ex06MCApplication.h:125
Ex06MCApplication::GetPrimaryGenerator
Ex06PrimaryGenerator * GetPrimaryGenerator() const
Definition
Ex06MCApplication.h:118
Ex06PrimaryGenerator::SetNofPrimaries
void SetNofPrimaries(Int_t nofPrimaries)
Definition
Ex06PrimaryGenerator.h:91
test_E06
void test_E06(const TString &configMacro, Bool_t oldGeometry)
Definition
test_E06.C:14
Generated on
for VMC Examples by
1.17.0