New pictures for TPC
[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
14const G4double TG4G3Defaults::fgCutTolerance = 1. * keV;
15
16// kinetic energy cuts
17const G4double TG4G3Defaults::fgCUTGAM = 0.001 * GeV;
18const G4double TG4G3Defaults::fgCUTELE = 0.001 * GeV;
19const G4double TG4G3Defaults::fgCUTNEU = 0.01 * GeV;
20const G4double TG4G3Defaults::fgCUTHAD = 0.01 * GeV;
21const G4double TG4G3Defaults::fgCUTMUO = 0.01 * GeV;
22const G4double TG4G3Defaults::fgBCUTE = fgCUTGAM;
23const G4double TG4G3Defaults::fgBCUTM = fgCUTGAM;
24const G4double TG4G3Defaults::fgDCUTE = 10. * TeV;
25const G4double TG4G3Defaults::fgDCUTM = 10. * TeV;
26const G4double TG4G3Defaults::fgPPCUTM = 0.01 * GeV;
27
28// physics processes
29const TG3FlagValue TG4G3Defaults::fgPAIR = kActivate; // 1
30const TG3FlagValue TG4G3Defaults::fgCOMP = kActivate; // 1
31const TG3FlagValue TG4G3Defaults::fgPHOT = kActivate; // 1
32const TG3FlagValue TG4G3Defaults::fgPFIS = kInActivate; // 0
33const TG3FlagValue TG4G3Defaults::fgDRAY = kActivate2; // 2
34const TG3FlagValue TG4G3Defaults::fgANNI = kActivate; // 1
35const TG3FlagValue TG4G3Defaults::fgBREM = kActivate; // 1
36const TG3FlagValue TG4G3Defaults::fgHADR = kActivate; // 1
37const TG3FlagValue TG4G3Defaults::fgMUNU = kInActivate; // 0
38const TG3FlagValue TG4G3Defaults::fgDCAY = kActivate; // 1
39const TG3FlagValue TG4G3Defaults::fgLOSS = kActivate2; // 2
40const TG3FlagValue TG4G3Defaults::fgMULS = kActivate; // 1
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:
57 return fgCUTGAM; break;
58 case kCUTELE:
59 return fgCUTELE; break;
60 case kCUTNEU:
61 return fgCUTNEU; break;
62 case kCUTHAD:
63 return fgCUTHAD; break;
64 case kCUTMUO:
65 return fgCUTMUO; break;
66 case kBCUTE:
67 return fgBCUTE; break;
68 case kBCUTM:
69 return fgBCUTM; break;
70 case kDCUTE:
71 return fgDCUTE; break;
72 case kDCUTM:
73 return fgDCUTM; break;
74 case kPPCUTM:
75 return fgPPCUTM; break;
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:
89 return fgPAIR; break;
90 case kCOMP:
91 return fgCOMP; break;
92 case kPHOT:
93 return fgPHOT; break;
94 case kPFIS:
95 return fgPFIS; break;
96 case kDRAY:
97 return fgDRAY; break;
98 case kANNI:
99 return fgANNI; break;
100 case kBREM:
101 return fgBREM; break;
102 case kHADR:
103 return fgHADR; break;
104 case kMUNU:
105 return fgMUNU; break;
106 case kDCAY:
107 return fgDCAY; break;
108 case kLOSS:
109 return fgLOSS; break;
110 case kMULS:
111 return fgMULS; break;
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
123 if (abs(value*GeV - CutValue(g3Cut)) > fgCutTolerance)
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}