Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleHypothesis.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleHypothesis.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 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 
16 
17 namespace Acts {
18 
19 // TODO In principle the factory methods could provide a reference to a static
20 // instance which would avoid copying the particle hypothesis and potentially
21 // save some memory. But constexpr+static seems to require C++2b extension.
22 
27  : public GenericParticleHypothesis<SinglyCharged> {
28  public:
30  : GenericParticleHypothesis(absPdg, mass, {}) {}
32  : GenericParticleHypothesis(absPdg) {}
33 
34  template <typename other_charge_t>
36  const GenericParticleHypothesis<other_charge_t>& other)
37  : GenericParticleHypothesis(other) {}
38 
39  static SinglyChargedParticleHypothesis muon() {
41  }
44  }
47  }
48 
49  static SinglyChargedParticleHypothesis chargedGeantino() {
51  }
52 };
53 
58  public:
59  constexpr NeutralParticleHypothesis(PdgParticle absPdg, float mass)
60  : GenericParticleHypothesis(absPdg, mass, {}) {}
62  : GenericParticleHypothesis(absPdg) {}
63 
64  template <typename other_charge_t>
65  constexpr NeutralParticleHypothesis(
66  const GenericParticleHypothesis<other_charge_t>& other)
67  : GenericParticleHypothesis(other) {}
68 
69  static NeutralParticleHypothesis photon() {
71  }
72  static NeutralParticleHypothesis pion0() {
74  }
75 
76  static NeutralParticleHypothesis geantino() {
78  }
79 };
80 
85  : public GenericParticleHypothesis<NonNeutralCharge> {
86  public:
88  NonNeutralCharge chargeType)
89  : GenericParticleHypothesis(absPdg, mass, chargeType) {}
91  : GenericParticleHypothesis(absPdg) {}
92 
93  template <typename other_charge_t>
96  : GenericParticleHypothesis(other) {}
97 
99  return SinglyChargedParticleHypothesis::muon();
100  }
103  }
106  }
107 
109  return NonNeutralChargedParticleHypothesis(pion().absolutePdg(),
110  pion().mass(), absQ);
111  }
112 
115  }
118  }
119 };
120 
125  public:
126  constexpr ParticleHypothesis(PdgParticle absPdg, float mass,
127  AnyCharge chargeType)
128  : GenericParticleHypothesis(absPdg, mass, chargeType) {}
130 
131  template <typename other_charge_t>
134  : GenericParticleHypothesis(other) {}
135 
137  return SinglyChargedParticleHypothesis::muon();
138  }
141  }
144  }
145 
147  return NeutralParticleHypothesis::photon();
148  }
150  return NeutralParticleHypothesis::pion0();
151  }
152 
153  static ParticleHypothesis pionLike(float absQ) {
154  return ParticleHypothesis(pion().absolutePdg(), pion().mass(), absQ);
155  }
156 
158  return NeutralParticleHypothesis::geantino();
159  }
162  }
163  static ParticleHypothesis chargedGeantino(float absQ) {
164  return ParticleHypothesis(PdgParticle::eInvalid, 0, absQ);
165  }
166 };
167 
168 } // namespace Acts