Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
global
src
TG4G3Defaults.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Geant4 Virtual Monte Carlo package
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
14
15
#include "
TG4G3Defaults.h
"
16
#include "
TG4Globals.h
"
17
18
#include <G4SystemOfUnits.hh>
19
20
#include <math.h>
21
22
// static data members
23
24
TG4G3Defaults
*
TG4G3Defaults::fgInstance
= 0;
25
26
//_____________________________________________________________________________
27
TG4G3Defaults::TG4G3Defaults
() :
fCutVector
(),
fControlVector
()
28
{
30
31
if
(
fgInstance
) {
32
TG4Globals::Exception
(
"TG4G3Defaults"
,
"TG4G3Defaults"
,
33
"Cannot create two instances of singleton."
);
34
}
35
36
fgInstance
=
this
;
37
38
// fill cut vector with default values
39
40
fCutVector
.SetCut(
kCUTGAM
, 0.001 * GeV);
41
fCutVector
.SetCut(
kCUTELE
, 0.001 * GeV);
42
fCutVector
.SetCut(
kCUTNEU
, 0.01 * GeV);
43
fCutVector
.SetCut(
kCUTHAD
, 0.01 * GeV);
44
fCutVector
.SetCut(
kCUTMUO
, 0.01 * GeV);
45
fCutVector
.SetCut(
kBCUTE
,
fCutVector
[
kCUTGAM
]);
46
fCutVector
.SetCut(
kBCUTM
,
fCutVector
[
kCUTGAM
]);
47
fCutVector
.SetCut(
kDCUTE
, 10. * TeV);
48
fCutVector
.SetCut(
kDCUTM
, 10. * TeV);
49
fCutVector
.SetCut(
kPPCUTM
, 0.01 * GeV);
50
51
// fill control vector with default values
52
fControlVector
.SetControl(
kPAIR
,
kActivate
,
fCutVector
);
// 1
53
fControlVector
.SetControl(
kCOMP
,
kActivate
,
fCutVector
);
// 1
54
fControlVector
.SetControl(
kPHOT
,
kActivate
,
fCutVector
);
// 1
55
fControlVector
.SetControl(
kPFIS
,
kInActivate
,
fCutVector
);
// 0
56
fControlVector
.SetControl(
kDRAY
,
kInActivate
,
fCutVector
);
// 0
57
fControlVector
.SetControl(
kANNI
,
kActivate
,
fCutVector
);
// 1
58
fControlVector
.SetControl(
kBREM
,
kActivate
,
fCutVector
);
// 1
59
fControlVector
.SetControl(
kHADR
,
kActivate
,
fCutVector
);
// 1
60
fControlVector
.SetControl(
kMUNU
,
kInActivate
,
fCutVector
);
// 0
61
fControlVector
.SetControl(
kDCAY
,
kActivate
,
fCutVector
);
// 1
62
fControlVector
.SetControl(
kG3LOSS
,
kActivate2
,
fCutVector
);
// 2
63
fControlVector
.SetControl(
kMULS
,
kActivate
,
fCutVector
);
// 1
64
fControlVector
.SetControl(
kCKOV
,
kInActivate
,
fCutVector
);
// 0
65
fControlVector
.SetControl(
kRAYL
,
kInActivate
,
fCutVector
);
// 0
66
fControlVector
.SetControl(
kLABS
,
kInActivate
,
fCutVector
);
// 0
67
fControlVector
.SetControl(
kSYNC
,
kInActivate
,
fCutVector
);
// 0
68
}
69
70
//_____________________________________________________________________________
71
TG4G3Defaults::~TG4G3Defaults
()
72
{
74
75
fgInstance
= 0;
76
}
77
78
//
79
// public methods
80
//
81
82
//_____________________________________________________________________________
83
G4double
TG4G3Defaults::CutValue
(G4int g3Cut)
const
84
{
86
87
return
fCutVector
[g3Cut];
88
}
89
90
//_____________________________________________________________________________
91
TG4G3ControlValue
TG4G3Defaults::ControlValue
(G4int control)
const
92
{
94
95
return
fControlVector
[control];
96
}
97
98
//_____________________________________________________________________________
99
G4bool
TG4G3Defaults::IsDefaultCut
(
TG4G3Cut
cut, G4double value)
const
100
{
102
103
if
(std::abs(value * GeV -
CutValue
(cut)) >
TG4G3CutVector::Tolerance
())
104
return
false
;
105
else
106
return
true
;
107
}
108
109
//_____________________________________________________________________________
110
G4bool
TG4G3Defaults::IsDefaultControl
(
111
TG4G3Control
control,
TG4G3ControlValue
value)
const
112
{
114
115
if
(value ==
ControlValue
(control))
116
return
true
;
117
else
118
return
false
;
119
}
TG4G3Defaults.h
Definition of the TG4G3Defaults class.
TG4Globals.h
Definition of the TG4Globals class and basic container types.
TG4G3CutVector::Tolerance
static G4double Tolerance()
Definition
TG4G3CutVector.h:116
TG4G3Defaults
Default G3 kinetic energy cuts and control process values.
Definition
TG4G3Defaults.h:34
TG4G3Defaults::TG4G3Defaults
TG4G3Defaults()
Definition
TG4G3Defaults.cxx:27
TG4G3Defaults::fCutVector
TG4G3CutVector fCutVector
vector of default cut values
Definition
TG4G3Defaults.h:60
TG4G3Defaults::fgInstance
static TG4G3Defaults * fgInstance
this instance
Definition
TG4G3Defaults.h:57
TG4G3Defaults::IsDefaultCut
G4bool IsDefaultCut(TG4G3Cut cut, G4double value) const
Definition
TG4G3Defaults.cxx:99
TG4G3Defaults::ControlValue
TG4G3ControlValue ControlValue(G4int control) const
Definition
TG4G3Defaults.cxx:91
TG4G3Defaults::CutValue
G4double CutValue(G4int cut) const
Definition
TG4G3Defaults.cxx:83
TG4G3Defaults::IsDefaultControl
G4bool IsDefaultControl(TG4G3Control control, TG4G3ControlValue value) const
Definition
TG4G3Defaults.cxx:110
TG4G3Defaults::~TG4G3Defaults
~TG4G3Defaults()
Definition
TG4G3Defaults.cxx:71
TG4G3Defaults::fControlVector
TG4G3ControlVector fControlVector
vector of default control values
Definition
TG4G3Defaults.h:61
TG4Globals::Exception
static void Exception(const TString &className, const TString &methodName, const TString &text)
Definition
TG4Globals.cxx:33
TG4G3ControlValue
TG4G3ControlValue
Enumeration for G3 processes control values.
Definition
TG4G3Control.h:176
TG4G3Cut
TG4G3Cut
Enumeration for G3 types of kinetic energy cuts.
Definition
TG4G3Cut.h:22
TG4G3Control
TG4G3Control
Enumeration for G3 types of physics processes controls.
Definition
TG4G3Control.h:29
kInActivate
@ kInActivate
process is not activated
Definition
TG4G3Control.h:181
kActivate
@ kActivate
process is activated WITH generation of secondaries
Definition
TG4G3Control.h:184
kActivate2
@ kActivate2
process is activated WITHOUT generation of secondaries
Definition
TG4G3Control.h:187
kCUTGAM
@ kCUTGAM
Definition
TG4G3Cut.h:27
kDCUTM
@ kDCUTM
Definition
TG4G3Cut.h:67
kDCUTE
@ kDCUTE
Definition
TG4G3Cut.h:62
kCUTHAD
@ kCUTHAD
Definition
TG4G3Cut.h:42
kBCUTM
@ kBCUTM
Definition
TG4G3Cut.h:57
kCUTNEU
@ kCUTNEU
Definition
TG4G3Cut.h:37
kCUTMUO
@ kCUTMUO
Definition
TG4G3Cut.h:47
kCUTELE
@ kCUTELE
Definition
TG4G3Cut.h:32
kPPCUTM
@ kPPCUTM
Definition
TG4G3Cut.h:72
kBCUTE
@ kBCUTE
Definition
TG4G3Cut.h:52
kDCAY
@ kDCAY
Definition
TG4G3Control.h:109
kPAIR
@ kPAIR
Definition
TG4G3Control.h:37
kPFIS
@ kPFIS
Definition
TG4G3Control.h:61
kHADR
@ kHADR
Definition
TG4G3Control.h:94
kANNI
@ kANNI
Definition
TG4G3Control.h:78
kRAYL
@ kRAYL
Definition
TG4G3Control.h:139
kDRAY
@ kDRAY
Definition
TG4G3Control.h:71
kG3LOSS
@ kG3LOSS
Definition
TG4G3Control.h:118
kCOMP
@ kCOMP
Definition
TG4G3Control.h:46
kBREM
@ kBREM
Definition
TG4G3Control.h:87
kMUNU
@ kMUNU
Definition
TG4G3Control.h:102
kLABS
@ kLABS
Definition
TG4G3Control.h:147
kSYNC
@ kSYNC
Definition
TG4G3Control.h:154
kCKOV
@ kCKOV
Definition
TG4G3Control.h:132
kMULS
@ kMULS
Definition
TG4G3Control.h:125
kPHOT
@ kPHOT
Definition
TG4G3Control.h:54
Generated on
for Geant4 VMC by
1.17.0