VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
Monopole
test_Monopole.C
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2007 - 2019 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_Monopole.C
12
/// \brief Example Monopole Test macro
13
14
void
test_Monopole
(
const
TString& configMacro)
15
{
16
/// Macro function for testing example Monopole
17
/// \param configMacro configuration macro loaded in initialization
18
19
// Create application if it does not yet exist
20
Bool_t needDelete = kFALSE;
21
if
( ! TVirtualMCApplication::Instance() ) {
22
new
VMC::Monopole::MCApplication
(
"Example06"
,
"The example06 MC application"
);
23
needDelete = kTRUE;
24
}
25
26
// MC application
27
VMC::Monopole::MCApplication
* appl
28
= (
VMC::Monopole::MCApplication
*)TVirtualMCApplication::Instance();
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
if
( TString(gMC->GetName()) ==
"TGeant4"
) {
47
// Customise Geant4 setting after initialization:
48
// Physics list
49
((TGeant4*)gMC)->ProcessGeantMacro(
"g4config2.in"
);
50
}
51
52
// Run MC
53
appl->
RunMC
(100);
54
55
if
( needDelete )
delete
appl;
56
}
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
test_Monopole
void test_Monopole(const TString &configMacro)
Definition
test_Monopole.C:14
Generated on
for VMC Examples by
1.17.0