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 // Author: F. Poignant, floriane.poignant@gma 26 // Author: F. Poignant, floriane.poignant@gmail.com 27 // 27 // 28 // file STCyclotronDetectorMesseger.cc 28 // file STCyclotronDetectorMesseger.cc 29 // 29 // 30 30 31 #include "STCyclotronDetectorMessenger.hh" 31 #include "STCyclotronDetectorMessenger.hh" 32 #include "STCyclotronDetectorConstruction.hh" 32 #include "STCyclotronDetectorConstruction.hh" 33 #include "G4UIdirectory.hh" 33 #include "G4UIdirectory.hh" 34 #include "G4UIcmdWithADoubleAndUnit.hh" 34 #include "G4UIcmdWithADoubleAndUnit.hh" 35 #include "G4UIcmdWithoutParameter.hh" 35 #include "G4UIcmdWithoutParameter.hh" 36 #include "G4UIcmdWithADouble.hh" 36 #include "G4UIcmdWithADouble.hh" 37 #include "G4UIcmdWithAString.hh" 37 #include "G4UIcmdWithAString.hh" 38 #include "G4UIcmdWithAnInteger.hh" 38 #include "G4UIcmdWithAnInteger.hh" 39 #include "G4SystemOfUnits.hh" 39 #include "G4SystemOfUnits.hh" 40 #include "G4UnitsTable.hh" 40 #include "G4UnitsTable.hh" 41 #include "G4UIcommand.hh" 41 #include "G4UIcommand.hh" 42 42 43 ////////////////////////////////////////////// 43 ///////////////////////////////////////////////////////////////////////////// 44 STCyclotronDetectorMessenger::STCyclotronDetec 44 STCyclotronDetectorMessenger::STCyclotronDetectorMessenger(STCyclotronDetectorConstruction* detector) 45 :fDet(detector) 45 :fDet(detector) 46 { 46 { 47 ///////////////////////////// 47 ///////////////////////////// 48 // Change Target parameters// 48 // Change Target parameters// 49 ///////////////////////////// 49 ///////////////////////////// 50 fChangeTarget = new G4UIdirectory("/change 50 fChangeTarget = new G4UIdirectory("/changeTarget/"); 51 fChangeTarget -> SetGuidance("Change the T 51 fChangeTarget -> SetGuidance("Change the Target diameter/thickness/material"); 52 52 53 // change Target diameter 53 // change Target diameter 54 fChangeTargetDiameterCmd = new G4UIcmdWith 54 fChangeTargetDiameterCmd = new G4UIcmdWithADoubleAndUnit("/changeTarget/diameter", this); 55 fChangeTargetDiameterCmd -> SetGuidance("C 55 fChangeTargetDiameterCmd -> SetGuidance("Change the diameter value of the target. " 56 "\nDefaul 56 "\nDefault value is 7. mm." 57 "\nThe range is between 0 and 15 57 "\nThe range is between 0 and 15 mm."); 58 fChangeTargetDiameterCmd -> SetParameterNa 58 fChangeTargetDiameterCmd -> SetParameterName("TargetDiameter", true); 59 fChangeTargetDiameterCmd -> SetRange("Targ 59 fChangeTargetDiameterCmd -> SetRange("TargetDiameter > 0. && TargetDiameter < 15."); 60 fChangeTargetDiameterCmd -> SetDefaultValu 60 fChangeTargetDiameterCmd -> SetDefaultValue(7.*mm); 61 fChangeTargetDiameterCmd -> AvailableForSt 61 fChangeTargetDiameterCmd -> AvailableForStates(G4State_Idle); 62 fChangeTargetDiameterCmd -> SetDefaultUnit 62 fChangeTargetDiameterCmd -> SetDefaultUnit("mm"); 63 fChangeTargetDiameterCmd -> SetUnitCandida 63 fChangeTargetDiameterCmd -> SetUnitCandidates("mm"); 64 64 65 // Change Target parameters 65 // Change Target parameters 66 fChangeTargetMaterial = new G4UIdirectory( 66 fChangeTargetMaterial = new G4UIdirectory("/changeTarget/designedMaterial/"); 67 fChangeTargetMaterial -> SetGuidance("Chan 67 fChangeTargetMaterial -> SetGuidance("Change the Target material choosing isotopes and elements, and their abundance in the target"); 68 68 69 //Change target material defining isotopes 69 //Change target material defining isotopes 70 fTargetIsotopeName = new G4UIcmdWithAStrin 70 fTargetIsotopeName = new G4UIcmdWithAString("/changeTarget/designedMaterial/isotopeName",this); 71 fTargetIsotopeName->SetGuidance("name of t 71 fTargetIsotopeName->SetGuidance("name of the isotope - ex : Ni64"); 72 fTargetIsotopeName->SetParameterName("Isot 72 fTargetIsotopeName->SetParameterName("IsotopeName",false); 73 fTargetIsotopeName->AvailableForStates(G4S 73 fTargetIsotopeName->AvailableForStates(G4State_Idle); 74 74 75 fTargetIsotopeZ = new G4UIcmdWithADouble(" 75 fTargetIsotopeZ = new G4UIcmdWithADouble("/changeTarget/designedMaterial/isotopeZ",this); 76 fTargetIsotopeZ-> SetGuidance("Z of the is 76 fTargetIsotopeZ-> SetGuidance("Z of the isotope"); 77 fTargetIsotopeZ->SetParameterName("Isotope 77 fTargetIsotopeZ->SetParameterName("IsotopeZ",false); 78 fTargetIsotopeZ->AvailableForStates(G4Stat 78 fTargetIsotopeZ->AvailableForStates(G4State_Idle); 79 79 80 fTargetIsotopeN = new G4UIcmdWithAnInteger 80 fTargetIsotopeN = new G4UIcmdWithAnInteger("/changeTarget/designedMaterial/isotopeN",this); 81 fTargetIsotopeN->SetGuidance("N (number of 81 fTargetIsotopeN->SetGuidance("N (number of nucleons) of the isotope"); 82 fTargetIsotopeN->SetParameterName("Isotope 82 fTargetIsotopeN->SetParameterName("IsotopeN",false); 83 fTargetIsotopeN->AvailableForStates(G4Stat 83 fTargetIsotopeN->AvailableForStates(G4State_Idle); 84 84 85 fTargetIsotopeA = new G4UIcmdWithADouble(" 85 fTargetIsotopeA = new G4UIcmdWithADouble("/changeTarget/designedMaterial/isotopeA",this); 86 fTargetIsotopeA->SetGuidance("A of the iso 86 fTargetIsotopeA->SetGuidance("A of the isotope, in g/cm3"); 87 fTargetIsotopeA->SetParameterName("Isotope 87 fTargetIsotopeA->SetParameterName("IsotopeA",false); 88 fTargetIsotopeA->AvailableForStates(G4Stat 88 fTargetIsotopeA->AvailableForStates(G4State_Idle); 89 89 90 //Define elements 90 //Define elements 91 fTargetElementName= new G4UIcmdWithAString 91 fTargetElementName= new G4UIcmdWithAString("/changeTarget/designedMaterial/ElementName",this); 92 fTargetElementName->SetGuidance("Name of t 92 fTargetElementName->SetGuidance("Name of the material - ex : PureNi64"); 93 fTargetElementName->SetParameterName("Elem 93 fTargetElementName->SetParameterName("ElementName",false); 94 fTargetElementName->AvailableForStates(G4S 94 fTargetElementName->AvailableForStates(G4State_Idle); 95 95 96 fTargetElementSymbole=new G4UIcmdWithAStri 96 fTargetElementSymbole=new G4UIcmdWithAString("/changeTarget/designedMaterial/ElementSymbole",this); 97 fTargetElementSymbole->SetGuidance("Symbol 97 fTargetElementSymbole->SetGuidance("Symbole of the element : ex 64Ni"); 98 fTargetElementSymbole->SetParameterName("E 98 fTargetElementSymbole->SetParameterName("ElementSymbole", false); 99 fTargetElementSymbole->AvailableForStates( 99 fTargetElementSymbole->AvailableForStates(G4State_Idle); 100 100 101 fTargetElementNComponents = new G4UIcmdWit 101 fTargetElementNComponents = new G4UIcmdWithAnInteger("/changeTarget/designedMaterial/ElementNComponents",this); 102 fTargetElementNComponents->SetGuidance("Nu 102 fTargetElementNComponents->SetGuidance("Number of isotopes in the element"); 103 fTargetElementNComponents->SetParameterNam 103 fTargetElementNComponents->SetParameterName("ElementNComponent", false); 104 fTargetElementNComponents->AvailableForSta 104 fTargetElementNComponents->AvailableForStates(G4State_Idle); 105 105 106 fTargetElementAbundance = new G4UIcmdWithA 106 fTargetElementAbundance = new G4UIcmdWithADouble("/changeTarget/designedMaterial/IsotopeAbundanceInElement",this); 107 fTargetElementAbundance->SetGuidance("Abun 107 fTargetElementAbundance->SetGuidance("Abundance of the isotope in the target"); 108 fTargetElementAbundance->SetParameterName( 108 fTargetElementAbundance->SetParameterName("IsotopeAbundance",false); 109 fTargetElementAbundance->AvailableForState 109 fTargetElementAbundance->AvailableForStates(G4State_Idle); 110 110 111 //Change material properties 111 //Change material properties 112 fChangeTargetMaterialDensityCmd = new G4UI 112 fChangeTargetMaterialDensityCmd = new G4UIcmdWithADouble("/changeTarget/designedMaterial/materialDensity", this); 113 fChangeTargetMaterialDensityCmd -> SetGuid 113 fChangeTargetMaterialDensityCmd -> SetGuidance("Change the density value of the Target Material." 114 "\nDefault value : 8.85 g/cm3.") 114 "\nDefault value : 8.85 g/cm3."); 115 fChangeTargetMaterialDensityCmd -> SetPara 115 fChangeTargetMaterialDensityCmd -> SetParameterName("TargetMaterialDensity", true); 116 fChangeTargetMaterialDensityCmd -> SetDefa 116 fChangeTargetMaterialDensityCmd -> SetDefaultValue(8.85); 117 fChangeTargetMaterialDensityCmd -> Availab 117 fChangeTargetMaterialDensityCmd -> AvailableForStates(G4State_Idle); 118 118 119 fTargetMaterialNComponents = new G4UIcmdWi 119 fTargetMaterialNComponents = new G4UIcmdWithAnInteger("/changeTarget/designedMaterial/MaterialNComponents",this); 120 fTargetMaterialNComponents->SetGuidance("N 120 fTargetMaterialNComponents->SetGuidance("Number of elements in the target material"); 121 fTargetMaterialNComponents->SetParameterNa 121 fTargetMaterialNComponents->SetParameterName("MaterialNComponents",false); 122 fTargetMaterialNComponents->AvailableForSt 122 fTargetMaterialNComponents->AvailableForStates(G4State_PreInit,G4State_Idle); 123 123 124 fTargetMaterialFractionMass= new G4UIcmdWi 124 fTargetMaterialFractionMass= new G4UIcmdWithADouble("/changeTarget/designedMaterial/MaterialFractionMass",this); 125 fTargetMaterialFractionMass->SetGuidance(" 125 fTargetMaterialFractionMass->SetGuidance("Fraction mass of the element in the material"); 126 fTargetMaterialFractionMass->SetParameterN 126 fTargetMaterialFractionMass->SetParameterName("MaterialFractionMass",false); 127 fTargetMaterialFractionMass->AvailableForS 127 fTargetMaterialFractionMass->AvailableForStates(G4State_Idle); 128 128 129 fTargetMaterialNaturalElement= new G4UIcmd 129 fTargetMaterialNaturalElement= new G4UIcmdWithAString("/changeTarget/designedMaterial/naturalElementName",this); 130 fTargetMaterialNaturalElement->SetGuidance 130 fTargetMaterialNaturalElement->SetGuidance("Add an element using NIST database"); 131 fTargetMaterialNaturalElement->SetParamete 131 fTargetMaterialNaturalElement->SetParameterName("NaturalElement",false); 132 fTargetMaterialNaturalElement->AvailableFo 132 fTargetMaterialNaturalElement->AvailableForStates(G4State_Idle); 133 133 134 fTargetMaterialNaturalElementFractionMass= 134 fTargetMaterialNaturalElementFractionMass= new G4UIcmdWithADouble("/changeTarget/designedMaterial/naturalElementFractionMass",this); 135 fTargetMaterialNaturalElementFractionMass- 135 fTargetMaterialNaturalElementFractionMass->SetGuidance("Add the fraction mass of the natural element"); 136 fTargetMaterialNaturalElementFractionMass- 136 fTargetMaterialNaturalElementFractionMass->SetParameterName("NaturalElementFractionMass",false); 137 fTargetMaterialNaturalElementFractionMass- 137 fTargetMaterialNaturalElementFractionMass->AvailableForStates(G4State_Idle); 138 138 139 139 140 fUpdateMaterial = new G4UIcmdWithoutParame 140 fUpdateMaterial = new G4UIcmdWithoutParameter("/changeTarget/designedMaterial/update",this); 141 fUpdateMaterial->SetGuidance("Update the m 141 fUpdateMaterial->SetGuidance("Update the material once its components are defined"); 142 fUpdateMaterial->AvailableForStates(G4Stat 142 fUpdateMaterial->AvailableForStates(G4State_Idle); 143 143 144 //Change material using physics NIST 144 //Change material using physics NIST 145 fChangeTargetMaterialCmd = new G4UIcmdWith 145 fChangeTargetMaterialCmd = new G4UIcmdWithAString("/changeTarget/materialNist", this); 146 fChangeTargetMaterialCmd -> SetGuidance("C 146 fChangeTargetMaterialCmd -> SetGuidance("Change the material of your target using the NIST database." 147 "\nTo get the list of the availab 147 "\nTo get the list of the available NIST materials, please select 'TargetMaterial->NistMaterialList'." 148 "\nExample of a NIST material : ' 148 "\nExample of a NIST material : 'G4_Ni'."); 149 fChangeTargetMaterialCmd -> SetParameterNa 149 fChangeTargetMaterialCmd -> SetParameterName("TargetMaterial",false); 150 150 151 151 152 //Change Target thickness 152 //Change Target thickness 153 fChangeTargetThicknessCmd = new G4UIcmdWi 153 fChangeTargetThicknessCmd = new G4UIcmdWithADoubleAndUnit("/changeTarget/thickness", this); 154 fChangeTargetThicknessCmd -> SetGuidance( 154 fChangeTargetThicknessCmd -> SetGuidance("Change the thickness value of the Target." 155 "\nDefault value : 0.6 mm."); 155 "\nDefault value : 0.6 mm."); 156 fChangeTargetThicknessCmd -> SetParameterN 156 fChangeTargetThicknessCmd -> SetParameterName("TargetThickness", true); 157 fChangeTargetThicknessCmd -> SetDefaultVal 157 fChangeTargetThicknessCmd -> SetDefaultValue(0.6*mm); 158 fChangeTargetThicknessCmd -> AvailableForS 158 fChangeTargetThicknessCmd -> AvailableForStates(G4State_Idle); 159 fChangeTargetThicknessCmd -> SetDefaultUni 159 fChangeTargetThicknessCmd -> SetDefaultUnit("mm"); 160 fChangeTargetThicknessCmd -> SetUnitCandid 160 fChangeTargetThicknessCmd -> SetUnitCandidates("mm"); 161 161 162 162 163 ////////////////////////// 163 ////////////////////////// 164 //Change foil parameters// 164 //Change foil parameters// 165 ////////////////////////// 165 ////////////////////////// 166 166 167 fChangeFoil = new G4UIdirectory("/changeFo 167 fChangeFoil = new G4UIdirectory("/changeFoil/"); 168 fChangeFoil -> SetGuidance("Change the Foi 168 fChangeFoil -> SetGuidance("Change the Foil thickness"); 169 169 170 // Change Foil Thickness 170 // Change Foil Thickness 171 fChangeFoilThicknessCmd = new G4UIcmdWithA 171 fChangeFoilThicknessCmd = new G4UIcmdWithADoubleAndUnit("/changeFoil/thickness", this); 172 fChangeFoilThicknessCmd -> SetGuidance("Ch 172 fChangeFoilThicknessCmd -> SetGuidance("Change the thickness value of the foil " 173 "\nThe default value is 0.32 mm.") 173 "\nThe default value is 0.32 mm."); 174 fChangeFoilThicknessCmd -> SetParameterNam 174 fChangeFoilThicknessCmd -> SetParameterName("FoilThickness", true); 175 fChangeFoilThicknessCmd -> SetDefaultValue 175 fChangeFoilThicknessCmd -> SetDefaultValue(.32*mm); 176 fChangeFoilThicknessCmd -> AvailableForSta 176 fChangeFoilThicknessCmd -> AvailableForStates(G4State_Idle); 177 fChangeFoilThicknessCmd -> SetDefaultUnit( 177 fChangeFoilThicknessCmd -> SetDefaultUnit("mm"); 178 fChangeFoilThicknessCmd -> SetUnitCandidat 178 fChangeFoilThicknessCmd -> SetUnitCandidates("mm"); 179 179 180 // Change Target material 180 // Change Target material 181 fChangeFoilMaterial = new G4UIdirectory("/ 181 fChangeFoilMaterial = new G4UIdirectory("/changeFoil/designedMaterial/"); 182 fChangeFoilMaterial -> SetGuidance("Change 182 fChangeFoilMaterial -> SetGuidance("Change the Foil material choosing isotopes and elements, and their abundance in the foil"); 183 183 184 //Change target material defining isotopes 184 //Change target material defining isotopes 185 fFoilIsotopeName = new G4UIcmdWithAString( 185 fFoilIsotopeName = new G4UIcmdWithAString("/changeFoil/designedMaterial/isotopeName",this); 186 fFoilIsotopeName->SetGuidance("name of the 186 fFoilIsotopeName->SetGuidance("name of the isotope - ex : Ni64"); 187 fFoilIsotopeName->SetParameterName("foilIs 187 fFoilIsotopeName->SetParameterName("foilIsotopeName",false); 188 fFoilIsotopeName->AvailableForStates(G4Sta 188 fFoilIsotopeName->AvailableForStates(G4State_Idle); 189 189 190 fFoilIsotopeZ = new G4UIcmdWithADouble("/c 190 fFoilIsotopeZ = new G4UIcmdWithADouble("/changeFoil/designedMaterial/isotopeZ",this); 191 fFoilIsotopeZ-> SetGuidance("Z of the isot 191 fFoilIsotopeZ-> SetGuidance("Z of the isotope"); 192 fFoilIsotopeZ->SetParameterName("foilIsoto 192 fFoilIsotopeZ->SetParameterName("foilIsotopeZ",false); 193 fFoilIsotopeZ->AvailableForStates(G4State_ 193 fFoilIsotopeZ->AvailableForStates(G4State_Idle); 194 194 195 fFoilIsotopeN = new G4UIcmdWithAnInteger(" 195 fFoilIsotopeN = new G4UIcmdWithAnInteger("/changeFoil/designedMaterial/isotopeN",this); 196 fFoilIsotopeN->SetGuidance("N (number of n 196 fFoilIsotopeN->SetGuidance("N (number of nucleons) of the isotope"); 197 fFoilIsotopeN->SetParameterName("foilIsoto 197 fFoilIsotopeN->SetParameterName("foilIsotopeN",false); 198 fFoilIsotopeN->AvailableForStates(G4State_ 198 fFoilIsotopeN->AvailableForStates(G4State_Idle); 199 199 200 fFoilIsotopeA = new G4UIcmdWithADouble("/c 200 fFoilIsotopeA = new G4UIcmdWithADouble("/changeFoil/designedMaterial/isotopeA",this); 201 fFoilIsotopeA->SetGuidance("A of the isoto 201 fFoilIsotopeA->SetGuidance("A of the isotope, in g/cm3"); 202 fFoilIsotopeA->SetParameterName("foilIsoto 202 fFoilIsotopeA->SetParameterName("foilIsotopeA",false); 203 fFoilIsotopeA->AvailableForStates(G4State_ 203 fFoilIsotopeA->AvailableForStates(G4State_Idle); 204 204 205 //Define elements 205 //Define elements 206 206 207 fFoilElementName= new G4UIcmdWithAString(" 207 fFoilElementName= new G4UIcmdWithAString("/changeFoil/designedMaterial/ElementName",this); 208 fFoilElementName->SetGuidance("Name of the 208 fFoilElementName->SetGuidance("Name of the material - ex : PureNi64"); 209 fFoilElementName->SetParameterName("foilEl 209 fFoilElementName->SetParameterName("foilElementName",false); 210 fFoilElementName->AvailableForStates(G4Sta 210 fFoilElementName->AvailableForStates(G4State_Idle); 211 211 212 fFoilElementSymbole=new G4UIcmdWithAString 212 fFoilElementSymbole=new G4UIcmdWithAString("/changeFoil/designedMaterial/ElementSymbole",this); 213 fFoilElementSymbole->SetGuidance("Symbole 213 fFoilElementSymbole->SetGuidance("Symbole of the element : ex 64Ni"); 214 fFoilElementSymbole->SetParameterName("foi 214 fFoilElementSymbole->SetParameterName("foilElementSymbole", false); 215 fFoilElementSymbole->AvailableForStates(G4 215 fFoilElementSymbole->AvailableForStates(G4State_Idle); 216 216 217 fFoilElementNComponents = new G4UIcmdWithA 217 fFoilElementNComponents = new G4UIcmdWithAnInteger("/changeFoil/designedMaterial/ElementNComponents",this); 218 fFoilElementNComponents->SetGuidance("Numb 218 fFoilElementNComponents->SetGuidance("Number of isotopes in the element"); 219 fFoilElementNComponents->SetParameterName( 219 fFoilElementNComponents->SetParameterName("foilElementNComponent", false); 220 fFoilElementNComponents->AvailableForState 220 fFoilElementNComponents->AvailableForStates(G4State_Idle); 221 221 222 fFoilElementAbundance = new G4UIcmdWithADo 222 fFoilElementAbundance = new G4UIcmdWithADouble("/changeFoil/designedMaterial/IsotopeAbundanceInElement",this); 223 fFoilElementAbundance->SetGuidance("Abunda 223 fFoilElementAbundance->SetGuidance("Abundance of the isotope in the foil"); 224 fFoilElementAbundance->SetParameterName("f 224 fFoilElementAbundance->SetParameterName("foilIsotopeAbundance",false); 225 fFoilElementAbundance->AvailableForStates( 225 fFoilElementAbundance->AvailableForStates(G4State_Idle); 226 226 227 //Change material properties 227 //Change material properties 228 fChangeFoilMaterialDensityCmd = new G4UIcm 228 fChangeFoilMaterialDensityCmd = new G4UIcmdWithADouble("/changeFoil/designedMaterial/materialDensity", this); 229 fChangeFoilMaterialDensityCmd -> SetGuidan 229 fChangeFoilMaterialDensityCmd -> SetGuidance("Change the density value of the Target Material"); 230 fChangeFoilMaterialDensityCmd -> SetParame 230 fChangeFoilMaterialDensityCmd -> SetParameterName("FoilMaterialDensity", true); 231 fChangeFoilMaterialDensityCmd -> Available 231 fChangeFoilMaterialDensityCmd -> AvailableForStates(G4State_Idle); 232 232 233 fFoilMaterialNComponents = new G4UIcmdWith 233 fFoilMaterialNComponents = new G4UIcmdWithAnInteger("/changeFoil/designedMaterial/MaterialNComponents",this); 234 fFoilMaterialNComponents->SetGuidance("Num 234 fFoilMaterialNComponents->SetGuidance("Number of elements in the target material"); 235 fFoilMaterialNComponents->SetParameterName 235 fFoilMaterialNComponents->SetParameterName("foilMaterialNComponents",false); 236 fFoilMaterialNComponents->AvailableForStat 236 fFoilMaterialNComponents->AvailableForStates(G4State_Idle); 237 237 238 fFoilMaterialFractionMass= new G4UIcmdWith 238 fFoilMaterialFractionMass= new G4UIcmdWithADouble("/changeFoil/designedMaterial/MaterialFractionMass",this); 239 fFoilMaterialFractionMass->SetGuidance("Fr 239 fFoilMaterialFractionMass->SetGuidance("Fraction mass of the element in the material"); 240 fFoilMaterialFractionMass->SetParameterNam 240 fFoilMaterialFractionMass->SetParameterName("foilMaterialFractionMass",false); 241 fFoilMaterialFractionMass->AvailableForSta 241 fFoilMaterialFractionMass->AvailableForStates(G4State_Idle); 242 242 243 fFoilMaterialNaturalElement= new G4UIcmdWi 243 fFoilMaterialNaturalElement= new G4UIcmdWithAString("/changeFoil/designedMaterial/naturalElementName",this); 244 fFoilMaterialNaturalElement->SetGuidance(" 244 fFoilMaterialNaturalElement->SetGuidance("Add an element using NIST database"); 245 fFoilMaterialNaturalElement->SetParameterN 245 fFoilMaterialNaturalElement->SetParameterName("foilNaturalElement",false); 246 fFoilMaterialNaturalElement->AvailableForS 246 fFoilMaterialNaturalElement->AvailableForStates(G4State_Idle); 247 247 248 fFoilMaterialNaturalElementFractionMass= n 248 fFoilMaterialNaturalElementFractionMass= new G4UIcmdWithADouble("/changeFoil/designedMaterial/naturalElementFractionMass",this); 249 fFoilMaterialNaturalElementFractionMass->S 249 fFoilMaterialNaturalElementFractionMass->SetGuidance("Add the fraction mass of the natural element"); 250 fFoilMaterialNaturalElementFractionMass->S 250 fFoilMaterialNaturalElementFractionMass->SetParameterName("foilNaturalElementFractionMass",false); 251 fFoilMaterialNaturalElementFractionMass->A 251 fFoilMaterialNaturalElementFractionMass->AvailableForStates(G4State_Idle); 252 252 253 253 254 fUpdateFoilMaterial = new G4UIcmdWithoutPa 254 fUpdateFoilMaterial = new G4UIcmdWithoutParameter("/changeFoil/designedMaterial/update",this); 255 fUpdateFoilMaterial->SetGuidance("Update t 255 fUpdateFoilMaterial->SetGuidance("Update the material once its components are defined"); 256 fUpdateFoilMaterial->AvailableForStates(G4 256 fUpdateFoilMaterial->AvailableForStates(G4State_Idle); 257 257 258 //Change foil material using physics NIST 258 //Change foil material using physics NIST 259 259 260 fChangeFoilMaterialCmd = new G4UIcmdWithAS 260 fChangeFoilMaterialCmd = new G4UIcmdWithAString("/changeFoil/materialNist", this); 261 fChangeFoilMaterialCmd -> SetGuidance("Cha 261 fChangeFoilMaterialCmd -> SetGuidance("Change the material of your foil using the NIST database." 262 "\nTo get the list of the available 262 "\nTo get the list of the available NIST materials, please select 'TargetMaterial->NistMaterialList'." 263 "\nExample of a NIST material : 'G4 263 "\nExample of a NIST material : 'G4_Ni'."); 264 fChangeFoilMaterialCmd -> SetParameterName 264 fChangeFoilMaterialCmd -> SetParameterName("FoilMaterial",false); 265 265 266 } 266 } 267 267 268 STCyclotronDetectorMessenger::~STCyclotronDete 268 STCyclotronDetectorMessenger::~STCyclotronDetectorMessenger() 269 { 269 { 270 delete fChangeTarget; 270 delete fChangeTarget; 271 delete fChangeTargetDiameterCmd; 271 delete fChangeTargetDiameterCmd; 272 delete fChangeTargetMaterial; 272 delete fChangeTargetMaterial; 273 delete fTargetIsotopeName; 273 delete fTargetIsotopeName; 274 delete fTargetIsotopeZ ; 274 delete fTargetIsotopeZ ; 275 delete fTargetIsotopeN; 275 delete fTargetIsotopeN; 276 delete fTargetIsotopeA; 276 delete fTargetIsotopeA; 277 delete fTargetElementName; 277 delete fTargetElementName; 278 delete fTargetElementSymbole; 278 delete fTargetElementSymbole; 279 delete fTargetElementNComponents; 279 delete fTargetElementNComponents; 280 delete fTargetElementAbundance ; 280 delete fTargetElementAbundance ; 281 delete fChangeTargetMaterialDensityCmd ; 281 delete fChangeTargetMaterialDensityCmd ; 282 delete fTargetMaterialNComponents; 282 delete fTargetMaterialNComponents; 283 delete fTargetMaterialFractionMass; 283 delete fTargetMaterialFractionMass; 284 delete fTargetMaterialNaturalElement; 284 delete fTargetMaterialNaturalElement; 285 delete fTargetMaterialNaturalElementFracti 285 delete fTargetMaterialNaturalElementFractionMass; 286 delete fUpdateMaterial; 286 delete fUpdateMaterial; 287 delete fChangeTargetMaterialCmd; 287 delete fChangeTargetMaterialCmd; 288 delete fChangeFoilMaterial; 288 delete fChangeFoilMaterial; 289 delete fFoilIsotopeName; 289 delete fFoilIsotopeName; 290 delete fFoilIsotopeZ ; 290 delete fFoilIsotopeZ ; 291 delete fFoilIsotopeN; 291 delete fFoilIsotopeN; 292 delete fFoilIsotopeA; 292 delete fFoilIsotopeA; 293 delete fFoilElementName; 293 delete fFoilElementName; 294 delete fFoilElementSymbole; 294 delete fFoilElementSymbole; 295 delete fFoilElementNComponents; 295 delete fFoilElementNComponents; 296 delete fFoilElementAbundance ; 296 delete fFoilElementAbundance ; 297 delete fChangeFoilMaterialDensityCmd ; 297 delete fChangeFoilMaterialDensityCmd ; 298 delete fFoilMaterialNComponents; 298 delete fFoilMaterialNComponents; 299 delete fFoilMaterialFractionMass; 299 delete fFoilMaterialFractionMass; 300 delete fFoilMaterialNaturalElement; 300 delete fFoilMaterialNaturalElement; 301 delete fFoilMaterialNaturalElementFraction 301 delete fFoilMaterialNaturalElementFractionMass; 302 delete fUpdateFoilMaterial; 302 delete fUpdateFoilMaterial; 303 delete fChangeFoilMaterialCmd; 303 delete fChangeFoilMaterialCmd; 304 delete fChangeTargetThicknessCmd; 304 delete fChangeTargetThicknessCmd; 305 delete fChangeFoil; 305 delete fChangeFoil; 306 delete fChangeFoilThicknessCmd; 306 delete fChangeFoilThicknessCmd; 307 307 308 } 308 } 309 309 310 void STCyclotronDetectorMessenger::SetNewValue 310 void STCyclotronDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 311 { 311 { 312 //TARGET 312 //TARGET 313 //DIAMETER 313 //DIAMETER 314 if( command == fChangeTargetDiameterCmd) 314 if( command == fChangeTargetDiameterCmd) 315 { 315 { 316 G4double updatedValue = fChangeTargetDi 316 G4double updatedValue = fChangeTargetDiameterCmd -> GetNewDoubleValue(newValue); 317 fDet -> SetTargetDiameter(updatedValue); 317 fDet -> SetTargetDiameter(updatedValue); 318 } 318 } 319 319 320 //MATERIAL 320 //MATERIAL 321 else if(command == fTargetIsotopeName) 321 else if(command == fTargetIsotopeName) 322 { 322 { 323 fDet -> SetTargetIsotopeName(newValue); 323 fDet -> SetTargetIsotopeName(newValue); 324 } 324 } 325 325 326 else if(command == fTargetIsotopeZ) 326 else if(command == fTargetIsotopeZ) 327 { 327 { 328 fDet -> SetTargetIsotopeZ(fTargetIsotope 328 fDet -> SetTargetIsotopeZ(fTargetIsotopeZ->GetNewDoubleValue(newValue)); 329 } 329 } 330 330 331 else if(command == fTargetIsotopeN) 331 else if(command == fTargetIsotopeN) 332 { 332 { 333 fDet -> SetTargetIsotopeN(fTargetIsotope 333 fDet -> SetTargetIsotopeN(fTargetIsotopeN->GetNewIntValue(newValue)); 334 } 334 } 335 335 336 else if(command == fTargetIsotopeA) 336 else if(command == fTargetIsotopeA) 337 { 337 { 338 fDet -> SetTargetIsotopeA(fTargetIsotope 338 fDet -> SetTargetIsotopeA(fTargetIsotopeA->GetNewDoubleValue(newValue)); 339 } 339 } 340 340 341 else if(command == fTargetElementName) 341 else if(command == fTargetElementName) 342 { 342 { 343 fDet -> SetTargetElementName(newValue); 343 fDet -> SetTargetElementName(newValue); 344 } 344 } 345 345 346 else if(command == fTargetElementSymbole) 346 else if(command == fTargetElementSymbole) 347 { 347 { 348 fDet -> SetTargetElementSymbole(newValue 348 fDet -> SetTargetElementSymbole(newValue); 349 } 349 } 350 350 351 else if(command == fTargetElementNComponents 351 else if(command == fTargetElementNComponents) 352 { 352 { 353 fDet -> SetTargetElementNComponents(fTar 353 fDet -> SetTargetElementNComponents(fTargetElementNComponents->GetNewIntValue(newValue)); 354 } 354 } 355 355 356 else if(command == fTargetElementAbundance) 356 else if(command == fTargetElementAbundance) 357 { 357 { 358 fDet -> SetTargetElementAbundance(fTarge 358 fDet -> SetTargetElementAbundance(fTargetElementAbundance->GetNewDoubleValue(newValue)); 359 } 359 } 360 360 361 361 362 else if (command == fChangeTargetMaterialDen 362 else if (command == fChangeTargetMaterialDensityCmd ) 363 { 363 { 364 G4double updatedValue = fChangeTargetMat 364 G4double updatedValue = fChangeTargetMaterialDensityCmd -> GetNewDoubleValue(newValue); 365 fDet -> SetTargetMaterialDensity(updated 365 fDet -> SetTargetMaterialDensity(updatedValue); 366 } 366 } 367 367 368 else if(command == fTargetMaterialNComponent 368 else if(command == fTargetMaterialNComponents) 369 { 369 { 370 fDet -> SetTargetMaterialNComponents(fTa 370 fDet -> SetTargetMaterialNComponents(fTargetMaterialNComponents->GetNewIntValue(newValue)); 371 } 371 } 372 372 373 else if(command == fTargetMaterialFractionMa 373 else if(command == fTargetMaterialFractionMass) 374 { 374 { 375 fDet -> SetTargetMaterialFractionMass(fT 375 fDet -> SetTargetMaterialFractionMass(fTargetMaterialFractionMass->GetNewDoubleValue(newValue)); 376 } 376 } 377 377 378 else if(command == fUpdateMaterial) 378 else if(command == fUpdateMaterial) 379 { 379 { 380 fDet -> UpdateMaterial(); 380 fDet -> UpdateMaterial(); 381 } 381 } 382 382 383 //NATURAL ELEMENT 383 //NATURAL ELEMENT 384 else if(command == fTargetMaterialNaturalEle 384 else if(command == fTargetMaterialNaturalElement) 385 { 385 { 386 fDet ->SetTargetNaturalElement(newValue) 386 fDet ->SetTargetNaturalElement(newValue); 387 } 387 } 388 388 389 else if(command == fTargetMaterialNaturalEle 389 else if(command == fTargetMaterialNaturalElementFractionMass) 390 { 390 { 391 fDet ->SetTargetNaturalMaterialFractionM 391 fDet ->SetTargetNaturalMaterialFractionMass(fTargetMaterialNaturalElementFractionMass->GetNewDoubleValue(newValue)); 392 } 392 } 393 393 394 394 395 //NATURAL MATERIAL 395 //NATURAL MATERIAL 396 396 397 else if (command == fChangeTargetMaterialCmd 397 else if (command == fChangeTargetMaterialCmd ) 398 { 398 { 399 fDet -> SetTargetMaterial(newValue); 399 fDet -> SetTargetMaterial(newValue); 400 } 400 } 401 401 402 //THICKNESS 402 //THICKNESS 403 403 404 else if (command == fChangeTargetThicknessCm 404 else if (command == fChangeTargetThicknessCmd ) 405 { 405 { 406 G4double updatedValue = fChangeTargetThi 406 G4double updatedValue = fChangeTargetThicknessCmd -> GetNewDoubleValue(newValue); 407 fDet -> SetTargetThickness(updatedValue) 407 fDet -> SetTargetThickness(updatedValue); 408 } 408 } 409 409 410 //FOIL 410 //FOIL 411 411 412 else if (command == fChangeFoilThicknessCmd 412 else if (command == fChangeFoilThicknessCmd ) 413 { 413 { 414 G4double updatedValue = fChangeFoilThick 414 G4double updatedValue = fChangeFoilThicknessCmd -> GetNewDoubleValue(newValue); 415 fDet -> SetFoilThickness(updatedValue); 415 fDet -> SetFoilThickness(updatedValue); 416 } 416 } 417 417 418 //MATERIAL FOIL 418 //MATERIAL FOIL 419 else if(command == fFoilIsotopeName) 419 else if(command == fFoilIsotopeName) 420 { 420 { 421 fDet -> SetFoilIsotopeName(newValue); 421 fDet -> SetFoilIsotopeName(newValue); 422 } 422 } 423 423 424 else if(command == fFoilIsotopeZ) 424 else if(command == fFoilIsotopeZ) 425 { 425 { 426 fDet -> SetFoilIsotopeZ(fFoilIsotopeZ->G 426 fDet -> SetFoilIsotopeZ(fFoilIsotopeZ->GetNewDoubleValue(newValue)); 427 } 427 } 428 428 429 else if(command == fFoilIsotopeN) 429 else if(command == fFoilIsotopeN) 430 { 430 { 431 fDet -> SetFoilIsotopeN(fFoilIsotopeN->G 431 fDet -> SetFoilIsotopeN(fFoilIsotopeN->GetNewIntValue(newValue)); 432 } 432 } 433 433 434 else if(command == fFoilIsotopeA) 434 else if(command == fFoilIsotopeA) 435 { 435 { 436 fDet -> SetFoilIsotopeA(fFoilIsotopeA->G 436 fDet -> SetFoilIsotopeA(fFoilIsotopeA->GetNewDoubleValue(newValue)); 437 } 437 } 438 438 439 else if(command == fFoilElementName) 439 else if(command == fFoilElementName) 440 { 440 { 441 fDet -> SetFoilElementName(newValue); 441 fDet -> SetFoilElementName(newValue); 442 } 442 } 443 443 444 else if(command == fFoilElementSymbole) 444 else if(command == fFoilElementSymbole) 445 { 445 { 446 fDet -> SetFoilElementSymbole(newValue); 446 fDet -> SetFoilElementSymbole(newValue); 447 } 447 } 448 448 449 else if(command == fFoilElementNComponents) 449 else if(command == fFoilElementNComponents) 450 { 450 { 451 fDet -> SetFoilElementNComponents(fFoilE 451 fDet -> SetFoilElementNComponents(fFoilElementNComponents->GetNewIntValue(newValue)); 452 } 452 } 453 453 454 else if(command == fFoilElementAbundance) 454 else if(command == fFoilElementAbundance) 455 { 455 { 456 fDet -> SetFoilElementAbundance(fFoilEle 456 fDet -> SetFoilElementAbundance(fFoilElementAbundance->GetNewDoubleValue(newValue)); 457 } 457 } 458 458 459 459 460 else if (command == fChangeFoilMaterialDensi 460 else if (command == fChangeFoilMaterialDensityCmd ) 461 { 461 { 462 G4double updatedValue = fChangeFoilMater 462 G4double updatedValue = fChangeFoilMaterialDensityCmd -> GetNewDoubleValue(newValue); 463 fDet -> SetFoilMaterialDensity(updatedVa 463 fDet -> SetFoilMaterialDensity(updatedValue); 464 } 464 } 465 465 466 else if(command == fFoilMaterialNComponents) 466 else if(command == fFoilMaterialNComponents) 467 { 467 { 468 fDet -> SetFoilMaterialNComponents(fFoil 468 fDet -> SetFoilMaterialNComponents(fFoilMaterialNComponents->GetNewIntValue(newValue)); 469 } 469 } 470 470 471 else if(command == fFoilMaterialFractionMass 471 else if(command == fFoilMaterialFractionMass) 472 { 472 { 473 fDet -> SetFoilMaterialFractionMass(fFoi 473 fDet -> SetFoilMaterialFractionMass(fFoilMaterialFractionMass->GetNewDoubleValue(newValue)); 474 } 474 } 475 475 476 else if(command == fUpdateFoilMaterial) 476 else if(command == fUpdateFoilMaterial) 477 { 477 { 478 fDet -> UpdateFoilMaterial(); 478 fDet -> UpdateFoilMaterial(); 479 } 479 } 480 480 481 //NATURAL ELEMENT 481 //NATURAL ELEMENT 482 else if(command == fFoilMaterialNaturalEleme 482 else if(command == fFoilMaterialNaturalElement) 483 { 483 { 484 fDet ->SetFoilNaturalElement(newValue); 484 fDet ->SetFoilNaturalElement(newValue); 485 } 485 } 486 486 487 else if(command == fFoilMaterialNaturalEleme 487 else if(command == fFoilMaterialNaturalElementFractionMass) 488 { 488 { 489 fDet ->SetFoilNaturalMaterialFractionMas 489 fDet ->SetFoilNaturalMaterialFractionMass(fFoilMaterialNaturalElementFractionMass->GetNewDoubleValue(newValue)); 490 } 490 } 491 491 492 //NATURAL MATERIAL 492 //NATURAL MATERIAL 493 else if (command == fChangeFoilMaterialCmd ) 493 else if (command == fChangeFoilMaterialCmd ) 494 { 494 { 495 fDet -> SetFoilMaterial(newValue); 495 fDet -> SetFoilMaterial(newValue); 496 } 496 } 497 } 497 } 498 498