16#include <fairlogger/Logger.h>
24using Slot = calibration::TimeSlot<o2::itsmft::NoiseMap>;
29 gsl::span<const o2::itsmft::Digit>
const&
digits,
30 gsl::span<const o2::itsmft::ROFRecord>
const& rofs)
32 LOG(detail) <<
"Processing TF# " << nTF;
35 auto& noiseMap = *(slotTF.getContainer());
37 for (
const auto& rof : rofs) {
38 auto digitsInFrame = rof.getROFData(
digits);
39 for (
const auto& d : digitsInFrame) {
40 auto id = d.getChipIndex();
41 auto row = d.getRow();
42 auto col = d.getColumn();
44 noiseMap.increaseNoiseCount(
id,
row,
col);
47 noiseMap.addStrobes(rofs.size());
48 mNumberOfStrobes += rofs.size();
53 gsl::span<const o2::itsmft::CompClusterExt>
const&
clusters,
54 gsl::span<const unsigned char>
const& patterns,
55 gsl::span<const o2::itsmft::ROFRecord>
const& rofs)
57 LOG(detail) <<
"Processing TF# " << nTF;
60 auto& noiseMap = *(slotTF.getContainer());
62 auto pattIt = patterns.begin();
63 for (
const auto& rof : rofs) {
64 auto clustersInFrame = rof.getROFData(
clusters);
65 for (
const auto&
c : clustersInFrame) {
72 auto id =
c.getSensorID();
73 auto row =
c.getRow();
74 auto col =
c.getCol();
79 if ((rowSpan == 1) && (colSpan == 1)) {
80 noiseMap.increaseNoiseCount(
id,
row,
col);
85 auto nBits = rowSpan * colSpan;
88 unsigned char tempChar = patt.
getByte(
i);
91 if ((tempChar & s) != 0) {
92 noiseMap.increaseNoiseCount(
id,
row +
ir,
col + ic);
96 if ((
ir + 1) * ic == nBits) {
104 if ((
ir + 1) * ic == nBits) {
110 noiseMap.addStrobes(rofs.size());
111 mNumberOfStrobes += rofs.size();
118 LOG(warning) <<
"Only 1-pix noise calibraton is possible !";
127 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
128 slot.setContainer(std::make_unique<o2::itsmft::NoiseMap>(936));
134 return slot.
getContainer()->getNumberOfStrobes() > mMinROFs ? true :
false;
Slot & getSlotForTF(TFType tf)
bool process(const DATA &... data)
const Container * getContainer() const
int getRowSpan() const
Returns the number of rows.
int getColumnSpan() const
Returns the number of columns.
unsigned char getByte(int n) const
Returns a specific byte of the pattern.
int getUsedBytes() const
Returns the number of bytes used for the pattern.
static constexpr unsigned short InvalidPatternID
NoiseMap class for the ITS and MFT.
long getNumberOfStrobes() const
void applyProbThreshold(float t, long int n, float relErr=0.2f, int minChipID=0, int maxChipID=24119)
bool process(calibration::TFType tf, const gsl::span< const o2::itsmft::CompClusterExt > data) final
void finalizeSlot(Slot &slot) final
Slot & emplaceNewSlot(bool, calibration::TFType, calibration::TFType) final
bool processTimeFrame(calibration::TFType tf, gsl::span< const o2::itsmft::Digit > const &digits, gsl::span< const o2::itsmft::ROFRecord > const &rofs)
bool hasEnoughData(const Slot &slot) const final
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)
std::vector< Cluster > clusters
std::vector< Digit > digits