71{
75 for (i = 0; i < nEnergy; ++i) {
76 it = i;
77#ifdef PHP_AS_HP
78 if (theAngular[i].GetEnergy() > anEnergy) break;
79#else
80 if (theAngular[i].GetEnergy() >= anEnergy) break;
81#endif
82 }
84
85
86
87
88 if (it == 0) {
92 result = theAngular[0].
Sample(anEnergy, massCode, targetMass, theAngularRep, theInterpolation);
94 }
95 else {
96
97
98
99
100
101
102
103
104
105
106#ifdef PHP_AS_HP
110 result = theAngular[it].
Sample(anEnergy, massCode, targetMass, theAngularRep, theInterpolation);
112
113#else
114 if (fCacheAngular.
Get() ==
nullptr) {
116 fCacheAngular.
Put(angpar);
117 }
120 (theAngular[it - 1]), (theAngular[it]));
124
125 result =
126 fCacheAngular.
Get()->
Sample(anEnergy, massCode, targetMass, theAngularRep, theInterpolation);
128#endif
129 }
130
131 return result;
132}
G4InterpolationScheme GetScheme(G4int index) const
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass, G4int angularRep, G4int interpol)
void SetPrimary(G4ReactionProduct *aPrimary)
void SetTarget(G4ReactionProduct *aTarget)
G4double MeanEnergyOfThisInteraction()
void SetTargetCode(G4double aTargetCode)
void BuildByInterpolation(G4double anEnergy, G4InterpolationScheme aScheme, G4ParticleHPContAngularPar &store1, G4ParticleHPContAngularPar &store2)
G4double MeanEnergyOfThisInteraction() override
G4ReactionProduct * GetTarget() const
G4ReactionProduct * GetProjectileRP() const