File indexing completed on 2025-01-18 09:11:42
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/EventData/Index.hpp"
0013 #include "ActsExamples/EventData/SimParticle.hpp"
0014 #include "ActsExamples/Framework/DataHandle.hpp"
0015 #include "ActsExamples/Framework/IAlgorithm.hpp"
0016 #include "ActsExamples/Framework/ProcessCode.hpp"
0017
0018 #include <limits>
0019 #include <string>
0020
0021 namespace ActsExamples {
0022 struct AlgorithmContext;
0023
0024
0025 class ParticleSelector final : public IAlgorithm {
0026 public:
0027 struct Config {
0028
0029 std::string inputParticles;
0030
0031
0032 std::string inputParticleMeasurementsMap;
0033
0034 std::string outputParticles;
0035
0036
0037 double rhoMin = 0;
0038 double rhoMax = std::numeric_limits<double>::infinity();
0039
0040 double absZMin = 0;
0041 double absZMax = std::numeric_limits<double>::infinity();
0042
0043 double timeMin = -std::numeric_limits<double>::infinity();
0044 double timeMax = std::numeric_limits<double>::infinity();
0045
0046 double phiMin = -std::numeric_limits<double>::infinity();
0047 double phiMax = std::numeric_limits<double>::infinity();
0048 double etaMin = -std::numeric_limits<double>::infinity();
0049 double etaMax = std::numeric_limits<double>::infinity();
0050 double absEtaMin = 0;
0051 double absEtaMax = std::numeric_limits<double>::infinity();
0052
0053 double ptMin = 0;
0054 double ptMax = std::numeric_limits<double>::infinity();
0055
0056 double mMin = 0;
0057 double mMax = std::numeric_limits<double>::infinity();
0058
0059 std::size_t hitsMin = 0;
0060 std::size_t hitsMax = std::numeric_limits<std::size_t>::max();
0061
0062 std::size_t measurementsMin = 0;
0063 std::size_t measurementsMax = std::numeric_limits<std::size_t>::max();
0064
0065 bool removeCharged = false;
0066
0067 bool removeNeutral = false;
0068
0069 bool removeSecondaries = false;
0070
0071 std::vector<int> excludeAbsPdgs;
0072
0073
0074 std::uint64_t minPrimaryVertexId = 0;
0075
0076 std::uint64_t maxPrimaryVertexId =
0077 std::numeric_limits<std::uint64_t>::max();
0078 };
0079
0080 ParticleSelector(const Config& config, Acts::Logging::Level level);
0081
0082 ProcessCode execute(const AlgorithmContext& ctx) const final;
0083
0084
0085 const Config& config() const { return m_cfg; }
0086
0087 private:
0088 Config m_cfg;
0089
0090 ReadDataHandle<SimParticleContainer> m_inputParticles{this, "InputParticles"};
0091 ReadDataHandle<InverseMultimap<SimBarcode>> m_inputParticleMeasurementsMap{
0092 this, "InputParticleMeasurementsMap"};
0093
0094 WriteDataHandle<SimParticleContainer> m_outputParticles{this,
0095 "OutputParticles"};
0096 };
0097
0098 }