Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPReactionWhiteBoard Class Reference

#include <G4NeutronHPReactionWhiteBoard.hh>

Public Member Functions

 G4NeutronHPReactionWhiteBoard ()
 
 ~G4NeutronHPReactionWhiteBoard ()
 
void Dump ()
 
void SetTargZ (G4int Z)
 
void SetTargA (G4int A)
 
void SetTargM (G4int M)
 
G4int GetTargZ ()
 
G4int GetTargA ()
 
G4int GetTargM ()
 
bool AddRecord (std::pair< G4String, G4String >)
 
G4String GetValue (G4String)
 
G4int GetValueInInt (G4String)
 
G4double GetValueInDouble (G4String)
 

Detailed Description

Definition at line 38 of file G4NeutronHPReactionWhiteBoard.hh.

Constructor & Destructor Documentation

G4NeutronHPReactionWhiteBoard::G4NeutronHPReactionWhiteBoard ( )

Definition at line 32 of file G4NeutronHPReactionWhiteBoard.cc.

33 :targZ(0)
34 ,targA(0)
35 ,targM(0)
36 {
37 ;
38 }
G4NeutronHPReactionWhiteBoard::~G4NeutronHPReactionWhiteBoard ( )

Definition at line 39 of file G4NeutronHPReactionWhiteBoard.cc.

40 {
41  mapStringPair.clear();
42 }

Member Function Documentation

bool G4NeutronHPReactionWhiteBoard::AddRecord ( std::pair< G4String, G4String new_record)

Definition at line 60 of file G4NeutronHPReactionWhiteBoard.cc.

References G4cout, and G4endl.

61 {
62  if ( mapStringPair.find( new_record.first ) != mapStringPair.end() ) {
63  G4cout << "This key is already used in the current reaction white board!" << G4endl;
64  return false;
65  }
66  mapStringPair.insert ( new_record );
67  return true;
68 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4NeutronHPReactionWhiteBoard::Dump ( )

Definition at line 44 of file G4NeutronHPReactionWhiteBoard.cc.

References G4cout, and G4endl.

45 {
46  G4cout << "G4NeutronHPReactionWhiteBoard::Dump" << G4endl;
47  G4cout << "Target Z = " << targZ << G4endl;
48  G4cout << "Target A = " << targA << G4endl;
49  G4cout << "Target M = " << targM << G4endl;
50 
51  for ( std::map< G4String,G4String >::iterator
52  it = mapStringPair.begin(); it != mapStringPair.end(); it++ )
53  {
54  G4cout << it->first << " " << it->second << G4endl;
55  }
56  //,,,
57  G4cout << G4endl;
58 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int G4NeutronHPReactionWhiteBoard::GetTargA ( )
inline

Definition at line 51 of file G4NeutronHPReactionWhiteBoard.hh.

51 { return targA; };
G4int G4NeutronHPReactionWhiteBoard::GetTargM ( )
inline

Definition at line 52 of file G4NeutronHPReactionWhiteBoard.hh.

52 { return targM; };
G4int G4NeutronHPReactionWhiteBoard::GetTargZ ( )
inline

Definition at line 50 of file G4NeutronHPReactionWhiteBoard.hh.

50 { return targZ; };
G4String G4NeutronHPReactionWhiteBoard::GetValue ( G4String  key)

Definition at line 70 of file G4NeutronHPReactionWhiteBoard.cc.

References G4cout, and G4endl.

Referenced by Lesson1Wx.Counter::Adjusted(), Lesson2Wx.Counter::Adjusted(), GetValueInDouble(), and GetValueInInt().

71 {
72  std::map< G4String,G4String >::iterator it = mapStringPair.find( key );
73  if ( it == mapStringPair.end() ) {
74  G4cout << "No entry for this key " << key << " in the current reaction white board!" << G4endl;
75  return "NONE";
76  }
77  return it->second;
78 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4NeutronHPReactionWhiteBoard::GetValueInDouble ( G4String  key)

Definition at line 91 of file G4NeutronHPReactionWhiteBoard.cc.

References GetValue(), and test::x.

92 {
93  G4String result = GetValue( key );
94  if ( result == "NONE" ) return 0.0;
95  std::stringstream ss;
96  ss << key;
97  G4double x;
98  ss >> x;
99  return x;
100 }
double G4double
Definition: G4Types.hh:76
G4int G4NeutronHPReactionWhiteBoard::GetValueInInt ( G4String  key)

Definition at line 80 of file G4NeutronHPReactionWhiteBoard.cc.

References GetValue().

81 {
82  G4String result = GetValue( key );
83  if ( result == "NONE" ) return 0;
84  std::stringstream ss;
85  ss << key;
86  G4int i;
87  ss >> i;
88  return i;
89 }
int G4int
Definition: G4Types.hh:78
void G4NeutronHPReactionWhiteBoard::SetTargA ( G4int  A)
inline
void G4NeutronHPReactionWhiteBoard::SetTargM ( G4int  M)
inline

Definition at line 49 of file G4NeutronHPReactionWhiteBoard.hh.

Referenced by G4NeutronHPChannel::ApplyYourself().

49 { targM=M; };
void G4NeutronHPReactionWhiteBoard::SetTargZ ( G4int  Z)
inline

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