16#include <fairlogger/Logger.h>
28 gsl::span<const unsigned char>
const& patterns,
29 gsl::span<const o2::itsmft::ROFRecord>
const& rofs)
32 LOG(detail) <<
"Processing TF# " << nTF;
35 auto& noiseMap = *(slotTF.getContainer());
37 auto pattIt = patterns.begin();
38 for (
const auto& rof : rofs) {
39 auto clustersInFrame = rof.getROFData(
clusters);
40 for (
const auto&
c : clustersInFrame) {
41 auto pattID =
c.getPatternID();
43 auto row =
c.getRow();
44 auto col =
c.getCol();
49 LOG(fatal) <<
"Clusters contain pattern IDs, but no dictionary is provided...";
53 }
else if (mDict.
isGroup(pattID)) {
55 float xCOG = 0., zCOG = 0.;
62 auto id =
c.getSensorID();
67 if ((rowSpan == 1) && (colSpan == 1)) {
68 noiseMap.increaseNoiseCount(
id,
row,
col);
76 auto nBits = rowSpan * colSpan;
79 unsigned char tempChar = patt.
getByte(
i);
82 if ((tempChar & s) != 0) {
83 noiseMap.increaseNoiseCount(
id,
row +
ir,
col + ic);
87 if ((
ir + 1) * ic == nBits) {
95 if ((
ir + 1) * ic == nBits) {
102 noiseMap.addStrobes(rofs.size());
103 mNumberOfStrobes += rofs.size();
110 LOG(warning) <<
"Only 1-pix noise calibraton is possible !";
119 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
120 slot.setContainer(std::make_unique<o2::itsmft::NoiseMap>(24120));
126 return slot.
getContainer()->getNumberOfStrobes() > mMinROFs ? true :
false;
Slot & getSlotForTF(TFType tf)
bool process(const DATA &... data)
const Container * getContainer() const
bool processTimeFrame(gsl::span< const o2::itsmft::CompClusterExt > const &clusters, gsl::span< const unsigned char > const &patterns, gsl::span< const o2::itsmft::ROFRecord > const &rofs)
bool process(const gsl::span< const o2::itsmft::CompClusterExt > data)
bool hasEnoughData(const Slot &slot) const final
Slot & emplaceNewSlot(bool, calibration::TFType, calibration::TFType) final
void finalizeSlot(Slot &slot) final
int getRowSpan() const
Returns the number of rows.
void acquirePattern(iterator &pattIt)
int getColumnSpan() const
Returns the number of columns.
static int getCOG(int rowSpan, int colSpan, const unsigned char patt[MaxPatternBytes], float &xCOG, float &zCOG)
Static: Compute pattern's COG position. Returns the number of fired pixels.
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)
int getSize() const
Returns the number of elements in the dicionary;.
const ClusterPattern & getPattern(int n) const
Returns the pattern of the topology.
bool isGroup(int n) const
Returns true if the element corresponds to a group of rare topologies.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)
std::vector< Cluster > clusters