14 #include <framework/logging/Logger.h>
28 class CDCDedxCosineEdge:
public TObject {
50 int getSize(
const int side)
const
54 }
else if (side > 0) {
57 B2ERROR(
"CDCDedxCosineEdge:choose >0 for forward and <0 for backward side");
67 double getMean(
int side,
unsigned int ibin)
const
70 std::vector<double> temp;
73 }
else if (side > 0) {
76 B2ERROR(
"CDCDedxCosineEdge:choose > 0 for forward and <0 for backward side");
80 if (ibin >= temp.size()) {
81 B2WARNING(
"CDCDedxADCNonLinearity:returning (1.0) uncorrected ADC as bin: " << ibin <<
" is not in range");
90 double getMean(
double costh)
const
92 double coslow = 0.0, coshigh = 0.0;
93 std::vector<double> temp;
96 coslow = -0.870; coshigh = -0.850;
97 }
else if (costh > 0) {
99 coslow = 0.950; coshigh = 0.960;
101 B2ERROR(
"CDCDedxCosineEdge:choose > 0 for forward and <0 for backward side");
106 if (costh < coslow || costh > coshigh) {
107 B2WARNING(
"CDCDedxCosineEdge:outside range (" << costh <<
")choose in between " << coslow <<
" and " << coshigh);
111 double bw = abs(coshigh - coslow) / temp.size();
112 unsigned int ibin = int((costh - coslow) / bw);
114 if (ibin >= temp.size()) {
115 B2WARNING(
"CDCDedxCosineEdge:no constants for bin ## " << ibin <<
" as it is not in range");
120 if (temp[ibin] <= 0.0)
return 1.0;
132 std::vector<double> temp;
133 double coslow = 0.0, coshigh = 0.0;
136 coslow = -0.870; coshigh = -0.850;
137 }
else if (side > 0) {
139 coslow = 0.950; coshigh = 0.960;
141 B2ERROR(
"CDCDedxCosineEdge:choose > 0 for forward and <0 for backward side");
145 if (ibin >= temp.size()) {
146 B2ERROR(
"CDCDedxCosineEdge:Problem with bin index: choose 0 and " << temp.size() - 1);
150 if (temp.size() == 0)
return -99.0;
151 double bw = abs(coshigh - coslow) / temp.size();
152 double bc = coslow + (0.5 + ibin) * bw;
153 std::cout <<
"Par # " << ibin <<
", costh bin centre = " << bc <<
", const =" << temp[ibin] << std::endl;
163 std::vector<double> temp;
164 double coslow = 0.0, coshigh = 0.0;
167 coslow = -0.870; coshigh = -0.850;
168 }
else if (side > 0) {
170 coslow = 0.950; coshigh = 0.960;
172 B2ERROR(
"CDCDedxCosineEdge:choose > 0 for forward and <0 for backward side");
176 if (temp.size() == 0)
return;
177 double bw = abs(coshigh - coslow) / temp.size();
178 B2INFO(
"Printing parameters (0=backward and 1=forward): " << side <<
", nPars = " << temp.size());
179 for (
unsigned int ibin = 0; ibin < temp.size(); ibin++) {
180 double bc = coslow + (0.5 + ibin) * bw;
181 std::cout <<
"Par # " << ibin <<
", costh bin centre = " << bc <<
", const = " << temp[ibin] << std::endl;
197 }
else if (side > 0) {
200 B2ERROR(
"CDCDedxCosineEdge:choose >0 for forward and <0 for backward side");
205 B2ERROR(
"CDCDedxCosineEdge:Problem with bin index: choose 0 and " <<
m_largeCos[iside].size() - 1);
210 std::cout <<
"Par # " << ibin <<
", const = " <<
m_largeCos[iside][ibin] << std::endl;