/*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | Delphes, a framework for the fast simulation | ** ** | of a generic collider experiment | ** ** \------------- arXiv:0903.2225v1 ------------/ ** ** ** ** ** ** This package uses: ** ** ------------------ ** ** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 ** ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] ** ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] ** ** FROG: [hep-ex/0901.2718v1] ** ** HepMC: Comput. Phys. Commun.134 (2001) 41 ** ** ** ** ------------------------------------------------------------------ ** ** ** ** 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 using namespace std; //PdgParticle::PdgParticle() : _pid(1), _mass(-1), _charge(-999), _gamma_tot(-1), _ctau(-1), _name("") {} PdgParticle::PdgParticle(const long 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) { if( (fabs(pid) == 12) || (fabs(pid) == 14) || (fabs(pid) == 16) || (fabs(pid) == 1000022 ) || (fabs(pid) == 1000023 ) || (fabs(pid) == 1000025) || (fabs(pid) == 1000035 ) || (fabs(pid) == 1000045 ) ) { /*std::cout << "invisible : " << pid << std::endl;*/ _isInvisible = true; } else _isInvisible = false; } 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), _isInvisible(p._isInvisible) {} 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; _isInvisible = p._isInvisible; 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 long 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"; if(i->second.invisible()) std::cout << "\t invisible"; std::cout << 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; }