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
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.
16 #include "ParticlePDG.h"
18 //________________________________________________________________________
19 ParticlePDG::ParticlePDG() :
26 fLightQuarkNumber(0.0),
27 fAntiLightQuarkNumber(0.0),
28 fStrangeQuarkNumber(0.0),
29 fAntiStrangeQuarkNumber(0.0),
30 fCharmQuarkNumber(0.0),
31 fAntiCharmQuarkNumber(0.0),
36 // default constructor
39 for(Int_t i=0; i<kMaxDecayChannels; i++)
40 fDecayChannels[i] = new DecayChannel();
43 //________________________________________________________________________
44 ParticlePDG::ParticlePDG(const Char_t * const name, Int_t pdg, Double_t mass, Double_t width) :
51 fLightQuarkNumber(0.0),
52 fAntiLightQuarkNumber(0.0),
53 fStrangeQuarkNumber(0.0),
54 fAntiStrangeQuarkNumber(0.0),
55 fCharmQuarkNumber(0.0),
56 fAntiCharmQuarkNumber(0.0),
63 for(Int_t i=0; i<9; i++)
64 if(*(name+i) != '\0') fName[i] = *(name+i);
66 for(Int_t i=0; i<kMaxDecayChannels; i++)
67 fDecayChannels[i] = new DecayChannel();
70 //________________________________________________________________________
71 ParticlePDG::~ParticlePDG() {
75 for(Int_t i=0; i<kMaxDecayChannels; i++)
76 delete fDecayChannels[i];
79 //________________________________________________________________________
80 Double_t ParticlePDG::GetFullBranching() {
82 // calculate the sum of branching ratios from all decay channels (should add up to 1)
84 Double_t fullBranching = 0.0;
85 for(Int_t i=0; i<fNDecayChannels; i++)
86 fullBranching += fDecayChannels[i]->GetBranching();
90 //________________________________________________________________________
91 void ParticlePDG::AddChannel(DecayChannel* channel) {
93 // add a decay channel
95 if(channel->GetMotherPDG() != fPDG) {
96 cout << "ERROR in ParticlePDG::AddChannel() : You try to add a channel which has a different mother PDG" << endl;
99 fDecayChannels[fNDecayChannels]->SetMotherPDG(channel->GetMotherPDG());
100 fDecayChannels[fNDecayChannels]->SetBranching(channel->GetBranching());
101 fDecayChannels[fNDecayChannels]->SetDaughters(channel->GetDaughters(), channel->GetNDaughters());