CbmRoot
InverseSlope.h
Go to the documentation of this file.
1 #ifndef INVERSESLOPE_H
2 #define INVERSESLOPE_H
3 
4 //#include <cmath>
5 #include "TMath.h"
6 #include "TSpline.h"
7 #include "common/Acceptance.h"
8 #include <iostream>
9 //#include <omp.h>
10 
11 
12 class InverseSlope {
13  std::vector<double> xlag32, wlag32;
14  std::vector<double> xleg32, wleg32;
15  double fMass;
16  int fPDGID;
18  double fYmin, fYmax, fYcm, fWidth;
19  // double fNorm;
21  fAcceptance; //fAcceptanceSTS, fAcceptanceSTSTOF;
23  TSpline3 fTamt;
24  TSpline3 fNormT, fNormT4pi;
25 
26 public:
27  InverseSlope(double mass = 0.938,
28  int PDGID = 2212,
29  bool fUseAcc = false,
30  double ymin = -3.,
31  double ymax = 3.,
32  double ycm = 2.,
33  double width = 1.);
34 
35  virtual ~InverseSlope(void) {}
36 
37  double GetT(double amt) {
38  if (!fUseAcceptance)
39  return 1. / 4.
40  * (amt - 2. * fMass
41  + TMath::Sqrt((amt + 2 * fMass) * (amt + 2 * fMass)
42  - 8. * fMass * fMass));
43  else {
44  return fTamt.Eval(amt);
45  }
46  }
47 
48  double GetA(double multiplicity, double T) {
49  if (!fUseAcceptance)
50  return multiplicity;
51  else
52  return multiplicity * fNormT4pi.Eval(T) / fNormT.Eval(T);
53  }
54 
55  double GetAerror(double multiplicity, double T, double multerr, double Terr) {
56  if (!fUseAcceptance)
57  return multerr;
58  else
59  return TMath::Sqrt(
60  fNormT4pi.Eval(T) / fNormT.Eval(T) * fNormT4pi.Eval(T) / fNormT.Eval(T)
61  * multerr * multerr
62  + multiplicity * multiplicity / fNormT.Eval(T) / fNormT.Eval(T)
63  * fNormT4pi.Derivative(T) * fNormT4pi.Derivative(T) * Terr * Terr
64  + multiplicity * multiplicity / fNormT.Eval(T) / fNormT.Eval(T)
65  / fNormT.Eval(T) / fNormT.Eval(T) * fNormT4pi.Eval(T)
66  * fNormT4pi.Eval(T) * fNormT.Derivative(T) * fNormT.Derivative(T)
67  * Terr * Terr);
68  }
69 
70  double fmt(double amt, double T);
71 
72  double dTdmt(double amt) {
73  if (!fUseAcceptance)
74  return 1. / 4.
75  * (1.
76  + (amt + 2. * fMass)
77  / TMath::Sqrt((amt + 2. * fMass) * (amt + 2. * fMass)
78  - 8. * fMass * fMass));
79  else
80  return fTamt.Derivative(amt);
81  }
82 
83  double mtAv(double T);
84  double mtAv2(double T);
85  double Normalization(double T);
86  double Normalization4pi(double T);
87 };
88 
89 #endif
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
InverseSlope::~InverseSlope
virtual ~InverseSlope(void)
Definition: InverseSlope.h:35
InverseSlope::GetT
double GetT(double amt)
Definition: InverseSlope.h:37
InverseSlope::fNormT
TSpline3 fNormT
Definition: InverseSlope.h:24
InverseSlope::fTamt
TSpline3 fTamt
Definition: InverseSlope.h:23
InverseSlope::xlag32
std::vector< double > xlag32
Definition: InverseSlope.h:13
InverseSlope::Normalization
double Normalization(double T)
Definition: InverseSlope.cxx:130
Acceptance::AcceptanceFunction
Definition: Acceptance.h:10
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
InverseSlope::dTdmt
double dTdmt(double amt)
Definition: InverseSlope.h:72
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::GetA
double GetA(double multiplicity, double T)
Definition: InverseSlope.h:48
Acceptance.h
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
InverseSlope::GetAerror
double GetAerror(double multiplicity, double T, double multerr, double Terr)
Definition: InverseSlope.h:55
InverseSlope::wleg32
std::vector< double > wleg32
Definition: InverseSlope.h:14
InverseSlope
Definition: InverseSlope.h:12
InverseSlope::fYcm
double fYcm
Definition: InverseSlope.h:18
InverseSlope::fYmin
double fYmin
Definition: InverseSlope.h:18