Fix Coverity
[u/mrichter/AliRoot.git] / TTherminator / Therminator / DecayChannel.cxx
1 /******************************************************************************
2  *                      T H E R M I N A T O R                                 *
3  *                   THERMal heavy-IoN generATOR                              *
4  *                           version 1.0                                      *
5  *                                                                            *
6  * Authors of the model: Wojciech Broniowski, Wojciech.Broniowski@ifj.edu.pl, *
7  *                       Wojciech Florkowski, Wojciech.Florkowski@ifj.edu.pl  *
8  * Authors of the code:  Adam Kisiel, kisiel@if.pw.edu.pl                     *
9  *                       Tomasz Taluc, ttaluc@if.pw.edu.pl                    *
10  * Code designers: Adam Kisiel, Tomasz Taluc, Wojciech Broniowski,            *
11  *                 Wojciech Florkowski                                        *
12  *                                                                            *
13  * For the detailed description of the program and furhter references         * 
14  * to the description of the model plesase refer to: nucl-th/0504047,         *
15  * accessibile at: http://www.arxiv.org/nucl-th/0504047                       *
16  *                                                                            *
17  * Homepage: http://hirg.if.pw.edu.pl/en/therminator/                         *
18  *                                                                            *
19  * This code can be freely used and redistributed. However if you decide to   *
20  * make modifications to the code, please contact the authors, especially     *
21  * if you plan to publish the results obtained with such modified code.       *
22  * Any publication of results obtained using this code must include the       *
23  * reference to nucl-th/0504047 and the published version of it, when         *
24  * available.                                                                 *
25  *                                                                            *
26  *****************************************************************************/
27 #include "DecayChannel.h"
28
29 DecayChannel::DecayChannel() :
30   mParticleType1(0), mParticleType2(0), mParticleType3(-1), mBranchRatio(0.0)
31 {
32 }
33
34 DecayChannel::DecayChannel(const DecayChannel& aChannel) 
35 {
36   mBranchRatio = aChannel.GetBranchingRatio();
37   mParticleType1 = aChannel.GetParticle1();
38   mParticleType2 = aChannel.GetParticle2();
39   mParticleType3 = aChannel.GetParticle3();
40 }
41
42 DecayChannel::DecayChannel(double aBranchRatio, int aPartType1, int aPartType2, int aPartType3) :
43   mParticleType1(aPartType1), mParticleType2(aPartType2), mParticleType3(aPartType3), mBranchRatio(aBranchRatio)
44 {
45 }
46
47 DecayChannel::~DecayChannel()
48 {
49 }
50
51 DecayChannel& DecayChannel::operator=(const DecayChannel& aChannel)
52 {
53   if (this != &aChannel) {
54     mBranchRatio = aChannel.GetBranchingRatio();
55     mParticleType1 = aChannel.GetParticle1();
56     mParticleType2 = aChannel.GetParticle2();
57     mParticleType3 = aChannel.GetParticle3();
58   }
59
60   return *this;
61 }
62
63 int    
64 DecayChannel::GetParticle1() const
65 {
66   return mParticleType1;
67 }
68
69 int    
70 DecayChannel::GetParticle2() const
71 {
72   return mParticleType2;
73 }
74
75 int    
76 DecayChannel::GetParticle3() const
77 {
78   return mParticleType3;
79 }
80
81 double 
82 DecayChannel::GetBranchingRatio() const
83 {
84   return mBranchRatio;
85 }
86
87 int    
88 DecayChannel::Is3Particle() const
89 {
90   return (mParticleType3 != -1);
91 }
92
93
94 void   DecayChannel::SetParticle1(int aPartType1)
95 {
96   mParticleType1 = aPartType1;
97 }
98
99 void   DecayChannel::SetParticle2(int aPartType2)
100 {
101   mParticleType2 = aPartType2;
102 }
103
104 void   
105 DecayChannel::SetParticle3(int aPartType3)
106 {
107   mParticleType3 = aPartType3;
108 }
109
110 void   DecayChannel::SetBranchingRatio(double aRatio)
111 {
112   mBranchRatio = aRatio;
113 }