Belle II Software  release-08-01-10
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 <Eigen/Core>
11 #include <gtest/gtest.h>
12 
13 #include "analysis/VertexFitting/TreeFitter/FitParams.h"
14 
15 namespace {
16 
18  class TreeFitterFitparTest : public ::testing::Test {
19  protected:
20  };
21 
22  TEST_F(TreeFitterFitparTest, Constructor)
23  {
24  TreeFitter::FitParams fitParDim3(3);
25 
27  EXPECT_FALSE(fitParDim3.getStateVector().array().any()) << "statevector not initialised to 0,0,...";
28 
30  EXPECT_FALSE(fitParDim3.getCovariance().array().any()) << "covariance not initialised to 0";
31  }
32 
34  TEST_F(TreeFitterFitparTest, Functions)
35  {
36  TreeFitter::FitParams fitParDim3(3);
37 
38  // cppcheck-suppress constStatement
39  fitParDim3.getStateVector() << 1, 2, 3;
40  fitParDim3.resetStateVector();
41  EXPECT_FALSE(fitParDim3.getStateVector().array().any()) << "fitParDim3.resetStateVector() didn't work";
42 
43  // cppcheck-suppress constStatement
44  fitParDim3.getCovariance() << 1, 2, 3, 4, 5, 6, 7, 8, 9;
45  fitParDim3.resetCovariance();
46  EXPECT_FALSE(fitParDim3.getCovariance().array().any()) << "fitParDim3.resetCovariance() didn't work";
47 
48  EXPECT_FALSE(fitParDim3.testCovariance()) << "fitParDim3.testCovariance() failed";
49 
50 
51  }
52 
53 } // namespace
Class to store and manage fitparams (statevector)
Definition: FitParams.h:20
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Definition: globalLabel.cc:72