CbmRoot
InverseSlope.cxx
Go to the documentation of this file.
1 #include "InverseSlope.h"
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 {
39  if (fUseAcceptance) {
40  TString work = getenv("VMCWORKDIR");
41  TString dir =
42  work + "/KF/KFModelParameters/common/"; //ThermalModel.mT-t.sts_v13.txt";
43  char spdg[300];
44  sprintf(spdg, "%d", fPDGID);
46  dir + "pty_acc_" + spdg + ".txt")) {
47  fUseAcceptance = false;
48  return;
49  }
50  //std::cout << "Acceptance OK!\n" << "\n";
53  std::vector<double> Tvec(0), mtacc(0), norm(0), norm4pi(0);
54  double dT = 0.002;
55  double Tmax = 0.5;
56  //std::cout << ymin << "<" << "y" << "<" << ymax << "\n";
57  for (int i = 0;; ++i) {
58  double tmpT = 0.01 + dT * (0.5 + i);
59  if (tmpT > Tmax) break;
60  Tvec.push_back(tmpT);
61  mtacc.push_back(mtAv(tmpT));
62  norm.push_back(Normalization(tmpT));
63  norm4pi.push_back(Normalization4pi(tmpT));
64  //std::cout << "Calc: " << Tvec[i] << " " << mtacc[i] << " " << norm[i] << "\n";
65  }
66  fTamt = TSpline3("fTamtacc", &mtacc[0], &Tvec[0], Tvec.size());
67  fNormT = TSpline3("fNormacc", &Tvec[0], &norm[0], Tvec.size());
68  fNormT4pi = TSpline3("fNorm4pi", &Tvec[0], &norm4pi[0], Tvec.size());
69  }
70 }
71 
72 double InverseSlope::mtAv(double T) {
73  if (!fUseAcceptance) {
74  return (fMass * fMass + 2. * fMass * T + 2. * T * T) / (fMass + T);
75  } else {
76  //double ret = 0.;
77  double ret1 = 0., ret2 = 0.;
78  for (Int_t i = 0; i < 32; i++) {
79  for (Int_t j = 0; j < 32; j++) {
80  double tmpf = 0.;
81  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
82  * TMath::CosH(xleg32[j] + fYcm);
83  tp = sqrt(tp * tp - fMass * fMass);
84  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
85  tmpf = wlag32[i] * wleg32[j] * xlag32[i] * TMath::Exp(-tmt / T)
86  * TMath::Exp(-xleg32[j] * xleg32[j] / 2. / fWidth / fWidth)
89  ret1 += tmpf;
90  ret2 += tmpf * tmt;
91  }
92  }
93  return ret2 / ret1;
94  }
95 }
96 
97 double InverseSlope::mtAv2(double T) {
98  if (!fUseAcceptance) {
99  return (fMass * fMass + 2. * fMass * T + 2. * T * T) / (fMass + T);
100  } else {
101  double ret = 0.;
102  for (Int_t i = 0; i < 32; i++) {
103  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
104  ret += wlag32[i] * xlag32[i] * fmt(tmt, T);
105  }
106  return ret;
107  }
108 }
109 
110 double InverseSlope::fmt(double mt, double T) {
111  if (!fUseAcceptance)
112  return TMath::Exp((fMass - mt) / T) * mt / T / (fMass + T);
113  else {
114  double ret = 0.;
115  double tpt = sqrt(mt * mt - fMass * fMass);
116  for (Int_t j = 0; j < 32; j++) {
117  double tmpf = 0.;
118  double tp = mt * TMath::CosH(xleg32[j] + fYcm);
119  tp = sqrt(tp * tp - fMass * fMass);
120  tmpf = wleg32[j] * tpt * TMath::Exp(-mt / T)
121  * TMath::Exp(-xleg32[j] * xleg32[j] / 2. / fWidth / fWidth)
122  * fAcceptance.getAcceptance(xleg32[j] + fYcm, tpt)
124  ret += tmpf;
125  }
126  return ret * mt / tpt / fNormT.Eval(T);
127  }
128 }
129 
130 double InverseSlope::Normalization(double T) {
131  double ret = 0.;
132  if (fUseAcceptance) {
133  for (Int_t i = 0; i < 32; i++) {
134  for (Int_t j = 0; j < 32; j++) {
135  double tmpf = 0.;
136  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
137  * TMath::CosH(xleg32[j] + fYcm);
138  tp = sqrt(tp * tp - fMass * fMass);
139  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
140  tmpf = wlag32[i] * wleg32[j] * xlag32[i] * TMath::Exp(-tmt / T)
141  * TMath::Exp(-xleg32[j] * xleg32[j] / 2. / fWidth / fWidth)
144  ret += tmpf;
145  }
146  }
147  }
148  return ret;
149 }
150 
152  double ret = 0.;
153  if (fUseAcceptance) {
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] * TMath::Exp(-tmt / T)
162  * TMath::Exp(-xleg32[j] * xleg32[j] / 2. / fWidth / fWidth);
163  ret += tmpf;
164  }
165  }
166  }
167  return ret;
168 }
InverseSlope.h
InverseSlope::fNormT4pi
TSpline3 fNormT4pi
Definition: InverseSlope.h:24
InverseSlope::InverseSlope
InverseSlope(double mass=0.938, int PDGID=2212, bool fUseAcc=false, double ymin=-3., double ymax=3., double ycm=2., double width=1.)
Definition: InverseSlope.cxx:10
InverseSlope::xleg32
std::vector< double > xleg32
Definition: InverseSlope.h:14
InverseSlope::fmt
double fmt(double amt, double T)
Definition: InverseSlope.cxx:110
Acceptance::AcceptanceFunction::getAcceptance
Double_t getAcceptance(const Double_t &y, const Double_t &pt) const
Definition: Acceptance.cxx:33
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
InverseSlope::fNormT
TSpline3 fNormT
Definition: InverseSlope.h:24
InverseSlope::fTamt
TSpline3 fTamt
Definition: InverseSlope.h:23
Acceptance::ReconstructionEfficiencyFunction::f
Double_t f(double p)
Definition: Acceptance.h:25
InverseSlope::xlag32
std::vector< double > xlag32
Definition: InverseSlope.h:13
InverseSlope::Normalization
double Normalization(double T)
Definition: InverseSlope.cxx:130
GetCoefsIntegrateLegendre32
void GetCoefsIntegrateLegendre32(double a, double b, std::vector< double > &x, std::vector< double > &w)
Definition: HRGModel/NumericalIntegration.h:477
InverseSlope::fMass
double fMass
Definition: InverseSlope.h:15
InverseSlope::mtAv
double mtAv(double T)
Definition: InverseSlope.cxx:72
InverseSlope::wlag32
std::vector< double > wlag32
Definition: InverseSlope.h:13
Acceptance::ReconstructionEfficiencyFunction
Definition: Acceptance.h:19
InverseSlopeNamespace
Definition: InverseSlope.cxx:4
InverseSlope::fWidth
double fWidth
Definition: InverseSlope.h:18
InverseSlope::Normalization4pi
double Normalization4pi(double T)
Definition: InverseSlope.cxx:151
InverseSlope::fUseAcceptance
bool fUseAcceptance
Definition: InverseSlope.h:17
InverseSlope::fPDGID
int fPDGID
Definition: InverseSlope.h:16
InverseSlope::mtAv2
double mtAv2(double T)
Definition: InverseSlope.cxx:97
InverseSlope::fYmax
double fYmax
Definition: InverseSlope.h:18
InverseSlope::fReconstructionEfficiency
Acceptance::ReconstructionEfficiencyFunction fReconstructionEfficiency
Definition: InverseSlope.h:22
InverseSlope::fAcceptance
Acceptance::AcceptanceFunction fAcceptance
Definition: InverseSlope.h:21
Acceptance::ReadAcceptanceFunction
int ReadAcceptanceFunction(AcceptanceFunction &func, TString filename)
Definition: Acceptance.cxx:7
InverseSlope::wleg32
std::vector< double > wleg32
Definition: InverseSlope.h:14
InverseSlope::fYcm
double fYcm
Definition: InverseSlope.h:18
InverseSlope::fYmin
double fYmin
Definition: InverseSlope.h:18