Project
Loading...
Searching...
No Matches
PedestalChannel.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#include <cmath>
14#include <fmt/core.h>
15#include <iostream>
16
18
19{
20double PedestalChannel::getRms() const
21{
22 return mEntries > 0 ? std::sqrt(mVariance / mEntries) : std::numeric_limits<double>::max();
23}
24
25bool PedestalChannel::isValid() const
26{
27 return dsChannelId.isValid();
28}
29
30std::string PedestalChannel::asString() const
31{
32 return fmt::format("{} entries {:8d} mean {:7.2f} mVariance {:7.2f} rms {:7.2f}",
34}
35
36std::ostream& operator<<(std::ostream& os, const PedestalChannel& c)
37{
38 os << c.asString();
39 return os;
40}
41
42} // namespace o2::mch::calibration
uint32_t c
Definition RawData.h:2
std::string asString() const
bool isValid() const
Definition DsChannelId.h:57
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)
Pedestal mean and sigma for one channel.
int mEntries
number of entries used so far for the mean and variance
DsChannelId dsChannelId
identifier of the channel