Project
Loading...
Searching...
No Matches
NoiseCalibrator.h
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
14#ifndef O2_ITS_NOISECALIBRATOR
15#define O2_ITS_NOISECALIBRATOR
16
17#include <string>
22#include "gsl/span"
23
24namespace o2
25{
26
27namespace itsmft
28{
29class CompClusterExt;
30class ROFRecord;
31} // namespace itsmft
32
33namespace its
34{
35
37{
38 public:
40
41 NoiseCalibrator() = default;
42 NoiseCalibrator(bool one, float prob, float relErr = 0.2) : m1pix(one), mProbabilityThreshold(prob), mProbRelErr(relErr)
43 {
44 mMinROFs = 1.1 * o2::itsmft::NoiseMap::getMinROFs(prob, relErr);
45 LOGP(info, "Expect at least {} ROFs needed to apply threshold {} with relative error {}", mMinROFs, mProbabilityThreshold, mProbRelErr);
46 }
47 ~NoiseCalibrator() = default;
48
49 bool processTimeFrameClusters(gsl::span<const o2::itsmft::CompClusterExt> const& clusters,
50 gsl::span<const unsigned char> const& patterns,
51 gsl::span<const o2::itsmft::ROFRecord> const& rofs);
52
53 bool processTimeFrameDigits(gsl::span<const o2::itsmft::Digit> const& digits,
54 gsl::span<const o2::itsmft::ROFRecord> const& rofs);
55
56 void addMap(const o2::itsmft::NoiseMap& extMap);
57
58 void finalize(float cutIB = -1.);
59
60 void setNThreads(int n) { mNThreads = n > 0 ? n : 1; }
61
62 void setMinROFs(long n) { mMinROFs = n; }
63 long getMinROFs() const { return mMinROFs; }
64
66
67 const o2::itsmft::NoiseMap& getNoiseMap() const { return mNoiseMap; }
68
69 void setInstanceID(int i) { mInstanceID = i; }
70 void setNInstances(int n) { mNInstances = n; }
71 auto getInstanceID() const { return mInstanceID; }
72 auto getNInstances() const { return mNInstances; }
73 auto getNStrobes() const { return mNumberOfStrobes; }
74 auto setNStrobes(unsigned int s) { mNumberOfStrobes = s; }
75
76 void reset();
77
78 private:
79 const o2::itsmft::TopologyDictionary* mDict = nullptr;
81 float mProbabilityThreshold = 3e-6f;
82 float mProbRelErr = 0.2; // relative error on channel noise to apply the threshold
83 long mMinROFs = 0;
84 unsigned int mNumberOfStrobes = 0;
85 bool m1pix = true;
86 int mNThreads = 1;
87 int mInstanceID = 0; // pipeline instance
88 int mNInstances = 1; // total number of pipelines
89 std::vector<int> mChipIDs;
90 std::array<std::vector<int>, NChips> mChipHits;
91};
92
93} // namespace its
94} // namespace o2
95
96#endif /* O2_ITS_NOISECALIBRATOR */
Definition of the ClusterTopology class.
int32_t i
Definition of the ITSMFT NoiseMap.
Transient data classes for single pixel and set of pixels from current chip.
uint32_t one
Definition RawData.h:4
static constexpr int NChips
bool processTimeFrameDigits(gsl::span< const o2::itsmft::Digit > const &digits, gsl::span< const o2::itsmft::ROFRecord > const &rofs)
NoiseCalibrator(bool one, float prob, float relErr=0.2)
void addMap(const o2::itsmft::NoiseMap &extMap)
void setClusterDictionary(const o2::itsmft::TopologyDictionary *d)
auto setNStrobes(unsigned int s)
const o2::itsmft::NoiseMap & getNoiseMap() const
bool processTimeFrameClusters(gsl::span< const o2::itsmft::CompClusterExt > const &clusters, gsl::span< const unsigned char > const &patterns, gsl::span< const o2::itsmft::ROFRecord > const &rofs)
void finalize(float cutIB=-1.)
static constexpr int getNChips()
number of chips per barrel
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
static long getMinROFs(float t, float relErr)
Definition NoiseMap.h:197
GLdouble n
Definition glcorearb.h:1982
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Cluster > clusters
std::vector< Digit > digits