1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: XrayFluoPhysicsListMessenger.cc |
---|
28 | // GEANT4 tag $Name: xray_fluo-V03-02-00 |
---|
29 | // |
---|
30 | // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) |
---|
31 | // |
---|
32 | // History: |
---|
33 | // ----------- |
---|
34 | // 28 Nov 2001 Elena Guardincerri Created |
---|
35 | // |
---|
36 | // ------------------------------------------------------------------- |
---|
37 | |
---|
38 | #include "XrayFluoPhysicsListMessenger.hh" |
---|
39 | #include "XrayFluoPhysicsList.hh" |
---|
40 | |
---|
41 | #include "G4UIdirectory.hh" |
---|
42 | #include "G4UIcmdWithoutParameter.hh" |
---|
43 | #include "G4UIcmdWithADouble.hh" |
---|
44 | #include "G4UIcmdWithADoubleAndUnit.hh" |
---|
45 | |
---|
46 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
47 | |
---|
48 | XrayFluoPhysicsListMessenger::XrayFluoPhysicsListMessenger(XrayFluoPhysicsList * List) |
---|
49 | :XrayFluoList(List) |
---|
50 | { |
---|
51 | |
---|
52 | lowEnDir = new G4UIdirectory("/lowenergy/"); |
---|
53 | lowEnDir->SetGuidance("LowEnergy commands"); |
---|
54 | |
---|
55 | cutGLowLimCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/lowlimG",this); |
---|
56 | cutGLowLimCmd->SetGuidance("Set ENERGY low limit for Gamma."); |
---|
57 | cutGLowLimCmd->SetParameterName("energy",true); |
---|
58 | cutGLowLimCmd->SetDefaultValue(1e-3); |
---|
59 | cutGLowLimCmd->SetDefaultUnit("MeV"); |
---|
60 | cutGLowLimCmd->AvailableForStates(G4State_Idle); |
---|
61 | |
---|
62 | cutELowLimCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/lowlimE",this); |
---|
63 | cutELowLimCmd->SetGuidance("Set ENERGY low limit for e-."); |
---|
64 | cutELowLimCmd->SetParameterName("energy",true); |
---|
65 | cutELowLimCmd->SetDefaultValue(1e-3); |
---|
66 | cutELowLimCmd->SetDefaultUnit("MeV"); |
---|
67 | cutELowLimCmd->AvailableForStates(G4State_Idle); |
---|
68 | |
---|
69 | cutGELowLimCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/lowlimGE",this); |
---|
70 | cutGELowLimCmd->SetGuidance("Set ENERGY low limit for e- and Gamma."); |
---|
71 | cutGELowLimCmd->SetParameterName("energy",true); |
---|
72 | cutGELowLimCmd->SetDefaultValue(1e-3); |
---|
73 | cutGELowLimCmd->SetDefaultUnit("MeV"); |
---|
74 | cutGELowLimCmd->AvailableForStates(G4State_Idle); |
---|
75 | |
---|
76 | cutSecPhotCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/secphotcut",this); |
---|
77 | cutSecPhotCmd->SetGuidance("Set production threshold for secondary Gamma."); |
---|
78 | cutSecPhotCmd->SetParameterName("energy",true); |
---|
79 | cutSecPhotCmd->SetDefaultValue(5e-5); |
---|
80 | cutSecPhotCmd->SetDefaultUnit("MeV"); |
---|
81 | cutSecPhotCmd->AvailableForStates(G4State_Idle); |
---|
82 | |
---|
83 | cutSecElecCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/seceleccut",this); |
---|
84 | cutSecElecCmd->SetGuidance("Set production threshold for secondary e-"); |
---|
85 | cutSecElecCmd->SetParameterName("energy",true); |
---|
86 | cutSecElecCmd->SetDefaultValue(5e-5); |
---|
87 | cutSecElecCmd->SetDefaultUnit("MeV"); |
---|
88 | cutSecElecCmd->AvailableForStates(G4State_Idle); |
---|
89 | |
---|
90 | cutGCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutG",this); |
---|
91 | cutGCmd->SetGuidance("Set cut values by RANGE for Gamma."); |
---|
92 | cutGCmd->SetParameterName("range",true); |
---|
93 | cutGCmd->SetDefaultValue(1.); |
---|
94 | cutGCmd->SetDefaultUnit("mm"); |
---|
95 | cutGCmd->AvailableForStates(G4State_Idle); |
---|
96 | |
---|
97 | cutECmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutE",this); |
---|
98 | cutECmd->SetGuidance("Set cut values by RANGE for e-."); |
---|
99 | cutECmd->SetParameterName("range",true); |
---|
100 | cutECmd->SetDefaultValue(1.); |
---|
101 | cutECmd->SetDefaultUnit("mm"); |
---|
102 | cutECmd->AvailableForStates(G4State_Idle); |
---|
103 | |
---|
104 | cutPCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutP",this); |
---|
105 | cutPCmd->SetGuidance("Set cut values by RANGE for proton and others."); |
---|
106 | cutPCmd->SetParameterName("cutP",false); |
---|
107 | cutPCmd->SetRange("cutP>0."); |
---|
108 | cutPCmd->SetUnitCategory("Length"); |
---|
109 | cutPCmd->AvailableForStates(G4State_Idle); |
---|
110 | |
---|
111 | eCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutEnergy",this); |
---|
112 | eCmd->SetGuidance("Set cut values by ENERGY for all particles."); |
---|
113 | eCmd->SetParameterName("cutenergy",false); |
---|
114 | eCmd->SetRange("cutenergy>0."); |
---|
115 | eCmd->SetUnitCategory("Energy"); |
---|
116 | eCmd->AvailableForStates(G4State_Idle); |
---|
117 | |
---|
118 | } |
---|
119 | |
---|
120 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
121 | |
---|
122 | XrayFluoPhysicsListMessenger::~XrayFluoPhysicsListMessenger() |
---|
123 | { |
---|
124 | |
---|
125 | delete cutGLowLimCmd; |
---|
126 | delete cutELowLimCmd; |
---|
127 | delete cutGELowLimCmd; |
---|
128 | delete cutSecElecCmd; |
---|
129 | delete cutSecPhotCmd; |
---|
130 | delete cutGCmd; |
---|
131 | delete cutECmd; |
---|
132 | delete cutPCmd; |
---|
133 | delete eCmd; |
---|
134 | |
---|
135 | } |
---|
136 | |
---|
137 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
138 | |
---|
139 | void XrayFluoPhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue) |
---|
140 | { |
---|
141 | if(command == cutGLowLimCmd) |
---|
142 | { XrayFluoList->SetGammaLowLimit(cutGLowLimCmd->GetNewDoubleValue(newValue));} |
---|
143 | |
---|
144 | if(command == cutELowLimCmd) |
---|
145 | { XrayFluoList->SetElectronLowLimit(cutELowLimCmd->GetNewDoubleValue(newValue));} |
---|
146 | |
---|
147 | if(command == cutGELowLimCmd) |
---|
148 | { XrayFluoList->SetGELowLimit(cutGELowLimCmd->GetNewDoubleValue(newValue));} |
---|
149 | |
---|
150 | if(command == cutSecPhotCmd) |
---|
151 | { XrayFluoList->SetLowEnSecPhotCut(cutSecPhotCmd->GetNewDoubleValue(newValue));} |
---|
152 | |
---|
153 | if(command == cutSecElecCmd) |
---|
154 | { XrayFluoList->SetLowEnSecElecCut(cutSecElecCmd->GetNewDoubleValue(newValue));} |
---|
155 | |
---|
156 | if(command == cutGCmd) |
---|
157 | { XrayFluoList->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));} |
---|
158 | |
---|
159 | if(command == cutECmd) |
---|
160 | { XrayFluoList->SetElectronCut(cutECmd->GetNewDoubleValue(newValue));} |
---|
161 | |
---|
162 | if(command == cutPCmd) |
---|
163 | { XrayFluoList->SetProtonCut(cutPCmd->GetNewDoubleValue(newValue));} |
---|
164 | |
---|
165 | if(command == eCmd) |
---|
166 | { XrayFluoList->SetCutsByEnergy(eCmd->GetNewDoubleValue(newValue));} |
---|
167 | |
---|
168 | } |
---|
169 | |
---|
170 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
171 | |
---|
172 | |
---|
173 | |
---|
174 | |
---|
175 | |
---|
176 | |
---|