Geant4-11
Public Member Functions | Private Attributes
G4ParticleHPHash Class Reference

#include <G4ParticleHPHash.hh>

Public Member Functions

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

Private Attributes

G4bool prepared
 
std::vector< G4ParticleHPDataPointtheData
 
std::vector< int > theIndex
 
G4ParticleHPHashtheUpper
 

Detailed Description

Definition at line 36 of file G4ParticleHPHash.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPHash() [1/2]

G4ParticleHPHash::G4ParticleHPHash ( )
inline

Definition at line 39 of file G4ParticleHPHash.hh.

40 {
41 theUpper = 0;
42 prepared = false;
43 }
G4ParticleHPHash * theUpper

References prepared, and theUpper.

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

◆ ~G4ParticleHPHash()

G4ParticleHPHash::~G4ParticleHPHash ( )
inline

Definition at line 45 of file G4ParticleHPHash.hh.

46 {
47 if(theUpper) delete theUpper;
48 }

References theUpper.

◆ G4ParticleHPHash() [2/2]

G4ParticleHPHash::G4ParticleHPHash ( const G4ParticleHPHash aHash)
inline

Definition at line 50 of file G4ParticleHPHash.hh.

51 {
52 theIndex = aHash.theIndex;
53 theData = aHash.theData;
54 prepared = aHash.prepared;
55 if(aHash.theUpper != 0)
56 {
57 theUpper = new G4ParticleHPHash(*(aHash.theUpper));
58 }
59 else
60 {
61 theUpper = 0;
62 }
63 }
std::vector< int > theIndex
std::vector< G4ParticleHPDataPoint > theData

References G4ParticleHPHash(), prepared, theData, theIndex, and theUpper.

Member Function Documentation

◆ Clear()

void G4ParticleHPHash::Clear ( )
inline

Definition at line 83 of file G4ParticleHPHash.hh.

84 {
85 if(theUpper)
86 {
87 theUpper->Clear();
88 delete theUpper;
89 theUpper = 0;
90 }
91 theIndex.clear();
92 theData.clear();
93 prepared = false;
94 }

References Clear(), prepared, theData, theIndex, and theUpper.

Referenced by G4ParticleHPVector::CleanUp(), Clear(), G4ParticleHPVector::ReHash(), and G4ParticleHPVector::~G4ParticleHPVector().

◆ GetMinIndex()

G4int G4ParticleHPHash::GetMinIndex ( G4double  e) const
inline

Definition at line 111 of file G4ParticleHPHash.hh.

112 {
113 G4int result=-1;
114 if(theData.size() == 0) return 0;
115 if(theData[0].GetX()>e) return 0;
116
117 G4int lower=0;
118 if(theUpper != 0)
119 {
120 lower = theUpper->GetMinIndex(e);
121 }
122 unsigned int i;
123 for(i=lower; i<theData.size(); i++)
124 {
125 if(theData[i].GetX()>e)
126 {
127 result = theIndex[i-1];
128 break;
129 }
130 }
131 if(result == -1) result = theIndex[theIndex.size()-1];
132 return result;
133 }
int G4int
Definition: G4Types.hh:85
G4int GetMinIndex(G4double e) const

References GetMinIndex(), theData, theIndex, and theUpper.

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

◆ operator=()

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

Definition at line 65 of file G4ParticleHPHash.hh.

66 {
67 if(&aHash != this)
68 {
69 theIndex = aHash.theIndex;
70 theData = aHash.theData;
71 if(aHash.theUpper != 0)
72 {
73 theUpper = new G4ParticleHPHash(*(aHash.theUpper));
74 }
75 else
76 {
77 theUpper = 0;
78 }
79 }
80 return *this;
81 }

References G4ParticleHPHash(), theData, theIndex, and theUpper.

◆ Prepared()

G4bool G4ParticleHPHash::Prepared ( ) const
inline

◆ SetData()

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

Definition at line 97 of file G4ParticleHPHash.hh.

98 {
99 prepared = true;
101 aPoint.SetData(x, y);
102 theData.push_back(aPoint);
103 theIndex.push_back(index);
104 if(0 == theData.size()%10 && 0!=theData.size())
105 {
106 if(0 == theUpper) theUpper = new G4ParticleHPHash();
107 theUpper->SetData( static_cast<G4int>(theData.size())-1, x, y);
108 }
109 }
void SetData(G4double e, G4double x)
void SetData(G4int index, G4double x, G4double y)

References G4ParticleHPHash(), prepared, G4ParticleHPDataPoint::SetData(), SetData(), theData, theIndex, and theUpper.

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

Field Documentation

◆ prepared

G4bool G4ParticleHPHash::prepared
private

Definition at line 137 of file G4ParticleHPHash.hh.

Referenced by Clear(), G4ParticleHPHash(), Prepared(), and SetData().

◆ theData

std::vector<G4ParticleHPDataPoint> G4ParticleHPHash::theData
private

Definition at line 140 of file G4ParticleHPHash.hh.

Referenced by Clear(), G4ParticleHPHash(), GetMinIndex(), operator=(), and SetData().

◆ theIndex

std::vector<int> G4ParticleHPHash::theIndex
private

Definition at line 139 of file G4ParticleHPHash.hh.

Referenced by Clear(), G4ParticleHPHash(), GetMinIndex(), operator=(), and SetData().

◆ theUpper

G4ParticleHPHash* G4ParticleHPHash::theUpper
private

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