[386] | 1 | /***********************************************************************
|
---|
| 2 | ** **
|
---|
| 3 | ** /----------------------------------------------\ **
|
---|
| 4 | ** | Delphes, a framework for the fast simulation | **
|
---|
| 5 | ** | of a generic collider experiment | **
|
---|
| 6 | ** \------------- arXiv:0903.2225v1 ------------/ **
|
---|
| 7 | ** **
|
---|
| 8 | ** **
|
---|
| 9 | ** This package uses: **
|
---|
| 10 | ** ------------------ **
|
---|
[443] | 11 | ** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 **
|
---|
[386] | 12 | ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
|
---|
| 13 | ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
|
---|
| 14 | ** FROG: [hep-ex/0901.2718v1] **
|
---|
[443] | 15 | ** HepMC: Comput. Phys. Commun.134 (2001) 41 **
|
---|
[386] | 16 | ** **
|
---|
| 17 | ** ------------------------------------------------------------------ **
|
---|
| 18 | ** **
|
---|
| 19 | ** Main authors: **
|
---|
| 20 | ** ------------- **
|
---|
| 21 | ** **
|
---|
| 22 | ** Severine Ovyn Xavier Rouby **
|
---|
| 23 | ** severine.ovyn@uclouvain.be xavier.rouby@cern **
|
---|
| 24 | ** **
|
---|
| 25 | ** Center for Particle Physics and Phenomenology (CP3) **
|
---|
| 26 | ** Universite catholique de Louvain (UCL) **
|
---|
| 27 | ** Louvain-la-Neuve, Belgium **
|
---|
| 28 | ** **
|
---|
| 29 | ** Copyright (C) 2008-2009, **
|
---|
| 30 | ** All rights reserved. **
|
---|
| 31 | ** **
|
---|
| 32 | ***********************************************************************/
|
---|
| 33 |
|
---|
| 34 | /// \file PdgParticle.h
|
---|
| 35 | /// \brief Stores the data from PDG particle tables
|
---|
| 36 |
|
---|
| 37 | #include "PdgParticle.h"
|
---|
| 38 | #include <iostream>
|
---|
| 39 | #include <string>
|
---|
| 40 | #include <map>
|
---|
[402] | 41 | #include <iomanip>
|
---|
[386] | 42 |
|
---|
[535] | 43 | using namespace std;
|
---|
| 44 |
|
---|
[402] | 45 | //PdgParticle::PdgParticle() : _pid(1), _mass(-1), _charge(-999), _gamma_tot(-1), _ctau(-1), _name("") {}
|
---|
[386] | 46 |
|
---|
[469] | 47 | PdgParticle::PdgParticle(const long int pid, const std::string& name, const float m, const float q, const float gamma, const float ctau) :
|
---|
| 48 | _pid(pid), _mass(m), _charge(q), _gamma_tot(gamma), _ctau(ctau), _name(name) {
|
---|
[535] | 49 | if( (fabs(pid) == 12) || (fabs(pid) == 14) || (fabs(pid) == 16) ||
|
---|
| 50 | (fabs(pid) == 1000022 ) || (fabs(pid) == 1000023 ) || (fabs(pid) == 1000025) ||
|
---|
| 51 | (fabs(pid) == 1000035 ) || (fabs(pid) == 1000045 ) ) { /*std::cout << "invisible : " << pid << std::endl;*/
|
---|
| 52 | _isInvisible = true; }
|
---|
[469] | 53 | else _isInvisible = false;
|
---|
| 54 | }
|
---|
[386] | 55 |
|
---|
| 56 |
|
---|
| 57 | PdgParticle::PdgParticle(const PdgParticle& p) :
|
---|
[469] | 58 | _pid(p._pid), _mass(p._mass), _charge(p._charge), _gamma_tot(p._gamma_tot), _ctau(p._ctau), _name(p._name), _isInvisible(p._isInvisible) {}
|
---|
[386] | 59 |
|
---|
| 60 | PdgParticle& PdgParticle::operator=(const PdgParticle& p) {
|
---|
| 61 | if(this == &p) return *this;
|
---|
| 62 | _pid = p._pid; _name= p._name; _mass=p._mass;
|
---|
[402] | 63 | _charge=p._charge; _gamma_tot=p._gamma_tot; _ctau = p._ctau;
|
---|
[469] | 64 | _isInvisible = p._isInvisible;
|
---|
[386] | 65 | return *this;
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | PdgTable::PdgTable(const PdgTable& table) {
|
---|
| 69 | std::map<int, PdgParticle>::const_iterator i;
|
---|
| 70 | for(i = table._table.begin(); i != table._table.end(); i++)
|
---|
| 71 | _table.insert(std::map<int,PdgParticle>::value_type(i->first,i->second));
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | PdgTable& PdgTable::operator=(const PdgTable& table) {
|
---|
| 75 | if(this == &table) return *this;
|
---|
| 76 | std::map<int, PdgParticle>::const_iterator i;
|
---|
| 77 | for(i = table._table.begin(); i != table._table.end(); i++)
|
---|
| 78 | _table.insert(std::map<int,PdgParticle>::value_type(i->first,i->second));
|
---|
| 79 | return *this;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
[469] | 82 | void PdgTable::insert(const long int pid, const PdgParticle &p) {
|
---|
[386] | 83 | _table.insert(std::map<int,PdgParticle>::value_type(pid,p));
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | void PdgTable::print() const {
|
---|
| 87 | std::map<int, PdgParticle>::const_iterator i;
|
---|
[469] | 88 | for(i = _table.begin(); i != _table.end(); i++) {
|
---|
[402] | 89 | std::cout << "name = " << std::setw(20) << std::left << i->second.name()
|
---|
| 90 | << "pid = " << std::setw(10) << i->first
|
---|
| 91 | << "\t M=" << std::setw(10) << i->second.mass() << "GeV/c^2"
|
---|
| 92 | << "\t Q=" << std::setw(6) << i->second.charge() << "e+"
|
---|
[469] | 93 | << "\t ctau=" << i->second.ctau() << " m";
|
---|
| 94 | if(i->second.invisible()) std::cout << "\t invisible";
|
---|
| 95 | std::cout << std::endl;
|
---|
| 96 | }
|
---|
[386] | 97 | }
|
---|
| 98 |
|
---|
| 99 | PdgParticle PdgTable::operator[](const int pid) const {
|
---|
| 100 | std::map<int, PdgParticle>::const_iterator i;
|
---|
| 101 | i =_table.find(pid);
|
---|
| 102 | if(i==_table.end()) {
|
---|
[412] | 103 | // std::cout <<"** WARNING: PDG ID not found (" << pid << "), use default values **" << std::endl;
|
---|
[386] | 104 | return PdgParticle();
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | return i->second;
|
---|
| 108 | }
|
---|