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
34
39 void setSpatialPrecision(double precision) {m_spatialPrecision = precision;}
40
45 void setAngularPrecision(double precision) {m_angularPrecision = precision;}
46
47 private:
48
52 struct AlignData {
53 int iter = 0;
54 int ntrk = 0;
55 std::vector<float> alignPars;
56 std::vector<float> alignErrs;
57 bool valid = false;
63 void add(const AlignData& data);
68 void finalize(double scaleFact);
69 };
70
74 virtual EResult calibrate() final;
75
79 void mergeData();
80
81 // algorithm parameters
82 double m_spatialPrecision = 0.1;
83 double m_angularPrecision = 0.001;
84
85 // input tree variables
86 int m_moduleID = 0;
87 int m_iter = 0;
88 int m_ntrk = 0;
89 int m_errorCode = 0;
90 std::vector<float>* m_vAlignPars = 0;
91 std::vector<float>* m_vAlignParsErr = 0;
92 bool m_valid = false;
93 TBranch* m_bAlignPars = 0;
94 TBranch* m_bAlignParsErr = 0;
95
96 // maps of moduleID and AlignData
97 std::multimap<int, AlignData> m_inputData;
99
100 };
101
102 } // end namespace TOP
104} // 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