Fork me on GitHub

source: svn/trunk/interface/PdgParticle.h@ 641

Last change on this file since 641 was 588, checked in by cp3-support, 13 years ago

cleaning table to particle tables to avoid memory leak

File size: 3.6 KB
Line 
1#ifndef _PDGPARTICLE_H_
2#define _PDGPARTICLE_H_
3
4/***********************************************************************
5** **
6** /----------------------------------------------\ **
7** | Delphes, a framework for the fast simulation | **
8** | of a generic collider experiment | **
9** \------------- arXiv:0903.2225v1 ------------/ **
10** **
11** **
12** This package uses: **
13** ------------------ **
14** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 **
15** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
16** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
17** FROG: [hep-ex/0901.2718v1] **
18** HepMC: Comput. Phys. Commun.134 (2001) 41 **
19** **
20** ------------------------------------------------------------------ **
21** **
22** Main authors: **
23** ------------- **
24** **
25** Severine Ovyn Xavier Rouby **
26** severine.ovyn@uclouvain.be xavier.rouby@cern **
27** **
28** Center for Particle Physics and Phenomenology (CP3) **
29** Universite catholique de Louvain (UCL) **
30** Louvain-la-Neuve, Belgium **
31** **
32** Copyright (C) 2008-2009, **
33** All rights reserved. **
34** **
35***********************************************************************/
36
37#include <string>
38#include <map>
39#include <cmath>
40
41class PdgParticle {
42 public:
43 PdgParticle(): _pid(-999), _mass(0), _charge(0), _gamma_tot(0), _ctau(0), _name("Unknown"), _isInvisible(false) {};
44 PdgParticle(const long int pid, const std::string& name, const float m, const float q, const float gamma, const float ctau);
45 PdgParticle(const PdgParticle& p);
46 PdgParticle& operator=(const PdgParticle& p);
47 virtual ~PdgParticle() {};
48 long int pid() const {return _pid;};
49 float mass() const {return _mass;};
50 float charge() const {return _charge;};
51 float gamma_tot() const {return _gamma_tot;};
52 double ctau() const {return _ctau;};
53 bool invisible() const {return _isInvisible;};
54 std::string name() const {return _name;};
55
56 private:
57 long int _pid;
58 float _mass; // GeV
59 float _charge; // in e+
60 float _gamma_tot; // GeV
61 double _ctau; // in m
62 std::string _name;
63 bool _isInvisible; // neutrino-like
64};
65
66class PdgTable {
67 public:
68 PdgTable(){};
69 PdgTable(const PdgTable& table);
70 PdgTable& operator=(const PdgTable& table);
71 virtual ~PdgTable(){};
72 void insert(const long int pid, const PdgParticle &p);
73 void print() const;
74 PdgParticle operator[](const int pid) const;
75 private:
76 std::map<int, PdgParticle> _table;
77};
78
79#endif
Note: See TracBrowser for help on using the repository browser.