Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoSourceDensity.cxx
1/*
2 * FemtoSourceDensity.cxx
3 *
4 * Created on: 3 sty 2023
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "FemtoSourceDensity.h"
10
11
12namespace Hal {
13
14 FemtoSourceDensity::FemtoSourceDensity(const FemtoSourceDensity& other) : TObject(other) {
15 fNParams = other.fNParams;
16 fAna1d = other.fAna1d;
17 fAna3d = other.fAna3d;
18 if (fNParams > 0) {
19 fParams = new Double_t[fNParams];
20 for (int i = 0; i < fNParams; i++) {
21 fParams[i] = other.fParams[i];
22 }
23 } else {
24 fNParams = 0;
25 fParams = nullptr;
26 }
27 }
28
30 if (&other == this) return *this;
31 if (other.fNParams != fNParams) {
32 delete[] fParams;
33 fNParams = other.fNParams;
34 fParams = new Double_t[fNParams];
35 }
36 for (int i = 0; i < fNParams; i++) {
37 fParams[i] = other.fParams[i];
38 }
39 return *this;
40 }
41
42 void FemtoSourceDensity::SetBaseParameters(const Double_t* params) {
43 for (int i = 0; i < fNParams; i++) {
44 fParams[i] = params[i];
45 }
46 }
47
48 Double_t FemtoSourceDensity::GetRelativeProbDensity3d(const TVector3& vec, const Double_t* par) {
49 return GetProbDensity3d(vec, par) / GetProbDensity3d(vec, fParams);
50 }
51
52 Double_t FemtoSourceDensity::GetRelativeProbDensity1d(const Double_t r, const Double_t* params) const {
53 return GetProbDensity1d(r, params) / GetProbDensity1d(r, fParams);
54 }
55
56} // namespace Hal
virtual Double_t GetRelativeProbDensity3d(const TVector3 &vec, const Double_t *params)
virtual Double_t GetProbDensity3d(const TVector3 &, const Double_t *) const
FemtoSourceDensity & operator=(const FemtoSourceDensity &other)
virtual void SetBaseParameters(const Double_t *params)
virtual Double_t GetProbDensity1d(const Double_t, const Double_t *) const
virtual Double_t GetRelativeProbDensity1d(const Double_t r, const Double_t *params) const