#include <G4InterpolationManager.hh>
Definition at line 37 of file G4InterpolationManager.hh.
◆ G4InterpolationManager()
G4InterpolationManager::G4InterpolationManager |
( |
| ) |
|
|
inline |
Definition at line 43 of file G4InterpolationManager.hh.
44 {
45 nRanges = 1;
47 start[0] = 0;
49 range [0] = 100000;
52 nEntries = 0;
53 }
◆ ~G4InterpolationManager()
G4InterpolationManager::~G4InterpolationManager |
( |
| ) |
|
|
inline |
Definition at line 55 of file G4InterpolationManager.hh.
56 {
57 if(start!=0) delete [] start;
58 if(range!=0) delete [] range;
59 if(scheme!=0) delete [] scheme;
60 }
◆ AppendScheme()
Definition at line 90 of file G4InterpolationManager.cc.
91 {
92 if(aPoint!=nEntries)
93 {
94 G4cout <<
"G4InterpolationManager::AppendScheme - "<<aPoint<<
" "<<nEntries<<
G4endl;
95 throw G4HadronicException(__FILE__, __LINE__,
"Wrong usage of G4InterpolationManager::AppendScheme");
96 }
97 if(nEntries==0)
98 {
99 nEntries = 1;
100 nRanges = 1;
101 start[0] = 0;
102 range [0] = 1;
103 scheme[0] = aScheme;
104 }
105 else if(aScheme==scheme[nRanges-1])
106 {
107 ++range[nRanges-1];
108 nEntries++;
109 }
110 else
111 {
112 nEntries++;
113 nRanges++;
118 for(i=0; i<nRanges-1; i++)
119 {
120 buffer[i] = start[i];
121 buffer1[i] = range[i];
122 buff2[i] = scheme[i];
123 }
124 delete [] start;
125 delete [] range;
126 delete [] scheme;
127 start = buffer;
128 range = buffer1;
129 scheme = buff2;
130 start[nRanges-1] = start[nRanges-2]+range[nRanges-2];
131 range[nRanges-1] = 1;
132 scheme[nRanges-1] = aScheme;
133 }
134 }
G4GLOB_DLL std::ostream G4cout
Referenced by G4ParticleHPVector::Merge(), and G4ParticleHPVector::SetScheme().
◆ CleanUp()
void G4InterpolationManager::CleanUp |
( |
| ) |
|
|
inline |
◆ GetInverseScheme()
◆ GetScheme()
Definition at line 131 of file G4InterpolationManager.hh.
132 {
134 for(
G4int i=1; i<nRanges; i++)
135 {
136 if(index<start[i]) break;
137 it = i;
138 }
139 return scheme[it];
140 }
Referenced by G4ParticleHPContAngularPar::BuildByInterpolation(), G4ParticleHPAngularP::GetCosTh(), GetInverseScheme(), G4ParticleHPVector::GetMeanX(), G4ParticleHPVector::GetScheme(), G4ParticleHPVector::GetXsec(), G4ParticleHPPartial::GetY(), G4ParticleHPVector::Integrate(), G4ParticleHPVector::IntegrateAndNormalise(), G4ParticleHPContEnergyAngular::Sample(), G4ParticleHPDiscreteTwoBody::Sample(), G4ParticleHPLabAngularEnergy::Sample(), G4ParticleHPContAngularPar::Sample(), G4ParticleHPLegendreStore::Sample(), G4ParticleHPPartial::Sample(), G4ParticleHPLegendreStore::SampleDiscreteTwoBody(), G4ParticleHPLegendreStore::SampleElastic(), and G4ParticleHPLegendreStore::SampleMax().
◆ Init() [1/3]
void G4InterpolationManager::Init |
( |
G4int |
aScheme, |
|
|
G4int |
aRange |
|
) |
| |
|
inline |
Definition at line 84 of file G4InterpolationManager.hh.
85 {
86 nRanges = 1;
87 start[0] = 0;
88 range [0] = aRange;
90 nEntries = aRange;
91 }
G4InterpolationScheme MakeScheme(G4int it)
Referenced by G4ParticleHPAngularP::Init(), G4ParticleHPContEnergyAngular::Init(), G4ParticleHPDiscreteTwoBody::Init(), G4ParticleHPLabAngularEnergy::Init(), G4ParticleHPVector::Init(), G4ParticleHPArbitaryTab::Init(), G4ParticleHPPhotonDist::InitAngular(), G4ParticleHPLegendreStore::InitInterpolation(), G4ParticleHPPartial::InitInterpolation(), G4ParticleHPVector::InitInterpolation(), G4ParticleHPDiscreteTwoBody::Sample(), G4ParticleHPContAngularPar::Sample(), and G4ParticleHPContAngularPar::SetInterpolation().
◆ Init() [2/3]
Definition at line 92 of file G4InterpolationManager.hh.
93 {
94 nRanges = 1;
95 start[0] = 0;
96 range [0] = aRange;
97 scheme[0] = aScheme;
98 nEntries = aRange;
99 }
◆ Init() [3/3]
void G4InterpolationManager::Init |
( |
std::istream & |
aDataFile | ) |
|
|
inline |
Definition at line 101 of file G4InterpolationManager.hh.
102 {
103 delete [] start;
104 delete [] range;
105 delete [] scheme;
106 aDataFile >> nRanges;
107 start =
new G4int[nRanges];
108 range =
new G4int[nRanges];
110 start[0] = 0;
112 for(
G4int i=0; i<nRanges; i++)
113 {
114 aDataFile>>range[i];
115
116
117
118
119
120
121 if(i!=0) start[i] = range[i-1];
122
123 aDataFile>>it;
125 }
126 nEntries = start[nRanges-1]+range[nRanges-1];
127 }
◆ MakeScheme()
Definition at line 33 of file G4InterpolationManager.cc.
34 {
36 switch(it)
37 {
38 case 1:
40 break;
41 case 2:
43 break;
44 case 3:
46 break;
47 case 4:
49 break;
50 case 5:
52 break;
53 case 11:
55 break;
56 case 12:
58 break;
59 case 13:
61 break;
62 case 14:
64 break;
65 case 15:
67 break;
68 case 21:
70 break;
71 case 22:
73 break;
74 case 23:
76 break;
77 case 24:
79 break;
80 case 25:
82 break;
83 default:
84 throw G4HadronicException(__FILE__, __LINE__,
"G4InterpolationManager: unknown interpolation scheme");
85 break;
86 }
87 return result;
88 }
Referenced by Init().
◆ operator=()
Definition at line 62 of file G4InterpolationManager.hh.
63 {
64 if(this != &aManager)
65 {
66 nRanges = aManager.nRanges;
67 nEntries = aManager.nEntries;
68 if(scheme!=0) delete [] scheme;
69 if(start!=0) delete [] start;
70 if(range!=0) delete [] range;
72 start =
new G4int[nRanges];
73 range =
new G4int[nRanges];
74 for(
G4int i=0; i<nRanges; i++)
75 {
76 scheme[i]=aManager.scheme[i];
77 start[i]=aManager.start[i];
78 range[i]=aManager.range[i];
79 }
80 }
81 return *this;
82 }
◆ G4InterpolationIterator
The documentation for this class was generated from the following files: