Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleSelector.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleSelector.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
12 
13 #pragma once
14 
23 
24 #include <limits>
25 #include <string>
26 
27 namespace ActsExamples {
28 struct AlgorithmContext;
29 
31 class ParticleSelector final : public IAlgorithm {
32  public:
33  struct Config {
40  // Minimum/maximum distance from the origin in the transverse plane.
41  double rhoMin = 0;
42  double rhoMax = std::numeric_limits<double>::infinity();
43  // Minimum/maximum absolute distance from the origin along z.
44  double absZMin = 0;
45  double absZMax = std::numeric_limits<double>::infinity();
46  // Minimum/maximum particle time.
47  double timeMin = -std::numeric_limits<double>::infinity();
48  double timeMax = std::numeric_limits<double>::infinity();
49  // Direction cuts.
50  double phiMin = -std::numeric_limits<double>::infinity();
51  double phiMax = std::numeric_limits<double>::infinity();
52  double etaMin = -std::numeric_limits<double>::infinity();
53  double etaMax = std::numeric_limits<double>::infinity();
54  double absEtaMin = 0;
55  double absEtaMax = std::numeric_limits<double>::infinity();
56  // Momentum cuts.
57  double ptMin = 0;
58  double ptMax = std::numeric_limits<double>::infinity();
59  // Rest mass cuts
60  double mMin = 0;
61  double mMax = std::numeric_limits<double>::infinity();
63  std::size_t measurementsMin = 0;
64  std::size_t measurementsMax = std::numeric_limits<std::size_t>::max();
66  bool removeCharged = false;
68  bool removeNeutral = false;
69 
71  bool removeSecondaries = false;
72  };
73 
75 
76  ProcessCode execute(const AlgorithmContext& ctx) const final;
77 
79  const Config& config() const { return m_cfg; }
80 
81  private:
83 
86  this, "InputMeasurementParticlesMap"};
87 
89  "OutputParticles"};
90 };
91 
92 } // namespace ActsExamples