Project
Loading...
Searching...
No Matches
testCaloRawFitterError.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#define BOOST_TEST_MODULE Test EMCAL Reconstruction
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16#include <array>
18
19namespace o2
20{
21namespace emcal
22{
23
24BOOST_AUTO_TEST_CASE(CaloRawFitterError_test)
25{
27 std::array<std::string, 5> errornames = {{"SampleUninitalized",
28 "NoConvergence",
29 "Chi2Error",
30 "BunchRejected",
31 "LowSignal"}},
32 errortitles = {{"sample uninitalized",
33 "No convergence",
34 "Chi2 error",
35 "Bunch rejected",
36 "Low signal"}},
37 errordescriptions = {{"Sample for fit not initialzied or bunch length is 0",
38 "Fit of the raw bunch was not successful",
39 "Chi2 of the fit could not be determined",
40 "Calo bunch could not be selected",
41 "No ADC value above threshold found"}};
42 std::array<CaloRawFitter::RawFitterError_t, 5> errortypes = {{CaloRawFitter::RawFitterError_t::SAMPLE_UNINITIALIZED,
47 for (int errortype = 0; errortype < CaloRawFitter::getNumberOfErrorTypes(); errortype++) {
48 BOOST_CHECK_EQUAL(CaloRawFitter::getErrorNumber(errortypes[errortype]), errortype);
49 BOOST_CHECK_EQUAL(CaloRawFitter::intToErrorType(errortype), errortypes[errortype]);
50 BOOST_CHECK_EQUAL(std::string(CaloRawFitter::getErrorTypeName(errortype)), errornames[errortype]);
51 BOOST_CHECK_EQUAL(std::string(CaloRawFitter::getErrorTypeName(errortypes[errortype])), errornames[errortype]);
52 BOOST_CHECK_EQUAL(std::string(CaloRawFitter::getErrorTypeTitle(errortype)), errortitles[errortype]);
53 BOOST_CHECK_EQUAL(std::string(CaloRawFitter::getErrorTypeTitle(errortypes[errortype])), errortitles[errortype]);
54 BOOST_CHECK_EQUAL(std::string(CaloRawFitter::getErrorTypeDescription(errortype)), errordescriptions[errortype]);
55 BOOST_CHECK_EQUAL(std::string(CaloRawFitter::getErrorTypeDescription(errortypes[errortype])), errordescriptions[errortype]);
56 }
57}
58
59} // namespace emcal
60} // namespace o2
static constexpr int getNumberOfErrorTypes() noexcept
Get the number of raw fit error types supported.
static const char * getErrorTypeTitle(RawFitterError_t fiterror)
Get the title connected to the fit error type.
static int getErrorNumber(RawFitterError_t fiterror)
Convert error type to numeric representation.
static const char * getErrorTypeDescription(RawFitterError_t fiterror)
Get the description connected to the fit error type.
@ LOW_SIGNAL
No ADC value above threshold found.
@ SAMPLE_UNINITIALIZED
Samples not initialized or length is 0.
@ CHI2_ERROR
Chi2 cannot be determined (usually due to insufficient amount of samples)
static const char * getErrorTypeName(RawFitterError_t fiterror)
Get the name connected to the fit error type.
static RawFitterError_t intToErrorType(unsigned int fiterror)
Convert numeric representation of error type to RawFitterError_t.
BOOST_AUTO_TEST_CASE(asynch_schedule_test)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())