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 <fmt/format.h>
16#include <iostream>
17
19
20{
21double PedestalChannel::getRms() const
22{
23 return mEntries > 0 ? std::sqrt(mVariance / mEntries) : std::numeric_limits<double>::max();
24}
25
26bool PedestalChannel::isValid() const
27{
28 return dsChannelId.isValid();
29}
30
31std::string PedestalChannel::asString() const
32{
33 return fmt::format("{} entries {:8d} mean {:7.2f} mVariance {:7.2f} rms {:7.2f}",
35}
36
37std::ostream& operator<<(std::ostream& os, const PedestalChannel& c)
38{
39 os << c.asString();
40 return os;
41}
42
43} // 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