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 // 29 // 30 ////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////// 31 // Class Name: G4AdjointPhysicsMes 31 // Class Name: G4AdjointPhysicsMessenger 32 // Author: L. Desorgher 32 // Author: L. Desorgher 33 // Organisation: SpaceIT GmbH 33 // Organisation: SpaceIT GmbH 34 // Contract: ESA contract 21435/ 34 // Contract: ESA contract 21435/08/NL/AT 35 // Customer: ESA/ESTEC 35 // Customer: ESA/ESTEC 36 ////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////// 37 37 38 //....oooOO0OOooo........oooOO0OOooo........oo 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 //....oooOO0OOooo........oooOO0OOooo........oo 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 40 40 41 #include "G4AdjointPhysicsMessenger.hh" 41 #include "G4AdjointPhysicsMessenger.hh" 42 << 42 #include "G4UIdirectory.hh" 43 #include "G4AdjointPhysicsList.hh" << 44 #include "G4UIcmdWith3VectorAndUnit.hh" << 45 #include "G4UIcmdWithABool.hh" 43 #include "G4UIcmdWithABool.hh" 46 #include "G4UIcmdWithADouble.hh" << 47 #include "G4UIcmdWithADoubleAndUnit.hh" << 48 #include "G4UIcmdWithAString.hh" << 49 #include "G4UIcmdWithAnInteger.hh" 44 #include "G4UIcmdWithAnInteger.hh" >> 45 #include "G4UIcmdWithADoubleAndUnit.hh" >> 46 #include "G4UIcmdWithADouble.hh" 50 #include "G4UIcmdWithoutParameter.hh" 47 #include "G4UIcmdWithoutParameter.hh" 51 #include "G4UIdirectory.hh" << 48 #include "G4UIcmdWithAString.hh" 52 #include "G4UnitsTable.hh" 49 #include "G4UnitsTable.hh" >> 50 #include "G4AdjointPhysicsList.hh" >> 51 #include "G4UIcmdWith3VectorAndUnit.hh" 53 52 54 //....oooOO0OOooo........oooOO0OOooo........oo 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 55 54 56 G4AdjointPhysicsMessenger::G4AdjointPhysicsMes << 55 G4AdjointPhysicsMessenger::G4AdjointPhysicsMessenger( 57 : G4UImessenger(), << 56 G4AdjointPhysicsList* pPhysicsList) 58 fPhysicsList(pPhysicsList), << 57 : G4UImessenger(), 59 fPhysicsDir(0), << 58 fPhysicsList(pPhysicsList), 60 fUsepIonisationCmd(0), << 59 fPhysicsDir(0), 61 fUseBremCmd(0), << 60 fUsepIonisationCmd(0), 62 fUseComptonCmd(0), << 61 fUseBremCmd(0), 63 fUseMSCmd(0), << 62 fUseComptonCmd(0), 64 fUsePEEffectCmd(0), << 63 fUseMSCmd(0), 65 fUseGammaConversionCmd(0), << 64 fUsePEEffectCmd(0), 66 fUseEgainFluctuationCmd(0), << 65 fUseGammaConversionCmd(0), 67 fSetEminAdjModelsCmd(0), << 66 fUseEgainFluctuationCmd(0), 68 fSetEmaxAdjModelsCmd(0) << 67 fSetEminAdjModelsCmd(0), 69 { << 68 fSetEmaxAdjModelsCmd(0) >> 69 { 70 fPhysicsDir = new G4UIdirectory("/adjoint_ph 70 fPhysicsDir = new G4UIdirectory("/adjoint_physics/"); 71 71 72 fPhysicsDir->SetGuidance("Definition of adjo << 72 fPhysicsDir->SetGuidance( >> 73 "Definition of adjoint and forward physics processes"); 73 //------- 74 //------- 74 fUsepIonisationCmd = new G4UIcmdWithABool("/ << 75 fUsepIonisationCmd = new G4UIcmdWithABool( 75 fUsepIonisationCmd->SetGuidance("If true (fa << 76 "/adjoint_physics/UseProtonIonisation",this); >> 77 fUsepIonisationCmd->SetGuidance( >> 78 "If true (false) the proton ionisation is (not) considered"); 76 fUsepIonisationCmd->AvailableForStates(G4Sta 79 fUsepIonisationCmd->AvailableForStates(G4State_PreInit); 77 << 80 78 fUseBremCmd = new G4UIcmdWithABool("/adjoint << 81 fUseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung",this); 79 fUseBremCmd->SetGuidance("If true (false) th << 82 fUseBremCmd->SetGuidance( 80 fUseBremCmd->AvailableForStates(G4State_PreI << 83 "If true (false) the bremsstrahlung process is (not) considered"); 81 << 84 fUseBremCmd->AvailableForStates(G4State_PreInit); 82 fUseComptonCmd = new G4UIcmdWithABool("/adjo << 85 83 fUseComptonCmd->SetGuidance("If true (false) << 86 fUseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton",this); 84 fUseComptonCmd->AvailableForStates(G4State_P << 87 fUseComptonCmd->SetGuidance( 85 << 88 "If true (false) the Compton scattering is (not) considered"); 86 fUseMSCmd = new G4UIcmdWithABool("/adjoint_p << 89 fUseComptonCmd->AvailableForStates(G4State_PreInit); 87 fUseMSCmd->SetGuidance("If true (false) the << 90 88 fUseMSCmd->AvailableForStates(G4State_PreIni << 91 fUseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS",this); 89 << 92 fUseMSCmd->SetGuidance( 90 fUseEgainFluctuationCmd = new G4UIcmdWithABo << 93 "If true (false) the continuous multiple scattering is (not) considered"); >> 94 fUseMSCmd->AvailableForStates(G4State_PreInit); >> 95 >> 96 fUseEgainFluctuationCmd = new G4UIcmdWithABool( >> 97 "/adjoint_physics/UseEgainElossFluctuation",this); 91 fUseEgainFluctuationCmd->SetGuidance( 98 fUseEgainFluctuationCmd->SetGuidance( 92 "Switch on/off the fluctation for continuo 99 "Switch on/off the fluctation for continuous energy gain/loss"); 93 fUseEgainFluctuationCmd->AvailableForStates( << 100 fUseEgainFluctuationCmd->AvailableForStates(G4State_PreInit); 94 << 101 95 fUsePEEffectCmd = new G4UIcmdWithABool("/adj << 102 fUsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect",this); 96 fUsePEEffectCmd->AvailableForStates(G4State_ << 103 fUsePEEffectCmd->AvailableForStates(G4State_PreInit); 97 fUsePEEffectCmd->SetGuidance("If true (false << 104 fUsePEEffectCmd->SetGuidance( 98 << 105 "If true (false) the photo electric effect is (not) considered"); 99 fUseGammaConversionCmd = new G4UIcmdWithABoo << 106 >> 107 fUseGammaConversionCmd = new G4UIcmdWithABool( >> 108 "/adjoint_physics/UseGammaConversion",this); 100 fUseGammaConversionCmd->AvailableForStates(G 109 fUseGammaConversionCmd->AvailableForStates(G4State_PreInit); 101 fUseGammaConversionCmd->SetGuidance("If true << 110 fUseGammaConversionCmd->SetGuidance( 102 << 111 "If true the fwd gamma pair conversion is considered"); 103 fSetEminAdjModelsCmd = << 112 104 new G4UIcmdWithADoubleAndUnit("/adjoint_ph << 113 fSetEminAdjModelsCmd = new G4UIcmdWithADoubleAndUnit( 105 fSetEminAdjModelsCmd->SetGuidance("Set the m << 114 "/adjoint_physics/SetEminForAdjointModels",this); 106 fSetEminAdjModelsCmd->SetParameterName("Emin << 115 fSetEminAdjModelsCmd->SetGuidance( >> 116 "Set the minimum energy of the adjoint models"); >> 117 fSetEminAdjModelsCmd->SetParameterName("Emin",false); 107 fSetEminAdjModelsCmd->SetUnitCategory("Energ 118 fSetEminAdjModelsCmd->SetUnitCategory("Energy"); 108 fSetEminAdjModelsCmd->AvailableForStates(G4S 119 fSetEminAdjModelsCmd->AvailableForStates(G4State_PreInit); 109 << 120 110 fSetEmaxAdjModelsCmd = << 121 fSetEmaxAdjModelsCmd = new G4UIcmdWithADoubleAndUnit( 111 new G4UIcmdWithADoubleAndUnit("/adjoint_ph << 122 "/adjoint_physics/SetEmaxForAdjointModels",this); 112 fSetEmaxAdjModelsCmd->SetGuidance("Set the m << 123 fSetEmaxAdjModelsCmd->SetGuidance( 113 fSetEmaxAdjModelsCmd->SetParameterName("Emax << 124 "Set the minimum energy of the adjoint models."); >> 125 fSetEmaxAdjModelsCmd->SetParameterName("Emax",false); 114 fSetEmaxAdjModelsCmd->SetUnitCategory("Energ 126 fSetEmaxAdjModelsCmd->SetUnitCategory("Energy"); 115 fSetEmaxAdjModelsCmd->AvailableForStates(G4S 127 fSetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit); 116 } 128 } 117 129 118 //....oooOO0OOooo........oooOO0OOooo........oo 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 119 131 120 G4AdjointPhysicsMessenger::~G4AdjointPhysicsMe 132 G4AdjointPhysicsMessenger::~G4AdjointPhysicsMessenger() 121 { 133 { 122 delete fUsepIonisationCmd; 134 delete fUsepIonisationCmd; 123 delete fUseBremCmd; 135 delete fUseBremCmd; 124 delete fUseComptonCmd; 136 delete fUseComptonCmd; 125 delete fUseMSCmd; 137 delete fUseMSCmd; 126 delete fUsePEEffectCmd; 138 delete fUsePEEffectCmd; 127 delete fUseGammaConversionCmd; 139 delete fUseGammaConversionCmd; 128 delete fUseEgainFluctuationCmd; 140 delete fUseEgainFluctuationCmd; 129 delete fSetEminAdjModelsCmd; 141 delete fSetEminAdjModelsCmd; 130 delete fSetEmaxAdjModelsCmd; 142 delete fSetEmaxAdjModelsCmd; 131 } 143 } 132 144 133 //....oooOO0OOooo........oooOO0OOooo........oo 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 134 146 135 void G4AdjointPhysicsMessenger::SetNewValue(G4 << 147 void G4AdjointPhysicsMessenger::SetNewValue(G4UIcommand* command, >> 148 G4String newValue) 136 { 149 { 137 if (command == fUsepIonisationCmd) { << 150 if ( command==fUsepIonisationCmd){ 138 fPhysicsList->SetUseProtonIonisation(fUsep << 151 fPhysicsList->SetUseProtonIonisation( >> 152 fUsepIonisationCmd->GetNewBoolValue(newValue)); >> 153 139 } 154 } 140 else if (command == fUseBremCmd) { << 155 else if ( command==fUseBremCmd){ 141 fPhysicsList->SetUseBrem(fUseBremCmd->GetN << 156 fPhysicsList->SetUseBrem(fUseBremCmd->GetNewBoolValue(newValue)); 142 } 157 } 143 else if (command == fUseComptonCmd) { << 158 else if ( command==fUseComptonCmd){ 144 fPhysicsList->SetUseCompton(fUseComptonCmd << 159 fPhysicsList->SetUseCompton(fUseComptonCmd->GetNewBoolValue(newValue)); 145 } 160 } 146 else if (command == fUseMSCmd) { << 161 else if ( command==fUseMSCmd){ 147 fPhysicsList->SetUseMS(fUseMSCmd->GetNewBo 162 fPhysicsList->SetUseMS(fUseMSCmd->GetNewBoolValue(newValue)); 148 } 163 } 149 else if (command == fUsePEEffectCmd) { << 164 else if ( command==fUsePEEffectCmd){ 150 fPhysicsList->SetUsePEEffect(fUsePEEffectC 165 fPhysicsList->SetUsePEEffect(fUsePEEffectCmd->GetNewBoolValue(newValue)); 151 } 166 } 152 else if (command == fUseGammaConversionCmd) << 167 else if ( command==fUseGammaConversionCmd){ 153 fPhysicsList->SetUseGammaConversion(fUseGa << 168 fPhysicsList->SetUseGammaConversion( 154 } << 169 fUseGammaConversionCmd->GetNewBoolValue(newValue)); 155 else if (command == fUseEgainFluctuationCmd) << 170 } 156 fPhysicsList->SetUseEgainFluctuation(fUseE << 171 else if ( command==fUseEgainFluctuationCmd){ 157 } << 172 fPhysicsList->SetUseEgainFluctuation( 158 << 173 fUseEgainFluctuationCmd->GetNewBoolValue(newValue)); 159 else if (command == fSetEminAdjModelsCmd) { << 174 } 160 fPhysicsList->SetEminAdjModels(fSetEminAdj << 175 161 } << 176 else if ( command== fSetEminAdjModelsCmd){ 162 else if (command == fSetEmaxAdjModelsCmd) { << 177 fPhysicsList->SetEminAdjModels( 163 fPhysicsList->SetEmaxAdjModels(fSetEmaxAdj << 178 fSetEminAdjModelsCmd->GetNewDoubleValue(newValue)); >> 179 } >> 180 else if ( command== fSetEmaxAdjModelsCmd){ >> 181 fPhysicsList->SetEmaxAdjModels( >> 182 fSetEmaxAdjModelsCmd->GetNewDoubleValue(newValue)); 164 } 183 } 165 } 184 } 166 185 167 //....oooOO0OOooo........oooOO0OOooo........oo 186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 187 168 188