source: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysicsListMessenger.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 5.6 KB
Line 
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//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
28
29#include "exrdmPhysicsListMessenger.hh"
30
31#include "exrdmPhysicsList.hh"
32#include "G4UIdirectory.hh"
33#include "G4UIcmdWithADoubleAndUnit.hh"
34#include "G4UIcmdWithAString.hh"
35
36//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37
38exrdmPhysicsListMessenger::exrdmPhysicsListMessenger(exrdmPhysicsList* pPhys)
39:pPhysicsList(pPhys)
40{
41 physDir = new G4UIdirectory("/exrdm/phys/");
42 physDir->SetGuidance("physics control.");
43
44 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setGCut",this);
45 gammaCutCmd->SetGuidance("Set gamma cut.");
46 gammaCutCmd->SetParameterName("Gcut",false);
47 gammaCutCmd->SetUnitCategory("Length");
48 gammaCutCmd->SetRange("Gcut>0.0");
49 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
50
51 electCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setECut",this);
52 electCutCmd->SetGuidance("Set electron cut.");
53 electCutCmd->SetParameterName("Ecut",false);
54 electCutCmd->SetUnitCategory("Length");
55 electCutCmd->SetRange("Ecut>0.0");
56 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
57
58 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setPCut",this);
59 protoCutCmd->SetGuidance("Set positron cut.");
60 protoCutCmd->SetParameterName("Pcut",false);
61 protoCutCmd->SetUnitCategory("Length");
62 protoCutCmd->SetRange("Pcut>0.0");
63 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
64
65 allCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setCuts",this);
66 allCutCmd->SetGuidance("Set cut for all.");
67 allCutCmd->SetParameterName("cut",false);
68 allCutCmd->SetUnitCategory("Length");
69 allCutCmd->SetRange("cut>0.0");
70 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
71
72 eCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/TargetCuts",this);
73 eCutCmd->SetGuidance("Set cuts for the target");
74 eCutCmd->SetParameterName("Ecut",false);
75 eCutCmd->SetUnitCategory("Length");
76 eCutCmd->SetRange("Ecut>0.0");
77 eCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
78
79 mCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/DetectorCuts",this);
80 mCutCmd->SetGuidance("Set cuts for the Detector");
81 mCutCmd->SetParameterName("Ecut",false);
82 mCutCmd->SetUnitCategory("Length");
83 mCutCmd->SetRange("Ecut>0.0");
84 mCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
85
86 pListCmd = new G4UIcmdWithAString("/exrdm/phys/SelectPhysics",this);
87 pListCmd->SetGuidance("Select modula physics list.");
88 pListCmd->SetParameterName("PList",false);
89 pListCmd->AvailableForStates(G4State_PreInit);
90}
91
92//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93
94exrdmPhysicsListMessenger::~exrdmPhysicsListMessenger()
95{
96 delete physDir;
97 delete gammaCutCmd;
98 delete electCutCmd;
99 delete protoCutCmd;
100 delete allCutCmd;
101 delete pListCmd;
102 delete eCutCmd;
103 delete mCutCmd;
104}
105
106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
108void exrdmPhysicsListMessenger::SetNewValue(G4UIcommand* command,
109 G4String newValue)
110{
111 if( command == gammaCutCmd )
112 { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
113
114 if( command == electCutCmd )
115 { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
116
117 if( command == protoCutCmd )
118 { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
119
120 if( command == allCutCmd )
121 {
122 G4double cut = allCutCmd->GetNewDoubleValue(newValue);
123 pPhysicsList->SetCutForGamma(cut);
124 pPhysicsList->SetCutForElectron(cut);
125 pPhysicsList->SetCutForPositron(cut);
126 }
127
128 if( command == eCutCmd )
129 { pPhysicsList->SetTargetCut(eCutCmd->GetNewDoubleValue(newValue));}
130
131 if( command == mCutCmd )
132 { pPhysicsList->SetDetectorCut(mCutCmd->GetNewDoubleValue(newValue));}
133
134 if( command == pListCmd )
135 { pPhysicsList->SelectPhysicsList(newValue);}
136}
137
138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.