Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HadronicDeveloperParameters Class Reference

#include <G4HadronicDeveloperParameters.hh>

Public Member Functions

G4bool Set (const std::string name, const G4bool)
 
G4bool Set (const std::string name, const G4int)
 
G4bool Set (const std::string name, const G4double)
 
G4bool GetDefault (const std::string name, G4bool &value)
 
G4bool GetDefault (const std::string name, G4int &value)
 
G4bool GetDefault (const std::string name, G4double &value)
 
G4bool Get (const std::string name, G4bool &value)
 
G4bool Get (const std::string name, G4int &value)
 
G4bool Get (const std::string name, G4double &value)
 
G4bool DeveloperGet (const std::string name, G4bool &value)
 
G4bool DeveloperGet (const std::string name, G4int &value)
 
G4bool DeveloperGet (const std::string name, G4double &value)
 
void Dump (const std::string name)
 
G4bool SetDefault (const std::string name, const G4bool value)
 
G4bool SetDefault (const std::string name, const G4int value, G4int lower_limit=-INT_MAX, G4int upper_limit=INT_MAX)
 
G4bool SetDefault (const std::string name, const G4double value, G4double lower_limit=-DBL_MAX, G4double upper_limit=DBL_MAX)
 

Static Public Member Functions

static G4HadronicDeveloperParametersGetInstance ()
 

Detailed Description

Definition at line 36 of file G4HadronicDeveloperParameters.hh.

Member Function Documentation

◆ DeveloperGet() [1/3]

G4bool G4HadronicDeveloperParameters::DeveloperGet ( const std::string  name,
G4bool value 
)

◆ DeveloperGet() [2/3]

G4bool G4HadronicDeveloperParameters::DeveloperGet ( const std::string  name,
G4double value 
)

Definition at line 192 of file G4HadronicDeveloperParameters.cc.

192 {
193 return get( name , value , true );
194}

◆ DeveloperGet() [3/3]

G4bool G4HadronicDeveloperParameters::DeveloperGet ( const std::string  name,
G4int value 
)

Definition at line 217 of file G4HadronicDeveloperParameters.cc.

217 {
218 return get( name , value , true );
219}

◆ Dump()

void G4HadronicDeveloperParameters::Dump ( const std::string  name)

Definition at line 263 of file G4HadronicDeveloperParameters.cc.

263 {
264 //const std::map<std::string,G4double>::iterator it = values.find( name );
265 if ( b_values.find( name ) != b_values.end() ) {
266 G4cout << "G4HadronicDeveloperParameters: "
267 << "name = " << name
268 << ", default value = " << b_defaults.find( name )->second
269 << ", current value = " << b_values.find( name )->second
270 << "." << G4endl;
271 } else if ( i_values.find( name ) != i_values.end() ) {
272 G4cout << "G4HadronicDeveloperParameters: "
273 << "name = " << name
274 << ", default value = " << i_defaults.find( name )->second
275 << ", lower limit = " << i_limits.find( name )->second.first
276 << ", upper limit = " << i_limits.find( name )->second.second
277 << ", current value = " << i_values.find( name )->second
278 << "." << G4endl;
279 } else if ( values.find( name ) != values.end() ) {
280 G4cout << "G4HadronicDeveloperParameters: "
281 << "name = " << name
282 << ", default value = " << defaults.find( name )->second
283 << ", lower limit = " << limits.find( name )->second.first
284 << ", upper limit = " << limits.find( name )->second.second
285 << ", current value = " << values.find( name )->second
286 << "." << G4endl;
287 } else {
288 /*Parameter of "name" does not exist*/
289 issue_no_param( name );
290 }
291}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const char * name(G4int ptype)

◆ Get() [1/3]

G4bool G4HadronicDeveloperParameters::Get ( const std::string  name,
G4bool value 
)

Definition at line 238 of file G4HadronicDeveloperParameters.cc.

238 {
239 return get( name , value );
240}

◆ Get() [2/3]

G4bool G4HadronicDeveloperParameters::Get ( const std::string  name,
G4double value 
)

Definition at line 188 of file G4HadronicDeveloperParameters.cc.

188 {
189 return get( name , value );
190}

◆ Get() [3/3]

G4bool G4HadronicDeveloperParameters::Get ( const std::string  name,
G4int value 
)

Definition at line 213 of file G4HadronicDeveloperParameters.cc.

213 {
214 return get( name , value );
215}

◆ GetDefault() [1/3]

G4bool G4HadronicDeveloperParameters::GetDefault ( const std::string  name,
G4bool value 
)

Definition at line 149 of file G4HadronicDeveloperParameters.cc.

149 {
150 G4bool status = false;
151 const std::map<std::string,const G4bool>::iterator it = b_defaults.find( name );
152 if ( it != b_defaults.end() ) {
153 status = true;
154 value = it->second;
155 } else {
156 /*Parameter of "name" does not exist*/
157 issue_no_param( name );
158 }
159 return status;
160}
bool G4bool
Definition: G4Types.hh:86

◆ GetDefault() [2/3]

G4bool G4HadronicDeveloperParameters::GetDefault ( const std::string  name,
G4double value 
)

Definition at line 175 of file G4HadronicDeveloperParameters.cc.

175 {
176 G4bool status = false;
177 const std::map<std::string,const G4double>::iterator it = defaults.find( name );
178 if ( it != defaults.end() ) {
179 status = true;
180 value = it->second;
181 } else {
182 /*Parameter of "name" does not exist*/
183 issue_no_param( name );
184 }
185 return status;
186}

◆ GetDefault() [3/3]

G4bool G4HadronicDeveloperParameters::GetDefault ( const std::string  name,
G4int value 
)

Definition at line 162 of file G4HadronicDeveloperParameters.cc.

162 {
163 G4bool status = false;
164 const std::map<std::string,const G4int>::iterator it = i_defaults.find( name );
165 if ( it != i_defaults.end() ) {
166 status = true;
167 value = it->second;
168 } else {
169 /*Parameter of "name" does not exist*/
170 issue_no_param( name );
171 }
172 return status;
173}

◆ GetInstance()

G4HadronicDeveloperParameters & G4HadronicDeveloperParameters::GetInstance ( )
static

Definition at line 28 of file G4HadronicDeveloperParameters.cc.

28 {
29 static G4HadronicDeveloperParameters instance;
30 return instance;
31}

◆ Set() [1/3]

G4bool G4HadronicDeveloperParameters::Set ( const std::string  name,
const G4bool  value 
)

Definition at line 83 of file G4HadronicDeveloperParameters.cc.

83 {
84 G4bool status = false;
85 const std::map<std::string,G4bool>::iterator it = b_values.find( name );
86 if ( it != b_values.end() ) {
87 if ( it->second == b_defaults.find(name)->second ) {
88 status = true;
89 it->second = value;
90 } else {
91 /*change more than once*/
92 issue_has_changed( name );
93 }
94 } else {
95 /*Parameter of "name" does not exist*/
96 issue_no_param( name );
97 }
98 return status;
99}

◆ Set() [2/3]

G4bool G4HadronicDeveloperParameters::Set ( const std::string  name,
const G4double  value 
)

Definition at line 125 of file G4HadronicDeveloperParameters.cc.

125 {
126 G4bool status = false;
127 const std::map<std::string,G4double>::iterator it = values.find( name );
128 if ( it != values.end() ) {
129 if ( it->second == defaults.find(name)->second ) {
130 if ( check_value_within_limits( limits.find(name)->second , value ) ) {
131 /*value is OK*/
132 status = true;
133 it->second = value;
134 } else {
135 /*Value is outside of valid range*/
136 issue_non_eligible_value( name );
137 }
138 } else {
139 /*change more than once*/
140 issue_has_changed( name );
141 }
142 } else {
143 /*Parameter of "name" does not exist*/
144 issue_no_param( name );
145 }
146 return status;
147}

◆ Set() [3/3]

G4bool G4HadronicDeveloperParameters::Set ( const std::string  name,
const G4int  value 
)

Definition at line 101 of file G4HadronicDeveloperParameters.cc.

101 {
102 G4bool status = false;
103 const std::map<std::string,G4int>::iterator it = i_values.find( name );
104 if ( it != i_values.end() ) {
105 if ( it->second == i_defaults.find(name)->second ) {
106 if ( check_value_within_limits( i_limits.find(name)->second , value ) ) {
107 /*value is OK*/
108 status = true;
109 it->second = value;
110 } else {
111 /*Value is outside of valid range*/
112 issue_non_eligible_value( name );
113 }
114 } else {
115 /*change more than once*/
116 issue_has_changed( name );
117 }
118 } else {
119 /*Parameter of "name" does not exist*/
120 issue_no_param( name );
121 }
122 return status;
123}

◆ SetDefault() [1/3]

G4bool G4HadronicDeveloperParameters::SetDefault ( const std::string  name,
const G4bool  value 
)

Definition at line 39 of file G4HadronicDeveloperParameters.cc.

39 {
40 G4bool status = false;
41 const std::map< std::string , const G4bool >::iterator it = b_defaults.find( name );
42 if ( it == b_defaults.end() ) {
43 status = true;
44 b_defaults.insert( std::pair<std::string, const G4bool>( name , value ) );
45 b_values.insert( std::pair<std::string, G4bool>( name , value ) );
46 } else {
47 /*error*/
48 issue_is_already_defined( name );
49 }
50 return status;
51}

Referenced by G4FTFSettingDefaultHDP::G4FTFSettingDefaultHDP().

◆ SetDefault() [2/3]

G4bool G4HadronicDeveloperParameters::SetDefault ( const std::string  name,
const G4double  value,
G4double  lower_limit = -DBL_MAX,
G4double  upper_limit = DBL_MAX 
)

Definition at line 68 of file G4HadronicDeveloperParameters.cc.

68 {
69 G4bool status = false;
70 const std::map< std::string , const G4double >::iterator it = defaults.find( name );
71 if ( it == defaults.end() ) {
72 status = true;
73 defaults.insert( std::pair<std::string, const G4double>( name , value ) );
74 values.insert( std::pair<std::string, G4double>( name , value ) );
75 limits.insert( std::pair< std::string,std::pair< const G4double , const G4double> >( name, std::pair< const G4double , const G4double> ( lower_limit , upper_limit ) ) );
76 } else {
77 /*error*/
78 issue_is_already_defined( name );
79 }
80 return status;
81}

◆ SetDefault() [3/3]

G4bool G4HadronicDeveloperParameters::SetDefault ( const std::string  name,
const G4int  value,
G4int  lower_limit = -INT_MAX,
G4int  upper_limit = INT_MAX 
)

Definition at line 53 of file G4HadronicDeveloperParameters.cc.

53 {
54 G4bool status = false;
55 const std::map< std::string , const G4int >::iterator it = i_defaults.find( name );
56 if ( it == i_defaults.end() ) {
57 status = true;
58 i_defaults.insert( std::pair<std::string, const G4int>( name , value ) );
59 i_values.insert( std::pair<std::string, G4int>( name , value ) );
60 i_limits.insert( std::pair< std::string,std::pair< const G4int , const G4int> >( name, std::pair< const G4int , const G4int> ( lower_limit , upper_limit ) ) );
61 } else {
62 /*error*/
63 issue_is_already_defined( name );
64 }
65 return status;
66}

The documentation for this class was generated from the following files: