Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 07:49:41

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/PdgParticle.hpp"
0012 
0013 #include <iosfwd>
0014 #include <optional>
0015 #include <string_view>
0016 
0017 namespace Acts {
0018 
0019 struct ParticleData {
0020   float charge{};
0021   float mass{};
0022   std::string_view name;
0023 };
0024 
0025 /// Find the charge for a given PDG particle number.
0026 ///
0027 /// @return Charge in native units.
0028 std::optional<float> findCharge(PdgParticle pdg);
0029 
0030 /// Find the charge for a given PDG particle number of a nucleus.
0031 /// Try its ground state first, and ultimately get the proton number from PDG
0032 ///
0033 /// @return Charge in native units.
0034 float findChargeOfNucleus(PdgParticle pdg);
0035 
0036 /// Find the mass for a given PDG particle number.
0037 ///
0038 /// @return Mass in native units.
0039 std::optional<float> findMass(PdgParticle pdg);
0040 
0041 /// Find the mass for a given PDG particle number of a nucleus.
0042 /// Try its ground state first, and ultimately get the mass from
0043 /// Bethe-Weizsacker formula
0044 ///
0045 /// @return Mass in native units
0046 float findMassOfNucleus(PdgParticle pdg);
0047 
0048 /// Calculate the mass of a nucleus using Bethe-Weizsacker formula
0049 /// Parameters obtained from https://www.actaphys.uj.edu.pl/R/37/6/1833
0050 ///
0051 /// @return Mass in native units
0052 float calculateNucleusMass(PdgParticle pdg);
0053 
0054 /// Find a descriptive particle name for a given PDG particle number.
0055 ///
0056 /// @return Particle name.
0057 std::optional<std::string_view> findName(PdgParticle pdg);
0058 
0059 /// Find a descriptive particle name for a given PDG particle number of a
0060 /// nucleus. Try to get the name from its ground state.
0061 ///
0062 /// @return Particle name.
0063 std::optional<std::string_view> findNameOfNucleus(PdgParticle pdg);
0064 
0065 /// Find all known particle data for a given PDG particle number.
0066 ///
0067 /// @return Particle name.
0068 std::optional<ParticleData> findParticleData(PdgParticle pdg);
0069 
0070 /// Print PDG particle numbers with a descriptive name.
0071 std::ostream& operator<<(std::ostream& os, PdgParticle pdg);
0072 
0073 std::optional<std::string_view> pdgToShortAbsString(PdgParticle pdg);
0074 
0075 }  // namespace Acts