Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file biasing/ReverseMC01/src/G4AdjointPhy 26 /// \file biasing/ReverseMC01/src/G4AdjointPhysicsMessenger.cc 27 /// \brief Implementation of the G4AdjointPhys 27 /// \brief Implementation of the G4AdjointPhysicsMessenger class 28 // 28 // >> 29 // $Id$ 29 // 30 // 30 ////////////////////////////////////////////// 31 ////////////////////////////////////////////////////////////// 31 // Class Name: G4AdjointPhysicsMes 32 // Class Name: G4AdjointPhysicsMessenger 32 // Author: L. Desorgher 33 // Author: L. Desorgher 33 // Organisation: SpaceIT GmbH 34 // Organisation: SpaceIT GmbH 34 // Contract: ESA contract 21435/ 35 // Contract: ESA contract 21435/08/NL/AT 35 // Customer: ESA/ESTEC 36 // Customer: ESA/ESTEC 36 ////////////////////////////////////////////// 37 ////////////////////////////////////////////////////////////// 37 38 38 //....oooOO0OOooo........oooOO0OOooo........oo 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 40 41 41 #include "G4AdjointPhysicsMessenger.hh" 42 #include "G4AdjointPhysicsMessenger.hh" 42 << 43 #include "G4UIdirectory.hh" 43 #include "G4AdjointPhysicsList.hh" << 44 #include "G4UIcmdWith3VectorAndUnit.hh" << 45 #include "G4UIcmdWithABool.hh" 44 #include "G4UIcmdWithABool.hh" 46 #include "G4UIcmdWithADouble.hh" << 47 #include "G4UIcmdWithADoubleAndUnit.hh" << 48 #include "G4UIcmdWithAString.hh" << 49 #include "G4UIcmdWithAnInteger.hh" 45 #include "G4UIcmdWithAnInteger.hh" >> 46 #include "G4UIcmdWithADoubleAndUnit.hh" >> 47 #include "G4UIcmdWithADouble.hh" 50 #include "G4UIcmdWithoutParameter.hh" 48 #include "G4UIcmdWithoutParameter.hh" 51 #include "G4UIdirectory.hh" << 49 #include "G4UIcmdWithAString.hh" 52 #include "G4UnitsTable.hh" 50 #include "G4UnitsTable.hh" >> 51 #include "G4AdjointPhysicsList.hh" >> 52 #include "G4UIcmdWith3VectorAndUnit.hh" 53 53 54 //....oooOO0OOooo........oooOO0OOooo........oo 54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 55 55 56 G4AdjointPhysicsMessenger::G4AdjointPhysicsMes << 56 G4AdjointPhysicsMessenger::G4AdjointPhysicsMessenger( 57 : G4UImessenger(), << 57 G4AdjointPhysicsList* pPhysicsList) 58 fPhysicsList(pPhysicsList), << 58 :fPhysicsList(pPhysicsList) 59 fPhysicsDir(0), << 59 { 60 fUsepIonisationCmd(0), << 61 fUseBremCmd(0), << 62 fUseComptonCmd(0), << 63 fUseMSCmd(0), << 64 fUsePEEffectCmd(0), << 65 fUseGammaConversionCmd(0), << 66 fUseEgainFluctuationCmd(0), << 67 fSetEminAdjModelsCmd(0), << 68 fSetEmaxAdjModelsCmd(0) << 69 { << 70 fPhysicsDir = new G4UIdirectory("/adjoint_ph 60 fPhysicsDir = new G4UIdirectory("/adjoint_physics/"); 71 61 72 fPhysicsDir->SetGuidance("Definition of adjo << 62 fPhysicsDir->SetGuidance("Definition of physics processes to be used in the adjoint and forward simulation mode"); >> 63 >> 64 //Physics 73 //------- 65 //------- 74 fUsepIonisationCmd = new G4UIcmdWithABool("/ << 66 fUsepIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseProtonIonisation",this); 75 fUsepIonisationCmd->SetGuidance("If true (fa << 67 fUsepIonisationCmd->SetGuidance("If true (false) the proton ionisation is (not) considered for adjoint and forward simulations"); 76 fUsepIonisationCmd->AvailableForStates(G4Sta 68 fUsepIonisationCmd->AvailableForStates(G4State_PreInit); 77 << 69 78 fUseBremCmd = new G4UIcmdWithABool("/adjoint << 70 fUseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung",this); 79 fUseBremCmd->SetGuidance("If true (false) th << 71 fUseBremCmd->SetGuidance("If true (false) the bremsstrahlung process is (not) considered for adjoint and forward simulations"); 80 fUseBremCmd->AvailableForStates(G4State_PreI << 72 fUseBremCmd->AvailableForStates(G4State_PreInit); 81 << 73 82 fUseComptonCmd = new G4UIcmdWithABool("/adjo << 74 fUseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton",this); 83 fUseComptonCmd->SetGuidance("If true (false) << 75 fUseComptonCmd->SetGuidance("If true (false) the Compton scattering is (not) considered for adjoint and forward simulations"); 84 fUseComptonCmd->AvailableForStates(G4State_P << 76 fUseComptonCmd->AvailableForStates(G4State_PreInit); 85 << 77 86 fUseMSCmd = new G4UIcmdWithABool("/adjoint_p << 78 fUseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS",this); 87 fUseMSCmd->SetGuidance("If true (false) the << 79 fUseMSCmd->SetGuidance("If true (false) the continuous multiple scattering is (not) considered for adjoint and forward simulations"); 88 fUseMSCmd->AvailableForStates(G4State_PreIni << 80 fUseMSCmd->AvailableForStates(G4State_PreInit); 89 << 81 90 fUseEgainFluctuationCmd = new G4UIcmdWithABo << 82 fUseEgainFluctuationCmd = new G4UIcmdWithABool("/adjoint_physics/UseEgainElossFluctuation",this); 91 fUseEgainFluctuationCmd->SetGuidance( << 83 fUseEgainFluctuationCmd->SetGuidance("If true (false) the fluctation for continuous energy gain and loss is (not) considered for adjoint and forward simulations"); 92 "Switch on/off the fluctation for continuo << 84 fUseEgainFluctuationCmd->AvailableForStates(G4State_PreInit); 93 fUseEgainFluctuationCmd->AvailableForStates( << 85 94 << 86 fUsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect",this); 95 fUsePEEffectCmd = new G4UIcmdWithABool("/adj << 87 fUsePEEffectCmd->AvailableForStates(G4State_PreInit); 96 fUsePEEffectCmd->AvailableForStates(G4State_ << 88 fUsePEEffectCmd->SetGuidance("If true (false) the photo electric effect is (not) considered for the adjoint and forward simulations"); 97 fUsePEEffectCmd->SetGuidance("If true (false << 89 98 << 90 fUseGammaConversionCmd = new G4UIcmdWithABool("/adjoint_physics/UseGammaConversion",this); 99 fUseGammaConversionCmd = new G4UIcmdWithABoo << 100 fUseGammaConversionCmd->AvailableForStates(G 91 fUseGammaConversionCmd->AvailableForStates(G4State_PreInit); 101 fUseGammaConversionCmd->SetGuidance("If true << 92 fUseGammaConversionCmd->SetGuidance("If true the gamma pair conversion is considered as well as the e+ physics for the forward simulation"); 102 << 93 103 fSetEminAdjModelsCmd = << 94 fSetEminAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEminForAdjointModels",this); 104 new G4UIcmdWithADoubleAndUnit("/adjoint_ph << 105 fSetEminAdjModelsCmd->SetGuidance("Set the m 95 fSetEminAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models"); 106 fSetEminAdjModelsCmd->SetParameterName("Emin << 96 fSetEminAdjModelsCmd->SetParameterName("Emin",false); 107 fSetEminAdjModelsCmd->SetUnitCategory("Energ 97 fSetEminAdjModelsCmd->SetUnitCategory("Energy"); 108 fSetEminAdjModelsCmd->AvailableForStates(G4S 98 fSetEminAdjModelsCmd->AvailableForStates(G4State_PreInit); 109 << 99 110 fSetEmaxAdjModelsCmd = << 100 fSetEmaxAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEmaxForAdjointModels",this); 111 new G4UIcmdWithADoubleAndUnit("/adjoint_ph << 101 fSetEmaxAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models."); 112 fSetEmaxAdjModelsCmd->SetGuidance("Set the m << 102 fSetEmaxAdjModelsCmd->SetParameterName("Emax",false); 113 fSetEmaxAdjModelsCmd->SetParameterName("Emax << 114 fSetEmaxAdjModelsCmd->SetUnitCategory("Energ 103 fSetEmaxAdjModelsCmd->SetUnitCategory("Energy"); 115 fSetEmaxAdjModelsCmd->AvailableForStates(G4S 104 fSetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit); 116 } 105 } 117 106 118 //....oooOO0OOooo........oooOO0OOooo........oo 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 119 108 120 G4AdjointPhysicsMessenger::~G4AdjointPhysicsMe 109 G4AdjointPhysicsMessenger::~G4AdjointPhysicsMessenger() 121 { 110 { 122 delete fUsepIonisationCmd; 111 delete fUsepIonisationCmd; 123 delete fUseBremCmd; 112 delete fUseBremCmd; 124 delete fUseComptonCmd; 113 delete fUseComptonCmd; 125 delete fUseMSCmd; 114 delete fUseMSCmd; 126 delete fUsePEEffectCmd; 115 delete fUsePEEffectCmd; 127 delete fUseGammaConversionCmd; 116 delete fUseGammaConversionCmd; 128 delete fUseEgainFluctuationCmd; 117 delete fUseEgainFluctuationCmd; 129 delete fSetEminAdjModelsCmd; 118 delete fSetEminAdjModelsCmd; 130 delete fSetEmaxAdjModelsCmd; 119 delete fSetEmaxAdjModelsCmd; 131 } 120 } 132 121 133 //....oooOO0OOooo........oooOO0OOooo........oo 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 134 123 135 void G4AdjointPhysicsMessenger::SetNewValue(G4 << 124 void G4AdjointPhysicsMessenger::SetNewValue(G4UIcommand* command, >> 125 G4String newValue) 136 { 126 { 137 if (command == fUsepIonisationCmd) { << 127 if ( command==fUsepIonisationCmd){ 138 fPhysicsList->SetUseProtonIonisation(fUsep << 128 fPhysicsList->SetUseProtonIonisation( >> 129 fUsepIonisationCmd->GetNewBoolValue(newValue)); >> 130 139 } 131 } 140 else if (command == fUseBremCmd) { << 132 else if ( command==fUseBremCmd){ 141 fPhysicsList->SetUseBrem(fUseBremCmd->GetN << 133 fPhysicsList->SetUseBrem(fUseBremCmd->GetNewBoolValue(newValue)); 142 } 134 } 143 else if (command == fUseComptonCmd) { << 135 else if ( command==fUseComptonCmd){ 144 fPhysicsList->SetUseCompton(fUseComptonCmd << 136 fPhysicsList->SetUseCompton(fUseComptonCmd->GetNewBoolValue(newValue)); 145 } 137 } 146 else if (command == fUseMSCmd) { << 138 else if ( command==fUseMSCmd){ 147 fPhysicsList->SetUseMS(fUseMSCmd->GetNewBo 139 fPhysicsList->SetUseMS(fUseMSCmd->GetNewBoolValue(newValue)); 148 } 140 } 149 else if (command == fUsePEEffectCmd) { << 141 else if ( command==fUsePEEffectCmd){ 150 fPhysicsList->SetUsePEEffect(fUsePEEffectC 142 fPhysicsList->SetUsePEEffect(fUsePEEffectCmd->GetNewBoolValue(newValue)); 151 } 143 } 152 else if (command == fUseGammaConversionCmd) << 144 else if ( command==fUseGammaConversionCmd){ 153 fPhysicsList->SetUseGammaConversion(fUseGa << 145 fPhysicsList->SetUseGammaConversion( 154 } << 146 fUseGammaConversionCmd->GetNewBoolValue(newValue)); 155 else if (command == fUseEgainFluctuationCmd) << 147 } 156 fPhysicsList->SetUseEgainFluctuation(fUseE << 148 else if ( command==fUseEgainFluctuationCmd){ 157 } << 149 fPhysicsList->SetUseEgainFluctuation( 158 << 150 fUseEgainFluctuationCmd->GetNewBoolValue(newValue)); 159 else if (command == fSetEminAdjModelsCmd) { << 151 } 160 fPhysicsList->SetEminAdjModels(fSetEminAdj << 152 161 } << 153 else if ( command== fSetEminAdjModelsCmd){ 162 else if (command == fSetEmaxAdjModelsCmd) { << 154 fPhysicsList->SetEminAdjModels( 163 fPhysicsList->SetEmaxAdjModels(fSetEmaxAdj << 155 fSetEminAdjModelsCmd->GetNewDoubleValue(newValue)); >> 156 } >> 157 else if ( command== fSetEmaxAdjModelsCmd){ >> 158 fPhysicsList->SetEmaxAdjModels( >> 159 fSetEmaxAdjModelsCmd->GetNewDoubleValue(newValue)); 164 } 160 } 165 } 161 } 166 162 167 //....oooOO0OOooo........oooOO0OOooo........oo 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 164 168 165