Belle II Software  release-08-01-10
ECLLocalRunCalibUnit.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 #pragma once
9 
10 #include <string>
11 #include <vector>
12 #include <ecl/modules/eclLocalRunCalibration/ECLLocalRunCalibAcc.h>
13 #include <framework/database/IntervalOfValidity.h>
14 #include <ecl/utility/ECLDBTool.h>
15 
16 namespace Belle2 {
28  public:
36  ECLLocalRunCalibUnit(const int& ncellids,
37  const float& min_value,
38  const float& max_value,
39  const int* const ndevs);
51  void add(const int& cellid, const float& value);
55  void calc();
67  void writeToDB(
68  bool isLocal,
69  const std::string& dbName,
70  const std::string& payloadName,
71  const IntervalOfValidity& iov,
72  const int& run,
73  const bool& changePrev,
74  const bool& addref);
81  void enableNegAmpl();
87  bool isNegAmpl() const;
88  private:
103  void markAsRefference(const bool& isLocal,
104  const std::string& dbName,
105  const int& run,
106  const IntervalOfValidity& iov);
112  void changePreviousIoV(const ECLDBTool& payload,
113  const IntervalOfValidity& iov);
118  std::vector<ECLLocalRunCalibAcc> m_unitData;
124  template <typename T>
125  void callAccGetter(
126  std::vector<T>* vec,
127  T(ECLLocalRunCalibAcc::*getter)() const);
128  };
130 } // Belle2
131 
The ECLDBTool class is designed to read / write object from / to database.
Definition: ECLDBTool.h:23
ECLLocalRunCalibAcc is the class designed to accumulate mean values, standard deviation and number of...
ECLLocalRunCalibUnit is the class designed for the control of mean value and the standard deviation a...
void calc()
Calculate accumulated values.
std::vector< ECLLocalRunCalibAcc > m_unitData
Mean value and standard deviation accumulators for each cell id.
void callAccGetter(std::vector< T > *vec, T(ECLLocalRunCalibAcc::*getter)() const)
Getter of accumulated values.
ECLLocalRunCalibUnit(const int &ncellids, const float &min_value, const float &max_value, const int *const ndevs)
Constructor.
void markAsRefference(const bool &isLocal, const std::string &dbName, const int &run, const IntervalOfValidity &iov)
Mark current run as reference.
void enableNegAmpl()
This function will be called only in the case, if negative amplitudes are observed in the current run...
void changePreviousIoV(const ECLDBTool &payload, const IntervalOfValidity &iov)
Change previous validity interval.
bool m_isNegAmpl
m_isNegAmpl is true if there are negative amplitudes in the current run and false otherwise.
void writeToDB(bool isLocal, const std::string &dbName, const std::string &payloadName, const IntervalOfValidity &iov, const int &run, const bool &changePrev, const bool &addref)
Write calibration results into a database.
bool isNegAmpl() const
Check presence of negative amplitudes in the current run.
void add(const int &cellid, const float &value)
Add value to accumulate mean value, standard deviation and number of accepted events.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Abstract base class for different kinds of events.