Project
Loading...
Searching...
No Matches
ChipDigitsContainer.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14using namespace o2::trk;
15
18
19//______________________________________________________________________
20void ChipDigitsContainer::addNoise(UInt_t rofMin, UInt_t rofMax, const o2::trk::DigiParams* params, int subDetID, int layer)
21{
22 UInt_t row = 0;
23 UInt_t col = 0;
24 Int_t nhits = 0;
25 constexpr float ns2sec = 1e-9;
26 float mean = 0.f;
27 int nel = 0;
28 int maxRows = 0;
29 int maxCols = 0;
30
31 // TODO: set different noise and threshold for VD and MLOT
32 if (subDetID == 0) { // VD
33 maxRows = constants::VD::petal::layer::nRows[layer]; // TODO: get the layer from the geometry
34 maxCols = constants::VD::petal::layer::nCols;
35 mean = params->getNoisePerPixel() * maxRows * maxCols;
36 nel = static_cast<int>(params->getChargeThreshold() * 1.1);
37 } else { // ML/OT
40 mean = params->getNoisePerPixel() * maxRows * maxCols;
41 nel = static_cast<int>(params->getChargeThreshold() * 1.1);
42 }
43
44 LOG(debug) << "Adding noise for chip " << mChipIndex << " with mean " << mean << " and charge " << nel;
45
46 for (UInt_t rof = rofMin; rof <= rofMax; rof++) {
47 nhits = gRandom->Poisson(mean);
48 for (Int_t i = 0; i < nhits; ++i) {
49 row = gRandom->Integer(maxRows);
50 col = gRandom->Integer(maxCols);
51 LOG(debug) << "Generated noise hit at ROF " << rof << ", row " << row << ", col " << col;
53 continue;
54 }
56 continue;
57 }
58 auto key = getOrderingKey(rof, row, col);
59 if (!findDigit(key)) {
60 addDigit(key, rof, row, col, nel, o2::MCCompLabel(true));
61 }
62 }
63 }
64}
std::ostringstream debug
int32_t i
uint32_t col
Definition RawData.h:4
StringRef key
void addDigit(ULong64_t key, UInt_t roframe, UShort_t row, UShort_t col, int charge, o2::MCCompLabel lbl)
const o2::itsmft::NoiseMap * mNoiseMap
o2::itsmft::PreDigit * findDigit(ULong64_t key)
const o2::itsmft::NoiseMap * mDeadChanMap
bool isNoisy(int chip, int row, int col) const
Definition NoiseMap.h:151
static ULong64_t getOrderingKey(UInt_t roframe, UShort_t row, UShort_t col)
Get global ordering key made of readout frame, column and row.
void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::itsmft::DigiParams *params, int maxRows=o2::itsmft::SegmentationAlpide::NRows, int maxCols=o2::itsmft::SegmentationAlpide::NCols)=delete
Adds noise digits, deleted the one using the itsmft::DigiParams interface.
GLenum const GLfloat * params
Definition glcorearb.h:272
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< int > row