15 inline float logisticFunction (
const float x) {
return 1./(1.+unsafe_expf<4>(-
x));}
17 inline float BetheHeitlerMean (
const float rl) {
18 return unsafe_expf<4>(-rl);
21 inline float BetheHeitlerVariance (
const float rl)
23 #if defined(__clang__) || defined(__INTEL_COMPILER) 29 float mean = BetheHeitlerMean(rl);
30 return unsafe_expf<4>(-rl*l3ol2) - mean*mean;
57 const int correctionFlag) :
60 theCorrectionFlag(correctionFlag)
63 edm::LogInfo(
"GsfBetheHeitlerUpdator") <<
"1st moment of mixture will be corrected";
66 <<
"1st and 2nd moments of mixture will be corrected";
79 edm::LogInfo(
"GsfBetheHeitlerUpdator") <<
"Reading GSF parameterization " 80 <<
"of Bethe-Heitler energy loss from " 82 std::ifstream ifs(parFile.
fullPath().c_str());
101 float coeffs[order+1];
102 for (
int i=0; i<(order+1); ++i ) aStream >> coeffs[
i];
132 if ( rl<0.01
f ) rl = 0.01f;
133 if ( rl>0.20
f ) rl = 0.20f;
136 GSContainer mixture{mixtureData[0],mixtureData[1],mixtureData[2]};
147 effects[
i].
weight*=mixture.first[
i];
153 effects[
i].
deltaP += p*(mixture.second[
i]-1.f);
156 float f = 1.f/(p*mixture.second[
i]);
157 varPinv = f*f*mixture.third[
i];
164 effects[
i].
deltaP += p*(1.f/mixture.second[
i]-1.f);
165 varPinv = mixture.third[
i]/(p*
p);
188 mixture.
first[
i]=logisticFunction(weight[
i]);
189 mixture.
second[
i]=logisticFunction(z[i]);
190 mixture.
third[
i]=unsafe_expf<4>(vz[
i]);;
229 float mean = BetheHeitlerMean(rl);
247 float var = BetheHeitlerVariance(rl) +
248 BetheHeitlerMean(rl)*BetheHeitlerMean(rl) -
Polynomial readPolynomial(std::ifstream &, const int)
Read coefficients of one polynomial from file.
void correctWeights(GSContainer &) const
Correction for weight of component 1.
Polynomial thePolyWeights[MaxSize]
correction of 1st or 1st&2nd moments
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect[]) const
Computation: generates vectors of weights, means and standard deviations.
void getMixtureParameters(const float, GSContainer &) const
Filling of mixture (in terms of z=E/E0)
LocalVector localMomentum() const
T x() const
Cartesian x coordinate.
const SurfaceType & surface() const
int theTransformationCode
number of components used for parameterisation
GsfBetheHeitlerUpdator(const std::string fileName, const int correctionFlag)
constructor with explicit filename and correction flag
int theCorrectionFlag
values to be transformed by logistic / exp. function?
float correctedFirstVar(const float, const GSContainer &) const
Correction for variance of component 1.
Polynomial thePolyVars[MaxSize]
parametrisation of mean for each componentP
std::string fullPath() const
void readParameters(const std::string)
Read parametrization from file.
Polynomial thePolyMeans[MaxSize]
parametrisation of weight for each component
const MediumProperties & mediumProperties() const
float correctedFirstMean(const float, const GSContainer &) const
Correction for mean of component 1.