source: trunk/source/processes/hadronic/models/radioactive_decay/src/G4RadioactiveDecaymessenger.cc @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 9.6 KB
Line 
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//
34G4RadioactiveDecaymessenger::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  // Command contols whether ICM will be applied or not
120  //
121  icmCmd = new G4UIcmdWithABool ("/grdm/applyICM",this);
122  icmCmd->SetGuidance("True: ICM is applied; false: no");
123  icmCmd->SetParameterName("applyICM",true);
124  icmCmd->SetDefaultValue(true);
125  icmCmd->AvailableForStates(G4State_PreInit);
126  //
127  // Command contols whether ARM will be applied or not
128  //
129  armCmd = new G4UIcmdWithABool ("/grdm/applyARM",this);
130  armCmd->SetGuidance("True: ARM is applied; false: no");
131  armCmd->SetParameterName("applyARM",true);
132  armCmd->SetDefaultValue(true);
133  armCmd->AvailableForStates(G4State_PreInit);
134  //
135  // Command to set the h-l thresold for isomer production
136  //
137  hlthCmd = new G4UIcmdWithADoubleAndUnit("/grdm/hlThreshold",this);
138  hlthCmd->SetGuidance("Set the h-l threshold for isomer production");
139  hlthCmd->SetParameterName("hlThreshold",false);
140  // hlthCmd->SetRange("hlThreshold>0.");
141  hlthCmd->SetUnitCategory("Time");
142  hlthCmd->AvailableForStates(G4State_PreInit);
143  //
144  // Command to define the incident particle source time profile.
145  //
146  sourcetimeprofileCmd = new
147    G4UIcmdWithAString("/grdm/sourceTimeProfile",this);
148  sourcetimeprofileCmd->SetGuidance
149    ("Supply the name of the ascii file containing the source particle time profile");
150  sourcetimeprofileCmd->SetParameterName("STimeProfile",true);
151  sourcetimeprofileCmd->SetDefaultValue("source.data");
152  //
153  //
154  // Command to define the incident particle source time profile.
155  //
156  decaybiasprofileCmd = new
157    G4UIcmdWithAString("/grdm/decayBiasProfile",this);
158  decaybiasprofileCmd->SetGuidance
159    ("Supply the name of the ascii file containing the decay bias time profile");
160  decaybiasprofileCmd->SetParameterName("DBiasProfile",true);
161  decaybiasprofileCmd->SetDefaultValue("bias.data");
162  //
163
164  //
165  // This command setup the nuclei spliting parameter
166  //
167  splitnucleiCmd = new G4UIcmdWithAnInteger("/grdm/splitNuclei",this);
168  splitnucleiCmd->SetGuidance("Set number of spliting for the isotopes.");
169  splitnucleiCmd->SetParameterName("NSplit",true);
170  splitnucleiCmd->SetDefaultValue(1);
171  splitnucleiCmd->SetRange("NSplit>=1");
172
173  //
174  // This command setup the verbose level of radioactive decay
175  //
176  verboseCmd = new G4UIcmdWithAnInteger("/grdm/verbose",this);
177  verboseCmd->SetGuidance("Set verbose level: 0, 1, 2 or 3");
178  verboseCmd->SetParameterName("VerboseLevel",true);
179  verboseCmd->SetDefaultValue(1);
180  verboseCmd->SetRange("VerboseLevel>=0");
181
182}
183////////////////////////////////////////////////////////////////////////////////
184//
185G4RadioactiveDecaymessenger::~G4RadioactiveDecaymessenger ()
186{
187  delete grdmDirectory;
188  delete nucleuslimitsCmd;
189  delete sourcetimeprofileCmd;
190  delete decaybiasprofileCmd;
191  delete analoguemcCmd;
192  delete fbetaCmd;
193  delete brbiasCmd;
194  delete splitnucleiCmd;
195  delete verboseCmd;
196  delete avolumeCmd;
197  delete deavolumeCmd;
198  delete allvolumesCmd;
199  delete deallvolumesCmd;
200  delete icmCmd;
201  delete armCmd;
202  delete hlthCmd;
203}
204////////////////////////////////////////////////////////////////////////////////
205//
206void G4RadioactiveDecaymessenger::SetNewValue (G4UIcommand *command, G4String newValues)
207{
208  if (command==nucleuslimitsCmd) {theRadioactiveDecayContainer->
209                                    SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues));}
210  else if  (command==analoguemcCmd) {
211    G4int vl;
212    const char* t = newValues;
213    std::istringstream is(t);
214    is >> vl;
215    theRadioactiveDecayContainer->SetAnalogueMonteCarlo(vl!=0);}
216  else if  (command==fbetaCmd) {
217    G4int vl;
218    const char* t = newValues;
219    std::istringstream is(t);
220    is >> vl;
221    theRadioactiveDecayContainer->SetFBeta(vl!=0);}
222  else if  (command==avolumeCmd) {theRadioactiveDecayContainer->
223                                   SelectAVolume(newValues);}
224  else if  (command==deavolumeCmd) {theRadioactiveDecayContainer->
225                                   DeselectAVolume(newValues);}
226  else if  (command==allvolumesCmd) {theRadioactiveDecayContainer->
227                                   SelectAllVolumes();}
228  else if  (command==deallvolumesCmd) {theRadioactiveDecayContainer->
229                                   DeselectAllVolumes();}
230  else if  (command==brbiasCmd) {
231    G4int vl;
232    const char* t = newValues;
233    std::istringstream is(t);
234    is >> vl;
235    theRadioactiveDecayContainer->SetBRBias(vl!=0);}
236  else if (command==sourcetimeprofileCmd) {theRadioactiveDecayContainer->
237                                             SetSourceTimeProfile(newValues);}
238  else if (command==decaybiasprofileCmd) {theRadioactiveDecayContainer->
239                                            SetDecayBias(newValues);}
240  else if (command==splitnucleiCmd) {theRadioactiveDecayContainer->
241                                       SetSplitNuclei(splitnucleiCmd->GetNewIntValue(newValues));}
242  else if (command==verboseCmd) {theRadioactiveDecayContainer->
243                                       SetVerboseLevel(verboseCmd->GetNewIntValue(newValues));}
244  else if (command==icmCmd ) {theRadioactiveDecayContainer->
245      SetICM(icmCmd->GetNewBoolValue(newValues));}
246  else if (command==armCmd ) {theRadioactiveDecayContainer->
247      SetARM(armCmd->GetNewBoolValue(newValues));}
248  else if (command==hlthCmd ) {theRadioactiveDecayContainer->
249      SetHLThreshold(hlthCmd->GetNewDoubleValue(newValues));}
250}
251
252
253
254
255
256
Note: See TracBrowser for help on using the repository browser.