14#include <fmt/format.h>
37 auto GetAddressName = [&](int32_t address) -> std::string {
41 return format(
"u{}_l{}_m{}", u, l, m);
44 auto GetAddressTitle = [&](int32_t address) -> std::string {
48 return format(
"U{} L{} M{}", u, l, m);
61 for (
int iM = 0; iM < nModules; ++iM) {
64 auto aName = GetAddressName(address);
65 auto aTitl = GetAddressTitle(address);
66 auto cName = format(
"sts_digi/sts_digi_vs_channel_charge_{}", aName);
67 auto cTitl = format(
"STS digis per channel and charge for module {}", aTitl);
70 auto pad = PadConfig();
71 auto name = format(
"sts_digi_{}_channel", aName);
72 auto titl = format(
"Number of digis per channel for module {};channel;N_{{digis}}", aTitl);
78 canv.AddPadConfig(pad);
81 auto pad = PadConfig();
82 auto name = format(
"sts_digi_{}_charge", aName);
83 auto titl = format(
"STS digi charge for mudule {};charge [ADS units];N_{{digis}}", aTitl);
86 canv.AddPadConfig(pad);
89 auto pad = PadConfig();
90 auto name = format(
"sts_digi_{}_channel_charge", aName);
91 auto titl = format(
"STS digi charge for module {};charge [ADS units];channel", aTitl);
94 canv.AddPadConfig(pad);
98 auto pad = PadConfig();
99 auto name = format(
"sts_digi_{}_channel_elink", aName);
100 auto titl = format(
"STS digi charge for module {};E-link;channel", aTitl);
103 canv.AddPadConfig(pad);
106 auto pad = PadConfig();
107 auto name = format(
"sts_digi_{}_channel_missed_evt", aName);
109 format(
"STS digi missed event ratio for module {};channel; N_{{w/ missed events}} / N_{{tot.}}", aTitl);
112 canv.AddPadConfig(pad);
115 auto pad = PadConfig();
116 auto name = format(
"sts_digi_{}_time_missed_evt", aName);
118 format(
"STS digi missed event ratio for module {};time [ms]; N_{{w/ missed events}} / N_{{tot.}}", aTitl);
119 constexpr double timeMin = 0.;
120 constexpr double timeMax = 150.;
121 int timeBins = std::ceil(timeMax - timeMin);
126 canv.AddPadConfig(pad);
146 for (
const auto& digi : (*
fpvDigis)) {
147 int32_t address = digi.GetAddress();
148 double channel = digi.GetChannel();
149 double charge = digi.GetCharge();
154 L_(error) << format(
"sts::DigiQa: found address {:x}, which is not defined in the ReadoutSetup config", address);
158 int iM = itHistID->second;
167 for (
const auto& auxDigi : ms.fQaDigis) {
168 int32_t address = auxDigi.address;
171 L_(error) << format(
"sts::DigiQa: found address {:x}, which is not defined in the ReadoutSetup config",
175 int iM = itHistID->second;
178 static_cast<double>(auxDigi.missedEvent));
QA module for STS raw digis (source)
A canvas configuration for the histogram server.
Class to handle QA-objects in the online reconstruction.
void AddCanvasConfig(const CanvasConfig &canvas)
Adds a canvas to the canvas config list.
void Send(std::shared_ptr< HistogramSender > histoSender)
Sends QA data to the HistogramSender.
void Init(std::shared_ptr< HistogramSender > histoSender)
Sends QA initialization information to the HistogramSender.
Obj * MakeObj(Args... args)
Creates a QA-object and returns the pointer to it.
A pad configuration for the histogram server.
QA module for STS raw digis.
std::vector< qa::H1D * > fvphAddressChannel
hist: digi channel in different sensors
std::vector< qa::Prof1D * > fvppAddressChannelMissedEvt
prof: missed event ratio vs. channel (AUX)
std::vector< qa::Prof1D * > fvppAddressTimeMissedEvt
prof: missed event ratio vs. time (AUX)
std::vector< qa::H2D * > fvphAddressChannelCharge
hist: digi channel vs. charge in different sensors
void Init()
Initializes QA (initialization of histograms and canvases)
void Exec()
Executes QA (filling histograms)
std::unordered_map< int32_t, int > fmAddressMap
Map of address to histogram index.
std::vector< qa::H2D * > fvphAddressChannelElink
hist: digi channel (vs. eling (AUX)
std::vector< qa::H1D * > fvphAddressCharge
hist: digi charge in different sensors
std::shared_ptr< ReadoutSetup > fpReadoutSetup
Readout config instance.
std::shared_ptr< HistogramSender > fpSender
Histogram sender.
const AuxData * fpAuxDigis
Aux information on digis.
const PODVector< Digi > * fpvDigis
Digis input.
bool fbAux
Extra distributions (if the auxiliary data should be used)
uint32_t GetElementId(int32_t address, int32_t level)
Get the index of an element.
EHistFlag
Histogram control flags (bit masks)