1#ifndef TRACKING_RECO_TRACKERPEDESTALS_H_
2#define TRACKING_RECO_TRACKERPEDESTALS_H_
8#include <unordered_map>
11#include "Tracking/Reco/SiStripChannelMap.h"
13namespace tracking::reco {
35 std::array<float, channelmap::K_SAMPLES_PER_APV_TRIGGER> mean_{};
36 std::array<float, channelmap::K_SAMPLES_PER_APV_TRIGGER> noise_{};
42 void add(uint8_t feb, uint8_t hybrid, uint8_t apv, uint8_t channel,
49 uint8_t channel)
const {
51 return it == channels_.end() ? nullptr : &it->second;
56 float noise(uint8_t feb, uint8_t hybrid, uint8_t apv, uint8_t channel)
const {
60 std::accumulate(c->noise_.begin(), c->noise_.end(), 0.f);
61 return sum /
static_cast<float>(c->noise_.size());
65 std::size_t
size()
const {
return channels_.size(); }
68 std::unordered_map<uint32_t, Channel> channels_;
Base class for conditions information like pedestals, gains, electronics maps, etc.
Base class for all conditions objects, very simple.
ConditionsObject(const std::string &name)
Class constructor.
Per-channel tracker pedestal conditions: the per-sample pedestal mean and RMS noise for every silicon...
void add(uint8_t feb, uint8_t hybrid, uint8_t apv, uint8_t channel, const Channel &ped)
Insert the pedestal for one electronics channel.
std::size_t size() const
Number of channels in the table.
const Channel * find(uint8_t feb, uint8_t hybrid, uint8_t apv, uint8_t channel) const
Look up a channel; returns nullptr if the channel is not in the table.
static const std::string CONDITIONS_NAME
Name of the conditions object (must match the python registration).
float noise(uint8_t feb, uint8_t hybrid, uint8_t apv, uint8_t channel) const
Scalar per-channel noise (mean of the three per-sample noises); 0 if the channel is absent.
All classes in the ldmx-sw project use this namespace.
constexpr uint32_t channelId(uint8_t feb, uint8_t hybrid, uint8_t apv, uint8_t channel)
Pack the full electronics address (feb, hybrid, apv, channel) into a single 32-bit id,...
Per-channel pedestal mean and RMS noise for the three APV25 samples.