Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exrdmPhysicsListMessenger.cc
Go to the documentation of this file.
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 //
28 //
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
33 
34 #include "exrdmPhysicsList.hh"
35 #include "G4UIdirectory.hh"
37 #include "G4UIcmdWithAString.hh"
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 
42 :fPPhysicsList(pPhys)
43 {
44  fPhysDir = new G4UIdirectory("/exrdm/phys/");
45  fPhysDir->SetGuidance("physics control.");
46 
47  fGammaCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setGCut",this);
48  fGammaCutCmd->SetGuidance("Set gamma cut.");
49  fGammaCutCmd->SetParameterName("Gcut",false);
50  fGammaCutCmd->SetUnitCategory("Length");
51  fGammaCutCmd->SetRange("Gcut>0.0");
53 
54  fElectCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setECut",this);
55  fElectCutCmd->SetGuidance("Set electron cut.");
56  fElectCutCmd->SetParameterName("Ecut",false);
57  fElectCutCmd->SetUnitCategory("Length");
58  fElectCutCmd->SetRange("Ecut>0.0");
60 
61  fProtoCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setPCut",this);
62  fProtoCutCmd->SetGuidance("Set positron cut.");
63  fProtoCutCmd->SetParameterName("Pcut",false);
64  fProtoCutCmd->SetUnitCategory("Length");
65  fProtoCutCmd->SetRange("Pcut>0.0");
67 
68  fAllCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setCuts",this);
69  fAllCutCmd->SetGuidance("Set cut for all.");
70  fAllCutCmd->SetParameterName("cut",false);
71  fAllCutCmd->SetUnitCategory("Length");
72  fAllCutCmd->SetRange("cut>0.0");
74 
75  fECutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/TargetCuts",this);
76  fECutCmd->SetGuidance("Set cuts for the target");
77  fECutCmd->SetParameterName("Ecut",false);
78  fECutCmd->SetUnitCategory("Length");
79  fECutCmd->SetRange("Ecut>0.0");
81 
82  fMCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/DetectorCuts",this);
83  fMCutCmd->SetGuidance("Set cuts for the Detector");
84  fMCutCmd->SetParameterName("Ecut",false);
85  fMCutCmd->SetUnitCategory("Length");
86  fMCutCmd->SetRange("Ecut>0.0");
88 
89  fPListCmd = new G4UIcmdWithAString("/exrdm/phys/SelectPhysics",this);
90  fPListCmd->SetGuidance("Select modula physics list.");
91  fPListCmd->SetParameterName("PList",false);
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  delete fPhysDir;
100  delete fGammaCutCmd;
101  delete fElectCutCmd;
102  delete fProtoCutCmd;
103  delete fAllCutCmd;
104  delete fPListCmd;
105  delete fECutCmd;
106  delete fMCutCmd;
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112  G4String newValue)
113 {
114  if( command == fGammaCutCmd )
115  { fPPhysicsList->SetCutForGamma(fGammaCutCmd->GetNewDoubleValue(newValue));}
116 
117  if( command == fElectCutCmd )
118  { fPPhysicsList->SetCutForElectron(fElectCutCmd->GetNewDoubleValue(newValue));}
119 
120  if( command == fProtoCutCmd )
121  { fPPhysicsList->SetCutForPositron(fProtoCutCmd->GetNewDoubleValue(newValue));}
122 
123  if( command == fAllCutCmd )
124  {
125  G4double cut = fAllCutCmd->GetNewDoubleValue(newValue);
126  fPPhysicsList->SetCutForGamma(cut);
127  fPPhysicsList->SetCutForElectron(cut);
128  fPPhysicsList->SetCutForPositron(cut);
129  }
130 
131  if( command == fECutCmd )
132  { fPPhysicsList->SetTargetCut(fECutCmd->GetNewDoubleValue(newValue));}
133 
134  if( command == fMCutCmd )
135  { fPPhysicsList->SetDetectorCut(fMCutCmd->GetNewDoubleValue(newValue));}
136 
137  if( command == fPListCmd )
138  { fPPhysicsList->SelectPhysicsList(newValue);}
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......