Geant4  10.02.p02
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 //---------------------------------------------------------------
27 //
28 // G4NuclideTableMessenger.cc
29 //
30 // Description:
31 // This is a messenger class to interface to exchange information
32 // between ParticleDefinition and UI.
33 //
34 // History:
35 // 11 November 2015, T. Koi : The 1st version created.
36 //---------------------------------------------------------------
37 
39 #include "G4UImanager.hh"
40 #include "G4UIdirectory.hh"
42 #include "G4UIcmdWithAnInteger.hh"
44 #include "G4UIcmdWithABool.hh"
45 
46 #include "G4NuclideTable.hh"
47 #include "G4ios.hh" // Include from 'system'
48 #include <iomanip> // Include from 'system'
49 
51  :theNuclideTable(nuclideTable)
52 {
53  //Commnad /particle/manage/nuclide
54  thisDirectory = new G4UIdirectory("/particle/manage/nuclideTable/");
55  thisDirectory->SetGuidance("Nuclide table control commands.");
56 
58  lifetimeCmd = new G4UIcmdWithADoubleAndUnit("/particle/manage/nuclideTable/min_halflife",this);
59  lifetimeCmd->SetGuidance("Set threshold of half-life.");
60  lifetimeCmd->SetGuidance("Unit of the time can be :");
61  lifetimeCmd->SetGuidance(" s, ms, ns (default)");
62  lifetimeCmd->SetParameterName("life",false);
63  lifetimeCmd->SetDefaultValue( 1000.0 );
64  lifetimeCmd->SetRange("life >0.0");
65  //lifetimeCmd->SetUnitCategory("Time");
66  //lifetimeCmd->SetUnitCandidates("s ms ns");
69 
71  lToleranceCmd = new G4UIcmdWithADoubleAndUnit("/particle/manage/nuclideTable/level_tolerance",this);
72  lToleranceCmd->SetGuidance("Set tolerance in level seaching.");
73  lToleranceCmd->SetGuidance("Unit of the energy can be :");
74  lToleranceCmd->SetGuidance(" MeV, keV, eV (default)");
75  lToleranceCmd->SetParameterName("lTolerance",false);
77  lToleranceCmd->SetRange("lTolerance >0.0");
80 
81  //Commnad /particle/manage/nuclide/dump
82  //dumpCmd = new G4UIcmdWithoutParameter("/particle/manage/nuclide/dump",this);
83  //dumpCmd->SetGuidance("dump nuclide table.");
84 
85 }
86 
88 {
89 // if (fDecayTableMessenger !=0) delete fDecayTableMessenger;
90 // fDecayTableMessenger = 0;
91 
92  delete thisDirectory;
93  delete lifetimeCmd;
94  delete lToleranceCmd;
95 }
96 
98 {
99  if (command == lifetimeCmd ) {
100  //Commnad /particle/manage/nuclideTable/min_halflife
102  } else if (command == lToleranceCmd ) {
103  //Commnad /particle/manage/nuclideTable/level_tolerance
105  }
106 }
void SetThresholdOfHalfLife(G4double)
G4UIcmdWithADoubleAndUnit * lifetimeCmd
static G4double GetNewDoubleValue(const char *paramString)
G4NuclideTableMessenger(G4NuclideTable *nuclideTable=0)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetLevelTolerance(G4double x)
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
G4UIcmdWithADoubleAndUnit * lToleranceCmd
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)