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

#include <G4NeutronHPHash.hh>

Public Member Functions

 G4NeutronHPHash ()
 
 ~G4NeutronHPHash ()
 
 G4NeutronHPHash (const G4NeutronHPHash &aHash)
 
G4NeutronHPHashoperator= (const G4NeutronHPHash &aHash)
 
void Clear ()
 
G4bool Prepared () const
 
void SetData (G4int index, G4double x, G4double y)
 
G4int GetMinIndex (G4double e) const
 

Detailed Description

Definition at line 32 of file G4NeutronHPHash.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPHash() [1/2]

G4NeutronHPHash::G4NeutronHPHash ( )
inline

Definition at line 35 of file G4NeutronHPHash.hh.

36 {
37 theUpper = 0;
38 prepared = false;
39 }

Referenced by G4NeutronHPHash(), operator=(), and SetData().

◆ ~G4NeutronHPHash()

G4NeutronHPHash::~G4NeutronHPHash ( )
inline

Definition at line 41 of file G4NeutronHPHash.hh.

42 {
43 if(theUpper) delete theUpper;
44 }

◆ G4NeutronHPHash() [2/2]

G4NeutronHPHash::G4NeutronHPHash ( const G4NeutronHPHash aHash)
inline

Definition at line 46 of file G4NeutronHPHash.hh.

47 {
48 theIndex = aHash.theIndex;
49 theData = aHash.theData;
50 if(aHash.theUpper != 0)
51 {
52 theUpper = new G4NeutronHPHash(*(aHash.theUpper));
53 }
54 else
55 {
56 theUpper = 0;
57 }
58 }

Member Function Documentation

◆ Clear()

void G4NeutronHPHash::Clear ( )
inline

Definition at line 78 of file G4NeutronHPHash.hh.

79 {
80 if(theUpper)
81 {
82 delete theUpper;
83 theUpper = 0;
84 }
85 theIndex.clear();
86 theData.clear();
87 prepared = false;
88 }

Referenced by G4NeutronHPVector::CleanUp(), and G4NeutronHPVector::ReHash().

◆ GetMinIndex()

G4int G4NeutronHPHash::GetMinIndex ( G4double  e) const
inline

Definition at line 105 of file G4NeutronHPHash.hh.

106 {
107 G4int result=-1;
108 if(theData.size() == 0) return 0;
109 if(theData[0].GetX()>e) return 0;
110
111 G4int lower=0;
112 if(theUpper != 0)
113 {
114 lower = theUpper->GetMinIndex(e);
115 }
116 unsigned int i;
117 for(i=lower; i<theData.size(); i++)
118 {
119 if(theData[i].GetX()>e)
120 {
121 result = theIndex[i-1];
122 break;
123 }
124 }
125 if(result == -1) result = theIndex[theIndex.size()-1];
126 return result;
127 }
int G4int
Definition: G4Types.hh:66
G4int GetMinIndex(G4double e) const

Referenced by GetMinIndex(), and G4NeutronHPVector::GetXsec().

◆ operator=()

G4NeutronHPHash & G4NeutronHPHash::operator= ( const G4NeutronHPHash aHash)
inline

Definition at line 60 of file G4NeutronHPHash.hh.

61 {
62 if(&aHash != this)
63 {
64 theIndex = aHash.theIndex;
65 theData = aHash.theData;
66 if(aHash.theUpper != 0)
67 {
68 theUpper = new G4NeutronHPHash(*(aHash.theUpper));
69 }
70 else
71 {
72 theUpper = 0;
73 }
74 }
75 return *this;
76 }

◆ Prepared()

G4bool G4NeutronHPHash::Prepared ( ) const
inline

Definition at line 90 of file G4NeutronHPHash.hh.

90{return prepared;}

Referenced by G4NeutronHPVector::GetXsec(), G4NeutronHPVector::Merge(), and G4NeutronHPVector::ThinOut().

◆ SetData()

void G4NeutronHPHash::SetData ( G4int  index,
G4double  x,
G4double  y 
)
inline

Definition at line 91 of file G4NeutronHPHash.hh.

92 {
93 prepared = true;
95 aPoint.SetData(x, y);
96 theData.push_back(aPoint);
97 theIndex.push_back(index);
98 if(0 == theData.size()%10 && 0!=theData.size())
99 {
100 if(0 == theUpper) theUpper = new G4NeutronHPHash();
101 theUpper->SetData(theData.size()-1, x, y);
102 }
103 }
void SetData(G4double e, G4double x)
void SetData(G4int index, G4double x, G4double y)

Referenced by G4NeutronHPVector::Hash(), G4NeutronHPVector::Init(), and SetData().


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