VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
Monopole
run_g4.C
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2018 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
#include "TVirtualMC.h"
11
12
#include "
set_g4_vis.C
"
13
14
/// \ingroup Monopole
15
/// \file Monopole/run_g4.C
16
/// \brief Macro for running Monopole example with Geant4.
17
18
void
run_g4
(
const
TString& configMacro =
"g4Config.C"
)
19
{
20
/// Macro function for running Monopole example 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 Monopole/g4Config.C
25
26
// MC application
27
VMC::Monopole::MCApplication
* appl
28
=
new
VMC::Monopole::MCApplication
(
"ExampleMonopole"
,
"The example Monopole MC application"
);
29
30
// Set detector parameters
31
// /testex/det/setMat G4_Si
32
// /testex/det/setSizeX 10 cm
33
// /testex/det/setSizeYZ 20 cm
34
// /testex/det/setStepSize 0.2 mm
35
// /testex/run/binSize 0.2 mm
36
VMC::Monopole::DetectorConstruction
* detector = appl->
GetDetectorConstruction
();
37
detector->
SetAbsorberMaterial
(
"Si"
);
38
detector->
SetAbsorberSizeX
(10);
39
detector->
SetAbsorberSizeYZ
(20);
40
detector->
SetMaxStepSize
(0.02);
41
appl->
SetBinSize
(0.02);
42
43
// Initialize MC
44
appl->
InitMC
(configMacro);
45
46
// Customise Geant4 setting after initialization:
47
// Physics list
48
((TGeant4*)gMC)->ProcessGeantMacro(
"g4config2.in"
);
49
50
// ((TGeant4*)gMC)->StartGeantUI();
51
52
// Visualization setting
53
set_g4_vis
();
54
55
// Run MC
56
TStopwatch timer;
57
timer.Start();
58
appl->
RunMC
(5);
59
timer.Stop();
60
timer.Print();
61
62
delete
appl;
63
}
64
run_g4
void run_g4(const TString &configMacro="g4Config.C")
Definition
run_g4.C:16
set_g4_vis
void set_g4_vis()
Definition
set_g4_vis.C:15
set_g4_vis.C
Macro for setting G4 visualization for Monopole.
VMC::Monopole::DetectorConstruction
The detector construction (via TGeo ).
Definition
DetectorConstruction.h:38
VMC::Monopole::DetectorConstruction::SetAbsorberSizeYZ
void SetAbsorberSizeYZ(Double_t sizeYZ)
Definition
DetectorConstruction.cxx:200
VMC::Monopole::DetectorConstruction::SetAbsorberSizeX
void SetAbsorberSizeX(Double_t sizeX)
Definition
DetectorConstruction.cxx:186
VMC::Monopole::DetectorConstruction::SetMaxStepSize
void SetMaxStepSize(Double_t maxStepSize)
Definition
DetectorConstruction.cxx:286
VMC::Monopole::DetectorConstruction::SetAbsorberMaterial
void SetAbsorberMaterial(const TString &name)
Definition
DetectorConstruction.cxx:214
VMC::Monopole::MCApplication
Implementation of the TVirtualMCApplication.
Definition
MCApplication.h:41
VMC::Monopole::MCApplication::InitMC
void InitMC(const char *setup)
Definition
MCApplication.cxx:153
VMC::Monopole::MCApplication::SetBinSize
void SetBinSize(Double_t binSize)
Definition
MCApplication.cxx:507
VMC::Monopole::MCApplication::RunMC
void RunMC(Int_t nofEvents)
Definition
MCApplication.cxx:221
VMC::Monopole::MCApplication::GetDetectorConstruction
DetectorConstruction * GetDetectorConstruction() const
Definition
MCApplication.h:104
Generated on
for VMC Examples by
1.17.0