| 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 |
|
|---|
| 27 | //
|
|---|
| 28 | #include "G4RadioactiveDecaymessenger.hh"
|
|---|
| 29 |
|
|---|
| 30 | #include <sstream>
|
|---|
| 31 |
|
|---|
| 32 | ////////////////////////////////////////////////////////////////////////////////
|
|---|
| 33 | //
|
|---|
| 34 | G4RadioactiveDecaymessenger::G4RadioactiveDecaymessenger
|
|---|
| 35 | (G4RadioactiveDecay* theRadioactiveDecayContainer1)
|
|---|
| 36 | :theRadioactiveDecayContainer(theRadioactiveDecayContainer1)
|
|---|
| 37 | {
|
|---|
| 38 | //
|
|---|
| 39 | //
|
|---|
| 40 | // main directory for control of the RDM
|
|---|
| 41 | //
|
|---|
| 42 | //
|
|---|
| 43 | grdmDirectory = new G4UIdirectory("/grdm/");
|
|---|
| 44 | grdmDirectory->SetGuidance("Controls for the Radioactive Decay Module.");
|
|---|
| 45 | //
|
|---|
| 46 | //
|
|---|
| 47 | // Command to define the limits on nucleus the RDM will treat.
|
|---|
| 48 | //
|
|---|
| 49 | nucleuslimitsCmd = new
|
|---|
| 50 | G4UIcmdWithNucleusLimits("/grdm/nucleusLimits",this);
|
|---|
| 51 | nucleuslimitsCmd->SetGuidance
|
|---|
| 52 | ("Set the amotic weight and number limits for the RDM.");
|
|---|
| 53 | nucleuslimitsCmd->SetParameterName("aMin","aMax","zMin","zMax",true);
|
|---|
| 54 | //
|
|---|
| 55 |
|
|---|
| 56 | //
|
|---|
| 57 | // The next command contols whether the decay will be treated analoguely or
|
|---|
| 58 | // with variance reduction
|
|---|
| 59 | //
|
|---|
| 60 | analoguemcCmd = new G4UIcmdWithABool ("/grdm/analogueMC",this);
|
|---|
| 61 | analoguemcCmd->SetGuidance("false: variance reduction method; true: analogue method");
|
|---|
| 62 | analoguemcCmd->SetParameterName("AnalogueMC",true);
|
|---|
| 63 | analoguemcCmd->SetDefaultValue(true);
|
|---|
| 64 | //
|
|---|
| 65 | // The next command contols whether beta decay will be treated faithfully or
|
|---|
| 66 | // in fast mode
|
|---|
| 67 | //
|
|---|
| 68 | fbetaCmd = new G4UIcmdWithABool ("/grdm/fBeta",this);
|
|---|
| 69 | fbetaCmd->SetGuidance("false: use 3-body decay, true: use histogram method");
|
|---|
| 70 | fbetaCmd->SetParameterName("fBeta",true);
|
|---|
| 71 | fbetaCmd->SetDefaultValue(false);
|
|---|
| 72 |
|
|---|
| 73 | //
|
|---|
| 74 | //
|
|---|
| 75 | // Command to selete a logical volume for RDM.
|
|---|
| 76 | //
|
|---|
| 77 | avolumeCmd = new
|
|---|
| 78 | G4UIcmdWithAString("/grdm/selectVolume",this);
|
|---|
| 79 | avolumeCmd->SetGuidance
|
|---|
| 80 | ("Suppply a logical volumes name to add it to the RDM apply list");
|
|---|
| 81 | avolumeCmd->SetParameterName("aVolume",false);
|
|---|
| 82 | //
|
|---|
| 83 | //
|
|---|
| 84 | //
|
|---|
| 85 | // Command to de-selete a logical volume for RDM.
|
|---|
| 86 | //
|
|---|
| 87 | deavolumeCmd = new
|
|---|
| 88 | G4UIcmdWithAString("/grdm/deselectVolume",this);
|
|---|
| 89 | deavolumeCmd->SetGuidance
|
|---|
| 90 | ("Suppply a logical volumes name to remove it from the RDM apply list");
|
|---|
| 91 | deavolumeCmd->SetParameterName("aVolume",false);
|
|---|
| 92 | //
|
|---|
| 93 | //
|
|---|
| 94 | // Command to selete all logical volumes for RDM.
|
|---|
| 95 | //
|
|---|
| 96 | allvolumesCmd = new
|
|---|
| 97 | G4UIcmdWithoutParameter("/grdm/allVolumes",this);
|
|---|
| 98 | allvolumesCmd->SetGuidance
|
|---|
| 99 | (" apply RDM to all logical volumes. No parameter required.");
|
|---|
| 100 | // allvolumeCmd->SetParameterName("AddAVolume",true);
|
|---|
| 101 |
|
|---|
| 102 | //
|
|---|
| 103 | // Command to de-selete a logical volume for RDM.
|
|---|
| 104 | //
|
|---|
| 105 | deallvolumesCmd = new
|
|---|
| 106 | G4UIcmdWithoutParameter("/grdm/noVolumes",this);
|
|---|
| 107 | deallvolumesCmd->SetGuidance
|
|---|
| 108 | (" RDM is not applied to any logical volumes");
|
|---|
| 109 |
|
|---|
| 110 | // deallvolumesCmd->SetParameterName("RemoveAVolume",true);
|
|---|
| 111 | //
|
|---|
| 112 | // The next command contols whether the branching ratio biasing will be applied or not
|
|---|
| 113 | //
|
|---|
| 114 | brbiasCmd = new G4UIcmdWithABool ("/grdm/BRbias",this);
|
|---|
| 115 | brbiasCmd->SetGuidance("false: no biasing; true: all branches are treated as equal");
|
|---|
| 116 | brbiasCmd->SetParameterName("BRBias",true);
|
|---|
| 117 | brbiasCmd->SetDefaultValue(true);
|
|---|
| 118 |
|
|---|
| 119 | //
|
|---|
| 120 | // Command to define the incident particle source time profile.
|
|---|
| 121 | //
|
|---|
| 122 | sourcetimeprofileCmd = new
|
|---|
| 123 | G4UIcmdWithAString("/grdm/sourceTimeProfile",this);
|
|---|
| 124 | sourcetimeprofileCmd->SetGuidance
|
|---|
| 125 | ("Supply the name of the ascii file containing the source particle time profile");
|
|---|
| 126 | sourcetimeprofileCmd->SetParameterName("STimeProfile",true);
|
|---|
| 127 | sourcetimeprofileCmd->SetDefaultValue("source.data");
|
|---|
| 128 | //
|
|---|
| 129 | //
|
|---|
| 130 | // Command to define the incident particle source time profile.
|
|---|
| 131 | //
|
|---|
| 132 | decaybiasprofileCmd = new
|
|---|
| 133 | G4UIcmdWithAString("/grdm/decayBiasProfile",this);
|
|---|
| 134 | decaybiasprofileCmd->SetGuidance
|
|---|
| 135 | ("Supply the name of the ascii file containing the decay bias time profile");
|
|---|
| 136 | decaybiasprofileCmd->SetParameterName("DBiasProfile",true);
|
|---|
| 137 | decaybiasprofileCmd->SetDefaultValue("bias.data");
|
|---|
| 138 | //
|
|---|
| 139 |
|
|---|
| 140 | //
|
|---|
| 141 | // This command setup the nuclei spliting parameter
|
|---|
| 142 | //
|
|---|
| 143 | splitnucleiCmd = new G4UIcmdWithAnInteger("/grdm/splitNuclei",this);
|
|---|
| 144 | splitnucleiCmd->SetGuidance("Set number of spliting for the isotopes.");
|
|---|
| 145 | splitnucleiCmd->SetParameterName("NSplit",true);
|
|---|
| 146 | splitnucleiCmd->SetDefaultValue(1);
|
|---|
| 147 | splitnucleiCmd->SetRange("NSplit>=1");
|
|---|
| 148 |
|
|---|
| 149 | //
|
|---|
| 150 | // This command setup the verbose level of radioactive decay
|
|---|
| 151 | //
|
|---|
| 152 | verboseCmd = new G4UIcmdWithAnInteger("/grdm/verbose",this);
|
|---|
| 153 | verboseCmd->SetGuidance("Set verbose level: 0, 1, 2 or 3");
|
|---|
| 154 | verboseCmd->SetParameterName("VerboseLevel",true);
|
|---|
| 155 | verboseCmd->SetDefaultValue(1);
|
|---|
| 156 | verboseCmd->SetRange("VerboseLevel>=0");
|
|---|
| 157 |
|
|---|
| 158 | }
|
|---|
| 159 | ////////////////////////////////////////////////////////////////////////////////
|
|---|
| 160 | //
|
|---|
| 161 | G4RadioactiveDecaymessenger::~G4RadioactiveDecaymessenger ()
|
|---|
| 162 | {
|
|---|
| 163 | delete grdmDirectory;
|
|---|
| 164 | delete nucleuslimitsCmd;
|
|---|
| 165 | delete sourcetimeprofileCmd;
|
|---|
| 166 | delete decaybiasprofileCmd;
|
|---|
| 167 | delete analoguemcCmd;
|
|---|
| 168 | delete fbetaCmd;
|
|---|
| 169 | delete brbiasCmd;
|
|---|
| 170 | delete splitnucleiCmd;
|
|---|
| 171 | delete verboseCmd;
|
|---|
| 172 | delete avolumeCmd;
|
|---|
| 173 | delete deavolumeCmd;
|
|---|
| 174 | delete allvolumesCmd;
|
|---|
| 175 | delete deallvolumesCmd;
|
|---|
| 176 | }
|
|---|
| 177 | ////////////////////////////////////////////////////////////////////////////////
|
|---|
| 178 | //
|
|---|
| 179 | void G4RadioactiveDecaymessenger::SetNewValue (G4UIcommand *command, G4String newValues)
|
|---|
| 180 | {
|
|---|
| 181 | if (command==nucleuslimitsCmd) {theRadioactiveDecayContainer->
|
|---|
| 182 | SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues));}
|
|---|
| 183 | else if (command==analoguemcCmd) {
|
|---|
| 184 | G4int vl;
|
|---|
| 185 | const char* t = newValues;
|
|---|
| 186 | std::istringstream is(t);
|
|---|
| 187 | is >> vl;
|
|---|
| 188 | theRadioactiveDecayContainer->SetAnalogueMonteCarlo(vl!=0);}
|
|---|
| 189 | else if (command==fbetaCmd) {
|
|---|
| 190 | G4int vl;
|
|---|
| 191 | const char* t = newValues;
|
|---|
| 192 | std::istringstream is(t);
|
|---|
| 193 | is >> vl;
|
|---|
| 194 | theRadioactiveDecayContainer->SetFBeta(vl!=0);}
|
|---|
| 195 | else if (command==avolumeCmd) {theRadioactiveDecayContainer->
|
|---|
| 196 | SelectAVolume(newValues);}
|
|---|
| 197 | else if (command==deavolumeCmd) {theRadioactiveDecayContainer->
|
|---|
| 198 | DeselectAVolume(newValues);}
|
|---|
| 199 | else if (command==allvolumesCmd) {theRadioactiveDecayContainer->
|
|---|
| 200 | SelectAllVolumes();}
|
|---|
| 201 | else if (command==deallvolumesCmd) {theRadioactiveDecayContainer->
|
|---|
| 202 | DeselectAllVolumes();}
|
|---|
| 203 | else if (command==brbiasCmd) {
|
|---|
| 204 | G4int vl;
|
|---|
| 205 | const char* t = newValues;
|
|---|
| 206 | std::istringstream is(t);
|
|---|
| 207 | is >> vl;
|
|---|
| 208 | theRadioactiveDecayContainer->SetBRBias(vl!=0);}
|
|---|
| 209 | else if (command==sourcetimeprofileCmd) {theRadioactiveDecayContainer->
|
|---|
| 210 | SetSourceTimeProfile(newValues);}
|
|---|
| 211 | else if (command==decaybiasprofileCmd) {theRadioactiveDecayContainer->
|
|---|
| 212 | SetDecayBias(newValues);}
|
|---|
| 213 | else if (command==splitnucleiCmd) {theRadioactiveDecayContainer->
|
|---|
| 214 | SetSplitNuclei(splitnucleiCmd->GetNewIntValue(newValues));}
|
|---|
| 215 | else if (command==verboseCmd) {theRadioactiveDecayContainer->
|
|---|
| 216 | SetVerboseLevel(verboseCmd->GetNewIntValue(newValues));}
|
|---|
| 217 | }
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|