VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E03
test_E03_6.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 Tests
11
/// \file test_E03_6.C
12
/// \brief Example E03 Test macro 6
13
///
14
/// Running Example03
15
16
// Activate this code to check curving of trajectories in field
17
//#include "set_vis.C"
18
19
void
test_E03_6
(
const
TString& configMacro =
"g4Config5.C"
, Bool_t oldGeometry = kFALSE)
20
{
21
/// Macro function for testing example E03
22
/// \param configMacro configuration macro loaded in initialization
23
/// (g4Config5.C or g4tgeoConfig5.C)
24
/// \param oldGeometry if true - geometry is defined via VMC, otherwise
25
/// via TGeo
26
///
27
/// Activate user defined magnetic field equation of motion and stepper
28
/// and run an event of 5 muons.
29
30
// Create application if it does not yet exist
31
Bool_t needDelete = kFALSE;
32
if
( ! TVirtualMCApplication::Instance() ) {
33
new
Ex03MCApplication
(
"Example03"
,
"The example03 MC application"
);
34
needDelete = kTRUE;
35
}
36
37
// MC application
38
Ex03MCApplication
* appl
39
= (
Ex03MCApplication
*)TVirtualMCApplication::Instance();
40
appl->
GetPrimaryGenerator
()->
SetNofPrimaries
(5);
41
appl->
GetPrimaryGenerator
()->
SetPrimaryType
(
Ex03PrimaryGenerator::kTestField
);
42
appl->
SetField
(20);
// Set field value in z-direction to 20 kGauss (2tesla)
43
44
// Set geometry defined via VMC
45
appl->
SetOldGeometry
(oldGeometry);
46
47
appl->
InitMC
(configMacro);
48
49
// Visualization setting
50
// Activate this code to check curving of trajectories in field
51
//set_vis();
52
53
appl->
RunMC
(1);
54
55
// Inactivate this code to check curving of trajectories in field
56
if
( needDelete )
delete
appl;
57
}
Ex03MCApplication
Ex03bMCApplication Ex03MCApplication
Definition
Ex03bMCApplication.h:111
Ex03MCApplication
Implementation of the TVirtualMCApplication.
Definition
Ex03MCApplication.h:40
Ex03MCApplication::InitMC
void InitMC(const char *setup)
Definition
Ex03MCApplication.cxx:175
Ex03MCApplication::RunMC
void RunMC(Int_t nofEvents)
Definition
Ex03MCApplication.cxx:214
Ex03MCApplication::SetOldGeometry
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
Definition
Ex03MCApplication.h:149
Ex03MCApplication::SetField
void SetField(Double_t bz)
Definition
Ex03MCApplication.h:123
Ex03MCApplication::GetPrimaryGenerator
Ex03PrimaryGenerator * GetPrimaryGenerator() const
Definition
Ex03MCApplication.h:142
Ex03PrimaryGenerator::SetNofPrimaries
void SetNofPrimaries(Int_t nofPrimaries)
Definition
Ex03PrimaryGenerator.h:102
Ex03PrimaryGenerator::kTestField
@ kTestField
mu+ with a suitable energy to test magnetic field
Definition
Ex03PrimaryGenerator.h:43
Ex03PrimaryGenerator::SetPrimaryType
void SetPrimaryType(Type primaryType)
Definition
Ex03PrimaryGenerator.h:94
test_E03_6
void test_E03_6(const TString &configMacro="g4Config5.C", Bool_t oldGeometry=kFALSE)
Definition
test_E03_6.C:19
Generated on
for VMC Examples by
1.17.0