43 : fFunction(pFunction), fNumber(n),
44 fChebyshevCof(new
G4double[fNumber]),
45 fMean(0.5*(b+a)), fDiff(0.5*(b-a))
55 rootSum = std::cos(cof*(i+0.5)) ;
65 rootSum += tempFunction[i]*std::cos(cofj*(i+0.5)) ;
69 delete[] tempFunction ;
83 : fFunction(pFunction), fNumber(nx),
84 fChebyshevCof(new
G4double[fNumber]),
85 fMean(0.5*(b+a)), fDiff(0.5*(b-a))
89 G4Exception(
"G4ChebyshevApproximation::G4ChebyshevApproximation()",
100 rootSum = std::cos(cof*(i+0.5)) ;
110 rootSum += tempFunction[i]*std::cos(cofj*(i+0.5)) ;
125 delete[] tempFunction ;
137 : fFunction(pFunction), fNumber(n),
138 fChebyshevCof(new
G4double[fNumber]),
139 fMean(0.5*(b+a)), fDiff(0.5*(b-a))
149 rootSum = std::cos(cof*(i+0.5)) ;
159 rootSum += tempFunction[i]*std::cos(cofj*(i+0.5)) ;
170 delete[] tempFunction ;
193 if(number < 0 && number >=
fNumber)
195 G4Exception(
"G4ChebyshevApproximation::GetChebyshevCof()",
209 G4double evaluate = 0.0, evaluate2 = 0.0, temp = 0.0,
210 xReduced = 0.0, xReduced2 = 0.0 ;
214 G4Exception(
"G4ChebyshevApproximation::ChebyshevEvaluation()",
218 xReduced2 = 2.0*xReduced ;
222 evaluate = xReduced2*evaluate - evaluate2 +
fChebyshevCof[i] ;
225 return xReduced*evaluate - evaluate2 + 0.5*
fChebyshevCof[0] ;
265 sum += factor*integralCof[i] ;
268 integralCof[fNumber-1] = cof*
fChebyshevCof[fNumber-2]/(fNumber-1) ;
269 sum += factor*integralCof[fNumber-1] ;
270 integralCof[0] = 2.0*
sum ;
std::vector< ExP01TrackerHit * > a
void DerivativeChebyshevCof(G4double derCof[]) const
G4ChebyshevApproximation(function pFunction, G4int n, G4double a, G4double b)
G4double ChebyshevEvaluation(G4double x) const
void IntegralChebyshevCof(G4double integralCof[]) const
G4double GetChebyshevCof(G4int number) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
~G4ChebyshevApproximation()
static constexpr double pi