/*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | Delphes, a framework for the fast simulation | ** ** | of a generic collider experiment | ** ** \------------- arXiv:0903.2225v1 ------------/ ** ** ** ** ** ** This package uses: ** ** ------------------ ** ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] ** ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] ** ** FROG: [hep-ex/0901.2718v1] ** ** ** ** ------------------------------------------------------------------ ** ** ** ** Main authors: ** ** ------------- ** ** ** ** Severine Ovyn Xavier Rouby ** ** severine.ovyn@uclouvain.be xavier.rouby@cern ** ** ** ** Center for Particle Physics and Phenomenology (CP3) ** ** Universite catholique de Louvain (UCL) ** ** Louvain-la-Neuve, Belgium ** ** ** ** Copyright (C) 2008-2009, ** ** All rights reserved. ** ** ** ***********************************************************************/ /// \file PdgParticle.h /// \brief Stores the data from PDG particle tables #include "PdgParticle.h" #include #include #include #include //PdgParticle::PdgParticle() : _pid(1), _mass(-1), _charge(-999), _gamma_tot(-1), _ctau(-1), _name("") {} PdgParticle::PdgParticle(const int pid, const std::string& name, const float m, const float q, const float gamma, const float ctau) : _pid(pid), _mass(m), _charge(q), _gamma_tot(gamma), _ctau(ctau), _name(name) {} PdgParticle::PdgParticle(const PdgParticle& p) : _pid(p._pid), _mass(p._mass), _charge(p._charge), _gamma_tot(p._gamma_tot), _ctau(p._ctau), _name(p._name) {} PdgParticle& PdgParticle::operator=(const PdgParticle& p) { if(this == &p) return *this; _pid = p._pid; _name= p._name; _mass=p._mass; _charge=p._charge; _gamma_tot=p._gamma_tot; _ctau = p._ctau; return *this; } PdgTable::PdgTable(const PdgTable& table) { std::map::const_iterator i; for(i = table._table.begin(); i != table._table.end(); i++) _table.insert(std::map::value_type(i->first,i->second)); } PdgTable& PdgTable::operator=(const PdgTable& table) { if(this == &table) return *this; std::map::const_iterator i; for(i = table._table.begin(); i != table._table.end(); i++) _table.insert(std::map::value_type(i->first,i->second)); return *this; } void PdgTable::insert(const int pid, const PdgParticle &p) { _table.insert(std::map::value_type(pid,p)); } void PdgTable::print() const { std::map::const_iterator i; for(i = _table.begin(); i != _table.end(); i++) std::cout << "name = " << std::setw(20) << std::left << i->second.name() << "pid = " << std::setw(10) << i->first << "\t M=" << std::setw(10) << i->second.mass() << "GeV/c^2" << "\t Q=" << std::setw(6) << i->second.charge() << "e+" << "\t ctau=" << i->second.ctau() << " m" << std::endl; } PdgParticle PdgTable::operator[](const int pid) const { std::map::const_iterator i; i =_table.find(pid); if(i==_table.end()) { std::cout <<"** WARNING: PDG ID not found (" << pid << "), use default values **" << std::endl; return PdgParticle(); } return i->second; }