24 throw std::invalid_argument(
"Missing input truth particles collection");
27 throw std::invalid_argument(
"Missing output tracks parameters collection");
34 const auto& particles =
37 parameters.reserve(particles.size());
40 auto rng = m_cfg.randomNumbers->spawnGenerator(ctx);
41 std::normal_distribution<double> stdNormal(0.0, 1.0);
43 for (
const auto&
particle : particles) {
46 const auto pt =
particle.transverseMomentum();
52 m_cfg.sigmaD0PtA * std::exp(-1.0 *
std::abs(m_cfg.sigmaD0PtB) * pt);
55 m_cfg.sigmaZ0PtA * std::exp(-1.0 *
std::abs(m_cfg.sigmaZ0PtB) * pt);
56 const auto sigmaP = m_cfg.sigmaPRel *
p;
58 const auto sigmaQOverP = sigmaP / (
p *
p);
60 const auto sigmaT0 = m_cfg.sigmaT0;
61 const auto sigmaPhi = m_cfg.sigmaPhi;
62 const auto sigmaTheta = m_cfg.sigmaTheta;
65 const auto sigmaU = sigmaD0;
67 const auto sigmaV = sigmaZ0 * std::sin(theta);
70 const auto deltaD0 = sigmaD0 * stdNormal(rng);
71 const auto deltaZ0 = sigmaZ0 * stdNormal(rng);
72 const auto deltaT0 = sigmaT0 * stdNormal(rng);
73 const auto deltaPhi = sigmaPhi * stdNormal(rng);
74 const auto deltaTheta = sigmaTheta * stdNormal(rng);
75 const auto deltaP = sigmaP * stdNormal(rng);
84 const auto [newPhi, newTheta] =
87 const auto newP =
p + deltaP;
98 parameters.emplace_back(pos4, newPhi, newTheta, newP,
particle.charge(),
102 ctx.
eventStore.
add(m_cfg.outputTrackParameters, std::move(parameters));