Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4ProductionCutsTableMessenger.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 //
27 // $Id: G4ProductionCutsTableMessenger.cc 70369 2013-05-29 14:59:24Z gcosmo $
28 //
29 //
30 //---------------------------------------------------------------
31 //
32 // G4ProductionCutsTableMessenger.cc
33 // ------------------------------------------------------------
34 // History
35 // first version 02 Mar. 2008 by H.Kurashige
36 //
37 
39 #include "G4ProductionCutsTable.hh"
40 
41 #include "G4UIdirectory.hh"
43 #include "G4UIcmdWithAnInteger.hh"
45 #include "G4UIcmdWithAString.hh"
46 #include "G4ios.hh"
47 #include "G4Tokenizer.hh"
48 
49 #include <sstream>
50 
52  :theCutsTable(pTable)
53 {
54  // /cuts/ directory
55  theDirectory = new G4UIdirectory("/cuts/");
56  theDirectory->SetGuidance("Commands for G4VUserPhysicsList.");
57 
58  // /cuts/verbose command
59  verboseCmd = new G4UIcmdWithAnInteger("/cuts/verbose",this);
60  verboseCmd->SetGuidance("Set the Verbose level of G4ProductionCutsTable.");
61  verboseCmd->SetGuidance(" 0 : Silent (default)");
62  verboseCmd->SetGuidance(" 1 : Display warning messages");
63  verboseCmd->SetGuidance(" 2 : Display more info");
64  verboseCmd->SetGuidance(" 2 : Display debug info");
65  verboseCmd->SetParameterName("level",true);
67  verboseCmd->SetRange("level >=0 && level <=3");
68 
69  // /cuts/setLowEdge command
70  setLowEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setLowEdge",this);
71  setLowEdgeCmd->SetGuidance("Set low edge energy value ");
72  setLowEdgeCmd->SetParameterName("edge",false);
74  setLowEdgeCmd->SetRange("edge >0.0");
77 
78  // /cuts/setHighEdge command
79  setHighEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setHighEdge",this);
80  setHighEdgeCmd->SetGuidance("Set high edge energy value ");
81  setHighEdgeCmd->SetParameterName("edge",false);
83  setHighEdgeCmd->SetRange("edge >0.0");
86 
87  // /cuts/setMaxCutEnergy command
88  setMaxEnergyCutCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setMaxCutEnergy",this);
89  setMaxEnergyCutCmd->SetGuidance("Set maximum of cut energy value ");
92  setMaxEnergyCutCmd->SetRange("cut >0.0");
95 
96  // /cuts/dump command
97  dumpCmd = new G4UIcmdWithoutParameter("/cuts/dump",this);
98  dumpCmd->SetGuidance("Dump cuplues in ProductuinCutsTable. ");
99 
100 }
101 
103 {
104  delete dumpCmd;
105  delete setMaxEnergyCutCmd;
106  delete setHighEdgeCmd;
107  delete setLowEdgeCmd;
108  delete verboseCmd;
109  delete theDirectory;
110 }
111 
113  G4String newValue)
114 {
115  if( command==verboseCmd ) {
117 
118  } else if( command==dumpCmd ){
119  theCutsTable-> DumpCouples();
120 
121  } else if( command==setLowEdgeCmd ){
122  G4double lowEdge = setLowEdgeCmd->GetNewDoubleValue(newValue);
124  theCutsTable->SetEnergyRange(lowEdge, highEdge);
125 
126  } else if( command==setHighEdgeCmd ){
127  G4double highEdge = setHighEdgeCmd->GetNewDoubleValue(newValue);
129  theCutsTable->SetEnergyRange(lowEdge, highEdge);
130 
131  } else if( command==setMaxEnergyCutCmd ){
132  G4double cut = setHighEdgeCmd->GetNewDoubleValue(newValue);
134 
135  }
136 }
137 
139 {
140  G4String cv;
141 
142  if( command==verboseCmd ){
144 
145  } else if( command==setLowEdgeCmd ){
147  cv = setLowEdgeCmd->ConvertToString( lowEdge, "keV" );
148 
149  } else if( command==setHighEdgeCmd ){
151  cv = setHighEdgeCmd->ConvertToString( highEdge, "TeV" );
152 
153  } else if( command==setMaxEnergyCutCmd ){
155  cv = setMaxEnergyCutCmd->ConvertToString( cut, "GeV" );
156  }
157 
158 
159  return cv;
160 
161 }
162 
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
virtual G4String GetCurrentValue(G4UIcommand *command)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
void SetDefaultValue(G4int defVal)
void SetMaxEnergyCut(G4double value)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetEnergyRange(G4double lowedge, G4double highedge)
G4double GetHighEdgeEnergy() const
static G4double GetNewDoubleValue(const char *paramString)
double G4double
Definition: G4Types.hh:76
G4double GetLowEdgeEnergy() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:374
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
void SetDefaultUnit(const char *defUnit)
G4UIcmdWithADoubleAndUnit * setMaxEnergyCutCmd
void SetVerboseLevel(G4int value)