37 throw std::invalid_argument(
"Missing input truth particles collection");
40 throw std::invalid_argument(
"Missing output tracks parameters collection");
43 throw std::invalid_argument(
"Missing random numbers tool");
47 ACTS_INFO(
"Override truth particle hypothesis with "
58 const auto&
particles = m_inputParticles(ctx);
63 auto rng =
m_cfg.randomNumbers->spawnGenerator(ctx);
64 std::normal_distribution<double> stdNormal(0.0, 1.0);
70 auto perigee = Acts::Surface::makeShared<Acts::PerigeeSurface>(
71 vtxParticles.begin()->position());
73 for (
const auto&
particle : vtxParticles) {
78 const auto p =
particle.absoluteMomentum();
84 const double sigmaD0 =
86 m_cfg.sigmaD0PtA * std::exp(-1.0 * std::abs(
m_cfg.sigmaD0PtB) * pt);
87 const double sigmaZ0 =
89 m_cfg.sigmaZ0PtA * std::exp(-1.0 * std::abs(
m_cfg.sigmaZ0PtB) * pt);
90 const double sigmaP =
m_cfg.sigmaPRel *
p;
92 const double sigmaQOverP = sigmaP / (
p *
p);
94 const double sigmaT0 =
m_cfg.sigmaT0;
95 const double sigmaPhi =
m_cfg.sigmaPhi;
96 const double sigmaTheta =
m_cfg.sigmaTheta;
105 phi + sigmaPhi * stdNormal(
rng), theta + sigmaTheta * stdNormal(
rng));
109 const double newP = std::max(0.0,
p + sigmaP * stdNormal(
rng));
112 ACTS_VERBOSE(
"Smearing particle (pos, time, phi, theta, q/p):");
114 <<
", " <<
phi <<
", " << theta <<
", "
115 << (q != 0 ? q /
p : 1 /
p));
130 if (
m_cfg.initialSigmas) {
134 (*
m_cfg.initialSigmas)[
i];