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<fNDaughters; 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<nDaughters; i++) {
54 if(i >= kMaxDaughters) {
55 cout << "ERROR in DecayChannel explicit constructor: " << endl;
56 cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
58 fDaughtersPDG[fNDaughters++] = *(daughters+i);
62 //_______________________________________________________________________________
63 void DecayChannel::SetDaughters(const Int_t *daughters, Int_t n) {
65 // set the daughter PDGs
67 for(Int_t i=0; i<n; i++) {
68 if(i >= kMaxDaughters) {
69 cout << "ERROR in DecayChannel::SetDaughters() :" << endl;
70 cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
72 fDaughtersPDG[fNDaughters++] = *(daughters+i);
76 //_______________________________________________________________________________
77 void DecayChannel::AddDaughter(Int_t pdg) {
79 // add a daughter to this channel
81 if(fNDaughters >= kMaxDaughters) {
82 cout << "ERROR in DecayChannel::AddDaughter() :" << endl;
83 cout << "Number of daughters is already >= than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
85 fDaughtersPDG[fNDaughters++] = pdg;
89 //_______________________________________________________________________________
90 Int_t DecayChannel::GetDaughterPDG(Int_t i) {
92 // get the PDG of the i'th daughter
94 if((i >= fNDaughters) || (i<0)) {
95 cout << "ERROR in DecayChannel::GetDaughterPDG() :" << endl;
96 cout << "Daughter index required is too big or less than zero!! There are only " << fNDaughters << " secondaries in this channel !!" << endl;
99 return fDaughtersPDG[i];