]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TUHKMgen/UHKM/ParticlePDG.cxx
updated macros for making PPR plots
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / ParticlePDG.cxx
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   fSpin(0.0),
26   fIsospin(0.0),
27   fIsospinZ(0.0),
28   fLightQuarkNumber(0.0),
29   fAntiLightQuarkNumber(0.0),
30   fStrangeQuarkNumber(0.0),
31   fAntiStrangeQuarkNumber(0.0),
32   fCharmQuarkNumber(0.0),
33   fAntiCharmQuarkNumber(0.0),
34   fNDecayChannels(0),
35   fStable(0.0)
36 {
37   for(Int_t i=0; i<kMaxDecayChannels; i++)
38     fDecayChannels[i] = new DecayChannel();
39 }
40
41 ParticlePDG::ParticlePDG(Char_t *name, Int_t pdg, Double_t mass, Double_t width) :
42   fPDG(pdg),
43   fMass(mass),
44   fWidth(width),
45   fSpin(0.0),
46   fIsospin(0.0),
47   fIsospinZ(0.0),
48   fLightQuarkNumber(0.0),
49   fAntiLightQuarkNumber(0.0),
50   fStrangeQuarkNumber(0.0),
51   fAntiStrangeQuarkNumber(0.0),
52   fCharmQuarkNumber(0.0),
53   fAntiCharmQuarkNumber(0.0),
54   fNDecayChannels(0),
55   fStable(0.0)
56 {
57   for(Int_t i=0; i<9; i++)
58     if(*(name+i) != '\0') fName[i] = *(name+i);
59     else break;
60   for(Int_t i=0; i<kMaxDecayChannels; i++)
61     fDecayChannels[i] = new DecayChannel();
62 }
63
64 ParticlePDG::~ParticlePDG() {
65   for(Int_t i=0; i<kMaxDecayChannels; i++)
66     delete fDecayChannels[i];
67 }
68
69 Double_t ParticlePDG::GetFullBranching() {
70   Double_t fullBranching = 0.0;
71   for(Int_t i=0; i<fNDecayChannels; i++)
72     fullBranching += fDecayChannels[i]->GetBranching();
73   return fullBranching;
74 }
75
76 void ParticlePDG::AddChannel(DecayChannel* channel) {
77   if(channel->GetMotherPDG() != fPDG) {
78     cout << "ERROR in ParticlePDG::AddChannel() : You try to add a channel which has a different mother PDG" << endl;
79     return;
80   }
81   fDecayChannels[fNDecayChannels]->SetMotherPDG(channel->GetMotherPDG());
82   fDecayChannels[fNDecayChannels]->SetBranching(channel->GetBranching());
83   fDecayChannels[fNDecayChannels]->SetDaughters(channel->GetDaughters(), channel->GetNDaughters());
84   fNDecayChannels++;
85 }