Belle II Software  release-08-01-10
TOPAlignmentAlgorithm::AlignData Struct Reference

data structure More...

Collaboration diagram for TOPAlignmentAlgorithm::AlignData:

Public Member Functions

void add (const AlignData &data)
 Merge another data structure to this one. More...
 
void finalize (double scaleFact)
 Calculate weighted averages and rescale errors. More...
 

Public Attributes

int iter = 0
 iteration counter
 
int ntrk = 0
 number of tracks used
 
std::vector< float > alignPars
 alignment parameters
 
std::vector< float > alignErrs
 uncertainties on alignment parameters
 
bool valid = false
 true if alignment parameters are valid
 

Detailed Description

data structure

Definition at line 52 of file TOPAlignmentAlgorithm.h.

Member Function Documentation

◆ add()

void add ( const AlignData data)

Merge another data structure to this one.

Implements weighted average (least square fit) of alignment parameters. Function finalize() must be called after all data structures are added.

Definition at line 342 of file TOPAlignmentAlgorithm.cc.

343  {
344  iter = std::max(iter, data.iter);
345  ntrk += data.ntrk;
346  if (not data.valid) return;
347 
348  for (size_t i = alignPars.size(); i < data.alignPars.size(); i++) {
349  alignPars.push_back(0);
350  alignErrs.push_back(0);
351  }
352 
353  for (size_t i = 0; i < data.alignPars.size(); i++) {
354  auto e = data.alignErrs[i];
355  if (e == 0) continue;
356  auto wt = 1 / (e * e);
357  alignPars[i] += data.alignPars[i] * wt ;
358  alignErrs[i] += wt ;
359  }
360  valid = true;
361  }
bool valid
true if alignment parameters are valid
std::vector< float > alignPars
alignment parameters
std::vector< float > alignErrs
uncertainties on alignment parameters

◆ finalize()

void finalize ( double  scaleFact)

Calculate weighted averages and rescale errors.

Parameters
scaleFactscale factor for errors

Definition at line 364 of file TOPAlignmentAlgorithm.cc.


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