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 //
8 // This class is using the particle and decays lists provided by the //
9 // THERMINATOR (Computer Physics Communications 174 669 (2006)) and //
10 // SHARE (Computer Physics Communications 167 229 (2005)) collaborations. //
11 ////////////////////////////////////////////////////////////////////////////////////////////////
16 #include "DecayChannel.h"
18 //_______________________________________________________________________________
19 DecayChannel::DecayChannel() :
20 fMotherPDG(kNonsensePDG),
25 // default constructor
27 for(Int_t i=0; i<kMaxDaughters; i++)
28 fDaughtersPDG[i] = kNonsensePDG;
31 //_______________________________________________________________________________
32 DecayChannel::DecayChannel(const DecayChannel ©):
33 fMotherPDG(copy.fMotherPDG),
34 fBranchingRatio(copy.fBranchingRatio),
35 fNDaughters(copy.fNDaughters)
40 for(Int_t i=0; i<kMaxDaughters; i++)
41 fDaughtersPDG[i] = copy.fDaughtersPDG[i];
44 //_______________________________________________________________________________
45 DecayChannel::DecayChannel(Int_t mother, Double_t branching, Int_t nDaughters, const Int_t *daughters):
47 fBranchingRatio(branching),
53 for(Int_t i=0; i<kMaxDaughters; i++) {
55 fDaughtersPDG[fNDaughters++] = *(daughters+i);
57 fDaughtersPDG[i] = kNonsensePDG;
61 //_______________________________________________________________________________
62 void DecayChannel::SetDaughters(const Int_t *daughters, Int_t n) {
64 // set the daughter PDGs
66 for(Int_t i=0; i<n; i++) {
67 if(i >= kMaxDaughters) {
68 cout << "ERROR in DecayChannel::SetDaughters() :" << endl;
69 cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
71 fDaughtersPDG[fNDaughters++] = *(daughters+i);
75 //_______________________________________________________________________________
76 void DecayChannel::AddDaughter(Int_t pdg) {
78 // add a daughter to this channel
80 if(fNDaughters >= kMaxDaughters) {
81 cout << "ERROR in DecayChannel::AddDaughter() :" << endl;
82 cout << "Number of daughters is already >= than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
84 fDaughtersPDG[fNDaughters++] = pdg;
88 //_______________________________________________________________________________
89 Int_t DecayChannel::GetDaughterPDG(Int_t i) {
91 // get the PDG of the i'th daughter
93 if((i >= fNDaughters) || (i<0)) {
94 cout << "ERROR in DecayChannel::GetDaughterPDG() :" << endl;
95 cout << "Daughter index required is too big or less than zero!! There are only " << fNDaughters << " secondaries in this channel !!" << endl;
98 return fDaughtersPDG[i];