Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4HadronicEPTestMessenger.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//
28#include "G4UIdirectory.hh"
30#include "G4UIcmdWithADouble.hh"
32
33
35 :theProcessStore(theStore)
36{
37 // Main directory for control of the e/p test
38 heptstDirectory = new G4UIdirectory("/heptst/");
39 heptstDirectory->SetGuidance("Controls for the hadronic energy/momentum test");
40
41 // Command to set level of detail reported upon e/p non-conservation
42 reportLvlCmd = new G4UIcmdWithAnInteger("/heptst/reportLevel",this);
43 reportLvlCmd->SetGuidance("Set level of detail reported upon E/p non-conservation");
44 reportLvlCmd->SetGuidance(" 0 - (default) no reporting ");
45 reportLvlCmd->SetGuidance(" 1 - report only when E/p not conserved ");
46 reportLvlCmd->SetGuidance(" 2 - report regardless of E/p conservation ");
47 reportLvlCmd->SetGuidance(" 3 - report only when E/p not conserved, with names, limits ");
48 reportLvlCmd->SetGuidance(" 4 - report regardless of E/p conservation, with names, limits ");
49 reportLvlCmd->SetParameterName("ReportLevel",true);
50 reportLvlCmd->SetDefaultValue(0);
51 reportLvlCmd->SetRange("ReportLevel >= 0 && ReportLevel < 5");
52
53 // Set the absolute energy non-conservation level for the process
54 procAbsLvlCmd = new G4UIcmdWithADoubleAndUnit("/heptst/processAbsLevel",this);
55 procAbsLvlCmd->SetGuidance("Set absolute energy level (with unit) of allowed energy non-conservation");
56 procAbsLvlCmd->SetParameterName("ProcessAbsLevel",true);
57 procAbsLvlCmd->SetDefaultValue(-1.0);
58 procAbsLvlCmd->SetUnitCategory("Energy");
59
60 // Set the relative energy non-conservation level for the process
61 procRelLvlCmd = new G4UIcmdWithADouble("/heptst/processRelLevel",this);
62 procRelLvlCmd->SetGuidance("Set relative level of allowed energy non-conservation");
63 procRelLvlCmd->SetParameterName("ProcessRelLevel",true);
64 procRelLvlCmd->SetDefaultValue(-1.0);
65}
66
67
69{
70 delete heptstDirectory;
71 delete reportLvlCmd;
72 delete procAbsLvlCmd;
73 delete procRelLvlCmd;
74}
75
76
78{
79 if (command==reportLvlCmd) {
80 theProcessStore->SetEpReportLevel(reportLvlCmd->GetNewIntValue(newValue) );
81
82 } else if(command==procRelLvlCmd) {
83 // G4double absval = theHadronicProcess->GetEnergyMomentumCheckLevels().second;
84 theProcessStore->SetProcessRelLevel(procRelLvlCmd->GetNewDoubleValue(newValue) );
85 } else if(command==procAbsLvlCmd) {
86 // G4double relval = theHadronicProcess->GetEnergyMomentumCheckLevels().first;
87 theProcessStore->SetProcessAbsLevel(procAbsLvlCmd->GetNewDoubleValue(newValue) );
88 }
89}
G4HadronicEPTestMessenger(G4HadronicProcessStore *theProcessStore)
void SetNewValue(G4UIcommand *command, G4String newValues)
void SetProcessAbsLevel(G4double absoluteLevel)
void SetProcessRelLevel(G4double relativeLevel)
void SetEpReportLevel(G4int level)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
void SetDefaultValue(G4double defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120