Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleSelectors.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleSelectors.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2021 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 
9 #pragma once
10 
13 
14 namespace ActsFatras {
15 
17 struct EveryParticle {
18  bool operator()(const Particle & /*particle*/) const { return true; }
19 };
20 
23  bool operator()(const Particle &particle) const {
24  return (particle.charge() == Particle::Scalar(0));
25  }
26 };
27 
30  bool operator()(const Particle &particle) const {
31  return (particle.charge() != Particle::Scalar(0));
32  }
33 };
34 
37  bool operator()(const Particle &particle) const {
38  return (Particle::Scalar(0) < particle.charge());
39  }
40 };
41 
44  bool operator()(const Particle &particle) const {
45  return (particle.charge() < Particle::Scalar(0));
46  }
47 };
48 
52 template <Acts::PdgParticle Pdg>
53 struct PdgSelector {
54  bool operator()(const Particle &particle) const {
55  return (particle.pdg() == Pdg);
56  }
57 };
58 
60 template <Acts::PdgParticle Pdg>
62  bool operator()(const Particle &particle) const {
63  return (makeAbsolutePdgParticle(particle.pdg()) ==
65  }
66 };
67 
71 template <Acts::PdgParticle Pdg>
72 struct PdgExcluder {
73  bool operator()(const Particle &particle) const {
74  return (particle.pdg() != Pdg);
75  }
76 };
77 
79 template <Acts::PdgParticle Pdg>
81  bool operator()(const Particle &particle) const {
82  return (makeAbsolutePdgParticle(particle.pdg()) !=
84  }
85 };
86 
87 } // namespace ActsFatras