111{
112
113
114
115
116
117 if(theEnergy == lastEnergy)
118 {
119 }
120 else if(theEnergy < lastEnergy && theEnergy >= binVector[lastBin])
121 {
122 lastEnergy = theEnergy;
123 lastValue = Interpolation();
124 }
125 else if(theEnergy <= edgeMin)
126 {
127 lastBin = 0;
128 lastEnergy = edgeMin;
129 lastValue = dataVector[0];
130 }
131 else if(theEnergy >= edgeMax)
132 {
133 lastBin = numberOfNodes - 1;
134 lastEnergy = edgeMax;
135 lastValue = dataVector[lastBin];
136 }
137 else
138 {
139 lastBin = (std::size_t)(
G4Log(theEnergy) / dBin - baseBin);
140 if(lastBin == numberOfNodes)
141 {
142 --lastBin;
143 }
144 lastEnergy = theEnergy;
145 lastValue = Interpolation();
146 }
147 return lastValue;
148}
G4double G4Log(G4double x)