Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RadioactiveDecayMessenger.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//
26
27////////////////////////////////////////////////////////////////////////////////
28// //
29// File: G4RadioactiveDecayMessenger.cc //
30// Author: D.H. Wright (SLAC) //
31// Date: 29 August 2017 //
32// Description: messenger class for the non-biased version of //
33// G4RadioactiveDecay. Based on the code of F. Lei and //
34// P.R. Truscott. //
35// //
36////////////////////////////////////////////////////////////////////////////////
37
39#include "G4NuclearLevelData.hh"
40#include <sstream>
42
43
45(G4RadioactiveDecay* theRadioactiveDecayContainer1)
46:theRadioactiveDecayContainer(theRadioactiveDecayContainer1)
47{
48 rdmDirectory = new G4UIdirectory("/process/had/rdm/");
49 rdmDirectory->SetGuidance("Controls for the Radioactive Decay Module.");
50
51 // Command to define the limits on nucleus the RDM will treat.
52 nucleuslimitsCmd = new G4UIcmdWithNucleusLimits("/process/had/rdm/nucleusLimits",this);
53 nucleuslimitsCmd->SetGuidance("Set the atomic weight and number limits for the RDM.");
54 nucleuslimitsCmd->SetParameterName("AMin","AMax","ZMin","ZMax",true);
55
56 // Select a logical volume for RDM
57 avolumeCmd = new G4UIcmdWithAString("/process/had/rdm/selectVolume",this);
58 avolumeCmd->SetGuidance("Supply a logical volumes name to add it to the RDM apply list");
59 avolumeCmd->SetParameterName("AVolume",false);
60
61 // De-select a logical volume for RDM
62 deavolumeCmd = new G4UIcmdWithAString("/process/had/rdm/deselectVolume",this);
63 deavolumeCmd->SetGuidance("Supply a logical volumes name to remove it from the RDM apply list");
64 deavolumeCmd->SetParameterName("AVolume",false);
65
66 // Select all logical volumes for RDM
67 allvolumesCmd = new G4UIcmdWithoutParameter("/process/had/rdm/allVolumes",this);
68 allvolumesCmd->SetGuidance(" apply RDM to all logical volumes. No parameter required.");
69 // allvolumeCmd->SetParameterName("AddAVolume",true);
70
71 // De-select all logical volumes for RDM
72 deallvolumesCmd = new G4UIcmdWithoutParameter("/process/had/rdm/noVolumes",this);
73 deallvolumesCmd->SetGuidance(" RDM is not applied to any logical volumes");
74 // deallvolumesCmd->SetParameterName("RemoveAVolume",true);
75
76 // Command to invoke atomic relaxation or not
77 armCmd = new G4UIcmdWithABool("/process/had/rdm/applyARM",this);
78 armCmd->SetGuidance("True: ARM is applied; false: no");
79 armCmd->SetParameterName("ApplyARM",true);
80 armCmd->SetDefaultValue(true);
81 //armCmd->AvailableForStates(G4State_PreInit);
82
83 // Command to set the directional bias (collimation) vector
84 colldirCmd = new G4UIcmdWith3Vector("/process/had/rdm/decayDirection",this);
85 colldirCmd->SetGuidance("Supply the direction vector for decay products");
86 colldirCmd->SetParameterName("X","Y","Z",false);
87
88 // Command to set the directional bias (collimation) half angle ("cone")
89 collangleCmd = new G4UIcmdWithADoubleAndUnit("/process/had/rdm/decayHalfAngle",this);
90 collangleCmd->SetGuidance("Supply maximum angle from direction vector for decay products");
91 collangleCmd->SetParameterName("HalfAngle",false);
92 collangleCmd->SetUnitCategory("Angle");
93
94 // This command setup the verbose level of radioactive decay
95 verboseCmd = new G4UIcmdWithAnInteger("/process/had/rdm/verbose",this);
96 verboseCmd->SetGuidance("Set verbose level: 0, 1, 2 or 3");
97 verboseCmd->SetParameterName("VerboseLevel",true);
98 verboseCmd->SetDefaultValue(1);
99 verboseCmd->SetRange("VerboseLevel>=0");
100
101 // Use a user-defined decay datafile for a given isotope
102 userDecayDataCmd = new G4UIcommand("/process/had/rdm/setRadioactiveDecayFile",this);
103 userDecayDataCmd->SetGuidance("Supply user-defined radioactive decay data file");
104 G4UIparameter* Z_para= new G4UIparameter("Z_isotope",'i',true);
105 Z_para->SetParameterRange("Z_isotope > 0");
106 Z_para->SetGuidance("Z: Charge number of isotope");
107 G4UIparameter* A_para= new G4UIparameter("A_isotope",'i',true);
108 A_para->SetParameterRange("A_isotope > 1");
109 A_para->SetGuidance("A: mass number of isotope");
110 G4UIparameter* FileName_para= new G4UIparameter("file_name",'s',true);
111 FileName_para->SetGuidance("Name of the user data file");
112 userDecayDataCmd->SetParameter(Z_para);
113 userDecayDataCmd->SetParameter(A_para);
114 userDecayDataCmd->SetParameter(FileName_para);
115
116 // Use a user-defined evaporation data file for a given isotope
117 userEvaporationDataCmd = new G4UIcommand("/process/had/rdm/setPhotoEvaporationFile",this);
118 userEvaporationDataCmd->SetGuidance("Supply user-defined photon evaporation data file");
119 G4UIparameter* Zpara= new G4UIparameter("Z_isotope",'i',true);
120 Zpara->SetParameterRange("Z_isotope > 0");
121 Zpara->SetGuidance("Z: Charge number of isotope");
122 G4UIparameter* Apara= new G4UIparameter("A_isotope",'i',true);
123 Apara->SetParameterRange("A_isotope > 1");
124 Apara->SetGuidance("A: mass number of isotope");
125 G4UIparameter* FileNamepara= new G4UIparameter("file_name",'s',true);
126 FileNamepara->SetGuidance("Name of the user data file");
127 userEvaporationDataCmd->SetParameter(Zpara);
128 userEvaporationDataCmd->SetParameter(Apara);
129 userEvaporationDataCmd->SetParameter(FileNamepara);
130
131 // Command to set the threshold for very long decay time (i.e. radioactive
132 // decays of nuclides at rest happening later than this threshold are ignored)
133 thresholdForVeryLongDecayTimeCmd = new G4UIcmdWithADoubleAndUnit("/process/had/rdm/thresholdForVeryLongDecayTime",this);
134 thresholdForVeryLongDecayTimeCmd->SetGuidance("Ignore decays at rest of nuclides happening after this time threshold");
135 thresholdForVeryLongDecayTimeCmd->SetParameterName("ThresholdForVeryLongDecayTime",false);
136 thresholdForVeryLongDecayTimeCmd->SetUnitCategory("Time");
137}
138
139
141{
142 delete rdmDirectory;
143 delete nucleuslimitsCmd;
144 delete verboseCmd;
145 delete avolumeCmd;
146 delete deavolumeCmd;
147 delete allvolumesCmd;
148 delete deallvolumesCmd;
149 delete armCmd;
150 delete userDecayDataCmd;
151 delete userEvaporationDataCmd;
152 delete colldirCmd;
153 delete collangleCmd;
154 delete thresholdForVeryLongDecayTimeCmd;
155}
156
157
158void
160{
161 if ( command == nucleuslimitsCmd ) {
162 theRadioactiveDecayContainer->
163 SetNucleusLimits( nucleuslimitsCmd->GetNewNucleusLimitsValue( newValues ) );
164 } else if ( command == avolumeCmd ) {
165 theRadioactiveDecayContainer->SelectAVolume( newValues );
166 } else if ( command == deavolumeCmd ) {
167 theRadioactiveDecayContainer->DeselectAVolume( newValues );
168 } else if ( command == allvolumesCmd ) {
169 theRadioactiveDecayContainer->SelectAllVolumes();
170 } else if ( command == deallvolumesCmd ) {
171 theRadioactiveDecayContainer->DeselectAllVolumes();
172 } else if (command == verboseCmd) {
173 theRadioactiveDecayContainer->SetVerboseLevel(verboseCmd->GetNewIntValue(newValues) );
174 } else if (command == armCmd) {
175 theRadioactiveDecayContainer->SetARM(armCmd->GetNewBoolValue(newValues) );
176 } else if ( command == userDecayDataCmd ) {
177 G4int Z,A;
178 G4String file_name;
179 const char* nv = (const char*)newValues;
180 std::istringstream is(nv);
181 is >> Z >> A >> file_name;
182 theRadioactiveDecayContainer->AddUserDecayDataFile(Z,A,file_name);
183 } else if ( command == userEvaporationDataCmd ) {
184 G4int Z,A;
185 G4String file_name;
186 const char* nv = (const char*)newValues;
187 std::istringstream is(nv);
188 is >> Z >> A >> file_name;
190 } else if ( command == colldirCmd ) {
191 theRadioactiveDecayContainer->SetDecayDirection( colldirCmd->GetNew3VectorValue( newValues ) );
192 } else if ( command == collangleCmd ) {
193 theRadioactiveDecayContainer->SetDecayHalfAngle( collangleCmd->GetNewDoubleValue( newValues ) );
194 } else if (command == thresholdForVeryLongDecayTimeCmd) {
195 theRadioactiveDecayContainer->SetThresholdForVeryLongDecayTime(thresholdForVeryLongDecayTimeCmd->GetNewDoubleValue(newValues) );
196 }
197}
198
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
G4bool AddPrivateData(G4int Z, G4int A, const G4String &filename)
static G4NuclearLevelData * GetInstance()
G4RadioactiveDecayMessenger(G4RadioactiveDecay *theRadioactiveDecayContainer)
void SetNewValue(G4UIcommand *command, G4String newValues)
void SelectAVolume(const G4String &aVolume)
void SetVerboseLevel(G4int value)
void SetDecayHalfAngle(G4double halfAngle=0.*CLHEP::deg)
void SetDecayDirection(const G4ThreeVector &theDir)
void SetARM(G4bool arm)
void SetThresholdForVeryLongDecayTime(const G4double inputThreshold)
void AddUserDecayDataFile(G4int Z, G4int A, G4String filename)
void DeselectAVolume(const G4String &aVolume)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
G4NucleusLimits GetNewNucleusLimitsValue(G4String paramString)
void SetParameterName(const char *theNameAMin, const char *theNameAMax, const char *theNameZMin, const char *theNameZMax, G4bool omittable, G4bool currentAsDefault=true)
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:147
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:157
void SetRange(const char *rs)
Definition: G4UIcommand.hh:121
void SetGuidance(const char *theGuidance)
void SetParameterRange(const char *theRange)