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 ////////////////////////////////////////////// 26 //////////////////////////////////////////////////////////////////////////////// 27 // << 27 // // 28 // GEANT4 Class source file << 28 // File: G4RadioactivationMessenger.cc // 29 // << 29 // Author: D.H. Wright (SLAC) // 30 // G4RadioactivationMessenger << 30 // Date: 29 August 2017 // 31 // << 31 // Description: messenger class for biased version of G4RadioactiveDecay. // 32 // Author: D.H. Wright (SLAC) << 32 // Based on the code of F. Lei and P.R. Truscott. // 33 // Date: 29 August 2017 << 33 // // 34 // << 35 // Based on the code of F. Lei and P.R. Trusc << 36 // << 37 ////////////////////////////////////////////// 34 //////////////////////////////////////////////////////////////////////////////// 38 35 39 #include "G4RadioactivationMessenger.hh" 36 #include "G4RadioactivationMessenger.hh" 40 #include "G4NuclearLevelData.hh" 37 #include "G4NuclearLevelData.hh" 41 #include "G4RadioactiveDecay.hh" << 42 << 43 #include <sstream> 38 #include <sstream> 44 #include "G4HadronicException.hh" << 45 39 46 40 47 G4RadioactivationMessenger::G4RadioactivationM << 41 G4RadioactivationMessenger::G4RadioactivationMessenger(G4Radioactivation* theRadioactivationContainer1) 48 :theRadDecay(ptr) << 42 :theRadioactivationContainer(theRadioactivationContainer1) 49 { 43 { 50 rdmDirectory = new G4UIdirectory("/process/h << 44 grdmDirectory = new G4UIdirectory("/grdm/"); 51 rdmDirectory->SetGuidance("Controls the bias << 45 grdmDirectory->SetGuidance("Controls the biased version of radioactive decay"); 52 << 46 /* 53 // Command to turn on/off variance reduction << 47 // Command to define the limits on nuclei the RDM will treat 54 analoguemcCmd = new G4UIcmdWithABool("/proce << 48 nucleuslimitsCmd = new G4UIcmdWithNucleusLimits("/grdm/nucleusLimits",this); 55 analoguemcCmd->SetGuidance("false: variance << 49 nucleuslimitsCmd->SetGuidance 56 analoguemcCmd->SetParameterName("AnalogueMC" << 50 ("Set the atomic weight and number limits for the RDM."); 57 analoguemcCmd->SetDefaultValue(true); << 51 nucleuslimitsCmd->SetParameterName("aMin","aMax","zMin","zMax",true); 58 << 52 >> 53 // Command to contols whether beta decay will be treated faithfully or >> 54 // in fast mode (no longer used) >> 55 fbetaCmd = new G4UIcmdWithABool ("/grdm/fBeta",this); >> 56 fbetaCmd->SetGuidance("false: use 3-body decay, true: use histogram method"); >> 57 fbetaCmd->SetParameterName("fBeta",true); >> 58 fbetaCmd->SetDefaultValue(false); >> 59 >> 60 // Command to select a logical volume for RDM >> 61 avolumeCmd = new G4UIcmdWithAString("/grdm/selectVolume",this); >> 62 avolumeCmd->SetGuidance >> 63 ("Suppply a logical volumes name to add it to the RDM apply list"); >> 64 avolumeCmd->SetParameterName("aVolume",false); >> 65 >> 66 // Command to de-select a logical volume for RDM >> 67 deavolumeCmd = new G4UIcmdWithAString("/grdm/deselectVolume",this); >> 68 deavolumeCmd->SetGuidance >> 69 ("Suppply a logical volumes name to remove it from the RDM apply list"); >> 70 deavolumeCmd->SetParameterName("aVolume",false); >> 71 >> 72 // Command to select all logical volumes for RDM >> 73 allvolumesCmd = new G4UIcmdWithoutParameter("/grdm/allVolumes",this); >> 74 allvolumesCmd->SetGuidance >> 75 (" apply RDM to all logical volumes. No parameter required."); >> 76 >> 77 // Command to de-selete a logical volume for RDM. >> 78 deallvolumesCmd = new G4UIcmdWithoutParameter("/grdm/noVolumes",this); >> 79 deallvolumesCmd->SetGuidance(" RDM is not applied to any logical volumes"); >> 80 */ 59 // Command to use branching ratio biasing or 81 // Command to use branching ratio biasing or not 60 brbiasCmd = new G4UIcmdWithABool("/process/h << 82 brbiasCmd = new G4UIcmdWithABool ("/grdm/BRbias",this); 61 brbiasCmd->SetGuidance("false: no biasing; t 83 brbiasCmd->SetGuidance("false: no biasing; true: all branches are treated as equal"); 62 brbiasCmd->SetParameterName("BRBias",true); 84 brbiasCmd->SetParameterName("BRBias",true); 63 brbiasCmd->SetDefaultValue(true); 85 brbiasCmd->SetDefaultValue(true); 64 << 86 /* >> 87 // Command to apply internal conversion or not >> 88 icmCmd = new G4UIcmdWithABool ("/grdm/applyICM",this); >> 89 icmCmd->SetGuidance("True: ICM is applied; false: no"); >> 90 icmCmd->SetParameterName("applyICM",true); >> 91 icmCmd->SetDefaultValue(true); >> 92 >> 93 // Command to apply atomic relaxation or not >> 94 armCmd = new G4UIcmdWithABool ("/grdm/applyARM",this); >> 95 armCmd->SetGuidance("True: ARM is applied; false: no"); >> 96 armCmd->SetParameterName("applyARM",true); >> 97 armCmd->SetDefaultValue(true); >> 98 */ 65 // Command to set the half-life thresold for 99 // Command to set the half-life thresold for isomer production 66 hlthCmd = new G4UIcmdWithADoubleAndUnit("/pr << 100 hlthCmd = new G4UIcmdWithADoubleAndUnit("/grdm/hlThreshold",this); 67 hlthCmd->SetGuidance("Set the h-l threshold 101 hlthCmd->SetGuidance("Set the h-l threshold for isomer production"); 68 hlthCmd->SetParameterName("hlThreshold",fals 102 hlthCmd->SetParameterName("hlThreshold",false); 69 hlthCmd->SetUnitCategory("Time"); 103 hlthCmd->SetUnitCategory("Time"); 70 << 104 71 // Command to define the incident particle s 105 // Command to define the incident particle source time profile 72 sourcetimeprofileCmd = new G4UIcmdWithAStrin << 106 sourcetimeprofileCmd = new G4UIcmdWithAString("/grdm/sourceTimeProfile",this); 73 sourcetimeprofileCmd->SetGuidance 107 sourcetimeprofileCmd->SetGuidance 74 ("Supply the name of the ascii file contai 108 ("Supply the name of the ascii file containing the source particle time profile"); 75 sourcetimeprofileCmd->SetParameterName("STim 109 sourcetimeprofileCmd->SetParameterName("STimeProfile",true); 76 sourcetimeprofileCmd->SetDefaultValue("sourc 110 sourcetimeprofileCmd->SetDefaultValue("source.data"); 77 << 111 78 // Command to define the incident particle s 112 // Command to define the incident particle source time profile 79 decaybiasprofileCmd = new G4UIcmdWithAString << 113 decaybiasprofileCmd = new G4UIcmdWithAString("/grdm/decayBiasProfile",this); 80 decaybiasprofileCmd->SetGuidance 114 decaybiasprofileCmd->SetGuidance 81 ("Supply the name of the ascii file contai 115 ("Supply the name of the ascii file containing the decay bias time profile"); 82 decaybiasprofileCmd->SetParameterName("DBias 116 decaybiasprofileCmd->SetParameterName("DBiasProfile",true); 83 decaybiasprofileCmd->SetDefaultValue("bias.d 117 decaybiasprofileCmd->SetDefaultValue("bias.data"); 84 << 118 /* 85 // Command to set nuclei splitting parameter << 119 // Command to set the directional bias (collimation) vector 86 splitnucleiCmd = new G4UIcmdWithAnInteger("/ << 120 colldirCmd = new G4UIcmdWith3Vector("/grdm/decayDirection",this); 87 splitnucleiCmd->SetGuidance("Set number of s << 121 colldirCmd->SetGuidance("Supply the direction vector for decay products"); >> 122 colldirCmd->SetParameterName("X","Y","Z",false); >> 123 >> 124 // Command to set the directional bias (collimation) half angle ("cone") >> 125 collangleCmd = new G4UIcmdWithADoubleAndUnit("/grdm/decayHalfAngle",this); >> 126 collangleCmd->SetGuidance >> 127 ("Supply maximum angle from direction vector for decay products"); >> 128 collangleCmd->SetParameterName("halfAngle",false); >> 129 collangleCmd->SetUnitCategory("Angle"); >> 130 */ >> 131 // Command to set nuclei spliting parameter >> 132 splitnucleiCmd = new G4UIcmdWithAnInteger("/grdm/splitNuclei",this); >> 133 splitnucleiCmd->SetGuidance("Set number of spliting for the isotopes."); 88 splitnucleiCmd->SetParameterName("NSplit",tr 134 splitnucleiCmd->SetParameterName("NSplit",true); 89 splitnucleiCmd->SetDefaultValue(1); 135 splitnucleiCmd->SetDefaultValue(1); 90 splitnucleiCmd->SetRange("NSplit>=1"); 136 splitnucleiCmd->SetRange("NSplit>=1"); >> 137 /* >> 138 // Command to set verbosity >> 139 verboseCmd = new G4UIcmdWithAnInteger("/grdm/verbose",this); >> 140 verboseCmd->SetGuidance("Set verbose level: 0, 1, 2 or 3"); >> 141 verboseCmd->SetParameterName("VerboseLevel",true); >> 142 verboseCmd->SetDefaultValue(1); >> 143 verboseCmd->SetRange("VerboseLevel>=0"); >> 144 >> 145 //This commansd allows the user to define its own decay datafile for >> 146 // a given isotope >> 147 // >> 148 userDecayDataCmd = new G4UIcommand("/grdm/setRadioactiveDecayFile",this); >> 149 G4UIparameter* Z_para= new G4UIparameter("Z_isotope",'i',true); >> 150 Z_para->SetParameterRange("Z_isotope > 0"); >> 151 Z_para->SetGuidance("Z: Charge number of isotope"); >> 152 >> 153 >> 154 G4UIparameter* A_para= new G4UIparameter("A_isotope",'i',true); >> 155 A_para->SetParameterRange("A_isotope > 1"); >> 156 A_para->SetGuidance("A: mass number of isotope"); >> 157 >> 158 G4UIparameter* FileName_para= new G4UIparameter("file_name",'s',true); >> 159 FileName_para->SetGuidance("Name of the user data file"); >> 160 userDecayDataCmd->SetParameter(Z_para); >> 161 userDecayDataCmd->SetParameter(A_para); >> 162 userDecayDataCmd->SetParameter(FileName_para); >> 163 >> 164 // Command allowing user-defined evaporation data file to be used >> 165 // a given isotope >> 166 >> 167 userEvaporationDataCmd = new G4UIcommand("/grdm/setPhotoEvaporationFile",this); >> 168 userEvaporationDataCmd->SetParameter(Z_para); >> 169 userEvaporationDataCmd->SetParameter(A_para); >> 170 userEvaporationDataCmd->SetParameter(FileName_para); >> 171 */ 91 } 172 } 92 173 93 174 94 G4RadioactivationMessenger::~G4Radioactivation 175 G4RadioactivationMessenger::~G4RadioactivationMessenger() 95 { 176 { 96 delete rdmDirectory; << 177 delete grdmDirectory; 97 delete analoguemcCmd; << 178 // delete nucleuslimitsCmd; 98 delete sourcetimeprofileCmd; 179 delete sourcetimeprofileCmd; 99 delete decaybiasprofileCmd; 180 delete decaybiasprofileCmd; >> 181 // delete fbetaCmd; 100 delete brbiasCmd; 182 delete brbiasCmd; 101 delete splitnucleiCmd; 183 delete splitnucleiCmd; >> 184 // delete verboseCmd; >> 185 // delete avolumeCmd; >> 186 // delete deavolumeCmd; >> 187 // delete allvolumesCmd; >> 188 // delete deallvolumesCmd; >> 189 // delete icmCmd; >> 190 // delete armCmd; 102 delete hlthCmd; 191 delete hlthCmd; >> 192 // delete userDecayDataCmd; >> 193 // delete userEvaporationDataCmd; >> 194 // delete colldirCmd; >> 195 // delete collangleCmd; 103 } 196 } 104 197 105 198 106 void G4RadioactivationMessenger::SetNewValue(G 199 void G4RadioactivationMessenger::SetNewValue(G4UIcommand* command, G4String newValues) 107 { 200 { 108 if ( command == analoguemcCmd ) { theRadDeca << 201 // if (command==nucleuslimitsCmd) {theRadioactivationContainer-> 109 SetAnalogueMonteCarlo( analoguemcCmd->GetN << 202 // SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues)); 110 } else if ( command == brbiasCmd ) { theRadD << 203 /* 111 SetBRBias( brbiasCmd->GetNewBoolValue( new << 204 } else if (command==fbetaCmd) {theRadioactivationContainer-> 112 } else if ( command == sourcetimeprofileCmd << 205 SetFBeta(fbetaCmd->GetNewBoolValue(newValues)); 113 SetSourceTimeProfile( newValues ); << 206 114 } else if ( command == decaybiasprofileCmd ) << 207 } else if (command==avolumeCmd) {theRadioactivationContainer-> 115 SetDecayBias( newValues ); << 208 SelectAVolume(newValues); 116 } else if ( command == splitnucleiCmd ) { th << 209 117 SetSplitNuclei( splitnucleiCmd->GetNewIntV << 210 } else if (command==deavolumeCmd) {theRadioactivationContainer-> 118 } else if ( command == hlthCmd ) { theRadDec << 211 DeselectAVolume(newValues); 119 SetHLThreshold( hlthCmd->GetNewDoubleValue << 212 >> 213 } else if (command==allvolumesCmd) {theRadioactivationContainer-> >> 214 SelectAllVolumes(); >> 215 >> 216 } else if (command==deallvolumesCmd) {theRadioactivationContainer-> >> 217 DeselectAllVolumes(); >> 218 */ >> 219 if (command==brbiasCmd) {theRadioactivationContainer-> >> 220 SetBRBias(brbiasCmd->GetNewBoolValue(newValues)); >> 221 >> 222 } else if (command==sourcetimeprofileCmd) {theRadioactivationContainer-> >> 223 SetSourceTimeProfile(newValues); >> 224 >> 225 } else if (command==decaybiasprofileCmd) {theRadioactivationContainer-> >> 226 SetDecayBias(newValues); >> 227 >> 228 } else if (command==splitnucleiCmd) {theRadioactivationContainer-> >> 229 SetSplitNuclei(splitnucleiCmd->GetNewIntValue(newValues)); >> 230 /* >> 231 } else if (command==verboseCmd) {theRadioactivationContainer-> >> 232 SetVerboseLevel(verboseCmd->GetNewIntValue(newValues)); >> 233 >> 234 } else if (command==icmCmd ) {theRadioactivationContainer-> >> 235 SetICM(icmCmd->GetNewBoolValue(newValues)); >> 236 >> 237 } else if (command==armCmd ) {theRadioactivationContainer-> >> 238 SetARM(armCmd->GetNewBoolValue(newValues)); >> 239 */ >> 240 } else if (command==hlthCmd ) {theRadioactivationContainer-> >> 241 SetHLThreshold(hlthCmd->GetNewDoubleValue(newValues)); >> 242 /* >> 243 } else if (command ==userDecayDataCmd) { >> 244 G4int Z,A; >> 245 G4String file_name; >> 246 const char* nv = (const char*)newValues; >> 247 std::istringstream is(nv); >> 248 is >> Z >> A >> file_name; >> 249 theRadioactivationContainer->AddUserDecayDataFile(Z,A,file_name); >> 250 >> 251 } else if (command ==userEvaporationDataCmd) { >> 252 G4int Z,A; >> 253 G4String file_name; >> 254 const char* nv = (const char*)newValues; >> 255 std::istringstream is(nv); >> 256 is >> Z >> A >> file_name; >> 257 G4NuclearLevelData::GetInstance()->AddPrivateData(Z,A,file_name); >> 258 >> 259 } else if (command==colldirCmd) {theRadioactivationContainer-> >> 260 SetDecayDirection(colldirCmd->GetNew3VectorValue(newValues)); >> 261 >> 262 } else if (command==collangleCmd) {theRadioactivationContainer-> >> 263 SetDecayHalfAngle(collangleCmd->GetNewDoubleValue(newValues)); >> 264 */ 120 } 265 } 121 } 266 } 122 267 123 268