10#include "FemtoSourceModelGauss.h"
15#include <TDecompChol.h>
21 FemtoSourceModelGauss1D::FemtoSourceModelGauss1D() : FemtoSourceModel1D() {
22 fModelName =
"gaus1d";
23 fDensity =
new FemtoSourceDensityGaus1d();
36 FemtoSourceModelGauss1D::~FemtoSourceModelGauss1D() {}
58 FemtoSourceModelGauss3D::~FemtoSourceModelGauss3D() {}
62 FemtoSourceDensityGaus1d::FemtoSourceDensityGaus1d() : FemtoSourceDensity(1, kTRUE, kTRUE) {}
66 Double_t u = params[0];
67 const Double_t Norm = 2. * Const::SqrtPi() * u * u * u;
68 return TMath::Exp(-r * r / (4.0 * u * u)) / Norm * r * r;
72 const Double_t sxsysz = params[0] * params[0] * params[0];
73 const Double_t Gx = TMath::Gaus(vec.X(), 0, params[0] * TMath::Sqrt2());
74 const Double_t Gy = TMath::Gaus(vec.Y(), 0, params[0] * TMath::Sqrt2());
75 const Double_t Gz = TMath::Gaus(vec.Z(), 0, params[0] * TMath::Sqrt2());
76 return 0.02244839026564582 / sxsysz * Gx * Gy * Gz;
80 FemtoSourceDensityGaus3d::FemtoSourceDensityGaus3d() :
FemtoSourceDensity(3, kTRUE, kTRUE) {}
84 Double_t u = TMath::Power(params[0] * params[1] * params[2], 1.0 / 3.0);
85 const Double_t Norm = 2. * Const::SqrtPi() * u * u * u;
86 return TMath::Exp(-r * r / (4.0 * u * u)) / Norm * r * r;
90 const Double_t sxsysz = params[0] * params[1] * params[2];
91 const Double_t Gx = TMath::Gaus(vec.X(), 0, params[0] * TMath::Sqrt2());
92 const Double_t Gy = TMath::Gaus(vec.Y(), 0, params[1] * TMath::Sqrt2());
93 const Double_t Gz = TMath::Gaus(vec.Z(), 0, params[2] * TMath::Sqrt2());
94 return 0.02244839026564582 / sxsysz * Gx * Gy * Gz;
102 SetParName(3,
"R_{out-side}");
103 SetParName(4,
"R_{out-long}");
104 SetParName(5,
"R_{side-long}");
109 fAMatrix = model.fAMatrix;
110 fCovMatrix = model.fCovMatrix;
111 for (
int i = 0; i < 3; i++) {
112 fRowX[i] = model.fRowX[i];
113 fRowY[i] = model.fRowY[i];
114 fRowZ[i] = model.fRowZ[i];
124 Double_t Z1 =
fRandom->Gaus(0, TMath::Sqrt2());
125 Double_t Z2 =
fRandom->Gaus(0, TMath::Sqrt2());
126 Double_t Z3 =
fRandom->Gaus(0, TMath::Sqrt2());
131 fRout = Z1 * fRowX[0] + Z2 * fRowX[1] + Z3 * fRowX[2];
132 fRside = Z1 * fRowY[0] + Z2 * fRowY[1] + Z3 * fRowY[2];
133 fRlong = Z1 * fRowZ[0] + Z2 * fRowZ[1] + Z3 * fRowZ[2];
138 TMatrixD sigma(3, 3);
140 sigma[0][1] = GetOutSide();
141 sigma[0][2] = GetOutLong();
142 sigma[1][0] = GetOutSide();
144 sigma[1][2] = GetSideLong();
145 sigma[2][0] = GetOutLong();
146 sigma[2][1] = GetSideLong();
148 for (
int i = 0; i < 3; i++) {
149 for (
int j = 0; j < 3; j++) {
150 sigma[i][j] = sigma[i][j] * sigma[i][j];
157 TDecompChol chol(sigma);
158 Bool_t decomposed = chol.Decompose();
160 Hal::Cout::PrintInfo(
"Cannot decompose matrix in FemtoSourceModelGauss3DCross", Hal::EInfo::kError);
163 auto m = chol.GetU();
167 for (
int i = 0; i < 3; i++) {
static void PrintInfo(TString text, Hal::EInfo status)
Double_t GetProbDensity1d(const Double_t r, const Double_t *params) const
Double_t GetProbDensity3d(const TVector3 &vec, const Double_t *params) const
Double_t GetProbDensity3d(const TVector3 &vec, const Double_t *params) const
Double_t GetProbDensity1d(const Double_t r, const Double_t *params) const
FemtoSourceModel * MakeCopy() const
void GenerateCoordinates(FemtoPair *Pair)
void GenerateCoordinates(FemtoPair *Pair)
FemtoSourceModel * MakeCopy() const
FemtoSourceModelGauss3DCross()
FemtoSourceModel * MakeCopy() const
FemtoSourceModelGauss3D()
void GenerateCoordinates(FemtoPair *Pair)
void SetParameter(Int_t par_no, Double_t par_val)
Double_t GetParameter(Int_t n) const
FemtoSourceDensity * fDensity