CbmRoot
Loading...
Searching...
No Matches
bmon/Calibrate.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "CbmBmonDigi.h"
13#include "PartitionedVector.h"
14#include "bmon/CalibrateSetup.h"
15#include "tof/Calibrate.h" // for the monitor data
16
17#include <gsl/span>
18#include <optional>
19#include <sstream>
20#include <vector>
21
22#include <xpu/host.h>
23
25{
26 // NOTE: reusing TOF monitor
28
31 class Calibrate {
32 public:
33 using resultType = std::tuple<std::vector<CbmBmonDigi>, CalibrateMonitorData>;
34
37 explicit Calibrate(CalibrateSetup params);
38
41 resultType operator()(gsl::span<const CbmBmonDigi> digiIn);
42
43 private:
46 size_t GetDiamondIndex(uint32_t address) const
47 {
48 return ((fSetup.selectionMask & address) >> fSelectionBitsOffset);
49 }
50
52 std::vector<size_t> fChannelOffset;
53 std::vector<double> fChannelDeadTime;
55 };
56} // namespace cbm::algo::bmon
Configuration of the calibrator for the BMON digis.
Algorithm to calibrate BMon digis.
CalibrateSetup fSetup
Parameters of calibrator.
Calibrate(CalibrateSetup params)
Constructor.
std::vector< double > fChannelDeadTime
Dead time, stored for a channel.
resultType operator()(gsl::span< const CbmBmonDigi > digiIn)
Calibrates a portion of digis.
std::tuple< std::vector< CbmBmonDigi >, CalibrateMonitorData > resultType
size_t GetDiamondIndex(uint32_t address) const
Returns an index of the diamond by the address.
uint32_t fSelectionBitsOffset
Number of bits to ther right from the first bit in the selection mask.
std::vector< size_t > fChannelOffset
Channel offset: offset for the channel index of each diamond.
BMON calibration per channel.
Monitoring data for calibration.