Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:14:58

0001 // lAger: General Purpose l/A-event Generator
0002 // Copyright (C) 2016-2021 Sylvester Joosten <sjoosten@anl.gov>
0003 //
0004 // This file is part of lAger.
0005 //
0006 // lAger is free software: you can redistribute it and/or modify
0007 // it under the terms of the GNU General Public License as published by
0008 // the Free Shoftware Foundation, either version 3 of the License, or
0009 // (at your option) any later version.
0010 //
0011 // lAger is distributed in the hope that it will be useful,
0012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 // GNU General Public License for more details.
0015 //
0016 // You should have received a copy of the GNU General Public License
0017 // along with lAger.  If not, see <https://www.gnu.org/licenses/>.
0018 //
0019 
0020 #ifndef LAGER_CORE_PDG_LOADED
0021 #define LAGER_CORE_PDG_LOADED
0022 
0023 #include <TDecayChannel.h>
0024 #include <TMath.h>
0025 #include <TParticlePDG.h>
0026 #include <cstdint>
0027 #include <memory>
0028 
0029 namespace lager {
0030 
0031 // Pentaquark particle codes
0032 // (slight deviation from PDG scheme:
0033 //   - parity code to allow for different parities in case exact parity isn't
0034 //     known
0035 //   - extra code in case we don't know the exact mass assignments of the
0036 //     penaquarks
0037 
0038 #if __cplusplus < 201402L
0039 // extra utility function needed pre-C++14
0040 // in C++14 and later we can just calculate this in the constexpr function and
0041 // store it as a variable
0042 constexpr int pdg_pentaquark_id_pcode(int parity) {
0043   return (parity == -1) ? 2 : ((parity == 1) ? 1 : 0);
0044 }
0045 #endif
0046 
0047 constexpr int32_t pdg_pentaquark_id(int q1, int q2, int q3, int q4, int qbar,
0048                                     int twoJ, int parity = 0,
0049                                     int extracode = 0) {
0050 #if __cplusplus < 201402L
0051   return extracode * 100000000 + pdg_pentaquark_id_pcode(parity) * 10000000 +
0052          9 * 1000000 + q1 * 100000 + q2 * 10000 + q3 * 1000 + q4 * 100 +
0053          qbar * 10 + twoJ + 1;
0054 #else
0055   int pcode = 0;
0056   if (parity == -1) {
0057     pcode = 2;
0058   } else if (parity == 1) {
0059     pcode = 1;
0060   }
0061   return extracode * 100000000 + pcode * 10000000 + 9 * 1000000 + q1 * 100000 +
0062          q2 * 10000 + q3 * 1000 + q4 * 100 + qbar * 10 + twoJ + 1;
0063 #endif
0064 }
0065 
0066 // add possibility for nuclear id as per PDG
0067 // Parameters:
0068 //  A: baryon number (#protons + #neutrons + #lambdas)
0069 //  Z: charge (#protons)
0070 //  L: Number of strange quark
0071 //  I: Isomer level, where 0 corresponds to the ground state
0072 constexpr int32_t pdg_nuclear_id(unsigned A, unsigned Z, unsigned L = 0,
0073                                  unsigned I = 0) {
0074   return 1000000000 + L * 10000000 + Z * 10000 + A * 10 + I;
0075 }
0076 
0077 // particle ID enum
0078 enum class pdg_id : int32_t {
0079   // partons
0080   d = 1,
0081   d_bar = -1,
0082   u = 2,
0083   u_bar = -2,
0084   s = 3,
0085   s_bar = -3,
0086   c = 4,
0087   c_bar = -4,
0088   b = 5,
0089   b_bar = -5,
0090   t = 6,
0091   t_bar = -6,
0092   // leptons
0093   e_minus = 11,
0094   e_plus = -11,
0095   nu_e = 12,
0096   nu_e_bar = -12,
0097   mu_minus = 13,
0098   mu_plus = -13,
0099   nu_mu = 14,
0100   nu_mu_bar = -14,
0101   tau_minus = 15,
0102   tau_plus = -15,
0103   nu_tau = 16,
0104   nu_tau_bar = -16,
0105   // bosons
0106   g = 21,
0107   gamma = 22,
0108   Z_0 = 23,
0109   W_plus = 24,
0110   W_minus = -24,
0111   H_0 = 25,
0112   reggeon = 28,
0113   pomeron = 29,
0114   // scalar mesons
0115   pi_0 = 111,
0116   pi_plus = 211,
0117   pi_minus = -211,
0118   eta = 221,
0119   K_0 = 311,
0120   K_0_bar = -311,
0121   K_L_0 = 130,
0122   K_S_0 = 310,
0123   K_plus = 321,
0124   K_minus = -321,
0125   eta_prime = 331,
0126   // vector mesons
0127   rho_0 = 113,
0128   rho_plus = 213,
0129   rho_minus = -213,
0130   omega = 223,
0131   K_star_0 = 313,
0132   K_star_0_bar = -313,
0133   K_star_plus = 323,
0134   K_star_minus = -323,
0135   phi = 333,
0136   J_psi = 443,
0137   psi_prime = 100443,
0138   upsilon = 553,
0139   // baryons
0140   n = 2112,
0141   n_bar = -2122,
0142   p = 2212,
0143   p_bar = -2212,
0144   // nuclei
0145   H1 = 2212, // same as proton
0146   H2 = pdg_nuclear_id(2, 1),
0147   H3 = pdg_nuclear_id(3, 1),
0148   He3 = pdg_nuclear_id(3, 2),
0149   He4 = pdg_nuclear_id(4, 2),
0150   C12 = pdg_nuclear_id(12, 6),
0151   N14 = pdg_nuclear_id(14, 7),
0152   Al27 = pdg_nuclear_id(27, 13),
0153   // LHCb pentaquark hypetheses (from different models (impacts decay
0154   // distributions))
0155   Pc_wang_52p = pdg_pentaquark_id(4, 2, 2, 1, 4, 5, 1, 1),
0156   Pc_wang_52m = pdg_pentaquark_id(4, 2, 2, 1, 4, 5, -1, 1),
0157   Pc_wang_32p = pdg_pentaquark_id(4, 2, 2, 1, 4, 3, 1, 1),
0158   Pc_wang_32m = pdg_pentaquark_id(4, 2, 2, 1, 4, 3, -1, 1),
0159   Pc_iso_52p = pdg_pentaquark_id(4, 2, 2, 1, 4, 5, 1, 2),
0160   Pc_iso_52m = pdg_pentaquark_id(4, 2, 2, 1, 4, 5, -1, 2),
0161   Pc_iso_32p = pdg_pentaquark_id(4, 2, 2, 1, 4, 3, 1, 2),
0162   Pc_iso_32m = pdg_pentaquark_id(4, 2, 2, 1, 4, 3, -1, 2),
0163   // unknown
0164   unknown = -9999
0165 };
0166 
0167 // Get PID info from the buildin ROOT PDG database
0168 // note: the custom particles (nuclei, pentaquarks, ...) under pdg_id are added
0169 // to the database.
0170 // Feel free to add other particles as-needed to the database in pdg.cc
0171 TParticlePDG* pdg_particle(const pdg_id id);
0172 TParticlePDG* pdg_particle(const std::string& name);
0173 
0174 } // namespace lager
0175 
0176 #endif