17#include <fmt/format.h>
32 throw std::runtime_error(
"parameters were not initialized. Please, provide the configuration using the function "
33 "HitfindQa::InitParameters(calSetup, hitSetup)");
41 for (
size_t iD = 0; iD < nDiamonds; ++iD) {
43 int nCh = diamondPar.nChannels;
44 auto sDN = format(
"_diamond_{:#08x}", diamondPar.address);
49 format(
"bmon_digi_occup_channel{}", sDN),
50 format(
"BMON-{} digi occupancy vs. channel;channel;counts", iD),
51 nCh, -0.5, nCh - 0.5);
53 format(
"bmon_digi_charge_channel{}", sDN),
54 format(
"BMON-{} digi charge vs. channel;channel;charge;counts", iD),
57 format(
"bmon_hit_nChannels{}", sDN),
58 format(
"BMON-{} hit number of channels;N_{{chan}};counts", iD),
61 format(
"bmon_hit_time_diff{}", sDN),
62 format(
"BMON-{} digi time difference in a hit formed from two digis;#Delta t_{{digi}} [ns];counts", iD),
67 auto cName = format(
"{}/bmon{}",
GetTaskName(), sDN);
68 auto cTitl = format(
"BMON-{}", iD);
77catch (
const std::exception& err) {
78 L_(fatal) <<
"bmon::HitfindQa: initialization failed. Reason: " << err.what();
79 throw std::runtime_error(
"bmon::HitfindQa initialization failure");
91 for (
const auto& digi : *
fpDigis) {
93 int32_t chan = digi.GetChannel();
100 for (
size_t iH = 0; iH <
hits.size(); ++iH) {
101 const auto& hit =
hits[iH];
103 int nChannels = hit.GetNofChannels();
105 if (nChannels == 2) {
106 int32_t iDigi = (*fpDigiIndices)[iH];
107 const auto& digiF = (*fpDigis)[iDigi];
108 const auto& digiS = (*fpDigis)[iDigi + 1];
static vector< vector< QAHit > > hits
ROOT-free implementation of a histogram.
A QA module for the BMON hit-finder.
std::vector< qa::H1D * > fvphHitNofChan
Hit number of channels [diamond].
const std::vector< CbmBmonDigi > * fpDigis
Pointer to BMON digi sample.
static constexpr double kDtimeU
digi time difference: upper bound [ns]
std::vector< qa::H1D * > fvphHitTimeDiff
Time difference of two digis in a hit [diamond].
std::vector< qa::H1D * > fvphDigiOccupVsChan
Digi occupancy vs. channel [diamond].
void Exec()
Executes the task, fills the histograms.
static constexpr double kChrgU
charge scale: upper bound
static constexpr int kChrgB
charge scale: number of bins
const PartitionedVector< bmon::Hit > * fpHits
Pointer to BMON hit sample.
std::vector< qa::H2D * > fvphDigiChargeVsChan
Digi charge vs channel [diamond].
static constexpr double kChrgL
charge scale: lower bound
static constexpr double kDtimeL
digi time difference: lower bound [ns]
static constexpr int kDtimeB
digi time difference: number of bins
HitfindQaParameters fParameters
Parameters of the hit finder QA.
void Init()
Initialized the task.
A canvas configuration for the histogram server.
A pad configuration for the histogram server.
size_t GetDiamondIndex(uint32_t address) const
Returns an index of the diamond by the address.
std::vector< Diamond > diamonds