Belle II Software development
ECLLocalRunCalibratorModule.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/* ECL headers. */
11#include <ecl/dataobjects/ECLDigit.h>
12#include <ecl/modules/eclLocalRunCalibration/ECLLocalRunCalibUnit.h>
13
14/* Basf2 headers. */
15#include <framework/core/Module.h>
16#include <framework/dataobjects/EventMetaData.h>
17#include <framework/datastore/StoreArray.h>
18#include <framework/datastore/StoreObjPtr.h>
19
20/* ROOT headers. */
21#include <TH1F.h>
22#include <TTree.h>
23
24/* C++ headers. */
25#include <cstdint>
26#include <string>
27
28namespace Belle2 {
39 public:
51 void beginRun() override;
55 void event() override;
59 void endRun() override;
60 private:
65 int16_t getTimeShift(const ECLDigit& digit) const;
70 inline uint32_t decodeTrigTime(uint32_t time) const;
74 static const int c_ncellids;
98 std::string m_histoFileName;
125 std::string m_dbName;
159 TH1F* m_histo_time{nullptr};
168 TH1F* m_histo_ampl{nullptr};
172 static const std::string c_timePayloadName;
176 static const std::string c_amplPayloadName;
215 TTree* m_tree{nullptr};
225 float m_tree_time{0};
230 float m_tree_ampl{0};
241 void writeHistoToFile();
247 };
249} // namespace Belle2
250
Class to store ECL digitized hits (output of ECLDigi) relation to ECLHit filled in ecl/modules/eclDig...
Definition: ECLDigit.h:24
ECLLocalRunCalibUnit is the class designed for the control of mean value and the standard deviation a...
ECLLocalRunCalibratorModule is the module developed to perform ECL local run calibration.
std::string m_dbName
Tag of central database or path to a local database.
float m_tree_ampl
Amplitude variable used to fill tree.
bool m_isFillHisto
If m_isFillHisto is false, than the mode of local run calibration is enabled.
bool m_isLocal
Enables local database usage.
TTree * m_tree
Full tree of times and amplitudes per each cellid before calculating mean values.
float m_tree_time
Time variable used to fill tree.
static const std::string c_amplPayloadName
Name of the amplitude payload.
static const std::string c_timePayloadName
Name of the time payload.
bool m_addref
If m_addref is true, then the current calibration run will be marked as reference run immediately aft...
float m_maxAmpl
Maximum allowed amplitude value.
float m_minTime
Minimum allowed time value.
StoreArray< ECLDigit > m_ECLDigits
ECL digits.
int m_tree_event
Event variable used to fill tree.
int m_tree_cellid
Cellid variable used to fill tree.
ECLLocalRunCalibUnit * m_ampl
m_ampl contains amplitude mean value and standard deviation accumulators for all cell ids.
TH1F * m_histo_ampl
m_histo_ampl is the name of the histogram, which contains amplitude distribution for a certain cell i...
bool m_fulltree
Write full tree of times and amplitudes per each cellid (before calculating mean values) to file "ecl...
ECLLocalRunCalibUnit * m_time
m_time contains time mean value and standard deviation accumulators for all cell ids.
uint32_t decodeTrigTime(uint32_t time) const
Decode time.
float m_maxTime
Maximum allowed time value.
static const int c_ncellids
Number of cell ids.
std::string m_histoFileName
The path of the .root file with the histograms obtained in the histogram filling mode.
bool m_changePrev
If m_changePrev is true, the validity intervals of the previous payloads stored into the database wil...
int m_highRun
High run of the validity interval.
int m_lowRun
Low run of the validity interval.
void writeHistoToFile()
Write histograms to file in the case, if the histogram filling mode is enabled.
TH1F * m_histo_time
m_histo_time is the name of the histogram, which contains time distribution for a certain cell id.
void writeCalibResultsToDB()
Write calibration results into a database.
StoreObjPtr< EventMetaData > m_EventMetaData
Event metadata.
float m_minAmpl
Minimum allowed amplitude value.
int m_devs
Number of standard deviations used to update value limits.
int16_t getTimeShift(const ECLDigit &digit) const
Calculate time shift.
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.