Geant4  10.00.p01
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 //
26 // $Id: exrdmPhysicsListMessenger.cc 68030 2013-03-13 13:51:27Z gcosmo $
27 //
30 //
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
35 
36 #include "exrdmPhysicsList.hh"
37 #include "G4UIdirectory.hh"
39 #include "G4UIcmdWithAString.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44 :G4UImessenger(),
45  fPPhysicsList(pPhys),
46  fPhysDir(0),
47  fGammaCutCmd(0),
48  fElectCutCmd(0),
49  fProtoCutCmd(0),
50  fAllCutCmd(0),
51  fMCutCmd(0),
52  fECutCmd(0),
53  fPListCmd(0)
54 {
55  fPhysDir = new G4UIdirectory("/exrdm/phys/");
56  fPhysDir->SetGuidance("physics control.");
57 
58  fGammaCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setGCut",this);
59  fGammaCutCmd->SetGuidance("Set gamma cut.");
60  fGammaCutCmd->SetParameterName("Gcut",false);
61  fGammaCutCmd->SetUnitCategory("Length");
62  fGammaCutCmd->SetRange("Gcut>0.0");
64 
65  fElectCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setECut",this);
66  fElectCutCmd->SetGuidance("Set electron cut.");
67  fElectCutCmd->SetParameterName("Ecut",false);
68  fElectCutCmd->SetUnitCategory("Length");
69  fElectCutCmd->SetRange("Ecut>0.0");
71 
72  fProtoCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setPCut",this);
73  fProtoCutCmd->SetGuidance("Set positron cut.");
74  fProtoCutCmd->SetParameterName("Pcut",false);
75  fProtoCutCmd->SetUnitCategory("Length");
76  fProtoCutCmd->SetRange("Pcut>0.0");
78 
79  fAllCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setCuts",this);
80  fAllCutCmd->SetGuidance("Set cut for all.");
81  fAllCutCmd->SetParameterName("cut",false);
82  fAllCutCmd->SetUnitCategory("Length");
83  fAllCutCmd->SetRange("cut>0.0");
85 
86  fECutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/TargetCuts",this);
87  fECutCmd->SetGuidance("Set cuts for the target");
88  fECutCmd->SetParameterName("Ecut",false);
89  fECutCmd->SetUnitCategory("Length");
90  fECutCmd->SetRange("Ecut>0.0");
92 
93  fMCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/DetectorCuts",this);
94  fMCutCmd->SetGuidance("Set cuts for the Detector");
95  fMCutCmd->SetParameterName("Ecut",false);
96  fMCutCmd->SetUnitCategory("Length");
97  fMCutCmd->SetRange("Ecut>0.0");
99 
100  fPListCmd = new G4UIcmdWithAString("/exrdm/phys/SelectPhysics",this);
101  fPListCmd->SetGuidance("Select modula physics list.");
102  fPListCmd->SetParameterName("PList",false);
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
109 {
110  delete fPhysDir;
111  delete fGammaCutCmd;
112  delete fElectCutCmd;
113  delete fProtoCutCmd;
114  delete fAllCutCmd;
115  delete fPListCmd;
116  delete fECutCmd;
117  delete fMCutCmd;
118 }
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
123  G4String newValue)
124 {
125  if( command == fGammaCutCmd )
127 
128  if( command == fElectCutCmd )
130 
131  if( command == fProtoCutCmd )
133 
134  if( command == fAllCutCmd )
135  {
136  G4double cut = fAllCutCmd->GetNewDoubleValue(newValue);
140  }
141 
142  if( command == fECutCmd )
144 
145  if( command == fMCutCmd )
147 
148  if( command == fPListCmd )
149  { fPPhysicsList->SelectPhysicsList(newValue);}
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * fECutCmd
G4UIcmdWithADoubleAndUnit * fElectCutCmd
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetTargetCut(G4double val)
void SetCutForElectron(G4double)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
Definition of the exrdmPhysicsListMessenger class.
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDetectorCut(G4double val)
exrdmPhysicsListMessenger(exrdmPhysicsList *)
void SetCutForGamma(G4double)
G4UIcmdWithADoubleAndUnit * fGammaCutCmd
Definition of the exrdmPhysicsList class.
void SetCutForPositron(G4double)
G4UIcmdWithADoubleAndUnit * fProtoCutCmd
double G4double
Definition: G4Types.hh:76
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * fAllCutCmd
void SelectPhysicsList(const G4String &name)
virtual void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithADoubleAndUnit * fMCutCmd