]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TMEVSIM/TMevSimPartTypeParams.cxx
Replacing array of objects by array of pointers
[u/mrichter/AliRoot.git] / TMEVSIM / TMevSimPartTypeParams.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 #include "TMevSimPartTypeParams.h"
19
20 ClassImp(TMevSimPartTypeParams) 
21
22   
23 //______________________________________________________________________________
24   TMevSimPartTypeParams::TMevSimPartTypeParams() 
25
26 // Default constructor
27   
28   for (Int_t i = 0; i < 4; i++)
29     for (Int_t j = 0; j < NFLOWTERMS; j++) {
30       fVnMean[j][i] = 0.0;
31       fVnStDev[j][i] = 0.0;
32     }
33 }
34
35 //__________________________________________________________________________
36 TMevSimPartTypeParams::TMevSimPartTypeParams(Int_t agpid, Int_t amultmean, Int_t amultvc, 
37                                              Float_t atempmean, Float_t atempstdev, Float_t asigmamean,
38                                              Float_t asigmastdev, Float_t aexpvelmean, Float_t aexpvelstdev) 
39 {
40 // Construct the particle type parametrs class. Use the values provide
41 // by the user to initialize the internal variables. For the meaning of
42 // the parametrs see the TMevSim class documentation.
43    
44    fGPid = agpid;
45    fMultMean = amultmean;
46    fMultVarianceControl = amultvc;
47    fTempMean = atempmean;
48    fTempStDev = atempstdev;
49    fSigmaMean = asigmamean;
50    fSigmaStDev = asigmastdev;
51    fExpVelMean = aexpvelmean;
52    fExpVelStDev = aexpvelstdev;
53    for (Int_t i = 0; i < 4; i++)
54      for (Int_t j = 0; j < NFLOWTERMS; j++) {
55         fVnMean[j][i] = 0.0;
56         fVnStDev[j][i] = 0.0;
57      }
58    
59 }
60
61 //______________________________________________________________________________
62 TMevSimPartTypeParams::~TMevSimPartTypeParams() 
63 {
64   //dtor
65 }
66
67 //______________________________________________________________________________
68 TMevSimPartTypeParams::TMevSimPartTypeParams (const TMevSimPartTypeParams& pars) : TObject(pars) {
69 // The copy constructor
70   
71    this->fGPid = pars.GetGPid();
72    this->fMultMean = pars.GetMultMean();
73    this->fMultVarianceControl = pars.GetMultVarianceControl();
74    this->fTempMean = pars.GetTempMean();
75    this->fTempStDev = pars.GetTempStDev();
76    this->fSigmaMean = pars.GetSigmaMean();
77    this->fSigmaStDev = pars.GetSigmaStDev();
78    this->fExpVelMean = pars.GetExpVelMean();
79    this->fExpVelStDev = pars.GetExpVelStDev();
80    for (Int_t i = 0; i < 4; i++)
81      for (Int_t j = 0; j < NFLOWTERMS; j++) {
82        this->fVnMean[j][i] = pars.GetVnMeanComponent(j, i);
83        this->fVnStDev[j][i] = pars.GetVnStDevComponent(j, i);
84      }
85 }
86
87 //______________________________________________________________________________
88 TMevSimPartTypeParams& TMevSimPartTypeParams::operator=(const TMevSimPartTypeParams& pars) {
89 // The assignment operator
90    
91    this->fGPid = pars.GetGPid();
92    this->fMultMean = pars.GetMultMean();
93    this->fMultVarianceControl = pars.GetMultVarianceControl();
94    this->fTempMean = pars.GetTempMean();
95    this->fTempStDev = pars.GetTempStDev();
96    this->fSigmaMean = pars.GetSigmaMean();
97    this->fSigmaStDev = pars.GetSigmaStDev();
98    this->fExpVelMean = pars.GetExpVelMean();
99    this->fExpVelStDev = pars.GetExpVelStDev();
100    for (Int_t i = 0; i < 4; i++)
101      for (Int_t j = 0; j < NFLOWTERMS; j++) {
102        this->fVnMean[j][i] = GetVnMeanComponent(j, i);
103        this->fVnStDev[j][i] = GetVnStDevComponent(j, i);
104      }
105    return (*this);
106 }
107
108 //______________________________________________________________________________
109 void    TMevSimPartTypeParams::SetGPid(Int_t gpid) {
110 //Sets pid
111    fGPid = gpid;
112 }
113 //______________________________________________________________________________
114 Int_t   TMevSimPartTypeParams::GetGPid() const {
115 //returns pid
116    return fGPid;
117 }
118 //______________________________________________________________________________
119 void    TMevSimPartTypeParams::SetMultMean(Int_t multmean) {
120 //sets multiplicity mean
121    fMultMean = multmean;
122 }
123 //______________________________________________________________________________
124 Int_t TMevSimPartTypeParams::GetMultMean() const {
125 //returns multiplicity mean
126    return fMultMean;
127 }
128 //______________________________________________________________________________
129 void    TMevSimPartTypeParams::SetMultVarianceControl(Int_t multvc) {
130 //sets multiplicity variance
131    fMultVarianceControl = multvc;
132 }
133 //______________________________________________________________________________
134 Int_t   TMevSimPartTypeParams::GetMultVarianceControl() const {
135 //returns multiplicity variance
136    return fMultVarianceControl;
137 }
138 //______________________________________________________________________________
139 void    TMevSimPartTypeParams::SetTempParams(Float_t tempmean, Float_t tempsdev) { 
140 //Sets mean and variance of temperature
141    fTempMean = tempmean;
142    fTempStDev = tempsdev;
143 }
144 //______________________________________________________________________________
145 Float_t TMevSimPartTypeParams::GetTempMean() const { 
146 //returns mean temperature
147    return fTempMean;
148 }
149 //______________________________________________________________________________
150 Float_t TMevSimPartTypeParams::GetTempStDev() const { 
151 //returns temperature variance
152    return fTempStDev;
153 }
154 //______________________________________________________________________________
155 void    TMevSimPartTypeParams::SetSigmaPrams(Float_t sigmamean, Float_t sigmastdev) {  
156 //Sets mean and variance of rapidity
157    fSigmaMean = sigmamean;
158    fSigmaStDev = sigmastdev;
159 }
160 //______________________________________________________________________________
161 Float_t TMevSimPartTypeParams::GetSigmaMean() const { 
162 //returns mean rapidity
163    return fSigmaMean;
164 }
165 //______________________________________________________________________________
166 Float_t TMevSimPartTypeParams::GetSigmaStDev() const { 
167 //returns rapidity variance
168    return fSigmaStDev;
169 }
170 //______________________________________________________________________________
171 void    TMevSimPartTypeParams::SetExpVelParams(Float_t expvelmean, Float_t expvelstdev) {  
172 //Sets mean and variance of  Expansion velocity ala Scott Pratt (in units of c)
173    fExpVelMean = expvelmean;
174    fExpVelStDev = expvelstdev;
175 }
176 //______________________________________________________________________________
177 Float_t TMevSimPartTypeParams::GetExpVelMean() const { 
178 //Sets mean of Expansion velocity ala Scott Pratt (in units of c)
179    return fExpVelMean;
180 }
181 //______________________________________________________________________________
182 Float_t TMevSimPartTypeParams::GetExpVelStDev() const { 
183 //Sets variance of  Expansion velocity ala Scott Pratt (in units of c)
184    return fExpVelStDev;
185 }
186 //______________________________________________________________________________
187
188 void TMevSimPartTypeParams::SetVnMeanComponent
189 (Int_t nComponent, Float_t mean1, Float_t mean2,  Float_t mean3, Float_t mean4)  {  
190   //Sets VnMean: Anisotropic flow parameters for Fourier components NFLOWTERMS=1,6
191   //                 mean include all 6 sets of parameters, set them to 0 if not used                                
192
193   if (nComponent < 0 || nComponent > NFLOWTERMS )
194     Error("SetVnMeanComponent", "Wrong Vn component n = %d (must be [%d , %d])", 
195           nComponent, 0, NFLOWTERMS);
196
197   fVnMean[nComponent][0] = mean1;
198   fVnMean[nComponent][1] = mean2;
199   fVnMean[nComponent][2] = mean3;
200   fVnMean[nComponent][3] = mean4;
201 }
202 //______________________________________________________________________________
203
204 void TMevSimPartTypeParams::SetVnStDevComponent
205 (Int_t nComponent, Float_t stdev1, Float_t stdev2,Float_t stdev3, Float_t stdev4) {  
206   //Sets VnStDev: Anisotropic flow parameters for Fourier components NFLOWTERMS=1,6
207   //              standard deviation include all 6 sets of parameters, set them to 0 if not used                                
208
209   if (nComponent < 0 || nComponent > NFLOWTERMS )
210     Error("SetVnStDevComponent", "Wrong Vn component n = %d (must be [%d , %d])",
211           nComponent, 0, NFLOWTERMS);
212
213   fVnStDev[nComponent][0] = stdev1;
214   fVnStDev[nComponent][1] = stdev2;
215   fVnStDev[nComponent][2] = stdev3;
216   fVnStDev[nComponent][3] = stdev4;
217 }
218
219 //______________________________________________________________________________
220
221 void TMevSimPartTypeParams::SetVnMeanComponent (Int_t nComponent, Float_t mean[4]) {
222   //Sets VnMean: Anisotropic flow parameters for Fourier components NFLOWTERMS=1,6
223   //                 mean include all 6 sets of parameters, set them to 0 if not used                                
224   if (nComponent < 0 || nComponent > NFLOWTERMS )
225     Error("SetVnMeanComponent", "Wrong Vn component (%d) (must be [%d,%d])",
226         nComponent, 0, NFLOWTERMS);
227   
228   Int_t n = 4;
229   for (Int_t i=0; i<n; i++) 
230     fVnMean[nComponent][i] = mean[i];
231
232 }
233
234 //______________________________________________________________________________
235
236 void TMevSimPartTypeParams::SetVnStDevComponent (Int_t nComponent, Float_t stdev[4]) {
237   //Sets VnStDev: Anisotropic flow parameters for Fourier components NFLOWTERMS=1,6
238   //              standard deviation include all 6 sets of parameters, set them to 0 if not used                                
239
240   if (nComponent < 0 || nComponent > NFLOWTERMS )
241     Error("SetVnStDevComponent", "Wrong Vn component n = %d (must be [%d , %d])",
242           nComponent, 0, NFLOWTERMS);
243   
244   Int_t n = 4;
245   for (Int_t i=0; i<n; i++) 
246     fVnStDev[nComponent][i] = stdev[i];  
247 }
248
249 //______________________________________________________________________________
250
251 Float_t     TMevSimPartTypeParams::GetVnMeanComponent(Int_t nComponent, Int_t nMean) const {
252   //Returns VnMean: Anisotropic flow parameters for Fourier components NFLOWTERMS=1,6
253   //                 mean include all 6 sets of parameters, set them to 0 if not used                                
254
255   if ((nComponent < 0) || (nComponent>NFLOWTERMS) || (nMean < 0) || (nMean > 3)) return 0.0;
256   return fVnMean[nComponent][nMean];
257 }
258 //______________________________________________________________________________
259 Float_t     TMevSimPartTypeParams::GetVnStDevComponent(Int_t nComponent, Int_t nStDev) const {
260   //Returns VnStDev: Anisotropic flow parameters for Fourier components NFLOWTERMS=1,6
261   //              standard deviation include all 6 sets of parameters, set them to 0 if not used                                
262
263   if ((nComponent < 0) || (nComponent>NFLOWTERMS) || (nStDev < 0) || (nStDev > 3)) return 0.0;
264   return fVnMean[nComponent][nStDev];
265 }
266
267 //______________________________________________________________________________
268
269
270
271
272