Project
Loading...
Searching...
No Matches
SanityCheck.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
12#include "MCHBase/SanityCheck.h"
13#include <fmt/core.h>
14
15namespace o2::mch
16{
17
18bool isOK(const SanityError& error)
19{
20 return error.nofDuplicatedIndices == 0 &&
21 error.nofDuplicatedItems == 0 &&
22 error.nofMissingItems == 0 &&
23 error.nofOutOfBounds == 0;
24}
25
26std::string asString(const SanityError& error)
27{
28 return fmt::format("error counts : {} duplicated items {} missing items {} out-of-bounds index {} duplicated index", error.nofDuplicatedItems, error.nofMissingItems, error.nofOutOfBounds, error.nofDuplicatedIndices);
29}
30
31} // namespace o2::mch
std::string asString(const o2::mch::TrackMCH &t)
Definition TrackMCH.cxx:104
bool isOK(const SanityError &error)
uint32_t nofDuplicatedItems
Definition SanityCheck.h:38
uint32_t nofDuplicatedIndices
Definition SanityCheck.h:39