Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4AdjointPhysicsMessenger.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 // $Id$
30 //
32 // Class Name: G4AdjointPhysicsMessenger
33 // Author: L. Desorgher
34 // Organisation: SpaceIT GmbH
35 // Contract: ESA contract 21435/08/NL/AT
36 // Customer: ESA/ESTEC
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
43 #include "G4UIdirectory.hh"
44 #include "G4UIcmdWithABool.hh"
45 #include "G4UIcmdWithAnInteger.hh"
47 #include "G4UIcmdWithADouble.hh"
49 #include "G4UIcmdWithAString.hh"
50 #include "G4UnitsTable.hh"
51 #include "G4AdjointPhysicsList.hh"
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
57  G4AdjointPhysicsList* pPhysicsList)
58 :fPhysicsList(pPhysicsList)
59 {
60  fPhysicsDir = new G4UIdirectory("/adjoint_physics/");
61 
62  fPhysicsDir->SetGuidance("Definition of physics processes to be used in the adjoint and forward simulation mode");
63 
64  //Physics
65  //-------
66  fUsepIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseProtonIonisation",this);
67  fUsepIonisationCmd->SetGuidance("If true (false) the proton ionisation is (not) considered for adjoint and forward simulations");
68  fUsepIonisationCmd->AvailableForStates(G4State_PreInit);
69 
70  fUseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung",this);
71  fUseBremCmd->SetGuidance("If true (false) the bremsstrahlung process is (not) considered for adjoint and forward simulations");
72  fUseBremCmd->AvailableForStates(G4State_PreInit);
73 
74  fUseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton",this);
75  fUseComptonCmd->SetGuidance("If true (false) the Compton scattering is (not) considered for adjoint and forward simulations");
76  fUseComptonCmd->AvailableForStates(G4State_PreInit);
77 
78  fUseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS",this);
79  fUseMSCmd->SetGuidance("If true (false) the continuous multiple scattering is (not) considered for adjoint and forward simulations");
81 
82  fUseEgainFluctuationCmd = new G4UIcmdWithABool("/adjoint_physics/UseEgainElossFluctuation",this);
83  fUseEgainFluctuationCmd->SetGuidance("If true (false) the fluctation for continuous energy gain and loss is (not) considered for adjoint and forward simulations");
84  fUseEgainFluctuationCmd->AvailableForStates(G4State_PreInit);
85 
86  fUsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect",this);
87  fUsePEEffectCmd->AvailableForStates(G4State_PreInit);
88  fUsePEEffectCmd->SetGuidance("If true (false) the photo electric effect is (not) considered for the adjoint and forward simulations");
89 
90  fUseGammaConversionCmd = new G4UIcmdWithABool("/adjoint_physics/UseGammaConversion",this);
91  fUseGammaConversionCmd->AvailableForStates(G4State_PreInit);
92  fUseGammaConversionCmd->SetGuidance("If true the gamma pair conversion is considered as well as the e+ physics for the forward simulation");
93 
94  fSetEminAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEminForAdjointModels",this);
95  fSetEminAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models");
96  fSetEminAdjModelsCmd->SetParameterName("Emin",false);
97  fSetEminAdjModelsCmd->SetUnitCategory("Energy");
98  fSetEminAdjModelsCmd->AvailableForStates(G4State_PreInit);
99 
100  fSetEmaxAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEmaxForAdjointModels",this);
101  fSetEmaxAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models.");
102  fSetEmaxAdjModelsCmd->SetParameterName("Emax",false);
103  fSetEmaxAdjModelsCmd->SetUnitCategory("Energy");
104  fSetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit);
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
110 {
111  delete fUsepIonisationCmd;
112  delete fUseBremCmd;
113  delete fUseComptonCmd;
114  delete fUseMSCmd;
115  delete fUsePEEffectCmd;
116  delete fUseGammaConversionCmd;
117  delete fUseEgainFluctuationCmd;
118  delete fSetEminAdjModelsCmd;
119  delete fSetEmaxAdjModelsCmd;
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123 
125  G4String newValue)
126 {
127  if ( command==fUsepIonisationCmd){
128  fPhysicsList->SetUseProtonIonisation(
129  fUsepIonisationCmd->GetNewBoolValue(newValue));
130 
131  }
132  else if ( command==fUseBremCmd){
133  fPhysicsList->SetUseBrem(fUseBremCmd->GetNewBoolValue(newValue));
134  }
135  else if ( command==fUseComptonCmd){
136  fPhysicsList->SetUseCompton(fUseComptonCmd->GetNewBoolValue(newValue));
137  }
138  else if ( command==fUseMSCmd){
139  fPhysicsList->SetUseMS(fUseMSCmd->GetNewBoolValue(newValue));
140  }
141  else if ( command==fUsePEEffectCmd){
142  fPhysicsList->SetUsePEEffect(fUsePEEffectCmd->GetNewBoolValue(newValue));
143  }
144  else if ( command==fUseGammaConversionCmd){
145  fPhysicsList->SetUseGammaConversion(
146  fUseGammaConversionCmd->GetNewBoolValue(newValue));
147  }
148  else if ( command==fUseEgainFluctuationCmd){
149  fPhysicsList->SetUseEgainFluctuation(
150  fUseEgainFluctuationCmd->GetNewBoolValue(newValue));
151  }
152 
153  else if ( command== fSetEminAdjModelsCmd){
154  fPhysicsList->SetEminAdjModels(
155  fSetEminAdjModelsCmd->GetNewDoubleValue(newValue));
156  }
157  else if ( command== fSetEmaxAdjModelsCmd){
158  fPhysicsList->SetEmaxAdjModels(
159  fSetEmaxAdjModelsCmd->GetNewDoubleValue(newValue));
160  }
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
164