Public Member Functions |
Static Public Member Functions |
Private Member Functions |
Private Attributes |
Static Private Attributes
ParticleNames Class Reference
Collaboration diagram for ParticleNames:
![]()
Detailed Description
Handler for particle name code <-> string conversion
Definition at line 157 of file ParticleName.hh. Constructor & Destructor Documentation
Definition at line 179 of file ParticleName.hh. References ParticleNames::_add_pid_name(), Rivet::PID::ANTIMUON, Rivet::PID::ANTINEUTRON, Rivet::PID::ANTIPROTON, Rivet::PID::ANTITAU, Rivet::PID::ANY, Rivet::PID::ELECTRON, Rivet::PID::HIGGS, Rivet::PID::MUON, Rivet::PID::NEUTRON, Rivet::PID::NU_E, Rivet::PID::NU_EBAR, Rivet::PID::NU_MU, Rivet::PID::NU_MUBAR, Rivet::PID::NU_TAU, Rivet::PID::NU_TAUBAR, Rivet::PID::PHOTON, Rivet::PID::PIMINUS, Rivet::PID::PIPLUS, Rivet::PID::POSITRON, Rivet::PID::PROTON, Rivet::PID::TAU, Rivet::PID::WMINUSBOSON, Rivet::PID::WPLUSBOSON, and Rivet::PID::ZBOSON. Referenced by ParticleNames::particleId(), and ParticleNames::particleName(). { _add_pid_name(ELECTRON, "ELECTRON"); _add_pid_name(POSITRON, "POSITRON"); _add_pid_name(PROTON, "PROTON"); _add_pid_name(ANTIPROTON, "ANTIPROTON"); _add_pid_name(PHOTON, "PHOTON"); _add_pid_name(NEUTRON, "NEUTRON"); _add_pid_name(ANTINEUTRON, "ANTINEUTRON"); _add_pid_name(MUON, "MUON"); _add_pid_name(ANTIMUON, "ANTIMUON"); _add_pid_name(NU_E, "NU_E"); _add_pid_name(NU_EBAR, "NU_EBAR"); _add_pid_name(NU_MU, "NU_MU"); _add_pid_name(NU_MUBAR, "NU_MUBAR"); _add_pid_name(NU_TAU, "NU_TAU"); _add_pid_name(NU_TAUBAR, "NU_TAUBAR"); _add_pid_name(PIPLUS, "PIPLUS"); _add_pid_name(PIMINUS, "PIMINUS"); _add_pid_name(TAU, "TAU"); _add_pid_name(WPLUSBOSON, "WPLUSBOSON"); _add_pid_name(WMINUSBOSON, "WMINUSBOSON"); _add_pid_name(ZBOSON, "ZBOSON"); _add_pid_name(HIGGS, "HIGGS"); _add_pid_name(ANTITAU, "ANTITAU"); _add_pid_name(ANY, "*"); } Member Function Documentation
Definition at line 206 of file ParticleName.hh. References ParticleNames::_ids_names, and ParticleNames::_names_ids. Referenced by ParticleNames::ParticleNames(). { _ids_names[pid] = pname; _names_ids[pname] = pid; }
Definition at line 22 of file ParticleName.cc. References ParticleNames::_names_ids, Rivet::PID::ANTIPROTON, Rivet::PID::ELECTRON, Rivet::PID::NEUTRON, Rivet::PID::PHOTON, Rivet::PID::POSITRON, Rivet::PID::PROTON, and Rivet::toUpper(). Referenced by ParticleNames::particleId(). { if (_names_ids.find(pname) == _names_ids.end()) { if (toUpper(pname) == "P+" || toUpper(pname) == "P") return PROTON; if (toUpper(pname) == "P-" || toUpper(pname) == "PBAR") return ANTIPROTON; if (toUpper(pname) == "E-") return ELECTRON; if (toUpper(pname) == "E+") return POSITRON; if (toUpper(pname) == "GAMMA") return PHOTON; if (toUpper(pname) == "N") return NEUTRON; try { PdgId rtn = lexical_cast<PdgId>(pname); return rtn; } catch (const bad_lexical_cast& blc) { throw PidError("Particle name '" + pname + "' not known and could not be directly cast to a PDG ID."); } } return _names_ids[pname]; }
Definition at line 14 of file ParticleName.cc. References ParticleNames::_ids_names. Referenced by ParticleNames::particleName(). { if (_ids_names.find(pid) == _ids_names.end()) { throw PidError("Particle ID '" + lexical_cast<string>(pid) + "' not known."); } return _ids_names[pid]; }
Definition at line 166 of file ParticleName.hh. References ParticleNames::_instance, ParticleNames::_particleId(), and ParticleNames::ParticleNames(). Referenced by Rivet::PID::toParticleId(). { /// @todo Isn't there a nicer, pointerless way to do singletons? if (!_instance) _instance = new ParticleNames(); return _instance->_particleId(pname); }
Definition at line 160 of file ParticleName.hh. References ParticleNames::_instance, ParticleNames::_particleName(), and ParticleNames::ParticleNames(). Referenced by Rivet::PID::toParticleName(). { /// @todo Isn't there a nicer, pointerless way to do singletons? if (!_instance) _instance = new ParticleNames(); return _instance->_particleName(pid); } Member Data Documentation
Definition at line 213 of file ParticleName.hh. Referenced by ParticleNames::_add_pid_name(), and ParticleNames::_particleName().
Definition at line 211 of file ParticleName.hh. Referenced by ParticleNames::particleId(), and ParticleNames::particleName().
Definition at line 215 of file ParticleName.hh. Referenced by ParticleNames::_add_pid_name(), and ParticleNames::_particleId(). The documentation for this class was generated from the following files: Generated on Thu Feb 6 2014 17:40:13 for The Rivet MC analysis system by ![]() |