Skip to content

Conversation

@mattiaisgro
Copy link

This pull request introduces a PDG code enumeration PDGCode which can be used as an integer value to reference particles by name. For example:

if (in[j] ==  21 || in[j] == 15)
      result[j] = 1;

becomes

if (in[j] == PDG_GLUON || in[j] == PDG_TAU)
      result[j] = 1;

The PDG codes are defined in the MCParticleCodes.h header file, which has no dependencies. Currently, only basic particles have been defined, but more may be added when needed.

Advantages:

  • Improves code readability
  • Reduces human error
  • By using an unscoped enumeration, legacy code does not need to change. Software already using FCCAnalyses will not need to change, but new code may use this feature

The PDGCode enumeration contains common particle codes which can be used to make code clearer and less error prone, instead of hard-coding particle codes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant