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: F03PhysicsListMessenger.cc,v 1.3 2006/06/29 18:30:17 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: HEAD $ |
---|
29 | // |
---|
30 | // |
---|
31 | |
---|
32 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
33 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
34 | |
---|
35 | #include "F03PhysicsListMessenger.hh" |
---|
36 | |
---|
37 | #include "F03PhysicsList.hh" |
---|
38 | #include "G4UIcmdWithoutParameter.hh" |
---|
39 | #include "G4UIcmdWithADouble.hh" |
---|
40 | #include "G4UIcmdWithADoubleAndUnit.hh" |
---|
41 | |
---|
42 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
43 | |
---|
44 | F03PhysicsListMessenger::F03PhysicsListMessenger(F03PhysicsList * List) |
---|
45 | :F03List(List) |
---|
46 | { |
---|
47 | cutGCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutG",this); |
---|
48 | cutGCmd->SetGuidance("Set cut values by RANGE for Gamma."); |
---|
49 | cutGCmd->SetParameterName("range",true); |
---|
50 | cutGCmd->SetDefaultValue(1.); |
---|
51 | cutGCmd->SetDefaultUnit("mm"); |
---|
52 | cutGCmd->AvailableForStates(G4State_Idle); |
---|
53 | |
---|
54 | cutECmd = new G4UIcmdWithADoubleAndUnit("/calor/cutE",this); |
---|
55 | cutECmd->SetGuidance("Set cut values by RANGE for e- e+."); |
---|
56 | cutECmd->SetParameterName("range",true); |
---|
57 | cutECmd->SetDefaultValue(1.); |
---|
58 | cutECmd->SetDefaultUnit("mm"); |
---|
59 | cutECmd->AvailableForStates(G4State_Idle); |
---|
60 | |
---|
61 | cutPCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutP",this); |
---|
62 | cutPCmd->SetGuidance("Set cut values by RANGE for proton and others."); |
---|
63 | cutPCmd->SetParameterName("range",true); |
---|
64 | cutPCmd->SetDefaultValue(1.); |
---|
65 | cutPCmd->SetDefaultUnit("mm"); |
---|
66 | cutPCmd->AvailableForStates(G4State_Idle); |
---|
67 | |
---|
68 | eCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutEnergy",this); |
---|
69 | eCmd->SetGuidance("Set cut values by ENERGY for charged particles."); |
---|
70 | eCmd->SetParameterName("energy",true); |
---|
71 | eCmd->SetDefaultValue(10.); |
---|
72 | eCmd->SetDefaultUnit("keV"); |
---|
73 | eCmd->AvailableForStates(G4State_Idle); |
---|
74 | |
---|
75 | rCmd = new G4UIcmdWithADoubleAndUnit("/calor/range",this); |
---|
76 | rCmd->SetGuidance("Display the RANGE of Electron for the current material."); |
---|
77 | rCmd->SetParameterName("energy",true); |
---|
78 | rCmd->SetDefaultValue(10.); |
---|
79 | rCmd->SetDefaultUnit("keV"); |
---|
80 | rCmd->AvailableForStates(G4State_Idle); |
---|
81 | |
---|
82 | setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/step/setMaxStep",this); |
---|
83 | setMaxStepCmd->SetGuidance("Set max. step length in the detector"); |
---|
84 | setMaxStepCmd->SetParameterName("mxStep",true); |
---|
85 | setMaxStepCmd->SetDefaultUnit("mm"); |
---|
86 | |
---|
87 | } |
---|
88 | |
---|
89 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
90 | |
---|
91 | F03PhysicsListMessenger::~F03PhysicsListMessenger() |
---|
92 | { |
---|
93 | |
---|
94 | delete setMaxStepCmd; |
---|
95 | |
---|
96 | delete cutGCmd; |
---|
97 | delete cutECmd; |
---|
98 | delete cutPCmd; |
---|
99 | delete rCmd; |
---|
100 | delete eCmd; |
---|
101 | |
---|
102 | } |
---|
103 | |
---|
104 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
105 | |
---|
106 | void F03PhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue) |
---|
107 | { |
---|
108 | if(command == cutGCmd) |
---|
109 | { F03List->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));} |
---|
110 | if(command == cutECmd) |
---|
111 | { F03List->SetElectronCut(eCmd->GetNewDoubleValue(newValue));} |
---|
112 | if(command == cutPCmd) |
---|
113 | { F03List->SetProtonCut(eCmd->GetNewDoubleValue(newValue));} |
---|
114 | if(command == eCmd) |
---|
115 | { F03List->SetCutsByEnergy(cutECmd->GetNewDoubleValue(newValue));} |
---|
116 | if(command == rCmd) |
---|
117 | { F03List->GetRange(rCmd->GetNewDoubleValue(newValue));} |
---|
118 | if(command == setMaxStepCmd) |
---|
119 | { F03List->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));} |
---|
120 | } |
---|
121 | |
---|
122 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
123 | |
---|