Functions
genie::pdg Namespace Reference

Utilities for improving the code readability when using PDG codes. More...

Functions

bool IsPseudoParticle (int pdgc)
 
bool IsIon (int pdgc)
 
bool IsParticle (int pdgc)
 not ion or pseudo-particle More...
 
int IonPdgCodeToZ (int pdgc)
 
int IonPdgCodeToA (int pdgc)
 
int IonPdgCode (int A, int Z)
 
int IonPdgCode (int A, int Z, int L, int I)
 
bool IsLepton (int pdgc)
 
bool IsNeutralLepton (int pdgc)
 
bool IsChargedLepton (int pdgc)
 
bool IsNeutrino (int pdgc)
 
bool IsAntiNeutrino (int pdgc)
 
bool IsNegChargedLepton (int pdgc)
 
bool IsPosChargedLepton (int pdgc)
 
bool IsDarkMatter (int pdgc)
 
bool IsAntiDarkMatter (int pdgc)
 
bool IsNuE (int pdgc)
 
bool IsNuMu (int pdgc)
 
bool IsNuTau (int pdgc)
 
bool IsAntiNuE (int pdgc)
 
bool IsAntiNuMu (int pdgc)
 
bool IsAntiNuTau (int pdgc)
 
bool IsElectron (int pdgc)
 
bool IsPositron (int pdgc)
 
bool IsMuon (int pdgc)
 
bool IsAntiMuon (int pdgc)
 
bool IsTau (int pdgc)
 
bool IsAntiTau (int pdgc)
 
bool IsDiQuark (int pdgc)
 
bool IsQuark (int pdgc)
 
bool IsUQuark (int pdgc)
 
bool IsDQuark (int pdgc)
 
bool IsSQuark (int pdgc)
 
bool IsCQuark (int pdgc)
 
bool IsBQuark (int pdgc)
 
bool IsTQuark (int pdgc)
 
bool IsAntiQuark (int pdgc)
 
bool IsAntiUQuark (int pdgc)
 
bool IsAntiDQuark (int pdgc)
 
bool IsAntiSQuark (int pdgc)
 
bool IsAntiCQuark (int pdgc)
 
bool IsAntiBQuark (int pdgc)
 
bool IsAntiTQuark (int pdgc)
 
bool IsKaon (int pdgc)
 
bool IsPion (int pdgc)
 
bool IsProton (int pdgc)
 
bool IsNeutron (int pdgc)
 
bool IsNucleon (int pdgc)
 
bool IsNeutronOrProton (int pdgc)
 
bool IsHadron (int pdgc)
 
bool IsBaryonResonance (int pdgc)
 
bool Is2NucleonCluster (int pdgc)
 
bool IsDarkSectorParticle (int pdgc)
 
int SwitchProtonNeutron (int pdgc)
 
int ModifyNucleonCluster (int pdgc, int dQ)
 
int Neutrino2ChargedLepton (int pdgc)
 
int GeantToPdg (int geant_code)
 

Detailed Description

Utilities for improving the code readability when using PDG codes.

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

Changes required to implement the GENIE Boosted Dark Matter module were installed by Josh Berger (Univ. of Wisconsin)

May 06, 2004

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Function Documentation

int genie::pdg::GeantToPdg ( int  geant_code)

Definition at line 416 of file PDGUtils.cxx.

417 {
418  if(geant_code == 3) return kPdgElectron; // 11 / e-
419  if(geant_code == 2) return kPdgPositron; // -11 / e+
420  if(geant_code == 6) return kPdgMuon; // 13 / mu-
421  if(geant_code == 5) return kPdgAntiMuon; // -13 / mu+
422  if(geant_code == 34) return kPdgTau; // 15 / tau-
423  if(geant_code == 33) return kPdgAntiTau; // -15 / tau+
424  if(geant_code == 8) return kPdgPiP; // 211 / pi+
425  if(geant_code == 9) return kPdgPiM; // -211 / pi-
426  if(geant_code == 7) return kPdgPi0; // 111 / pi0
427  if(geant_code == 17) return kPdgEta; // 221 / eta
428  if(geant_code == 11) return kPdgKP; // 321 / K+
429  if(geant_code == 12) return kPdgKM; // -321 / K-
430  if(geant_code == 10) return kPdgK0L; // 130 / K0_{long}
431  if(geant_code == 16) return kPdgK0S; // 310 / K0_{short}
432  if(geant_code == 35) return kPdgDP; // 411 / D+
433  if(geant_code == 36) return kPdgDM; // -411 / D-
434  if(geant_code == 37) return kPdgD0; // 421 / D0
435  if(geant_code == 38) return kPdgAntiD0; // -421 / \bar{D0}
436  if(geant_code == 39) return kPdgDPs; // 431 / D+_{s}
437  if(geant_code == 40) return kPdgDMs; // -431 / D-_{s}
438  if(geant_code == 1) return kPdgGamma; // 22 / photon
439  if(geant_code == 44) return kPdgZ0; // 23 / Z
440  if(geant_code == 42) return kPdgWP; // 24 / W+
441  if(geant_code == 43) return kPdgWM; // -24 / W-
442  if(geant_code == 14) return kPdgProton; // 2212
443  if(geant_code == 15) return kPdgAntiProton; // -2212
444  if(geant_code == 13) return kPdgNeutron; // 2112
445  if(geant_code == 25) return kPdgAntiNeutron; // -2112
446  if(geant_code == 18) return kPdgLambda; // 3122 / Lambda
447  if(geant_code == 26) return kPdgAntiLambda; // -3122 / \bar{Lambda}
448  if(geant_code == 19) return kPdgSigmaP; // 3222 / Sigma+
449  if(geant_code == 20) return kPdgSigma0; // 3212 / Sigma0
450  if(geant_code == 21) return kPdgSigmaM; // 3112 / Sigma-
451  if(geant_code == 29) return kPdgAntiSigmaP; // -3112 / \bar{Sigma+}
452  if(geant_code == 28) return kPdgAntiSigma0; // -3212 / \bar{Sigma0}
453  if(geant_code == 27) return kPdgAntiSigmaM; // -3112 / \bar{Sigma-}
454  if(geant_code == 22) return kPdgXi0; // 3322 / Xi0
455  if(geant_code == 23) return kPdgXiM; // 3312 / Xi-
456  if(geant_code == 30) return kPdgAntiXi0; // -3322 / \bar{Xi0}
457  if(geant_code == 31) return kPdgAntiXiP; // -3312 / \bar{Xi+}
458  if(geant_code == 24) return kPdgOmegaM; // 3334 / Omega-
459  if(geant_code == 32) return kPdgAntiOmegaP; // -3334 / \bar{Omega+}
460 
461  // some rare Geant3 codes that don't really need definitions in PDGCodes.h
462  const int kPdgDeuteron = 1000010020; // pdg::IonPdgCode(2,1);
463  const int kPdgTritium = 1000010030; // pdg::IonPdgCode(3,1);
464  const int kPdgAlpha = 1000020040; // pdg::IonPdgCode(4,2);
465  const int kPdgHe3 = 1000020030; // pdg::IonPdgCode(3,2);
466  if(geant_code == 45) return kPdgDeuteron;
467  if(geant_code == 46) return kPdgTritium;
468  if(geant_code == 47) return kPdgAlpha;
469  if(geant_code == 49) return kPdgHe3;
470 
471  LOG("PDG", pWARN)
472  << "Can not convert geant code: " << geant_code << " to PDG";
473  return 0;
474 }
const int kPdgAntiD0
Definition: PDGCodes.h:184
const int kPdgDPs
Definition: PDGCodes.h:185
const int kPdgAntiXi0
Definition: PDGCodes.h:95
const int kPdgXi0
Definition: PDGCodes.h:93
const int kPdgLambda
Definition: PDGCodes.h:85
const int kPdgAntiSigma0
Definition: PDGCodes.h:91
const int kPdgWM
Definition: PDGCodes.h:192
const int kPdgAntiMuon
Definition: PDGCodes.h:38
const int kPdgSigma0
Definition: PDGCodes.h:88
const int kPdgElectron
Definition: PDGCodes.h:35
const int kPdgZ0
Definition: PDGCodes.h:190
const int kPdgAntiOmegaP
Definition: PDGCodes.h:98
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgTau
Definition: PDGCodes.h:39
const int kPdgKM
Definition: PDGCodes.h:173
const int kPdgGamma
Definition: PDGCodes.h:189
const int kPdgKP
Definition: PDGCodes.h:172
const int kPdgEta
Definition: PDGCodes.h:161
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
const int kPdgK0L
Definition: PDGCodes.h:176
const int kPdgOmegaM
Definition: PDGCodes.h:97
#define pWARN
Definition: Messenger.h:60
const int kPdgSigmaM
Definition: PDGCodes.h:89
const int kPdgDP
Definition: PDGCodes.h:181
const int kPdgAntiSigmaM
Definition: PDGCodes.h:92
const int kPdgXiM
Definition: PDGCodes.h:94
const int kPdgAntiNeutron
Definition: PDGCodes.h:84
const int kPdgDMs
Definition: PDGCodes.h:186
const int kPdgDM
Definition: PDGCodes.h:182
const int kPdgAntiProton
Definition: PDGCodes.h:82
const int kPdgPiM
Definition: PDGCodes.h:159
const int kPdgAntiTau
Definition: PDGCodes.h:40
const int kPdgSigmaP
Definition: PDGCodes.h:87
const int kPdgAntiXiP
Definition: PDGCodes.h:96
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgAntiLambda
Definition: PDGCodes.h:86
const int kPdgMuon
Definition: PDGCodes.h:37
const int kPdgK0S
Definition: PDGCodes.h:177
const int kPdgAntiSigmaP
Definition: PDGCodes.h:90
const int kPdgPositron
Definition: PDGCodes.h:36
const int kPdgNeutron
Definition: PDGCodes.h:83
const int kPdgWP
Definition: PDGCodes.h:191
const int kPdgD0
Definition: PDGCodes.h:183
int genie::pdg::IonPdgCode ( int  A,
int  Z 
)

Definition at line 68 of file PDGUtils.cxx.

69 {
70 // Build ion PDG code from A,Z
71 
72  return IonPdgCode(A,Z,0,0);
73 }
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
#define A
Definition: memgrp.cpp:38
int genie::pdg::IonPdgCode ( int  A,
int  Z,
int  L,
int  I 
)

Definition at line 75 of file PDGUtils.cxx.

76 {
77 // Build ion PDG code from A,Z,L,I
78 
79  int ion_pdgc = 1000000000 + L*100000000 + Z*10000 + A*10 + I;
80  return ion_pdgc;
81 }
#define A
Definition: memgrp.cpp:38
int genie::pdg::IonPdgCodeToA ( int  pdgc)

Definition at line 60 of file PDGUtils.cxx.

61 {
62 // Decoding A from the PDG code (PDG ion code convention: 10LZZZAAAI)
63 
64  int A = (ion_pdgc/10) - 1000*(ion_pdgc/10000); // don't factor out!
65  return A;
66 }
#define A
Definition: memgrp.cpp:38
int genie::pdg::IonPdgCodeToZ ( int  pdgc)

Definition at line 52 of file PDGUtils.cxx.

53 {
54 // Decoding Z from the PDG code (PDG ion code convention: 10LZZZAAAI)
55 
56  int Z = (ion_pdgc/10000) - 1000*(ion_pdgc/10000000); // don't factor out!
57  return Z;
58 }
bool genie::pdg::Is2NucleonCluster ( int  pdgc)

Definition at line 399 of file PDGUtils.cxx.

400 {
401  return (
402  pdgc == kPdgClusterNN ||
403  pdgc == kPdgClusterNP ||
404  pdgc == kPdgClusterPP
405  );
406 }
const int kPdgClusterNP
Definition: PDGCodes.h:215
const int kPdgClusterNN
Definition: PDGCodes.h:214
const int kPdgClusterPP
Definition: PDGCodes.h:216
bool genie::pdg::IsAntiBQuark ( int  pdgc)

Definition at line 313 of file PDGUtils.cxx.

314 {
315  return (pdgc == kPdgAntiBQuark);
316 }
const int kPdgAntiBQuark
Definition: PDGCodes.h:51
bool genie::pdg::IsAntiCQuark ( int  pdgc)

Definition at line 308 of file PDGUtils.cxx.

309 {
310  return (pdgc == kPdgAntiCQuark);
311 }
const int kPdgAntiCQuark
Definition: PDGCodes.h:49
bool genie::pdg::IsAntiDarkMatter ( int  pdgc)

Definition at line 130 of file PDGUtils.cxx.

131 {
132  bool is_dmbar = (pdgc == kPdgAntiDarkMatter);
133  return is_dmbar;
134 }
const int kPdgAntiDarkMatter
Definition: PDGCodes.h:219
bool genie::pdg::IsAntiDQuark ( int  pdgc)

Definition at line 298 of file PDGUtils.cxx.

299 {
300  return (pdgc == kPdgAntiDQuark);
301 }
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
bool genie::pdg::IsAntiMuon ( int  pdgc)

Definition at line 200 of file PDGUtils.cxx.

201 {
202  return (pdgc == kPdgAntiMuon);
203 }
const int kPdgAntiMuon
Definition: PDGCodes.h:38
bool genie::pdg::IsAntiNeutrino ( int  pdgc)

Definition at line 115 of file PDGUtils.cxx.

116 {
117  bool is_nubar = (pdgc == kPdgAntiNuE) ||
118  (pdgc == kPdgAntiNuMu) ||
119  (pdgc == kPdgAntiNuTau);
120 
121  return is_nubar;
122 }
const int kPdgAntiNuE
Definition: PDGCodes.h:29
const int kPdgAntiNuTau
Definition: PDGCodes.h:33
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
bool genie::pdg::IsAntiNuE ( int  pdgc)

Definition at line 170 of file PDGUtils.cxx.

171 {
172  return (pdgc == kPdgAntiNuE);
173 }
const int kPdgAntiNuE
Definition: PDGCodes.h:29
bool genie::pdg::IsAntiNuMu ( int  pdgc)

Definition at line 175 of file PDGUtils.cxx.

176 {
177  return (pdgc == kPdgAntiNuMu);
178 }
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
bool genie::pdg::IsAntiNuTau ( int  pdgc)

Definition at line 180 of file PDGUtils.cxx.

181 {
182  return (pdgc == kPdgAntiNuTau);
183 }
const int kPdgAntiNuTau
Definition: PDGCodes.h:33
bool genie::pdg::IsAntiQuark ( int  pdgc)

Definition at line 255 of file PDGUtils.cxx.

256 {
257  return ( pdgc == kPdgAntiDQuark || pdgc == kPdgAntiUQuark ||
258  pdgc == kPdgAntiSQuark || pdgc == kPdgAntiCQuark ||
259  pdgc == kPdgAntiBQuark || pdgc == kPdgAntiTQuark
260  );
261 }
const int kPdgAntiUQuark
Definition: PDGCodes.h:43
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
const int kPdgAntiTQuark
Definition: PDGCodes.h:53
const int kPdgAntiSQuark
Definition: PDGCodes.h:47
const int kPdgAntiCQuark
Definition: PDGCodes.h:49
const int kPdgAntiBQuark
Definition: PDGCodes.h:51
bool genie::pdg::IsAntiSQuark ( int  pdgc)

Definition at line 303 of file PDGUtils.cxx.

304 {
305  return (pdgc == kPdgAntiSQuark);
306 }
const int kPdgAntiSQuark
Definition: PDGCodes.h:47
bool genie::pdg::IsAntiTau ( int  pdgc)

Definition at line 210 of file PDGUtils.cxx.

211 {
212  return (pdgc == kPdgAntiTau);
213 }
const int kPdgAntiTau
Definition: PDGCodes.h:40
bool genie::pdg::IsAntiTQuark ( int  pdgc)

Definition at line 318 of file PDGUtils.cxx.

319 {
320  return (pdgc == kPdgAntiTQuark);
321 }
const int kPdgAntiTQuark
Definition: PDGCodes.h:53
bool genie::pdg::IsAntiUQuark ( int  pdgc)

Definition at line 293 of file PDGUtils.cxx.

294 {
295  return (pdgc == kPdgAntiUQuark);
296 }
const int kPdgAntiUQuark
Definition: PDGCodes.h:43
bool genie::pdg::IsBaryonResonance ( int  pdgc)

Definition at line 394 of file PDGUtils.cxx.

395 {
396  return utils::res::IsBaryonResonance(pdgc);
397 }
bool IsBaryonResonance(int pdgc)
is input a baryon resonance?
bool genie::pdg::IsBQuark ( int  pdgc)

Definition at line 283 of file PDGUtils.cxx.

284 {
285  return (pdgc == kPdgBQuark);
286 }
const int kPdgBQuark
Definition: PDGCodes.h:50
bool genie::pdg::IsChargedLepton ( int  pdgc)

Definition at line 98 of file PDGUtils.cxx.

99 {
100  bool is_neg_lepton = genie::pdg::IsNegChargedLepton(pdgc);
101  bool is_pos_lepton = genie::pdg::IsPosChargedLepton(pdgc);
102 
103  bool is_charged_lepton = is_neg_lepton || is_pos_lepton;
104  return is_charged_lepton;
105 }
bool IsPosChargedLepton(int pdgc)
Definition: PDGUtils.cxx:145
bool IsNegChargedLepton(int pdgc)
Definition: PDGUtils.cxx:136
bool genie::pdg::IsCQuark ( int  pdgc)

Definition at line 278 of file PDGUtils.cxx.

279 {
280  return (pdgc == kPdgCQuark);
281 }
const int kPdgCQuark
Definition: PDGCodes.h:48
bool genie::pdg::IsDarkMatter ( int  pdgc)

Definition at line 124 of file PDGUtils.cxx.

125 {
126  bool is_dm = (pdgc == kPdgDarkMatter);
127  return is_dm;
128 }
const int kPdgDarkMatter
Definition: PDGCodes.h:218
bool genie::pdg::IsDarkSectorParticle ( int  pdgc)

Definition at line 408 of file PDGUtils.cxx.

409 {
410  return (
411  pdgc == kPdgDarkNeutrino ||
412  pdgc == kPdgDNuMediator
413  );
414 }
const int kPdgDNuMediator
Definition: PDGCodes.h:224
const int kPdgDarkNeutrino
Definition: PDGCodes.h:222
bool genie::pdg::IsDiQuark ( int  pdgc)

Definition at line 228 of file PDGUtils.cxx.

229 {
230  return ( pdgc == kPdgDDDiquarkS1 || pdgc == kPdgUDDiquarkS0 ||
231  pdgc == kPdgUDDiquarkS1 || pdgc == kPdgUUDiquarkS1 ||
232  pdgc == kPdgSDDiquarkS0 || pdgc == kPdgSDDiquarkS1 ||
233  pdgc == kPdgSUDiquarkS0 || pdgc == kPdgSUDiquarkS1 ||
234  pdgc == kPdgSSDiquarkS1 ||
235  pdgc == kPdgCDDiquarkS0 || pdgc == kPdgCDDiquarkS1 ||
236  pdgc == kPdgCUDiquarkS0 || pdgc == kPdgCUDiquarkS1 ||
237  pdgc == kPdgCSDiquarkS0 || pdgc == kPdgCSDiquarkS1 ||
238  pdgc == kPdgCCDiquarkS1 ||
239  pdgc == kPdgBDDiquarkS0 || pdgc == kPdgBDDiquarkS1 ||
240  pdgc == kPdgBUDiquarkS0 || pdgc == kPdgBUDiquarkS1 ||
241  pdgc == kPdgBSDiquarkS0 || pdgc == kPdgBSDiquarkS1 ||
242  pdgc == kPdgBCDiquarkS0 || pdgc == kPdgBCDiquarkS1 ||
243  pdgc == kPdgBBDiquarkS1
244  );
245 }
const int kPdgBUDiquarkS0
Definition: PDGCodes.h:73
const int kPdgUUDiquarkS1
Definition: PDGCodes.h:58
const int kPdgSDDiquarkS1
Definition: PDGCodes.h:60
const int kPdgBCDiquarkS0
Definition: PDGCodes.h:77
const int kPdgBCDiquarkS1
Definition: PDGCodes.h:78
const int kPdgBUDiquarkS1
Definition: PDGCodes.h:74
const int kPdgSUDiquarkS1
Definition: PDGCodes.h:62
const int kPdgSUDiquarkS0
Definition: PDGCodes.h:61
const int kPdgSSDiquarkS1
Definition: PDGCodes.h:63
const int kPdgCSDiquarkS1
Definition: PDGCodes.h:69
const int kPdgCDDiquarkS1
Definition: PDGCodes.h:65
const int kPdgCSDiquarkS0
Definition: PDGCodes.h:68
const int kPdgSDDiquarkS0
Definition: PDGCodes.h:59
const int kPdgBBDiquarkS1
Definition: PDGCodes.h:79
const int kPdgCDDiquarkS0
Definition: PDGCodes.h:64
const int kPdgBDDiquarkS0
Definition: PDGCodes.h:71
const int kPdgUDDiquarkS1
Definition: PDGCodes.h:57
const int kPdgBSDiquarkS0
Definition: PDGCodes.h:75
const int kPdgBSDiquarkS1
Definition: PDGCodes.h:76
const int kPdgUDDiquarkS0
Definition: PDGCodes.h:56
const int kPdgCUDiquarkS1
Definition: PDGCodes.h:67
const int kPdgCCDiquarkS1
Definition: PDGCodes.h:70
const int kPdgBDDiquarkS1
Definition: PDGCodes.h:72
const int kPdgCUDiquarkS0
Definition: PDGCodes.h:66
const int kPdgDDDiquarkS1
Definition: PDGCodes.h:55
bool genie::pdg::IsDQuark ( int  pdgc)

Definition at line 268 of file PDGUtils.cxx.

269 {
270  return (pdgc == kPdgDQuark);
271 }
const int kPdgDQuark
Definition: PDGCodes.h:44
bool genie::pdg::IsElectron ( int  pdgc)

Definition at line 185 of file PDGUtils.cxx.

186 {
187  return (pdgc == kPdgElectron);
188 }
const int kPdgElectron
Definition: PDGCodes.h:35
bool genie::pdg::IsHadron ( int  pdgc)

Definition at line 389 of file PDGUtils.cxx.

390 {
391  return ((pdgc>=100 && pdgc<=9999) || (pdgc>=-9999 && pdgc<=-100));
392 }
bool genie::pdg::IsIon ( int  pdgc)

Definition at line 39 of file PDGUtils.cxx.

40 {
41  return (pdgc > 1000000000 && pdgc < 1999999999);
42 }
bool genie::pdg::IsKaon ( int  pdgc)

Definition at line 328 of file PDGUtils.cxx.

329 {
330  return (pdgc == kPdgKP || pdgc == kPdgK0 || pdgc == kPdgKM);
331 }
const int kPdgK0
Definition: PDGCodes.h:174
const int kPdgKM
Definition: PDGCodes.h:173
const int kPdgKP
Definition: PDGCodes.h:172
bool genie::pdg::IsLepton ( int  pdgc)

Definition at line 83 of file PDGUtils.cxx.

84 {
85  bool is_neutral_lepton = genie::pdg::IsNeutralLepton(pdgc);
86  bool is_charged_lepton = genie::pdg::IsChargedLepton(pdgc);
87 
88  bool is_lepton = (is_neutral_lepton || is_charged_lepton);
89  return is_lepton;
90 }
bool IsChargedLepton(int pdgc)
Definition: PDGUtils.cxx:98
bool IsNeutralLepton(int pdgc)
Definition: PDGUtils.cxx:92
bool genie::pdg::IsMuon ( int  pdgc)

Definition at line 195 of file PDGUtils.cxx.

196 {
197  return (pdgc == kPdgMuon);
198 }
const int kPdgMuon
Definition: PDGCodes.h:37
bool genie::pdg::IsNegChargedLepton ( int  pdgc)

Definition at line 136 of file PDGUtils.cxx.

137 {
138  bool is_neg_lepton = (pdgc == kPdgElectron) ||
139  (pdgc == kPdgMuon) ||
140  (pdgc == kPdgTau);
141 
142  return is_neg_lepton;
143 }
const int kPdgElectron
Definition: PDGCodes.h:35
const int kPdgTau
Definition: PDGCodes.h:39
const int kPdgMuon
Definition: PDGCodes.h:37
bool genie::pdg::IsNeutralLepton ( int  pdgc)

Definition at line 92 of file PDGUtils.cxx.

93 {
94  bool is_neutral_lepton = IsNeutrino(pdgc) || IsAntiNeutrino(pdgc);
95  return is_neutral_lepton;
96 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
bool genie::pdg::IsNeutrino ( int  pdgc)

Definition at line 107 of file PDGUtils.cxx.

108 {
109  bool is_nu = (pdgc == kPdgNuE) ||
110  (pdgc == kPdgNuMu) ||
111  (pdgc == kPdgNuTau);
112  return is_nu;
113 }
const int kPdgNuE
Definition: PDGCodes.h:28
const int kPdgNuMu
Definition: PDGCodes.h:30
const int kPdgNuTau
Definition: PDGCodes.h:32
bool genie::pdg::IsNeutron ( int  pdgc)

Definition at line 338 of file PDGUtils.cxx.

339 {
340  return (pdgc == kPdgNeutron);
341 }
const int kPdgNeutron
Definition: PDGCodes.h:83
bool genie::pdg::IsNeutronOrProton ( int  pdgc)

Definition at line 348 of file PDGUtils.cxx.

349 {
350  return (pdgc == kPdgNeutron || pdgc == kPdgProton);
351 }
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
bool genie::pdg::IsNucleon ( int  pdgc)

Definition at line 343 of file PDGUtils.cxx.

344 {
345  return (pdgc == kPdgNeutron || pdgc == kPdgProton);
346 }
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
bool genie::pdg::IsNuE ( int  pdgc)

Definition at line 155 of file PDGUtils.cxx.

156 {
157  return (pdgc == kPdgNuE);
158 }
const int kPdgNuE
Definition: PDGCodes.h:28
bool genie::pdg::IsNuMu ( int  pdgc)

Definition at line 160 of file PDGUtils.cxx.

161 {
162  return (pdgc == kPdgNuMu);
163 }
const int kPdgNuMu
Definition: PDGCodes.h:30
bool genie::pdg::IsNuTau ( int  pdgc)

Definition at line 165 of file PDGUtils.cxx.

166 {
167  return (pdgc == kPdgNuTau);
168 }
const int kPdgNuTau
Definition: PDGCodes.h:32
bool genie::pdg::IsParticle ( int  pdgc)

not ion or pseudo-particle

Definition at line 44 of file PDGUtils.cxx.

45 {
46  if( genie::pdg::IsPseudoParticle (pdgc) ) return false;
47  if( genie::pdg::IsIon (pdgc) ) return false;
48 
49  return true;
50 }
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:39
bool IsPseudoParticle(int pdgc)
Definition: PDGUtils.cxx:24
bool genie::pdg::IsPion ( int  pdgc)

Definition at line 323 of file PDGUtils.cxx.

324 {
325  return (pdgc == kPdgPiP || pdgc == kPdgPi0 || pdgc == kPdgPiM);
326 }
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
const int kPdgPiM
Definition: PDGCodes.h:159
bool genie::pdg::IsPosChargedLepton ( int  pdgc)

Definition at line 145 of file PDGUtils.cxx.

146 {
147  bool is_pos_lepton = (pdgc == kPdgPositron) ||
148  (pdgc == kPdgAntiMuon) ||
149  (pdgc == kPdgAntiTau);
150 
151  return is_pos_lepton;
152 }
const int kPdgAntiMuon
Definition: PDGCodes.h:38
const int kPdgAntiTau
Definition: PDGCodes.h:40
const int kPdgPositron
Definition: PDGCodes.h:36
bool genie::pdg::IsPositron ( int  pdgc)

Definition at line 190 of file PDGUtils.cxx.

191 {
192  return (pdgc == kPdgPositron);
193 }
const int kPdgPositron
Definition: PDGCodes.h:36
bool genie::pdg::IsProton ( int  pdgc)

Definition at line 333 of file PDGUtils.cxx.

334 {
335  return (pdgc == kPdgProton);
336 }
const int kPdgProton
Definition: PDGCodes.h:81
bool genie::pdg::IsPseudoParticle ( int  pdgc)

Definition at line 24 of file PDGUtils.cxx.

25 {
26 // ROOT's rootino has PDG code=0
27 // GENIE pseudoparticles are in the 2000000000-2000100000 range
28 // Include PYTHIA's pseudoparticles
29 
30  bool is_fake =
31  ( (pdgc == 0) ||
32  (pdgc > 2000000000 && pdgc < 2000100000) ||
33  (pdgc == kPdgCluster || pdgc == kPdgString || pdgc == kPdgIndep)
34  );
35 
36  return is_fake;
37 }
const int kPdgIndep
Definition: PDGCodes.h:231
const int kPdgString
Definition: PDGCodes.h:230
const int kPdgCluster
Definition: PDGCodes.h:229
bool genie::pdg::IsQuark ( int  pdgc)

Definition at line 247 of file PDGUtils.cxx.

248 {
249  return ( pdgc == kPdgDQuark || pdgc == kPdgUQuark ||
250  pdgc == kPdgSQuark || pdgc == kPdgCQuark ||
251  pdgc == kPdgBQuark || pdgc == kPdgTQuark
252  );
253 }
const int kPdgBQuark
Definition: PDGCodes.h:50
const int kPdgUQuark
Definition: PDGCodes.h:42
const int kPdgSQuark
Definition: PDGCodes.h:46
const int kPdgCQuark
Definition: PDGCodes.h:48
const int kPdgDQuark
Definition: PDGCodes.h:44
const int kPdgTQuark
Definition: PDGCodes.h:52
bool genie::pdg::IsSQuark ( int  pdgc)

Definition at line 273 of file PDGUtils.cxx.

274 {
275  return (pdgc == kPdgSQuark);
276 }
const int kPdgSQuark
Definition: PDGCodes.h:46
bool genie::pdg::IsTau ( int  pdgc)

Definition at line 205 of file PDGUtils.cxx.

206 {
207  return (pdgc == kPdgTau);
208 }
const int kPdgTau
Definition: PDGCodes.h:39
bool genie::pdg::IsTQuark ( int  pdgc)

Definition at line 288 of file PDGUtils.cxx.

289 {
290  return (pdgc == kPdgTQuark);
291 }
const int kPdgTQuark
Definition: PDGCodes.h:52
bool genie::pdg::IsUQuark ( int  pdgc)

Definition at line 263 of file PDGUtils.cxx.

264 {
265  return (pdgc == kPdgUQuark);
266 }
const int kPdgUQuark
Definition: PDGCodes.h:42
int genie::pdg::ModifyNucleonCluster ( int  pdgc,
int  dQ 
)

Definition at line 361 of file PDGUtils.cxx.

362 {
363  assert(pdg::Is2NucleonCluster(pdgc));
364 
365  if(pdgc == kPdgClusterNN) {
366  if (dQ == 0) { return kPdgClusterNN; }
367  else if (dQ == +1) { return kPdgClusterNP; }
368  else if (dQ == +2) { return kPdgClusterPP; }
369  else { return 0; }
370  }
371  else
372  if(pdgc == kPdgClusterNP) {
373  if (dQ == -1) { return kPdgClusterNN; }
374  else if (dQ == 0) { return kPdgClusterNP; }
375  else if (dQ == +1) { return kPdgClusterPP; }
376  else { return 0; }
377  }
378  else
379  if(pdgc == kPdgClusterPP) {
380  if (dQ == -2) { return kPdgClusterNN; }
381  else if (dQ == -1) { return kPdgClusterNP; }
382  else if (dQ == 0) { return kPdgClusterPP; }
383  else { return 0; }
384  }
385 
386  return 0;
387 }
const int kPdgClusterNP
Definition: PDGCodes.h:215
const int kPdgClusterNN
Definition: PDGCodes.h:214
bool Is2NucleonCluster(int pdgc)
Definition: PDGUtils.cxx:399
const int kPdgClusterPP
Definition: PDGCodes.h:216
int genie::pdg::Neutrino2ChargedLepton ( int  pdgc)

Definition at line 215 of file PDGUtils.cxx.

216 {
217  switch(pdgc) {
218  case (kPdgNuE) : return kPdgElectron; break;
219  case (kPdgAntiNuE) : return kPdgPositron; break;
220  case (kPdgNuMu) : return kPdgMuon; break;
221  case (kPdgAntiNuMu) : return kPdgAntiMuon; break;
222  case (kPdgNuTau) : return kPdgTau; break;
223  case (kPdgAntiNuTau): return kPdgAntiTau; break;
224  }
225  return -1;
226 }
const int kPdgNuE
Definition: PDGCodes.h:28
const int kPdgAntiNuE
Definition: PDGCodes.h:29
const int kPdgNuMu
Definition: PDGCodes.h:30
const int kPdgAntiMuon
Definition: PDGCodes.h:38
const int kPdgElectron
Definition: PDGCodes.h:35
const int kPdgTau
Definition: PDGCodes.h:39
const int kPdgAntiNuTau
Definition: PDGCodes.h:33
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
const int kPdgNuTau
Definition: PDGCodes.h:32
const int kPdgAntiTau
Definition: PDGCodes.h:40
const int kPdgMuon
Definition: PDGCodes.h:37
const int kPdgPositron
Definition: PDGCodes.h:36
int genie::pdg::SwitchProtonNeutron ( int  pdgc)

Definition at line 353 of file PDGUtils.cxx.

354 {
355  assert(IsProton(pdgc) || IsNeutron(pdgc));
356 
357  if (IsProton(pdgc)) return kPdgNeutron;
358  else return kPdgProton;
359 }
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83