]>
Commit | Line | Data |
---|---|---|
b1c2e580 | 1 | /* |
2 | Copyright : The FASTMC and SPHMC Collaboration | |
3 | Author : Ionut Cristian Arsene | |
4 | Affiliation : Oslo University, Norway & Institute for Space Sciences, Bucharest, Romania | |
5 | e-mail : i.c.arsene@fys.uio.no | |
6 | Date : 2007/05/30 | |
7 | ||
8 | This class is using the particle and decay lists provided by the | |
9 | THERMINATOR (Computer Physics Communications 174 669 (2006)) and | |
10 | SHARE (Computer Physics Communications 167 229 (2005)) collaborations. | |
11 | */ | |
12 | ||
13 | #ifndef PARTICLE_PDG | |
14 | #include "ParticlePDG.h" | |
15 | #endif | |
16 | ||
17 | #include <iostream> | |
18 | using std::cout; | |
19 | using std::endl; | |
20 | ||
21 | ParticlePDG::ParticlePDG() { | |
22 | fPDG = kNonsensePDG; | |
23 | fMass = -1.0; | |
24 | fWidth = 0.0; | |
25 | fNDecayChannels = 0; | |
26 | for(Int_t i=0; i<kMaxDecayChannels; i++) | |
27 | fDecayChannels[i] = new DecayChannel(); | |
28 | } | |
29 | ||
30 | ParticlePDG::ParticlePDG(Char_t *name, Int_t pdg, Double_t mass, Double_t width) { | |
31 | for(Int_t i=0; i<9; i++) | |
32 | if(*(name+i) != '\0') fName[i] = *(name+i); | |
33 | else break; | |
34 | fPDG = pdg; | |
35 | fMass = mass; | |
36 | fWidth = width; | |
37 | fNDecayChannels = 0; | |
38 | for(Int_t i=0; i<kMaxDecayChannels; i++) | |
39 | fDecayChannels[i] = new DecayChannel(); | |
40 | } | |
41 | ||
42 | ParticlePDG::~ParticlePDG() { | |
43 | for(Int_t i=0; i<kMaxDecayChannels; i++) | |
44 | delete fDecayChannels[i]; | |
45 | } | |
46 | ||
47 | Double_t ParticlePDG::GetFullBranching() { | |
48 | Double_t fullBranching = 0.0; | |
49 | for(Int_t i=0; i<fNDecayChannels; i++) | |
50 | fullBranching += fDecayChannels[i]->GetBranching(); | |
51 | return fullBranching; | |
52 | } | |
53 | ||
54 | void ParticlePDG::AddChannel(DecayChannel* channel) { | |
55 | if(channel->GetMotherPDG() != fPDG) { | |
56 | cout << "ERROR in ParticlePDG::AddChannel() : You try to add a channel which has a different mother PDG" << endl; | |
57 | return; | |
58 | } | |
59 | fDecayChannels[fNDecayChannels]->SetMotherPDG(channel->GetMotherPDG()); | |
60 | fDecayChannels[fNDecayChannels]->SetBranching(channel->GetBranching()); | |
61 | fDecayChannels[fNDecayChannels]->SetDaughters(channel->GetDaughters(), channel->GetNDaughters()); | |
62 | fNDecayChannels++; | |
63 | } |