Belle II Software development
test_Fitparams.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <gtest/gtest.h>
11
12#include <analysis/VertexFitting/TreeFitter/FitParams.h>
13
14namespace {
15
17 class TreeFitterFitparTest : public ::testing::Test {
18 protected:
19 };
20
21 TEST_F(TreeFitterFitparTest, Constructor)
22 {
23 TreeFitter::FitParams fitParDim3(3);
24
26 EXPECT_FALSE(fitParDim3.getStateVector().array().any()) << "statevector not initialised to 0,0,...";
27
29 EXPECT_FALSE(fitParDim3.getCovariance().array().any()) << "covariance not initialised to 0";
30 }
31
33 TEST_F(TreeFitterFitparTest, Functions)
34 {
35 TreeFitter::FitParams fitParDim3(3);
36
37 // cppcheck-suppress constStatement
38 fitParDim3.getStateVector() << 1, 2, 3;
39 fitParDim3.resetStateVector();
40 EXPECT_FALSE(fitParDim3.getStateVector().array().any()) << "fitParDim3.resetStateVector() didn't work";
41
42 // cppcheck-suppress constStatement
43 fitParDim3.getCovariance() << 1, 2, 3, 4, 5, 6, 7, 8, 9;
44 fitParDim3.resetCovariance();
45 EXPECT_FALSE(fitParDim3.getCovariance().array().any()) << "fitParDim3.resetCovariance() didn't work";
46
47 EXPECT_FALSE(fitParDim3.testCovariance()) << "fitParDim3.testCovariance() failed";
48
49
50 }
51
52} // namespace
Class to store and manage fitparams (statevector)
Definition FitParams.h:20