Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysicsListMessenger.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 // $Id$
31 //
32 //
33 
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
37 #include "PhysicsListMessenger.hh"
38 
39 #include "PhysicsList.hh"
41 #include "G4UIcmdWithAString.hh"
42 #include "G4UIcmdWithABool.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47  :fPhysicsList(pPhys)
48 {
49  fGammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this);
50  fGammaCutCmd->SetGuidance("Set fGamma cut.");
51  fGammaCutCmd->SetParameterName("Gcut",false);
52  fGammaCutCmd->SetUnitCategory("Length");
53  fGammaCutCmd->SetRange("Gcut>0.0");
55 
56  fElectCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this);
57  fElectCutCmd->SetGuidance("Set electron cut.");
58  fElectCutCmd->SetParameterName("Ecut",false);
59  fElectCutCmd->SetUnitCategory("Length");
60  fElectCutCmd->SetRange("Ecut>0.0");
62 
63  fProtoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this);
64  fProtoCutCmd->SetGuidance("Set positron cut.");
65  fProtoCutCmd->SetParameterName("Pcut",false);
66  fProtoCutCmd->SetUnitCategory("Length");
67  fProtoCutCmd->SetRange("Pcut>0.0");
69 
70  fAllCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this);
71  fAllCutCmd->SetGuidance("Set cut for all.");
72  fAllCutCmd->SetParameterName("cut",false);
73  fAllCutCmd->SetUnitCategory("Length");
74  fAllCutCmd->SetRange("cut>0.0");
76 
77  fECutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/VertexCuts",this);
78  fECutCmd->SetGuidance("Set cuts for the Vertex Detector");
79  fECutCmd->SetParameterName("Ecut",false);
80  fECutCmd->SetUnitCategory("Length");
81  fECutCmd->SetRange("Ecut>0.0");
83 
84  fMCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/MuonCuts",this);
85  fMCutCmd->SetGuidance("Set cuts for the Muon Detector");
86  fMCutCmd->SetParameterName("Ecut",false);
87  fMCutCmd->SetUnitCategory("Length");
88  fMCutCmd->SetRange("Ecut>0.0");
90 
91  fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
92  fListCmd->SetGuidance("Add modula physics list.");
93  fListCmd->SetParameterName("PList",false);
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
100 {
101  delete fGammaCutCmd;
102  delete fElectCutCmd;
103  delete fProtoCutCmd;
104  delete fAllCutCmd;
105  delete fListCmd;
106  delete fECutCmd;
107  delete fMCutCmd;
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111 
113  G4String newValue)
114 {
115  if( command == fGammaCutCmd )
116  { fPhysicsList->SetCutForGamma(fGammaCutCmd->GetNewDoubleValue(newValue));}
117 
118  if( command == fElectCutCmd )
119  { fPhysicsList->SetCutForElectron(fElectCutCmd->GetNewDoubleValue(newValue));}
120 
121  if( command == fProtoCutCmd )
122  { fPhysicsList->SetCutForProton(fProtoCutCmd->GetNewDoubleValue(newValue));}
123 
124  if( command == fAllCutCmd )
125  {
126  G4double cut = fAllCutCmd->GetNewDoubleValue(newValue);
127  fPhysicsList->SetCutForGamma(cut);
128  fPhysicsList->SetCutForElectron(cut);
129  fPhysicsList->SetCutForProton(cut);
130  }
131 
132  if( command == fECutCmd )
133  { fPhysicsList->SetVertexCut(fECutCmd->GetNewDoubleValue(newValue));}
134 
135  if( command == fMCutCmd )
136  { fPhysicsList->SetMuonCut(fMCutCmd->GetNewDoubleValue(newValue));}
137 
138  if( command == fListCmd )
139  { fPhysicsList->AddPhysicsList(newValue);}
140 }
141 
142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......