12#ifndef ALICEO2_TRK_CHIPDIGITSCONTAINER_
13#define ALICEO2_TRK_CHIPDIGITSCONTAINER_
21#include <fairlogger/Logger.h>
54 return (
static_cast<ULong64_t
>(roframe) << (8 *
sizeof(UInt_t))) + (
static_cast<ULong64_t
>(
col) << (8 *
sizeof(Short_t))) +
row;
65 std::map<ULong64_t, o2::trkft3::PreDigit>
mDigits;
75 return digitentry !=
mDigits.end() ? &(digitentry->second) :
nullptr;
99 maxRows = o2::trk::constants::VD::petal::layer::nRows[
layer];
100 maxCols = o2::trk::constants::VD::petal::layer::nCols;
105 mean =
params->getNoisePerPixel() * maxRows * maxCols;
106 nel =
static_cast<int>(
params->getChargeThreshold() * 1.1);
108 LOG(
debug) <<
"Adding noise for chip " << mChipIndex <<
" with mean " << mean <<
" and charge " << nel;
110 for (UInt_t rof = rofMin; rof <= rofMax; rof++) {
111 nhits = gRandom->Poisson(mean);
112 for (Int_t
i = 0;
i < nhits; ++
i) {
113 row = gRandom->Integer(maxRows);
114 col = gRandom->Integer(maxCols);
115 LOG(
debug) <<
"Generated noise hit at ROF " << rof <<
", row " <<
row <<
", col " <<
col;
116 if (mNoiseMap && mNoiseMap->isNoisy(mChipIndex,
row,
col)) {
119 if (mDeadChanMap && mDeadChanMap->isNoisy(mChipIndex,
row,
col)) {
122 auto key = getOrderingKey(rof,
row,
col);
123 if (!findDigit(
key)) {
Simulation parameters for the TRK digitizer. Based on the ITS2 and ITS3 digitizer parameters.
Definition of the ITSMFT NoiseMap.
Definition of the SegmentationChipclass.
Definition of the digit contribution from single hit for TRK/FT3 (based on o2::itsmft::PreDigit,...
NoiseMap class for the ITS and MFT.
Container for simulated points connected to a given chip.
void addDigit(ULong64_t key, UInt_t roframe, UShort_t row, UShort_t col, int charge, o2::MCCompLabel lbl, float toa=0.f)
const o2::itsmft::NoiseMap * mNoiseMap
std::map< ULong64_t, o2::trkft3::PreDigit > mDigits
Map of fired pixels, possibly in multiple frames.
void setNoiseMap(const o2::itsmft::NoiseMap *mp)
void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::trkft3::DigiParams< DetID > *params, int subDetID, int layer)
std::map< ULong64_t, o2::trkft3::PreDigit > & getPreDigits()
UShort_t mChipIndex
chip index
const o2::itsmft::NoiseMap * mDeadChanMap
UShort_t getChipIndex() const
void setDeadChanMap(const o2::itsmft::NoiseMap *mp)
void setChipIndex(UShort_t ind)
ClassDefNV(ChipDigitsContainer, 2)
static ULong64_t getOrderingKey(UInt_t roframe, UShort_t row, UShort_t col)
Get global ordering key made of readout frame, column and row.
~ChipDigitsContainer()=default
Destructor.
o2::trkft3::PreDigit * findDigit(ULong64_t key)
GLenum const GLfloat * params
GLenum GLuint GLint GLint layer
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"