removed unreachable break from switch commands
[u/mrichter/AliRoot.git] / TGeant4 / TG4G3Defaults.cxx
CommitLineData
2817d3e2 1// $Id$
2// Category: physics
3//
4// See the class description in the header file.
5
6#include "TG4G3Defaults.h"
7#include "TG4Globals.h"
8
9#include <math.h>
10
11// static const data members
12
13// precision tolerance
c63f260d 14const G4double TG4G3Defaults::fgkCutTolerance = 1. * keV;
2817d3e2 15
16// kinetic energy cuts
c63f260d 17const G4double TG4G3Defaults::fgkCUTGAM = 0.001 * GeV;
18const G4double TG4G3Defaults::fgkCUTELE = 0.001 * GeV;
19const G4double TG4G3Defaults::fgkCUTNEU = 0.01 * GeV;
20const G4double TG4G3Defaults::fgkCUTHAD = 0.01 * GeV;
21const G4double TG4G3Defaults::fgkCUTMUO = 0.01 * GeV;
22const G4double TG4G3Defaults::fgkBCUTE = fgkCUTGAM;
23const G4double TG4G3Defaults::fgkBCUTM = fgkCUTGAM;
24const G4double TG4G3Defaults::fgkDCUTE = 10. * TeV;
25const G4double TG4G3Defaults::fgkDCUTM = 10. * TeV;
26const G4double TG4G3Defaults::fgkPPCUTM = 0.01 * GeV;
2817d3e2 27
28// physics processes
c63f260d 29const TG3FlagValue TG4G3Defaults::fgkPAIR = kActivate; // 1
30const TG3FlagValue TG4G3Defaults::fgkCOMP = kActivate; // 1
31const TG3FlagValue TG4G3Defaults::fgkPHOT = kActivate; // 1
32const TG3FlagValue TG4G3Defaults::fgkPFIS = kInActivate; // 0
33const TG3FlagValue TG4G3Defaults::fgkDRAY = kActivate2; // 2
34const TG3FlagValue TG4G3Defaults::fgkANNI = kActivate; // 1
35const TG3FlagValue TG4G3Defaults::fgkBREM = kActivate; // 1
36const TG3FlagValue TG4G3Defaults::fgkHADR = kActivate; // 1
37const TG3FlagValue TG4G3Defaults::fgkMUNU = kInActivate; // 0
38const TG3FlagValue TG4G3Defaults::fgkDCAY = kActivate; // 1
39const TG3FlagValue TG4G3Defaults::fgkLOSS = kActivate2; // 2
40const TG3FlagValue TG4G3Defaults::fgkMULS = kActivate; // 1
2817d3e2 41
42TG4G3Defaults::TG4G3Defaults() {
43//
44}
45
46TG4G3Defaults::~TG4G3Defaults() {
47//
48}
49
50G4double TG4G3Defaults::CutValue(G4int g3Cut)
51{
52// Returns the G3 default value for the specified cut.
53// ---
54
55 switch (g3Cut) {
56 case kCUTGAM:
4e994a92 57 return fgkCUTGAM;
2817d3e2 58 case kCUTELE:
4e994a92 59 return fgkCUTELE;
2817d3e2 60 case kCUTNEU:
4e994a92 61 return fgkCUTNEU;
2817d3e2 62 case kCUTHAD:
4e994a92 63 return fgkCUTHAD;
2817d3e2 64 case kCUTMUO:
4e994a92 65 return fgkCUTMUO;
2817d3e2 66 case kBCUTE:
4e994a92 67 return fgkBCUTE;
2817d3e2 68 case kBCUTM:
4e994a92 69 return fgkBCUTM;
2817d3e2 70 case kDCUTE:
4e994a92 71 return fgkDCUTE;
2817d3e2 72 case kDCUTM:
4e994a92 73 return fgkDCUTM;
2817d3e2 74 case kPPCUTM:
4e994a92 75 return fgkPPCUTM;
2817d3e2 76 default:
77 TG4Globals::Warning("TG4G3Defaults::CutValue: Inconsistent cut.");
78 return 0.;
79 }
80}
81
82TG3FlagValue TG4G3Defaults::FlagValue(G4int g3Flag)
83{
84// Returns the G3 default value for the specified flag.
85// ---
86
87 switch (g3Flag) {
88 case kPAIR:
4e994a92 89 return fgkPAIR;
2817d3e2 90 case kCOMP:
4e994a92 91 return fgkCOMP;
2817d3e2 92 case kPHOT:
4e994a92 93 return fgkPHOT;
2817d3e2 94 case kPFIS:
4e994a92 95 return fgkPFIS;
2817d3e2 96 case kDRAY:
4e994a92 97 return fgkDRAY;
2817d3e2 98 case kANNI:
4e994a92 99 return fgkANNI;
2817d3e2 100 case kBREM:
4e994a92 101 return fgkBREM;
2817d3e2 102 case kHADR:
4e994a92 103 return fgkHADR;
2817d3e2 104 case kMUNU:
4e994a92 105 return fgkMUNU;
2817d3e2 106 case kDCAY:
4e994a92 107 return fgkDCAY;
2817d3e2 108 case kLOSS:
4e994a92 109 return fgkLOSS;
2817d3e2 110 case kMULS:
4e994a92 111 return fgkMULS;
2817d3e2 112 default:
113 TG4Globals::Warning("TG4G3Defaults::FlagValue: Inconsistent flag.");
114 return kUnset;
115 }
116}
117
118G4bool TG4G3Defaults::IsDefaultCut(TG3Cut g3Cut, G4double value)
119{
120// Tests if the parameter value is equal to the G3 default value.
121// ---
122
c63f260d 123 if (abs(value*GeV - CutValue(g3Cut)) > fgkCutTolerance)
2817d3e2 124 return false;
125 else
126 return true;
127}
128
129G4bool TG4G3Defaults::IsDefaultFlag(TG3Flag g3Flag, G4double value)
130{
131// Tests if the parameter value is equal to the G3 default value.
132// ---
133
134 if (value == FlagValue(g3Flag))
135 return true;
136 else
137 return false;
138}