Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
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
25
26//_____________________________________________________________________________
27TG4G3Defaults::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);
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
68}
69
70//_____________________________________________________________________________
77
78//
79// public methods
80//
81
82//_____________________________________________________________________________
83G4double TG4G3Defaults::CutValue(G4int g3Cut) const
84{
86
87 return fCutVector[g3Cut];
88}
89
90//_____________________________________________________________________________
92{
94
95 return fControlVector[control];
96}
97
98//_____________________________________________________________________________
99G4bool 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//_____________________________________________________________________________
111 TG4G3Control control, TG4G3ControlValue value) const
112{
114
115 if (value == ControlValue(control))
116 return true;
117 else
118 return false;
119}
Definition of the TG4G3Defaults class.
Definition of the TG4Globals class and basic container types.
G4bool SetControl(TG4G3Control control, TG4G3ControlValue controlValue, TG4G3CutVector &cuts)
static G4double Tolerance()
void SetCut(TG4G3Cut cut, G4double cutValue)
Default G3 kinetic energy cuts and control process values.
TG4G3CutVector fCutVector
vector of default cut values
G4bool IsDefaultCut(TG4G3Cut cut, G4double value) const
TG4G3ControlValue ControlValue(G4int control) const
G4double CutValue(G4int cut) const
G4bool IsDefaultControl(TG4G3Control control, TG4G3ControlValue value) const
static G4ThreadLocal TG4G3Defaults * fgInstance
this instance
TG4G3ControlVector fControlVector
vector of default control values
static void Exception(const TString &className, const TString &methodName, const TString &text)
TG4G3ControlValue
Enumeration for G3 processes control values.
TG4G3Cut
Enumeration for G3 types of kinetic energy cuts.
Definition TG4G3Cut.h:22
TG4G3Control
Enumeration for G3 types of physics processes controls.
@ kInActivate
process is not activated
@ kActivate
process is activated WITH generation of secondaries
@ kActivate2
process is activated WITHOUT generation of secondaries
@ kCUTGAM
Definition TG4G3Cut.h:27
@ kDCUTM
Definition TG4G3Cut.h:67
@ kDCUTE
Definition TG4G3Cut.h:62
@ kCUTHAD
Definition TG4G3Cut.h:42
@ kBCUTM
Definition TG4G3Cut.h:57
@ kCUTNEU
Definition TG4G3Cut.h:37
@ kCUTMUO
Definition TG4G3Cut.h:47
@ kCUTELE
Definition TG4G3Cut.h:32
@ kPPCUTM
Definition TG4G3Cut.h:72
@ kBCUTE
Definition TG4G3Cut.h:52
@ kDCAY
@ kPAIR
@ kPFIS
@ kHADR
@ kANNI
@ kRAYL
@ kDRAY
@ kG3LOSS
@ kCOMP
@ kBREM
@ kMUNU
@ kLABS
@ kSYNC
@ kCKOV
@ kMULS
@ kPHOT