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 | // |
---|
28 | // |
---|
29 | // ------------------------------------------------------------- |
---|
30 | // GEANT4 hTest |
---|
31 | // |
---|
32 | // History: based on object model of |
---|
33 | // 2nd December 1995, G.Cosmo |
---|
34 | // ---------- hTestPhysicsListMessenger ------- |
---|
35 | // |
---|
36 | // Modified: 08.04.01 Vladimir Ivanchenko new design of hTest |
---|
37 | // |
---|
38 | // ------------------------------------------------------------- |
---|
39 | |
---|
40 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
41 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
42 | |
---|
43 | #include "hTestPhysicsListMessenger.hh" |
---|
44 | |
---|
45 | #include "hTestPhysicsList.hh" |
---|
46 | #include "G4UIcmdWithADoubleAndUnit.hh" |
---|
47 | #include "G4UIcmdWithAString.hh" |
---|
48 | #include "G4UIcmdWithAnInteger.hh" |
---|
49 | |
---|
50 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
51 | |
---|
52 | hTestPhysicsListMessenger::hTestPhysicsListMessenger(hTestPhysicsList* list) |
---|
53 | :hTestList(list) |
---|
54 | { |
---|
55 | cutGCmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/cutGamma",this); |
---|
56 | cutGCmd->SetGuidance("Set cut values by RANGE for Gamma"); |
---|
57 | cutGCmd->SetParameterName("cutGamma",false); |
---|
58 | cutGCmd->SetRange("cutGamma>0."); |
---|
59 | cutGCmd->SetUnitCategory("Length"); |
---|
60 | cutGCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
61 | |
---|
62 | cutECmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/cutElectron",this); |
---|
63 | cutECmd->SetGuidance("Set cut values by RANGE for e- & e+"); |
---|
64 | cutECmd->SetParameterName("cutElectron",false); |
---|
65 | cutECmd->SetRange("cutElectron>0."); |
---|
66 | cutECmd->SetUnitCategory("Length"); |
---|
67 | cutECmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
68 | |
---|
69 | cutPCmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/cutHadron",this); |
---|
70 | cutPCmd->SetGuidance("Set cut values by RANGE for proton and others"); |
---|
71 | cutPCmd->SetParameterName("cutHadron",false); |
---|
72 | cutPCmd->SetRange("cutHadron>0."); |
---|
73 | cutPCmd->SetUnitCategory("Length"); |
---|
74 | cutPCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
75 | |
---|
76 | eCmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/cutElectronEnergy",this); |
---|
77 | eCmd->SetGuidance("Set cut values by ENERGY for charged particles."); |
---|
78 | eCmd->SetParameterName("cutElectronEnergy",false); |
---|
79 | eCmd->SetRange("cutElectronEnergy>0."); |
---|
80 | eCmd->SetUnitCategory("Energy"); |
---|
81 | eCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
82 | |
---|
83 | lowLimCmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/LowLimit",this); |
---|
84 | lowLimCmd->SetGuidance("Set low enery limit for charged particles"); |
---|
85 | lowLimCmd->SetParameterName("LowLimit",false); |
---|
86 | lowLimCmd->SetRange("LowLimit>0."); |
---|
87 | lowLimCmd->SetUnitCategory("Energy"); |
---|
88 | lowLimCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
89 | |
---|
90 | highLimCmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/HighLimit",this); |
---|
91 | highLimCmd->SetGuidance("Set high energy limit for charged particles"); |
---|
92 | highLimCmd->SetParameterName("HighLimit",false); |
---|
93 | highLimCmd->SetRange("HighLimit>0."); |
---|
94 | highLimCmd->SetUnitCategory("Energy"); |
---|
95 | highLimCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
96 | |
---|
97 | setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/hTest/physics/MaxStep",this); |
---|
98 | setMaxStepCmd->SetGuidance("Set max charged particle step length"); |
---|
99 | setMaxStepCmd->SetParameterName("MaxStep",false); |
---|
100 | setMaxStepCmd->SetRange("MaxStep>0."); |
---|
101 | setMaxStepCmd->SetUnitCategory("Length"); |
---|
102 | setMaxStepCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
103 | |
---|
104 | EMPhysicsCmd = new G4UIcmdWithAString("/hTest/physics/EMList",this); |
---|
105 | EMPhysicsCmd->SetGuidance("Set the name of the EMPhysicsList"); |
---|
106 | EMPhysicsCmd->SetParameterName("EMList",false); |
---|
107 | EMPhysicsCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
108 | |
---|
109 | HadPhysicsCmd = new G4UIcmdWithAString("/hTest/physics/HadronList",this); |
---|
110 | HadPhysicsCmd->SetGuidance("Set the name of the HadPhysicsList"); |
---|
111 | HadPhysicsCmd->SetParameterName("HadronList",false); |
---|
112 | HadPhysicsCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
113 | |
---|
114 | decayCmd = new G4UIcmdWithAString("/hTest/physics/decay",this); |
---|
115 | decayCmd->SetGuidance("Set the name of the decayList"); |
---|
116 | decayCmd->SetParameterName("decay",false); |
---|
117 | decayCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
118 | |
---|
119 | verbCmd = new G4UIcmdWithAnInteger("/hTest/physics/verbose",this); |
---|
120 | verbCmd->SetGuidance("Set verbose for hTest"); |
---|
121 | verbCmd->SetParameterName("verb",false); |
---|
122 | verbCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
123 | |
---|
124 | } |
---|
125 | |
---|
126 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
127 | |
---|
128 | hTestPhysicsListMessenger::~hTestPhysicsListMessenger() |
---|
129 | { |
---|
130 | delete cutGCmd; |
---|
131 | delete cutECmd; |
---|
132 | delete cutPCmd; |
---|
133 | delete eCmd; |
---|
134 | delete lowLimCmd; |
---|
135 | delete highLimCmd; |
---|
136 | delete setMaxStepCmd; |
---|
137 | delete EMPhysicsCmd; |
---|
138 | delete HadPhysicsCmd; |
---|
139 | delete decayCmd; |
---|
140 | delete verbCmd; |
---|
141 | } |
---|
142 | |
---|
143 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
144 | |
---|
145 | void hTestPhysicsListMessenger::SetNewValue(G4UIcommand* com, G4String newValue) |
---|
146 | { |
---|
147 | if(hTestList->GetVerbose() > 1) { |
---|
148 | G4cout << "hTestPhysicsListMessenger: new value = " << newValue << G4endl; |
---|
149 | } |
---|
150 | |
---|
151 | if(com == cutGCmd) |
---|
152 | { hTestList->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));} |
---|
153 | if(com == cutECmd) |
---|
154 | { hTestList->SetElectronCut(cutECmd->GetNewDoubleValue(newValue));} |
---|
155 | if(com == cutPCmd) |
---|
156 | { hTestList->SetProtonCut(cutPCmd->GetNewDoubleValue(newValue));} |
---|
157 | if(com == eCmd) |
---|
158 | { hTestList->SetElectronCutByEnergy(eCmd->GetNewDoubleValue(newValue));} |
---|
159 | if(com == lowLimCmd) |
---|
160 | { hTestList->SetLowEnergyLimit(lowLimCmd->GetNewDoubleValue(newValue));} |
---|
161 | if(com == highLimCmd) |
---|
162 | { hTestList->SetHighEnergyLimit(highLimCmd->GetNewDoubleValue(newValue));} |
---|
163 | if(com == setMaxStepCmd) |
---|
164 | { hTestList->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));} |
---|
165 | if(com == EMPhysicsCmd) |
---|
166 | { hTestList->SetEMPhysicsList(newValue);} |
---|
167 | if(com == HadPhysicsCmd) |
---|
168 | { hTestList->SetHadronPhysicsList(newValue);} |
---|
169 | if(com == decayCmd) |
---|
170 | { hTestList->SetDecay(newValue);} |
---|
171 | if( com == verbCmd ) |
---|
172 | { hTestList->SetVerbose(verbCmd->GetNewIntValue(newValue));} |
---|
173 | } |
---|
174 | |
---|
175 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
176 | |
---|