Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F04PhysicsListMessenger.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: F04PhysicsListMessenger.cc 68021 2013-03-13 13:36:07Z gcosmo $
27 //
30 //
31 
32 #include "globals.hh"
33 
35 #include "F04PhysicsList.hh"
36 
37 #include <G4UIdirectory.hh>
38 #include <G4UIcmdWithAString.hh>
41 
42 #include "G4ParticleTable.hh"
43 #include "G4ParticleDefinition.hh"
44 
45 #include "G4DecayTable.hh"
46 #include "G4VDecayChannel.hh"
47 
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
54  : fPhysicsList(pPhys)
55 {
56  fDirectory = new G4UIdirectory("/exp/phys/");
57  fDirectory->SetGuidance("Control the physics lists");
58 
59  fGammaCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/gammaCut",this);
60  fGammaCutCMD->SetGuidance("Set gamma cut");
61  fGammaCutCMD->SetParameterName("Gcut",false);
62  fGammaCutCMD->SetUnitCategory("Length");
63  fGammaCutCMD->SetRange("Gcut>0.0");
64  fGammaCutCMD->SetDefaultUnit("mm");
66 
67  fElectCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/electronCut",
68  this);
69  fElectCutCMD->SetGuidance("Set electron cut");
70  fElectCutCMD->SetParameterName("Ecut",false);
71  fElectCutCMD->SetUnitCategory("Length");
72  fElectCutCMD->SetRange("Ecut>0.0");
73  fElectCutCMD->SetDefaultUnit("mm");
75 
76  fPosCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/positronCut",
77  this);
78  fPosCutCMD->SetGuidance("Set positron cut");
79  fPosCutCMD->SetParameterName("Pcut",false);
80  fPosCutCMD->SetUnitCategory("Length");
81  fPosCutCMD->SetRange("Pcut>0.0");
82  fPosCutCMD->SetDefaultUnit("mm");
84 
85  fAllCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/allCuts",this);
86  fAllCutCMD->SetGuidance("Set cut for all");
87  fAllCutCMD->SetParameterName("cut",false);
88  fAllCutCMD->SetUnitCategory("Length");
89  fAllCutCMD->SetRange("cut>0.0");
90  fAllCutCMD->SetDefaultUnit("mm");
92 
93  fStepMaxCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/stepMax",this);
94  fStepMaxCMD->SetGuidance("Set max. step length in the detector");
95  fStepMaxCMD->SetParameterName("mxStep",false);
96  fStepMaxCMD->SetUnitCategory("Length");
97  fStepMaxCMD->SetRange("mxStep>0.0");
98  fStepMaxCMD->SetDefaultUnit("mm");
100 /*
101  fClearPhysicsCMD = new G4UIcmdWithoutParameter("/exp/phys/clearPhysics",
102  this);
103  fClearPhysicsCMD->SetGuidance("Clear the physics list");
104  fClearPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
105 
106  fRemovePhysicsCMD = new G4UIcmdWithAString("/exp/phys/removePhysics",this);
107  fRemovePhysicsCMD->
108  SetGuidance("Remove a physics process from Physics List");
109  fRemovePhysicsCMD->SetParameterName("PList",false);
110  fRemovePhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
111 */
112  fDecayDirectory = new G4UIdirectory("/decay/");
113  fDecayDirectory->SetGuidance("Decay chain control commands.");
114 
115  fPienuCMD = new G4UIcmdWithoutParameter("/decay/pienu", this);
116  fPienuCMD->SetGuidance("Sets the pi+ to decay into e+, nu");
117 
118  fPimunuCMD = new G4UIcmdWithoutParameter("/decay/pimunu", this);
119  fPimunuCMD->SetGuidance("Sets the pi+ to decay into mu+, nu");
120 
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 {
127  delete fGammaCutCMD;
128  delete fElectCutCMD;
129  delete fPosCutCMD;
130  delete fAllCutCMD;
131 /*
132  delete fClearPhysicsCMD;
133  delete fRemovePhysicsCMD;
134 */
135  delete fPienuCMD;
136  delete fPimunuCMD;
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
142  G4String newValue)
143 {
145 
146  if (command == fPienuCMD) {
147  G4ParticleDefinition* fParticleDef = fParticleTable->FindParticle("pi+");
148  G4VDecayChannel* fMode =
149  new G4PhaseSpaceDecayChannel("pi+",0.999983,2,"e+","nu_e");
150  G4DecayTable* fTable = new G4DecayTable();
151  fTable->Insert(fMode);
152  fMode = new G4PionRadiativeDecayChannel("pi+",0.000017);
153  fTable->Insert(fMode);
154  fParticleDef->SetDecayTable(fTable);
155  }
156 
157  if (command == fPimunuCMD) {
158  G4ParticleDefinition* fParticleDef = fParticleTable->FindParticle("pi+");
159  G4VDecayChannel* fMode =
160  new G4PhaseSpaceDecayChannel("pi+",1.000,2,"mu+","nu_mu");
161  G4DecayTable* fTable = new G4DecayTable();
162  fTable->Insert(fMode);
163  fParticleDef->SetDecayTable(fTable);
164  }
165 
166  if (command == fGammaCutCMD) {
167  fPhysicsList->SetCutForGamma(fGammaCutCMD
168  ->GetNewDoubleValue(newValue));
169  }
170  else if (command == fElectCutCMD) {
171  fPhysicsList->SetCutForElectron(fElectCutCMD
172  ->GetNewDoubleValue(newValue));
173  }
174  else if (command == fPosCutCMD) {
175  fPhysicsList->SetCutForPositron(fPosCutCMD
176  ->GetNewDoubleValue(newValue));
177  }
178  else if (command == fAllCutCMD) {
179  G4double cut = fAllCutCMD->GetNewDoubleValue(newValue);
180  fPhysicsList->SetCutForGamma(cut);
181  fPhysicsList->SetCutForElectron(cut);
182  fPhysicsList->SetCutForPositron(cut);
183  }
184  else if (command == fStepMaxCMD) {
185  fPhysicsList->SetStepMax(fStepMaxCMD
186  ->GetNewDoubleValue(newValue));
187  }
188 /* else if (command == fClearPhysicsCMD) {
189  fPhysicsList->ClearPhysics();
190  }
191  else if (command == fRemovePhysicsCMD) {
192  G4String name = newValue;
193  fPhysicsList->RemoveFromPhysicsList(name);
194  }
195 */
196 }
void SetDecayTable(G4DecayTable *aDecayTable)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
F04PhysicsListMessenger(F04PhysicsList *)
virtual void SetNewValue(G4UIcommand *, G4String)
Definition of the F04PhysicsListMessenger class.
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetCutForGamma(G4double)
void SetCutForElectron(G4double)
void SetCutForPositron(G4double)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetStepMax(G4double)
Definition of the F04PhysicsList class.
void Insert(G4VDecayChannel *aChannel)
Definition: G4DecayTable.cc:60
static G4ParticleTable * GetParticleTable()
void SetDefaultUnit(const char *defUnit)
double G4double
Definition: G4Types.hh:76
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)