Project
Loading...
Searching...
No Matches
NoiseSlotCalibrator.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_NOISESLOTCALIBRATOR
15#define O2_ITS_NOISESLOTCALIBRATOR
16
17#include <string>
18
22
25#include "gsl/span"
26
27namespace o2
28{
29
30namespace itsmft
31{
32class ROFRecord;
33} // namespace itsmft
34
35namespace its
36{
37
38class NoiseSlotCalibrator final : public o2::calibration::TimeSlotCalibration<o2::itsmft::NoiseMap>
39{
41
42 public:
44 NoiseSlotCalibrator(bool one, float prob, float relErr) : m1pix(one), mProbabilityThreshold(prob), mProbRelErr(relErr)
45 {
46 mMinROFs = 1.1 * o2::itsmft::NoiseMap::getMinROFs(prob, relErr);
47 LOGP(info, "Expect at least {} ROFs needed to apply threshold {} with relative error {}", mMinROFs, mProbabilityThreshold, mProbRelErr);
49 }
50 ~NoiseSlotCalibrator() final = default;
51
52 bool processTimeFrame(gsl::span<const o2::itsmft::CompClusterExt> const& clusters,
53 gsl::span<const unsigned char> const& patterns,
54 gsl::span<const o2::itsmft::ROFRecord> const& rofs);
55
56 void setMinROFs(long n) { mMinROFs = n; }
57
58 void finalize()
59 {
60 LOG(info) << "Number of processed strobes is " << mNumberOfStrobes;
61 auto& slot = getSlots().back();
62 slot.getContainer()->applyProbThreshold(mProbabilityThreshold, mNumberOfStrobes);
63 }
64
65 void loadDictionary(std::string fname)
66 {
67 mDict.readFromFile(fname);
68 }
70 {
71 const auto& slot = getSlots().back();
72 start = slot.getTFStart();
73 end = slot.getTFEnd();
74 return *(slot.getContainer());
75 }
76
77 // Functions overloaded from the calibration framework
78 bool process(const gsl::span<const o2::itsmft::CompClusterExt> data);
79
80 // Functions required by the calibration framework
81 void initOutput() final {}
83 void finalizeSlot(Slot& slot) final;
84 bool hasEnoughData(const Slot& slot) const final;
85
86 private:
88 float mProbabilityThreshold = 3e-6f;
89 float mProbRelErr = 0.2; // relative error on channel noise to apply the threshold
90 long mMinROFs = 0;
91 unsigned int mNumberOfStrobes = 0;
92 bool m1pix = true;
93};
94
95} // namespace its
96} // namespace o2
97
98#endif /* O2_ITS_NOISESLOTCALIBRATOR */
Definition of the ITSMFT compact cluster.
Definition of the ClusterTopology class.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
Definition of the ITSMFT NoiseMap.
uint32_t one
Definition RawData.h:4
const o2::itsmft::NoiseMap & getNoiseMap(long &start, long &end)
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)
~NoiseSlotCalibrator() final=default
NoiseSlotCalibrator(bool one, float prob, float relErr)
bool hasEnoughData(const Slot &slot) const final
Slot & emplaceNewSlot(bool, calibration::TFType, calibration::TFType) final
void finalizeSlot(Slot &slot) final
void loadDictionary(std::string fname)
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
static long getMinROFs(float t, float relErr)
Definition NoiseMap.h:197
int readFromFile(const std::string &fileName)
GLdouble n
Definition glcorearb.h:1982
GLuint GLuint end
Definition glcorearb.h:469
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< Cluster > clusters