Belle II Software development
UnknowSpline Struct Reference

Spline with uncertainty obtained from the boot-strap replicas. More...

Public Member Functions

void add (Spline spl)
 add boot-strap replica
 
Spline getMeanSigma ()
 Get mean and 1-sigma errors of the spline values.
 
Spline getLimit (double v)
 quantile of all points in spline, v=0.5 : median, v=0.16: lower 68% bound, v=0.84 : upper 68% bound
 

Public Attributes

std::vector< Splinespls
 vector with replicas
 

Detailed Description

Spline with uncertainty obtained from the boot-strap replicas.

Definition at line 151 of file BeamSpotStandAlone.cc.

Member Function Documentation

◆ add()

void add ( Spline  spl)
inline

add boot-strap replica

Definition at line 153 of file BeamSpotStandAlone.cc.

◆ getLimit()

Spline getLimit ( double  v)
inline

quantile of all points in spline, v=0.5 : median, v=0.16: lower 68% bound, v=0.84 : upper 68% bound

Definition at line 186 of file BeamSpotStandAlone.cc.

187 {
188 Spline sLim = spls[0];
189
190 double indx = (spls.size() - 1) * v;
191 int nNd = spls[0].vals.size();
192 for (int k = 0; k < nNd; ++k) {
193 std::vector<double> vals;
194 for (unsigned i = 0; i < spls.size(); ++i) {
195 vals.push_back(spls[i].vals[k]);
196 }
197 sort(vals.begin(), vals.end());
198
199 int I = indx;
200 double r = indx - I;
201 sLim.vals[k] = vals[I] * (1 - r) + vals[I + 1] * r;
202 sLim.errs[k] = 0;
203 }
204 return sLim;
205 }
std::vector< Spline > spls
vector with replicas

◆ getMeanSigma()

Spline getMeanSigma ( )
inline

Get mean and 1-sigma errors of the spline values.

Definition at line 156 of file BeamSpotStandAlone.cc.

157 {
158 Spline sAvg;
159 sAvg = spls[0];
160 int nNd = spls[0].vals.size();
161 for (int k = 0; k < nNd; ++k) {
162 double s = 0, ss = 0;
163 for (unsigned i = 0; i < spls.size(); ++i) {
164 s += spls[i].vals[k];
165 }
166 s /= spls.size();
167
168 for (unsigned i = 0; i < spls.size(); ++i) {
169 ss += pow(spls[i].vals[k] - s, 2);
170 }
171
172 if (spls.size() > 1)
173 ss = sqrt(ss / (spls.size() - 1));
174 else
175 ss = 0;
176
177 sAvg.vals[k] = s;
178 sAvg.errs[k] = ss;
179
180 }
181 return sAvg;
182 }
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

Member Data Documentation

◆ spls

std::vector<Spline> spls

vector with replicas

Definition at line 152 of file BeamSpotStandAlone.cc.


The documentation for this struct was generated from the following file: