Belle II Software development
TOPAlignmentAlgorithm.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10#include <calibration/CalibrationAlgorithm.h>
11#include <vector>
12#include <map>
13
14namespace Belle2 {
19 namespace TOP {
20
27 public:
28
31
36 void setSpatialPrecision(double precision) {m_spatialPrecision = precision;}
37
42 void setAngularPrecision(double precision) {m_angularPrecision = precision;}
43
44 private:
45
49 struct AlignData {
50 int iter = 0;
51 int ntrk = 0;
52 std::vector<float> alignPars;
53 std::vector<float> alignErrs;
54 bool valid = false;
60 void add(const AlignData& data);
65 void finalize(double scaleFact);
66 };
67
71 virtual EResult calibrate() final;
72
76 void mergeData();
77
78 // algorithm parameters
79 double m_spatialPrecision = 0.1;
80 double m_angularPrecision = 0.001;
81
82 // input tree variables
83 int m_moduleID = 0;
84 int m_iter = 0;
85 int m_ntrk = 0;
86 int m_errorCode = 0;
87 std::vector<float>* m_vAlignPars = 0;
88 std::vector<float>* m_vAlignParsErr = 0;
89 bool m_valid = false;
90 TBranch* m_bAlignPars = 0;
91 TBranch* m_bAlignParsErr = 0;
92
93 // maps of moduleID and AlignData
94 std::multimap<int, AlignData> m_inputData;
96
97 };
98
99 } // end namespace TOP
101} // end namespace Belle2
EResult
The result of calibration.
CalibrationAlgorithm(const std::string &collectorModuleName)
Constructor - sets the prefix for collected objects (won't be accesses until execute(....
void setAngularPrecision(double precision)
Sets required precision of rotation angles to declare calibration as c_OK.
std::vector< float > * m_vAlignPars
alignment parameters
double m_spatialPrecision
required precision of displacements
TBranch * m_bAlignParsErr
branch of error on alignment parameters
std::multimap< int, AlignData > m_inputData
input from ntuples
virtual EResult calibrate() final
algorithm implementation
double m_angularPrecision
required precision of rotation angles
std::vector< float > * m_vAlignParsErr
error on alignment parameters
TBranch * m_bAlignPars
branch of alignment parameters
bool m_valid
true if alignment parameters are valid
int m_errorCode
error code of the alignment procedure
void mergeData()
merge subsamples and rescale errors
std::map< int, AlignData > m_mergedData
merged subsamples
void setSpatialPrecision(double precision)
Sets required precision of displacements to declare calibration as c_OK.
STL class.
STL class.
Abstract base class for different kinds of events.
STL namespace.
void add(const AlignData &data)
Merge another data structure to this one.
bool valid
true if alignment parameters are valid
void finalize(double scaleFact)
Calculate weighted averages and rescale errors.
std::vector< float > alignPars
alignment parameters
std::vector< float > alignErrs
uncertainties on alignment parameters