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

#include <G4ParticleHPHash.hh>

Public Member Functions

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

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 }

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 }

◆ 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 }

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 }

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

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 }

◆ Prepared()

G4bool G4ParticleHPHash::Prepared ( ) const
inline

Definition at line 96 of file G4ParticleHPHash.hh.

96{return prepared;}

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

◆ 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)

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


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