Belle II Software  release-05-02-19
MillepedeAlgorithm.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Tadeas Bilka *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <alignment/dataobjects/PedeSteering.h>
14 #include <alignment/GlobalTimeLine.h>
15 #include <alignment/PedeResult.h>
16 #include <alignment/PedeApplication.h>
17 #include <calibration/CalibrationAlgorithm.h>
18 
19 namespace Belle2 {
28  public:
29 
32 
34  virtual ~MillepedeAlgorithm() {}
35 
37  PedeSteering& steering() {return m_steering;}
38 
41 
43  alignment::PedeApplication& pede() {return m_pede;}
44 
46  void invertSign(bool use_subtraction = true) {m_invertSign = use_subtraction;}
47 
49  void setComponents(const std::vector<std::string>& components) {m_components = components;}
50 
52  void ignoreUndeterminedParams(bool ignore = true) {m_ignoreUndeterminedParams = ignore;}
53 
56  void setEvents(const std::vector<EventMetaData>& events) {m_events = events;}
57 
60  void setMinEntries(int minEntries) {m_minEntries = minEntries;}
61 
79  void setTimedepConfig(PyObject* config) {setEvents(alignment::timeline::setupTimedepGlobalLabels(config));}
80 
100  void setTimedepConfig(std::vector< std::tuple< std::vector<int>, std::vector< std::tuple<int, int, int> > > >& config)
101  {
102  setEvents(alignment::timeline::setupTimedepGlobalLabels(config));
103  }
104 
105  protected:
106 
108  virtual EResult calibrate() override;
109 
110  private:
112  std::vector<std::string> m_components{};
114  bool m_invertSign{false};
116  PedeSteering m_steering{"PedeSteering.txt"};
118  alignment::PedeResult m_result{};
125  std::vector<EventMetaData> m_events{};
126 
129 
131  int m_minEntries{ -1};
132 
133  };
135 } // namespace Belle2
136 
137 
Belle2::MillepedeAlgorithm
Class implementing Millepede calibration algorithm.
Definition: MillepedeAlgorithm.h:35
Belle2::MillepedeAlgorithm::m_pede
alignment::PedeApplication m_pede
The Pede application (unsuccesfull until execution)
Definition: MillepedeAlgorithm.h:128
Belle2::MillepedeAlgorithm::setEvents
void setEvents(const std::vector< EventMetaData > &events)
Set the events at which payloads can change for time-dep calibration (translation from time IDs (aka ...
Definition: MillepedeAlgorithm.h:64
Belle2::MillepedeAlgorithm::setMinEntries
void setMinEntries(int minEntries)
Set minimum entries - for less algo will not run, but report NotEnoughData.
Definition: MillepedeAlgorithm.h:68
Belle2::MillepedeAlgorithm::m_minEntries
int m_minEntries
Minimum entries collected - report NotEnoughData for less.
Definition: MillepedeAlgorithm.h:139
Belle2::MillepedeAlgorithm::~MillepedeAlgorithm
virtual ~MillepedeAlgorithm()
Destructor.
Definition: MillepedeAlgorithm.h:42
Belle2::MillepedeAlgorithm::setComponents
void setComponents(const std::vector< std::string > &components)
Set components (BeamSpot...) to calibrate or empty for all available in data.
Definition: MillepedeAlgorithm.h:57
Belle2::MillepedeAlgorithm::m_invertSign
bool m_invertSign
Add (true) or subtract (false) corrections?
Definition: MillepedeAlgorithm.h:122
Belle2::MillepedeAlgorithm::m_events
std::vector< EventMetaData > m_events
The events at which payloads can change for time-dep calibration (translation from time IDs (aka cont...
Definition: MillepedeAlgorithm.h:133
Belle2::MillepedeAlgorithm::invertSign
void invertSign(bool use_subtraction=true)
Add (false) or subtract (true) corrections to previous values?
Definition: MillepedeAlgorithm.h:54
Belle2::MillepedeAlgorithm::MillepedeAlgorithm
MillepedeAlgorithm()
Constructor set the prefix to MillepedeCalibration.
Definition: MillepedeAlgorithm.cc:21
Belle2::MillepedeAlgorithm::m_result
alignment::PedeResult m_result
The result (invalid until execution)
Definition: MillepedeAlgorithm.h:126
Belle2::MillepedeAlgorithm::calibrate
virtual EResult calibrate() override
Run algo on data.
Definition: MillepedeAlgorithm.cc:26
Belle2::MillepedeAlgorithm::result
alignment::PedeResult & result()
Get the result (invalid until executed) to get parameters etc.
Definition: MillepedeAlgorithm.h:48
Belle2::MillepedeAlgorithm::m_steering
PedeSteering m_steering
The steering with commands.
Definition: MillepedeAlgorithm.h:124
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PedeSteering
Class representing Millepede steering.
Definition: PedeSteering.h:16
Belle2::alignment::PedeResult
Class to process Pede result file(s)
Definition: PedeResult.h:32
Belle2::MillepedeAlgorithm::ignoreUndeterminedParams
void ignoreUndeterminedParams(bool ignore=true)
Report failure(false) or success (true) even if some parameters could not be determined.
Definition: MillepedeAlgorithm.h:60
Belle2::MillepedeAlgorithm::prepareMilleBinary
void prepareMilleBinary()
Write out binary files from data in tree with GBL data to be used by Millepede and add them to steeri...
Definition: MillepedeAlgorithm.cc:259
Belle2::alignment::PedeApplication
Class interfacing Millepede solver (Pede)
Definition: PedeApplication.h:33
Belle2::MillepedeAlgorithm::setTimedepConfig
void setTimedepConfig(PyObject *config)
Setup the complete time dependence of parameters at once (ensures consistency) (Python version)
Definition: MillepedeAlgorithm.h:87
Belle2::CalibrationAlgorithm::EResult
EResult
The result of calibration.
Definition: CalibrationAlgorithm.h:50
Belle2::MillepedeAlgorithm::steering
PedeSteering & steering()
Get the steering to set commands etc.
Definition: MillepedeAlgorithm.h:45
Belle2::MillepedeAlgorithm::m_ignoreUndeterminedParams
bool m_ignoreUndeterminedParams
Report failure(false) or success (true) even if some parameters could not be determined.
Definition: MillepedeAlgorithm.h:130
Belle2::MillepedeAlgorithm::m_components
std::vector< std::string > m_components
Components (BeamSpot...) to calibrate or empty for all available in data.
Definition: MillepedeAlgorithm.h:120
Belle2::CalibrationAlgorithm
Base class for calibration algorithms.
Definition: CalibrationAlgorithm.h:47
Belle2::MillepedeAlgorithm::pede
alignment::PedeApplication & pede()
Get the Pede application (for status etc.)
Definition: MillepedeAlgorithm.h:51