Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NuclideTableMessenger.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// G4NuclideTableMessenger class implementation
27//
28// Author: T.Koi, SLAC - 11 November 2015
29//---------------------------------------------------------------------
30
32#include "G4UImanager.hh"
33#include "G4UIdirectory.hh"
37#include "G4UIcmdWithABool.hh"
38
39#include "G4NuclideTable.hh"
40#include "G4ios.hh"
41
42#include <iomanip> // Include from 'system'
43
45 : theNuclideTable(nuclideTable)
46{
47 thisDirectory = new G4UIdirectory("/particle/nuclideTable/");
48 thisDirectory->SetGuidance("Nuclide table control commands.");
49
50 // particle/manage/nuclide/min_halflife
51 lifetimeCmd = new G4UIcmdWithADoubleAndUnit("/particle/nuclideTable/min_halflife",this);
52 lifetimeCmd->SetGuidance("Set threshold of half-life.");
53 lifetimeCmd->SetGuidance("Unit of the time can be :");
54 lifetimeCmd->SetGuidance(" s, ms, ns (default)");
55 lifetimeCmd->SetParameterName("life",false);
56 lifetimeCmd->SetDefaultValue( 1000.0 );
57 lifetimeCmd->SetRange("life >0.0");
58 lifetimeCmd->SetDefaultUnit("ns");
60
61 // particle/manage/nuclide/level_tolerance
62 lToleranceCmd = new G4UIcmdWithADoubleAndUnit("/particle/nuclideTable/level_tolerance",this);
63 lToleranceCmd->SetGuidance("Set tolerance in level searching.");
64 lToleranceCmd->SetGuidance("Unit of the energy can be :");
65 lToleranceCmd->SetGuidance(" MeV, keV, eV (default)");
66 lToleranceCmd->SetParameterName("lTolerance",false);
67 lToleranceCmd->SetDefaultValue( 1.0 );
68 lToleranceCmd->SetRange("lTolerance >0.0");
69 lToleranceCmd->SetDefaultUnit("eV");
71}
72
74{
75 delete thisDirectory;
76 delete lifetimeCmd;
77 delete lToleranceCmd;
78}
79
81SetNewValue(G4UIcommand* command, G4String newValue)
82{
83 if (command == lifetimeCmd )
84 {
85 // Command /particle/manage/nuclideTable/min_halflife
86 theNuclideTable->SetThresholdOfHalfLife(lifetimeCmd->GetNewDoubleValue(newValue));
87 }
88 else if (command == lToleranceCmd )
89 {
90 // Command /particle/manage/nuclideTable/level_tolerance
91 theNuclideTable->SetLevelTolerance(lToleranceCmd->GetNewDoubleValue(newValue));
92 }
93}
@ G4State_Idle
@ G4State_PreInit
G4NuclideTableMessenger(G4NuclideTable *nuclideTable=nullptr)
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
void SetThresholdOfHalfLife(G4double)
void SetLevelTolerance(G4double x)
void SetDefaultUnit(const char *defUnit)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:273