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.
14 #include "DecayChannel.h"
21 DecayChannel::DecayChannel() :
22 fMotherPDG(kNonsensePDG),
26 for(Int_t i=0; i<kMaxDaughters; i++)
27 fDaughtersPDG[i] = kNonsensePDG;
30 DecayChannel::DecayChannel(const DecayChannel ©):
31 fMotherPDG(copy.fMotherPDG),
32 fBranchingRatio(copy.fBranchingRatio),
33 fNDaughters(copy.fNDaughters)
35 for(Int_t i=0; i<fNDaughters; i++)
36 fDaughtersPDG[i] = copy.fDaughtersPDG[i];
39 DecayChannel::DecayChannel(Int_t mother, Double_t branching, Int_t nDaughters, Int_t *daughters):
41 fBranchingRatio(branching),
44 for(Int_t i=0; i<nDaughters; i++) {
45 if(i >= kMaxDaughters) {
46 cout << "ERROR in DecayChannel explicit constructor: " << endl;
47 cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
49 fDaughtersPDG[fNDaughters++] = *(daughters+i);
53 void DecayChannel::SetDaughters(Int_t *daughters, Int_t n) {
54 for(Int_t i=0; i<n; i++) {
55 if(i >= kMaxDaughters) {
56 cout << "ERROR in DecayChannel::SetDaughters() :" << endl;
57 cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
59 fDaughtersPDG[fNDaughters++] = *(daughters+i);
63 void DecayChannel::AddDaughter(Int_t pdg) {
64 if(fNDaughters >= kMaxDaughters) {
65 cout << "ERROR in DecayChannel::AddDaughter() :" << endl;
66 cout << "Number of daughters is already >= than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
68 fDaughtersPDG[fNDaughters++] = pdg;
71 Int_t DecayChannel::GetDaughterPDG(Int_t i) {
72 if((i >= fNDaughters) || (i<0)) {
73 cout << "ERROR in DecayChannel::GetDaughterPDG() :" << endl;
74 cout << "Daughter index required is too big or less than zero!! There are only " << fNDaughters << " secondaries in this channel !!" << endl;
77 return fDaughtersPDG[i];