26 throw std::invalid_argument(
"Missing input track parameters");
29 throw std::invalid_argument(
"Missing output track parameters");
39 auto within = [](
double x,
double min,
double max) {
40 return (min <= x) and (x < max);
42 auto isValidTrack = [&](
const auto& trk) {
43 const auto theta = trk.template get<Acts::eBoundTheta>();
44 const auto eta = -std::log(std::tan(
theta / 2));
46 return within(trk.transverseMomentum(),
m_cfg.ptMin,
m_cfg.ptMax) and
47 within(std::abs(eta),
m_cfg.absEtaMin,
m_cfg.absEtaMax) and
49 within(trk.template get<Acts::eBoundPhi>(),
m_cfg.phiMin,
51 within(trk.template get<Acts::eBoundLoc0>(),
m_cfg.loc0Min,
53 within(trk.template get<Acts::eBoundLoc1>(),
m_cfg.loc1Min,
55 within(trk.template get<Acts::eBoundTime>(),
m_cfg.timeMin,
59 const auto& inputTrackParameters = m_inputTrackParameters(ctx);
61 outputTrackParameters.reserve(inputTrackParameters.size());
64 for (uint32_t
i = 0;
i < inputTrackParameters.size(); ++
i) {
65 const auto& trk = inputTrackParameters[
i];
66 if (isValidTrack(trk)) {
67 outputTrackParameters.push_back(trk);
70 outputTrackParameters.shrink_to_fit();
73 << outputTrackParameters.size() <<
" from "
74 << inputTrackParameters.size()
75 <<
" tracks in track parameters");
77 m_outputTrackParameters(ctx,
std::move(outputTrackParameters));