CbmRoot
BoltzmannDistribution.cxx
Go to the documentation of this file.
2 #include <iostream>
3 
5 
6 #include "../NumericalIntegration.h"
7 
8 }
9 
11  int PDGID,
12  bool UseAcc,
13  double ymin,
14  double ymax,
15  double ycm,
16  double width)
17  : xlag32()
18  , wlag32()
19  , xleg32()
20  , wleg32()
21  , fMass(mass)
22  , fPDGID(PDGID)
23  , fUseAcceptance(UseAcc)
24  , fYmin(ymin)
25  , fYmax(ymax)
26  , fYcm(ycm)
27  , fWidth(width)
28  , fAcceptance()
29  , fReconstructionEfficiency()
30  , fTamt()
31  , fNormT()
32  , fNormT4pi()
33 // fNorm(1.), fAcceptance(), fReconstructionEfficiency(), fTamt(), fNormT(), fNormT4pi()
34 {
35  //InverseSlopeNamespace::GetCoefsIntegrateLaguerre32(xlag32, wlag32);
36  fWidth = 1.;
38  0., 3., xlag32, wlag32);
41  //if (fUseAcceptance)
42  {
43  TString work = getenv("VMCWORKDIR");
44  TString dir =
45  work + "/KF/KFModelParameters/common/"; //ThermalModel.mT-t.sts_v13.txt";
46  char spdg[300];
47  sprintf(spdg, "%d", fPDGID);
49  dir + "pty_acc_" + spdg + ".txt")) {
50  fUseAcceptance = false;
51  //std::cout << dir + "pty_acc_" + spdg + ".txt" << "\nAcceptance not OK!\n" << "\n";
52  return;
53  }
54  //std::cout << "Acceptance OK!\n" << "\n";
57  std::vector<double> Tvec(0), mtacc(0), norm(0), norm4pi(0);
58  double dT = 0.002;
59  double Tmax = 0.5;
60  //std::cout << ymin << "<" << "y" << "<" << ymax << "\n";
61  for (int i = 0;; ++i) {
62  double tmpT = 0.01 + dT * (0.5 + i);
63  if (tmpT > Tmax) break;
64  Tvec.push_back(tmpT);
65  mtacc.push_back(mtAv(tmpT));
66  norm.push_back(Normalization(tmpT));
67  norm4pi.push_back(Normalization4pi(tmpT));
68  //std::cout << "Calc: " << Tvec[i] << " " << mtacc[i] << " " << norm[i] << "\n";
69  }
70  fTamt = TSpline3("fTamtacc", &mtacc[0], &Tvec[0], Tvec.size());
71  fNormT = TSpline3("fNormacc", &Tvec[0], &norm[0], Tvec.size());
72  fNormT4pi = TSpline3("fNorm4pi", &Tvec[0], &norm4pi[0], Tvec.size());
73  //for(int i=0;i<Tvec.size();++i) {
74  // std::cout << "ACalc: " << fTamt.Eval(mtacc[i]) << " " << mtacc[i] << " " << fNormT.Eval(Tvec[i]) << "\n";
75  // std::cout << "Avs: " << mtAv(Tvec[i]) << " " << mtAv2(Tvec[i]) << "\n";
76  //}
77  }
78 }
79 
80 double BoltzmannDistribution::mtAv(double T) {
81  double ret1 = 0., ret2 = 0.;
82  for (Int_t i = 0; i < 32; i++) {
83  for (Int_t j = 0; j < 32; j++) {
84  double tmpf = 0.;
85  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
86  * TMath::CosH(xleg32[j] + fYcm);
87  tp = sqrt(tp * tp - fMass * fMass);
88  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
89  tmpf = wlag32[i] * wleg32[j] * xlag32[i] * tmt * TMath::CosH(xleg32[j])
90  * TMath::Exp(-tmt * TMath::CosH(xleg32[j]) / T);
91  if (fUseAcceptance)
94  ret1 += tmpf;
95  ret2 += tmpf * tmt;
96  }
97  }
98  return ret2 / ret1;
99 }
100 
102  double ret = 0.;
103  for (Int_t i = 0; i < 32; i++) {
104  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
105  ret += wlag32[i] * xlag32[i] * fmt(tmt, T);
106  }
107  return ret;
108 }
109 
110 double BoltzmannDistribution::fmt(double mt, double T) {
111  double ret = 0.;
112  double tpt = sqrt(mt * mt - fMass * fMass);
113  for (Int_t j = 0; j < 32; j++) {
114  double tmpf = 0.;
115  double tp = mt * TMath::CosH(xleg32[j] + fYcm);
116  tp = sqrt(tp * tp - fMass * fMass);
117  tmpf = wleg32[j] * tpt * mt * TMath::CosH(xleg32[j])
118  * TMath::Exp(-mt * TMath::CosH(xleg32[j]) / T);
119  if (fUseAcceptance)
120  tmpf *= fAcceptance.getAcceptance(xleg32[j] + fYcm, tpt)
122  ret += tmpf;
123  }
124  return ret * mt / tpt / fNormT.Eval(T);
125 }
126 
128  double ret = 0.;
129  //if (fUseAcceptance)
130  {
131  for (Int_t i = 0; i < 32; i++) {
132  for (Int_t j = 0; j < 32; j++) {
133  double tmpf = 0.;
134  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
135  * TMath::CosH(xleg32[j] + fYcm);
136  tp = sqrt(tp * tp - fMass * fMass);
137  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
138  tmpf = wlag32[i] * wleg32[j] * xlag32[i] * tmt * TMath::CosH(xleg32[j])
139  * TMath::Exp(-tmt * TMath::CosH(xleg32[j]) / T);
140  if (fUseAcceptance)
141  tmpf *= fAcceptance.getAcceptance(xleg32[j] + fYcm, xlag32[i])
143  ret += tmpf;
144  }
145  }
146  }
147  return ret;
148 }
149 
151  double ret = 0.;
152  //if (fUseAcceptance)
153  {
154  for (Int_t i = 0; i < 32; i++) {
155  for (Int_t j = 0; j < 32; j++) {
156  double tmpf = 0.;
157  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
158  * TMath::CosH(xleg32[j] + fYcm);
159  tp = sqrt(tp * tp - fMass * fMass);
160  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
161  tmpf = wlag32[i] * wleg32[j] * xlag32[i] * tmt * TMath::CosH(xleg32[j])
162  * TMath::Exp(-tmt * TMath::CosH(xleg32[j]) / T);
163  ret += tmpf;
164  }
165  }
166  }
167  return ret;
168 }
169 
170 double BoltzmannDistribution::dndy(double y, double A, double T) {
171  double ret = 0.;
172  for (Int_t i = 0; i < 32; i++) {
173  //for(Int_t j = 0 ; j < 32 ; j++){
174  double tmpf = 0.;
175  double tp =
176  sqrt(xlag32[i] * xlag32[i] + fMass * fMass) * TMath::CosH(y + fYcm);
177  tp = sqrt(tp * tp - fMass * fMass);
178  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
179  tmpf = wlag32[i] * xlag32[i] * tmt * TMath::CosH(y)
180  * TMath::Exp(-tmt * TMath::CosH(y) / T);
181  ret += tmpf;
182  //}
183  }
184  return ret / fNormT4pi.Eval(T) * A;
185 }
BoltzmannDistribution::mtAv
double mtAv(double T)
Definition: BoltzmannDistribution.cxx:80
BoltzmannDistribution::fMass
double fMass
Definition: BoltzmannDistribution.h:15
Acceptance::AcceptanceFunction::getAcceptance
Double_t getAcceptance(const Double_t &y, const Double_t &pt) const
Definition: Acceptance.cxx:33
BoltzmannDistribution::fmt
double fmt(double amt, double T)
Definition: BoltzmannDistribution.cxx:110
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
BoltzmannDistribution::Normalization4pi
double Normalization4pi(double T)
Definition: BoltzmannDistribution.cxx:150
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
BoltzmannDistribution::fUseAcceptance
bool fUseAcceptance
Definition: BoltzmannDistribution.h:17
BoltzmannDistribution.h
BoltzmannDistribution::fYmax
double fYmax
Definition: BoltzmannDistribution.h:18
BoltzmannDistribution::xlag32
std::vector< double > xlag32
Definition: BoltzmannDistribution.h:13
BoltzmannDistribution::xleg32
std::vector< double > xleg32
Definition: BoltzmannDistribution.h:14
Acceptance::ReconstructionEfficiencyFunction::f
Double_t f(double p)
Definition: Acceptance.h:25
GetCoefsIntegrateLegendre32
void GetCoefsIntegrateLegendre32(double a, double b, std::vector< double > &x, std::vector< double > &w)
Definition: HRGModel/NumericalIntegration.h:477
BoltzmannDistribution::fYmin
double fYmin
Definition: BoltzmannDistribution.h:18
BoltzmannDistribution::Normalization
double Normalization(double T)
Definition: BoltzmannDistribution.cxx:127
BoltzmannDistribution::fWidth
double fWidth
Definition: BoltzmannDistribution.h:18
Acceptance::ReconstructionEfficiencyFunction
Definition: Acceptance.h:19
BoltzmannDistribution::BoltzmannDistribution
BoltzmannDistribution(double mass=0.938, int PDGID=2212, bool fUseAcc=false, double ymin=-3., double ymax=3., double ycm=2., double width=1.)
Definition: BoltzmannDistribution.cxx:10
BoltzmannDistribution::dndy
double dndy(double y, double A, double T)
Definition: BoltzmannDistribution.cxx:170
BoltzmannDistribution::mtAv2
double mtAv2(double T)
Definition: BoltzmannDistribution.cxx:101
BoltzmannDistribution::wleg32
std::vector< double > wleg32
Definition: BoltzmannDistribution.h:14
BoltzmannDistribution::fYcm
double fYcm
Definition: BoltzmannDistribution.h:18
BoltzmannDistribution::fNormT
TSpline3 fNormT
Definition: BoltzmannDistribution.h:24
BoltzmannDistribution::fAcceptance
Acceptance::AcceptanceFunction fAcceptance
Definition: BoltzmannDistribution.h:21
BoltzmannDistribution::fTamt
TSpline3 fTamt
Definition: BoltzmannDistribution.h:23
BoltzmannDistribution::wlag32
std::vector< double > wlag32
Definition: BoltzmannDistribution.h:13
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
BoltzmannDistribution::fReconstructionEfficiency
Acceptance::ReconstructionEfficiencyFunction fReconstructionEfficiency
Definition: BoltzmannDistribution.h:22
Acceptance::ReadAcceptanceFunction
int ReadAcceptanceFunction(AcceptanceFunction &func, TString filename)
Definition: Acceptance.cxx:7
BoltzmannDistribution::fNormT4pi
TSpline3 fNormT4pi
Definition: BoltzmannDistribution.h:24
BoltzmannDistributionNamespace
Definition: BoltzmannDistribution.cxx:4
BoltzmannDistribution::fPDGID
int fPDGID
Definition: BoltzmannDistribution.h:16