16#include <fmt/format.h>
33 throw std::runtime_error(
"parameters were not initialized. Please, provide the configuration using the function "
34 "HitfindQa::InitParameters(hitSetup)");
44 auto cOccupCh =
CanvasConfig(format(
"{}/tof_rpc_occup_ch",
GetTaskName()),
"RPC hit occupancy vs. channel", 1, 1);
45 for (
size_t iRpc = 0; iRpc < nRpcs; ++iRpc) {
47 int nCh = rpcPar.chAddresses.size();
48 auto sDN = format(
"{:#010x}", rpcPar.address);
57 format(
"RPC {};channel;counts", sDT), nCh, -0.5, nCh - 0.5);
61 pad.SetLog(
false,
true,
false);
62 cOccupX.AddPadConfig(pad);
66 pad.SetLog(
false,
true,
false);
67 cOccupY.AddPadConfig(pad);
71 pad.SetLog(
false,
true,
false);
72 cOccupCh.AddPadConfig(pad);
80catch (
const std::exception& err) {
81 L_(fatal) <<
"tof::HitfindQa: initialization failed. Reason: " << err.what();
82 throw std::runtime_error(
"tof::HitfindQa initialization failure");
95 for (
size_t iH = 0; iH <
hits.size(); ++iH) {
96 const auto& hit =
hits[iH];
97 int32_t hitAddress = hit.address;
105 uint32_t iRpc = itAddress->second;
static vector< vector< QAHit > > hits
ROOT-free implementation of a histogram.
static int32_t GetModFullId(uint32_t address)
static std::string ToString(int32_t address)
static int32_t GetChannelId(uint32_t address)
A canvas configuration for the histogram server.
A pad configuration for the histogram server.
A QA module for the BMON hit-finder.
static constexpr double kHitOccupU
Hit occupancy: upper bound [cm].
std::vector< qa::H1D * > fvphRpcHitOccupX
Hit occupancy in RPC vs. x.
static constexpr double kHitOccupL
Hit occupancy: lower bound [cm].
void Exec()
Executes the task, fills the histograms.
HitfindQaParameters fParameters
Parameters of the hit finder QA.
std::vector< qa::H1D * > fvphRpcHitOccupCh
Hit occupancy in RPC vs. channel.
std::vector< qa::H1D * > fvphRpcHitOccupY
Hit occupancy in RPC vs. y.
void Init()
Initialized the task.
static constexpr int kHitOccupB
Hit occupancy: n bins.
const PartitionedVector< tof::Hit > * fpHits
Pointer to TOF hit sample.
std::unordered_map< uint32_t, uint32_t > lookupMap
A lookup map for RPC addresses.
std::vector< Rpc > rpcs
A map for different RPC properties.