Belle II Software  release-05-02-19
TestDBAccessAlgorithm.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 #include <calibration/CalibrationAlgorithm.h>
13 #include <framework/database/DBObjPtr.h>
14 #include <calibration/dbobjects/TestCalibMean.h>
15 
16 namespace Belle2 {
24  class TestDBAccessAlgorithm : public CalibrationAlgorithm {
25  public:
26 
29 
31  virtual ~TestDBAccessAlgorithm() {}
32  void setGeneratePayloads(const bool& value) {m_generatePayloads = value;}
33  bool getGeneratePayloads() const {return m_generatePayloads;}
34  void saveSameMeans();
35 
36  protected:
37 
39  virtual EResult calibrate() override;
40 
41  private:
43  void generateNewPayloads();
45  bool m_generatePayloads = true;
46  DBObjPtr<TestCalibMean> m_dbMean;
47  };
49 } // namespace Belle2
Belle2::TestDBAccessAlgorithm::~TestDBAccessAlgorithm
virtual ~TestDBAccessAlgorithm()
Destructor.
Definition: TestDBAccessAlgorithm.h:39
Belle2::TestDBAccessAlgorithm::calibrate
virtual EResult calibrate() override
Run algo on data.
Definition: TestDBAccessAlgorithm.cc:22
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::TestDBAccessAlgorithm::saveSameMeans
void saveSameMeans()
Saves the same DB values for each run into a new localdb, otherwise we aren't creating a DB this iter...
Definition: TestDBAccessAlgorithm.cc:79
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CalibrationAlgorithm::EResult
EResult
The result of calibration.
Definition: CalibrationAlgorithm.h:50
Belle2::TestDBAccessAlgorithm::getAverageDistanceFromAnswer
float getAverageDistanceFromAnswer()
Grabs DBObjects from the Database and finds out the average distance from 42.
Definition: TestDBAccessAlgorithm.cc:98
Belle2::TestDBAccessAlgorithm::reduceDistancesAndSave
void reduceDistancesAndSave()
Saves new DB values for each run where they are a little closer to 42.
Definition: TestDBAccessAlgorithm.cc:55
Belle2::TestDBAccessAlgorithm::TestDBAccessAlgorithm
TestDBAccessAlgorithm()
Constructor set the prefix to TestCalibration.
Definition: TestDBAccessAlgorithm.cc:12