Belle II Software development
MillepedeAlgorithm.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
11#include <alignment/dataobjects/PedeSteering.h>
12#include <alignment/GlobalTimeLine.h>
13#include <alignment/PedeResult.h>
14#include <alignment/PedeApplication.h>
15#include <calibration/CalibrationAlgorithm.h>
16
17namespace Belle2 {
26 public:
27
30
33
36
39
42
44 void invertSign(bool use_subtraction = true) {m_invertSign = use_subtraction;}
45
47 void setComponents(const std::vector<std::string>& components) {m_components = components;}
48
50 void ignoreUndeterminedParams(bool ignore = true) {m_ignoreUndeterminedParams = ignore;}
51
54 void setEvents(const std::vector<EventMetaData>& events) {m_events = events;}
55
58 void setMinEntries(int minEntries) {m_minEntries = minEntries;}
59
77 void setTimedepConfig(PyObject* config) {setEvents(alignment::timeline::setupTimedepGlobalLabels(config));}
78
98 void setTimedepConfig(std::vector< std::tuple< std::vector<int>, std::vector< std::tuple<int, int, int> > > >& config)
99 {
100 setEvents(alignment::timeline::setupTimedepGlobalLabels(config));
101 }
102
103 protected:
104
106 virtual EResult calibrate() override;
107
108 private:
110 std::vector<std::string> m_components{};
112 bool m_invertSign{false};
114 PedeSteering m_steering{"PedeSteering.txt"};
123 std::vector<EventMetaData> m_events{};
124
126 void prepareMilleBinary();
127
129 int m_minEntries{ -1};
130
131 };
133} // namespace Belle2
134
135
Base class for calibration algorithms.
EResult
The result of calibration.
Class implementing Millepede calibration algorithm.
void prepareMilleBinary()
Write out binary files from data in tree with GBL data to be used by Millepede and add them to steeri...
int m_minEntries
Minimum entries collected - report NotEnoughData for less.
void setEvents(const std::vector< EventMetaData > &events)
Set the events at which payloads can change for time-dep calibration (translation from time IDs (aka ...
void setMinEntries(int minEntries)
Set minimum entries - for less algo will not run, but report NotEnoughData.
std::vector< std::string > m_components
Components (BeamSpot...) to calibrate or empty for all available in data.
std::vector< EventMetaData > m_events
The events at which payloads can change for time-dep calibration (translation from time IDs (aka cont...
bool m_invertSign
Add (true) or subtract (false) corrections?
MillepedeAlgorithm()
Constructor set the prefix to MillepedeCalibration.
alignment::PedeResult & result()
Get the result (invalid until executed) to get parameters etc.
alignment::PedeApplication & pede()
Get the Pede application (for status etc.)
void invertSign(bool use_subtraction=true)
Add (false) or subtract (true) corrections to previous values?
void ignoreUndeterminedParams(bool ignore=true)
Report failure(false) or success (true) even if some parameters could not be determined.
void setTimedepConfig(std::vector< std::tuple< std::vector< int >, std::vector< std::tuple< int, int, int > > > > &config)
Setup the complete time dependence of parameters at once (ensures consistency) (C++ version)
alignment::PedeApplication m_pede
The Pede application (unsuccesfull until execution)
PedeSteering & steering()
Get the steering to set commands etc.
void setTimedepConfig(PyObject *config)
Setup the complete time dependence of parameters at once (ensures consistency) (Python version)
virtual ~MillepedeAlgorithm()
Destructor.
void setComponents(const std::vector< std::string > &components)
Set components (BeamSpot...) to calibrate or empty for all available in data.
virtual EResult calibrate() override
Run algo on data.
alignment::PedeResult m_result
The result (invalid until execution)
bool m_ignoreUndeterminedParams
Report failure(false) or success (true) even if some parameters could not be determined.
PedeSteering m_steering
The steering with commands.
Class representing Millepede steering.
Definition: PedeSteering.h:23
Class interfacing Millepede solver (Pede)
Class to process Pede result file(s)
Definition: PedeResult.h:22
Abstract base class for different kinds of events.