331{
333
336
337 const double radiationLength = materialProperties.x0();
338 const double momentum = globalMomentum.mag();
339 double pathlengthInX0 = pathLength / radiationLength;
340
341 if (pathlengthInX0 < s_singleGaussianRange) {
344 return;
345 }
346
347
348
349 if (pathlengthInX0 < s_lowerRange) {
350 const double meanZ = std::exp(-1. * pathlengthInX0);
352 const double varZ =
353 std::exp(-1. * pathlengthInX0 * std::log(3.) / std::log(2.)) -
354 std::exp(-2. * pathlengthInX0);
355 double deltaP(0.);
356 double varQoverP(0.);
360 } else {
363 }
364 cache.
elements[0] = { 1., deltaP, varQoverP };
366 return;
367 }
368
369 if (pathlengthInX0 > s_upperRange) {
370 pathlengthInX0 = s_upperRange;
371 }
372
373
375 if (pathlengthInX0 > s_xOverRange) {
379 pathlengthInX0,
381 } else {
385 pathlengthInX0,
387 }
388
390 int componentIndex = 0;
391 double weightToBeRemoved(0.);
392 int componentWithHighestMean(0);
393
395 if (mixture[componentIndex].
mean > mixture[componentWithHighestMean].
mean) {
396 componentWithHighestMean = componentIndex;
397 }
398 if (mixture[componentIndex].
mean >= s_componentMeanCut) {
399 continue;
400 }
401 weightToBeRemoved += mixture[componentIndex].weight;
402 }
403
404 componentIndex = 0;
406 double varianceInverseMomentum = 0;
407
408
409 if (mixture[componentIndex].
mean < s_componentMeanCut) {
410 continue;
411 }
412
413 double weight = mixture[componentIndex].weight;
414 if (componentIndex == componentWithHighestMean) {
415 weight += weightToBeRemoved;
416 }
417
418 double deltaP(0.);
420 deltaP =
momentum * (mixture[componentIndex].mean - 1.);
421 const double f = 1. / (
momentum * mixture[componentIndex].mean);
422 varianceInverseMomentum =
f *
f * mixture[componentIndex].variance;
423 } else {
424 deltaP =
momentum * (1. / mixture[componentIndex].mean - 1.);
425 varianceInverseMomentum = mixture[componentIndex].variance / (
momentum *
momentum);
426 }
427
428
430 deltaP,
431 varianceInverseMomentum };
433 }
434}
std::array< ComponentValues, GSFConstants::maxNumberofMatComponents > MixtureParameters
const Amg::Vector3D & momentum() const
Access method for the momentum.
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersBase< TrackParametersDim, Charged > TrackParameters
std::array< element, GSFConstants::maxNumberofMatComponents > elements