ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RadioactiveDecayBaseMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4RadioactiveDecayBaseMessenger.cc
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 
28 // //
29 // File: G4RadioactiveDecayBaseMessenger.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 // //
37 
39 #include "G4NuclearLevelData.hh"
40 #include <sstream>
41 
42 
44 (G4RadioactiveDecayBase* theRadioactiveDecayContainer1)
45 :theRadioactiveDecayContainer(theRadioactiveDecayContainer1)
46 {
47  // main directory for control of the RDM
48  grdmDirectory = new G4UIdirectory("/grdm/");
49  grdmDirectory->SetGuidance("Controls for the Radioactive Decay Module.");
50 
51  // Command to define the limits on nucleus the RDM will treat.
52  nucleuslimitsCmd = new
53  G4UIcmdWithNucleusLimits("/grdm/nucleusLimits",this);
54  nucleuslimitsCmd->SetGuidance
55  ("Set the atomic weight and number limits for the RDM.");
56  nucleuslimitsCmd->SetParameterName("aMin","aMax","zMin","zMax",true);
57 
58  // Select a logical volume for RDM
59  avolumeCmd = new
60  G4UIcmdWithAString("/grdm/selectVolume",this);
61  avolumeCmd->SetGuidance
62  ("Suppply a logical volumes name to add it to the RDM apply list");
63  avolumeCmd->SetParameterName("aVolume",false);
64 
65  // De-select a logical volume for RDM
66  deavolumeCmd = new
67  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  // Select all logical volumes for RDM
73  allvolumesCmd = new
74  G4UIcmdWithoutParameter("/grdm/allVolumes",this);
75  allvolumesCmd->SetGuidance
76  (" apply RDM to all logical volumes. No parameter required.");
77  // allvolumeCmd->SetParameterName("AddAVolume",true);
78 
79  // De-select all logical volumes for RDM
80  deallvolumesCmd = new
81  G4UIcmdWithoutParameter("/grdm/noVolumes",this);
82  deallvolumesCmd->SetGuidance
83  (" RDM is not applied to any logical volumes");
84  // deallvolumesCmd->SetParameterName("RemoveAVolume",true);z
85 
86  // Command to invoke internal conversion or not
87  icmCmd = new G4UIcmdWithABool ("/grdm/applyICM",this);
88  icmCmd->SetGuidance("Command not active; kept for backward compatibility.");
89  icmCmd->SetGuidance("Internal conversion is always turned on.");
90  icmCmd->SetParameterName("applyICM",true);
91  icmCmd->SetDefaultValue(true);
92 
93  // Command to invoke 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  //armCmd->AvailableForStates(G4State_PreInit);
99 
100  // Command to set the directional bias (collimation) vector
101  colldirCmd = new G4UIcmdWith3Vector("/grdm/decayDirection",this);
102  colldirCmd->SetGuidance("Supply the direction vector for decay products");
103  colldirCmd->SetParameterName("X","Y","Z",false);
104 
105  // Command to set the directional bias (collimation) half angle ("cone")
106  collangleCmd = new G4UIcmdWithADoubleAndUnit("/grdm/decayHalfAngle",this);
107  collangleCmd->SetGuidance
108  ("Supply maximum angle from direction vector for decay products");
109  collangleCmd->SetParameterName("halfAngle",false);
110  collangleCmd->SetUnitCategory("Angle");
111 
112  // This command setup the verbose level of radioactive decay
113  verboseCmd = new G4UIcmdWithAnInteger("/grdm/verbose",this);
114  verboseCmd->SetGuidance("Set verbose level: 0, 1, 2 or 3");
115  verboseCmd->SetParameterName("VerboseLevel",true);
116  verboseCmd->SetDefaultValue(1);
117  verboseCmd->SetRange("VerboseLevel>=0");
118 
119  // Use a user-defined decay datafile for a given isotope
120  userDecayDataCmd = new G4UIcommand("/grdm/setRadioactiveDecayFile",this);
121  userDecayDataCmd->SetGuidance("Supply user-defined radioactive decay data file");
122 
123  G4UIparameter* Z_para= new G4UIparameter("Z_isotope",'i',true);
124  Z_para->SetParameterRange("Z_isotope > 0");
125  Z_para->SetGuidance("Z: Charge number of isotope");
126 
127  G4UIparameter* A_para= new G4UIparameter("A_isotope",'i',true);
128  A_para->SetParameterRange("A_isotope > 1");
129  A_para->SetGuidance("A: mass number of isotope");
130 
131  G4UIparameter* FileName_para= new G4UIparameter("file_name",'s',true);
132  FileName_para->SetGuidance("Name of the user data file");
133 
134  userDecayDataCmd->SetParameter(Z_para);
135  userDecayDataCmd->SetParameter(A_para);
136  userDecayDataCmd->SetParameter(FileName_para);
137 
138  // Use a user-defined evaporation data file for a given isotope
139  userEvaporationDataCmd = new G4UIcommand("/grdm/setPhotoEvaporationFile",this);
140  userEvaporationDataCmd->SetGuidance("Supply user-defined photon evaporation data file");
141 
142  G4UIparameter* Zpara= new G4UIparameter("Z_isotope",'i',true);
143  Zpara->SetParameterRange("Z_isotope > 0");
144  Zpara->SetGuidance("Z: Charge number of isotope");
145 
146  G4UIparameter* Apara= new G4UIparameter("A_isotope",'i',true);
147  Apara->SetParameterRange("A_isotope > 1");
148  Apara->SetGuidance("A: mass number of isotope");
149 
150  G4UIparameter* FileNamepara= new G4UIparameter("file_name",'s',true);
151  FileNamepara->SetGuidance("Name of the user data file");
152 
153  userEvaporationDataCmd->SetParameter(Zpara);
154  userEvaporationDataCmd->SetParameter(Apara);
155  userEvaporationDataCmd->SetParameter(FileNamepara);
156 }
157 
158 
160 {
161  delete grdmDirectory;
162  delete nucleuslimitsCmd;
163  delete verboseCmd;
164  delete avolumeCmd;
165  delete deavolumeCmd;
166  delete allvolumesCmd;
167  delete deallvolumesCmd;
168  delete icmCmd;
169  delete armCmd;
170  delete userDecayDataCmd;
171  delete userEvaporationDataCmd;
172  delete colldirCmd;
173  delete collangleCmd;
174 }
175 
176 
177 void
179 {
180  if (command == nucleuslimitsCmd) {
182  SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues));
183 
184  } else if (command == avolumeCmd) {
186 
187  } else if (command == deavolumeCmd) {
189 
190  } else if (command == allvolumesCmd) {
192 
193  } else if (command == deallvolumesCmd) {
195 
196  } else if (command == verboseCmd) {
198  SetVerboseLevel(verboseCmd->GetNewIntValue(newValues));
199 
200  } else if (command == icmCmd) {
202  SetICM(icmCmd->GetNewBoolValue(newValues));
203 
204  } else if (command == armCmd) {
206  SetARM(armCmd->GetNewBoolValue(newValues));
207 
208  } else if (command == userDecayDataCmd) {
209  G4int Z,A;
210  G4String file_name;
211  const char* nv = (const char*)newValues;
212  std::istringstream is(nv);
213  is >> Z >> A >> file_name;
215 
216  } else if (command == userEvaporationDataCmd) {
217  G4int Z,A;
218  G4String file_name;
219  const char* nv = (const char*)newValues;
220  std::istringstream is(nv);
221  is >> Z >> A >> file_name;
223 
224  } else if (command == colldirCmd) {
226  SetDecayDirection(colldirCmd->GetNew3VectorValue(newValues));
227 
228  } else if (command == collangleCmd) {
230  SetDecayHalfAngle(collangleCmd->GetNewDoubleValue(newValues));
231  }
232 }
233