Class to hold the prediction of resolution depending dE/dx, nhit, and cos(theta)
More...
#include <CDCDedxSigmaPred.h>
|
| void | setParameters (std::string infile) |
| | set the parameters from file
|
| |
| void | setParameters () |
| | set the parameters
|
| |
| void | printParameters (std::string infile) |
| | write the parameters in file
|
| |
| double | getSigma (double dedx, double nhit, double cos, double timereso) |
| | Return the predicted resolution depending on dE/dx, nhit, and cos(theta)
|
| |
| double | nhitPrediction (double nhit) |
| | Return sigma from the nhit parameterization.
|
| |
| double | ionzPrediction (double dedx) |
| | Return sigma from the ionization parameterization.
|
| |
| double | cosPrediction (double cos) |
| | Return sigma from the cos parameterization.
|
| |
| double | getDedxPars (int i) |
| | get the dedx parameters
|
| |
| void | setDedxPars (int i, double val) |
| | set the dedx parameters
|
| |
| double | getNHitPars (int i) |
| | get the nhit parameters
|
| |
| void | setNHitPars (int i, double val) |
| | set the nhit parameters
|
| |
| double | getCosPars (int i) |
| | get the cos(theta) parameters
|
| |
| void | setCosPars (int i, double val) |
| | set the cos(theta) parameters
|
| |
Class to hold the prediction of resolution depending dE/dx, nhit, and cos(theta)
Definition at line 36 of file CDCDedxSigmaPred.h.
◆ cosPrediction()
| double cosPrediction |
( |
double | cos | ) |
|
Return sigma from the cos parameterization.
Definition at line 141 of file CDCDedxSigmaPred.cc.
142{
143
144 CDCDedxWidgetSigma gs;
145
146
147 double cospar[11];
148 cospar[0] = 3;
149 for (
int i = 0; i < 10; ++i) cospar[i + 1] =
m_cospars[i];
150
151
152 double x[1];
153 x[0] = cos;
154
155 double corCos;
156 corCos = gs.
sigmaCurve(x, std::vector<double>(cospar, cospar + 11));
157
158 return corCos;
159}
double m_cospars[10]
parameters for sigma vs.
◆ getCosPars()
| double getCosPars |
( |
int | i | ) |
|
|
inline |
get the cos(theta) parameters
Definition at line 98 of file CDCDedxSigmaPred.h.
98{ return m_cospars[i]; };
◆ getDedxPars()
| double getDedxPars |
( |
int | i | ) |
|
|
inline |
get the dedx parameters
Definition at line 78 of file CDCDedxSigmaPred.h.
78{ return m_dedxpars[i]; };
◆ getNHitPars()
| double getNHitPars |
( |
int | i | ) |
|
|
inline |
get the nhit parameters
Definition at line 88 of file CDCDedxSigmaPred.h.
88{ return m_nhitpars[i]; };
◆ getSigma()
| double getSigma |
( |
double | dedx, |
|
|
double | nhit, |
|
|
double | cos, |
|
|
double | timereso ) |
Return the predicted resolution depending on dE/dx, nhit, and cos(theta)
Definition at line 81 of file CDCDedxSigmaPred.cc.
82{
84 return correction;
85}
double ionzPrediction(double dedx)
Return sigma from the ionization parameterization.
double cosPrediction(double cos)
Return sigma from the cos parameterization.
double nhitPrediction(double nhit)
Return sigma from the nhit parameterization.
◆ ionzPrediction()
| double ionzPrediction |
( |
double | dedx | ) |
|
Return sigma from the ionization parameterization.
Definition at line 122 of file CDCDedxSigmaPred.cc.
123{
124
125 double dedxpar[3];
126 dedxpar[0] = 1;
127 for (
int i = 0; i < 2; ++i) dedxpar[i + 1] =
m_dedxpars[i];
128
129
130 CDCDedxWidgetSigma gs;
131
132
133 double x[1];
134 x[0] = dedx;
135
136 double corDedx = gs.
sigmaCurve(x, std::vector<double>(dedxpar, dedxpar + 3));
137
138 return corDedx;
139}
double m_dedxpars[2]
parameters for sigma vs.
◆ nhitPrediction()
| double nhitPrediction |
( |
double | nhit | ) |
|
Return sigma from the nhit parameterization.
Definition at line 88 of file CDCDedxSigmaPred.cc.
89{
90
91
92 int nhit_min = 8, nhit_max = 37;
93
94
95 double nhitpar[6];
96 nhitpar[0] = 2;
97 for (
int i = 0; i < 5; ++i) nhitpar[i + 1] =
m_nhitpars[i];
98
99
100 CDCDedxWidgetSigma gs;
101
102
103 double x[1];
104
105 x[0] = nhit;
106
107 double corNHit;
108
109 if (nhit < nhit_min) {
110 x[0] = nhit_min;
111 corNHit = gs.
sigmaCurve(x, std::vector<double>(nhitpar, nhitpar + 6)) * std::sqrt(nhit_min / nhit);
112 } else if (nhit > nhit_max) {
113 x[0] = nhit_max;
114 corNHit = gs.
sigmaCurve(x, std::vector<double>(nhitpar, nhitpar + 6)) * std::sqrt(nhit_max / nhit);
115 } else {
116 corNHit = gs.
sigmaCurve(x, std::vector<double>(nhitpar, nhitpar + 6));
117 }
118
119 return corNHit;
120}
double m_nhitpars[5]
parameters for sigma vs.
◆ printParameters()
| void printParameters |
( |
std::string | infile | ) |
|
write the parameters in file
Definition at line 60 of file CDCDedxSigmaPred.cc.
61{
62
63 B2INFO("\n\tCDCDedxSigmaPred: Printing parameters to file --> " << outfile.c_str());
64
65
66 std::ofstream fout(outfile.c_str());
67
68 for (
int i = 1; i < 3; ++i) fout << i <<
"\t" <<
m_dedxpars[i - 1] << std::endl;
69
70 fout << std::endl;
71 for (
int i = 3; i < 8; ++i) fout << i <<
"\t" <<
m_nhitpars[i - 3] << std::endl;
72
73 fout << std::endl;
74 for (
int i = 8; i < 18; ++i) fout << i <<
"\t" <<
m_cospars[i - 8] << std::endl;
75
76 fout << std::endl;
77
78 fout.close();
79}
◆ setCosPars()
| void setCosPars |
( |
int | i, |
|
|
double | val ) |
|
inline |
set the cos(theta) parameters
Definition at line 103 of file CDCDedxSigmaPred.h.
103{ m_cospars[i] = val; };
◆ setDedxPars()
| void setDedxPars |
( |
int | i, |
|
|
double | val ) |
|
inline |
set the dedx parameters
Definition at line 83 of file CDCDedxSigmaPred.h.
83{ m_dedxpars[i] = val; };
◆ setNHitPars()
| void setNHitPars |
( |
int | i, |
|
|
double | val ) |
|
inline |
set the nhit parameters
Definition at line 93 of file CDCDedxSigmaPred.h.
93{ m_nhitpars[i] = val; };
◆ setParameters() [1/2]
set the parameters
Definition at line 13 of file CDCDedxSigmaPred.cc.
14{
15
16
18 B2FATAL("No dE/dx sigma parameters!");
19
20 std::vector<double> sigmapar;
22 for (
int i = 0; i < 2; ++i)
m_dedxpars[i] = sigmapar[i];
23 for (
int i = 0; i < 5; ++i)
m_nhitpars[i] = sigmapar[i + 2];
24 for (
int i = 0; i < 10; ++i)
m_cospars[i] = sigmapar[i + 7];
25}
const DBObjPtr< CDCDedxSigmaPars > m_DBSigmaPars
db object for dE/dx resolution parameters
◆ setParameters() [2/2]
| void setParameters |
( |
std::string | infile | ) |
|
set the parameters from file
Definition at line 27 of file CDCDedxSigmaPred.cc.
28{
29
30 B2INFO("\n\tWidgetParameterization: Using parameters from file --> " << infile);
31
32 std::ifstream fin;
33 fin.open(infile.c_str());
34
35 if (!fin.good()) B2FATAL("\tWARNING: CANNOT FIND " << infile);
36
37 int par;
38
39 B2INFO("\t --> dedx parameters");
40 for (int i = 0; i < 2; ++i) {
43 }
44
45 B2INFO("\t --> nhit parameters");
46 for (int i = 0; i <= 4; ++i) {
49 }
50
51 B2INFO("\t --> cos parameters");
52 for (int i = 0; i < 10; ++i) {
54 B2INFO(
"\t\t (" << i <<
")" <<
m_cospars[i]);
55 }
56
57 fin.close();
58}
◆ m_cospars
◆ m_DBSigmaPars
◆ m_dedxpars
◆ m_nhitpars
The documentation for this class was generated from the following files: