forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBadChannelCalibrator.h
More file actions
85 lines (65 loc) · 2.99 KB
/
BadChannelCalibrator.h
File metadata and controls
85 lines (65 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file BadChannelCalibrator.h
/// \brief MCH calibrator to produce a bad channel map, using pedestal data
///
/// \author Andrea Ferrero, CEA-Saclay
#ifndef O2_MCH_CALIBRATION_BADCHANNEL_CALIBRATOR_H_
#define O2_MCH_CALIBRATION_BADCHANNEL_CALIBRATOR_H_
#include "DataFormatsMCH/DsChannelId.h"
#include "DetectorsCalibration/TimeSlot.h"
#include "DetectorsCalibration/TimeSlotCalibration.h"
#include "MCHCalibration/PedestalData.h"
#include "MCHCalibration/PedestalDigit.h"
#include <array>
namespace o2::mch::calibration
{
/**
* @class BadChannelCalibrator
* @brief Compute bad channel map from pedestal data
*
* Calibrator that checks the computed mean and RMS of the MCH pedestals
* and compares the values with (configurable) thresholds.
* The channels whose values exceed one of the thresholds are
* considered bad/noisy and they are stored into a
* "bad channels" list that is sent to the CDDB populator(s).
*/
class BadChannelCalibrator final : public o2::calibration::TimeSlotCalibration<o2::mch::calibration::PedestalData>
{
using TFType = o2::calibration::TFType;
using Slot = o2::calibration::TimeSlot<o2::mch::calibration::PedestalData>;
using BadChannelsVector = std::vector<o2::mch::DsChannelId>;
using PedestalsVector = std::vector<PedestalChannel>;
public:
BadChannelCalibrator() = default;
~BadChannelCalibrator() final = default;
/** Decides whether the Slot has enough data to compute the calibration.
* Decision depends both on the data itself and on the BadChannelCalibratorParam
* parameters.
*/
bool hasEnoughData(const Slot& slot) const final;
void initOutput() final;
void finalizeSlot(Slot& slot) final;
Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) final;
bool readyToSend(std::string& reason) const;
void finalize();
const BadChannelsVector& getBadChannelsVector() const { return mBadChannelsVector; }
const PedestalsVector& getPedestalsVector() const { return mPedestalsVector; }
void setLoggingInterval(int loggingInterval) { mLoggingInterval = loggingInterval; }
private:
TFType mTFStart;
BadChannelsVector mBadChannelsVector; ///< vector containing the unique IDs of the bad/noisy channels
PedestalsVector mPedestalsVector; ///< vector containing the source pedestal information used for bad channel decision
int mLoggingInterval = 0; ///< time interval between statistics logging messages
ClassDefOverride(BadChannelCalibrator, 2);
};
} // namespace o2::mch::calibration
#endif