Belle II Software development
SpotParam Struct Reference

structure containing most of the beam spot parameters More...

Public Member Functions

void print ()
 Print BeamSpot parameters.
 
 SpotParam (const std::vector< double > &vals, const std::vector< double > &errs, const std::vector< std::vector< double > > &spls, int order=0)
 Constructor based output of the linear regression, assuming zero-order splines vals, errors and vector with splines - are aggregated results of linear-regression Order of variables in the vals & errs vector is the following: xVals, yVals, kXvals, kYvals, zVals.
 

Public Attributes

Spline x
 spline for BS center position as a function of time (x coordinate)
 
Spline y
 spline for BS center position as a function of time (y coordinate)
 
Spline z
 spline for BS center position as a function of time (z coordinate)
 
Spline kX
 spline for BS angle in the xz plane as a function of time
 
Spline kY
 spline for BS angle in the yz plane as a function of time
 

Detailed Description

structure containing most of the beam spot parameters

Definition at line 70 of file BeamSpotStandAlone.cc.

Constructor & Destructor Documentation

◆ SpotParam() [1/2]

SpotParam ( )
inline

Definition at line 77 of file BeamSpotStandAlone.cc.

77{}

◆ SpotParam() [2/2]

SpotParam ( const std::vector< double > &  vals,
const std::vector< double > &  errs,
const std::vector< std::vector< double > > &  spls,
int  order = 0 
)
inline

Constructor based output of the linear regression, assuming zero-order splines vals, errors and vector with splines - are aggregated results of linear-regression Order of variables in the vals & errs vector is the following: xVals, yVals, kXvals, kYvals, zVals.

Definition at line 98 of file BeamSpotStandAlone.cc.

100 {
101 auto getSize = [order](const std::vector<double>& sp) {
102 if (sp.size() == 0)
103 return 1;
104 else {
105 if (order == 0) {
106 B2ASSERT("There must be least one node at this place", sp.size() >= 1);
107 return int(sp.size() + 1);
108 } else if (order == 1) {
109 B2ASSERT("Must be at least two nodes in lin. spline", sp.size() >= 2);
110 return int(sp.size());
111 } else {
112 B2FATAL("Unknown order");
113 }
114 }
115 };
116
117 int nx = getSize(spls[0]);
118 int ny = getSize(spls[1]);
119 x.nodes = spls[0];
120 y.nodes = spls[1];
121 x.vals = slice(vals, 0, nx);
122 y.vals = slice(vals, nx, ny);
123 x.errs = slice(errs, 0, nx);
124 y.errs = slice(errs, nx, ny);
125
126 if (spls.size() >= 4) {
127 int nkx = getSize(spls[2]);
128 int nky = getSize(spls[3]);
129 kX.nodes = spls[2];
130 kY.nodes = spls[3];
131 kX.vals = slice(vals, nx + ny, nkx);
132 kY.vals = slice(vals, nx + ny + nkx, nky);
133
134 kX.errs = slice(errs, nx + ny, nkx);
135 kY.errs = slice(errs, nx + ny + nkx, nky);
136
137 if (spls.size() >= 5) {
138 int nz = getSize(spls[4]);
139 z.nodes = spls[4];
140 z.vals = slice(vals, nx + ny + nkx + nky, nz);
141 z.errs = slice(errs, nx + ny + nkx + nky, nz);
142 }
143 }
144 }
std::vector< Atom > slice(std::vector< Atom > vec, int s, int e)
Slice the vector to contain only elements with indexes s .. e (included)
Definition: Splitter.h:85
Spline z
spline for BS center position as a function of time (z coordinate)
Spline x
spline for BS center position as a function of time (x coordinate)
Spline kX
spline for BS angle in the xz plane as a function of time
Spline kY
spline for BS angle in the yz plane as a function of time
Spline y
spline for BS center position as a function of time (y coordinate)
std::vector< double > nodes
vector of spline nodes
Definition: tools.h:166
std::vector< double > errs
vector of spline errors
Definition: tools.h:168
std::vector< double > vals
vector of spline values
Definition: tools.h:167

Member Function Documentation

◆ print()

void print ( )
inline

Print BeamSpot parameters.

Definition at line 80 of file BeamSpotStandAlone.cc.

81 {
82 B2INFO("x");
83 x.print();
84 B2INFO("y");
85 y.print();
86 B2INFO("z");
87 z.print();
88 B2INFO("kX");
89 kX.print();
90 B2INFO("kY");
91 kY.print();
92 }
void print(TString tag="")
print the spline
Definition: tools.h:188

Member Data Documentation

◆ kX

Spline kX

spline for BS angle in the xz plane as a function of time

Definition at line 74 of file BeamSpotStandAlone.cc.

◆ kY

Spline kY

spline for BS angle in the yz plane as a function of time

Definition at line 75 of file BeamSpotStandAlone.cc.

◆ x

Spline x

spline for BS center position as a function of time (x coordinate)

Definition at line 71 of file BeamSpotStandAlone.cc.

◆ y

Spline y

spline for BS center position as a function of time (y coordinate)

Definition at line 72 of file BeamSpotStandAlone.cc.

◆ z

Spline z

spline for BS center position as a function of time (z coordinate)

Definition at line 73 of file BeamSpotStandAlone.cc.


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