]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TUHKMgen/UHKM/DecayChannel.cxx
Medium cuts moved to galice.cuts
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / DecayChannel.cxx
CommitLineData
b1c2e580 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 DECAY_CHANNEL
14#include "DecayChannel.h"
15#endif
16
17#include <iostream>
18using std::cout;
19using std::endl;
20
786056a2 21DecayChannel::DecayChannel() :
22 fMotherPDG(kNonsensePDG),
23 fBranchingRatio(0.0),
24 fNDaughters(0)
25{
b1c2e580 26 for(Int_t i=0; i<kMaxDaughters; i++)
27 fDaughtersPDG[i] = kNonsensePDG;
28}
29
786056a2 30DecayChannel::DecayChannel(const DecayChannel &copy):
31 fMotherPDG(copy.fMotherPDG),
32 fBranchingRatio(copy.fBranchingRatio),
33 fNDaughters(copy.fNDaughters)
34{
b1c2e580 35 for(Int_t i=0; i<fNDaughters; i++)
36 fDaughtersPDG[i] = copy.fDaughtersPDG[i];
37}
38
786056a2 39DecayChannel::DecayChannel(Int_t mother, Double_t branching, Int_t nDaughters, Int_t *daughters):
40 fMotherPDG(mother),
41 fBranchingRatio(branching),
42 fNDaughters(0)
43{
b1c2e580 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;
48 }
49 fDaughtersPDG[fNDaughters++] = *(daughters+i);
50 }
51}
52
53void 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;
58 }
59 fDaughtersPDG[fNDaughters++] = *(daughters+i);
60 }
61}
62
63void 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;
67 }
68 fDaughtersPDG[fNDaughters++] = pdg;
69}
70
71Int_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;
75 return kNonsensePDG;
76 }
77 return fDaughtersPDG[i];
78}
79