Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:45

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 <cstdint>
0012 
0013 namespace Acts {
0014 
0015 /// Symbolic values for commonly used PDG particle numbers.
0016 enum PdgParticle : std::int32_t {
0017   eInvalid = 0,
0018   eElectron = 11,
0019   eAntiElectron = -eElectron,
0020   ePositron = -eElectron,
0021   eMuon = 13,
0022   eAntiMuon = -eMuon,
0023   eTau = 15,
0024   eAntiTau = -eTau,
0025   eGamma = 22,
0026   ePionZero = 111,
0027   ePionPlus = 211,
0028   ePionMinus = -ePionPlus,
0029   eKaonPlus = 321,
0030   eKaonMinus = -eKaonPlus,
0031   eNeutron = 2112,
0032   eAntiNeutron = -eNeutron,
0033   eProton = 2212,
0034   eAntiProton = -eProton,
0035   eLead = 1000822080
0036 };
0037 
0038 /// Convert an anti-particle to its particle and leave particles as-is.
0039 static constexpr PdgParticle makeAbsolutePdgParticle(PdgParticle pdg) {
0040   const auto value = static_cast<std::int32_t>(pdg);
0041   return static_cast<PdgParticle>((0 <= value) ? value : -value);
0042 }
0043 
0044 }  // namespace Acts